
/* LeverUp docs assistant hi-fi components. Uses tokens.css only. */
*{box-sizing:border-box;margin:0;padding:0}
html{font-size:16px;height:100%;height:100dvh;background:var(--color-bg);color:var(--color-fg)}
body{font-family:var(--font-sans);font-feature-settings:'cv11','ss01';color:var(--color-fg);background-color:var(--color-bg);background-image:linear-gradient(var(--color-grid) 1px,transparent 1px),linear-gradient(90deg,var(--color-grid) 1px,transparent 1px);background-size:var(--grid-size) var(--grid-size);background-position:0 0;overflow:hidden;position:relative;-webkit-font-smoothing:antialiased;display:flex;flex-direction:column;height:100%;height:100dvh;min-height:0}
a{color:inherit}
button,input,textarea{font:inherit;color:inherit;background:none;border:0;outline:0}
/* focus: 2px lime ring + 2px offset (passes 3:1), glow is decoration */
:focus-visible,.is-focus{outline:2px solid var(--color-focus)!important;outline-offset:2px;box-shadow:var(--focus-glow)}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* notice bar (header, every screen) */
.notice{flex:none;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:var(--s-2) var(--s-3);min-height:40px;padding:var(--s-2) var(--s-4);background:var(--color-surface-2);border-bottom:1px solid var(--color-border);text-align:center}
.notice img{display:block;height:16px;width:auto;flex:none}
.notice-text{font-size:var(--fs-meta);line-height:20px;font-weight:500;color:var(--color-fg)}
.app{flex:1;min-height:0;display:flex;flex-direction:column}
.top{flex:none;display:flex;align-items:center;justify-content:space-between;height:56px;padding:0 var(--s-6);border-bottom:1px solid var(--color-border)}
.brand{display:flex;align-items:center;gap:var(--s-3);font-weight:600;font-size:var(--fs-sm);letter-spacing:-0.005em;color:var(--color-fg)}
.scope{font-size:var(--fs-meta);color:var(--color-muted)}
.avatar{flex:none;width:28px;height:28px;border-radius:var(--r-pill);background:var(--color-surface-2);border:1px solid var(--color-border);display:flex;align-items:center;justify-content:center;color:var(--color-muted)}
.main{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;align-items:center;width:100%;-webkit-overflow-scrolling:touch}
.col{width:100%;max-width:var(--column);padding:0 var(--s-6)}
.thread{flex:none;width:100%;display:flex;flex-direction:column;align-items:center;padding-top:var(--s-7);padding-bottom:var(--s-6)}
.dock{flex:none;width:100%;display:flex;flex-direction:column;align-items:center;padding-top:var(--s-3);border-top:1px solid var(--color-border)}
.foot{padding:var(--s-2) 0 var(--s-4);text-align:center;font-size:var(--fs-meta);line-height:20px;color:var(--color-muted)}
.hint{font-size:var(--fs-meta);line-height:20px;color:var(--color-muted);margin-top:var(--s-2);text-align:center}

/* composer */
.composer{display:flex;align-items:flex-end;gap:var(--s-2);border:1px solid var(--color-border-strong);border-radius:var(--r-panel);background:var(--color-surface);padding:var(--s-2) var(--s-2) var(--s-2) var(--s-4)}
.composer:focus-within{border-color:var(--color-border-strong);outline:2px solid var(--color-focus);outline-offset:2px;box-shadow:var(--focus-glow)}
.composer textarea{flex:1;resize:none;height:44px;padding:11px 0;font-size:var(--fs-body);line-height:22px;color:var(--color-fg);overflow:hidden}
.composer textarea:focus-visible,.composer textarea:focus{outline:none!important;box-shadow:none!important}
.composer textarea::placeholder{color:var(--color-muted);opacity:1}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--s-2);min-height:44px;min-width:44px;padding:0 var(--s-5);border-radius:var(--r-control);font-family:var(--font-sans);font-weight:600;font-size:var(--fs-meta);letter-spacing:.01em;cursor:pointer;transition:background var(--m-fast) var(--ease),border-color var(--m-fast) var(--ease)}
.btn-primary{background:var(--color-accent);color:var(--color-accent-fg)}
.btn-primary:hover{background:var(--color-accent-strong);filter:brightness(1.02)}
.btn-secondary{background:var(--color-surface);color:var(--color-fg-2);border:1px solid var(--color-border-strong)}
.btn-secondary:hover{background:var(--color-hover)}
.btn-icon{padding:0;width:44px}
.btn[aria-disabled=true]{background:var(--color-surface-3);color:var(--color-muted);cursor:not-allowed}

/* messages */
.row{display:flex;flex-direction:column;gap:var(--s-6);width:100%}
.msg-user{align-self:flex-end;max-width:80%;background:var(--color-surface-2);color:var(--color-fg);border-radius:var(--r-panel) var(--r-panel) 4px var(--r-panel);padding:var(--s-3) var(--s-4);font-size:var(--fs-body);line-height:var(--lh-body)}
.msg-bot{display:flex;gap:var(--s-4);font-size:var(--fs-body);line-height:var(--lh-body);color:var(--color-fg)}
.msg-bot>.avatar{margin-top:-1px}
.bot-body{flex:1;min-width:0}
.bot-body p+p,.bot-body p+ul,.bot-body ul+p{margin-top:var(--s-3)}
.bot-body ul{padding-left:1.15em}.bot-body li+li{margin-top:var(--s-2)}
.bot-body li::marker{color:var(--color-muted)}

/* citation marker */
.cite{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 7px;margin:0 2px;border-radius:var(--r-pill);background:var(--color-accent-tint);color:var(--color-accent-tint-fg);font-family:var(--font-mono);font-size:var(--fs-meta);font-weight:600;text-decoration:none;vertical-align:1px;line-height:1}

/* sources block */
.sources{margin-top:var(--s-5);border:1px solid var(--color-border);border-radius:var(--r-panel);background:var(--color-surface);overflow:hidden}
.sources h3{font-size:var(--fs-meta);line-height:20px;font-weight:600;color:var(--color-muted);padding:var(--s-3) var(--s-4) var(--s-1)}
.src{display:flex;align-items:center;gap:var(--s-3);min-height:52px;padding:var(--s-2) var(--s-4);text-decoration:none;border-top:1px solid var(--color-border)}
.sources h3+.src{border-top:0}
.src .n{flex:none;min-width:24px;height:24px;border-radius:var(--r-pill);background:var(--color-accent-tint);color:var(--color-accent-tint-fg);font-family:var(--font-mono);font-size:var(--fs-meta);font-weight:600;display:flex;align-items:center;justify-content:center}
.src .t{flex:1;min-width:0}
.src .ttl{display:block;font-size:var(--fs-sm);line-height:22px;font-weight:500;color:var(--color-accent);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}
.src .url{display:block;font-family:var(--font-mono);font-size:var(--fs-meta);line-height:20px;color:var(--color-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.src .ext{flex:none;color:var(--color-muted);display:flex}
.src.pending .skel{display:block;height:12px;border-radius:var(--r-pill);background:var(--color-surface-3);width:58%}
.src.pending .skel+.skel{margin-top:8px;width:36%}

/* streaming */
.status{display:flex;align-items:center;gap:var(--s-2);font-size:var(--fs-meta);line-height:20px;color:var(--color-muted);margin-top:var(--s-4)}
.dots{display:inline-flex;gap:4px}.dots i{width:6px;height:6px;border-radius:50%;background:var(--color-muted);display:block}
.dots i:nth-child(2){opacity:.7}.dots i:nth-child(3){opacity:.45}
.caret{display:inline-block;width:2px;height:1.15em;background:var(--color-accent);vertical-align:-3px;margin-left:3px;border-radius:1px}

/* empty / hero */
.hero{text-align:left;margin-top:var(--s-6);max-width:36rem}
.hero-leverup{display:block;font-size:var(--fs-hero-leverup);line-height:1.05;font-weight:800;letter-spacing:-0.03em;color:var(--color-accent)}
.hero-assistant{display:block;margin-top:var(--s-1);font-size:var(--fs-hero-assistant);line-height:1.1;font-weight:700;letter-spacing:-0.02em;color:var(--color-fg)}
.hero-sub{margin-top:var(--s-5);color:var(--color-muted);font-size:var(--fs-body);line-height:var(--lh-body);max-width:32rem}
.hero-actions{display:flex;flex-wrap:wrap;gap:var(--s-3);margin-top:var(--s-6)}
.hero-actions .btn{min-width:9.5rem}
.brand-compact{display:inline-flex;align-items:baseline;gap:0.28em;font-weight:700;font-size:var(--fs-sm);letter-spacing:-0.02em;white-space:nowrap}
.brand-compact .hero-leverup{display:inline;font-size:inherit;font-weight:800;color:var(--color-accent)}
.brand-compact .hero-assistant{display:inline;font-size:inherit;font-weight:700;color:var(--color-fg)}
.app.has-chat .thread{padding-top:var(--s-4)}
.chips{display:grid;grid-template-columns:1fr 1fr;gap:var(--s-3);margin-top:var(--s-7)}
.chip{display:flex;align-items:center;gap:var(--s-3);min-height:64px;padding:var(--s-3) var(--s-6);border:1px solid var(--color-border-strong);border-radius:var(--r-control);background:var(--color-surface);font-size:var(--fs-sm);line-height:20px;font-weight:500;text-align:left;color:var(--color-fg);text-decoration:none;transition:background var(--m-fast) var(--ease)}
.chip:hover{background:var(--color-hover)}
.chip svg{flex:none;color:var(--color-muted)}
.chip small{display:block;font-size:var(--fs-meta);line-height:20px;font-weight:400;color:var(--color-muted);margin-top:2px}

/* refusal: NEUTRAL (02 §12, LU-12). No danger tokens. */
.refusal{border:1px solid var(--color-border-strong);border-left:4px solid var(--color-accent);border-radius:var(--r-panel);background:var(--color-surface);padding:var(--s-5) var(--s-6)}
.refusal h2{display:flex;align-items:center;gap:var(--s-3);font-size:var(--fs-h3);line-height:28px;font-weight:600;letter-spacing:-0.015em;color:var(--color-fg)}
.refusal h2 svg{color:var(--color-muted);flex:none}
.refusal p{margin-top:var(--s-3);color:var(--color-fg-2);font-size:var(--fs-body);line-height:var(--lh-body)}
.refusal .sources{margin-top:var(--s-4);background:var(--color-bg);border-color:var(--color-border)}

/* error: the ONLY danger surface (06) */
.err{display:flex;gap:var(--s-3);align-items:flex-start;border:1px solid var(--color-status-danger);background:var(--color-status-danger-bg);border-radius:var(--r-panel);padding:var(--s-4) var(--s-4) var(--s-4) var(--s-5)}
.err>svg{color:var(--color-status-danger);flex:none;margin-top:1px}
.err .tx{flex:1}.err strong{display:block;font-size:var(--fs-body);line-height:22px;font-weight:600;color:var(--color-status-danger)}
.err span{display:block;margin-top:2px;font-size:var(--fs-sm);line-height:22px;color:var(--color-fg-2)}
.err .btn-secondary{border-color:var(--color-fg);color:var(--color-fg);flex:none}

/* gate */
.gate{flex:1;display:flex;align-items:center;justify-content:center;flex-direction:column;width:100%;padding:0 var(--s-4)}
.card{width:100%;max-width:400px;border:1px solid var(--color-border);border-radius:var(--r-panel);padding:var(--s-7);background:var(--color-surface)}
.card h1{font-size:var(--fs-h2);line-height:34px;font-weight:600;letter-spacing:-0.02em;color:var(--color-fg)}
.card p{margin-top:var(--s-2);color:var(--color-muted);font-size:var(--fs-sm);line-height:var(--lh-body)}
.card label{display:flex;align-items:center;gap:var(--s-2);margin-top:var(--s-6);font-size:var(--fs-meta);line-height:20px;font-weight:500;color:var(--color-fg-2)}
.card label svg{color:var(--color-muted)}
.field{display:block;width:100%;margin-top:var(--s-2);height:48px;border:1px solid var(--color-border-strong);border-radius:var(--r-control);background:var(--color-bg);padding:0 var(--s-4);font-size:var(--fs-body);color:var(--color-fg)}
.field::placeholder{color:var(--color-muted);opacity:1}
.field[type=password]:not(:placeholder-shown){letter-spacing:.18em}
.field.bad{border:2px solid var(--color-status-danger);padding:0 15px}
.field.bad.is-focus{outline-color:var(--color-focus)!important}
.fielderr{display:flex;gap:var(--s-2);align-items:flex-start;margin-top:var(--s-2);font-size:var(--fs-meta);line-height:20px;font-weight:500;color:var(--color-status-danger)}
.fielderr svg{flex:none;margin-top:1px}
.card .btn{width:100%;margin-top:var(--s-5)}
.card .hint{text-align:left;margin-top:var(--s-4)}

/* design notes (data-noaudit): live in the desktop gutter, never part of the UI */
.ann{position:absolute;border:1px dashed var(--color-border-strong);background:var(--color-bg);color:var(--color-muted);font-size:13px;line-height:1.45;padding:10px 12px;border-radius:var(--r-card);width:300px}
.ann b{display:block;font-family:var(--font-mono);font-size:11px;letter-spacing:.08em;font-weight:600;color:var(--color-fg-2);margin-bottom:4px}

/* < 640 (390 ref) */
body.m .top{height:48px;padding:0 var(--s-4)}
body.m .col{padding:0 var(--s-4)}
body.m .thread{padding-top:var(--s-5)}
body.m .chips{grid-template-columns:1fr;margin-top:var(--s-6);gap:var(--s-2)}
body.m .chip{min-height:48px;padding:var(--s-2) var(--s-5)}
body.m .hero{margin-top:var(--s-4)}
body.m .hero-actions{flex-direction:column;align-items:stretch}
body.m .hero-actions .btn{width:100%}
body.m .brand-compact{font-size:var(--fs-meta)}
body.m .scope{display:none}
body.m .msg-user{max-width:88%}
body.m .msg-bot>.avatar{display:none}
body.m .row{gap:var(--s-5)}
body.m .src .url{display:none}
body.m .src{min-height:48px}
body.m .notice{padding:var(--s-2) var(--s-4)}
body.m .refusal{padding:var(--s-4)}
body.m .refusal h2{font-size:1.125rem}
body.m .dock{padding-top:var(--s-3)}
body.m .foot{padding-bottom:var(--s-3)}
