:root {
  color-scheme: dark;
  --bg: #090a0e;
  --surface: #101218;
  --surface-2: #151821;
  --surface-3: #1b1f2a;
  --line: #292e3b;
  --line-strong: #3b4050;
  --text: #f4f5f8;
  --muted: #989eae;
  --violet: #8064ff;
  --violet-2: #a894ff;
  --teal: #35d0ba;
  --amber: #f3b85b;
  --danger: #f06f7c;
  --sidebar: 248px;
  --radius: 8px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); }
body { margin: 0; min-width: 1024px; background: var(--bg); }
button, input, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--violet-2); outline-offset: 2px; }

.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; font-size: 15px; font-weight: 700; }
.brand > span:last-child { display: grid; min-width: 0; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 500; text-transform: uppercase; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #9c8aff; border-radius: 7px; color: #fff; background: #6749ee; box-shadow: 0 0 24px rgba(128,100,255,.3); font-size: 12px; }
.eyebrow { margin: 0 0 8px; color: var(--violet-2); font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: uppercase; }
.button { min-height: 40px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; font-weight: 650; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button.primary { background: var(--violet); border-color: #9883ff; color: #fff; }
.button.primary:hover { background: #7054ef; }
.button.quiet { background: #181b24; border-color: var(--line); color: #e5e7ee; }
.button.quiet:hover { background: #20232e; border-color: var(--line-strong); }
.button.large { min-height: 46px; padding-inline: 21px; }
.button.full { width: 100%; }
.icon-control { width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 7px; display: inline-grid; place-items: center; background: #171a22; color: var(--muted); cursor: pointer; }
.icon-control:hover { color: #fff; border-color: var(--line-strong); background: #20232d; }
.form-error { min-height: 20px; margin: 5px 0; color: var(--danger); font-size: 12px; }
.empty-copy { margin: 20px 10px; color: var(--muted); font-size: 13px; line-height: 1.6; text-align: center; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; padding: 12px 16px; border: 1px solid #4f466f; border-radius: 7px; background: #181526; color: #fff; box-shadow: 0 14px 40px rgba(0,0,0,.4); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

/* Landing */
.landing-body { min-width: 1080px; background-color: #08090d; background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 40px 40px; }
.landing-header { position: sticky; top: 0; z-index: 20; height: 66px; padding: 0 max(28px, calc((100vw - 1320px)/2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.07); background: rgba(8,9,13,.94); backdrop-filter: blur(14px); }
.landing-header nav { display: flex; gap: 32px; color: #b1b5c0; font-size: 13px; }
.landing-header nav a:hover { color: #fff; }
.header-actions { display: flex; gap: 8px; }
.landing-hero { width: min(1320px, calc(100% - 56px)); min-height: calc(100vh - 66px); max-height: 900px; margin: 0 auto; padding: 72px 0 58px; display: grid; grid-template-columns: .82fr 1.18fr; align-items: center; gap: 68px; }
.hero-copy h1 { margin: 0; max-width: 540px; font-size: 66px; line-height: .98; font-weight: 750; letter-spacing: 0; }
.hero-lead { max-width: 620px; margin: 25px 0 0; color: #b1b5c1; font-size: 18px; line-height: 1.75; }
.hero-actions { display: flex; gap: 10px; margin-top: 32px; }
.hero-metrics { margin: 46px 0 0; display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--line); }
.hero-metrics div { padding: 18px 16px 0 0; border-right: 1px solid var(--line); }
.hero-metrics div + div { padding-left: 16px; }
.hero-metrics div:last-child { border: 0; }
.hero-metrics dt { font-size: 12px; font-weight: 700; }
.hero-metrics dd { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.product-stage { min-width: 0; overflow: hidden; border: 1px solid #40375f; border-radius: 8px; background: #0d0f15; box-shadow: 0 24px 90px rgba(0,0,0,.55), 0 0 54px rgba(128,100,255,.13); }
.stage-top { height: 47px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #141620; font-size: 11px; }
.stage-brand { font-weight: 750; }
.live-dot { color: var(--teal); }
.live-dot::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 12px var(--teal); }
.stage-grid { min-height: 440px; display: grid; grid-template-columns: 170px 1fr; }
.stage-grid aside { padding: 18px 12px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.stage-grid aside b { padding: 0 8px 12px; color: #fff; font-size: 12px; }
.stage-grid aside span { padding: 10px 9px; border-radius: 5px; }
.stage-grid aside .active { background: #2a2243; color: #d7ceff; }
.stage-chat { padding: 30px; display: flex; flex-direction: column; gap: 17px; justify-content: center; }
.stage-chat p { margin: 0; font-size: 12px; line-height: 1.75; }
.agent-line { max-width: 85%; padding: 15px; border: 1px solid var(--line); border-radius: 7px; background: #141720; color: #d9dce5; }
.agent-line i { margin-right: 8px; color: var(--violet-2); font-style: normal; font-weight: 700; }
.user-line { align-self: flex-end; max-width: 72%; padding: 12px 14px; border-radius: 7px; background: #30245a; }
.stage-result { padding: 17px; border-left: 2px solid var(--teal); background: #101a1b; }
.stage-result span { color: var(--teal); font-size: 10px; text-transform: uppercase; }
.stage-result strong { float: right; font-size: 12px; }
.stage-result p { clear: both; padding-top: 11px; color: #b9c2c2; }
.landing-section { width: min(1240px, calc(100% - 64px)); margin: 0 auto; padding: 98px 0; }
.section-heading { max-width: 680px; margin-bottom: 42px; }
.section-heading h2 { margin: 0; font-size: 34px; line-height: 1.2; }
.section-heading > p:last-child { color: var(--muted); line-height: 1.7; }
.capability-grid { display: grid; grid-template-columns: repeat(4,1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.capability-grid article { min-height: 230px; padding: 28px 26px; border-right: 1px solid var(--line); }
.capability-grid article:last-child { border: 0; }
.capability-grid span { color: var(--violet-2); font: 700 11px Consolas, monospace; }
.capability-grid h3 { margin: 56px 0 12px; font-size: 17px; }
.capability-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.workflow-band { width: 100%; padding-inline: max(32px,calc((100% - 1240px)/2)); background: #0d0f14; border-block: 1px solid var(--line); }
.workflow-list { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4,1fr); list-style: none; counter-reset: flow; }
.workflow-list li { min-height: 130px; padding: 24px; border-left: 1px solid var(--line); display: grid; align-content: center; }
.workflow-list li:last-child { border-right: 1px solid var(--line); }
.workflow-list b { font-size: 14px; }
.workflow-list span { margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.pricing-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.pricing-row article { min-height: 210px; padding: 24px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.pricing-row article.featured { border-color: #6554a5; box-shadow: inset 0 2px var(--violet); }
.pricing-row em { float: right; color: var(--violet-2); font-size: 11px; font-style: normal; }
.pricing-row h3 { margin: 0 0 28px; font-size: 15px; }
.pricing-row strong { display: block; font-size: 23px; }
.pricing-row p { color: var(--muted); font-size: 12px; }
.landing-footer { height: 110px; padding: 0 max(32px,calc((100% - 1240px)/2)); display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.landing-footer span { color: #fff; font-weight: 700; }
.auth-dialog { width: 430px; padding: 0; border: 1px solid #414656; border-radius: 8px; background: #12141b; color: #fff; box-shadow: 0 30px 100px rgba(0,0,0,.7); }
.auth-dialog::backdrop { background: rgba(4,5,8,.78); backdrop-filter: blur(5px); }
.auth-dialog form { padding: 26px; }
.dialog-head { margin-bottom: 24px; display: flex; justify-content: space-between; }
.dialog-head h2 { margin: 0; font-size: 24px; }
.auth-dialog label, .field { margin: 14px 0; display: grid; gap: 8px; color: #b6bac6; font-size: 12px; }
.auth-dialog input, .field textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #0c0e13; color: #fff; }
.auth-dialog .button + .button { margin-top: 8px; }

/* Desktop application shell */
.app-body { overflow: hidden; }
.app-shell { height: 100dvh; min-height: 680px; display: grid; grid-template-columns: var(--sidebar) minmax(0,1fr); }
.app-sidebar { min-width: 0; padding: 18px 14px 14px; display: flex; flex-direction: column; border-right: 1px solid #232733; background: #0d0f14; }
.app-sidebar .brand { padding: 3px 8px 20px; }
.app-sidebar nav { margin-top: 12px; display: grid; gap: 4px; }
.app-sidebar nav a { height: 43px; padding: 0 12px; display: flex; align-items: center; gap: 11px; border: 1px solid transparent; border-radius: 6px; color: #9da3b3; font-size: 13px; font-weight: 600; }
.app-sidebar nav a:hover { color: #e7e9ef; background: #14171e; }
.app-sidebar nav a.active { border-color: #423962; background: #211b34; color: #ddd6ff; }
.app-sidebar nav a.active svg { color: var(--violet-2); }
.sidebar-status { margin: auto 6px 14px; padding: 15px; border: 1px solid var(--line); border-radius: 7px; background: #11141a; display: grid; gap: 7px; }
.sidebar-status span, .sidebar-status small { color: var(--muted); font-size: 10px; }
.sidebar-status b { font-size: 11px; }
.sidebar-status i { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); }
.sidebar-user { min-width: 0; padding: 11px 7px 0; display: grid; grid-template-columns: 32px minmax(0,1fr) 40px; align-items: center; gap: 9px; border-top: 1px solid var(--line); }
.sidebar-user div { min-width: 0; display: grid; gap: 2px; }
.sidebar-user b { overflow: hidden; color: #e4e6ec; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { color: var(--muted); font-size: 10px; }
.avatar, .large-avatar { display: grid; place-items: center; border-radius: 50%; background: #2c2550; color: #d9d1ff; font-weight: 750; }
.avatar { width: 32px; height: 32px; font-size: 11px; }

/* Chat */
.chat-layout { min-width: 0; height: 100dvh; display: grid; grid-template-columns: 272px minmax(0,1fr); }
.session-panel { min-width: 0; padding: 16px 12px; border-right: 1px solid var(--line); background: #101218; overflow: hidden; }
.search-field { height: 38px; margin: 12px 0 18px; padding: 0 10px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 6px; background: #0b0d12; color: var(--muted); }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font-size: 12px; }
.session-caption { padding: 0 5px 8px; display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.session-list { height: calc(100dvh - 154px); overflow-y: auto; }
.session-row { min-width: 0; height: 43px; margin: 2px 0; display: grid; grid-template-columns: minmax(0,1fr) 34px; border-radius: 5px; }
.session-row:hover, .session-row.active { background: #191c25; }
.session-row.active { box-shadow: inset 2px 0 var(--violet); }
.session-open, .session-delete { border: 0; background: transparent; cursor: pointer; }
.session-open { min-width: 0; padding: 0 9px; overflow: hidden; color: #b8bdc9; font-size: 11px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.session-delete { display: grid; place-items: center; color: transparent; }
.session-row:hover .session-delete { color: var(--muted); }
.session-delete svg { width: 14px; }
.conversation-panel { min-width: 0; height: 100dvh; display: grid; grid-template-rows: 68px 48px minmax(0,1fr) auto; background: #0b0d11; }
.workspace-header { min-width: 0; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #0e1015; }
.workspace-header .eyebrow { margin-bottom: 2px; font-size: 9px; }
.workspace-header h1 { margin: 0; font-size: 18px; }
.header-tools { display: flex; align-items: center; gap: 8px; }
.quota-chip { padding: 7px 10px; border: 1px solid #373245; border-radius: 5px; color: #bdb4e5; background: #181522; font-size: 10px; }
.mode-strip { padding: 7px 22px; display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); background: #101217; }
.mode-strip button, .report-tabs button { height: 31px; padding: 0 11px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.mode-strip button:hover, .mode-strip button.active, .report-tabs button.active { border-color: #3c3651; color: #ddd7fa; background: #211c31; }
.conversation { min-height: 0; width: min(900px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 18px; overflow-y: auto; }
.message { margin: 0 0 22px; display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 12px; }
.message-avatar { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid #49405e; border-radius: 7px; background: #211b35; color: #c9bdff; font-size: 9px; font-weight: 800; }
.message.user .message-avatar { border-color: #39404a; background: #1b2027; color: #cad0d8; }
.message b { font-size: 11px; }
.message p { margin: 7px 0 0; color: #d3d6de; font-size: 13px; line-height: 1.8; white-space: pre-wrap; }
.message.user p { color: #aeb4c0; }
.message.pending p { color: var(--muted); }
.starter-grid { margin: 26px 0 0 46px; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.starter-grid button { min-height: 62px; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: #11141a; color: #b9bec9; cursor: pointer; font-size: 11px; line-height: 1.5; text-align: left; }
.starter-grid button:hover { border-color: #51466f; color: #fff; }
.composer { width: min(900px, calc(100% - 40px)); margin: 0 auto 18px; border: 1px solid #3a3e4b; border-radius: 8px; background: #151820; box-shadow: 0 14px 40px rgba(0,0,0,.28); }
.composer:focus-within { border-color: #7362b5; }
.composer textarea { width: 100%; min-height: 60px; max-height: 160px; padding: 15px 16px 8px; resize: none; border: 0; outline: 0; background: transparent; color: #fff; font-size: 13px; line-height: 1.6; }
.composer-footer { height: 43px; padding: 0 8px 7px 15px; display: flex; align-items: center; gap: 14px; color: var(--violet-2); font-size: 10px; }
.composer-hint { margin-left: auto; color: var(--muted); }
.send-button { width: 34px; height: 34px; border: 0; border-radius: 6px; display: grid; place-items: center; background: var(--violet); color: #fff; cursor: pointer; }

/* Tool pages */
.workspace-page { min-width: 0; height: 100dvh; padding: 0 26px 28px; overflow: auto; background: #0b0d11; }
.page-header { min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.page-header h1 { margin: 0; font-size: 22px; }
.page-header p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.video-workspace { height: calc(100dvh - 122px); min-height: 560px; padding-top: 20px; display: grid; grid-template-columns: minmax(330px, .72fr) minmax(540px,1.28fr); gap: 16px; align-items: stretch; }
.tool-panel, .account-section { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.tool-panel { min-width: 0; padding: 18px; overflow: auto; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.panel-heading span { color: var(--violet-2); font-size: 9px; font-weight: 750; }
.panel-heading h2 { margin: 3px 0 0; font-size: 15px; }
.panel-heading small { color: var(--muted); font-size: 10px; }
.dropzone { min-height: 238px; margin: 18px 0 14px; padding: 18px; display: grid; place-items: center; align-content: center; gap: 9px; border: 1px dashed #444a59; border-radius: 7px; background: #0c0e13; color: var(--muted); cursor: pointer; text-align: center; }
.dropzone:hover { border-color: #7161a9; background: #101019; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone > svg { width: 30px; height: 30px; color: var(--violet-2); }
.dropzone b { color: #e6e8ee; font-size: 13px; }
.dropzone span { font-size: 11px; }
.dropzone video { width: 100%; max-height: 210px; border-radius: 5px; }
.file-meta { margin-bottom: 14px; display: grid; grid-template-columns: 1.4fr .7fr .6fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.file-meta span { min-width: 0; padding: 10px; display: grid; gap: 3px; background: #13161d; color: var(--muted); font-size: 9px; }
.file-meta b { overflow: hidden; color: #d9dce4; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.field textarea { min-height: 98px; resize: vertical; }
.upload-panel, .report-panel { display: grid; align-content: start; }
.report-panel { gap: 16px; }
.report-heading { align-items: stretch; }
.report-metrics { min-width: 220px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.report-metric { padding: 10px 12px; display: grid; gap: 5px; border: 1px solid #3a3551; border-radius: 7px; background: #171420; text-align: left; }
.report-metric small { color: var(--muted); font-size: 10px; }
.report-metric strong { color: #f4e9ff; font-size: 22px; line-height: 1; }
.analysis-track { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.track-stage { min-width: 0; padding: 12px; display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 7px; background: #11141a; }
.track-stage b { font-size: 11px; }
.track-stage small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.track-stage[data-status="active"] { border-color: #5b4ca0; background: #1c1730; }
.track-stage[data-status="active"] b { color: #dfd7ff; }
.track-stage[data-status="completed"] { border-color: rgba(53,208,186,.35); background: #101c1b; }
.track-stage[data-status="completed"] b { color: var(--teal); }
.track-stage[data-status="failed"] { border-color: rgba(240,111,124,.35); background: #201317; }
.track-stage[data-status="failed"] b { color: #ffb2bb; }
.track-stage[data-status="skipped"] { border-color: rgba(243,184,91,.35); background: #211910; }
.track-stage[data-status="skipped"] b { color: var(--amber); }
.report-empty { min-height: 210px; padding: 24px; display: grid; place-items: center; align-content: center; border: 1px dashed #343848; border-radius: 8px; color: var(--muted); text-align: center; }
.report-empty svg { width: 34px; height: 34px; color: #555c6a; }
.report-empty h3 { margin: 15px 0 4px; color: #d9dce3; font-size: 14px; }
.report-empty p { max-width: 390px; font-size: 11px; line-height: 1.7; }
.report-shell { display: grid; gap: 14px; align-content: start; }
.status-notice { margin: 0; padding: 11px 13px; border: 1px solid #35574d; border-radius: 7px; background: #11201d; color: #d6f5ec; font-size: 12px; line-height: 1.6; }
.status-notice[data-kind="partial"] { border-color: rgba(243,184,91,.42); background: #241d12; color: #f6ddb0; }
.summary-card { padding: 14px 16px; display: grid; gap: 7px; border: 1px solid var(--line); border-radius: 8px; background: #0f1117; }
.summary-card small { color: var(--muted); font-size: 10px; }
.summary-card p { margin: 0; color: #e7e9ee; font-size: 13px; line-height: 1.7; }
.report-tabs { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.report-tabs button { flex: 0 0 auto; min-width: 90px; }
.finding-list { display: grid; gap: 10px; }
.finding-card { padding: 14px; border: 1px solid #302c3c; border-left: 3px solid var(--amber); border-radius: 8px; background: #15171d; }
.finding-card[data-level="warning"] { border-left-color: var(--danger); }
.finding-card[data-level="gold"] { border-left-color: var(--teal); }
.finding-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.finding-list b { font-size: 12px; }
.finding-head small { color: var(--muted); font-size: 10px; }
.finding-list p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; white-space: pre-wrap; }
.rewrite-result { display: grid; gap: 12px; }
.rewrite-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rewrite-status { color: #e9ddff; font-size: 12px; font-weight: 650; }
.rewrite-result textarea { width: 100%; min-height: 240px; padding: 14px; resize: vertical; border: 1px solid var(--line); border-radius: 6px; background: #0b0d12; color: #dfe2e9; line-height: 1.7; }

/* Prompt versions */
.prompt-workspace { height: calc(100dvh - 122px); min-height: 550px; padding-top: 20px; display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 14px; }
.version-panel, .compare-panel { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: auto; }
.version-panel { padding: 12px; }
.version-panel .search-field { margin: 0 0 10px; }
.version-list { display: grid; gap: 4px; }
.version-row { min-width: 0; padding: 12px; display: grid; grid-template-columns: 33px minmax(0,1fr); gap: 5px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #d8dbe3; cursor: pointer; text-align: left; }
.version-row:hover, .version-row:focus { border-color: #48405f; background: #181722; }
.version-row b { grid-row: 1 / 3; color: var(--violet-2); font: 700 11px Consolas, monospace; }
.version-row span { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.version-row small { color: var(--muted); font-size: 9px; }
.compare-panel { padding: 20px; }
.compare-empty { height: 100%; display: grid; place-items: center; align-content: center; color: var(--muted); text-align: center; }
.compare-empty svg { width: 36px; height: 36px; }
.compare-empty h2 { margin: 12px 0 4px; color: #e0e2e8; font-size: 15px; }
.compare-empty p { font-size: 11px; }
.prompt-detail-head { display: flex; align-items: center; justify-content: space-between; }
.prompt-detail-head h2 { margin: 0; font-size: 18px; }
.prompt-text-block { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: #0e1015; }
.prompt-text-block h3 { margin: 0 0 10px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.prompt-text-block p { margin: 0; color: #d1d4dd; font-size: 12px; line-height: 1.8; white-space: pre-wrap; }
.prompt-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prompt-compare .prompt-text-block:last-child { border-color: #41375d; background: #12101a; }

/* Account */
.account-page { padding-bottom: 60px; }
.account-grid { padding-top: 20px; display: grid; grid-template-columns: 1.35fr .65fr; gap: 14px; }
.account-profile, .usage-card { min-height: 150px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.profile-line { display: flex; align-items: center; gap: 14px; }
.large-avatar { width: 54px; height: 54px; font-size: 18px; }
.profile-line h2 { margin: 0; font-size: 16px; }
.profile-line p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.invite-code { margin-top: 18px; padding-top: 13px; display: grid; grid-template-columns: 1fr auto 40px; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.invite-code span { color: var(--muted); font-size: 10px; }
.invite-code strong { color: var(--violet-2); font: 700 13px Consolas, monospace; }
.usage-card { display: grid; grid-template-columns: 1fr 1fr; align-content: center; gap: 12px; }
.usage-card > div:not(.usage-meter) { display: grid; gap: 5px; }
.usage-card span, .usage-card small { color: var(--muted); font-size: 10px; }
.usage-card strong { font-size: 23px; }
.usage-meter { grid-column: 1 / -1; height: 5px; border-radius: 3px; overflow: hidden; background: #272b34; }
.usage-meter i { display: block; height: 100%; width: 0; background: var(--violet); }
.usage-card small { grid-column: 1 / -1; }
.account-section { margin-top: 14px; padding: 18px; }
.membership-options { margin-top: 15px; display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; }
.membership-options article { min-height: 140px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: #0f1117; }
.membership-options article.current { border-color: #625391; box-shadow: inset 0 2px var(--violet); }
.membership-options h3 { margin: 0 0 24px; font-size: 12px; }
.membership-options strong { font-size: 16px; }
.membership-options p { min-height: 28px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.membership-options .button { min-height: 34px; padding: 0 9px; font-size: 10px; }
.account-lower { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.activity-list { margin-top: 12px; }
.activity-row { min-height: 50px; padding: 8px 4px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.activity-row div { display: grid; gap: 4px; }
.activity-row b { font-size: 11px; }
.activity-row small, .activity-row > span { color: var(--muted); font-size: 9px; }
.activity-row .status { padding: 5px 7px; border-radius: 4px; }
.activity-row .status.pending { background: #2a2418; color: var(--amber); }
.activity-row .status.approved { background: #142823; color: var(--teal); }
.activity-row .status.rejected { background: #2b181c; color: var(--danger); }

/* Standalone operations console */
.admin-standalone { min-width: 0; height: 100dvh; overflow: hidden; background: #08090d; }
.admin-shell { height: 100dvh; display: grid; grid-template-columns: minmax(220px, 248px) minmax(0,1fr); }
.admin-rail { min-width: 0; padding: 22px 14px 18px; display: flex; flex-direction: column; border-right: 1px solid #242834; background: #0d0f15; }
.admin-brand { height: 46px; padding: 0 8px; display: flex; align-items: center; gap: 11px; }
.admin-brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #8774eb; border-radius: 7px; background: #6749ee; color: #fff; font-size: 11px; font-weight: 800; box-shadow: 0 0 22px rgba(128,100,255,.25); }
.admin-brand > span:last-child { display: grid; gap: 2px; }
.admin-brand strong { font-size: 14px; }
.admin-brand small { color: var(--muted); font-size: 9px; }
.admin-nav { margin-top: 30px; display: grid; gap: 5px; }
.admin-nav button { position: relative; width: 100%; height: 42px; padding: 0 11px; display: flex; align-items: center; gap: 11px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #9298a8; cursor: pointer; font-size: 12px; text-align: left; }
.admin-nav button:hover { background: #151821; color: #e7e9ee; }
.admin-nav button.active { border-color: #39334f; background: #211c31; color: #fff; }
.admin-nav button.active::before { content: ""; position: absolute; left: -15px; width: 2px; height: 22px; background: var(--violet); }
.admin-nav button b { min-width: 20px; height: 20px; margin-left: auto; padding: 0 5px; display: grid; place-items: center; border-radius: 4px; background: #593eeb; color: #fff; font-size: 9px; }
.admin-rail-foot { margin-top: auto; padding: 16px 9px 0; border-top: 1px solid var(--line); }
.admin-rail-foot a { color: #d7d9e0; font-size: 11px; }
.admin-rail-foot p { margin: 10px 0 0; color: #666c7b; font-size: 9px; line-height: 1.55; }
.admin-main { min-width: 0; height: 100dvh; overflow: hidden; }
.admin-header { height: 82px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #0b0d12; }
.admin-eyebrow { margin: 0 0 6px; color: var(--violet-2); font-size: 9px; font-weight: 750; }
.admin-header h1 { margin: 0; font-size: 21px; line-height: 1; }
.admin-session { display: flex; align-items: center; gap: 9px; color: #aeb3c0; font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 12px rgba(53,208,186,.55); }
.icon-button { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: #151821; color: #aeb3c0; cursor: pointer; }
.icon-button:hover { border-color: #494f5e; color: #fff; }
.admin-login-state { width: min(940px, calc(100% - 56px)); min-height: 430px; margin: 64px auto 0; display: grid; grid-template-columns: 1fr 390px; align-items: center; gap: 74px; }
.admin-login-copy h2 { margin: 15px 0 12px; font-size: 29px; }
.admin-login-copy > p:last-child { max-width: 500px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.admin-lock-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #52466f; border-radius: 7px; background: #1b1726; color: var(--violet-2); }
.admin-login-form { padding: 24px; border: 1px solid #323746; border-radius: 8px; background: #11131a; }
.admin-login-form label, .admin-plan-row label, .provider-fields label { display: grid; gap: 7px; color: #959baa; font-size: 10px; }
.admin-login-form label + label { margin-top: 15px; }
.admin-login-form input, .admin-search input, .admin-plan-row input, .admin-plan-row select, .admin-table select, .provider-fields input { width: 100%; height: 39px; padding: 0 11px; border: 1px solid #303543; border-radius: 6px; background: #0b0d12; color: #fff; outline: none; }
.admin-login-form input:focus, .admin-search input:focus, .admin-plan-row input:focus, .admin-table select:focus, .provider-fields input:focus { border-color: var(--violet); }
.primary-button, .quiet-button, .danger-button, .danger-text-button, .admin-plan-row > button, .admin-search button, .admin-row-actions button, .provider-actions button, .admin-table td > button, .admin-pagination button { min-height: 36px; padding: 0 13px; border: 1px solid #4e3fc8; border-radius: 6px; background: #6749ee; color: #fff; cursor: pointer; font-size: 10px; font-weight: 700; }
.primary-button { width: 100%; margin-top: 5px; }
.quiet-button, .admin-pagination button { border-color: var(--line); background: #171a22; color: #d6d8df; }
.danger-text-button { border-color: #57333c !important; background: #25171b !important; color: #ff9aa4 !important; }
.danger-button { border-color: #bb5060; background: #bc4a5b; }
button:disabled { cursor: not-allowed; opacity: .5; }
.admin-workspace { height: calc(100dvh - 82px); overflow: hidden; }
.admin-view { height: 100%; padding: 26px 28px 34px; overflow: auto; }
.admin-view-head { min-height: 56px; margin-bottom: 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.admin-view-head h2 { margin: 0; font-size: 19px; }
.admin-view-head p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.admin-view-head > span { color: var(--muted); font-size: 9px; }
.admin-metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.admin-metric { min-height: 126px; padding: 18px; display: grid; align-content: space-between; border: 1px solid var(--line); border-top: 2px solid #7761e9; border-radius: 7px; background: #11131a; }
.admin-metric.teal { border-top-color: var(--teal); }
.admin-metric.amber { border-top-color: var(--amber); }
.admin-metric.rose { border-top-color: var(--danger); }
.admin-metric span, .admin-metric small { color: var(--muted); font-size: 10px; }
.admin-metric strong { font-size: 30px; line-height: 1; }
.admin-band { margin-top: 14px; padding: 19px; border-block: 1px solid var(--line); background: #0d0f14; }
.admin-band-head { display: flex; align-items: center; justify-content: space-between; }
.admin-band-head h3 { margin: 0; font-size: 13px; }
.admin-band-head span { color: var(--muted); font-size: 9px; }
.admin-plan-summary { margin-top: 17px; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); }
.admin-plan-summary-item { min-width: 0; padding: 8px 16px; display: grid; gap: 7px; border-left: 1px solid var(--line); }
.admin-plan-summary-item:first-child { border-left: 0; padding-left: 0; }
.admin-plan-summary-item strong { font-size: 11px; }
.admin-plan-summary-item span { font-size: 17px; font-weight: 700; }
.admin-plan-summary-item small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.admin-search { width: 330px; height: 38px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: #101218; overflow: hidden; }
.admin-search svg { margin-left: 11px; color: var(--muted); }
.admin-search input { height: 36px; padding-left: 4px; border: 0; background: transparent; }
.admin-search button { min-height: 30px; margin-right: 4px; }
.admin-table-shell { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 7px; background: #101218; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.admin-table th { height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #151820; color: #888e9d; font-size: 9px; text-align: left; white-space: nowrap; }
.admin-table td { min-height: 54px; padding: 11px 14px; border-bottom: 1px solid #232732; color: #cfd2da; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td strong, .admin-table td small { display: block; }
.admin-table td small { max-width: 190px; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; }
.admin-table select { min-width: 108px; height: 34px; }
.admin-row-actions { display: flex; align-items: center; gap: 5px; }
.admin-status { display: inline-flex; min-height: 23px; padding: 0 8px; align-items: center; border-radius: 4px; background: #262932; color: #b9bdc8; font-size: 9px; white-space: nowrap; }
.admin-status.active, .admin-status.approved { background: #142823; color: var(--teal); }
.admin-status.suspended { background: #2b181c; color: var(--danger); }
.admin-status.pending { background: #2a2418; color: var(--amber); }
.admin-empty-row td { height: 150px; color: var(--muted); text-align: center; }
.admin-pagination { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 9px; }
.admin-plan-editor, .provider-editor { display: grid; gap: 8px; }
.admin-plan-row { min-height: 82px; padding: 13px 15px; display: grid; grid-template-columns: minmax(140px,1.1fr) minmax(130px,.8fr) minmax(130px,.8fr) 110px 74px; align-items: end; gap: 12px; border: 1px solid var(--line); border-radius: 7px; background: #101218; }
.admin-plan-identity { align-self: center; display: grid; gap: 6px; }
.admin-plan-identity strong { font-size: 12px; }
.admin-plan-identity code, .provider-heading code { width: fit-content; color: var(--violet-2); font-size: 9px; }
.admin-check-label { display: flex !important; align-items: center; gap: 8px !important; white-space: nowrap; }
.admin-check-label input { width: 16px !important; height: 16px !important; accent-color: var(--violet); }
.provider-row { padding: 17px; border: 1px solid var(--line); border-radius: 7px; background: #101218; }
.provider-heading { display: flex; align-items: center; justify-content: space-between; }
.provider-heading > div { display: flex; align-items: center; gap: 10px; }
.provider-heading strong { font-size: 12px; }
.provider-fields { margin-top: 15px; display: grid; grid-template-columns: 75px minmax(160px,.8fr) minmax(260px,1.2fr) minmax(210px,1fr); align-items: end; gap: 10px; }
.provider-actions { margin-top: 11px; display: flex; justify-content: flex-end; gap: 6px; }
.admin-routing-workspace { display: grid; gap: 16px; }
.admin-routing-grid { display: grid; grid-template-columns: repeat(2, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.admin-routing-panel, .admin-routing-footer { padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: #101218; }
.admin-routing-panel { min-width: 0; display: grid; gap: 14px; }
.admin-routing-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.admin-routing-panel-head h3 { margin: 0; font-size: 13px; }
.admin-routing-panel-head p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.admin-routing-section { display: grid; gap: 12px; }
.admin-routing-section label { display: grid; gap: 7px; color: #959baa; font-size: 10px; }
.admin-routing-section select { width: 100%; min-height: 39px; padding: 0 11px; border: 1px solid #303543; border-radius: 6px; background: #0b0d12; color: #fff; outline: none; }
.admin-routing-section select:focus { border-color: var(--violet); }
.admin-routing-help { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.admin-routing-list { display: grid; gap: 0; }
.admin-routing-option { min-width: 0; padding: 12px 0; display: grid; grid-template-columns: 18px minmax(0,1fr) auto; align-items: center; gap: 12px; border-top: 1px solid #232732; cursor: pointer; }
.admin-routing-option:first-child { border-top: 0; padding-top: 0; }
.admin-routing-option:last-child { padding-bottom: 0; }
.admin-routing-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--violet); }
.admin-routing-option-copy { min-width: 0; display: grid; gap: 4px; }
.admin-routing-option-copy strong { font-size: 11px; line-height: 1.5; }
.admin-routing-option-copy small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.admin-routing-option.unavailable strong { color: #efc2c8; }
.admin-routing-empty { margin: 0; padding: 10px 0 2px; color: var(--muted); font-size: 10px; }
.admin-routing-footer { display: grid; grid-template-columns: auto minmax(0,1fr) 180px; align-items: center; gap: 16px; }
.admin-routing-toggle { align-self: center; }
.admin-routing-status { min-width: 0; display: grid; gap: 4px; }
.admin-routing-status [data-routing-status][data-kind="success"] { color: var(--teal); }
.admin-routing-status [data-routing-status][data-kind="error"] { color: #ffb0bb; }
.admin-routing-footer .primary-button { width: 100%; margin-top: 0; }
.confirm-dialog { width: 430px; padding: 0; border: 1px solid #404655; border-radius: 8px; background: #12141b; color: #fff; box-shadow: 0 28px 90px rgba(0,0,0,.7); }
.confirm-dialog::backdrop { background: rgba(4,5,8,.75); backdrop-filter: blur(4px); }
.confirm-dialog form { padding: 23px; }
.confirm-dialog h2 { margin: 17px 0 9px; font-size: 18px; }
.confirm-dialog p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.dialog-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 7px; }
.dialog-actions button { min-height: 36px; padding: 0 15px; border: 1px solid var(--line); border-radius: 6px; background: #191c24; color: #fff; cursor: pointer; }
.dialog-actions .danger-button { border-color: #bb5060; background: #bc4a5b; }
.toast[data-kind="error"] { border-color: #6d3540; background: #28171b; }
.toast[data-kind="info"] { border-color: #3e4657; background: #171b24; }
.admin-login-challenge { margin-top: 15px; padding: 13px; border: 1px solid #3f3855; border-radius: 6px; background: #171421; }
.admin-login-challenge label + label { margin-top: 12px; }
.admin-login-challenge p { margin: 9px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.admin-security-grid { display: grid; grid-template-columns: repeat(2, minmax(300px, 1fr)); gap: 14px; }
.admin-security-card { min-width: 0; padding: 20px; display: grid; align-content: start; gap: 18px; border: 1px solid var(--line); border-radius: 8px; background: #101218; }
.admin-security-card h3 { margin: 0; font-size: 15px; }
.admin-security-card p:not(.admin-eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.admin-security-card > .admin-status { width: fit-content; }
.admin-sensitive-form { margin-top: 15px; display: grid; gap: 12px; }
.admin-sensitive-form label { display: grid; gap: 7px; color: #959baa; font-size: 10px; }
.admin-sensitive-form input { width: 100%; height: 39px; padding: 0 11px; border: 1px solid #303543; border-radius: 6px; background: #0b0d12; color: #fff; outline: none; }
.admin-sensitive-form input:focus { border-color: var(--violet); }
.admin-sensitive-form .primary-button { width: fit-content; margin-top: 2px; }
.admin-form-dialog { max-height: min(760px, calc(100dvh - 40px)); overflow: auto; }
.admin-form-dialog > form { margin: 0; }
.admin-secret-dialog pre { min-height: 76px; max-height: 240px; margin: 17px 0 0; padding: 14px; overflow: auto; border: 1px solid #49405e; border-radius: 6px; background: #090a0e; color: #dcd6ff; font: 600 12px/1.75 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-all; user-select: all; }
.admin-totp-setup { margin-top: 17px; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 15px; align-items: center; }
.admin-totp-setup img { width: 150px; height: 150px; border-radius: 6px; background: #fff; object-fit: contain; }
.admin-totp-setup div { min-width: 0; display: grid; gap: 8px; }
.admin-totp-setup span { color: var(--muted); font-size: 9px; }
.admin-totp-setup code { padding: 11px; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 5px; color: #dcd6ff; background: #0b0d12; font-size: 11px; user-select: all; }
.admin-row-actions button:disabled, .admin-table select:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 1200px) {
  :root { --sidebar: 220px; }
  .chat-layout { grid-template-columns: 235px minmax(0,1fr); }
  .landing-hero { gap: 36px; }
  .hero-copy h1 { font-size: 54px; }
  .stage-grid { grid-template-columns: 145px 1fr; }
  .membership-options { grid-template-columns: repeat(3,1fr); }
  .admin-routing-grid { grid-template-columns: 1fr; }
  .admin-routing-footer { grid-template-columns: 1fr; align-items: start; }
  .admin-security-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
