/* RuleGrade console — design system.
   Dark by default; a full light theme via prefers-color-scheme and an explicit
   [data-theme] toggle. Components reference tokens only, so both themes stay in
   sync. Semantic hues (finding types, grades, risk) are data, not the accent. */
:root {
  --bg: #0f1319;
  --panel: #161c25;
  --panel-2: #1c232e;
  --border: #252e3a;
  --border-strong: #34404f;
  --text: #e7ecf3;
  --text-strong: #f3f6fa;
  --muted: #98a4b5;
  --muted-2: #717e8f;
  --accent: #5b93ff;
  --accent-weak: rgba(91,147,255,.15);
  --pos: #58cc8e;
  --neg: #ef7d75;
  --code-bg: #0e131a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 1px 2px rgba(0,0,0,.28), 0 14px 34px rgba(0,0,0,.4);
  --ring: 0 0 0 3px var(--accent-weak);

  --loose: #dca54a;      --loose-bg: rgba(220,165,74,.16);
  --unsupported: #e85d55; --unsupported-bg: rgba(232,93,85,.16);
  --incorrect: #a877f7;  --incorrect-bg: rgba(168,119,247,.18);
  --contradiction: #35bccb; --contradiction-bg: rgba(53,188,203,.16);

  --gA: #34c07d; --gB: #86cf5f; --gC: #e7b53c; --gD: #e59245; --gF: #e85d55;

  --risk-low-bg: rgba(52,192,125,.16);   --risk-low-fg: #6fdca2;
  --risk-med-bg: rgba(220,165,74,.18);   --risk-med-fg: #edbd63;
  --risk-high-bg: rgba(232,93,85,.20);   --risk-high-fg: #f3897f;

  --header-h: 150px;
  --radius: 12px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #eaeef3; --panel: #ffffff; --panel-2: #f3f6fa;
    --border: #dde3ea; --border-strong: #c3ccd7;
    --text: #1b2632; --text-strong: #0e1620; --muted: #566475; --muted-2: #8291a1;
    --accent: #2f6bd8; --accent-weak: rgba(47,107,216,.10);
    --pos: #1f9d63; --neg: #c8483f; --code-bg: #eff3f8;
    --shadow-sm: 0 1px 2px rgba(20,30,45,.06);
    --shadow: 0 1px 2px rgba(20,30,45,.06), 0 12px 30px rgba(20,30,45,.1);
    --loose: #a9761b; --loose-bg: rgba(220,165,74,.22);
    --unsupported: #cc4139; --unsupported-bg: rgba(232,93,85,.16);
    --incorrect: #7a4bd0; --incorrect-bg: rgba(168,119,247,.16);
    --contradiction: #10808f; --contradiction-bg: rgba(53,188,203,.16);
    --gA: #1f9d63; --gB: #57a83f; --gC: #c99509; --gD: #cc7a2a; --gF: #cc4139;
    --risk-low-bg: rgba(31,157,99,.14); --risk-low-fg: #178a54;
    --risk-med-bg: rgba(201,149,9,.16); --risk-med-fg: #9a710a;
    --risk-high-bg: rgba(200,72,63,.14); --risk-high-fg: #b83c33;
  }
}
:root[data-theme="light"] {
  --bg: #eaeef3; --panel: #ffffff; --panel-2: #f3f6fa;
  --border: #dde3ea; --border-strong: #c3ccd7;
  --text: #1b2632; --text-strong: #0e1620; --muted: #566475; --muted-2: #8291a1;
  --accent: #2f6bd8; --accent-weak: rgba(47,107,216,.10);
  --pos: #1f9d63; --neg: #c8483f; --code-bg: #eff3f8;
  --shadow-sm: 0 1px 2px rgba(20,30,45,.06);
  --shadow: 0 1px 2px rgba(20,30,45,.06), 0 12px 30px rgba(20,30,45,.1);
  --loose: #a9761b; --loose-bg: rgba(220,165,74,.22);
  --unsupported: #cc4139; --unsupported-bg: rgba(232,93,85,.16);
  --incorrect: #7a4bd0; --incorrect-bg: rgba(168,119,247,.16);
  --contradiction: #10808f; --contradiction-bg: rgba(53,188,203,.16);
  --gA: #1f9d63; --gB: #57a83f; --gC: #c99509; --gD: #cc7a2a; --gF: #cc4139;
  --risk-low-bg: rgba(31,157,99,.14); --risk-low-fg: #178a54;
  --risk-med-bg: rgba(201,149,9,.16); --risk-med-fg: #9a710a;
  --risk-high-bg: rgba(200,72,63,.14); --risk-high-fg: #b83c33;
}
:root[data-theme="dark"] {
  --bg: #0f1319; --panel: #161c25; --panel-2: #1c232e;
  --border: #252e3a; --border-strong: #34404f;
  --text: #e7ecf3; --text-strong: #f3f6fa; --muted: #98a4b5; --muted-2: #717e8f;
  --accent: #5b93ff; --accent-weak: rgba(91,147,255,.15);
  --pos: #58cc8e; --neg: #ef7d75; --code-bg: #0e131a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 1px 2px rgba(0,0,0,.28), 0 14px 34px rgba(0,0,0,.4);
  --loose: #dca54a; --loose-bg: rgba(220,165,74,.16);
  --unsupported: #e85d55; --unsupported-bg: rgba(232,93,85,.16);
  --incorrect: #a877f7; --incorrect-bg: rgba(168,119,247,.18);
  --contradiction: #35bccb; --contradiction-bg: rgba(53,188,203,.16);
  --gA: #34c07d; --gB: #86cf5f; --gC: #e7b53c; --gD: #e59245; --gF: #e85d55;
  --risk-low-bg: rgba(52,192,125,.16); --risk-low-fg: #6fdca2;
  --risk-med-bg: rgba(220,165,74,.18); --risk-med-fg: #edbd63;
  --risk-high-bg: rgba(232,93,85,.20); --risk-high-fg: #f3897f;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.tnum { font-variant-numeric: tabular-nums; }

/* ---- header ---- */
header.top {
  position: sticky; top: 0; z-index: 20;
  padding: 16px 26px 15px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex: none; box-shadow: var(--shadow-sm); }
.brand h1 { margin: 0; font-size: 20px; letter-spacing: -.01em; line-height: 1.1; }
.brand .tag { color: var(--muted); font-size: 12.5px; }
.actions { display: flex; align-items: center; gap: 9px; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--muted); font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: color .15s, border-color .15s, transform .1s; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(.94); }

.cta {
  background: var(--accent); color: #fff; border: none; border-radius: 9px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: filter .15s, transform .1s;
}
.cta:hover { filter: brightness(1.07); }
.cta:active { transform: translateY(1px); }

.subtitle { color: var(--muted); margin: 12px 0 0; font-size: 13px; max-width: 940px; line-height: 1.55; }

/* ---- KPI strip ---- */
.kpis { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.kpi {
  background: var(--panel); border: 1px solid var(--border); border-radius: 11px;
  padding: 10px 15px; min-width: 112px; transition: border-color .15s, transform .12s, box-shadow .15s;
}
.kpi:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.kpi .n { font-size: 23px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; margin-top: 3px; }
.kpi .n.loose { color: var(--loose); }
.kpi .n.unsupported { color: var(--unsupported); }
.kpi .n.incorrect { color: var(--incorrect); }
.kpi .n.contradiction { color: var(--contradiction); }

/* ---- layout ---- */
.wrap { display: grid; grid-template-columns: 320px minmax(0,1fr) 372px;
  min-height: calc(100vh - var(--header-h)); }
@media (max-width: 1100px) { .wrap { grid-template-columns: 1fr; } }
.col { padding: 18px 20px; overflow-y: auto; max-height: calc(100vh - var(--header-h)); }
.col.left { border-right: 1px solid var(--border); }
.col.center { background: var(--bg); }
.col.right { border-left: 1px solid var(--border); background: var(--panel); }
@media (max-width: 1100px) { .col { max-height: none; border: none; border-bottom: 1px solid var(--border); } }
.col::-webkit-scrollbar { width: 10px; }
.col::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 3px solid transparent; background-clip: content-box; }

h2.section { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted-2);
  font-weight: 700; margin: 4px 0 12px; }

/* ---- agency scorecards ---- */
.scorecard {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 14px; margin-bottom: 10px; cursor: pointer;
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.scorecard:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.scorecard.active { border-color: var(--accent); box-shadow: var(--ring); }
.sc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sc-name { font-weight: 650; font-size: 14px; letter-spacing: -.005em; }
.sc-std { color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.45; }
.sc-meta { color: var(--muted-2); font-size: 11.5px; margin-top: 9px; display: flex; gap: 11px; flex-wrap: wrap;
  font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.dot.loose { background: var(--loose); } .dot.unsupported { background: var(--unsupported); }
.dot.incorrect { background: var(--incorrect); } .dot.contradiction { background: var(--contradiction); }

/* ---- grade badge ---- */
.grade {
  font-weight: 800; font-size: 15px; width: 34px; height: 34px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none;
  box-shadow: var(--shadow-sm);
}
.grade.small { width: 26px; height: 26px; font-size: 12.5px; border-radius: 7px; }
.grade.A { background: var(--gA); } .grade.B { background: var(--gB); }
.grade.C { background: var(--gC); } .grade.D { background: var(--gD); } .grade.F { background: var(--gF); }

/* ---- filters + document list ---- */
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
select, input[type=text] {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 10px; font-size: 13px; transition: border-color .15s, box-shadow .15s;
}
select:hover, input[type=text]:hover { border-color: var(--border-strong); }
select:focus, input[type=text]:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type=text] { flex: 1; min-width: 120px; }

.doc-item {
  display: flex; gap: 11px; align-items: flex-start; padding: 11px 12px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer; transition: background .13s, border-color .13s;
}
.doc-item:hover { background: var(--panel); border-color: var(--border); }
.doc-item.active { background: var(--panel); border-color: var(--accent); box-shadow: var(--ring); }
.doc-title { font-size: 13.5px; font-weight: 560; line-height: 1.35; }
.doc-sub { color: var(--muted-2); font-size: 11.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.badge-syn { font-size: 9.5px; font-weight: 700; letter-spacing: .04em; color: var(--muted); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; margin-left: 7px; vertical-align: 1px; }
.badge-yours { font-size: 9.5px; font-weight: 700; letter-spacing: .04em; color: #fff; background: var(--accent);
  border-radius: 5px; padding: 1px 5px; margin-left: 7px; vertical-align: 1px; }

/* ---- document viewer ---- */
.doc-header { margin-bottom: 14px; }
.doc-header h3 { margin: 0 0 8px; font-size: 19px; line-height: 1.28; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.doc-header .meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 13px; flex-wrap: wrap; align-items: center;
  font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 15px; margin: 13px 0 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend .sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.doc-body {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; font-size: 15px; line-height: 1.8; white-space: pre-wrap; box-shadow: var(--shadow-sm);
}
mark.hl { border-radius: 3px; padding: 1px 2px; cursor: pointer; color: inherit;
  border-bottom: 2px solid transparent; background: transparent; transition: background .12s; }
mark.hl-loose { background: var(--loose-bg); border-bottom-color: var(--loose); }
mark.hl-unsupported { background: var(--unsupported-bg); border-bottom-color: var(--unsupported); }
mark.hl-incorrect { background: var(--incorrect-bg); border-bottom-color: var(--incorrect); }
mark.hl-contradiction { background: var(--contradiction-bg); border-bottom-color: var(--contradiction); }
mark.hl.focus { outline: 2px solid var(--accent); background: var(--accent-weak); }

.notice {
  background: var(--loose-bg); border: 1px solid color-mix(in srgb, var(--loose) 45%, transparent);
  color: color-mix(in srgb, var(--loose) 78%, var(--text)); border-radius: 10px;
  padding: 10px 13px; font-size: 12.5px; margin-bottom: 14px; line-height: 1.5;
}
.empty { color: var(--muted-2); font-size: 14px; padding: 46px 12px; text-align: center; line-height: 1.6; }

/* ---- export buttons ---- */
.exports { display: flex; gap: 7px; margin-left: auto; }
.btn-sm { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 10px; font-size: 11.5px; cursor: pointer; transition: color .13s, border-color .13s; }
.btn-sm:hover { color: var(--text); border-color: var(--border-strong); }

/* ---- challenge exposure ---- */
.risk { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; border-radius: 20px; padding: 2px 9px; }
.risk.low { background: var(--risk-low-bg); color: var(--risk-low-fg); }
.risk.medium { background: var(--risk-med-bg); color: var(--risk-med-fg); }
.risk.high { background: var(--risk-high-bg); color: var(--risk-high-fg); }

.exposure-banner {
  background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--unsupported);
  border-radius: 10px; padding: 12px 15px; margin-bottom: 14px; font-size: 12.5px; box-shadow: var(--shadow-sm);
}
.exposure-banner .eb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; flex-wrap: wrap; }
.exposure-banner .eb-head b { font-size: 13px; }
.exposure-banner .eb-line { color: var(--muted); line-height: 1.5; }
.exposure-banner .eb-line b { color: var(--text); font-weight: 600; }

/* ---- findings panel ---- */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { font-size: 12px; color: var(--muted); padding: 6px 12px; border: 1px solid var(--border);
  border-radius: 20px; cursor: pointer; transition: color .13s, border-color .13s, background .13s; }
.tab:hover { color: var(--text); border-color: var(--border-strong); }
.tab.active { color: var(--accent); border-color: var(--accent); background: var(--accent-weak); font-weight: 600; }

.finding {
  border: 1px solid var(--border); border-left-width: 3px; border-radius: 10px;
  padding: 12px 13px; margin-bottom: 10px; background: var(--panel-2); cursor: pointer;
  transition: border-color .13s, box-shadow .13s, transform .12s;
}
.finding:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.finding.loose { border-left-color: var(--loose); }
.finding.unsupported { border-left-color: var(--unsupported); }
.finding.incorrect { border-left-color: var(--incorrect); }
.finding.contradiction { border-left-color: var(--contradiction); }
.finding.focus { border-color: var(--accent); box-shadow: var(--ring); }
.f-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.f-type { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; }
.f-type.loose { color: var(--loose); } .f-type.unsupported { color: var(--unsupported); }
.f-type.incorrect { color: var(--incorrect); } .f-type.contradiction { color: var(--contradiction); }
.f-sev { font-size: 10px; color: var(--muted-2); border: 1px solid var(--border); border-radius: 20px; padding: 1px 8px; }
.f-doc { font-size: 10px; color: var(--muted-2); margin-left: auto; }
.f-msg { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.f-rat { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.f-std { font-size: 11px; color: var(--muted-2); margin-top: 6px; font-style: italic; }
.f-ex { font-size: 11.5px; color: var(--text); background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 8px; margin-top: 7px; font-family: ui-monospace, Menlo, monospace; line-height: 1.45; }

.f-exposure { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.f-exposure .lab { font-size: 10px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .05em; }
.f-chal { font-size: 11px; color: var(--muted); margin-top: 5px; line-height: 1.45; }

.f-cmt { margin-top: 8px; font-size: 11.5px; color: var(--contradiction); background: var(--contradiction-bg);
  border-radius: 6px; padding: 5px 9px; }

.f-partner { margin-top: 8px; font-size: 11.5px; border-left: 2px solid var(--contradiction); padding: 5px 9px;
  background: var(--contradiction-bg); border-radius: 0 6px 6px 0; line-height: 1.45; }
.f-partner .lbl { color: var(--contradiction); font-weight: 800; text-transform: uppercase; font-size: 9.5px; letter-spacing: .06em; }
.f-partner .pt { color: var(--muted-2); }

.f-evidence { margin-top: 9px; border-top: 1px dashed var(--border); padding-top: 8px; font-size: 11.5px; }
.f-evidence .lbl { color: var(--muted-2); font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; }
.f-evidence .gap { color: var(--text-strong); margin: 4px 0 6px; line-height: 1.45; }
.f-evidence .ev-sup, .f-evidence .ev-con { color: var(--muted); margin-top: 4px; line-height: 1.45; }
.f-evidence .ev-sup b { color: var(--pos); font-weight: 600; }
.f-evidence .ev-con b { color: var(--neg); font-weight: 600; }
.f-evidence ul { margin: 3px 0 0; padding-left: 16px; }
.f-evidence li { margin-bottom: 3px; }

.f-prec { margin-top: 9px; border-top: 1px dashed var(--border); padding-top: 8px; }
.f-prec .lbl { color: var(--muted-2); font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; display: block; margin-bottom: 5px; }
.prec { font-size: 11.5px; margin-bottom: 7px; line-height: 1.45; }
.prec .cn { font-weight: 650; color: var(--text-strong); }
.prec .cc { color: var(--muted-2); }
.prec .ch { color: var(--muted); display: block; margin-top: 2px; line-height: 1.45; }
.prec .verified { color: var(--pos); font-size: 10px; font-weight: 700; }

.std-block { margin-bottom: 17px; }
.std-block h4 { margin: 0 0 5px; font-size: 13.5px; }
.std-block .s { color: var(--muted); font-size: 12px; line-height: 1.5; }
.std-block ul { margin: 7px 0 0; padding-left: 18px; }
.std-block li { font-size: 12px; color: var(--muted); margin-bottom: 5px; line-height: 1.45; }

/* ---- comments / litigation ---- */
.cmt-summary { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-size: 12.5px; }
.cmt-valid { color: var(--muted); margin-top: 8px; font-size: 12px; line-height: 1.5; }
.cmt-valid b { color: var(--pos); }
.cmt-match { border-left: 2px solid var(--unsupported); padding: 7px 11px; margin-bottom: 8px;
  font-size: 12px; color: var(--text); background: var(--panel); border-radius: 0 8px 8px 0; line-height: 1.45; }
.cmt-card { border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; margin-bottom: 9px; background: var(--panel-2); }
.cmt-org { font-size: 12.5px; font-weight: 650; margin-bottom: 4px; }
.cmt-snip { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.pt { color: var(--muted-2); }

/* ---- analyze modal ---- */
.overlay { position: fixed; inset: 0; background: rgba(6,10,16,.62); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; }
.overlay[hidden] { display: none; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  width: min(760px, 96vw); padding: 22px 24px; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.modal .x { background: none; border: none; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; padding: 0 4px; }
.modal .x:hover { color: var(--text); }
.modal-sub { color: var(--muted); font-size: 12.5px; margin: 9px 0 16px; line-height: 1.55; }
.modal-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 13px; }
.modal-row label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.modal-row select, .modal-row input[type=file] { min-width: 180px; }
#analyzeText { width: 100%; min-height: 240px; resize: vertical; background: var(--panel-2);
  color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 13px;
  font: 13.5px/1.6 ui-monospace, Menlo, monospace; transition: border-color .15s, box-shadow .15s; }
#analyzeText:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 15px; }
.modal-msg { color: var(--muted); font-size: 12.5px; margin-right: auto; }
.modal-msg.err { color: var(--neg); }

footer.foot { padding: 18px 28px; border-top: 1px solid var(--border); color: var(--muted-2); font-size: 12px; line-height: 1.5; }

/* ---- print ---- */
@media print {
  :root { --bg:#fff; --panel:#fff; --panel-2:#fff; --text:#111; --muted:#444; --border:#ccc; }
  header.top, .col.left, .filters, #docList, .col.right .tabs, .exports, footer.foot, .overlay { display: none !important; }
  .wrap { display: block; }
  .col { max-height: none; overflow: visible; border: none; }
  .doc-body { border: 1px solid #ccc; }
  .finding { break-inside: avoid; }
  a { color: #0645ad; }
}
