/* IDML Review: the deck-review design system (monochrome greys, colour only for meaning, Inter 400/500,
   white cards with layered edges, filled wells, radii stepping 16 → 12 → 10 → 6). */
@font-face {
  font-family: "Inter";
  src: url("/vendor/InterVariable.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
}
:root {
  --bg: #fafbfc; --surface: #ffffff; --well: #f3f5f8; --well-2: #e9edf2; --stage: #eef1f5;
  --text: #121a24; --text-2: #556070; --text-3: #6b7684; --faint: #b2bac5;
  --line: #eef1f4; --line-2: #e4e8ee; --line-3: #d8dee6;
  --dark: #15212c; --dark-2: #0b141c; --on-dark: #ffffff;
  --hover: #f6f9fc; --hover-2: #eef1f5; --pill: #ffffff; --list-bg: #f7fafd; --card-line: #e8ebf0; --track: #dde2e8; --scroll: #d5dbe2;
  --thumb-n: rgba(255, 255, 255, .92); --login-1: #e3e8ee; --login-2: #d3dae3; --mine: #eaf4fc;
  --danger: #c93a32; --ok: #2f6f3e; --ok-2: #5aa46a;
  --del-bg: #fde4e2; --del-fg: #d93a33; --ins-bg: #dceffb; --ins-fg: #0b6aa0;
  --tag-n-bg: #edf0f3; --tag-n-line: #dbe0e6; --tag-n-fg: #4f5a67;
  --tag-y-bg: #fbf5df; --tag-y-line: #f0e3a6; --tag-y-fg: #3d3416;
  --tag-g-bg: #e6f6ea; --tag-g-line: #b5e2c0; --tag-g-fg: #1f4a26;
  --tag-b-bg: #e3effb; --tag-b-line: #a9cdf0; --tag-b-fg: #133e66;
  --tag-r-bg: #fce6e5; --tag-r-line: #f1b5b2; --tag-r-fg: #5c2420;
  --elan: #08a3e9;
  --r-card: 16px; --r-md: 12px; --r: 10px; --r-sm: 6px;
  --edge: 0 0 0 1px rgba(15, 25, 40, .06), 0 1px 2px rgba(15, 25, 40, .04);
  --float: 0 0 0 1px rgba(15, 25, 40, .08), 0 0 0 4px rgba(255, 255, 255, .5), 0 2px 4px rgba(15, 25, 40, .06), 0 16px 40px rgba(20, 35, 55, .16);
  font-family: "Inter", ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI", sans-serif;
  font-feature-settings: "cv11";
  font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
[v-cloak] { display: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.spacer { flex: 1; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.muted, .t-2 { color: var(--text-2); }
.t-3 { color: var(--text-3); }
.small { font-size: 13px; }
.nums { font-variant-numeric: tabular-nums; }
.error { color: var(--danger); font-size: 13px; }
.ic { flex-shrink: 0; display: block; }

/* severity: icon colour, halo, tint (colour only where it means something) */
.sev-critical { --c: #ef4136; --halo: #fbd6d1; --tint: #fdeceb; }
.sev-major { --c: #ee9632; --halo: #fbe5cb; --tint: #fdf3e6; }
.sev-minor { --c: #4b8ee0; --halo: #d9e7fa; --tint: #ecf3fd; }
.sev-suggestion { --c: #9ca1aa; --halo: #e7e9ee; --tint: #f0f3f6; }
.sev-client { --c: #a35bc6; --halo: #eedff5; --tint: #f7eefa; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d141b; --surface: #151e28; --well: #1c2631; --well-2: #24303c; --stage: #0a1016;
  --text: #e6ebf1; --text-2: #a8b3bf; --text-3: #8794a3; --faint: #4f5b68;
  --line: #1f2a35; --line-2: #2a3642; --line-3: #36434f;
  --dark: #08a3e9; --dark-2: #3bb8f0; --on-dark: #06121b;
  --hover: #1d2833; --hover-2: #202c38; --pill: #18222c; --list-bg: #111921; --card-line: #243039; --track: #2a3642; --scroll: #2e3a46;
  --thumb-n: rgba(13, 20, 27, .85); --login-1: #16212c; --login-2: #0b1117; --mine: #12304a;
  --danger: #f2766d; --ok: #3f8f53; --ok-2: #6cc17f;
  --del-bg: #3a1a1a; --del-fg: #ff8a80; --ins-bg: #0f3049; --ins-fg: #7cc8f5;
  --tag-n-bg: #1f2a35; --tag-n-line: #2e3a46; --tag-n-fg: #b4bfcb;
  --tag-y-bg: #2e2812; --tag-y-line: #574a1d; --tag-y-fg: #f0dc8c;
  --tag-g-bg: #12291a; --tag-g-line: #24502f; --tag-g-fg: #9fdcaf;
  --tag-b-bg: #0f2a42; --tag-b-line: #1d4d75; --tag-b-fg: #a6d3f7;
  --tag-r-bg: #35181a; --tag-r-line: #6a2a2b; --tag-r-fg: #f5b1ab;
  --edge: 0 0 0 1px rgba(255, 255, 255, .09), 0 1px 2px rgba(0, 0, 0, .3);
  --float: 0 0 0 1px rgba(255, 255, 255, .08), 0 2px 4px rgba(0, 0, 0, .3), 0 16px 40px rgba(0, 0, 0, .5);
}
:root[data-theme="dark"] [class*="sev-"] { --halo: color-mix(in srgb, var(--c) 30%, var(--surface)); --tint: color-mix(in srgb, var(--c) 18%, var(--surface)); }
:root[data-theme="dark"] .sev-suggestion { --c: #7d8896; }
:root[data-theme="dark"] .seg { background: var(--well); }
:root[data-theme="dark"] .seg button.active { background: var(--well-2); }
/* pins sit on the slide image, which stays light */
:root[data-theme="dark"] .pin { background: #ffffff; color: #121a24; }
:root[data-theme="dark"] .pin.on { background: #15212c; color: #ffffff; }
:root[data-theme="dark"] .thumb img, :root[data-theme="dark"] .slide img { box-shadow: 0 0 0 1px rgba(255, 255, 255, .06); }

/* 20px halo with a glyph: triangle / half disc / dot / ring */
.sev-icon { position: relative; flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--halo); display: inline-block; }
.sev-icon::after { content: ""; position: absolute; inset: 0; margin: auto; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.sev-icon.sev-critical::after { width: 10px; height: 9px; border-radius: 1px; clip-path: polygon(50% 0, 100% 100%, 0 100%); top: -1px; }
.sev-icon.sev-major::after { background: linear-gradient(90deg, var(--c) 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px var(--c); }
.sev-icon.sev-minor::after { width: 7px; height: 7px; }
.sev-icon.sev-suggestion::after { width: 8px; height: 8px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }

/* buttons */
.btn, .pill, .icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; user-select: none;
  box-shadow: 0 1px 2px rgba(15, 25, 40, .04); transition: background .12s, border-color .12s; }
.btn:hover, .pill:hover, .icon-btn:hover { background: var(--hover); border-color: var(--line-3); }
.btn .ic, .pill .ic { color: var(--text-2); }
.btn.dark, .pill.dark { background: var(--dark); border-color: var(--dark); color: var(--on-dark); box-shadow: 0 1px 2px rgba(15, 25, 40, .12); }
.btn.dark .ic, .pill.dark .ic { color: var(--on-dark); }
.btn.dark:hover, .pill.dark:hover { background: var(--dark-2); border-color: var(--dark-2); }
.btn.ghost { background: var(--well); border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--well-2); }
.btn.wide { width: 100%; height: 38px; }
.btn.pressed { background: var(--well-2); border-color: var(--line-3); }
.btn.dark.pressed { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn:disabled, .pill:disabled, .icon-btn:disabled { opacity: .4; cursor: default; }
.pill { border-radius: 999px; background: var(--pill); padding: 0 14px; }
.pill.icon-only { width: 32px; padding: 0; }
.icon-btn { width: 32px; padding: 0; color: var(--text-2); }
.icon-btn.well { background: var(--well); border-color: transparent; box-shadow: none; width: 34px; height: 34px; }
.icon-btn.well.on { background: var(--well-2); color: var(--text); }
.icon-btn.ghostless { border-color: transparent; box-shadow: none; background: transparent; }
.icon-btn.ghostless:hover { background: var(--well); }
.quiet-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.quiet-link:hover { color: var(--text); }
.link { color: var(--text-2); font-size: 13px; text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
.link:hover { color: var(--text); }

/* tags: pastel fill, same-hue border, dark same-hue text */
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid; font-size: 12.5px; white-space: nowrap; }
.tag.neutral { background: var(--tag-n-bg); border-color: var(--tag-n-line); color: var(--tag-n-fg); }
.tag.yellow { background: var(--tag-y-bg); border-color: var(--tag-y-line); color: var(--tag-y-fg); }
.tag.green { background: var(--tag-g-bg); border-color: var(--tag-g-line); color: var(--tag-g-fg); }
.tag.blue { background: var(--tag-b-bg); border-color: var(--tag-b-line); color: var(--tag-b-fg); }
.tag.red { background: var(--tag-r-bg); border-color: var(--tag-r-line); color: var(--tag-r-fg); }

/* inputs */
.well-input { width: 100%; height: 36px; padding: 0 12px; border: 0; border-radius: var(--r); background: var(--well); font: inherit; color: var(--text); outline: none; }
textarea.well-input { height: auto; padding: 9px 12px; resize: vertical; line-height: 1.5; }
.well-input:focus { background: var(--hover-2); }
.well-input:focus-visible { box-shadow: 0 0 0 2px var(--elan); }
.search { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; background: var(--well); border-radius: var(--r); color: var(--text-3); min-width: 0; flex: 1; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--text); outline: none; }
.search input::placeholder, .well-input::placeholder, textarea::placeholder { color: var(--text-3); }

/* brand */
.wordmark { font-weight: 700; letter-spacing: .01em; font-size: 22px; color: var(--text); }
.wordmark .brace { color: var(--elan); font-weight: 400; margin: 0 1px; }
.wordmark.small { font-size: 14px; }

/* frame */
.app { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.bar { height: 56px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 16px; }
.bar.contained { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.crumbs .tag { margin-left: 4px; }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.crumb { color: var(--text-3); white-space: nowrap; }
a.crumb:hover { color: var(--text); }
.crumb.current { color: var(--text); font-weight: 500; max-width: 520px; }
.crumb-sep { color: var(--faint); }
.page { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* card + floating sheet */
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--float); }
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 120% at 50% 40%, rgba(214, 221, 230, .55), rgba(188, 198, 210, .75)); backdrop-filter: blur(2px); }
.sheet { width: 520px; max-width: 100%; display: flex; flex-direction: column; }
.sheet.narrow { width: 380px; }
.sheet.choice { width: 470px; }
.sheet-head { display: flex; align-items: center; height: 52px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); font-weight: 500; }
.sheet-head > span:first-child { flex: 1; }
.sheet-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.sheet-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px 16px; }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 150px; padding: 20px;
  border-radius: var(--r-md); background: var(--well); color: var(--text-2); cursor: pointer; text-align: center; transition: box-shadow .12s, background .12s; }
.drop:hover { background: var(--hover-2); }
.drop.over { box-shadow: inset 0 0 0 2px var(--text); background: var(--well-2); }
.drop:focus-within { box-shadow: inset 0 0 0 2px var(--elan); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.page-error { display: flex; align-items: center; gap: 10px; margin: 0 16px 8px; padding: 10px 14px; border-radius: var(--r); background: var(--tag-r-bg); color: var(--tag-r-fg); font-size: 13px; }
.drop.filled { color: var(--text); }
.drop b { font-weight: 500; color: var(--text); margin-top: 6px; }
.well-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: var(--r);
  background: var(--well); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; text-align: left; }
.well-row:hover { background: var(--well-2); }
.well-row .ic { color: var(--text-2); }
.well-row .push { margin-left: auto; color: var(--faint); }
.well-row .flip { transform: rotate(180deg); }
.options { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px; }
.opt { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.opt input[type=file] { font: inherit; font-size: 13px; color: var(--text); }

/* password */
.stage-center { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(120% 120% at 50% 40%, var(--login-1), var(--login-2)); }
.login { width: 360px; padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.login .wordmark { margin-bottom: 4px; }
.login .muted b { color: var(--text); font-weight: 600; }
.user-name { max-width: 180px; margin-left: 6px; font-size: 13px; color: var(--text-2); }


/* segmented control */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--well); }
.seg button { height: 28px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.seg button:hover:not(:disabled) { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--edge); }
.seg button:disabled { opacity: .4; cursor: default; }
.seg .count { color: var(--text-3); font-variant-numeric: tabular-nums; margin-left: 2px; }

/* start page */
.home { flex: 1; overflow: auto; width: 100%; max-width: 1200px; margin: 0 auto; padding: 8px 20px 40px; display: flex; flex-direction: column; gap: 28px; }
.upload { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.upload h1 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.upload-head p { max-width: 760px; }
.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.upload-grid .drop { min-height: 120px; }
.upload-grid .drop .small { color: var(--text-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.upload-row { display: flex; align-items: center; gap: 8px; }
.upload-row .lang { width: 190px; flex-shrink: 0; }
.list { display: flex; flex-direction: column; gap: 6px; }
.list-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.job-row { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--edge); }
.job-row:hover { background: var(--hover); }
.job-name { font-weight: 500; }

/* document view: page strip | page stage | segment panel */
.work { flex: 1; min-height: 0; display: grid; grid-template-columns: 120px minmax(0, 1fr) 440px; border-top: 1px solid var(--line); }
.stage-msg { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--text-2); }
.strip { overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; background: var(--list-bg); border-right: 1px solid var(--line); }
.thumb { position: relative; padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--r-sm); }
.thumb img { display: block; width: 100%; border-radius: var(--r-sm); box-shadow: var(--edge); background: #fff; }
.thumb.on img { box-shadow: 0 0 0 2px var(--text); }
.thumb-n { position: absolute; left: 6px; bottom: 6px; padding: 0 6px; border-radius: 999px; font-size: 11px; background: var(--thumb-n); color: var(--text); }
.thumb-flag { position: absolute; right: 6px; top: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }

.stage { min-width: 0; display: flex; flex-direction: column; background: var(--stage); }
.stage-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; }
.notice { display: flex; gap: 8px; align-items: flex-start; margin: 0 16px 8px; padding: 10px 12px; border-radius: var(--r); background: var(--tag-y-bg); color: var(--tag-y-fg); font-size: 13px; }
.notice b { font-weight: 600; }
.pages { flex: 1; min-height: 0; overflow: auto; padding: 8px 24px 16px; display: flex; justify-content: center; gap: 24px; }
.page-wrap { flex: 0 1 820px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pages.both .page-wrap { flex-basis: 50%; }
.page-img { position: relative; width: 100%; background: #fff; box-shadow: var(--float); }
.page-img img { display: block; width: 100%; height: 100%; }
.page-missing { padding: 40px; text-align: center; }
.disclaimer { padding: 0 16px 10px; text-align: center; }

/* text frames over the page: quiet until hovered or selected; red where text overflows */
.frame { position: absolute; border-radius: 1px; cursor: pointer; }
.frame.has:hover { box-shadow: 0 0 0 1px rgba(8, 163, 233, .7); background: rgba(8, 163, 233, .05); }
.frame.sel { box-shadow: 0 0 0 2px var(--elan); background: rgba(8, 163, 233, .07); }
.frame.overset { box-shadow: 0 0 0 2px #e5372c; }
.frame.overset.sel { box-shadow: 0 0 0 2px #e5372c, 0 0 0 5px rgba(8, 163, 233, .45); }
.overset-mark { position: absolute; right: -9px; bottom: -9px; width: 16px; height: 16px; border-radius: 2px; background: #e5372c; color: #fff;
  font: 700 13px/16px ui-sans-serif, system-ui, sans-serif; text-align: center; box-shadow: 0 0 0 1.5px #fff; }

.panel { min-width: 0; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); }
.panel-head { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.review-run { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--well); }
.review-summary { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.seg-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.seg-list .empty { padding: 20px; text-align: center; }
.segment { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--edge); }
.segment.sel { box-shadow: 0 0 0 1.5px var(--elan); }
.segment.overset { background: color-mix(in srgb, var(--tag-r-bg) 45%, var(--surface)); }
.seg-meta { display: flex; align-items: center; gap: 6px; min-height: 0; }
.seg-meta:empty { display: none; }
.src { font-size: 13px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.tgt { font-size: 13.5px; }
.tgt.dirty { box-shadow: 0 0 0 2px var(--tag-b-line); }
.seg-actions { display: flex; align-items: center; gap: 6px; }
.itag { display: inline-grid; place-items: center; min-width: 18px; height: 16px; padding: 0 4px; margin: 0 1px; border-radius: 4px;
  background: var(--tag-b-bg); color: var(--tag-b-fg); border: 1px solid var(--tag-b-line); font-size: 10.5px; font-weight: 600; vertical-align: 1px; }
.lb { color: var(--text-3); }
.finding { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--r); background: var(--tint); }
.finding.accepted, .finding.rejected { opacity: .65; }
.finding-head { display: flex; align-items: center; gap: 8px; }
.suggestion { padding: 6px 8px; border-radius: var(--r-sm); background: var(--surface); white-space: pre-wrap; overflow-wrap: anywhere; }
.finding-actions { display: flex; justify-content: flex-end; gap: 6px; }
.finding-actions .btn { height: 28px; font-size: 13px; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-3); border-top-color: var(--text); animation: spin .8s linear infinite; flex-shrink: 0; }
.spinner.small { width: 14px; height: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .work { grid-template-columns: 90px minmax(0, 1fr) 360px; }
  .upload-grid { grid-template-columns: 1fr; }
  .upload-row { flex-wrap: wrap; }
}
