:root {
  --ink: #171916;
  --ink-2: #242722;
  --paper: #f2f0e9;
  --paper-2: #e7e4dc;
  --line: #d2cec4;
  --muted: #74776f;
  --acid: #086cff;
  --acid-2: #0652c4;
  --navy: #0a2c5e;
  --navy-2: #0d3266;
  --signal: #f06435;
  --white: #fffef9;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
}

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* Brand name: IFF in accent blue, Lua inherits container color */
.brand-name { font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.brand-name i { font-style: normal; color: var(--acid); }

.login-shell { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(420px, .65fr); min-height: 100vh; }
.login-story { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: 42px 54px 34px; color: var(--paper); background:
  radial-gradient(circle at 76% 26%, rgba(8,108,255,.16), transparent 27%),
  linear-gradient(135deg, transparent 74%, rgba(255,255,255,.035) 74.2%, transparent 74.5%),
  linear-gradient(160deg, #0a2c5e, #0d3266 58%, #081f4a); }
.login-story::before { content: "01"; position: absolute; right: -3vw; bottom: -16vh; font: 700 min(45vw, 680px)/1 var(--serif); letter-spacing: -.1em; color: rgba(255,255,255,.025); pointer-events: none; }
.login-story::after { content: ""; position: absolute; width: 38vw; height: 38vw; right: 7vw; top: 8vh; border: 1px solid rgba(8,108,255,.35); border-radius: 50%; box-shadow: 0 0 0 70px rgba(8,108,255,.06), 0 0 0 140px rgba(8,108,255,.04); }
.brand-lockup { position: relative; z-index: 2; display: flex; align-items: center; gap: 14px; font: 600 20px/1 var(--sans); letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 58px; height: 42px; color: var(--white); background: var(--acid); border-radius: 2px; font: 800 10px/1 var(--mono); letter-spacing: -.02em; }
.story-copy { position: relative; z-index: 2; max-width: 760px; margin-bottom: 4vh; }
.eyebrow, .kicker { display: block; font: 600 12px/1.2 var(--mono); letter-spacing: .18em; text-transform: uppercase; }
.story-copy .eyebrow { margin-bottom: 24px; color: var(--acid); }
.story-copy h1 { margin: 0; font: 400 clamp(44px, 5.2vw, 88px)/.96 var(--serif); letter-spacing: -.075em; }
.story-copy h1 { font-family: "Microsoft YaHei", "微软雅黑", var(--sans); font-size: clamp(30px, 3.4vw, 46px); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
.story-copy h1 em { color: var(--acid); font-style: normal; }
.story-copy p { width: min(500px, 72%); margin: 30px 0 0; color: #b6c2d8; font-size: 15px; line-height: 1.9; }
.story-index { position: relative; z-index: 2; display: flex; align-items: center; gap: 18px; color: #8fa1bf; font: 500 11px/1 var(--mono); letter-spacing: .16em; }
.story-index i { width: 46px; height: 1px; background: #2a4a82; }

.login-panel { display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: 42px 12%; background: var(--paper); border-left: 1px solid #0e100e; }
.login-form { width: min(100%, 430px); margin: auto; display: grid; gap: 24px; }
.login-form > div:first-child { margin-bottom: 20px; }
.login-form .kicker { color: var(--signal); margin-bottom: 14px; }
.login-form h2 { margin: 0 0 12px; font: 500 34px/1.08 var(--serif); letter-spacing: -.055em; }
.login-form p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.login-form label, .create-user label { display: grid; gap: 9px; color: #50534d; font: 600 13px/1 var(--mono); letter-spacing: .05em; }
.login-form input, .create-user input { width: 100%; padding: 15px 0; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid #a9a69e; border-radius: 0; font: 500 16px/1 var(--sans); transition: border-color .2s; }
.login-form input:focus, .create-user input:focus { outline: 0; border-color: var(--ink); }
.primary { border: 0; padding: 14px 18px; color: var(--white); background: var(--acid); cursor: pointer; font: 600 13px/1 var(--mono); letter-spacing: .04em; transition: background .2s, transform .2s; }
.primary:hover { background: var(--acid-2); transform: translateY(-1px); }
.primary.wide { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 6px; padding: 17px 20px; }
.primary.wide b { font-size: 19px; }
.login-status { min-height: 20px; color: #a83e20; font-size: 14px; }
.demo-note { display: grid; gap: 5px; padding: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.35); font: 12px/1.5 var(--mono); }
.demo-note strong { color: var(--signal); margin-bottom: 3px; }
.demo-note span { user-select: all; }
.login-panel footer { display: flex; justify-content: space-between; padding-top: 24px; border-top: 1px solid var(--line); color: #898b84; font: 11px/1 var(--mono); letter-spacing: .08em; }

.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 380px; padding: 14px 18px; color: var(--white); background: var(--navy); border-left: 4px solid var(--acid); box-shadow: 0 18px 60px rgba(0,0,0,.25); font-size: 13px; animation: toast-in .25s ease both; }
.toast.error { border-left-color: var(--signal); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* Workspace */
.workspace { display: grid; grid-template-columns: 74px 286px minmax(0,1fr); height: 100vh; overflow: hidden; background: var(--paper); }
.workspace.collapsed { grid-template-columns: 74px 0 minmax(0,1fr); }
.workspace.collapsed .sidebar { display: none; }
.rail { display: flex; flex-direction: column; align-items: center; padding: 18px 0; color: #b7c4da; background: linear-gradient(180deg, var(--navy), #0a2c5e); border-right: 1px solid #123a77; }
.rail-brand { display: grid; place-items: center; width: 58px; height: 40px; margin-bottom: 52px; border: 0; border-radius: 2px; color: var(--white); background: var(--acid); font: 800 10px/1 var(--mono); letter-spacing: -.02em; cursor: pointer; }
.rail nav { display: grid; gap: 5px; width: 100%; }
.rail-item { position: relative; display: grid; justify-items: center; gap: 7px; width: 100%; padding: 15px 0; border: 0; color: #8fa1bf; background: transparent; cursor: pointer; }
.rail-item::before { content:""; position:absolute; left:0; top:18%; width:2px; height:64%; background:transparent; }
.rail-item span { font: 600 13px/1 var(--mono); }
.rail-item b { font-size: 14px; font-weight: 500; }
.rail-item:hover, .rail-item.active { color: var(--white); }
.rail-item.active::before { background: var(--acid); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; margin-top: auto; border: 1px solid #3d5a8f; border-radius: 50%; color: var(--white); background: transparent; font: 600 12px/1 var(--serif); cursor: pointer; }
.avatar:hover { color: var(--white); background: var(--acid); border-color: var(--acid); }

.sidebar { display: flex; flex-direction: column; min-width: 0; height: 100vh; padding: 0 20px; background: var(--navy-2); color: #d8dbd2; border-right: 1px solid #0b2a55; }
.sidebar-head { height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #23509b; }
.brand-line { display: grid; gap: 4px; }
.brand-line strong { font: 700 20px/1 var(--serif); color: var(--white); }
.brand-line span { color: #8fa1bf; font: 500 11px/1 var(--mono); letter-spacing: .18em; }
.sidebar-head-actions { display: flex; align-items: center; }
.panel-toggle { border: 0; color: #aebcda; background: transparent; font-size: 16px; cursor: pointer; padding: 6px; }
.panel-toggle:hover { color: var(--white); }
.quota-card { margin: 20px 0 16px; padding: 15px; color: var(--white); background: linear-gradient(135deg, var(--acid), var(--acid-2)); border-radius: 2px; }
.quota-card > div { display: flex; justify-content: space-between; align-items: baseline; }
.quota-card span { font: 600 12px/1 var(--mono); letter-spacing: .06em; }
.quota-card strong { font: 600 24px/1 var(--serif); letter-spacing: -.04em; }
.quota-card progress { display: block; width: 100%; height: 3px; margin: 14px 0 9px; appearance: none; }
.quota-card progress::-webkit-progress-bar { background: rgba(255,255,255,.25); }
.quota-card progress::-webkit-progress-value { background: var(--white); }
.quota-card progress::-moz-progress-bar { background: var(--white); }
.quota-card small { font: 500 11px/1 var(--mono); color: rgba(255,255,255,.75); }
.new-chat { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 3px; border: 0; border-bottom: 1px solid #23509b; color: var(--white); background: transparent; cursor: pointer; font-size: 13px; text-align: left; }
.new-chat span { color: var(--acid); font-size: 18px; font-weight: 300; }
.new-chat:hover { color: var(--acid); }
.history-label { display: flex; justify-content: space-between; margin: 24px 2px 12px; color: #8fa1bf; font: 600 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.history-label b { color: #aebcda; }
.conversation-list { min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #3d5a8f transparent; }
.conversation { position: relative; display: grid; gap: 6px; width: 100%; padding: 11px 10px; border: 0; border-left: 2px solid transparent; color: #aebcda; background: transparent; text-align: left; cursor: pointer; }
.conversation span { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.conversation small { color: #6f84a8; font: 10px/1 var(--mono); }
.conversation:hover { background: #0e3a6e; }
.conversation.active { border-left-color: var(--acid); color: var(--white); background: #10396b; }
.empty-history { padding: 18px 10px; color: #7488a8; font-size: 12px; }
.sidebar-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 17px 2px; border-top: 1px solid #23509b; color: #8fa1bf; font: 600 11px/1 var(--mono); }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 3px rgba(8,108,255,.12); }

.stage { min-width: 0; height: 100vh; display: flex; flex-direction: column; }
.stage-head { height: 78px; flex: 0 0 78px; display: flex; justify-content: space-between; align-items: center; padding: 0 28px; background: var(--paper); border-bottom: 1px solid var(--line); }
.stage-head > div:first-child { display: flex; align-items: center; gap: 13px; }
.section-no { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid var(--acid); color: var(--acid); font: 600 11px/1 var(--mono); }
.stage-head h1 { margin: 0; font: 500 20px/1 var(--serif); letter-spacing: -.025em; }
.head-meta { display: flex; align-items: center; gap: 11px; color: #777a73; font: 600 11px/1 var(--mono); letter-spacing: .05em; }
.head-meta i { width: 3px; height: 3px; border-radius: 50%; background: var(--signal); }
.view-root { flex: 1; min-height: 0; overflow: auto; }

.chat-layout { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 270px; height: 100%; }
.chat-layout.ev-collapsed { grid-template-columns: minmax(0,1fr) 0; }
.chat-main { min-width: 0; display: flex; flex-direction: column; height: 100%; }
.evidence-toggle { position: absolute; z-index: 6; top: 50%; transform: translateY(-50%); right: 12px; display: flex; align-items: center; gap: 6px; padding: 12px 9px; border: 1px solid var(--line); background: var(--white); color: var(--ink); font: 600 12px/1 var(--sans); cursor: pointer; border-radius: 2px; box-shadow: 0 6px 18px rgba(24,26,22,.1); transition: right .2s, color .2s, border-color .2s; }
.chat-layout:not(.ev-collapsed) .evidence-toggle { right: 282px; }
.evidence-toggle b { color: var(--acid); font-size: 11px; }
.evidence-toggle:hover { color: var(--acid); border-color: var(--acid); }
.messages { flex: 1; min-height: 0; overflow: auto; padding: 32px clamp(24px, 5vw, 78px) 24px; scroll-behavior: smooth; }
.chat-blank { max-width: 820px; margin: max(3vh,24px) auto 0; }
.chat-blank .eyebrow, .library-hero .eyebrow, .admin-intro .eyebrow { margin-bottom: 20px; color: var(--signal); }
.chat-blank h2, .library-hero h2 { margin: 0; font: 400 clamp(26px, 3.2vw, 42px)/1.06 var(--serif); letter-spacing: -.05em; }
.chat-blank h2 { font-family: "Microsoft YaHei", "微软雅黑", var(--sans); font-size: clamp(22px, 2.6vw, 32px); font-weight: 600; letter-spacing: -.01em; }
.admin-intro h2 { margin: 0; font: 400 clamp(22px, 2.8vw, 34px)/1.1 var(--serif); letter-spacing: -.045em; }
.chat-blank > p, .library-hero > p, .admin-intro > p { max-width: 570px; margin: 22px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.prompt-grid { display: grid; grid-template-columns: 1fr 1fr; margin-top: 38px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.prompt-card { display: grid; grid-template-columns: 32px 1fr 20px; align-items: center; gap: 8px; min-height: 88px; padding: 18px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.16); text-align: left; cursor: pointer; transition: background .2s; }
.prompt-card span { color: var(--signal); font: 600 11px/1 var(--mono); }
.prompt-card b { font: 500 13px/1.55 var(--sans); }
.prompt-card i { font-style: normal; color: #999c94; }
.prompt-card:hover { background: var(--white); }
.prompt-card:hover i { color: var(--signal); }

.message { display: grid; grid-template-columns: 88px minmax(0, 740px); gap: 20px; max-width: 900px; margin: 0 auto 34px; }
.message-label { display: flex; align-items: flex-start; gap: 8px; padding-top: 3px; }
.message-label span { display: grid; place-items: center; width: 26px; height: 26px; color: var(--white); background: var(--navy); border-radius: 50%; font: 600 10px/1 var(--mono); }
.message.assistant .message-label span { color: var(--white); background: var(--acid); border-radius: 2px; }
.message-label b { padding-top: 7px; font: 600 11px/1 var(--mono); white-space: nowrap; }
.message-body { min-width: 0; color: #32352f; font-size: 14px; line-height: 1.78; }
.message.user .message-body { padding: 14px 17px; background: var(--paper-2); border-left: 2px solid #ada99f; }
.message-body > :first-child { margin-top: 0; }
.message-body > :last-child { margin-bottom: 0; }
.message-body h1, .message-body h2, .message-body h3 { margin: 26px 0 10px; color: var(--ink); font-family: var(--serif); letter-spacing: -.025em; }
.message-body h1 { font-size: 24px; } .message-body h2 { font-size: 20px; } .message-body h3 { font-size: 16px; }
.message-body p { margin: 8px 0; }
.message-body ul { margin: 10px 0; padding-left: 19px; }
.message-body li { margin: 5px 0; }
.message-body blockquote { margin: 14px 0; padding: 11px 14px; border-left: 2px solid var(--signal); background: #ebe8df; color: #62655e; }
.message-body code { font: 11px/1.6 var(--mono); }
.citation { display: inline-block; padding: 1px 5px; border: 1px solid #aab49a; color: #4c6535; background: #edf2e2; border-radius: 2px; font: 600 10px/1.4 var(--mono); white-space: nowrap; }
.codebox { margin: 16px 0; overflow: hidden; background: #10131c; color: #d8ded0; border-radius: 3px; box-shadow: 0 12px 30px rgba(20,22,19,.1); }
.codebar { display: flex; justify-content: space-between; align-items: center; padding: 9px 13px; border-bottom: 1px solid #1f2735; color: #8fa1bf; font: 600 11px/1 var(--mono); }
.codebar button { border: 0; color: var(--acid); background: transparent; font: inherit; cursor: pointer; }
.codebox pre { max-height: 460px; overflow: auto; margin: 0; padding: 17px; }
.codebox code { color: inherit; font: 11px/1.72 var(--mono); white-space: pre; }
.scan-line { display: flex; gap: 6px; margin: 4px 0 12px; }
.scan-line i { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); animation: scan 1s infinite ease-in-out; }
.scan-line i:nth-child(2) { animation-delay: .16s; }.scan-line i:nth-child(3) { animation-delay: .32s; }
@keyframes scan { 0%,80%,100% { opacity:.25; transform:translateY(0) } 40% { opacity:1; transform:translateY(-4px) } }

.composer { flex: 0 0 auto; margin: 0 clamp(20px, 4vw, 62px) 22px; border: 1px solid #b8b4aa; background: var(--white); box-shadow: 0 14px 44px rgba(24,26,22,.08); }
.composer-top, .composer-bottom { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; }
.composer-top { border-bottom: 1px solid #e1ded5; color: #8a8c85; font: 600 11px/1 var(--mono); }
.composer-top label { display: flex; align-items: center; gap: 9px; }
.composer-top select { border: 0; color: var(--ink); background: transparent; font: 600 11px/1 var(--mono); }
.composer textarea { display: block; width: 100%; min-height: 150px; max-height: 260px; resize: vertical; padding: 14px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; line-height: 1.65; }
.composer-bottom { padding-top: 4px; color: #989b93; font: 600 11px/1 var(--mono); }
kbd { padding: 2px 4px; border: 1px solid #d3d0c7; background: var(--paper); font: inherit; }
.send { padding: 10px 13px; border: 0; color: var(--white); background: var(--acid); cursor: pointer; font: 600 12px/1 var(--mono); }
.send b { margin-left: 10px; color: var(--white); }
.send:hover { background: var(--acid-2); }
.send:disabled { opacity: .45; cursor: wait; }

.evidence-panel { overflow: auto; padding: 0 18px 20px; border-left: 1px solid var(--line); background: #e9e6dd; }
.evidence-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; padding: 20px 0 13px; background: #e9e6dd; border-bottom: 1px solid #cbc7bd; font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.evidence-head b { color: var(--signal); }
.source-card { padding: 16px 2px; border-bottom: 1px solid #cbc7bd; }
.source-card > div { display: flex; justify-content: space-between; color: var(--signal); font: 600 10px/1 var(--mono); text-transform: uppercase; }
.source-card h3 { margin: 9px 0 8px; font: 500 13px/1.45 var(--serif); }
.source-card code { display: block; overflow: hidden; color: #7b7e76; font: 10px/1.5 var(--mono); text-overflow: ellipsis; }
.source-card a { display: inline-block; margin-top: 9px; color: #424a38; font: 600 11px/1 var(--mono); text-decoration: none; }
.evidence-empty { margin-top: 34px; color: #90938b; text-align: center; }
.evidence-empty span { font: 300 36px/1 var(--serif); }
.evidence-empty p { font-size: 13px; line-height: 1.7; }

/* Libraries and administration */
.library-view { height: 100%; overflow: auto; }
.library-hero { padding: clamp(38px, 7vh, 78px) clamp(28px, 7vw, 104px) 44px; border-bottom: 1px solid var(--line); background:
  linear-gradient(90deg, transparent 49.9%, rgba(23,25,22,.035) 50%, transparent 50.1%),
  linear-gradient(rgba(23,25,22,.025) 1px, transparent 1px); background-size: 100% 100%, 100% 34px; }
.library-hero h2 { max-width: 850px; }
.library-search { display: flex; max-width: 760px; margin-top: 32px; border-bottom: 2px solid var(--acid); }
.library-search input { flex: 1; min-width: 0; padding: 14px 3px; border: 0; outline: 0; background: transparent; font: 500 15px/1 var(--sans); }
.library-search button { border: 0; color: var(--white); background: var(--acid); padding: 0 19px; cursor: pointer; font: 600 12px/1 var(--mono); }
.library-search button:hover { background: var(--acid-2); }
.result-section { padding: 27px clamp(28px, 7vw, 104px) 80px; }
.result-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--acid); font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .09em; }
.result-head small { color: var(--muted); font: inherit; }
.search-results { display: grid; }
.search-result { display: grid; grid-template-columns: 55px minmax(0,1fr); gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.result-rank { color: var(--signal); font: 600 12px/1 var(--mono); padding-top: 4px; }
.search-result span { color: #74786f; font: 600 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.search-result h3 { margin: 7px 0; font: 500 17px/1.25 var(--serif); }
.search-result p { max-width: 800px; margin: 0 0 9px; color: #696c65; font-size: 13px; line-height: 1.7; }
.search-result code { color: #8c8f87; font: 10px/1.4 var(--mono); }
.result-placeholder { padding: 48px 0; color: #93968e; font: 500 12px/1 var(--mono); text-align: center; }
.error-text { color: #a83e20; }

.admin-view { display: grid; grid-template-columns: minmax(300px,1fr) minmax(520px,2fr); grid-template-areas: "intro list" "create list"; gap: 0; height: 100%; overflow: hidden; }
.admin-intro { grid-area: intro; padding: clamp(22px,4vw,40px); border-right: 1px solid var(--line); }
.create-user { grid-area: create; padding: clamp(16px,2.6vw,26px); border-right: 1px solid var(--line); border-top: 1px solid var(--line); background: var(--white); }
.panel-title { display: flex; justify-content: space-between; align-items: center; padding-bottom: 11px; border-bottom: 1px solid var(--acid); font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.panel-title b { color: var(--signal); font-size: 17px; }
.create-user form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; margin-top: 16px; }
.create-user .primary { justify-self: start; align-self: end; min-width: 140px; }
.user-list { grid-area: list; padding: 24px 26px; overflow: auto; scrollbar-width: thin; }
.user-row { display: grid; grid-template-columns: .5fr 1.5fr .75fr .75fr .75fr .6fr; gap: 14px; align-items: center; min-height: 62px; border-bottom: 1px solid var(--line); font-size: 12px; }
.user-row.header { position: sticky; top: 0; background: var(--paper); z-index: 1; min-height: 42px; color: var(--muted); font: 600 11px/1 var(--mono); text-transform: uppercase; }
.user-row > span { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.user-row > span:first-child { display: block; }
.user-row .rank { color: var(--signal); font: 600 12px/1 var(--mono); }
.user-row b { font-weight: 600; white-space: nowrap; }
.user-row small { color: var(--muted); font: 10px/1 var(--mono); }
.user-row .status-dot { width: 6px; height: 6px; }
.user-row .usage { color: #3c4046; }
.table-loading { padding: 30px 0; color: var(--muted); font: 12px/1 var(--mono); }

@media (max-width: 1120px) {
  .workspace { grid-template-columns: 68px 240px minmax(0,1fr); }
  .workspace.collapsed { grid-template-columns: 68px 0 minmax(0,1fr); }
  .chat-layout { grid-template-columns: minmax(0,1fr) 225px; }
  .chat-layout.ev-collapsed { grid-template-columns: minmax(0,1fr) 0; }
  .chat-layout:not(.ev-collapsed) .evidence-toggle { right: 237px; }
  .message { grid-template-columns: 70px minmax(0,1fr); }
  .admin-intro { padding: 26px; }
  .create-user { padding: 20px; }
}

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-story { min-height: 42vh; padding: 28px; }
  .story-copy { margin: 50px 0 20px; }
  .story-copy h1 { font-size: clamp(44px, 11vw, 74px); }
  .story-copy p { width: 85%; margin-top: 22px; }
  .story-index { display: none; }
  .login-panel { min-height: 58vh; padding: 40px 9%; border: 0; }
  .login-panel footer { margin-top: 40px; }
  .workspace { grid-template-columns: 60px minmax(0,1fr); }
  .sidebar { display: none; }
  .chat-layout { grid-template-columns: 1fr; }
  .evidence-panel { display: none; }
  .admin-view { grid-template-columns: 1fr; grid-template-areas: "intro" "create" "list"; overflow: auto; }
  .admin-intro { border-right: 0; }
  .user-list { overflow: visible; }
}

@media (max-width: 620px) {
  .login-story { min-height: 37vh; }
  .story-copy h1 { letter-spacing: -.06em; }
  .story-copy p { display: none; }
  .login-panel { padding: 34px 24px; }
  .workspace { grid-template-columns: 52px minmax(0,1fr); }
  .rail { padding-top: 12px; }
  .rail-brand { width: 46px; height: 34px; margin-bottom: 30px; font-size: 9px; }
  .rail-item span { font-size: 12px; }
  .rail-item b { font-size: 13px; }
  .stage-head { height: 62px; flex-basis: 62px; padding: 0 15px; }
  .head-meta { display: none; }
  .messages { padding: 22px 14px 16px; }
  .chat-blank { margin-top: 10px; }
  .chat-blank h2 { font-size: 30px; }
  .prompt-grid { grid-template-columns: 1fr; margin-top: 25px; }
  .prompt-card { min-height: 64px; }
  .message { grid-template-columns: 1fr; gap: 8px; margin-bottom: 25px; }
  .message-label { align-items: center; }
  .message-label b { padding-top: 0; }
  .composer { margin: 0 10px 10px; }
  .composer-bottom > span { display: none; }
  .composer-bottom { justify-content: flex-end; }
  .library-hero, .result-section { padding-left: 20px; padding-right: 20px; }
  .library-hero h2 { font-size: 30px; }
  .library-search button { padding: 0 10px; }
  .search-result { grid-template-columns: 35px 1fr; gap: 8px; }
  .admin-intro, .create-user, .user-list { padding: 22px 20px; }
  .create-user form { grid-template-columns: 1fr; }
  .user-row { grid-template-columns: .5fr 1.2fr 1fr 1fr; padding: 13px 0; }
  .user-row.header { display: none; }
  .user-row .col-week, .user-row .col-month { display: none; }
}

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