/* APEX Agent — an evidence-first workspace with iOS-native rhythm. */
:root {
  color-scheme: light dark;
  --canvas: #f5f6f7;
  --grouped: #eceef0;
  --surface: #fff;
  --surface-raised: #fff;
  --text: #1c1d1f;
  --secondary: #666b72;
  --tertiary: #858a91;
  --separator: rgba(60, 64, 70, .14);
  --accent: #286b59;
  --accent-strong: #1e5b4a;
  --accent-soft: #e6f1ed;
  --success: #2c7b5c;
  --success-soft: #e7f3ed;
  --warning: #9c641a;
  --warning-soft: #fbf0dc;
  --danger: #b33f40;
  --danger-soft: #faeaea;
  --blue: #316b9a;
  --blue-soft: #e8f0f7;
  --shadow-soft: 0 1px 2px rgba(18, 26, 24, .04), 0 10px 30px rgba(18, 26, 24, .035);
  --sidebar: #f8f9fa;
  --tab-glass: rgba(250, 251, 252, .88);
  --focus: #318568;
  --code: #f0f2f3;
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #101211; --grouped: #191c1a; --surface: #1b1e1c; --surface-raised: #222623;
    --text: #f2f4f2; --secondary: #b2b8b4; --tertiary: #858d87; --separator: rgba(220, 230, 223, .12);
    --accent: #85c9ad; --accent-strong: #a1dec4; --accent-soft: #1c342b;
    --success: #85c9a4; --success-soft: #1c3427; --warning: #e6bc75; --warning-soft: #352b1a;
    --danger: #ff8583; --danger-soft: #3a2222; --blue: #9bc6ea; --blue-soft: #202e39;
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, .25), 0 10px 30px rgba(0, 0, 0, .12);
    --sidebar: #151816; --tab-glass: rgba(25, 28, 26, .89); --focus: #91d3b8; --code: #111412;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #101211; --grouped: #191c1a; --surface: #1b1e1c; --surface-raised: #222623;
  --text: #f2f4f2; --secondary: #b2b8b4; --tertiary: #858d87; --separator: rgba(220, 230, 223, .12);
  --accent: #85c9ad; --accent-strong: #a1dec4; --accent-soft: #1c342b;
  --success: #85c9a4; --success-soft: #1c3427; --warning: #e6bc75; --warning-soft: #352b1a;
  --danger: #ff8583; --danger-soft: #3a2222; --blue: #9bc6ea; --blue-soft: #202e39;
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .25), 0 10px 30px rgba(0, 0, 0, .12);
  --sidebar: #151816; --tab-glass: rgba(25, 28, 26, .89); --focus: #91d3b8; --code: #111412;
}
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--canvas); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--canvas); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 55%, transparent); outline-offset: 3px; }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.skip-link { position: fixed; z-index: 100; left: 12px; top: 12px; padding: 12px 16px; border-radius: 12px; color: white; background: #173d31; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app-shell { min-height: 100vh; min-height: 100dvh; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; flex-direction: column; width: 248px; padding: 30px 16px 20px; border-right: 1px solid var(--separator); background: var(--sidebar); }
.brand { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 0 10px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: #286b59; font: 700 19px/1 var(--font); letter-spacing: -.09em; padding-right: 2px; box-shadow: inset 0 1px 0 #ffffff42; }
.brand-mark.small { width: 29px; height: 29px; border-radius: 9px; font-size: 15px; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 15px; font-weight: 650; letter-spacing: -.025em; }
.brand-copy small { color: var(--tertiary); font-size: 9px; letter-spacing: .12em; font-weight: 650; }
.primary-nav { display: grid; gap: 5px; margin-top: 42px; }
.nav-link { position: relative; display: flex; align-items: center; min-height: 46px; gap: 13px; padding: 0 13px; border-radius: 12px; color: var(--secondary); font-size: 14px; font-weight: 540; transition: background-color .16s ease, color .16s ease; }
.nav-link:hover { color: var(--text); background: var(--grouped); }
.nav-link.active { color: var(--accent-strong); background: var(--accent-soft); font-weight: 650; }
.nav-link svg { width: 20px; height: 20px; }
.nav-count { margin-left: auto; min-width: 23px; padding: 2px 7px; border-radius: 10px; background: var(--accent); color: var(--surface); text-align: center; font-size: 11px; font-variant-numeric: tabular-nums; }
.sidebar-bottom { margin-top: auto; padding: 13px 11px 2px; }
.connection-line { display: flex; align-items: center; gap: 8px; color: var(--secondary); font-size: 12px; }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tertiary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tertiary) 13%, transparent); }
.connection-dot.connected { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 15%, transparent); }
.sidebar-logout { display: flex; align-items: center; width: 100%; min-height: 43px; gap: 10px; margin-top: 16px; padding: 0; border: 0; background: none; color: var(--secondary); text-align: left; font-size: 13px; }
.sidebar-logout:hover { color: var(--text); }
.sidebar-logout svg { width: 18px; height: 18px; }
.sidebar-footnote { margin: 13px 0 0; color: var(--tertiary); font-size: 11px; line-height: 1.55; }
.mobile-header { display: none; }
.main-area { width: min(1120px, calc(100% - 248px)); min-height: 100vh; margin-left: 248px; padding: max(38px, env(safe-area-inset-top)) clamp(28px, 5vw, 72px) 70px; }
.screen-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 28px; }
.eyebrow { margin: 0 0 7px; color: var(--tertiary); font-size: 10px; line-height: 1.2; font-weight: 700; letter-spacing: .11em; }
.screen-heading h1 { margin: 0; font-size: clamp(32px, 4vw, 40px); line-height: 1.08; letter-spacing: -.055em; font-weight: 720; }
.heading-tools { display: flex; align-items: center; gap: 8px; padding-bottom: 3px; }
.updated-label { color: var(--tertiary); font-size: 12px; font-variant-numeric: tabular-nums; }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--separator); border-radius: 50%; background: var(--surface); color: var(--secondary); }
.icon-button:hover { color: var(--text); background: var(--grouped); }
.icon-button svg { width: 19px; height: 19px; }
.tab-bar { display: none; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; gap: 8px; padding: 0 16px; border: 1px solid var(--separator); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 13px; line-height: 1.2; font-weight: 620; text-align: center; transition: background-color .15s ease, border-color .15s ease, transform .15s ease; }
.button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 38%, var(--separator)); background: var(--grouped); }
.button:active:not(:disabled) { transform: scale(.985); }
.button-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
:root[data-theme="dark"] .button-primary { color: #101a15; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .button-primary { color: #101a15; } }
.button-primary:hover:not(:disabled) { border-color: var(--accent-strong); background: var(--accent-strong); color: #fff; }
:root[data-theme="dark"] .button-primary:hover:not(:disabled) { color: #101a15; }
.button-secondary { background: transparent; }
.button-destructive { color: var(--danger); }
.button-icon { width: 17px; height: 17px; flex: 0 0 auto; }
.text-link, .text-button { display: inline-flex; align-items: center; gap: 5px; padding: 8px 0; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 620; }
.text-link:hover, .text-button:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.text-button { cursor: pointer; }
.home-hero { position: relative; overflow: hidden; padding: 25px 28px; border: 1px solid var(--separator); border-radius: 23px; background: var(--surface); box-shadow: var(--shadow-soft); }
.home-hero::after { position: absolute; right: -65px; bottom: -125px; width: 260px; height: 260px; border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 50%; content: ""; pointer-events: none; }
.hero-top { display: flex; align-items: center; gap: 14px; }
.hero-status-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: var(--accent-soft); color: var(--accent); }
.hero-status-icon svg { width: 23px; height: 23px; }
.hero-title-block { flex: 1; }
.hero-title-block .eyebrow { margin-bottom: 4px; }
.hero-title-block h2 { margin: 0; font-size: 25px; line-height: 1.15; letter-spacing: -.04em; font-weight: 680; text-transform: capitalize; }
.hero-description { max-width: 690px; margin: 16px 0 0 60px; color: var(--secondary); font-size: 14px; line-height: 1.55; }
.hero-actions { display: flex; align-items: center; gap: 18px; margin: 17px 0 0 60px; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 25px; width: fit-content; padding: 3px 9px; border: 1px solid var(--separator); border-radius: 99px; background: var(--grouped); color: var(--secondary); font-size: 11px; line-height: 1.2; font-weight: 620; text-transform: capitalize; white-space: nowrap; }
.status-running, .status-complete, .status-completed, .status-reproduced, .status-verified, .status-confirmed { border-color: color-mix(in srgb, var(--success) 24%, transparent); background: var(--success-soft); color: var(--success); }
.status-paused, .status-inconclusive, .status-interrupted, .status-queued, .status-starting { border-color: color-mix(in srgb, var(--warning) 25%, transparent); background: var(--warning-soft); color: var(--warning); }
.status-failed, .status-error, .status-unavailable, .status-disproved, .status-rejected, .status-blocked { border-color: color-mix(in srgb, var(--danger) 24%, transparent); background: var(--danger-soft); color: var(--danger); }
.status-resuming, .status-discovery, .status-hypothesis, .status-experiment-result { border-color: color-mix(in srgb, var(--blue) 22%, transparent); background: var(--blue-soft); color: var(--blue); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(270px, .9fr); align-items: start; gap: 18px; margin-top: 20px; }
.home-rail { display: grid; gap: 14px; }
.surface { padding: 21px; border: 1px solid var(--separator); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.section-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.025em; font-weight: 680; }
.secondary { margin: 5px 0 0; color: var(--secondary); font-size: 13px; line-height: 1.5; }
.event-list { display: grid; gap: 12px; }
.compact-list { gap: 0; margin: 16px 0 6px; }
.event-card { min-width: 0; padding: 16px; border: 1px solid var(--separator); border-radius: 15px; background: var(--surface); }
.event-compact { padding: 14px 0; border: 0; border-bottom: 1px solid var(--separator); border-radius: 0; background: transparent; box-shadow: none; }
.event-compact:last-child { border-bottom: 0; }
.event-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.event-time { color: var(--tertiary); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.event-peer { display: flex; align-items: center; gap: 7px; margin-top: 11px; color: var(--secondary); font-size: 12px; font-weight: 600; }
.event-avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--grouped); color: var(--accent-strong); font-size: 10px; font-weight: 720; }
.event-summary { margin: 10px 0 0; color: var(--text); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.event-compact .event-peer { margin-top: 8px; }
.event-compact .event-summary { margin-top: 5px; color: var(--secondary); font-size: 13px; }
.evidence-ref-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.evidence-ref { display: inline-flex; align-items: center; min-height: 34px; padding: 4px 10px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--separator)); border-radius: 9px; background: var(--accent-soft); color: var(--accent-strong); font: 600 11px/1.3 var(--mono); overflow-wrap: anywhere; }
.evidence-ref:hover { border-color: var(--accent); }
.technical-details { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--separator); }
.technical-details summary { min-height: 28px; color: var(--secondary); font-size: 12px; cursor: pointer; }
.code-block, .report-content { max-height: 440px; overflow: auto; margin: 10px 0 0; padding: 14px; border: 1px solid var(--separator); border-radius: 12px; background: var(--code); color: var(--text); font: 12px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
.researcher-list { display: grid; gap: 12px; margin: 15px 0; }
.researcher-row { display: flex; align-items: center; min-width: 0; gap: 11px; }
.researcher-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border: 1px solid var(--separator); border-radius: 50%; background: var(--grouped); color: var(--accent-strong); font-size: 13px; font-weight: 700; }
.avatar-luna-a, .avatar-luna-b { background: var(--blue-soft); color: var(--blue); }
.avatar-apex, .avatar-qwen { background: var(--accent-soft); color: var(--accent); }
.researcher-info { display: grid; min-width: 0; gap: 2px; flex: 1; }
.researcher-info strong { font-size: 13px; font-weight: 650; }
.researcher-model, .researcher-meta { overflow: hidden; color: var(--secondary); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.researcher-meta { color: var(--tertiary); font-size: 10px; }
.presence { flex: 0 0 auto; color: var(--tertiary); font-size: 10px; text-transform: capitalize; }
.presence-online { color: var(--success); }
.presence-away { color: var(--warning); }
.inline-empty { padding: 13px 0; color: var(--secondary); font-size: 13px; line-height: 1.5; }
.attention-surface { border-color: color-mix(in srgb, var(--warning) 32%, var(--separator)); }
.attention-list { display: grid; gap: 2px; margin-top: 12px; }
.attention-item { display: flex; align-items: center; min-height: 52px; gap: 10px; border-top: 1px solid var(--separator); }
.attention-item > svg:first-child { width: 17px; height: 17px; color: var(--warning); }
.attention-copy { display: grid; gap: 2px; flex: 1; min-width: 0; }
.attention-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.attention-copy small { color: var(--secondary); font-size: 11px; }
.trailing-icon { width: 16px; height: 16px; flex: 0 0 auto; color: var(--tertiary); }
.summary-strip { display: flex; align-items: center; gap: 0; margin-top: 16px; padding: 13px 20px; }
.summary-metric { display: grid; gap: 2px; min-width: 100px; padding: 0 19px; border-right: 1px solid var(--separator); }
.summary-metric:first-child { padding-left: 0; }
.summary-metric strong { font-size: 19px; font-weight: 710; letter-spacing: -.035em; }
.summary-metric span { color: var(--secondary); font-size: 11px; }
.numeric { font-variant-numeric: tabular-nums; }
.summary-more { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; margin-left: auto; color: var(--accent); font-size: 12px; font-weight: 630; }
.summary-more svg { width: 16px; height: 16px; }
.page-intro { margin: -9px 0 20px; }
.segmented { display: flex; align-items: center; width: fit-content; max-width: 100%; min-height: 42px; gap: 3px; margin: 0 0 19px; padding: 4px; border: 1px solid var(--separator); border-radius: 13px; background: var(--grouped); overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segment { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 14px; border-radius: 9px; color: var(--secondary); font-size: 12px; font-weight: 590; white-space: nowrap; }
.segment:hover { color: var(--text); }
.segment.selected { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.10); font-weight: 670; }
.list-surface { overflow: hidden; border: 1px solid var(--separator); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.investigation-row { display: flex; align-items: center; min-height: 82px; gap: 14px; padding: 14px 17px; border-bottom: 1px solid var(--separator); transition: background-color .15s ease; }
.investigation-row:last-child { border-bottom: 0; }
.investigation-row:hover { background: var(--grouped); }
.target-mark { display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 auto; border: 1px solid var(--separator); border-radius: 14px; background: var(--grouped); color: var(--secondary); }
.target-mark svg { width: 20px; height: 20px; }
.mark-running, .mark-completed { background: var(--accent-soft); color: var(--accent); }
.investigation-main { display: grid; min-width: 0; flex: 1; gap: 4px; }
.investigation-title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.investigation-title-line strong { overflow: hidden; font-size: 14px; font-weight: 660; text-overflow: ellipsis; white-space: nowrap; }
.investigation-meta { color: var(--secondary); font-size: 11px; line-height: 1.4; }
.row-trailing { display: flex; align-items: center; gap: 8px; color: var(--tertiary); }
.findings-count { font-size: 11px; white-space: nowrap; }
.slim-list { margin-top: 12px; }
.opportunity-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--separator); }
.opportunity-row:last-child { border-bottom: 0; }
.opportunity-row .target-mark { width: 34px; height: 34px; border-radius: 11px; }
.opportunity-row .target-mark svg { width: 17px; height: 17px; }
.opportunity-row strong { overflow-wrap: anywhere; font-size: 13px; }
.content-section { margin-top: 29px; }
.section-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.launch-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; padding: 18px; border: 1px solid var(--separator); border-radius: var(--radius); background: var(--surface); }
.form-field { display: grid; min-width: 0; gap: 6px; color: var(--secondary); font-size: 11px; font-weight: 600; }
.form-control { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid var(--separator); border-radius: 11px; background: var(--canvas); color: var(--text); font-size: 16px; }
.form-control:focus { border-color: var(--focus); outline: 3px solid color-mix(in srgb, var(--focus) 18%, transparent); }
.form-field:last-of-type { grid-column: 1 / -1; }
.check-field { display: flex; align-items: center; min-height: 44px; gap: 9px; color: var(--secondary); font-size: 12px; }
.check-field input { width: 19px; height: 19px; accent-color: var(--accent); }
.launch-form .button { align-self: center; justify-self: end; }
.empty-state { display: grid; justify-items: center; gap: 8px; margin: 12px 0 18px; padding: 38px 20px; border: 1px dashed var(--separator); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 72%, transparent); text-align: center; }
.empty-state .empty-icon { width: 24px; height: 24px; color: var(--tertiary); }
.empty-state h3 { margin: 4px 0 0; font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.empty-state p { max-width: 390px; margin: 0; color: var(--secondary); font-size: 12px; line-height: 1.5; }
.detail-hero { margin-bottom: 20px; }
.back-link { display: inline-flex; align-items: center; min-height: 42px; gap: 7px; margin-bottom: 7px; color: var(--accent); font-size: 13px; font-weight: 620; }
.back-link svg { width: 18px; height: 18px; }
.detail-title-row { display: flex; align-items: center; gap: 13px; }
.detail-mark { width: 52px; height: 52px; border-radius: 17px; color: var(--accent); background: var(--accent-soft); }
.detail-title-copy { flex: 1; min-width: 0; }
.detail-title-copy h2 { margin: 0; overflow-wrap: anywhere; font-size: clamp(20px, 3vw, 27px); line-height: 1.18; letter-spacing: -.04em; }
.detail-title-copy p { margin: 4px 0 0; font: 11px/1.4 var(--mono); overflow-wrap: anywhere; }
.run-control-row { display: flex; flex-wrap: wrap; margin: 14px 0 0 65px; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; }
.detail-content { min-width: 0; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.detail-grid .surface { padding: 17px; }
.detail-grid .surface:last-child { grid-column: 1 / -1; }
.detail-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--separator); font-size: 12px; }
.detail-line:last-child { border-bottom: 0; }
.detail-line > span { color: var(--secondary); }
.detail-line > strong { max-width: 70%; text-align: right; font-weight: 590; overflow-wrap: anywhere; }
.scope-note { margin-top: 16px; padding: 13px 15px; border-radius: 12px; background: var(--warning-soft); color: var(--warning); font-size: 12px; }
.research-intro { margin: -8px 0 18px; }
.research-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: start; gap: 16px; }
.room-rail, .room-workspace { min-width: 0; }
.room-rail { position: sticky; top: 24px; display: grid; gap: 6px; padding: 16px 12px; border: 1px solid var(--separator); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.room-rail .section-heading { padding: 0 5px 8px; }
.room-rail .section-heading h2 { font-size: 14px; }
.room-rail .section-heading p { font-size: 11px; }
.room-choice { display: grid; min-height: 61px; align-content: center; gap: 3px; padding: 9px 10px; border-radius: 11px; color: var(--secondary); }
.room-choice strong { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.room-choice span { font-size: 10px; }
.room-choice.selected { background: var(--accent-soft); color: var(--accent-strong); }
.room-workspace { overflow: hidden; border: 1px solid var(--separator); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.room-toolbar { display: grid; gap: 13px; padding: 18px 19px; border-bottom: 1px solid var(--separator); }
.room-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.03em; overflow-wrap: anywhere; }
.room-heading p { margin: 4px 0 0; font-size: 11px; }
.filter-row { display: flex; gap: 8px; }
.filter-select { min-height: 42px; font-size: 14px; }
.room-feed { max-height: min(68vh, 820px); overflow-y: auto; overscroll-behavior: contain; padding: 13px 17px 20px; }
.room-feed .event-card { box-shadow: none; }
.team-panel { margin-top: 15px; }
.finding-list { display: grid; gap: 12px; }
.finding-card { padding: 18px; border: 1px solid var(--separator); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.finding-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.finding-card h3 { margin: 13px 0 4px; font-size: 17px; line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
.finding-card > p.secondary { margin: 0; }
.finding-description { margin: 13px 0 0; color: var(--secondary); font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.report-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--separator); }
.report-row:last-child { border-bottom: 0; }
.report-main { display: grid; min-width: 0; gap: 5px; }
.report-main strong { font-size: 13px; overflow-wrap: anywhere; }
.report-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 21px 24px; }
.settings-group { min-width: 0; }
.settings-group-title { margin: 0 0 9px 13px; color: var(--secondary); font-size: 12px; font-weight: 650; }
.settings-body { overflow: hidden; border: 1px solid var(--separator); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-soft); }
.settings-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 14px; padding: 12px 15px; border-bottom: 1px solid var(--separator); }
.settings-row:last-child { border-bottom: 0; }
.settings-row-button { width: 100%; border: 0; border-bottom: 1px solid var(--separator); border-radius: 0; background: transparent; text-align: left; }
.setting-copy { display: grid; min-width: 0; gap: 3px; }
.setting-copy > strong { font-size: 12px; font-weight: 640; }
.setting-value { color: var(--text); font-size: 12px; overflow-wrap: anywhere; }
.setting-copy small { color: var(--secondary); font-size: 10px; line-height: 1.45; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 14px; }
.settings-actions .button { min-height: 39px; padding: 0 11px; font-size: 11px; }
.theme-options { display: flex; gap: 4px; padding: 4px; border-radius: 11px; background: var(--grouped); }
.theme-options .button { min-height: 34px; padding: 0 9px; border-color: transparent; background: transparent; font-size: 10px; }
.theme-options .button.selected { border-color: var(--separator); background: var(--surface); box-shadow: 0 1px 3px #0001; }
.switch { position: relative; width: 42px; height: 26px; flex: 0 0 auto; border: 1px solid var(--separator); border-radius: 20px; background: var(--grouped); transition: background-color .16s ease; }
.switch::after { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px #0003; content: ""; transition: transform .16s ease; }
.switch.on { border-color: var(--accent); background: var(--accent); }
.switch.on::after { transform: translateX(16px); }
.fine-note { padding: 0 15px 13px; margin: 0; color: var(--tertiary); font-size: 10px; line-height: 1.45; }
.settings-logout { padding: 10px 14px; border-top: 1px solid var(--separator); }
.settings-logout .button { min-height: 39px; }
.install-group { grid-column: 1 / -1; }
.install-group .settings-body { padding: 15px; }
.install-group .settings-body p { margin: 0; color: var(--secondary); font-size: 13px; line-height: 1.55; }
.install-group .settings-body .fine-note { padding: 10px 0 0; }
.loading-state { display: flex; align-items: center; justify-content: center; min-height: 230px; gap: 12px; color: var(--secondary); font-size: 13px; }
.spinner { width: 19px; height: 19px; border: 2px solid var(--separator); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.detail-sheet { width: min(680px, calc(100% - 28px)); max-width: 680px; max-height: min(86dvh, 900px); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--separator); border-radius: 23px; background: var(--surface); color: var(--text); box-shadow: 0 25px 80px #0003; }
.detail-sheet::backdrop { background: rgba(15, 20, 18, .36); backdrop-filter: blur(4px); }
.sheet-grabber { display: none; }
.sheet-header { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 62px; padding: 8px 16px 8px 21px; border-bottom: 1px solid var(--separator); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); }
.sheet-header h2 { margin: 0; font-size: 17px; line-height: 1.25; letter-spacing: -.025em; overflow-wrap: anywhere; }
.sheet-header .icon-button { width: 40px; height: 40px; }
.sheet-content { padding: 18px 21px 28px; }
.evidence-sheet .detail-line { font-size: 11px; }
.evidence-image { display: block; width: 100%; height: auto; margin-top: 15px; border: 1px solid var(--separator); border-radius: 12px; }
.report-content { max-height: 68dvh; margin-top: 0; }
.error-text { padding: 12px; border-radius: 11px; background: var(--danger-soft); color: var(--danger); font-size: 13px; }
.toast { position: fixed; z-index: 100; inset: auto 22px 22px auto; max-width: min(440px, calc(100vw - 44px)); padding: 13px 16px; border: 1px solid var(--separator); border-radius: 13px; background: var(--surface-raised); color: var(--text); box-shadow: 0 12px 40px #0002; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; font-size: 13px; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-error { border-color: color-mix(in srgb, var(--danger) 40%, var(--separator)); }

/* Sign-in shares the product language while remaining a focused security step. */
.login-page { display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; padding: max(22px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom)); background: var(--canvas); }
.login-card { width: min(420px, 100%); padding: 33px; border: 1px solid var(--separator); border-radius: 23px; background: var(--surface); box-shadow: var(--shadow-soft); }
.login-card .brand-mark { margin-bottom: 25px; }
.login-card h1 { margin: 0; font-size: 27px; letter-spacing: -.045em; }
.login-card > p:not(.eyebrow) { color: var(--secondary); font-size: 13px; line-height: 1.5; }
.login-card form { display: grid; gap: 15px; margin-top: 24px; }
.login-card label { display: grid; gap: 7px; color: var(--secondary); font-size: 12px; font-weight: 600; }
.login-card input:not([type="hidden"]) { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--separator); border-radius: 11px; background: var(--canvas); font-size: 16px; }
.login-card button { width: 100%; min-height: 48px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 650; }
.login-card .fine { margin-top: 18px; color: var(--tertiary); font-size: 11px !important; }
.login-error { margin: 15px 0 0; padding: 11px 13px; border-radius: 11px; background: var(--danger-soft); color: var(--danger) !important; }

@media (min-width: 1440px) {
  .main-area { width: min(1210px, calc(100% - 248px)); padding-right: 80px; padding-left: 80px; }
}
@media (max-width: 1050px) {
  .sidebar { width: 218px; }
  .main-area { width: calc(100% - 218px); margin-left: 218px; padding-right: 30px; padding-left: 30px; }
  .research-layout { grid-template-columns: 200px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  html, body { min-height: 100%; }
  .sidebar { display: none; }
  .mobile-header { position: sticky; z-index: 25; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: calc(50px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 17px 0; border-bottom: 1px solid var(--separator); background: color-mix(in srgb, var(--canvas) 90%, transparent); backdrop-filter: saturate(180%) blur(20px); }
  .mobile-brand { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 660; letter-spacing: -.02em; }
  .mobile-connection { display: grid; place-items: center; width: 36px; height: 36px; }
  .main-area { width: 100%; min-height: calc(100dvh - 110px); margin: 0; padding: 25px 17px calc(110px + env(safe-area-inset-bottom)); }
  .screen-heading { align-items: flex-end; margin-bottom: 22px; }
  .screen-heading h1 { font-size: 34px; }
  .screen-heading .eyebrow { font-size: 9px; }
  .updated-label { display: none; }
  .icon-button.theme-quick { width: 40px; height: 40px; }
  .tab-bar { position: fixed; z-index: 30; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); min-height: calc(64px + env(safe-area-inset-bottom)); padding: 5px 5px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid var(--separator); background: var(--tab-glass); backdrop-filter: saturate(180%) blur(24px); }
  .tab-link { display: flex; min-width: 0; align-items: center; justify-content: center; flex-direction: column; gap: 3px; border-radius: 11px; color: var(--tertiary); font-size: 9px; line-height: 1.2; font-weight: 560; }
  .tab-link svg { width: 21px; height: 21px; }
  .tab-link.active { color: var(--accent); font-weight: 700; }
  .tab-link:active { background: var(--grouped); }
  .home-hero { padding: 20px 18px; border-radius: 20px; }
  .hero-status-icon { width: 42px; height: 42px; border-radius: 14px; }
  .hero-title-block h2 { font-size: 22px; }
  .hero-top > .status-pill { position: absolute; top: 14px; right: 15px; font-size: 9px; }
  .hero-title-block { padding-right: 55px; }
  .hero-description, .hero-actions { margin-left: 0; }
  .hero-description { font-size: 13px; }
  .hero-actions { flex-wrap: wrap; gap: 10px 16px; }
  .home-grid { grid-template-columns: 1fr; gap: 12px; margin-top: 13px; }
  .home-rail { gap: 12px; }
  .surface { padding: 17px; border-radius: 17px; }
  .summary-strip { padding: 12px 8px; }
  .summary-metric { min-width: 0; flex: 1; padding: 0 11px; }
  .summary-metric strong { font-size: 18px; }
  .summary-metric span { font-size: 10px; }
  .summary-more { width: 42px; justify-content: center; overflow: hidden; font-size: 0; }
  .summary-more svg { width: 19px; height: 19px; }
  .page-intro { margin-top: -5px; }
  .segmented { width: 100%; justify-content: stretch; margin-bottom: 15px; }
  .segment { flex: 1 0 auto; min-height: 37px; padding: 0 11px; font-size: 11px; }
  .investigation-row { min-height: 79px; gap: 10px; padding: 13px 12px; }
  .target-mark { width: 38px; height: 38px; border-radius: 12px; }
  .investigation-title-line { flex-wrap: wrap; gap: 5px; }
  .investigation-title-line strong { max-width: 100%; font-size: 13px; }
  .investigation-title-line .status-pill { min-height: 22px; font-size: 9px; }
  .investigation-meta { font-size: 10px; }
  .findings-count { display: none; }
  .launch-form { grid-template-columns: 1fr; gap: 11px; padding: 14px; }
  .form-field:last-of-type { grid-column: auto; }
  .check-field { min-height: 44px; }
  .launch-form .button { width: 100%; justify-self: stretch; }
  .research-layout { grid-template-columns: 1fr; gap: 12px; }
  .room-rail { position: static; display: flex; align-items: center; gap: 7px; overflow-x: auto; padding: 8px; border-radius: 14px; scrollbar-width: none; }
  .room-rail::-webkit-scrollbar { display: none; }
  .room-rail .section-heading { display: none; }
  .room-choice { display: grid; min-width: 132px; min-height: 58px; padding: 8px 10px; border: 1px solid var(--separator); background: var(--surface); }
  .room-choice.selected { border-color: color-mix(in srgb, var(--accent) 36%, var(--separator)); background: var(--accent-soft); }
  .room-workspace { border-radius: 17px; }
  .room-toolbar { gap: 10px; padding: 15px 13px 12px; }
  .room-heading h2 { font-size: 17px; }
  .filter-row { gap: 7px; }
  .filter-select { min-width: 0; min-height: 42px; padding: 0 8px; font-size: 13px; }
  .room-feed { max-height: none; overflow: visible; padding: 10px; }
  .room-feed .event-card { padding: 12px; border-radius: 13px; }
  .event-summary { font-size: 13px; }
  .event-time { font-size: 10px; }
  .finding-card { padding: 15px; }
  .report-row { display: grid; align-items: start; gap: 11px; padding: 13px; }
  .report-actions { width: 100%; }
  .report-actions .button { flex: 1; }
  .settings-grid { grid-template-columns: 1fr; gap: 18px; }
  .install-group { grid-column: auto; }
  .settings-row { gap: 9px; padding: 12px; }
  .settings-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .settings-actions .button:last-child { grid-column: 1 / -1; }
  .detail-hero { margin-bottom: 15px; }
  .detail-title-row { align-items: flex-start; }
  .detail-mark { width: 43px; height: 43px; border-radius: 14px; }
  .detail-title-copy h2 { font-size: 20px; }
  .run-control-row { margin-left: 0; }
  .run-control-row .button { flex: 1; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid .surface:last-child { grid-column: auto; }
  .detail-sheet { position: fixed; inset: auto 0 0; width: 100%; max-width: none; max-height: min(88dvh, 900px); margin: 0; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 23px 23px 0 0; animation: sheet-in .2s ease-out; }
  .detail-sheet::backdrop { background: rgba(15, 20, 18, .42); }
  .sheet-grabber { display: block; width: 37px; height: 5px; margin: 8px auto 0; border-radius: 5px; background: var(--tertiary); opacity: .45; }
  .sheet-header { min-height: 54px; padding: 5px 14px 7px; }
  .sheet-content { padding: 15px 16px calc(22px + env(safe-area-inset-bottom)); }
  .toast { inset: auto 13px calc(78px + env(safe-area-inset-bottom)) 13px; max-width: none; }
}
@media (max-width: 380px) {
  .main-area { padding-right: 13px; padding-left: 13px; }
  .screen-heading h1 { font-size: 31px; }
  .tab-bar { padding-right: 2px; padding-left: 2px; }
  .tab-link { font-size: 8px; }
  .tab-link svg { width: 20px; height: 20px; }
  .hero-top { gap: 10px; }
  .status-pill { padding-right: 7px; padding-left: 7px; }
  .summary-metric { padding-right: 8px; padding-left: 8px; }
  .event-top { align-items: flex-start; }
}
@media (min-width: 761px) and (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .research-layout { grid-template-columns: 1fr; }
  .room-rail { position: static; display: flex; align-items: center; overflow-x: auto; }
  .room-rail .section-heading { flex: 0 0 auto; }
  .room-choice { min-width: 170px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
