/* Blind page review (网页盲评): a calm, neutral tool around the pages being judged.
   The chrome stays grey and quiet so it does not compete with (or tint) the pages; colour is
   reserved for the two sides: A = blue, B = orange (a pair that colour-blind readers separate). */
:root {
  --bg: #f3f3f1;
  --surface: #ffffff;
  --sunken: #f7f7f5;
  --stage: #e4e4e1;
  --line: #e2e2de;
  --line-strong: #cfcfca;
  --ink: #1d1d1f;
  --ink-2: #4b4b50;
  --ink-3: #6e6e73;
  --a: #1f6feb;
  --a-ink: #1553c7;
  --a-soft: #e7effd;
  --a-mid: #b9cffa;
  --b: #e0700f;
  --b-ink: #a94f05;
  --b-soft: #fdf0e3;
  --b-mid: #f6c99d;
  --p: #5b5bd6;
  --p-soft: #ecebfb;
  --ok: #1f8a4c;
  --ok-soft: #e5f4ea;
  --warn: #b25c00;
  --warn-soft: #fdf3e2;
  --bad: #c42b1c;
  --bad-soft: #fbe9e7;
  --radius: 10px;
  --radius-s: 7px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .06);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --panel-w: 420px;
  --ease: cubic-bezier(.2, 0, 0, 1);
}

/* English first for Latin text (on Windows a CJK font would otherwise draw the Latin letters). */
html[lang="en"] { --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
kbd {
  font: 11px/1 var(--mono); padding: 2px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 4px; background: var(--surface); color: var(--ink-2);
}
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  height: 52px; display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: .02em; white-space: nowrap; }
.brand-mark { width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(90deg, var(--a) 0 50%, var(--b) 50% 100%); }
.modes { display: flex; gap: 2px; padding: 3px; background: var(--sunken); border: 1px solid var(--line); border-radius: 9px; }
.modes button {
  border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; color: var(--ink-2); white-space: nowrap;
}
.modes button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); font-weight: 600; }
.modes .count { font-size: 12px; color: var(--ink-3); margin-left: 4px; font-variant-numeric: tabular-nums; }
.task-title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: 10px; }
.progress { display: flex; flex-direction: column; gap: 4px; min-width: 190px; font-size: 12px; color: var(--ink-2); }
.progress .bar { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .4s var(--ease); }
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius-s);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--sunken); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sunken); color: var(--ink); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #000; }
.btn.primary:disabled { background: var(--sunken); border-color: var(--line); color: var(--ink-3); cursor: not-allowed; }
.btn.primary:disabled kbd { color: var(--ink-3); border-color: var(--line-strong); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.small[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.small[aria-pressed="true"] kbd { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
kbd.on-dark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.focus-chip { font-size: 12px; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.lang-seg { display: flex; padding: 2px; background: var(--sunken); border: 1px solid var(--line); border-radius: 8px; }
.lang-seg button { border: 0; background: transparent; padding: 3px 8px; border-radius: 6px; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.lang-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); font-weight: 600; }
.store-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); background: var(--sunken); }
.store-line .link { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); white-space: nowrap; }
.store-line .link svg { width: 13px; height: 13px; }
.who {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 4px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface); max-width: 180px;
}
.who:hover { background: var(--sunken); }
.avatar {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 650;
  color: #fff; background: var(--ink-2); flex: none;
}
.who-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- workspace ---------- */
.workspace { display: flex; height: calc(100vh - 52px); }
.viewer { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--stage); position: relative; }
.viewer-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.seg { display: flex; padding: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.seg button {
  border: 0; background: transparent; padding: 4px 10px; border-radius: 6px; color: var(--ink-2); display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg button[aria-pressed="true"] kbd { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.seg button.side-a[aria-pressed="true"] { background: var(--a); }
.seg button.side-b[aria-pressed="true"] { background: var(--b-ink); }
.viewer-bar .spacer { flex: 1; }
.chk { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; user-select: none; }
.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--radius-s); border: 1px solid transparent;
  background: transparent; color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.icon-btn svg, .btn svg { width: 16px; height: 16px; }

.stages { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 12px; position: relative; }
.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
/* Single view: both pages stay laid out at full size in the same place and only the shown one is
   painted, so switching A/B is instant and neither page loses its scroll position or state. */
.stages.single .stage { position: absolute; inset: 12px; }
.stage.off { visibility: hidden; pointer-events: none; }
.stage-head {
  display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 12px; color: var(--ink-2);
  padding: 3px 8px; border-radius: 8px; background: var(--surface); border-top: 3px solid var(--line-strong);
}
.stage[data-side="A"] .stage-head { background: var(--a-soft); border-top-color: var(--a); }
.stage[data-side="B"] .stage-head { background: var(--b-soft); border-top-color: var(--b); }
.stage[data-side="P"] .stage-head { background: var(--p-soft); border-top-color: var(--p); }
.stage-head .badge { min-width: 26px; height: 24px; font-size: 13px; }
.zoom { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
.zoom.small { color: var(--warn); }
.zoom + .stage-open { margin-left: 0; }
.badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px;
  font-weight: 700; font-size: 12px; color: #fff; letter-spacing: .02em;
}
.badge.A { background: var(--a); }
.badge.B { background: var(--b-ink); }
.badge.P { background: var(--p); }
.explore { display: flex; gap: 10px; flex-wrap: wrap; }
.explore span { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); }
.explore span.done { color: var(--ok); }
.explore svg { width: 12px; height: 12px; }
.stage-open { margin-left: auto; color: var(--ink-3); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.stage-open:hover { color: var(--ink); }
.stage-open svg, .chip svg { width: 12px; height: 12px; flex: none; }
.stage-body { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.frame-box {
  position: absolute; top: 0; left: 0; transform-origin: 0 0; background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 6px 24px rgba(0, 0, 0, .10); border-radius: 2px;
}
.stage[data-side="A"] .frame-box { box-shadow: 0 0 0 2px var(--a), 0 6px 24px rgba(0, 0, 0, .10); }
.stage[data-side="B"] .frame-box { box-shadow: 0 0 0 2px var(--b), 0 6px 24px rgba(0, 0, 0, .10); }
.frame-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.marks-layer, .pick-layer { position: absolute; inset: 0; pointer-events: none; }
.pick-layer { pointer-events: auto; cursor: crosshair; display: none; }
.picking .pick-layer { display: block; }
/* Marks live inside the scaled frame: --inv (1 / frame scale) keeps lines and labels a constant size on screen. */
.mark {
  position: absolute; border: calc(2px * var(--inv, 1)) solid var(--mark, var(--ink)); border-radius: calc(3px * var(--inv, 1));
  background: color-mix(in srgb, var(--mark, var(--ink)) 8%, transparent);
}
.mark-label {
  position: absolute; left: calc(-2px * var(--inv, 1)); bottom: 100%; white-space: nowrap;
  padding: calc(1px * var(--inv, 1)) calc(6px * var(--inv, 1)); border-radius: calc(4px * var(--inv, 1));
  font: 600 calc(11px * var(--inv, 1))/1.35 var(--font); color: #fff; background: var(--mark, var(--ink));
}
.mark.flash { animation: flash 1.2s var(--ease) 1; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, .28); } 100% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0); } }
.hover-box {
  position: absolute; border: calc(2px * var(--inv, 1)) solid var(--pick, var(--ink)); background: color-mix(in srgb, var(--pick, var(--ink)) 14%, transparent);
  border-radius: 3px; pointer-events: none;
}
.hover-tip {
  position: absolute; padding: calc(2px * var(--inv, 1)) calc(7px * var(--inv, 1)); border-radius: calc(5px * var(--inv, 1));
  background: var(--ink); color: #fff; font: 500 calc(11.5px * var(--inv, 1))/1.35 var(--font); white-space: nowrap;
  pointer-events: none; max-width: 90%; overflow: hidden; text-overflow: ellipsis;
}
.drag-box { position: absolute; border: calc(2px * var(--inv, 1)) dashed var(--pick, var(--ink)); background: color-mix(in srgb, var(--pick, var(--ink)) 10%, transparent); }

.side-flash {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.96); z-index: 6;
  width: 132px; height: 132px; border-radius: 28px; display: grid; place-items: center;
  font: 800 84px/1 var(--font); color: #fff; opacity: 0; pointer-events: none;
  transition: opacity .14s var(--ease), transform .14s var(--ease);
}
.side-flash.A { background: var(--a); }
.side-flash.B { background: var(--b-ink); }
.side-flash.show { opacity: .94; transform: translate(-50%, -50%) scale(1); }
.pick-bar {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 14px; background: var(--ink); color: #fff;
  border-bottom: 1px solid var(--line);
}
.pick-bar .pick-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; flex: none; box-shadow: 0 0 0 4px rgba(255, 255, 255, .18); }
.pick-bar .pick-text { flex: 1; min-width: 0; }
.pick-bar .msg { font-size: 13.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-bar .msg b { font-weight: 700; }
.pick-bar .sub { font-size: 12px; color: rgba(255, 255, 255, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-bar kbd { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.link.light { color: rgba(255, 255, 255, .85); white-space: nowrap; }
.link.light:hover { color: #fff; }
.btn.small.dark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.btn.small.dark:hover { background: rgba(255, 255, 255, .12); }

/* ---------- panel ---------- */
.resizer { width: 6px; margin-left: -3px; margin-right: -3px; cursor: col-resize; position: relative; z-index: 3; }
.resizer:hover, .resizer.active { background: linear-gradient(90deg, transparent 2px, var(--line-strong) 2px 4px, transparent 4px); }
.panel {
  width: var(--panel-w); flex: none; display: flex; flex-direction: column; background: var(--surface);
  border-left: 1px solid var(--line); min-height: 0;
}
.panel-scroll { flex: 1; overflow-y: auto; padding: 14px 14px 24px; scroll-padding: 14px; }
.panel-foot {
  border-top: 1px solid var(--line); padding: 10px 14px; display: flex; align-items: center; gap: 10px; background: var(--surface);
}
.panel-foot .status { flex: 1; font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.panel-foot .status.ready { color: var(--ok); }
.panel-foot .status a { color: inherit; }
.revising { background: var(--warn-soft); color: var(--warn); font-size: 12px; padding: 6px 14px; border-top: 1px solid var(--line); }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 10px; }
.card-head { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px 0; }
.card-title { font-weight: 650; font-size: 15px; white-space: nowrap; }
.card-sub { color: var(--ink-3); font-size: 12px; }
.card-body { padding: 8px 14px 14px; }
.card.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.card .question { color: var(--ink-2); margin: 2px 0 10px; }
.card .look { color: var(--ink-3); font-size: 12px; margin: -4px 0 10px; }
.step-no {
  width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; align-self: center;
  font-size: 11px; font-weight: 700; background: var(--sunken); color: var(--ink-3); border: 1px solid var(--line);
}
.card.answered .step-no { background: var(--ink); color: #fff; border-color: var(--ink); }
.card-summary { padding: 0 14px 12px; font-size: 12px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.card.collapsed .card-body { display: none; }
.card.collapsed { cursor: pointer; }
.card.collapsed:hover { background: var(--sunken); }

/* brief */
.brief .md { font-size: 13px; line-height: 1.75; color: var(--ink-2); max-height: 7.2em; overflow: hidden; position: relative; }
.brief .md::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.4em; background: linear-gradient(transparent, var(--surface)); }
.brief.open .md { max-height: none; color: var(--ink); }
.brief.open .md::after { display: none; }
.inputs .card-sub { margin-right: 2px; align-self: center; }
.brief-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.inputs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: 12px; }
.inputs a {
  color: var(--ink-2); text-decoration: none; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11px;
}
.inputs a:hover { border-color: var(--ink-3); color: var(--ink); }
.md p { margin: 0 0 .7em; }
.md ul, .md ol { margin: 0 0 .7em; padding-left: 1.4em; }
.md li { margin: .15em 0; }
.md code { font-family: var(--mono); font-size: .9em; background: var(--sunken); padding: 1px 4px; border-radius: 4px; }
.md a { color: var(--a-ink); }
.md h3, .md h4, .md h5, .md h6 { font-size: 1em; margin: 1em 0 .4em; }
.md table { border-collapse: collapse; font-size: .92em; margin: 0 0 .8em; }
.md th, .md td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
.md blockquote { margin: 0 0 .8em; padding-left: .8em; border-left: 3px solid var(--line); color: var(--ink-3); }
.md pre { background: var(--sunken); padding: 8px 10px; border-radius: 6px; overflow: auto; }
.tablewrap { overflow-x: auto; }

/* explore checklist */
.explore-card .card-body { padding-top: 10px; }
.checklist { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.checklist li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }
.tick { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-strong); color: transparent; }
.tick svg { width: 12px; height: 12px; }
.tick.on.A { background: var(--a); border-color: var(--a); color: #fff; }
.tick.on.B { background: var(--b); border-color: var(--b); color: #fff; }
.tick.on.P { background: var(--p); border-color: var(--p); color: #fff; }
.checklist .head { font-size: 11px; color: var(--ink-3); }
.checklist .head span { width: 20px; text-align: center; font-weight: 700; }

/* five-step comparison scale */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.scale.three { grid-template-columns: repeat(3, 1fr); }
.scale.three button { padding: 8px 2px 7px; }
.scale button {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 7px 2px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.2; min-width: 0;
  transition: background .12s var(--ease), border-color .12s var(--ease), color .12s var(--ease);
}
.scale button b { font-size: 15px; font-weight: 700; }
.scale button small { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.scale button.a2 b, .scale button.a1 b { color: var(--a-ink); }
.scale button.b2 b, .scale button.b1 b { color: var(--b-ink); }
.scale button:hover { border-color: var(--ink-3); }
.scale button[aria-checked="true"].a2 { background: var(--a); border-color: var(--a); }
.scale button[aria-checked="true"].a1 { background: var(--a-soft); border-color: var(--a); }
.scale button[aria-checked="true"].eq { background: var(--ink); border-color: var(--ink); }
.scale button[aria-checked="true"].b1 { background: var(--b-soft); border-color: var(--b); }
.scale button[aria-checked="true"].b2 { background: var(--b-ink); border-color: var(--b-ink); }
.scale button[aria-checked="true"].a2 b, .scale button[aria-checked="true"].a2 small,
.scale button[aria-checked="true"].b2 b, .scale button[aria-checked="true"].b2 small,
.scale button[aria-checked="true"].eq b, .scale button[aria-checked="true"].eq small { color: #fff; }
.scale-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.link { border: 0; background: none; padding: 0; color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; font-size: 12px; }
.link:hover { color: var(--ink); }
.link[aria-pressed="true"] { color: var(--ink); font-weight: 600; }

/* reason tags */
.tags { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.tags-title { display: flex; justify-content: space-between; align-items: flex-end; font-size: 12.5px; font-weight: 650; color: var(--ink); margin: 10px 0 4px; }
.tags-title .hint { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.col-head { display: grid; grid-template-columns: 30px 30px; gap: 4px; font-size: 11px; font-weight: 600; color: var(--ink-3); text-align: center; }
.col-head span { white-space: nowrap; }
/* English column heads ("A good") are wider than the Chinese ones: give both columns a little more room. */
html[lang="en"] .col-head { font-size: 10.5px; letter-spacing: -.01em; grid-template-columns: 36px 36px; gap: 2px; }
html[lang="en"] .tag-row { grid-template-columns: 1fr 36px 36px; gap: 2px; }
html[lang="en"] .tag-row .side-toggle { justify-self: center; }
.tags-hint { font-size: 11.5px; color: var(--ink-3); margin: 0 0 4px; line-height: 1.5; }
.tag-group { font-size: 11px; color: var(--ink-3); font-weight: 600; letter-spacing: .04em; margin: 8px 0 2px; padding-top: 6px; border-top: 1px solid var(--line); }
.tags-title + .tags-hint + .tag-group, .tags-title + .tag-group { border-top: 0; padding-top: 0; margin-top: 2px; }
.tag-row { display: grid; grid-template-columns: 1fr 30px 30px; gap: 4px; align-items: start; padding: 3px 0; }
.tag-main { min-width: 0; }
.tag-label {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 0; cursor: help; border-bottom: 1px dotted transparent; color: var(--ink);
}
.tag-label:hover, .tag-label:focus-visible { border-bottom-color: var(--ink-3); }
.tag-label .grader-none { width: 6px; height: 6px; border-radius: 50%; background: var(--p); display: none; }
.side-toggle {
  width: 30px; height: 26px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface);
  font-weight: 700; font-size: 12px; color: var(--ink-3);
}
.side-toggle.A:hover { border-color: var(--a); color: var(--a-ink); }
.side-toggle.B:hover { border-color: var(--b); color: var(--b-ink); }
.side-toggle.A[aria-pressed="true"] { background: var(--a); border-color: var(--a); color: #fff; }
.side-toggle.B[aria-pressed="true"] { background: var(--b-ink); border-color: var(--b-ink); color: #fff; }
.tag-row.strength .side-toggle.A[aria-pressed="true"] { background: var(--a-soft); color: var(--a-ink); }
.tag-row.strength .side-toggle.B[aria-pressed="true"] { background: var(--b-soft); color: var(--b-ink); }
.mark-line { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 2px; }
.pin {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px;
  border: 1px dashed var(--line-strong); background: transparent; color: var(--ink-2);
}
.pin svg { width: 12px; height: 12px; }
.pin.A { border-color: var(--a-mid); color: var(--a-ink); }
.pin.B { border-color: var(--b-mid); color: var(--b-ink); }
.pin.P { border-color: #c9c8f3; color: var(--p); }
.pin.has { border-style: solid; }
.pin.A.has { background: var(--a-soft); }
.pin.B.has { background: var(--b-soft); }
.pin.P.has { background: var(--p-soft); }
.pin .pin-go { border: 0; background: none; padding: 0; display: inline-flex; align-items: center; gap: 4px; color: inherit; font: inherit; }
.pin .x { border: 0; background: none; padding: 0 0 0 4px; margin-left: 2px; color: inherit; opacity: .6; font: inherit; font-size: 13px; line-height: 1; }
.pin .x:hover, .pin .x:focus-visible { opacity: 1; }
.more-btn { margin-top: 4px; }
.sev {
  height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; border: 1px dashed var(--line-strong);
  background: transparent; color: var(--ink-3);
}
.sev:hover { border-color: var(--bad); color: var(--bad); }
.sev[aria-pressed="true"] { border-style: solid; border-color: var(--bad); background: var(--bad-soft); color: var(--bad); font-weight: 650; }
.chip.severe { box-shadow: inset 0 0 0 1px var(--bad); }

/* summaries */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; border: 1px solid var(--line); background: var(--sunken); color: var(--ink-2); }
.chip.A { background: var(--a-soft); border-color: var(--a-mid); color: var(--a-ink); }
.chip.B { background: var(--b-soft); border-color: var(--b-mid); color: var(--b-ink); }
.chip.pick { font-weight: 650; }

/* audit */
.cond .card-head { flex-wrap: wrap; }
.type-pill { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--sunken); border: 1px solid var(--line); color: var(--ink-2); }
.cond-req { color: var(--ink-3); font-size: 12px; margin: 4px 0 2px; }
.cond-text { font-size: 15px; font-weight: 600; line-height: 1.55; margin: 0 0 6px; }
.cond-basis { font-size: 12px; color: var(--ink-3); margin: 0 0 12px; padding-left: 9px; border-left: 2px solid var(--line); }
.verdicts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.verdicts button {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 8px 4px; font-weight: 600;
  display: flex; justify-content: center; align-items: center; gap: 6px;
}
.verdicts button kbd { font-weight: 400; }
.verdicts button:hover { border-color: var(--ink-3); }
.verdicts button .glyph { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; background: var(--sunken); color: var(--ink-2); }
.verdicts button[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.verdicts button[aria-checked="true"] .glyph { background: #fff; color: var(--ink); }
.verdicts button[aria-checked="true"].met .glyph { color: var(--ok); }
.verdicts button[aria-checked="true"].unmet .glyph { color: var(--bad); }
.verdicts button[aria-checked="true"] kbd { color: #fff; border-color: rgba(255, 255, 255, .5); background: transparent; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.reasons button {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; color: var(--ink-2);
}
.reasons button:hover { border-color: var(--ink-3); color: var(--ink); }
.reasons button[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.field-label { font-size: 12px; color: var(--ink-3); margin: 12px 0 4px; }
.need { color: var(--warn); font-size: 12px; margin-top: 8px; }

.other-input {
  width: 100%; margin-top: 10px; height: 32px; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 0 10px;
  font-size: 12.5px; background: transparent;
}
.other-input:focus { outline: none; border-style: solid; border-color: var(--ink); background: var(--surface); }
.note { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; resize: vertical; min-height: 38px; font-size: 13px; }
.note:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

/* tooltip */
.tooltip {
  position: fixed; z-index: 50; max-width: 300px; padding: 10px 12px; border-radius: 10px; background: var(--ink); color: #fff;
  font-size: 12.5px; line-height: 1.55; box-shadow: var(--shadow); pointer-events: none;
}
.tooltip .t-title { font-weight: 650; margin-bottom: 4px; }
.tooltip .t-check { color: rgba(255, 255, 255, .72); margin-top: 6px; }
.tooltip .t-grader { color: rgba(255, 255, 255, .5); margin-top: 6px; font-size: 11px; }

/* toast */
.toast {
  position: fixed; left: 50%; top: 64px; transform: translate(-50%, -8px); opacity: 0; z-index: 60;
  display: flex; align-items: center; gap: 12px; padding: 9px 10px 9px 14px; border-radius: 10px; background: var(--ink); color: #fff;
  box-shadow: var(--shadow); transition: opacity .18s var(--ease), transform .18s var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.err { background: var(--bad); }
.toast button { border: 1px solid rgba(255, 255, 255, .35); background: transparent; color: #fff; border-radius: 6px; padding: 3px 10px; }

/* dialogs */
dialog { border: 0; border-radius: 14px; padding: 0; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); max-width: min(92vw, 720px); color: var(--ink); }
dialog::backdrop { background: rgba(20, 20, 22, .35); }
.dlg { padding: 22px 24px; }
.dlg h2 { margin: 0 0 6px; font-size: 18px; }
.dlg p { margin: 0 0 14px; color: var(--ink-2); }
.dlg .row { display: flex; gap: 8px; }
.dlg input[type="text"] { flex: 1; height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 12px; font-size: 15px; }
.dlg input[type="text"]:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.dlg .err { color: var(--bad); font-size: 12px; margin-top: 6px; min-height: 1em; }
.dlg-brief { width: min(92vw, 760px); }
.dlg-brief .md { font-size: 14.5px; line-height: 1.85; max-height: 70vh; overflow: auto; color: var(--ink); }
.dlg-close { position: absolute; right: 10px; top: 10px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; color: var(--ink-2); align-items: center; }
.keys dt { text-align: right; white-space: nowrap; }
.keys dd { margin: 0; }
.keys h3 { grid-column: 1 / -1; margin: 10px 0 0; font-size: 12px; color: var(--ink-3); font-weight: 600; }

.empty-state { display: grid; place-items: center; height: 100%; color: var(--ink-2); text-align: center; padding: 24px; }
.empty-state h2 { margin: 0 0 6px; font-size: 18px; color: var(--ink); }

/* Narrow screens: labeling needs room for a scaled page and the panel, so say so (in both languages). */
.narrow-note { display: none; }
@media (max-width: 699px) {
  .narrow-note:not(.dismissed) {
    display: grid; place-items: center; position: fixed; inset: 0; z-index: 100; padding: 24px 16px;
    background: var(--bg); overflow-y: auto;
  }
  .narrow-note > div { max-width: 420px; }
  .narrow-note p { margin: 0 0 14px; color: var(--ink-2); line-height: 1.6; }
  .narrow-note b { color: var(--ink); }
  .narrow-actions { display: flex; flex-wrap: wrap; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media (max-width: 1100px) {
  body { overflow: auto; }
  .topbar { height: auto; flex-wrap: wrap; padding: 8px 12px; row-gap: 8px; }
  .task-title { order: 3; flex-basis: 100%; white-space: normal; }
  .top-right { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
  .workspace { flex-direction: column; height: auto; }
  .viewer { height: 70vh; }
  .panel { width: auto; border-left: 0; border-top: 1px solid var(--line); }
  .resizer { display: none; }
  .progress { display: none; }
}
