/* Layout idea: a review desk. A quiet shell, one worklist of ADR cases, and a report ruled by severity. */
:root {
  --bg: #eef1f0; --surface: #ffffff; --sunk: #e4e9e7; --ink: #16201d; --muted: #586662; --line: #cfd7d4;
  --accent: #0d5c63; --accent-ink: #ffffff;
  --crit: #b3261e; --crit-bg: #fbeceb; --warn: #8a5a00; --warn-bg: #fbf1dc; --man: #3a56ad; --man-bg: #e9edfa;
  --ok: #2c7a4b; --ok-bg: #e6f3ea; --info: #586662; --info-bg: #e4e9e7;
  --display: "IBM Plex Sans Condensed", "Noto Sans Armenian", "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Noto Sans Armenian", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101615; --surface: #18201e; --sunk: #202a27; --ink: #e6eeeb; --muted: #9aaaa5; --line: #2d3a36;
    --accent: #62c4b8; --accent-ink: #06201d;
    --crit: #ff8a80; --crit-bg: #3a1a18; --warn: #f2bd5b; --warn-bg: #33270f; --man: #a3b6ff; --man-bg: #1c2443;
    --ok: #7fd09c; --ok-bg: #14301f; --info: #9aaaa5; --info-bg: #202a27;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--body); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; text-wrap: balance; margin: 0; }
h1 { font-size: 26px; line-height: 1.2; } h2 { font-size: 19px; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.note { font-size: 13px; color: var(--muted); }
.mono { font-family: var(--mono); }

/* shell */
.envbar { background: var(--warn-bg); color: var(--warn); font-size: 13px; font-weight: 500; text-align: center; padding: 6px 16px; border-bottom: 1px solid var(--line); }
.envbar.local { background: var(--ok-bg, #e7f3ec); color: var(--ok, #1d6b43); }
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top .wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.mark { font: 600 21px/1 var(--display); letter-spacing: .01em; color: var(--ink); text-decoration: none; }
.mark b { color: var(--accent); font-weight: 600; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a { padding: 7px 10px; white-space: nowrap; border-radius: 6px; text-decoration: none; color: var(--muted); font-weight: 500; }
.nav a[aria-current="page"] { background: var(--sunk); color: var(--ink); }
.who { font-size: 13px; color: var(--muted); text-align: right; line-height: 1.3; }
.who b { display: block; color: var(--ink); font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 5px 10px; cursor: pointer; font-weight: 500; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
main { display: flex; flex-direction: column; gap: 20px; }
main.wrap { padding-top: 24px; padding-bottom: 56px; }
.pagehead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pagehead h1 { flex: 1; min-width: 200px; }
.crumb { font-size: 13px; }

/* controls */
.btn { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 6px; cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; display: inline-block; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: transparent; color: var(--crit); border-color: var(--crit); }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-weight: 500; font-size: 14px; }
.field input, .field select, .field textarea, .inline-select { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 8px 10px; width: 100%; }
.field input, .field select, .inline-select { min-height: 40px; }
.field textarea { min-height: 90px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--muted); }
.inline-select { width: auto; padding: 5px 8px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.msg { border-radius: 6px; padding: 9px 12px; font-size: 14px; }
.msg.err { background: var(--crit-bg); color: var(--crit); }
.msg.okmsg { background: var(--ok-bg); color: var(--ok); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.auth { max-width: 440px; margin: 6vh auto 0; }
.auth .brandline { display: flex; align-items: center; gap: 10px; }

.drop { border: 1.5px dashed var(--line); border-radius: 6px; padding: 14px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: var(--sunk); }
.drop.over { border-color: var(--accent); }
.drop p { flex: 1; min-width: 200px; color: var(--muted); font-size: 14px; }
.bar { height: 4px; background: var(--sunk); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); }

/* tables */
.tablebox { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.tablebox.short { max-height: 340px; overflow-y: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 12px; border-top: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
td.wraps { white-space: normal; min-width: 180px; }
thead th { position: sticky; top: 0; background: var(--sunk); border-top: 0; font-weight: 500; font-size: 12px; color: var(--muted); }
td.num, th.num { text-align: right; }
tbody tr.link:hover { background: var(--sunk); }
td a.rowlink { font-weight: 500; }
.count { display: inline-block; min-width: 22px; text-align: center; font-weight: 600; }
.count.crit { color: var(--crit); } .count.warn { color: var(--warn); } .count.zero { color: var(--muted); font-weight: 400; }
.pill { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 4px 7px; border-radius: 3px; background: var(--info-bg); color: var(--info); display: inline-block; }
.pill.crit, .critical .pill { background: var(--crit-bg); color: var(--crit); }
.pill.warn, .warning .pill { background: var(--warn-bg); color: var(--warn); }
.pill.man, .manual .pill { background: var(--man-bg); color: var(--man); }
.pill.good, .ok .pill { background: var(--ok-bg); color: var(--ok); }
.empty { color: var(--muted); padding: 18px; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: 8px; }
.empty.plain { text-align: left; border: 0; background: transparent; padding: 8px 2px; }

/* case header */
.casebar { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: end; }
.history { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.history .step { border: 1px solid var(--line); border-radius: 5px; padding: 4px 8px; background: var(--surface); color: var(--ink); }

/* report */
.verdict { border: 1px solid var(--line); border-left: 6px solid var(--muted); background: var(--surface); border-radius: 8px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.verdict h2 { font-size: 23px; line-height: 1.2; }
.verdict.blocked { border-left-color: var(--crit); } .verdict.fix { border-left-color: var(--warn); } .verdict.clear { border-left-color: var(--ok); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.tile .n { font: 600 26px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.tile .l { font-size: 13px; color: var(--muted); }
.tile[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tile.critical .n { color: var(--crit); } .tile.warning .n { color: var(--warn); } .tile.manual .n { color: var(--man); } .tile.ok .n { color: var(--ok); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 0; }
.facts div { background: var(--surface); padding: 9px 12px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.sec-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sec-head .note { flex: 1; }
.list { display: flex; flex-direction: column; gap: 10px; }
.finding { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--info); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.finding.critical { border-left-color: var(--crit); } .finding.warning { border-left-color: var(--warn); } .finding.manual { border-left-color: var(--man); }
.finding .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.area { font-size: 13px; color: var(--muted); }
.finding h3 { font-size: 18px; line-height: 1.25; }
.finding p { max-width: 78ch; }
.lbl { display: block; font: 500 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.evi { background: var(--sunk); border-radius: 5px; padding: 8px 10px; overflow-x: auto; }
.evi code { font: 400 13px/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; display: block; }
.fix { border-top: 1px solid var(--line); padding-top: 8px; }
.foot { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.pg { font: 500 12px/1 var(--mono); border: 1px solid var(--line); border-radius: 3px; padding: 3px 5px; color: var(--ink); }
.ref { margin-left: auto; text-align: right; }
.passed { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.passed ul { margin: 0; padding: 0; }
.passed li { list-style: none; padding: 9px 14px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 22px 1fr; gap: 4px 6px; }
.passed li:first-child { border-top: 0; }
.passed .ck { color: var(--ok); font-weight: 600; }
.passed .d { grid-column: 2; font-size: 13px; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.checks { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px; }
.checks label { display: grid; grid-template-columns: 20px 1fr; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); cursor: pointer; }
.checks label:first-child { border-top: 0; }
.checks input { margin-top: 4px; accent-color: var(--accent); }
.about { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 13px; max-width: 80ch; }

/* overlays */
.dialog { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 20; }
.dialog .box { background: var(--surface); border-radius: 8px; padding: 18px; width: min(520px, 100%); display: flex; flex-direction: column; gap: 12px; max-height: 90vh; overflow-y: auto; }
.dialog textarea { width: 100%; height: 280px; font: 400 12px/1.45 var(--mono); background: var(--sunk); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.secret { font: 500 15px/1.4 var(--mono); background: var(--sunk); border-radius: 6px; padding: 10px 12px; overflow-wrap: anywhere; user-select: all; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 30; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--bg); border-radius: 6px; padding: 10px 14px; font-size: 14px; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.toast.err { background: var(--crit); color: #fff; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

@media (max-width: 760px) {
  .two, .grid2 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .ref { margin-left: 0; text-align: left; flex-basis: 100%; }
  .who { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* phone header: brand and sign-out on one row, navigation on a single scrolling row */
@media (max-width: 760px) {
  .top .wrap { gap: 8px 10px; padding-top: 10px; padding-bottom: 8px; }
  .top .mark { order: 1; font-size: 19px; }
  .top .spacer { order: 2; }
  .top .seg { order: 3; }
  .top .who { order: 4; flex: 1 1 60%; min-width: 0; text-align: left; display: flex; gap: 6px; flex-wrap: wrap; }
  .top .btn { order: 5; }
  .top .who b { display: inline; }
  .top .nav { order: 6; width: 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -6px; padding-bottom: 2px; scrollbar-width: thin; }
  .top .nav a { white-space: nowrap; padding: 7px 9px; }
  .envbar { font-size: 12px; padding: 5px 12px; }
}

/* per-finding "mark as done" */
.resolve { border-top: 1px dashed var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.rtop { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.rcheck { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; }
.rcheck input { width: 20px; height: 20px; accent-color: var(--ok); }
.resolve .when { font-size: 12px; color: var(--ok); }
.rnote { width: 100%; max-width: 78ch; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.resolve .hint { font-size: 12px; color: var(--muted); max-width: 78ch; }
.resolve .reopen { font-size: 13px; color: var(--warn); font-weight: 600; }
.finding.resolved { border-left-color: var(--ok); background: var(--ok-bg); }
.finding.resolved h3 { text-decoration: line-through; text-decoration-thickness: 1px; opacity: .8; }
.fxprog { margin-left: auto; font-weight: 600; }

.rcheck.wrong { font-weight: 400; font-size: 14px; color: var(--muted); }
.finding.flagged { outline: 2px dashed var(--warn); outline-offset: 2px; }

/* IDG notes */
.idgbar { flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.idgbar .btn.on { outline: 2px solid currentColor; }
.idged textarea { width: 100%; min-height: 84px; }
.attrow { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr; gap: 10px; align-items: center; margin: 6px 0; }
.idgchecks { margin: 14px 0; padding: 10px 12px; border: 1px solid var(--line, #ccc); border-radius: 8px; }
.idgchecks .ck.bad { font-weight: 600; }
.idgchecks .ck.soft { opacity: .85; }
@media (max-width: 600px) { .attrow { grid-template-columns: 1fr; } }

.modpick { display: inline-flex; align-items: center; gap: 4px; margin-right: 12px; white-space: nowrap; font-size: 14px; }
input.money { width: 110px; text-align: right; padding: 4px 6px; }
img.qr { background: #fff; padding: 8px; border-radius: 6px; border: 1px solid var(--line); }
ol.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
td .hint { font-size: 12px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent, #1d4ed8); text-decoration: underline; cursor: pointer; }
