@font-face { font-family: "DM Sans"; src: url(/DMSans.ttf) format("truetype-variations"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url(/DMMono.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(/InstrumentSerif-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }

/* Vera's palette. Dark is the default; light follows the OS. */
:root {
  --surface-base: #17191c;
  --surface-sunken: #121417;
  --surface-side: #1c2024;
  --surface-lift: #24292e;
  --surface-hover: #e9e6e20f;
  --surface-active: #2d3339;
  --border-base: #24292e;
  --border-subtle: #2d3339;
  --border-element: #3a434c;
  --content-strong: #fdfdfc;
  --content-default: #f6f5f4;
  --content-secondary: #a9b2bb;
  --content-tertiary: #8d99a5;
  --content-faint: #5a6672;
  --accent: #e83f5b;
  --accent-hover: #f45a73;
  --accent-soft: #e83f5b1f;
  --ok: #3fb984;
  --ok-soft: #3fb9841f;
  --warn: #e3a33b;
  --warn-soft: #e3a33b1f;
  --bad: #ef5d5d;
  --bad-soft: #ef5d5d1f;
  --shadow: 0 1px 0 #ffffff08 inset, 0 10px 30px #0006;
  --radius: 14px;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, Menlo, monospace;
  --font-serif: "Instrument Serif", Georgia, serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --surface-base: #f6f5f4;
    --surface-sunken: #efedea;
    --surface-side: #fdfdfc;
    --surface-lift: #ffffff;
    --surface-hover: #24292e0d;
    --surface-active: #e9e6e2;
    --border-base: #e9e6e2;
    --border-subtle: #e9e6e2;
    --border-element: #cfccc9;
    --content-strong: #161616;
    --content-default: #24292e;
    --content-secondary: #5a6672;
    --content-tertiary: #71808e;
    --content-faint: #a9b2bb;
    --accent: #d8304d;
    --accent-hover: #c92e48;
    --accent-soft: #e83f5b17;
    --shadow: 0 1px 2px #0000000d, 0 8px 24px #0000000f;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--surface-base); color: var(--content-default);
  font: 15px/1.55 var(--font-sans); -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em; }
.muted { color: var(--content-secondary); }
.small { font-size: 13px; }
.center { text-align: center; }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
a { color: var(--content-strong); }

/* ── The V mark (Vera's working mark) ───────────────────────────── */
.mark { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; flex-shrink: 0; }
.mark .spin, .mark .arm-l, .mark .arm-r { transform-box: view-box; }
.mark .spin { transform-origin: 12px 12.5px; }
.mark .arm-l, .mark .arm-r { transform-origin: 12px 19px; }
.mark .arm-l { transform: rotate(-4deg); }
.mark .arm-r { transform: rotate(4deg); }
.mark.working .spin { animation: v-spin 3s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
.mark.working .arm-l { animation: v-flap-l 3s ease-in-out infinite; }
.mark.working .arm-r { animation: v-flap-r 3s ease-in-out infinite; }
@keyframes v-spin { 0%, 50% { transform: rotate(0); } 88%, 100% { transform: rotate(360deg); } }
@keyframes v-flap-l { 0%, 25%, 50%, 100% { transform: rotate(-4deg); } 12.5%, 37.5% { transform: rotate(17deg); } }
@keyframes v-flap-r { 0%, 25%, 50%, 100% { transform: rotate(4deg); } 12.5%, 37.5% { transform: rotate(-17deg); } }
@media (prefers-reduced-motion: reduce) { .mark.working .spin, .mark.working .arm-l, .mark.working .arm-r { animation: none; } }

.boot { position: fixed; inset: 0; display: grid; place-items: center; }

/* ── Buttons, pills ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border-subtle);
  background: var(--surface-lift); color: var(--content-default); font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover:not(:disabled) { background: var(--surface-active); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.ghost { background: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--surface-hover); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn.wide { width: 100%; }
a.btn { text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .soon { font-size: 11px; padding: 1px 6px; border-radius: 99px; background: var(--surface-active); color: var(--content-tertiary); font-weight: 500; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: var(--content-secondary); }
.icon-btn:hover { background: var(--surface-hover); color: var(--content-default); }
.link { background: none; border: 0; padding: 0; color: var(--content-tertiary); font-size: 13px; }
.link:hover { color: var(--content-default); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 500; background: var(--surface-active); color: var(--content-secondary); white-space: nowrap; }
.pill.demo { height: 20px; padding: 0 8px; font-size: 11px; background: var(--warn-soft); color: var(--warn); margin-left: auto; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.run { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }

/* ── Sign in ─────────────────────────────────────────────────────── */
.login { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; gap: 18px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 34px 28px 26px; background: var(--surface-side); border: 1px solid var(--border-base); border-radius: 20px; box-shadow: var(--shadow); text-align: center; }
.login-card h1 { font-size: 34px; margin: 4px 0 0; line-height: 1.1; color: var(--content-strong); }
.login-card p { margin: 0 0 8px; font-size: 14px; }
.login-card input { width: 100%; height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-element); background: var(--surface-base); outline: none; letter-spacing: .08em; }
.login-card input:focus { border-color: var(--accent); }
.error-text { color: var(--bad); font-size: 13.5px; min-height: 1.2em; margin: 2px 0 0 !important; }
.powered { font-size: 12px; color: var(--content-tertiary); letter-spacing: .02em; }

/* ── Shell ───────────────────────────────────────────────────────── */
.shell { display: flex; height: 100%; }
.sidebar { width: 272px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--surface-side); border-right: 1px solid var(--border-base); padding: 14px 10px 10px; }
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px 14px; font-weight: 600; font-size: 15.5px; color: var(--content-strong); }
.btn.new { justify-content: flex-start; width: 100%; height: 38px; background: transparent; border-color: var(--border-subtle); }
.side-label { margin: 20px 10px 6px; font-size: 12px; color: var(--content-tertiary); font-weight: 500; letter-spacing: .02em; }
.history { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; margin: 0 -2px; padding: 0 2px; }
.h-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 9px; border: 0; background: transparent; color: var(--content-default); }
.h-item:hover { background: var(--surface-hover); }
.h-item.active { background: var(--surface-active); }
.h-text { flex: 1; min-width: 0; }
.h-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-sub { font-size: 12px; color: var(--content-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-glyph { width: 16px; height: 16px; display: grid; place-items: center; flex-shrink: 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--content-faint); }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); }
.h-empty { padding: 10px; font-size: 13px; color: var(--content-tertiary); }
.side-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 4px; border-top: 1px solid var(--border-base); margin-top: 8px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.topbar { height: 54px; flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid transparent; }
.top-title { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--content-strong); }
.top-title[contenteditable="true"] { outline: 1px solid var(--border-element); border-radius: 6px; padding: 2px 6px; }
.only-mobile { display: none; }
.view { flex: 1; min-height: 0; }
.scrim { position: fixed; inset: 0; background: #0008; z-index: 30; }

/* ── New analysis ────────────────────────────────────────────────── */
.new-view { overflow-y: auto; display: flex; }
.new-inner { width: 100%; max-width: 720px; margin: auto; padding: 24px 20px 60px; }
.hero { font-size: clamp(34px, 5vw, 46px); line-height: 1.08; text-align: center; margin: 0 0 8px; color: var(--content-strong); }
.drop { display: block; margin: 26px 0 14px; border: 1.5px dashed var(--border-element); border-radius: var(--radius); background: var(--surface-sunken); cursor: pointer; transition: border-color .15s, background .15s; outline: none; }
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop.has-file { border-style: solid; border-color: var(--border-subtle); background: var(--surface-side); cursor: default; }
.drop-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 40px 16px; color: var(--content-secondary); }
.drop-empty strong { color: var(--content-default); font-weight: 500; margin-top: 6px; }
.drop-file { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; }
.file-icon { width: 42px; height: 50px; flex-shrink: 0; border-radius: 7px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 600 11px var(--font-mono); letter-spacing: .05em; }
.file-meta { flex: 1; min-width: 0; }
.file-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 4px; border-radius: 4px; background: var(--surface-active); margin-top: 9px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .2s; }
.bar.done span { background: var(--ok); }

.composer { background: var(--surface-side); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 10px 10px 10px 14px; box-shadow: var(--shadow); transition: border-color .15s; }
.composer:focus-within { border-color: var(--border-element); }
.composer textarea { width: 100%; resize: none; border: 0; outline: none; background: transparent; padding: 4px 0; line-height: 1.5; max-height: 220px; }
.composer textarea::placeholder { color: var(--content-tertiary); }
.composer-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 6px; }
.chips { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 28px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--border-subtle); background: transparent; color: var(--content-secondary); font-size: 12.5px; }
.chip:hover { color: var(--content-default); background: var(--surface-hover); }
.hint { text-align: center; margin-top: 14px; }

/* ── Transcript ──────────────────────────────────────────────────── */
.job-view { display: flex; flex-direction: column; }
.transcript { flex: 1; overflow-y: auto; padding: 12px 20px 30px; scroll-behavior: smooth; }
.transcript > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.transcript > .wide { max-width: 1080px; }
.msg { margin: 18px auto; }
.msg.user { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.bubble { max-width: 85%; background: var(--surface-lift); border-radius: 18px 18px 6px 18px; padding: 10px 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.file-chip { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--surface-side); max-width: 85%; text-decoration: none; color: inherit; }
.file-chip:hover { border-color: var(--border-element); }
.file-chip .file-icon { width: 32px; height: 38px; font-size: 9.5px; }
.file-chip .t { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip .s { font-size: 12px; color: var(--content-tertiary); }

.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md h1, .md h2, .md h3 { font-size: 16px; margin: 16px 0 6px; color: var(--content-strong); }
.md strong { color: var(--content-strong); font-weight: 600; }
.md code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-lift); padding: 1px 5px; border-radius: 5px; }
.md table { border-collapse: collapse; margin: 8px 0 12px; font-size: 13.5px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border-subtle); padding: 5px 9px; text-align: left; }
.md em { color: var(--content-secondary); }

/* progress card */
.progress { margin: 14px auto; }
.prog-head { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 6px 0; text-align: left; }
.prog-label { font-weight: 500; color: var(--content-default); }
.prog-label.shimmer { background: linear-gradient(90deg, var(--content-secondary) 0%, var(--content-strong) 50%, var(--content-secondary) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 2.2s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.prog-meta { color: var(--content-tertiary); font-size: 13px; margin-left: auto; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.chev { transition: transform .2s; }
.progress.open .chev { transform: rotate(90deg); }
.steps { display: none; margin: 4px 0 0 7px; padding: 4px 0 4px 18px; border-left: 1px solid var(--border-subtle); }
.progress.open .steps { display: block; }
.step { display: flex; gap: 9px; align-items: baseline; padding: 3px 0; font-size: 13.5px; color: var(--content-secondary); animation: rise .25s ease-out; }
.step .k { width: 14px; flex-shrink: 0; text-align: center; color: var(--content-tertiary); font-size: 12px; }
.step.think { font-style: italic; }
.step.note { color: var(--warn); }
.step .when { margin-left: auto; padding-left: 10px; font: 11.5px var(--font-mono); color: var(--content-faint); white-space: nowrap; }
.progress.done .mark { stroke: var(--content-tertiary); }
.progress.failed .mark { stroke: var(--bad); }
@keyframes rise { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.notice { margin: 12px auto; padding: 10px 14px; border-radius: 12px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.info { background: var(--surface-lift); color: var(--content-secondary); }

/* results */
.results { margin: 20px auto; background: var(--surface-side); border: 1px solid var(--border-base); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; animation: rise .3s ease-out; }
.res-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 16px 18px 12px; }
.res-title { font-family: var(--font-serif); font-size: 26px; line-height: 1; color: var(--content-strong); margin-right: auto; }
.stats { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 14px; }
.stat { font-size: 12.5px; padding: 4px 10px; border-radius: 8px; background: var(--surface-lift); color: var(--content-secondary); }
.stat b { color: var(--content-strong); font-weight: 600; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--border-base); }
table.defects { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.defects th { position: sticky; top: 0; background: var(--surface-side); text-align: left; font-weight: 500; font-size: 12px; color: var(--content-tertiary); padding: 10px 12px; border-bottom: 1px solid var(--border-base); white-space: nowrap; }
.defects td { padding: 10px 12px; border-bottom: 1px solid var(--border-base); vertical-align: middle; }
.defects tr:last-child td { border-bottom: 0; }
.defects tr:hover td { background: var(--surface-hover); }
.defects td.num { font-family: var(--font-mono); font-size: 13px; white-space: nowrap; }
.defects td.note { color: var(--content-secondary); min-width: 130px; }
.sev { font: 600 11.5px var(--font-mono); padding: 2px 7px; border-radius: 6px; background: var(--bad-soft); color: var(--bad); }
.conf { font-size: 12px; }
.conf.High { color: var(--ok); } .conf.Medium { color: var(--warn); } .conf.Low { color: var(--bad); }
.thumb { display: block; width: 100px; height: 46px; border-radius: 7px; border: 1px solid var(--border-subtle); background: #fbf8f2 center/cover no-repeat; padding: 0; transition: transform .15s, border-color .15s; }
.thumb:hover { transform: scale(1.04); border-color: var(--accent); }
.res-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border-base); background: var(--surface-sunken); }
.res-actions .spacer { flex: 1; }
.res-empty { padding: 26px 18px; text-align: center; color: var(--content-secondary); border-top: 1px solid var(--border-base); }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px auto; }
.file-link { font-size: 13px; text-decoration: none; padding: 6px 11px; border-radius: 9px; border: 1px solid var(--border-subtle); color: var(--content-secondary); }
.file-link:hover { color: var(--content-default); border-color: var(--border-element); }
.usage { text-align: center; font-size: 12px; color: var(--content-faint); margin: 6px auto 12px; }

/* dock */
.dock { flex-shrink: 0; padding: 0 20px 14px; background: linear-gradient(to bottom, transparent, var(--surface-base) 30%); }
.dock .composer { max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 22px; }
.dock textarea { padding: 7px 0; }
.composer-actions { display: flex; align-items: center; gap: 6px; }
.send { width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: #fff; transition: opacity .15s; flex-shrink: 0; }
.send:disabled { opacity: .3; cursor: not-allowed; }
.dock-note { text-align: center; margin: 8px 0 0; font-size: 11.5px; color: var(--content-tertiary); }

/* lightbox, toasts */
.lightbox { position: fixed; inset: 0; z-index: 50; background: #000c; display: grid; place-items: center; padding: 24px 16px; animation: fade .15s; }
.lightbox figure { margin: 0; max-width: min(1100px, 100%); }
.lightbox img { display: block; max-width: 100%; max-height: 78vh; border-radius: 10px; background: #fbf8f2; }
.lightbox figcaption { margin-top: 12px; color: #e9e6e2; font-size: 14px; text-align: center; }
.lb-close { position: absolute; top: 14px; right: 14px; color: #fff; }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; width: calc(100% - 32px); max-width: 440px; pointer-events: none; }
.toast { background: var(--surface-lift); color: var(--content-default); border: 1px solid var(--border-subtle); box-shadow: var(--shadow); padding: 10px 16px; border-radius: 12px; font-size: 14px; animation: rise .2s ease-out; }
.toast.bad { border-color: var(--bad); }

@media (max-width: 640px) {
  .table-wrap { overflow: visible; }
  table.defects, .defects tbody, .defects tr, .defects td { display: block; width: 100%; }
  .defects thead { display: none; }
  .defects tr { position: relative; padding: 12px 16px 12px; border-bottom: 1px solid var(--border-base); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
  .defects tr:last-child { border-bottom: 0; }
  .defects td { padding: 0; border: 0; min-width: 0 !important; }
  .defects td::before { content: attr(data-label); display: block; font: 500 11px var(--font-sans); color: var(--content-tertiary); margin-bottom: 1px; }
  .defects td.c-no { display: none; }
  .defects td.c-note, .defects td.c-evidence { grid-column: 1 / -1; }
  .defects td.c-evidence .thumb { width: 100%; height: 86px; }
  .defects tr:hover td { background: none; }
}

/* ── Phones ──────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .sidebar { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .only-mobile { display: inline-grid; }
  .topbar { padding: 0 8px 0 6px; }
  .transcript, .dock { padding-left: 16px; padding-right: 16px; }
  .new-inner { padding: 12px 16px 40px; }
  .composer-row { flex-direction: column; align-items: stretch; }
  .composer-row .btn { width: 100%; }
  .bubble, .file-chip { max-width: 100%; }
  .thumb { width: 92px; height: 40px; }
  .res-title { font-size: 22px; }
  .res-actions .btn { flex: 1 1 auto; }
  .res-actions .spacer { display: none; }
}

/* ── Accounts ────────────────────────────────────────────────────── */
.fields { width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.field label, .f label { display: block; font-size: 12.5px; color: var(--content-secondary); margin: 0 0 4px 2px; font-weight: 500; }
.input, .login-card input, .page input, .page select {
  width: 100%; height: 42px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--border-element);
  background: var(--surface-base); outline: none; color: var(--content-default);
}
.login-card input { letter-spacing: normal; }
.input:focus, .login-card input:focus, .page input:focus, .page select:focus { border-color: var(--accent); }
.input[readonly], .login-card input[readonly] { color: var(--content-secondary); background: var(--surface-sunken); }
#auth-foot:empty { display: none; }

.side-foot { position: relative; display: block; padding: 8px 0 0; }
.me { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; color: var(--content-secondary); }
.me:hover, .me[aria-expanded="true"] { background: var(--surface-hover); }
.avatar { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px; text-transform: uppercase; }
.me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.me-name { color: var(--content-default); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 20; padding: 6px; border-radius: 12px; background: var(--surface-lift); border: 1px solid var(--border-subtle); box-shadow: var(--shadow); animation: rise .15s ease-out; }
.menu-head { padding: 6px 10px 8px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--content-default); text-decoration: none; font-size: 14px; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-hover); }
.menu svg { color: var(--content-tertiary); }

/* settings pages */
.page-view { overflow-y: auto; }
.page { max-width: 760px; margin: 0 auto; padding: 18px 20px 60px; }
.page h2 { font-family: var(--font-serif); font-weight: 400; font-size: 36px; line-height: 1.1; margin: 6px 0 6px; color: var(--content-strong); }
.page .lead { color: var(--content-secondary); margin: 0 0 22px; }
.card { background: var(--surface-side); border: 1px solid var(--border-base); border-radius: 16px; padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 12px; }
.card-head h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--content-strong); }
.card-head .sub { font-size: 13px; color: var(--content-secondary); }
.card-head .grow { flex: 1; min-width: 0; }
.logo { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.logo.sheets { background: #0f9d581f; color: #34a853; }
.logo.eam { background: var(--accent-soft); color: var(--accent); }
.card-body { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-base); }
.steps-list { counter-reset: s; list-style: none; margin: 0 0 14px; padding: 0; }
.steps-list li { counter-increment: s; position: relative; padding: 0 0 12px 34px; color: var(--content-default); font-size: 14px; }
.steps-list li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-active); color: var(--content-secondary); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.steps-list b { color: var(--content-strong); font-weight: 600; }
.code { position: relative; margin: 8px 0 2px; }
.code pre { margin: 0; max-height: 170px; overflow: auto; padding: 12px 14px; border-radius: 10px; background: var(--surface-sunken); border: 1px solid var(--border-subtle); font: 12px/1.5 var(--font-mono); color: var(--content-secondary); white-space: pre; }
.code .btn { position: absolute; top: 8px; right: 8px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row .f { flex: 1 1 200px; min-width: 0; }
.row .f.narrow { flex: 0 1 160px; }
.form-error { color: var(--bad); font-size: 13.5px; margin: 8px 0 0; min-height: 0; }
.form-error:empty { display: none; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--content-tertiary); }
.kv dd { margin: 0; color: var(--content-default); overflow-wrap: anywhere; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.demo-note { font-size: 12.5px; color: var(--warn); background: var(--warn-soft); padding: 8px 12px; border-radius: 9px; margin-top: 12px; }
.linkbox { display: flex; gap: 8px; margin-top: 10px; }
.linkbox input { font-family: var(--font-mono); font-size: 12.5px; }
.success { background: var(--ok-soft); border: 1px solid #3fb98440; border-radius: 12px; padding: 14px; margin-top: 14px; }
.success p { margin: 0; font-size: 14px; }

.members { list-style: none; margin: 0; padding: 0; }
.member { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border-base); }
.member:first-child { border-top: 0; padding-top: 2px; }
.member .grow { flex: 1; min-width: 0; }
.member .name { font-weight: 500; color: var(--content-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .meta { font-size: 12.5px; color: var(--content-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .btns { display: flex; gap: 6px; flex-shrink: 0; }
.member .linkbox { flex-basis: 100%; }
.member { flex-wrap: wrap; }
.wo { font: 12px var(--font-mono); color: var(--content-secondary); white-space: nowrap; }
@media (max-width: 640px) {
  .page h2 { font-size: 30px; }
  .member .btns { width: 100%; }
  .member .btns .btn { flex: 1; }
  .card { padding: 16px; }
}
