/* Debrief — design system (2026-10-29 review).
 * Principles: one primary action per screen; quiet chrome, strong content;
 * plain words over symbols; colour only carries meaning (blue = proposed /
 * action, green = done, amber = needs a decision, red = destructive/error). */
:root {
  --bg: #f4f6f9; --panel: #ffffff; --panel2: #f1f4f8; --line: #dde3ea; --line-strong: #c8d1dc;
  --text: #17202b; --muted: #5b6878; --faint: #8592a3;
  --accent: #1f5fbf; --accent-ink: #174a96; --accent-soft: #eaf1fb;
  --ok: #1d7a43; --ok-soft: #e8f5ee; --warn: #9a6200; --warn-soft: #fdf5e6;
  --bad: #c2312b; --bad-soft: #fdeceb; --amber: #b35900; --opp: #0f766e; --opp-soft: #e6f4f2;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(23 32 43 / .05), 0 1px 1px rgb(23 32 43 / .03);
  --shadow-lg: 0 8px 24px rgb(23 32 43 / .12);
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 15px; --fs-md: 15px; --fs-lg: 17px; --fs-xl: 22px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh;
       display: flex; flex-direction: column;
       font: var(--fs-base)/1.55 var(--font); -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: var(--fs-sm); }
.bad { color: var(--bad); }

/* ---------------------------------------------------------------- header */
header { display: flex; align-items: center; gap: 2rem; padding: 0 1.5rem; height: 60px;
         background: var(--panel); border-bottom: 1px solid var(--line);
         position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700;
         font-size: 1.1rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
              background: linear-gradient(135deg, var(--accent), #2f7ad8); color: #fff;
              font-size: .9rem; font-weight: 800; }
nav { display: flex; gap: .25rem; height: 100%; }
nav a { display: inline-flex; align-items: center; padding: 0 .85rem; height: 100%;
        color: var(--muted); text-decoration: none; font-weight: 550; font-size: var(--fs-base);
        border-bottom: 2px solid transparent; margin-bottom: -1px; }
nav a:hover { color: var(--text); }
nav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.auth-zone { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.auth-zone #auth-info { font-weight: 600; color: var(--text); font-size: var(--fs-sm); }
#btn-logout { background: none; border: 0; color: var(--muted); font-weight: 500;
              padding: .3rem .55rem; cursor: pointer; font-size: var(--fs-sm); border-radius: 6px; }
#btn-logout:hover { color: var(--text); background: var(--panel2); }

/* ---------------------------------------------------------------- layout */
main { padding: 1.75rem 1.5rem 2.5rem; max-width: 1120px; width: 100%; margin: 0 auto; flex: 1; }
.app-footer { text-align: center; color: var(--faint); font-size: var(--fs-xs);
              padding: .9rem 1rem 1.2rem; }
.page-head { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.1rem; }
.page-head h1 { margin: 0; font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.015em; }
.page-head .sub { margin: .2rem 0 0; color: var(--muted); font-size: var(--fs-sm); max-width: 640px; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: .5rem; color: var(--muted); font-size: var(--fs-sm);
        text-decoration: none; }
.back:hover { color: var(--accent); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
         padding: 1.25rem 1.4rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 .75rem; font-size: var(--fs-lg); font-weight: 650; letter-spacing: -.005em; }
.panel h3 { margin: 1.4rem 0 .5rem; font-size: var(--fs-xs); font-weight: 700;
            text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.panel h3:first-child { margin-top: 0; }
.row { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.step-label { display: inline-flex; align-items: center; gap: .5rem; font-size: var(--fs-xs);
              font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent);
              margin-bottom: .35rem; }
.step-label .n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
                 background: var(--accent); color: #fff; font-size: 11px; letter-spacing: 0; }

/* ---------------------------------------------------------------- forms */
textarea { width: 100%; min-height: 260px; background: #fff; color: var(--text);
           border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .85rem 1rem;
           font: 14px/1.6 var(--font); resize: vertical; }
textarea::placeholder, input::placeholder { color: var(--faint); }
input, select { background: #fff; color: var(--text); border: 1px solid var(--line-strong);
                border-radius: var(--radius-sm); padding: .5rem .65rem; font: inherit; font-size: var(--fs-sm);
                min-height: 38px; height: 40px; }
select { padding-right: .4rem; }
input[type=checkbox], input[type=radio] { min-height: 0; accent-color: var(--accent); width: 16px; height: 16px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field > span, .field > label { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; letter-spacing: .01em; }
.field .hint { font-weight: 400; color: var(--faint); }
.filters { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }

/* ---------------------------------------------------------------- buttons */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
         background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: var(--radius-sm);
         padding: .55rem 1.05rem; font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
         text-decoration: none; line-height: 1.2; min-height: 38px; transition: background .12s, border-color .12s; }
button:hover, .btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
button.lg, .btn.lg { padding: .7rem 1.4rem; font-size: var(--fs-base); }
button.secondary, .btn.secondary { background: #fff; color: var(--text); border-color: var(--line-strong); }
button.secondary:hover, .btn.secondary:hover { background: var(--panel2); border-color: var(--faint); }
button.ghost { background: transparent; color: var(--muted); border-color: transparent; }
button.ghost:hover { background: var(--panel2); color: var(--text); }
button.danger { background: #fff; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
button.danger:hover { background: var(--bad-soft); }
button.sm, .btn.sm { padding: .3rem .7rem; min-height: 30px; font-size: var(--fs-xs); }
button:disabled { opacity: .45; cursor: default; }
button:disabled:hover { background: var(--accent); }
button.secondary:disabled:hover { background: #fff; }
.primary { display: inline-flex; background: var(--accent); color: #fff; border: 1px solid var(--accent);
           padding: .5rem 1rem; border-radius: var(--radius-sm); cursor: pointer; }

/* ---------------------------------------------------------------- auth */
.auth-wrap { max-width: 420px; margin: 3rem auto 0; }
.auth-brand { text-align: center; margin-bottom: 1.25rem; }
.auth-brand .brand-mark { width: 44px; height: 44px; border-radius: 12px; font-size: 1.35rem; }
.auth-brand h1 { margin: .7rem 0 .15rem; font-size: 1.5rem; letter-spacing: -.02em; }
.auth-brand p { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.auth-card { padding: 1.75rem 1.6rem; display: flex; flex-direction: column; }
.auth-card h2 { font-size: 1.2rem; margin-bottom: 1.1rem; }
.auth-card .field { margin-bottom: .9rem; }
.auth-card input { padding: .65rem .75rem; font-size: var(--fs-base); }
.auth-submit { width: 100%; padding: .7rem 1rem; font-size: var(--fs-base); }
.auth-err { min-height: 1.3em; margin: .35rem 0 0; font-size: var(--fs-sm); }
.auth-switch { margin: .9rem 0 0; font-size: var(--fs-sm); color: var(--muted); text-align: center; }
/* the mode switch is a BUTTON styled as a link (see app.js viewLogin) */
.auth-switch button { display: inline; background: none; border: 0; padding: 0; margin: 0; min-height: 0;
  color: var(--accent); cursor: pointer; font-weight: 600; font-size: inherit; text-decoration: underline; }
.auth-switch button:hover { background: none; color: var(--accent-ink); }
.auth-foot { text-align: center; color: var(--faint); font-size: var(--fs-xs); margin-top: 1rem; }

/* ---------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
     background: var(--panel2); border-bottom-color: var(--line); white-space: nowrap; }
th:first-child { border-top-left-radius: var(--radius-sm); }
th:last-child { border-top-right-radius: var(--radius-sm); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
table tr.clickable { cursor: pointer; }
table tr.clickable:hover td { background: #f8fafc; }
.table-wrap { overflow-x: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.table-wrap table { width: 100%; table-layout: fixed; }
.table-wrap td { vertical-align: middle; }
.table-wrap td.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- chips */
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .14rem .6rem; border-radius: 999px;
        font-size: var(--fs-xs); font-weight: 600; border: 1px solid var(--line); background: #fff;
        white-space: nowrap; line-height: 1.5; }
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: var(--ok-soft); }
.chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: var(--warn-soft); }
.chip.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); background: var(--bad-soft); }
.chip.amber { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 30%, transparent); background: var(--warn-soft); }
.chip.opp { color: var(--opp); border-color: color-mix(in srgb, var(--opp) 30%, transparent); background: var(--opp-soft); }
.chip.muted { color: var(--muted); }
.chip.neutral { color: var(--text); border-color: var(--line); background: var(--panel2); }
.chip.info { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); background: var(--accent-soft); }

/* ---------------------------------------------------------------- codes */
.code-big { font-weight: 700; font-size: 1rem; color: var(--accent); white-space: nowrap;
            font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.code-big.xl { font-size: 1.45rem; }
.code-big.sel { color: var(--text); }
.code-chip { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.code-chip .code-desc, .code-desc { font-size: var(--fs-xs); color: var(--muted); font-weight: 400; }
.code-line { display: flex; gap: .45rem; align-items: baseline; margin: .1rem 0; min-width: 0; }
.code-line .code-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ruleid { display: inline-block; margin-left: .4rem; font-family: var(--mono); font-size: 10px; color: var(--faint);
  background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 0 .3rem; vertical-align: middle; }
.cite { color: var(--muted); font-size: var(--fs-xs); display: block; margin-top: .3rem; }

/* ---------------------------------------------------------------- summary tiles */
.portfolio, .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem;
  margin-bottom: 1rem; }
.portfolio > span, .tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .7rem .9rem; color: var(--muted); font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; display: flex; flex-direction: column-reverse; gap: .1rem; }
.portfolio strong, .tile strong { color: var(--text); font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em;
  text-transform: none; font-variant-numeric: tabular-nums; }
.portfolio .warn-text, .warn-text { color: var(--warn); }
td.wrvu { font-weight: 700; color: var(--text); white-space: nowrap; text-align: right;
          font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- case page */
.case-head { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.case-head h1 { margin: 0; font-size: var(--fs-xl); letter-spacing: -.015em; }
.case-head .meta { color: var(--faint); font-size: var(--fs-xs); margin-top: .25rem; }
.headline { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; align-items: center;
  padding: .9rem 1.1rem; margin-bottom: 1.1rem; background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); border-radius: var(--radius-sm); }
.hl-kicker { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; }
.hl-primary { display: inline-flex; flex-direction: column; gap: .1rem; min-width: 0; flex: 1; }
.hl-suggest { font-size: var(--fs-sm); color: var(--text); max-width: 620px; }
.hl-meta { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.hl-meta strong { color: var(--text); font-size: var(--fs-lg); }

.wl-row { display: flex; gap: .75rem; align-items: flex-start; background: #fff;
          border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .75rem .85rem; margin: .55rem 0;
          transition: opacity .15s, border-color .15s; }
.wl-row:hover { border-color: var(--line-strong); }
.wl-row.removed { opacity: .55; background: var(--panel2); }
.wl-row.removed .code-big { text-decoration: line-through; color: var(--muted); }
.wl-row.added { border-style: dashed; }
.wl-check { display: flex; margin-top: .2rem; }
.wl-main { flex: 1; min-width: 0; }
.wl-line1 { display: flex; gap: .65rem; align-items: baseline; min-width: 0; }
.wl-line1 .code-big { flex-shrink: 0; }
.wl-desc { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
           color: var(--muted); font-size: var(--fs-sm); }
.wl-conf { font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; text-transform: capitalize; }
.wl-conf .dot { display: inline-block; width: .55em; height: .55em; border-radius: 50%;
                background: currentColor; margin-right: .35em; vertical-align: .05em; }
.wl-conf.high { color: var(--ok); } .wl-conf.medium { color: var(--warn); }
.wl-conf.low { color: var(--bad); } .wl-conf.muted { color: var(--faint); }
.wl-wrvu { font-weight: 700; color: var(--text); font-size: var(--fs-sm); white-space: nowrap;
           font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }
.wl-wrvu small { color: var(--faint); font-weight: 500; }
.wl-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.wl-mod { position: relative; display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .7rem;
          border-radius: 999px; border: 1px dashed var(--line-strong); background: #fff;
          cursor: pointer; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.wl-mod input { position: absolute; opacity: 0; pointer-events: none; }
.wl-mod.on { color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-soft); }
.wl-toggle { align-self: flex-start; }
.wl-expand { margin-top: .65rem; padding-top: .65rem; border-top: 1px dashed var(--line); }
.wl-cc { border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--line)); background: var(--warn-soft);
         border-radius: var(--radius-sm); padding: .55rem .75rem; margin-top: .55rem; font-size: var(--fs-sm); }
.wl-cc > strong { color: var(--warn); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; margin-right: .3rem; }
.wl-cc-opt { display: flex; gap: .5rem; align-items: baseline; margin: .35rem 0 0 .2rem; cursor: pointer; min-width: 0; }
.add-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .9rem 0 .2rem;
           padding-top: .9rem; border-top: 1px solid var(--line); }
.add-row .add-label { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); margin-right: .2rem; }

/* other work found in the note (out-of-scope / add-on questions) */
.ow-card { display: flex; gap: .9rem; align-items: flex-start; border: 1px solid var(--line); border-left: 3px solid var(--amber);
           border-radius: var(--radius-sm); padding: .7rem .9rem; margin: .55rem 0; background: #fff; }
.ow-card.done { opacity: .5; border-left-color: var(--line-strong); }
.ow-main { flex: 1; min-width: 0; }
.ow-title { font-weight: 650; text-transform: capitalize; }
.ow-q { font-size: var(--fs-sm); color: var(--muted); margin-top: .15rem; }
.ow-actions { display: flex; gap: .4rem; flex-shrink: 0; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* suggestions ("strengthen your note") */
.docun { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.docu-sentence { color: var(--text); }
.sugg { display: flex; gap: .75rem; align-items: flex-start; padding: .65rem 0; border-top: 1px solid var(--line); }
.sugg:first-of-type { border-top: 0; }
.chip.unlock { margin-top: .1rem; }

/* evidence spans */
.ev { font-size: var(--fs-xs); color: var(--muted); cursor: pointer; font-style: italic;
      display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ev:hover { color: var(--warn); }
.ev.full { display: block; -webkit-line-clamp: unset; }
mark.evmark { background: color-mix(in srgb, var(--warn) 25%, transparent); color: var(--text); border-radius: 3px; padding: 0 2px; }
mark.evmark.ping { outline: 2px solid var(--warn); }

/* collapsible sections */
details { margin: .4rem 0; }
summary { cursor: pointer; color: var(--text); font-weight: 600; list-style: none; display: flex; align-items: center; gap: .5rem; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "›"; display: inline-block; width: 1rem; color: var(--muted); font-size: 1.2rem;
                  line-height: 1; transition: transform .15s; }
details[open] > summary::before { transform: rotate(90deg); }
summary .muted { font-weight: 400; }
details.panel { padding-top: 1rem; padding-bottom: 1rem; }
details.panel[open] > summary { margin-bottom: .8rem; }

/* sticky decision bar */
.decision-bar { position: sticky; bottom: 1rem; z-index: 10; display: flex; gap: .8rem; align-items: center;
  background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(8px);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .7rem .8rem .7rem 1.1rem;
  margin-top: 1rem; box-shadow: var(--shadow-lg); }
.decision-bar .db-summary { font-size: var(--fs-sm); color: var(--muted); min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.decision-bar .db-save { margin-left: auto; flex-shrink: 0; }
.decision-bar .db-save.dirty { background: var(--warn); border-color: var(--warn); }

/* ---------------------------------------------------------------- report / gate */
.card { border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: var(--radius-sm);
        padding: .65rem .9rem; margin: .5rem 0; background: #fff; }
.card.decision { border-left-color: var(--accent); }
.card.watch { border-left-color: var(--line-strong); }
.redacted-preview { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-sm);
                    padding: .9rem 1rem; white-space: pre-wrap; font: 13px/1.6 var(--mono);
                    max-height: 340px; overflow: auto; margin: .6rem 0; }
.gate { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-top: .9rem; }
.gate label { display: inline-flex; gap: .5rem; align-items: center; font-size: var(--fs-sm); }
.preview-codes { display: flex; flex-direction: column; gap: .35rem; margin: .5rem 0 .2rem; }
.spans { font-size: var(--fs-sm); color: var(--ok); font-weight: 600; }
.privacy { display: flex; gap: .5rem; align-items: flex-start; color: var(--muted); font-size: var(--fs-xs); margin-top: .6rem; }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--panel2);
           border-radius: var(--radius-sm); padding: .65rem .9rem; font-size: var(--fs-sm); margin: .6rem 0; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.flash { padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: .8rem; font-size: var(--fs-sm); }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.bad { background: var(--bad-soft); color: var(--bad); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty p { margin: 0 0 .9rem; }

/* progress */
.reprocess-bar { display: flex; gap: .9rem; align-items: center; padding: .4rem 0; }
.spinner { width: 1.1rem; height: 1.1rem; flex-shrink: 0; border-radius: 50%; display: inline-block;
           border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite;
           vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* toasts */
#toast { position: fixed; right: 1.25rem; bottom: 1.25rem; display: flex; flex-direction: column;
         gap: .5rem; z-index: 50; max-width: 420px; }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--ok);
         border-radius: var(--radius-sm); padding: .7rem .9rem; font-size: var(--fs-sm); cursor: pointer;
         box-shadow: var(--shadow-lg); display: flex; gap: .6rem; align-items: flex-start; }
.toast.bad { border-left-color: var(--bad); }
.toast .x { color: var(--faint); font-weight: 700; }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #cdd5df; border-radius: 5px; }
*::-webkit-scrollbar-track { background: transparent; }
::selection { background: rgba(31, 95, 191, .16); }

@media (max-width: 760px) {
  header { gap: .6rem; padding: 0 .8rem; }
  .brand { font-size: 1rem; }
  nav a { padding: 0 .45rem; font-size: var(--fs-sm); white-space: nowrap; }
  .auth-zone #auth-info { display: none; }
  main { padding: 1.1rem .75rem 2rem; }
  .panel { padding: 1rem; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .headline { flex-direction: column; align-items: flex-start; }
  .wl-line1 { flex-wrap: wrap; }
  .wl-desc { white-space: normal; flex-basis: 100%; order: 5; }
  .ow-card { flex-direction: column; }
  .ow-actions { justify-content: flex-start; }
  .add-row input { flex: 1 1 140px; width: auto !important; }
  .decision-bar { bottom: .5rem; }
  .decision-bar .db-summary { display: none; }
  .decision-bar .db-save { width: 100%; }
  .filters .field, .filters input, .filters select { width: 100% !important; }
  .table-wrap { overflow-x: auto; }
  .table-wrap table { min-width: 720px; }
}

/* full-analysis subsections (inside the collapsed "Full analysis" panel) */
.rsec { padding: .2rem 0 .9rem; }
.rsec + .rsec { border-top: 1px solid var(--line); padding-top: .9rem; }
.rsec h3 { margin: 0 0 .6rem; }
.ed-chip { margin: 0 0 .25rem; }

/* signed out: the sign-in card carries the brand; the app header would repeat it */
body.signed-out header { display: none; }
.auth-err:empty { min-height: 0; margin: 0; }
.auth-card form p { margin: .4rem 0 0; }
#btn-logout { white-space: nowrap; }
summary { flex-wrap: wrap; }
@media (max-width: 760px) { summary .muted { flex-basis: 100%; padding-left: 1.5rem; } }
