:root {
  color-scheme: dark light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --bg: #07110f;
  --surface: #0d1713;
  --surface-2: #111d18;
  --surface-3: #17251f;
  --text: #f3f7f3;
  --muted: #92a099;
  --line: rgba(239, 246, 241, .12);
  --line-strong: rgba(200, 255, 77, .28);
  --acid: #c8ff4d;
  --acid-ink: #07110f;
  --success: #70d78d;
  --warning: #efc76e;
  --danger: #ff8c82;
  --focus: #c8ff4d;
  --shadow: 0 24px 80px rgba(0, 0, 0, .34);
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; background:
  radial-gradient(circle at 74% -8%, rgba(200,255,77,.07), transparent 30%),
  linear-gradient(180deg, var(--bg), #08120f 48%, var(--bg)); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
button:focus-visible, a:focus-visible, input:focus, select:focus, textarea:focus, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 72px; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: inherit; text-decoration: none; font-weight: 780; letter-spacing: -.025em; }
.brand-mark { width: 30px; height: 30px; display: block; border-radius: 8px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.docs-link { min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 700; }
.docs-link:hover { color: var(--text); }
.account-email, .hint, .fine-print { color: var(--muted); font-size: 12px; }

.loading-view { min-height: min(66vh, 560px); display: flex; align-items: center; justify-content: center; gap: 11px; color: var(--muted); }
.loading-spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--acid); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.state-view { max-width: 720px; padding: 110px 0; }
.state-view h1 { margin: 9px 0 17px; font-size: clamp(38px, 6vw, 64px); line-height: .99; letter-spacing: -.055em; }
.state-view p { max-width: 600px; margin: 0 0 26px; color: var(--muted); font-size: 16px; line-height: 1.65; }

.auth-view { padding: clamp(58px, 8vw, 106px) 0; }
.auth-layout { min-height: 590px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); gap: clamp(50px, 8vw, 110px); align-items: center; }
.auth-copy { min-width: 0; }
.auth-glyph { width: 46px; height: 46px; display: block; margin-bottom: 24px; }
.auth-glyph img { width: 46px; height: 46px; display: block; }
.eyebrow { color: var(--acid); font-size: 10px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.auth-view h1 { max-width: 690px; margin: 10px 0 18px; font-size: clamp(48px, 7vw, 82px); line-height: .93; letter-spacing: -.064em; font-weight: 700; }
.auth-view p { max-width: 650px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.62; }
.auth-options { width: min(100%, 380px); display: grid; gap: 9px; margin-top: 28px; }
.auth-view .fine-print { max-width: 570px; margin-top: 22px; font-size: 12px; line-height: 1.55; }
.auth-proof { position: relative; overflow: hidden; padding: 24px; border: 1px solid var(--line-strong); border-radius: 22px; background: linear-gradient(160deg, rgba(200,255,77,.075), rgba(255,255,255,.018) 55%); box-shadow: 0 26px 90px rgba(0,0,0,.22); }
.auth-proof::after { content: ""; position: absolute; width: 220px; height: 220px; right: -110px; top: -110px; border-radius: 50%; background: radial-gradient(circle, rgba(200,255,77,.14), transparent 70%); pointer-events: none; }
.proof-head { display: flex; align-items: center; gap: 8px; color: #dce8df; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.proof-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 16px rgba(200,255,77,.5); }
.proof-flow { display: grid; gap: 8px; margin: 26px 0 22px; }
.proof-flow > div { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 2px 10px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(5,12,9,.38); }
.proof-flow > div > span { grid-row: 1 / 3; color: var(--acid); font: 750 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.proof-flow strong { font-size: 13px; }
.proof-flow small { color: var(--muted); font-size: 10px; }
.auth-proof > a { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; color: #dbe5df; font-size: 12px; font-weight: 700; text-decoration: none; }
.auth-proof > a:hover { color: var(--acid); }

.button, .ghost, .text-button, .icon-button, .tab { border: 0; cursor: pointer; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border-radius: 11px; text-decoration: none; font-size: 13px; font-weight: 780; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary { background: var(--acid); color: var(--acid-ink); box-shadow: 0 10px 34px rgba(139,207,25,.08); }
.button.primary:hover:not(:disabled) { background: #d7ff78; }
.button.secondary { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.button.ghost, .ghost { border: 1px solid var(--line); background: transparent; color: var(--text); }
.ghost:not(.button) { min-height: 44px; padding: 0 12px; border-radius: 10px; }
.button.large { min-height: 50px; padding-inline: 20px; }
.button.compact { min-height: 44px; padding-inline: 12px; font-size: 12px; }
button:disabled { opacity: .42; cursor: not-allowed; transform: none !important; }

.pairing-banner { margin-top: 28px; display: flex; align-items: center; justify-content: space-between; gap: 26px; padding: 24px; border: 1px solid var(--line-strong); border-radius: 17px; background: linear-gradient(135deg, rgba(200,255,77,.13), rgba(200,255,77,.045)); }
.pairing-banner h1 { margin: 6px 0 8px; font-size: 25px; letter-spacing: -.035em; }
.pairing-banner p { margin: 0; color: #bbc6c0; }
.pairing-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.hero-row { padding: 38px 0 24px; display: flex; align-items: end; justify-content: space-between; gap: 32px; }
.hero-copy-with-glyph { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
.hero-product-glyph { width: 30px; height: 30px; flex: none; display: block; margin-top: 2px; opacity: .9; }
.hero-product-glyph img { width: 30px; height: 30px; display: block; }
.hero-row h1 { margin: 5px 0 7px; font-size: clamp(29px, 4vw, 42px); line-height: 1; letter-spacing: -.047em; }
.hero-row p, .section-heading p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 13px; }

.control-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 34px; align-items: start; padding-top: 18px; border-top: 1px solid var(--line); }
.tabs { position: sticky; top: 18px; display: grid; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: rgba(13,23,19,.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.tab { width: 100%; min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px; background: transparent; color: var(--muted); text-align: left; font-size: 12px; font-weight: 720; white-space: nowrap; }
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab.active { background: var(--acid); color: var(--acid-ink); }
.control-content { min-width: 0; }
.tab-panel { min-width: 0; padding: 8px 0 28px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin: 0 0 34px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.018); overflow: hidden; }
.metrics div { min-width: 0; padding: 19px 20px; border-right: 1px solid var(--line); }
.metrics div:last-child { border-right: 0; }
.metrics span { display: block; font-size: clamp(25px, 3vw, 34px); font-weight: 760; letter-spacing: -.045em; }
.metrics small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.metric-grid-six { grid-template-columns: repeat(3, minmax(0,1fr)); }
.metric-grid-six div:nth-child(3) { border-right: 0; }
.metric-grid-six div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 0 0 15px; }
.section-heading h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.025em; }
.metrics-window { width: 170px; color: var(--muted); font-size: 12px; }
.metrics-window select { min-height: 36px; margin-top: 4px; padding: 6px 9px; }
.rows { border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: rgba(255,255,255,.012); }
.row { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-primary { min-width: 0; display: flex; align-items: center; gap: 12px; }
.row-primary strong, .row-primary small { display: block; }
.row-primary strong { overflow-wrap: anywhere; font-size: 13px; }
.row-primary small, .row-meta small { margin-top: 4px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.row-meta { min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; text-align: right; }
.presence { width: 9px; height: 9px; flex: none; border-radius: 50%; background: #69736e; }
.presence.online { background: var(--success); box-shadow: 0 0 0 3px rgba(112,215,141,.10), 0 0 14px rgba(112,215,141,.18); }
.status-pill { min-height: 28px; display: inline-flex; align-items: center; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-pill.success { border-color: rgba(112,215,141,.18); background: rgba(112,215,141,.08); color: var(--success); }
.status-pill.warning { border-color: rgba(239,199,110,.20); background: rgba(239,199,110,.08); color: var(--warning); }
.status-pill.neutral { color: var(--muted); }
.muted { opacity: .52; }
.text-button { min-height: 44px; padding: 0 4px; background: transparent; color: #dce5df; text-decoration: underline; text-underline-offset: 3px; font-size: 12px; }
.danger-text { color: var(--danger); }
.approval-copy { margin: 8px 0 0; color: #c6d0ca; font-size: 12px; }
.approval-actions { display: flex; align-items: center; gap: 8px; }

.empty-state { min-height: 150px; display: flex; align-items: center; padding: 34px; color: var(--muted); }
.empty-detail { display: flex; align-items: flex-start; gap: 16px; max-width: 660px; }
.empty-mark { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: var(--acid); font-size: 18px; }
.empty-product-glyph { width: 42px; height: 42px; flex: none; display: grid; place-items: center; }
.empty-product-glyph picture, .empty-product-glyph img { width: 36px; height: 36px; display: block; }
.empty-detail strong { display: block; color: var(--text); font-size: 13px; }
.empty-detail p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.compact-empty { max-width: 520px; }
#key-setup-hint { margin: 0 0 12px; }

.setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.setup-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); overflow-wrap: anywhere; }
.setup-card h3 { margin: 7px 0 16px; font-size: 16px; }
.setup-card > code { display: block; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: #050a08; color: #dce8e0; }
.setup-card p { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

/* dialogs */
dialog { width: min(570px, calc(100% - 28px)); max-height: min(88vh, 760px); overflow: auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(2,7,5,.65); backdrop-filter: blur(4px); }
.dialog-body { display: grid; gap: 18px; padding: 24px; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.dialog-head h2 { margin: 5px 0 0; font-size: 24px; letter-spacing: -.035em; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 21px; }
label, legend { font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 44px; margin-top: 7px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: #09110e; color: var(--text); outline: none; }
textarea { resize: vertical; }
fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; }
legend { margin-bottom: 6px; }
.preset { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.preset:hover { border-color: var(--line-strong); }
.preset:has(input:checked) { border-color: rgba(200,255,77,.46); background: rgba(200,255,77,.055); }
.preset input { width: auto; min-height: 0; margin: 2px 0 0; }
.preset strong, .preset small { display: block; }
.preset small { margin-top: 3px; color: var(--muted); font-weight: 400; line-height: 1.35; }
.danger-preset strong { color: var(--danger); }
.inline-choice { display: flex; align-items: center; gap: 8px; }
.inline-choice input { width: auto; min-height: 0; margin: 0; }
.warning, .error { margin: 0; padding: 11px 12px; border-radius: 10px; font-size: 12px; }
.warning { border: 1px solid rgba(239,199,110,.22); background: rgba(239,199,110,.08); color: #f3d99f; }
.error { border: 1px solid rgba(255,140,130,.22); background: rgba(255,140,130,.08); color: #ffc1bb; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.connection-hint { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.connection-hint code { overflow-wrap: anywhere; }
.secret-box { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.secret-box code { min-width: 0; overflow-wrap: anywhere; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #050a08; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; padding: 12px 15px; border: 1px solid var(--line-strong); border-radius: 11px; background: #111b17; color: #fff; box-shadow: var(--shadow); font-size: 12px; }

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; min-height: 0; }
  .auth-proof { max-width: 620px; }
  .control-layout { grid-template-columns: 1fr; gap: 18px; }
  .tabs { position: static; grid-template-columns: repeat(6, minmax(max-content,1fr)); overflow-x: auto; border-radius: 13px; padding: 5px; }
  .tab { justify-content: center; padding-inline: 10px; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metrics div { border-bottom: 1px solid var(--line); }
  .metrics div:nth-child(2n) { border-right: 0; }
  .metrics div:nth-last-child(-n+2) { border-bottom: 0; }
  .metric-grid-six { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-grid-six div:nth-child(3) { border-right: 1px solid var(--line); }
  .metric-grid-six div:nth-child(2n) { border-right: 0; }
  .metric-grid-six div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .metric-grid-six div:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 700px) {
  .shell { width: min(100% - 28px, 1240px); padding-bottom: 54px; }
  .topbar { min-height: 64px; }
  .docs-link { display: none; }
  .account-email { display: none; }
  .auth-view { padding: 54px 0 72px; }
  .auth-view h1 { font-size: clamp(46px, 14vw, 68px); }
  .auth-view p { font-size: 15px; }
  .auth-proof { padding: 18px; border-radius: 17px; }
  .hero-row { padding-top: 30px; align-items: stretch; flex-direction: column; gap: 18px; }
  .hero-copy-with-glyph { gap: 13px; }
  .hero-row .button { align-self: flex-start; }
  .pairing-banner, .section-heading, .row { align-items: stretch; flex-direction: column; }
  .pairing-actions { flex-wrap: wrap; }
  .row { gap: 10px; }
  .row-meta { justify-content: space-between; text-align: left; flex-wrap: wrap; }
  .approval-actions { flex-wrap: wrap; }
  .setup-grid { grid-template-columns: 1fr; }
  .empty-state { padding: 28px 18px; }
}

@media (max-width: 540px) {
  .tabs { grid-template-columns: repeat(3, minmax(0,1fr)); overflow: visible; }
  .tab { min-width: 0; min-height: 44px; padding: 8px 4px; white-space: normal; text-align: center; line-height: 1.2; }
  .metrics span { font-size: 27px; }
  .metrics div { padding: 16px; }
  .metric-grid-six small { font-size: 10px; }
  .secret-box { grid-template-columns: 1fr; }
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6f1; --surface: #ffffff; --surface-2: #edf0ea; --surface-3: #e2e7df;
    --text: #101512; --muted: #68716c; --line: rgba(16,21,18,.12); --line-strong: rgba(94,126,24,.26);
    --success: #248246; --warning: #8b6417; --danger: #ae3f37; --shadow: 0 24px 70px rgba(26,42,32,.12);
  }
  body { background: radial-gradient(circle at 74% -8%, rgba(166,218,44,.08), transparent 30%), #f4f6f1; }
  .tabs { background: rgba(255,255,255,.78); }
  .auth-proof { background: linear-gradient(160deg, rgba(200,255,77,.23), rgba(255,255,255,.88) 55%); }
  .proof-flow > div { background: rgba(255,255,255,.72); }
  .proof-head, .auth-proof > a, .text-button { color: #27312b; }
  .setup-card > code, input, select, textarea, .secret-box code { background: #f7f8f5; }
  .warning { color: #6e4e11; }
  .error { color: #8e2f29; }
  .pairing-banner p, .approval-copy { color: #59635d; }
  .toast { background: #111b17; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.sensitive-heading { margin-top: 28px; }
.sensitive-warning { margin: 0 0 14px; padding: 13px 14px; border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--warning) 8%, var(--surface)); }
.sensitive-warning strong { display: block; font-size: 13px; }
.sensitive-warning p, .warning-copy { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.sensitive-request { margin-top: 7px; padding: 9px 10px; border: 1px solid color-mix(in srgb, var(--warning) 26%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--warning) 6%, transparent); }
.sensitive-request strong { display: block; font-size: 12px; }
.sensitive-request p { margin: 3px 0 8px; color: var(--muted); font-size: 11px; }
.sensitive-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.skill-revision-panel { margin: 14px 0; border-top: 1px solid var(--line); }
.skill-revision-panel > summary { min-height: 44px; display: flex; align-items: center; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.skill-scope { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.skill-version-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.compact-heading { margin-top: 22px; }
.compact-heading h3 { margin: 0 0 3px; font-size: 15px; }
.domain-request { margin-top: 7px; padding: 9px 10px; border: 1px solid color-mix(in srgb, var(--focus) 25%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--focus) 5%, transparent); }
.domain-request strong { display:block; font-size:12px; }
.domain-request p { margin:3px 0 8px; color:var(--muted); font-size:11px; }
.task-profile-panel { border-top: 1px solid var(--line); padding-top: 8px; }
.task-profile-panel > summary { cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 700; }
.task-profile-panel > summary small { margin-left: 6px; font-weight: 500; }
.task-profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 12px; }
@media (max-width: 620px) { .task-profile-grid { grid-template-columns: 1fr; } }

.privacy-note { margin: 0 0 16px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.privacy-note strong { display: block; font-size: 13px; }
.privacy-note p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
