:root {
  color-scheme: dark;
  --bg: #080d12;
  --bg-deep: #05090d;
  --surface: #0c141b;
  --surface-raised: #101b23;
  --surface-soft: #0a1117;
  --line: #20313a;
  --line-strong: #304651;
  --text: #e6edf0;
  --muted: #82939b;
  --dim: #50616a;
  --accent: #60f1dd;
  --accent-rgb: 96, 241, 221;
  --accent-secondary: #ff6a70;
  --warning: #ffbd5b;
  --danger: #ff6670;
  --font-display: "Orbitron", "Arial", sans-serif;
  --font-mono: "Fira Code", "Consolas", monospace;
  --page-gutter: clamp(18px, 3vw, 46px);
  --header-height: 76px;
}

[data-theme="magenta"] { --accent: #ff61c7; --accent-rgb: 255, 97, 199; }
[data-theme="amber"] { --accent: #ffbd5b; --accent-rgb: 255, 189, 91; }
[data-theme="ghost"] { --accent: #f0f3f5; --accent-rgb: 240, 243, 245; }

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font-family: var(--font-mono); font-size: 13px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, a, input, select, textarea { touch-action: manipulation; }
body::before, body::after { position: fixed; inset: 0; z-index: 20; pointer-events: none; content: ""; }
body::before { opacity: .14; background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(0, 0, 0, .24) 4px); }
body::after { opacity: .2; background: radial-gradient(ellipse at 50% 40%, transparent 35%, rgba(0, 0, 0, .46) 100%); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.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; overflow: clip; background-image: linear-gradient(rgba(14, 30, 36, .12) 1px, transparent 1px), linear-gradient(90deg, rgba(14, 30, 36, .12) 1px, transparent 1px); background-size: 46px 46px; }
.site-header { position: relative; z-index: 5; height: var(--header-height); display: flex; align-items: center; padding: 0 var(--page-gutter); border-bottom: 1px solid var(--line); background: rgba(5, 9, 13, .86); }
.brand-lockup { display: inline-flex; gap: 12px; align-items: center; color: var(--text); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; display: inline-grid; flex: 0 0 auto; place-items: center; color: var(--bg); background: var(--accent); font-family: var(--font-display); font-size: 17px; font-weight: 800; clip-path: polygon(0 0, 80% 0, 100% 20%, 100% 100%, 20% 100%, 0 80%); }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-family: var(--font-display); font-size: 13px; letter-spacing: .07em; }
.brand-copy strong i { color: var(--accent); font-style: normal; }
.brand-copy small, .status-brand small { color: var(--muted); font-size: 9px; letter-spacing: .15em; }
.header-coordinates { margin-left: clamp(24px, 7vw, 105px); color: var(--dim); font-size: 10px; letter-spacing: .13em; }
.header-live { display: flex; align-items: center; gap: 9px; margin-left: auto; color: var(--muted); font-size: 10px; letter-spacing: .11em; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(var(--accent-rgb), .8); animation: dot-pulse 2.3s ease-in-out infinite; }
.screen-section { position: relative; }
.panel { position: relative; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(16, 27, 35, .97), rgba(8, 14, 19, .97)); }
.eyebrow { margin: 0; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .17em; line-height: 1.5; }
.accent-text { color: var(--accent); }
.outline-text { color: transparent; -webkit-text-stroke: 1px rgba(var(--accent-rgb), .8); }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 24px; padding: 0 16px; border: 1px solid transparent; cursor: pointer; font-family: var(--font-display); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-align: left; transition: background .2s ease, box-shadow .2s ease, border-color .2s ease, color .2s ease, transform .2s ease; }
.button b { font-size: 14px; font-weight: 500; }
.button-primary { color: var(--bg-deep); background: var(--accent); box-shadow: 0 0 18px rgba(var(--accent-rgb), .13); }
.button-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 0 24px rgba(var(--accent-rgb), .38); }
.button-secondary { border-color: var(--line-strong); color: var(--text); background: var(--surface-raised); }
.button-secondary:hover { border-color: var(--accent); color: var(--accent); }
.button-quiet { min-height: 34px; border-color: var(--line); color: var(--muted); background: transparent; font-size: 8px; }
.button-quiet:hover { border-color: var(--accent-secondary); color: var(--accent-secondary); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.text-button { padding: 5px 0; border: 0; color: var(--muted); background: none; cursor: pointer; font-size: 9px; letter-spacing: .07em; transition: color .18s ease; }
.text-button span { padding-left: 5px; color: var(--accent); font-size: 13px; }
.text-button:hover { color: var(--accent); }

/* Boot sequence */
.boot-screen { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow: hidden; background: #070b10; transition: opacity .65s ease, visibility .65s ease; }
.boot-screen.is-leaving { visibility: hidden; opacity: 0; }
.boot-noise { position: absolute; inset: 0; opacity: .3; background: repeating-linear-gradient(0deg, transparent 0, transparent 5px, rgba(var(--accent-rgb), .065) 6px, transparent 7px); animation: scan-shift 5s linear infinite; }
.boot-content { position: relative; width: min(390px, calc(100vw - 48px)); text-align: center; }
.boot-brand { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--text); font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: .12em; }
.boot-brand .brand-mark { width: 40px; height: 40px; font-size: 21px; }
.boot-brand .accent-text { color: var(--accent); }
.boot-content > .eyebrow { margin-top: 16px; }
.boot-orbit { position: relative; width: 110px; height: 110px; margin: 44px auto 26px; border: 1px solid rgba(var(--accent-rgb), .23); border-radius: 50%; animation: orbit-spin 10s linear infinite; }
.boot-orbit::before, .boot-orbit::after { position: absolute; inset: 12px; border: 1px solid rgba(var(--accent-rgb), .38); border-radius: 50%; content: ""; }
.boot-orbit::after { inset: 28px; border-color: rgba(var(--accent-rgb), .6); }
.boot-orbit span { position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.boot-orbit i, .boot-orbit b { position: absolute; inset: 0; border: 1px solid transparent; border-left-color: var(--accent); border-radius: 50%; transform: rotate(45deg) scaleX(.63); }
.boot-orbit b { transform: rotate(-45deg) scaleX(.63); border-left-color: transparent; border-right-color: var(--accent-secondary); }
.boot-line { margin: 0; color: var(--accent); font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: .17em; }
.ellipsis { animation: ellipsis 1.2s steps(4, end) infinite; }
.boot-progress { height: 3px; margin: 18px 0 10px; overflow: hidden; background: #18262d; }
.boot-progress span { display: block; width: 100%; height: 100%; background: var(--accent); box-shadow: 0 0 14px var(--accent); transform: scaleX(0); transform-origin: left; animation: boot-progress 1.85s cubic-bezier(.18,.65,.3,1) forwards; }
.boot-caption, .boot-footer { display: flex; justify-content: space-between; color: var(--dim); font-size: 8px; letter-spacing: .09em; }
.boot-footer { position: absolute; right: var(--page-gutter); bottom: 20px; left: var(--page-gutter); }

/* Login */
.auth-screen { min-height: calc(100vh - var(--header-height)); display: grid; place-items: center; padding: 48px 20px 70px; overflow: hidden; }
.auth-decoration { position: absolute; inset: 0; pointer-events: none; }
.deco-ring { position: absolute; top: 50%; left: 50%; width: min(630px, 76vw); aspect-ratio: 1; border: 1px solid rgba(var(--accent-rgb), .08); border-radius: 50%; transform: translate(-50%, -50%); }
.ring-two { width: min(470px, 59vw); border-style: dashed; animation: orbit-spin 80s linear infinite; }
.deco-cross { position: absolute; color: var(--accent); opacity: .45; font-size: 21px; }
.cross-one { top: 16%; left: 13%; }.cross-two { right: 12%; bottom: 18%; }
.deco-side-label { position: absolute; top: 50%; right: 25px; color: var(--dim); font-size: 8px; letter-spacing: .16em; writing-mode: vertical-rl; }
.auth-card { z-index: 1; width: min(430px, 100%); padding: 26px clamp(22px, 6vw, 42px) 25px; animation: reveal-up .65s both; }
.auth-card-top, .section-topline { display: flex; align-items: center; justify-content: space-between; }
.auth-code, .tiny-code, .config-id { color: var(--dim); font-size: 9px; letter-spacing: .08em; }
.auth-emblem { position: relative; width: 64px; height: 64px; display: grid; place-items: center; margin: 35px auto 22px; color: var(--accent); border: 1px solid rgba(var(--accent-rgb), .48); font-family: var(--font-display); font-size: 32px; font-weight: 700; clip-path: polygon(0 0, 82% 0, 100% 20%, 100% 100%, 18% 100%, 0 80%); }
.auth-emblem i, .auth-emblem b { position: absolute; width: 10px; height: 1px; background: var(--accent); }
.auth-emblem i { top: 11px; right: 4px; }.auth-emblem b { bottom: 10px; left: 4px; }
.auth-card > .eyebrow { text-align: center; }
.auth-card h1, .page-heading h1 { margin: 7px 0; font-family: var(--font-display); font-size: clamp(26px, 4vw, 35px); font-weight: 700; letter-spacing: -.035em; line-height: 1.2; text-align: center; }
.auth-intro { margin: 10px 0 26px; color: var(--muted); font-size: 11px; text-align: center; }
.field-label { display: block; margin: 16px 0 7px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .12em; }
.input-wrap { min-height: 43px; display: flex; align-items: center; gap: 11px; padding: 0 12px; border: 1px solid var(--line); background: var(--bg-deep); transition: border-color .2s ease, box-shadow .2s ease; }
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 14px rgba(var(--accent-rgb), .1); }
.input-wrap > span { color: var(--accent); }
.input-wrap input, .api-key-row input, .terminal-input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 11px; }
.input-wrap input::placeholder, .api-key-row input::placeholder, .terminal-input::placeholder { color: #53636b; opacity: 1; }
.remember-row { position: relative; display: inline-flex; align-items: center; gap: 9px; margin: 15px 0 19px; color: var(--muted); cursor: pointer; font-size: 9px; letter-spacing: .06em; }
.remember-row input { position: absolute; width: 16px; height: 16px; opacity: 0; }
.checkmark { width: 14px; height: 14px; border: 1px solid var(--line-strong); background: var(--bg-deep); }
.remember-row input:checked + .checkmark { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--bg-deep); }
.remember-row input:focus-visible + .checkmark { outline: 2px solid var(--accent); outline-offset: 2px; }
.auth-submit { width: 100%; justify-content: space-between; }
.auth-error { margin: 0 0 12px; color: var(--danger); font-size: 10px; }
.auth-error.shake { animation: shake .32s ease; }
.auth-warning { display: flex; gap: 9px; margin-top: 20px; padding: 10px; border: 1px solid rgba(255, 189, 91, .25); background: rgba(255, 189, 91, .045); }
.auth-warning > span, .security-note > span { flex: 0 0 auto; color: var(--warning); font-weight: 700; }
.auth-warning p, .security-note p { margin: 0; color: #a89c83; font-size: 9px; line-height: 1.65; }
.card-corner { position: absolute; width: 13px; height: 13px; border-color: var(--accent); border-style: solid; opacity: .75; }
.corner-tl { top: -1px; left: -1px; border-width: 1px 0 0 1px; }.corner-br { right: -1px; bottom: -1px; border-width: 0 1px 1px 0; }
.auth-footnote { position: absolute; right: var(--page-gutter); bottom: 18px; left: var(--page-gutter); display: flex; justify-content: space-between; color: var(--dim); font-size: 8px; letter-spacing: .12em; }

/* Shared dashboard frame */
.dashboard { width: min(1600px, 100%); min-height: calc(100vh - var(--header-height)); margin: 0 auto; padding: 22px var(--page-gutter) 32px; }
.status-bar { min-height: 68px; display: flex; align-items: center; gap: 22px; padding: 10px 16px; }
.status-time { display: grid; gap: 1px; min-width: 112px; }
.status-label { color: var(--dim); font-size: 8px; letter-spacing: .14em; }
.status-time strong { font-family: var(--font-display); font-size: 17px; letter-spacing: .07em; }
.status-time small, .status-metric small { color: var(--dim); font-size: 8px; letter-spacing: .06em; }
.status-divider { width: 1px; height: 34px; background: var(--line); }
.status-metric { display: grid; gap: 3px; min-width: 145px; }
.status-metric strong { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 10px; letter-spacing: .04em; }
.status-metric strong .status-dot { width: 6px; height: 6px; }
.signal-metric { min-width: 100px; }
.signal-bars { height: 14px; align-items: flex-end !important; gap: 3px !important; }
.signal-bars i { width: 4px; background: var(--accent); box-shadow: 0 0 7px rgba(var(--accent-rgb), .4); }
.signal-bars i:nth-child(1) { height: 4px; }.signal-bars i:nth-child(2) { height: 7px; }.signal-bars i:nth-child(3) { height: 9px; }.signal-bars i:nth-child(4) { height: 12px; }.signal-bars i:nth-child(5) { height: 14px; }
.status-spacer { flex: 1; }
.status-brand { display: flex; align-items: center; gap: 9px; }
.status-brand .brand-mark { width: 27px; height: 27px; font-size: 14px; }
.status-brand > span:last-child { display: grid; }
.status-brand b { font-family: var(--font-display); font-size: 9px; letter-spacing: .07em; }
.status-brand small { font-size: 7px; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--muted); background: transparent; cursor: pointer; font-size: 18px; }
.icon-button:hover { color: var(--accent); border-color: var(--accent); }
.offline-banner { margin-top: 12px; padding: 9px 13px; border: 1px solid rgba(255, 189, 91, .35); color: var(--warning); background: rgba(255, 189, 91, .06); font-size: 9px; letter-spacing: .1em; }
.offline-banner span { margin-right: 7px; font-weight: 700; }
.workspace-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 19px; margin-top: 19px; }
.sidebar { min-height: min(740px, calc(100vh - 205px)); display: flex; flex-direction: column; padding: 19px 12px 14px; }
.sidebar-heading { display: flex; justify-content: space-between; padding: 0 8px 14px; border-bottom: 1px solid var(--line); }
.side-nav { display: grid; gap: 5px; margin-top: 14px; }
.nav-link { position: relative; min-height: 42px; display: grid; grid-template-columns: 25px 1fr 22px; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid transparent; color: var(--muted); background: transparent; cursor: pointer; font-size: 9px; letter-spacing: .07em; text-align: left; transition: color .18s ease, background .18s ease, border-color .18s ease; }
.nav-link:hover, .nav-link.active { border-color: rgba(var(--accent-rgb), .21); color: var(--text); background: rgba(var(--accent-rgb), .06); }
.nav-link.active::before { position: absolute; top: 8px; bottom: 8px; left: -1px; width: 2px; content: ""; background: var(--accent); box-shadow: 0 0 9px var(--accent); }
.nav-icon { color: var(--accent); font-size: 16px; text-align: center; }
.nav-link b { color: var(--dim); font-size: 8px; font-weight: 400; text-align: right; }
.sidebar-bottom { margin-top: auto; }
.mini-readout { display: grid; gap: 4px; padding: 13px 9px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mini-readout strong { color: var(--accent); font-family: var(--font-display); font-size: 11px; letter-spacing: .09em; }
.mini-readout small { color: var(--dim); font-size: 8px; }
.sidebar-decoration { display: flex; gap: 4px; align-items: flex-end; height: 35px; margin: 17px 9px 10px; opacity: .64; }
.sidebar-decoration i { flex: 1; height: 22%; background: var(--accent); }
.sidebar-decoration i:nth-child(2n) { height: 45%; }.sidebar-decoration i:nth-child(3n) { height: 75%; }.sidebar-decoration i:nth-child(4n) { height: 34%; }.sidebar-decoration i:nth-child(5n) { height: 95%; }.sidebar-decoration i:nth-child(7n) { height: 58%; }
.sidebar-version { display: block; padding: 0 9px; color: var(--dim); font-size: 7px; letter-spacing: .08em; }
.content-area { min-width: 0; }
.view-panel { min-width: 0; animation: reveal-up .34s ease both; }
.page-heading { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.page-heading .eyebrow { color: var(--muted); }
.heading-slash { color: var(--accent); }
.page-heading h1 { margin: 5px 0 0; font-size: clamp(20px, 2.8vw, 29px); text-align: left; }
.heading-stamp { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.heading-stamp i, .live-tag i, .output-ready i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px rgba(var(--accent-rgb), .7); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(210px, .75fr); gap: 13px; }
.hero-card { min-height: 270px; padding: 21px 23px 17px; overflow: hidden; }
.hero-card::before { position: absolute; top: 0; right: 0; width: 36%; height: 100%; content: ""; background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), .045)); }
.hero-top { position: relative; z-index: 1; display: flex; justify-content: space-between; }
.hero-id { color: var(--dim); font-size: 8px; letter-spacing: .08em; }
.hero-copy { position: relative; z-index: 1; margin: 25px 0 17px; }
.hero-kicker { margin: 0 0 7px; color: var(--accent); font-size: 9px; letter-spacing: .13em; }
.hero-copy h2 { margin: 0; font-family: var(--font-display); font-size: clamp(26px, 4.2vw, 40px); font-weight: 700; line-height: 1.16; letter-spacing: -.035em; }
.hero-copy h2 span { color: var(--accent); }
.hero-description { max-width: 350px; margin: 9px 0 0; color: var(--muted); font-size: 10px; }
.hero-card > .button { position: relative; z-index: 2; min-width: 196px; justify-content: space-between; }
.hero-grid-lines { position: absolute; top: 5%; right: 1%; width: 42%; height: 88%; opacity: .27; background-image: linear-gradient(rgba(var(--accent-rgb), .15) 1px, transparent 1px), linear-gradient(90deg, rgba(var(--accent-rgb), .15) 1px, transparent 1px); background-size: 21px 21px; mask-image: linear-gradient(90deg, transparent, black); }
.hero-glyph { position: absolute; top: 51%; right: 11%; width: 110px; height: 110px; display: grid; place-items: center; border: 1px solid rgba(var(--accent-rgb), .19); color: rgba(var(--accent-rgb), .26); font-family: var(--font-display); font-size: 54px; font-weight: 800; transform: translateY(-50%) rotate(45deg); }
.hero-glyph span { transform: rotate(-45deg); }.hero-glyph i, .hero-glyph b { position: absolute; inset: 10px; border: 1px solid rgba(var(--accent-rgb), .12); }.hero-glyph b { inset: -10px; }
.hero-index { position: absolute; right: 19px; bottom: 12px; color: var(--dim); font-size: 7px; letter-spacing: .1em; }
.hero-index span { color: var(--accent); }
.system-card { display: flex; flex-direction: column; padding: 18px 16px 13px; }
.live-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 8px; letter-spacing: .08em; }
.live-tag i { width: 5px; height: 5px; }
.system-readout { margin-top: 18px; }
.system-readout > div:first-child { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.system-readout > div:first-child span { color: var(--muted); font-size: 8px; letter-spacing: .08em; }
.system-readout strong { font-family: var(--font-display); font-size: 14px; }
.system-readout strong small { padding-left: 3px; color: var(--dim); font-size: 8px; }
.metric-track { height: 4px; overflow: hidden; background: #1b2b33; }
.metric-track i { display: block; width: 0; height: 100%; background: var(--accent); box-shadow: 0 0 9px rgba(var(--accent-rgb), .7); transition: width 1.1s cubic-bezier(.15,.7,.2,1); }
.system-footer { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 14px; color: var(--dim); font-size: 7px; letter-spacing: .05em; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 24px 0 11px; }
.section-heading h2, .builder-panel h2, .query-output h2, .settings-card h2, .install-card h2 { margin: 4px 0 0; font-family: var(--font-display); font-size: 17px; letter-spacing: -.02em; }
.section-count { color: var(--dim); font-size: 8px; letter-spacing: .09em; }
.module-grid { display: grid; grid-template-columns: 1fr 1fr .8fr; gap: 12px; }
.module-card { min-height: 175px; display: flex; flex-direction: column; align-items: flex-start; padding: 14px; overflow: hidden; cursor: pointer; text-align: left; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.module-card:hover { transform: translateY(-2px); border-color: rgba(var(--accent-rgb), .58); box-shadow: 0 9px 25px rgba(0, 0, 0, .22), 0 0 16px rgba(var(--accent-rgb), .08); }
.module-index { color: var(--dim); font-size: 7px; letter-spacing: .1em; }
.module-icon { margin-top: 8px; color: var(--accent); font-size: 21px; line-height: 1; }
.module-name { margin-top: 6px; font-family: var(--font-display); font-size: 14px; font-weight: 700; line-height: 1.28; }
.module-description { max-width: 200px; margin-top: 6px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.module-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; margin-top: auto; padding-top: 11px; color: var(--accent); font-size: 7px; letter-spacing: .07em; }
.module-link b { font-size: 12px; }
.module-accent { position: absolute; top: 0; right: 0; width: 3px; height: 40px; background: var(--accent); opacity: .65; }
.brand-note { display: flex; flex-direction: column; justify-content: space-between; min-height: 175px; padding: 13px; overflow: hidden; }
.brand-note-mark { color: rgba(var(--accent-rgb), .32); font-family: var(--font-display); font-size: 53px; font-weight: 800; line-height: 1; }
.brand-note-mark span { color: var(--accent); }
.brand-note > p { margin: 0; font-family: var(--font-display); font-size: 9px; font-weight: 600; letter-spacing: .06em; line-height: 1.7; }
.brand-note > p span { color: var(--accent); }.brand-note > p small { color: var(--muted); font-family: var(--font-mono); font-size: 7px; letter-spacing: .11em; }
.note-serial { color: var(--dim); font-size: 7px; letter-spacing: .07em; }
.dashboard-footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 15px; color: var(--dim); font-size: 7px; letter-spacing: .08em; }
.mobile-footer, .mobile-nav { display: none; }

/* AI Agent */
.ai-layout { display: grid; grid-template-columns: minmax(245px, .78fr) minmax(0, 1.5fr); gap: 13px; }
.ai-setup { padding: 16px; }
.setup-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-top: 23px; border: 1px solid rgba(var(--accent-rgb), .3); color: var(--accent); font-size: 24px; }
.ai-setup h2 { margin: 13px 0 8px; font-family: var(--font-display); font-size: 17px; line-height: 1.4; }
.setup-copy, .settings-card > p, .install-card p { color: var(--muted); font-size: 9px; line-height: 1.7; }
.setup-steps { display: grid; gap: 12px; margin: 19px 0; }
.setup-steps > div { display: grid; grid-template-columns: 25px 1fr; gap: 8px; color: var(--muted); font-size: 9px; line-height: 1.65; }
.setup-steps > div > b { color: var(--accent); font-size: 9px; }
.setup-steps a { text-decoration-color: rgba(var(--accent-rgb), .4); text-underline-offset: 2px; }
.setup-steps strong { color: var(--text); }
.api-key-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 5px; border: 1px solid var(--line); background: var(--bg-deep); }
.api-key-row:focus-within { border-color: var(--accent); }
.api-key-row input { padding: 0 6px; font-size: 10px; }
.api-key-row .button { min-height: 34px; padding: 0 10px; font-size: 8px; }
.clear-key-button { margin-top: 7px; }
.security-note { display: flex; gap: 8px; margin-top: 16px; padding: 10px; border: 1px solid rgba(255, 189, 91, .23); background: rgba(255, 189, 91, .04); }
.security-note p { color: #ab9e85; font-size: 8px; }
.chat-panel { min-height: 580px; display: flex; flex-direction: column; }
.chat-header { min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 15px; border-bottom: 1px solid var(--line); }
.chat-header > div { display: grid; gap: 4px; }
.chat-header strong { display: flex; align-items: center; gap: 7px; font-size: 8px; font-weight: 500; letter-spacing: .06em; }
.chat-header strong .status-dot { width: 5px; height: 5px; }
.model-badge { padding: 6px 8px; border: 1px solid var(--line); color: var(--accent); font-size: 8px; letter-spacing: .06em; }
.chat-messages { flex: 1; min-height: 350px; display: flex; flex-direction: column; gap: 15px; padding: 17px; overflow: auto; }
.chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; min-height: 300px; text-align: center; }
.empty-glyph { display: grid; width: 47px; height: 47px; place-items: center; margin-bottom: 14px; border: 1px solid rgba(var(--accent-rgb), .35); color: var(--accent); font-size: 23px; }
.chat-empty > p:not(.eyebrow) { max-width: 280px; color: var(--muted); font-size: 9px; }
.empty-footer { margin-top: 23px; color: var(--dim); font-size: 7px; letter-spacing: .09em; }
.chat-message { max-width: 85%; padding: 11px 12px; border: 1px solid var(--line); overflow-wrap: anywhere; }
.chat-message.user { align-self: flex-end; border-color: rgba(var(--accent-rgb), .24); background: rgba(var(--accent-rgb), .07); }
.chat-message.assistant { align-self: flex-start; background: rgba(255, 255, 255, .025); }
.message-role { display: block; margin-bottom: 6px; color: var(--accent); font-size: 8px; letter-spacing: .1em; }
.chat-message.assistant .message-role { color: var(--accent-secondary); }
.message-text { margin: 0; color: var(--text); font-size: 10px; line-height: 1.7; white-space: pre-wrap; }
.message-error .message-role { color: var(--danger) !important; }
.typing-indicator { padding: 0 17px 9px; color: var(--accent); font-size: 8px; letter-spacing: .08em; }
.typing-dots { animation: ellipsis 1.2s steps(4, end) infinite; }
.chat-compose { margin: 0 12px; border: 1px solid var(--line); background: var(--bg-deep); }
.compose-field { display: flex; gap: 10px; padding: 9px 11px 2px; color: var(--accent); }
.compose-field textarea { width: 100%; resize: vertical; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 10px; line-height: 1.6; }
.compose-field textarea::placeholder { color: var(--dim); }
.compose-footer { min-height: 38px; display: flex; align-items: center; gap: 13px; padding: 4px 7px 7px 11px; }
.compose-footer > span { color: var(--dim); font-size: 7px; }
.compose-footer .compose-hint { margin-left: auto; }
.send-button { min-height: 30px; gap: 8px; padding: 0 10px; font-size: 8px; }
.keyboard-done-button { display: none; min-height: 30px; gap: 6px; padding: 0 9px; font-size: 8px; }
.chat-actions { display: flex; justify-content: space-between; gap: 10px; padding: 8px 14px 11px; color: var(--dim); font-size: 7px; letter-spacing: .05em; }
.chat-actions > div { display: flex; gap: 15px; }
.chat-actions .text-button { padding: 0; font-size: 7px; }

/* Public research builder */
.research-warning { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 13px; padding: 10px 13px; border-color: rgba(255, 189, 91, .25); background: rgba(255, 189, 91, .035); }
.research-warning > span { color: var(--warning); font-weight: 700; }
.research-warning p { margin: 0; color: #ab9e85; font-size: 9px; line-height: 1.6; }
.research-warning strong { color: var(--warning); font-size: 8px; letter-spacing: .05em; }
.research-layout { display: grid; grid-template-columns: minmax(250px, .85fr) minmax(0, 1.15fr); gap: 13px; }
.builder-panel, .query-output { min-width: 0; padding: 17px; }
.builder-panel h2, .query-output h2 { margin: 13px 0 20px; }
.terminal-select, .terminal-input { width: 100%; min-height: 40px; padding: 0 11px; border: 1px solid var(--line); color: var(--text); background: var(--bg-deep); font-size: 9px; }
.terminal-select:focus, .terminal-input:focus { border-color: var(--accent); outline: none; }
.terminal-select option { color: var(--text); background: var(--bg-deep); }
.field-optional { float: right; color: var(--dim); font-size: 8px; }
.build-query-button { width: 100%; justify-content: space-between; margin-top: 18px; }
.operator-guide { margin-top: 20px; border-top: 1px solid var(--line); }
.operator-guide summary { display: flex; justify-content: space-between; padding: 12px 0 4px; color: var(--muted); cursor: pointer; font-size: 8px; letter-spacing: .08em; list-style: none; }
.operator-guide summary::-webkit-details-marker { display: none; }
.operator-guide summary span { color: var(--accent); font-size: 13px; }
.operator-guide[open] summary span { transform: rotate(45deg); }
.operator-guide > div { padding: 6px 0; }
.operator-guide p { color: var(--muted); font-size: 8px; line-height: 1.7; }
.operator-guide code { color: var(--accent); }
.output-ready { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 8px; }
.output-ready i { width: 5px; height: 5px; }
.query-screen { position: relative; min-height: 132px; padding: 13px; border: 1px solid var(--line); background: var(--bg-deep); }
.query-prompt { display: block; margin-bottom: 14px; color: var(--dim); font-size: 8px; letter-spacing: .08em; }
.query-screen code { color: var(--accent); font-size: 10px; line-height: 1.8; overflow-wrap: anywhere; }
.query-cursor { display: inline-block; width: 6px; height: 11px; margin-left: 3px; background: var(--accent); vertical-align: middle; animation: cursor-blink 1s steps(2) infinite; }
.query-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 8px; margin-top: 11px; }
.query-actions .button { min-width: 0; justify-content: space-between; gap: 7px; padding: 0 10px; font-size: 8px; }
.copy-feedback { margin: 10px 0 0; color: var(--accent); font-size: 8px; letter-spacing: .08em; animation: copy-flash .5s ease; }
.domain-note { display: flex; gap: 9px; margin-top: 21px; padding: 10px; border: 1px solid var(--line); color: var(--accent); }
.domain-note p { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.6; }
.output-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 21px; color: var(--dim); font-size: 7px; letter-spacing: .06em; }

/* Logs and settings */
.logs-panel { min-height: 420px; padding: 17px; }
.log-list { display: grid; margin-top: 14px; }
.log-row { display: grid; grid-template-columns: 87px 72px 1fr; gap: 10px; padding: 11px 7px; border-top: 1px solid var(--line); font-size: 9px; }
.log-time { color: var(--dim); }.log-type { color: var(--accent); font-size: 8px; }.log-message { color: var(--muted); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.settings-card { padding: 17px; }
.settings-card h2 { margin: 15px 0 5px; }
.settings-card .deck-ai-note { margin: 16px 0 0; padding-top: 11px; border-top: 1px solid var(--line); font-size: 8px; }
.theme-options { display: grid; gap: 7px; margin-top: 19px; }
.theme-option { min-height: 40px; display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid var(--line); color: var(--muted); background: var(--bg-deep); cursor: pointer; font-size: 8px; letter-spacing: .06em; text-align: left; }
.theme-option i { width: 11px; height: 11px; border: 1px solid var(--option-color); border-radius: 50%; background: var(--option-color); box-shadow: 0 0 7px var(--option-color); }
.theme-option[data-theme="cyan"] { --option-color: #60f1dd; }.theme-option[data-theme="magenta"] { --option-color: #ff61c7; }.theme-option[data-theme="amber"] { --option-color: #ffbd5b; }.theme-option[data-theme="ghost"] { --option-color: #f0f3f5; }
.theme-option:hover, .theme-option.active { border-color: var(--option-color); color: var(--text); }
.theme-option b { color: var(--option-color); font-size: 7px; font-weight: 500; }
.device-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; letter-spacing: .04em; }
.device-row:first-of-type { margin-top: 18px; }
.device-row strong { color: var(--accent); font-size: 8px; font-weight: 500; text-align: right; }
.settings-disclaimer { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.install-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 13px; padding: 15px 17px; }
.install-card h2 { margin-top: 3px; }.install-card p { margin: 3px 0 0; }
.install-card .install-status { color: var(--accent); }
.install-card .button { flex: 0 0 auto; }
.install-toast { position: fixed; right: 22px; bottom: 22px; z-index: 35; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 30px); padding: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); animation: reveal-up .3s ease both; }
.toast-mark { width: 31px; height: 31px; display: grid; flex: 0 0 auto; place-items: center; color: var(--bg); background: var(--accent); font-family: var(--font-display); font-weight: 700; }
.install-toast strong { color: var(--text); font-size: 8px; letter-spacing: .05em; }
.install-toast p { margin: 2px 0 0; color: var(--muted); font-size: 8px; }
.install-toast .button { min-height: 32px; padding: 0 10px; font-size: 8px; }
.toast-close { padding: 2px 5px; border: 0; color: var(--muted); background: none; cursor: pointer; font-size: 18px; }

@keyframes dot-pulse { 50% { opacity: .56; box-shadow: 0 0 4px rgba(var(--accent-rgb), .45); } }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
@keyframes scan-shift { to { background-position: 0 8px; } }
@keyframes boot-progress { to { transform: scaleX(1); } }
@keyframes ellipsis { 0%, 20% { opacity: .15; } 40% { opacity: .4; } 60% { opacity: .7; } 80%, 100% { opacity: 1; } }
@keyframes cursor-blink { 50% { opacity: 0; } }
@keyframes reveal-up { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@keyframes copy-flash { 50% { text-shadow: 0 0 12px var(--accent); } }

@media (min-width: 1450px) {
  :root { --header-height: 82px; }
  .dashboard { padding-top: 28px; }
  .hero-card { min-height: 300px; padding: 25px 28px; }
  .system-card { padding: 21px; }
  .workspace-grid { grid-template-columns: 245px minmax(0, 1fr); gap: 23px; }
}
@media (max-width: 1000px) {
  .header-coordinates { margin-left: 35px; }
  .workspace-grid { grid-template-columns: 182px minmax(0, 1fr); gap: 13px; }
  .sidebar { padding-right: 9px; padding-left: 9px; }
  .status-bar { gap: 14px; }
  .status-metric { min-width: 119px; }
  .status-brand { display: none; }
  .ai-layout { grid-template-columns: minmax(220px, .75fr) minmax(0, 1.25fr); }
  .module-grid { grid-template-columns: 1fr 1fr; }
  .brand-note { display: none; }
}
@media (max-width: 720px) {
  :root { --header-height: 62px; --page-gutter: 14px; }
  body { font-size: 12px; }
  .site-header { padding: 0 14px; }
  .brand-lockup { gap: 9px; }
  .brand-mark { width: 29px; height: 29px; font-size: 15px; }
  .brand-copy strong { font-size: 10px; }
  .brand-copy small { font-size: 7px; letter-spacing: .1em; }
  .header-coordinates { display: none; }
  .header-live { font-size: 8px; }
  .auth-screen { min-height: calc(100vh - var(--header-height)); padding: 26px 15px 52px; }
  .deco-side-label { right: 5px; font-size: 7px; }
  .auth-card { padding: 21px 21px 20px; }
  .auth-emblem { margin-top: 25px; }
  .auth-footnote { font-size: 7px; }
  .dashboard { min-height: calc(100vh - var(--header-height)); padding: 10px 11px 86px; }
  .status-bar { min-height: 56px; gap: 10px; padding: 7px 9px; }
  .status-time { min-width: 83px; }
  .status-label { font-size: 7px; }
  .status-time strong { font-size: 13px; }
  .status-time small, .status-metric small { font-size: 7px; }
  .status-divider { height: 29px; }
  .status-metric { min-width: 93px; gap: 2px; }
  .status-metric strong { font-size: 8px; }
  .signal-metric { min-width: 47px; }
  .signal-metric small { display: none; }
  .status-spacer { min-width: 0; }
  .fullscreen-button { display: none; }
  .logout-button { min-height: 30px; gap: 6px; padding: 0 7px; font-size: 7px; }
  .workspace-grid { display: block; margin-top: 10px; }
  .sidebar { display: none; }
  .page-heading { min-height: 61px; margin-bottom: 10px; }
  .page-heading .eyebrow { font-size: 8px; }
  .page-heading h1 { font-size: clamp(19px, 5.2vw, 25px); }
  .heading-stamp { font-size: 7px; text-align: right; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .hero-card { min-height: 248px; padding: 17px; }
  .hero-copy { margin-top: 25px; }
  .hero-copy h2 { font-size: clamp(29px, 8vw, 40px); }
  .hero-glyph { right: 9%; width: 90px; height: 90px; opacity: .6; }
  .hero-description { max-width: 245px; }
  .hero-card > .button { min-height: 38px; }
  .system-card { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; padding: 12px; }
  .system-card .section-topline { grid-column: 1 / -1; }
  .system-readout { margin-top: 12px; }
  .system-footer { grid-column: 1 / -1; margin-top: 12px; padding-top: 8px; }
  .section-heading { margin-top: 19px; }
  .section-heading h2 { font-size: 15px; }
  .section-count { font-size: 7px; text-align: right; }
  .module-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .module-card { min-height: 160px; padding: 11px; }
  .module-name { font-size: 12px; }
  .module-description { font-size: 7px; }
  .module-link { font-size: 6px; }
  .dashboard-footer { font-size: 6px; }
  .mobile-footer { display: flex; justify-content: space-between; gap: 7px; margin-top: 16px; padding: 11px 0 0; border-top: 1px solid var(--line); color: var(--dim); font-size: 6px; letter-spacing: .06em; }
  .mobile-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr); padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-strong); background: rgba(5, 9, 13, .96); backdrop-filter: blur(12px); }
  .mobile-nav-link { display: grid; justify-items: center; gap: 1px; padding: 3px 0; border: 0; color: var(--dim); background: none; cursor: pointer; }
  .mobile-nav-link > span { font-size: 17px; line-height: 1.15; }
  .mobile-nav-link small { font-size: 6px; letter-spacing: .04em; }
  .mobile-nav-link.active { color: var(--accent); }
  .ai-layout, .research-layout, .settings-grid { grid-template-columns: 1fr; gap: 9px; }
  .ai-setup { padding: 13px; }
  .setup-icon { margin-top: 16px; }
  .ai-setup h2 { font-size: 15px; }
  .setup-steps { grid-template-columns: 1fr 1fr 1fr; gap: 7px; margin: 14px 0; }
  .setup-steps > div { grid-template-columns: 1fr; gap: 3px; font-size: 8px; }
  .security-note { margin-top: 12px; }
  .chat-panel { min-height: 440px; }
  .chat-messages { min-height: 245px; max-height: 48vh; padding: 12px; }
  .chat-empty { min-height: 220px; }
  .chat-message { max-width: 94%; }
  .chat-compose { margin: 0 8px; }
  .compose-footer { gap: 7px; }
  .compose-footer .compose-hint { display: none; }
  .keyboard-done-button:not([hidden]) { display: inline-flex; }
  .chat-actions { padding-right: 9px; padding-left: 9px; }
  .chat-actions > div { gap: 10px; }
  .builder-panel, .query-output { padding: 13px; }
  .research-warning { padding: 9px; }
  .log-row { grid-template-columns: 67px 59px 1fr; gap: 6px; font-size: 8px; }
  .install-card { align-items: flex-start; flex-direction: column; }
  .install-toast { right: 9px; bottom: calc(75px + env(safe-area-inset-bottom)); left: 9px; gap: 8px; padding: 9px; }
  .install-toast strong { font-size: 7px; }
  .install-toast p { font-size: 7px; }
  .toast-mark { width: 27px; height: 27px; }
  .toast-close { padding-left: 0; }
}
@media (max-width: 720px) {
  .input-wrap input,
  .api-key-row input,
  .terminal-input,
  .terminal-select,
  .compose-field textarea {
    font-size: 16px;
  }
}
@media (max-width: 400px) {
  .header-live { font-size: 7px; }
  .status-metric { min-width: 80px; }
  .signal-metric { min-width: 37px; }
  .module-card { min-height: 156px; }
  .module-index { font-size: 6px; }
  .dashboard-footer span:last-child { display: none; }
  .heading-stamp { max-width: 93px; line-height: 1.5; }
  .compose-footer > span { font-size: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
