:root {
  --ink: #172033;
  --muted: #657084;
  --line: #e4e8ee;
  --canvas: #f5f7fb;
  --surface: #ffffff;
  --brand: #d64545;
  --brand-dark: #b92f36;
  --shadow: 0 18px 48px rgba(24, 38, 66, .10);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button { font: inherit; }
.shell { min-height: 100vh; transition: filter .2s ease; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px max(28px, calc((100vw - 1120px) / 2)); background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; color: white; background: var(--brand); border-radius: 9px; font-size: 16px; }
.account { display: flex; align-items: center; gap: 13px; min-width: 0; }
.account-email { max-width: 300px; overflow: hidden; color: var(--muted); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.sign-out, .sign-in { border: 0; border-radius: 9px; cursor: pointer; font-weight: 650; }
.sign-out { padding: 9px 12px; color: var(--ink); background: #f0f2f6; }
.sign-out:hover { background: #e5e9f0; }
main { width: min(100% - 40px, 1120px); margin: 46px auto; }
.page-heading h1 { margin: 0; font-size: clamp(28px, 4vw, 36px); letter-spacing: -.04em; }
.page-heading p { margin: 10px 0 28px; color: var(--muted); }
.tabs { display: flex; gap: 8px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 14px; color: var(--muted); background: transparent; border: 0; border-radius: 8px; cursor: pointer; font-weight: 650; }
.tab:hover { background: #eceff5; color: var(--ink); }
.tab[aria-selected="true"] { color: var(--brand); background: #fce9e9; }
.panel { padding-top: 28px; }
.panel[hidden] { display: none; }
.panel-description { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.panel-description code { padding: 2px 5px; color: #a52b34; background: #fce9e9; border-radius: 5px; font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 13px; }
.card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; min-width: 540px; border-collapse: collapse; text-align: left; }
.data-table th { padding: 0 16px 12px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.data-table th:first-child, .data-table td:first-child { padding-left: 0; }
.sort-button { padding: 0; color: inherit; background: transparent; border: 0; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.sort-button:hover { color: var(--ink); }
.sort-button[data-direction="asc"]::after { content: " ▲"; }
.sort-button[data-direction="desc"]::after { content: " ▼"; }
.data-table td { padding: 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.data-table td code { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 13px; }
.email { overflow-wrap: anywhere; font-size: 15px; font-weight: 600; }
.badge { padding: 5px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.badge.allow { color: #1e7a3c; background: #e3f4e8; }
.badge.deny { color: #a52b34; background: #fce9e9; }
.badge.admin { color: #5b32c7; background: #efe9fb; }
.badge.leader { color: #1d5fbf; background: #e5effb; }
.badge.user { color: #657084; background: #f0f2f6; }
.member-list { margin: 0; padding-left: 0; font-size: 14px; line-height: 1.8; list-style: none; }
.empty-row { padding: 22px 0; color: var(--muted); text-align: center; }
.api-test-form { margin-top: 18px; }
.request-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: stretch; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; }
.method-select { padding: 13px 10px 13px 14px; color: var(--ink); background: #f0f2f6; border: 0; border-right: 1px solid var(--line); outline: none; cursor: pointer; font: inherit; font-weight: 650; }
.request-row input { min-width: 0; padding: 13px 14px; color: var(--ink); background: transparent; border: 0; outline: none; font: inherit; }
.request-row input:focus { box-shadow: inset 0 0 0 2px rgba(214, 69, 69, .25); }
.send-button { padding: 0 18px; color: white; background: var(--brand); border: 0; cursor: pointer; font-weight: 750; }
.send-button:hover { background: var(--brand-dark); }
.send-button:disabled { cursor: wait; opacity: .65; }
.body-textarea { width: 100%; min-height: 120px; margin-top: 12px; padding: 13px 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; outline: none; font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 13px; line-height: 1.6; resize: vertical; }
.body-textarea:focus { box-shadow: inset 0 0 0 2px rgba(214, 69, 69, .25); }
.result-meta { min-height: 22px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.result-box { min-height: 220px; margin: 8px 0 0; padding: 16px; overflow: auto; color: #f7f7fb; background: #172033; border-radius: 12px; font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.loading-overlay { position: fixed; z-index: 9; inset: 0; display: grid; place-items: center; background: var(--canvas); }
.loading-overlay[hidden] { display: none; }
.loading-dialog { color: var(--muted); text-align: center; font-size: 14px; }
.loading-spinner { width: 36px; height: 36px; margin: 0 auto 14px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-overlay { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(245, 247, 251, .55); backdrop-filter: blur(9px); }
.auth-overlay[hidden] { display: none; }
.auth-dialog { width: min(100%, 410px); padding: 32px; background: rgba(255, 255, 255, .94); border: 1px solid rgba(255, 255, 255, .85); border-radius: 16px; box-shadow: 0 24px 70px rgba(23, 32, 51, .18); text-align: center; }
.auth-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 16px; background: #fce9e9; border-radius: 14px; font-size: 24px; }
.auth-dialog h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.auth-dialog p { margin: 10px 0 22px; color: var(--muted); line-height: 1.6; font-size: 14px; }
.sign-in { width: 100%; padding: 12px 16px; color: white; background: var(--brand); box-shadow: 0 7px 16px rgba(214, 69, 69, .25); }
.sign-in:hover { background: var(--brand-dark); }
.sign-in:disabled { cursor: wait; opacity: .65; }
.auth-error { min-height: 20px; margin: 14px 0 0; color: #c53140; font-size: 13px; }

@media (max-width: 600px) {
  .topbar { padding: 15px 20px; }
  .account-email { display: none; }
  main { width: min(100% - 32px, 1120px); margin-top: 32px; }
  .tabs { overflow-x: auto; }
  .tab { flex: 0 0 auto; }
  .card { padding: 18px; }
  .request-row { grid-template-columns: 1fr; }
  .method-select { border-right: 0; border-bottom: 1px solid var(--line); }
  .send-button { min-height: 44px; }
}
