/* ============================================================================
   EstimateBay — design system
   "Audit-grade clarity": calm authority, precision, trust. The status language
   is carried by crafted icon MEDALLIONS, soft tints and layered depth — never a
   flat strip of colour on a card edge.
   ============================================================================ */

:root {
  /* ---- Canvas & surfaces (a layered, cool neutral stack) ---- */
  --page: #e8edf1;
  --page-2: #eef2f5;
  --paper: #ffffff;
  --paper-2: #f4f7f9;
  --paper-3: #eef2f6;
  --ink: #14202b;
  --ink-soft: #2c3a46;
  --muted: #5c6b78;
  --faint: #8593a0;
  --line: #e3e8ec;
  --line-2: #d8dee4;
  --line-strong: #c4ccd4;

  /* ---- Brand & semantic hues ---- */
  --navy: #1a3d63;
  --blue: #1f6b9d;
  --teal: #157d83;
  --green: #1c7a4d;
  --amber: #b06a10;
  --red: #c0392b;
  --purple: #6f4ca0;
  --money: #0a8a6f;
  --brand-a: #5fd0bd;
  --brand-b: #4f8fd0;
  --brand-grad: linear-gradient(135deg, var(--brand-a), var(--brand-b));
  --primary: #1a3d63;
  --primary-hover: #234e7d;
  --primary-ink: #ffffff;
  --inverse: #ffffff;
  --link: #1f6b9d;

  /* ---- Status: ink / soft wash / hairline ring (used by medallions + tints) ---- */
  --ok-ink: #1c7a4d;   --ok-wash: #eaf6ef;   --ok-ring: rgba(28,122,77,.26);   --ok-tint: #f4faf6;
  --warn-ink: #b06a10; --warn-wash: #fdf3e3; --warn-ring: rgba(176,106,16,.26); --warn-tint: #fef8ee;
  --bad-ink: #c0392b;  --bad-wash: #fcebe8;  --bad-ring: rgba(192,57,43,.24);  --bad-tint: #fdf3f1;
  --review-ink: #6f4ca0; --review-wash: #f1ecf9; --review-ring: rgba(111,76,160,.24); --review-tint: #f8f5fc;
  --info-ink: #1f6b9d; --info-wash: #e9f2f9;  --info-ring: rgba(31,107,157,.24);  --info-tint: #f3f8fc;
  --money-ink: #0a8a6f; --money-wash: #e6f6f0; --money-ring: rgba(10,138,111,.26); --money-tint: #f2fbf7;

  /* legacy aliases (kept so older rules + dynamic markup resolve) */
  --ok-bg: var(--ok-wash); --ok-border: var(--ok-ring);
  --warn-bg: var(--warn-wash); --warn-border: var(--warn-ring);
  --bad-bg: var(--bad-wash); --bad-border: var(--bad-ring);
  --review-bg: var(--review-wash); --review-border: var(--review-ring);
  --info-bg: var(--info-wash); --info-border: var(--info-ring);
  --money-bg: var(--money-wash);
  --verdict-bg: var(--ok-tint);
  --detail: var(--ink-soft); --verdict-detail: var(--ink-soft);
  --tag-bg: #eef3f6; --tag-border: #d7e0e6;
  --table-line: #eef1f4;
  --board-bg: #eef2f5; --lane-bg: #f1f5f7; --track-bg: #dde4e9;
  --judgment-bg: #fdf7ec;
  --drop-bg: #f7fafb; --drop-border: #aebcc4; --drop-drag-bg: #eaf6ef; --drop-icon-border: #c8e3d6;
  --pass-accent: var(--ok-ring); --info-accent: var(--info-ring);
  --estimate-head-end: #235a86;
  --addressed-line: #9aa7b1;

  /* ---- Dark rail ---- */
  --rail: #101b27;
  --rail-2: #0c151f;
  --rail-ink: #eef3f7;
  --rail-muted: #93a3b2;
  --rail-control: #18283a;
  --rail-control-ink: #eef3f7;
  --rail-hover: rgba(255,255,255,.06);
  --rail-active: rgba(95,208,189,.12);
  --rail-border: rgba(255,255,255,.10);
  --rail-border-soft: rgba(255,255,255,.07);

  /* ---- Effects ---- */
  --focus: #2f9fd0;
  --focus-ring: 0 0 0 3px rgba(47,159,208,.35);
  --overlay-bg: rgba(20,32,43,.46);
  --toast-bg: #16242f;
  --spinner-track: #d3dce2;
  --scroll-shadow: rgba(20,32,43,.14);
  --scroll-cover: var(--paper);

  --shadow-xs: 0 1px 2px rgba(20,32,43,.06);
  --shadow-sm: 0 1px 2px rgba(20,32,43,.06), 0 1px 1px rgba(20,32,43,.04);
  --shadow: 0 1px 2px rgba(20,32,43,.05), 0 6px 16px -6px rgba(20,32,43,.12);
  --shadow-md: 0 2px 6px -2px rgba(20,32,43,.06), 0 14px 30px -10px rgba(20,32,43,.16);
  --shadow-lg: 0 8px 18px -8px rgba(20,32,43,.12), 0 30px 60px -16px rgba(20,32,43,.24);
  --edge-hi: inset 0 1px 0 rgba(255,255,255,.65);

  --r-sm: 9px;
  --r: 13px;
  --r-lg: 18px;
  --r-pill: 999px;

  --mono: "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  --sans: Inter, "Segoe UI", Roboto, Arial, sans-serif;

  /* ---- Icon shapes (colour-agnostic; coloured at use-site via mask) ---- */
  --ic-check: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%2012.5l4.5%204.5%209.5-10'/%3E%3C/svg%3E");
  --ic-x: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M6.5%206.5l11%2011M17.5%206.5l-11%2011'/%3E%3C/svg%3E");
  --ic-bang: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%206.3v8M12%2017.7v.01'/%3E%3C/svg%3E");
  --ic-eye: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.1'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M2.6%2012s3.7-6.4%209.4-6.4S21.4%2012%2021.4%2012s-3.7%206.4-9.4%206.4S2.6%2012%202.6%2012Z'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='2.4'/%3E%3C/svg%3E");
  --ic-info: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%2010.8v5.6M12%207.5v.01'/%3E%3C/svg%3E");
  --ic-up: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.3'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M4%2015.5l5.5-5.5%204%204%206.5-6.5M16.5%207.5h4v4'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b121a;
  --page-2: #0e1620;
  --paper: #151f2a;
  --paper-2: #1b2735;
  --paper-3: #1f2d3c;
  --ink: #eef3f7;
  --ink-soft: #c6d2dc;
  --muted: #93a4b3;
  --faint: #6f8090;
  --line: #28384a;
  --line-2: #314556;
  --line-strong: #3c5063;

  --navy: #7db4e6;
  --blue: #6fbcef;
  --teal: #5cc6cd;
  --green: #5fd699;
  --amber: #e6b46a;
  --red: #f0897f;
  --purple: #c2a4f0;
  --money: #5fd9c2;
  --primary: #2a5a8c;
  --primary-hover: #336aa3;
  --link: #7cc3f2;

  --ok-ink: #5fd699;   --ok-wash: #14342a;   --ok-ring: rgba(95,214,153,.30);   --ok-tint: #122a23;
  --warn-ink: #e6b46a; --warn-wash: #382a14; --warn-ring: rgba(230,180,106,.30); --warn-tint: #2c2113;
  --bad-ink: #f0897f;  --bad-wash: #3a1e1d;  --bad-ring: rgba(240,137,127,.32);  --bad-tint: #2e1917;
  --review-ink: #c2a4f0; --review-wash: #2b2240; --review-ring: rgba(194,164,240,.30); --review-tint: #221b33;
  --info-ink: #6fbcef; --info-wash: #15324a;  --info-ring: rgba(111,188,239,.30);  --info-tint: #11283b;
  --money-ink: #5fd9c2; --money-wash: #103730; --money-ring: rgba(95,217,194,.30); --money-tint: #0d2c27;

  --tag-bg: #223240; --tag-border: #34485a;
  --table-line: #243443;
  --board-bg: #0d151e; --lane-bg: #15202c; --track-bg: #2a3a49;
  --judgment-bg: #322816;
  --drop-bg: #131d27; --drop-border: #3a4f61; --drop-drag-bg: #143229; --drop-icon-border: #2f5a4a;
  --estimate-head-end: #2a567d;
  --addressed-line: #6b7a87;

  --rail: #0a121b;
  --rail-2: #070d14;
  --rail-control: #16222f;
  --rail-active: rgba(95,208,189,.14);

  --focus: #54b4e0;
  --focus-ring: 0 0 0 3px rgba(84,180,224,.35);
  --overlay-bg: rgba(5,9,14,.62);
  --toast-bg: #1d2c3a;
  --spinner-track: #2a3a49;
  --scroll-shadow: rgba(0,0,0,.55);
  --edge-hi: inset 0 1px 0 rgba(255,255,255,.05);

  --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 1px 1px rgba(0,0,0,.3);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 18px -8px rgba(0,0,0,.5);
  --shadow-md: 0 2px 6px -2px rgba(0,0,0,.45), 0 16px 32px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 10px 22px -10px rgba(0,0,0,.5), 0 32px 64px -18px rgba(0,0,0,.7);
}

/* ---- Base ---- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--page);
  font: 14px/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "cv05" 1, "ss01" 1;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.012em; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(47,159,208,.22); }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }

/* ============================================================================
   App shell + dark rail
   ============================================================================ */
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px;
  padding: 20px 16px;
  color: var(--rail-ink);
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(95,208,189,.08), transparent 60%),
    linear-gradient(180deg, var(--rail), var(--rail-2));
  border-right: 1px solid rgba(255,255,255,.06);
}
.wordmark {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 8px; margin: -2px; border-radius: 11px; cursor: pointer;
  transition: background .15s ease;
}
.wordmark:hover { background: var(--rail-hover); }
.wordmark:focus-visible { box-shadow: var(--focus-ring); }
.mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: var(--brand-grad);
  display: grid; place-items: center; color: #0d2230; font-weight: 900; font-size: 13px;
}
.mark-img {
  width: 38px; height: 38px; border-radius: 11px; flex: none; background: #fff;
  object-fit: contain; padding: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.5);
}
.wordmark b { display: block; font-size: 15.5px; font-weight: 800; letter-spacing: -.01em; }
.wordmark span { display: block; color: var(--rail-muted); font-size: 11px; margin-top: 1px; letter-spacing: .01em; }

.rail-nav { display: grid; gap: 3px; }
.rail-btn {
  position: relative;
  width: 100%; min-height: 40px; border: 0; border-radius: 10px; background: transparent;
  color: var(--rail-muted); text-align: left; padding: 9px 11px;
  display: flex; align-items: center; gap: 11px; cursor: pointer; font-weight: 600; font-size: 13.5px;
  transition: background .15s ease, color .15s ease;
}
.rail-btn:hover { background: var(--rail-hover); color: var(--rail-ink); }
.rail-btn:active { transform: translateY(.5px); }
.rail-btn .nav-ic { width: 19px; height: 19px; flex: none; color: currentColor; opacity: .92; }
.mini-icon {  /* legacy lettermark fallback if an SVG is ever missing */
  width: 26px; height: 26px; border: 1px solid var(--rail-border); border-radius: 7px;
  display: grid; place-items: center; font-size: 10px; font-weight: 800; flex: none;
}

.rail-upload {
  width: 100%; justify-content: center; cursor: pointer;
  background: var(--brand-grad); color: #0c2230; border: 0; font-weight: 750;
  box-shadow: 0 6px 16px -6px rgba(79,143,208,.6), inset 0 1px 0 rgba(255,255,255,.4);
}
.rail-upload:hover { filter: brightness(1.05); border: 0; }
.rail-upload .btn-icon { border-color: rgba(12,34,48,.5); }

.rail-field { display: grid; gap: 6px; font-size: 10.5px; color: var(--rail-muted); font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.rail-field select {
  width: 100%; padding: 9px 10px; border-radius: 9px; border: 1px solid var(--rail-border);
  background: var(--rail-control); color: var(--rail-control-ink); font-weight: 600;
  text-transform: none; letter-spacing: 0; font-size: 13px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a3b2' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 15px; padding-right: 30px;
}
.rail-field select:focus-visible { box-shadow: var(--focus-ring); border-color: var(--focus); }
.rail-field small { color: var(--rail-muted); font-size: 11px; line-height: 1.4; text-transform: none; letter-spacing: 0; font-weight: 500; }

.theme-toggle {
  min-height: 40px; border: 1px solid var(--rail-border); border-radius: 10px;
  color: var(--rail-muted); display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; font-size: 12.5px; font-weight: 650; cursor: pointer; user-select: none;
  transition: background .15s ease, color .15s ease;
}
.theme-toggle:hover { background: var(--rail-hover); color: var(--rail-ink); }
.theme-toggle input { width: 16px; height: 16px; accent-color: var(--brand-a); }

.rail-foot {
  margin-top: auto; border-top: 1px solid var(--rail-border-soft); padding-top: 15px;
  color: var(--rail-muted); font-size: 12px; display: grid; gap: 7px;
}
.rail-foot b { color: var(--rail-ink); font-weight: 700; }
.rail-foot > span:last-child,
.rail-foot > span:nth-last-child(2) { display: inline-flex; align-items: center; gap: 7px; }
.rail-signout { color: var(--rail-muted); font-size: 12px; text-decoration: none; justify-self: start; font-weight: 600; border-bottom: 1px solid transparent; }
.rail-signout:hover { color: var(--rail-ink); border-bottom-color: currentColor; }

.main { min-width: 0; }
.content { max-width: 1320px; margin: 0 auto; padding: 28px 30px 56px; display: grid; gap: 18px; }
.content > section { min-width: 0; }

/* ============================================================================
   Login
   ============================================================================ */
.login-body {
  display: flex; align-items: center; justify-content: flex-start; min-height: 100vh;
  padding-left: clamp(24px, 9vw, 150px);
  background-color: var(--page);
  background-image: linear-gradient(105deg, rgba(11,18,26,.72) 0%, rgba(11,18,26,.34) 46%, rgba(11,18,26,.06) 72%), url("../img/login-hero.jpg");
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.login-wrap { width: 100%; max-width: 400px; padding: 24px; }
.login-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), var(--edge-hi);
  padding: 30px 28px; display: grid; gap: 15px;
}
.login-logo { width: 208px; max-width: 78%; height: auto; display: block; margin: 2px auto 4px; }
.login-mark { display: flex; align-items: center; gap: 10px; }
.login-mark b { display: block; font-size: 15px; }
.login-mark span { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.login-card h1 { font-size: 22px; font-weight: 850; }
.login-card > h1 + .login-field { margin-top: 2px; }
.login-field { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.login-field input {
  padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 10px; font-size: 14px;
  background: var(--paper-2); color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-field input:focus { outline: none; border-color: var(--focus); background: var(--paper); box-shadow: var(--focus-ring); }
.login-submit { justify-content: center; margin-top: 6px; min-height: 44px; font-size: 14.5px; }
.login-error {
  background: var(--bad-wash); border: 1px solid var(--bad-ring); color: var(--bad-ink);
  border-radius: 10px; padding: 10px 13px; font-size: 13px; font-weight: 650;
}
.login-foot { color: var(--muted); font-size: 11px; text-align: center; margin-top: 4px; display: inline-flex; gap: 6px; justify-content: center; }

/* ============================================================================
   Buttons
   ============================================================================ */
.btn {
  min-height: 38px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--paper); color: var(--ink); padding: 8px 15px; font-weight: 650; font-size: 13.5px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .05s;
  box-shadow: var(--shadow-xs);
}
.btn:hover { border-color: var(--line-strong); background: var(--paper-2); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(.5px); }
.btn:focus-visible { box-shadow: var(--focus-ring); }
.btn.primary {
  color: var(--primary-ink); background: var(--primary); border-color: transparent;
  box-shadow: 0 6px 16px -8px rgba(26,61,99,.7), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn.primary:hover { background: var(--primary-hover); border-color: transparent; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--paper-2); }
.btn.sm { min-height: 32px; padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-icon { width: 19px; height: 19px; border: 1.5px solid currentColor; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 900; line-height: 1; opacity: .95; }
.link { background: none; border: none; color: var(--link); font-weight: 700; cursor: pointer; padding: 0; text-decoration: none; border-bottom: 1px solid transparent; }
.link:hover { border-bottom-color: currentColor; }

/* ============================================================================
   Panels
   ============================================================================ */
.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); overflow: hidden; min-width: 0;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper), var(--paper-2));
}
.panel-head h3 { font-size: 13.5px; font-weight: 800; letter-spacing: -.01em; }
.panel-head .muted { font-weight: 600; }

/* ============================================================================
   Intake / dropzone
   ============================================================================ */
.dropzone {
  position: relative; border: 1.5px dashed var(--drop-border); background: var(--drop-bg);
  border-radius: var(--r-lg); padding: 34px 32px; box-shadow: var(--shadow-sm);
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.dropzone::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 80% at 12% 0%, rgba(95,208,189,.07), transparent 55%);
}
.dropzone.drag { border-color: var(--green); background: var(--drop-drag-bg); box-shadow: var(--shadow-md); }
.dz-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 332px); gap: 32px; align-items: center; }
.dz-copy { min-width: 0; }
.dz-icon {
  width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center;
  color: var(--green); font-size: 0; margin-bottom: 16px;
  background: var(--paper); border: 1px solid var(--drop-icon-border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.6);
}
.dz-icon::after {
  content: ""; width: 30px; height: 30px; background: currentColor;
  -webkit-mask: var(--ic-up-cloud) center / contain no-repeat; mask: var(--ic-up-cloud) center / contain no-repeat;
}
:root { --ic-up-cloud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 14.5V21'/%3E%3Cpath d='M8.5 17.5 12 14l3.5 3.5'/%3E%3Cpath d='M20 16.6A4.5 4.5 0 0 0 17.5 8h-1.3A7 7 0 1 0 4 14.3'/%3E%3C/svg%3E"); }
.dz-inner h2 { max-width: 640px; font-size: 27px; font-weight: 850; line-height: 1.1; letter-spacing: -.02em; }
.dz-inner p { color: var(--muted); margin-top: 11px; max-width: 600px; font-size: 14.5px; line-height: 1.55; }
.dz-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.dz-steps { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 11px; max-width: 540px; }
.dz-steps li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-soft); }
.dz-steps li span {
  flex: none; width: 25px; height: 25px; border-radius: 50%; color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  background: var(--brand-grad); box-shadow: 0 2px 6px -2px rgba(79,143,208,.6);
}
.dz-sample { margin-top: 18px; font-size: 12.5px; }

.dz-setup {
  border-left: 1px solid var(--line); padding-left: 28px; display: grid; gap: 14px; align-content: start;
}
.setup-row {
  display: grid; gap: 3px; padding: 13px 15px; border-radius: var(--r-sm);
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-xs);
}
.setup-row span { color: var(--faint); text-transform: uppercase; letter-spacing: .6px; font-size: 10px; font-weight: 800; }
.setup-row b { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.setup-row em { color: var(--muted); font-style: normal; font-size: 12.5px; line-height: 1.4; }

/* Cross-estimate overlap / duplicate banner */
.rel-banner { display: grid; gap: 10px; }
.rel-row {
  position: relative; border-radius: var(--r); padding: 13px 16px 13px 46px; font-size: 13.5px;
  border: 1px solid var(--bad-ring); background: var(--bad-wash); color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.rel-row::before {
  content: ""; position: absolute; left: 15px; top: 14px; width: 20px; height: 20px;
  background: var(--bad-ink); -webkit-mask: var(--ic-bang) center/contain no-repeat; mask: var(--ic-bang) center/contain no-repeat;
}
.rel-row b { font-weight: 800; }
.rel-row ul { margin: 7px 0 0 2px; padding: 0; list-style: none; display: grid; gap: 3px; }
.rel-row li { font-size: 12.5px; color: var(--muted); padding-left: 14px; position: relative; }
.rel-row li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--bad-ink); opacity: .6; }

/* ============================================================================
   Intake: recent audits
   ============================================================================ */
.recent { display: grid; gap: 14px; }
.recent-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.recent-head h3 { font-size: 16px; font-weight: 820; letter-spacing: -.015em; }
.recent-head .muted { display: block; margin-top: 3px; }
.recent-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(244px, 1fr)); gap: 14px; }
.recent-card {
  font: inherit; text-align: left; cursor: pointer; display: grid; gap: 7px; align-content: start;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); padding: 15px 16px; min-height: 112px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.recent-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.recent-card:focus-visible { box-shadow: var(--focus-ring); }
.rc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rc-when { color: var(--faint); font-size: 11px; font-weight: 700; }
.rc-title { font-weight: 800; font-size: 14.5px; line-height: 1.25; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 16px; }
.rc-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 3px; font-size: 12px; color: var(--muted); padding-top: 9px; border-top: 1px solid var(--line); }
.rc-recon { font-weight: 700; }
.rc-recon.ok { color: var(--ok-ink); } .rc-recon.bad { color: var(--bad-ink); }
.rc-status { font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.rc-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.rc-status.ok { color: var(--ok-ink); }
.rc-status.review { color: var(--review-ink); }
.rc-status.money { color: var(--money-ink); }
.rc-status.bad { color: var(--bad-ink); }

/* ============================================================================
   Review masthead
   ============================================================================ */
.review-masthead {
  background: linear-gradient(180deg, var(--paper), var(--paper-2));
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); padding: 18px 22px; display: flex; align-items: center;
  justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.section-kicker { color: var(--blue); text-transform: uppercase; letter-spacing: .6px; font-size: 11px; font-weight: 900; margin-bottom: 5px; }
.review-masthead h1 { font-size: 27px; line-height: 1.08; font-weight: 850; letter-spacing: -.02em; }
.review-masthead p { color: var(--muted); margin-top: 7px; max-width: 680px; font-size: 13px; }
.masthead-id { min-width: 0; }
.masthead-actions { display: flex; align-items: center; gap: 10px; flex: none; }

.export-menu { position: relative; }
.export-menu .caret { font-size: 10px; opacity: .9; }
.export-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 224px;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg); padding: 7px; display: grid; gap: 2px;
  animation: pop-in .14s ease;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
.export-fmt { text-align: left; background: none; border: 0; border-radius: 8px; padding: 9px 11px; font-weight: 650; color: var(--ink); cursor: pointer; transition: background .12s; }
.export-fmt:hover { background: var(--paper-2); }
.export-redact { display: flex; align-items: center; gap: 9px; margin-top: 5px; padding: 10px 11px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); cursor: pointer; }
.export-redact input { accent-color: var(--primary); }
.export-warranty { margin-top: 5px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; color: var(--primary); font-weight: 700; }
/* Estimate-file group: the Original / Generated estimate downloads. */
.export-files { display: grid; gap: 2px; margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line); }
.export-files[hidden] { display: none; }
.export-sep { font-size: 10.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); padding: 3px 11px 4px; }
.export-file { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.export-tag { font-size: 10px; font-weight: 800; letter-spacing: .3px; border-radius: 999px; padding: 2px 8px; border: 1px solid; white-space: nowrap; }
.export-tag.orig { color: var(--ok-ink); background: var(--ok-wash); border-color: var(--ok-ring); }
.export-tag.gen { color: var(--muted); background: var(--paper-2); border-color: var(--line-2); }
.report-btn { border-color: var(--warn-ring); color: var(--warn-ink); background: var(--warn-tint); }
.report-btn:hover { background: var(--warn-wash); border-color: var(--warn-ring); }
.report-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ============================================================================
   Scorebar / verdict / KPIs
   ============================================================================ */
.scorebar {
  display: flex; align-items: stretch; gap: 18px; flex-wrap: wrap;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); padding: 18px;
}

/* The verdict card — a hero status card carried by a crafted medallion, a soft
   full-surface wash and depth. No edge strip. */
.verdict-card {
  position: relative; flex: 1 1 250px; max-width: 360px; min-height: 116px;
  border-radius: var(--r); border: 1px solid var(--st-ring, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--st-wash, var(--paper-2)) 70%, var(--paper)) , var(--paper));
  padding: 18px 18px 18px 84px;
  display: grid; align-content: center; gap: 6px;
  box-shadow: var(--shadow), var(--edge-hi);
  --st: var(--ok-ink); --st-wash: var(--ok-wash); --st-ring: var(--ok-ring); --st-ic: var(--ic-check);
}
.verdict-card::before {  /* medallion plate */
  content: ""; position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 50px; height: 50px; border-radius: 14px;
  background: var(--st-wash); box-shadow: inset 0 0 0 1px var(--st-ring), var(--shadow-sm);
}
.verdict-card::after {  /* medallion icon */
  content: ""; position: absolute; left: 31px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; background: var(--st);
  -webkit-mask: var(--st-ic) center/contain no-repeat; mask: var(--st-ic) center/contain no-repeat;
}
.verdict-card.review { --st: var(--review-ink); --st-wash: var(--review-wash); --st-ring: var(--review-ring); --st-ic: var(--ic-eye); }
.verdict-card.bad { --st: var(--bad-ink); --st-wash: var(--bad-wash); --st-ring: var(--bad-ring); --st-ic: var(--ic-bang); }
.verdict-card.money { --st: var(--money-ink); --st-wash: var(--money-wash); --st-ring: var(--money-ring); --st-ic: var(--ic-up); }
.verdict-label { color: var(--st); text-transform: uppercase; letter-spacing: .6px; font-size: 10.5px; font-weight: 900; }
.verdict-title { font-size: 19px; line-height: 1.18; font-weight: 800; color: var(--ink); letter-spacing: -.015em; }
.verdict-detail { color: var(--ink-soft); font-size: 12.5px; line-height: 1.4; }

.batch-scorebar { align-items: stretch; }
.batch-scorebar .verdict-card { flex: 1 1 260px; max-width: 380px; }
.batch-head { flex: 0 1 180px; display: grid; align-content: center; gap: 5px; }
.batch-head h2 { font-size: 19px; font-weight: 820; letter-spacing: -.015em; }
.batch-head .muted { line-height: 1.4; }

.kpis { flex: 2 1 360px; display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 12px; min-width: 260px; }
.kpi {
  min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 14px 14px 13px; overflow: hidden; box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.kpi.money { background: linear-gradient(180deg, var(--money-tint), var(--paper)); border-color: var(--money-ring); }
.kpi.opp { background: linear-gradient(180deg, var(--money-tint), var(--paper)); border-color: var(--money-ring); }
.kpi .v { font-size: 23px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi.money .v, .kpi.opp .v { font-size: clamp(18px, 1.5vw, 22px); white-space: nowrap; color: var(--money-ink); }
.kpi .l { color: var(--faint); text-transform: uppercase; font-size: 10px; font-weight: 800; margin-top: 9px; letter-spacing: .5px; }
.kpi .v.ok { color: var(--ok-ink); } .kpi .v.bad { color: var(--bad-ink); } .kpi .v.opp { color: var(--money-ink); }
.kpi-sub { color: var(--muted); font-size: 11px; font-weight: 600; margin-top: 8px; line-height: 1.3; }
.kpi-foot { margin-top: 10px; }
.kpi-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: var(--r-pill); letter-spacing: .2px; }
.kpi-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.kpi-badge.ok { color: var(--ok-ink); background: var(--ok-wash); box-shadow: inset 0 0 0 1px var(--ok-ring); }
.kpi-badge.bad { color: var(--bad-ink); background: var(--bad-wash); box-shadow: inset 0 0 0 1px var(--bad-ring); }

/* The single-estimate scorebar reads as a two-zone bento: verdict | metric tiles. */
#results .scorebar { display: grid; grid-template-columns: minmax(250px, 330px) 1fr; align-items: stretch; }
#results .scorebar .verdict-card { max-width: none; }
#results .scorebar .kpis { min-width: 0; }
@media (max-width: 720px) { #results .scorebar { grid-template-columns: 1fr; } }

.exports { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.exports > span { font-size: 12px; color: var(--muted); margin-right: 2px; }
.redact-opt { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }

/* ============================================================================
   Results layout
   ============================================================================ */
/* The single-estimate review stacks its blocks (masthead, scorebar, layout,
   full-width line items) with the same 18px rhythm used across the app. */
.results { display: grid; gap: 18px; align-content: start; }
.layout { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
.col-main { display: grid; gap: 18px; min-width: 0; }
.col-side { display: grid; gap: 18px; }

/* ============================================================================
   Findings — tools / filters / progress
   ============================================================================ */
.finding-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.view-toggle {
  display: inline-flex; align-items: center; border: 1px solid var(--line-2);
  border-radius: 9px; overflow: hidden; background: var(--paper-2); padding: 2px;
}
.view-btn {
  min-width: 56px; min-height: 28px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); padding: 5px 12px; font-size: 12px; font-weight: 750; cursor: pointer;
  transition: background .12s, color .12s, box-shadow .12s;
}
.view-btn:hover { color: var(--ink); }
.view-btn.active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }

.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-size: 11.5px; font-weight: 750; border-radius: var(--r-pill); padding: 4px 12px;
  border: 1px solid var(--line-2); background: var(--paper); color: var(--muted); cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active { color: var(--inverse); background: var(--primary); border-color: var(--primary); }
.chip[data-k="action"].active { background: var(--red); border-color: var(--red); }
.chip[data-k="confirm"].active { background: var(--amber); border-color: var(--amber); }
.chip[data-k="opps"].active { background: var(--money); border-color: var(--money); }
.chip[data-k="pass"].active { background: var(--primary); border-color: var(--primary); }

.review-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
/* Inset the findings content (Fix list / List / Board) from the panel edges. */
#findings { padding: 14px 16px 16px; }
#review-progress { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
#review-progress b { color: var(--ink); }
.rp-bar { display: inline-block; width: 132px; height: 7px; border-radius: var(--r-pill); background: var(--track-bg); overflow: hidden; }
.rp-bar span { display: block; height: 100%; background: var(--brand-grad); border-radius: inherit; }
.hide-addr { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.hide-addr input { accent-color: var(--primary); }

.show-passed {
  width: 100%; text-align: center; background: var(--paper-2); border: 0;
  border-top: 1px solid var(--line); padding: 13px; font-size: 12.5px; font-weight: 700;
  color: var(--link); cursor: pointer; transition: background .12s, color .12s;
}
.show-passed:hover { background: var(--paper-3); }

/* ---- Findings: category groups + rows ---- */
.cat-group { border-bottom: 1px solid var(--line); }
.cat-group:last-child { border-bottom: 0; }
.cat-title {
  padding: 10px 18px; background: var(--paper-2); font-weight: 800; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .6px; color: var(--faint); display: flex; justify-content: space-between;
}
.finding-empty { padding: 28px 18px; color: var(--muted); font-weight: 600; text-align: center; }

/* List row: a crafted status MEDALLION anchors each row (icon + soft plate +
   ring). No edge strip. Each row carries its status via --st* tokens. */
.finding {
  display: grid; grid-template-columns: 60px 1fr; gap: 15px; padding: 16px 18px;
  border-top: 1px solid var(--table-line); transition: background .12s;
  --st: var(--info-ink); --st-wash: var(--info-wash); --st-ring: var(--info-ring); --st-ic: var(--ic-info);
}
.finding:first-of-type { border-top: none; }
.finding:not(.finding-board-card):hover { background: var(--paper-2); }
.finding:has(.badge.fail) { --st: var(--bad-ink); --st-wash: var(--bad-wash); --st-ring: var(--bad-ring); --st-ic: var(--ic-x); }
.finding:has(.badge.warn) { --st: var(--warn-ink); --st-wash: var(--warn-wash); --st-ring: var(--warn-ring); --st-ic: var(--ic-bang); }
.finding:has(.badge.review) { --st: var(--review-ink); --st-wash: var(--review-wash); --st-ring: var(--review-ring); --st-ic: var(--ic-eye); }
.finding:has(.badge.pass) { --st: var(--ok-ink); --st-wash: var(--ok-wash); --st-ring: var(--ok-ring); --st-ic: var(--ic-check); }
.finding:has(.badge.info) { --st: var(--info-ink); --st-wash: var(--info-wash); --st-ring: var(--info-ring); --st-ic: var(--ic-info); }

/* col 1: medallion + status word + severity */
.finding:not(.finding-board-card) > div:first-child {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding-top: 44px; text-align: center;
}
.finding:not(.finding-board-card) > div:first-child::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--st-wash); box-shadow: inset 0 0 0 1px var(--st-ring);
}
.finding:not(.finding-board-card) > div:first-child::after {
  content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 24px; background: var(--st);
  -webkit-mask: var(--st-ic) center/contain no-repeat; mask: var(--st-ic) center/contain no-repeat;
}
/* in the list, the textual badge becomes the small coloured status word */
.finding:not(.finding-board-card) .badge {
  background: none; border: 0; padding: 0; color: var(--st);
  font-size: 10px; font-weight: 800; letter-spacing: .4px; text-align: center;
}
.finding:not(.finding-board-card) .sev { margin-top: 0; }

.badge {
  align-self: start; font-size: 10px; font-weight: 800; border-radius: var(--r-pill);
  padding: 3px 9px 3px 8px; text-align: center; letter-spacing: .4px; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 5px;
}
.badge::before { content: ""; width: 11px; height: 11px; flex: none; background: currentColor; -webkit-mask: var(--ic-info) center/contain no-repeat; mask: var(--ic-info) center/contain no-repeat; }
.badge.pass { color: var(--ok-ink); background: var(--ok-wash); border-color: var(--ok-ring); }
.badge.pass::before { -webkit-mask-image: var(--ic-check); mask-image: var(--ic-check); }
.badge.warn { color: var(--warn-ink); background: var(--warn-wash); border-color: var(--warn-ring); }
.badge.warn::before { -webkit-mask-image: var(--ic-bang); mask-image: var(--ic-bang); }
.badge.fail { color: var(--bad-ink); background: var(--bad-wash); border-color: var(--bad-ring); }
.badge.fail::before { -webkit-mask-image: var(--ic-x); mask-image: var(--ic-x); }
.badge.review { color: var(--review-ink); background: var(--review-wash); border-color: var(--review-ring); }
.badge.review::before { -webkit-mask-image: var(--ic-eye); mask-image: var(--ic-eye); }
.badge.info { color: var(--info-ink); background: var(--info-wash); border-color: var(--info-ring); }
/* the list-row badge word has no icon (the medallion already shows it) */
.finding:not(.finding-board-card) .badge::before { display: none; }

.sev { font-size: 9px; color: var(--faint); text-transform: uppercase; text-align: center; letter-spacing: .4px; font-weight: 700; }
.finding .title { font-weight: 750; font-size: 14px; letter-spacing: -.01em; }
.finding .detail { color: var(--ink-soft); margin-top: 4px; line-height: 1.5; }
.finding .evidence {
  color: var(--muted); font-size: 12px; margin-top: 8px; font-family: var(--mono);
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  white-space: pre-line; overflow-wrap: anywhere;
}
.finding .rec { color: var(--navy); font-size: 12.5px; margin-top: 7px; font-weight: 650; }
.finding .cite { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.cite-tag { font-size: 10px; font-weight: 800; color: var(--navy); background: var(--tag-bg); border: 1px solid var(--tag-border); border-radius: 6px; padding: 2px 8px; }
.disp-tag { margin-top: 7px; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; text-align: center; border-radius: 6px; padding: 3px 6px; color: var(--inverse); }
.disp-tag.done { background: var(--green); } .disp-tag.dismissed { background: var(--faint); }
.finding.addressed { opacity: .58; }
.finding.addressed .title { text-decoration: line-through; text-decoration-color: var(--addressed-line); }

.finding-review { display: flex; align-items: center; gap: 9px; margin-top: 11px; flex-wrap: wrap; }
.disp { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; background: var(--paper-2); padding: 2px; gap: 2px; }
.disp .d { background: transparent; border: none; border-radius: 7px; padding: 5px 12px; font-size: 12px; font-weight: 650; color: var(--muted); cursor: pointer; transition: background .12s, color .12s; }
.disp .d:hover { background: var(--paper); color: var(--ink); }
.disp .d.on { color: var(--inverse); background: var(--primary); }
.disp .d.on.done { background: var(--green); }
.disp .d.on.dismiss { background: var(--faint); }
.finding-review .note { flex: 1; min-width: 170px; font-size: 12.5px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--paper); transition: border-color .15s, box-shadow .15s; }
.finding-review .note:focus { outline: none; border-color: var(--focus); box-shadow: var(--focus-ring); }
.hist { margin-top: 7px; font-size: 11px; color: var(--faint); cursor: help; }

/* ---- Findings: board ---- */
.findings-board {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(224px, 1fr));
  gap: 14px; padding: 16px; background: var(--board-bg);
}
.finding-lane {
  min-width: 0; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--lane-bg); overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow-xs);
}
.finding-lane-head {
  min-height: 54px; padding: 12px 14px; background: var(--paper);
  border-bottom: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
}
.finding-lane-head h4 { margin: 0; font-size: 13px; font-weight: 800; }
.finding-lane-head span { color: var(--muted); font-size: 11px; font-weight: 700; }
.lane-count {
  min-width: 28px; height: 28px; padding: 0 8px; border-radius: var(--r-pill); display: grid; place-items: center;
  color: var(--inverse) !important; font-size: 12px !important; font-weight: 800 !important; flex: none;
}
.lane-count.fail { background: var(--red); }
.lane-count.warn { background: var(--amber); }
.lane-count.review { background: var(--purple); }
.lane-count.info { background: var(--blue); }
.lane-count.pass { background: var(--green); }
.finding-lane-cards { display: grid; gap: 12px; padding: 12px; align-content: start; }

/* Board card: soft full-surface status wash + icon-chip badge + depth. No strip. */
.finding-board-card {
  display: grid; grid-template-columns: 1fr; gap: 8px; border: 1px solid var(--st-ring, var(--line));
  border-radius: var(--r-sm); padding: 13px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--st-wash, var(--paper)) 55%, var(--paper)), var(--paper));
  box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s;
  --st: var(--info-ink); --st-wash: var(--info-wash); --st-ring: var(--info-ring);
}
.finding-board-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.finding-board-card.fail { --st: var(--bad-ink); --st-wash: var(--bad-wash); --st-ring: var(--bad-ring); }
.finding-board-card.warn { --st: var(--warn-ink); --st-wash: var(--warn-wash); --st-ring: var(--warn-ring); }
.finding-board-card.review { --st: var(--review-ink); --st-wash: var(--review-wash); --st-ring: var(--review-ring); }
.finding-board-card.info { --st: var(--info-ink); --st-wash: var(--info-wash); --st-ring: var(--info-ring); }
.finding-board-card.pass { --st: var(--ok-ink); --st-wash: var(--ok-wash); --st-ring: var(--ok-ring); }
.finding-board-card .badge { justify-self: start; min-width: 0; padding: 3px 10px 3px 8px; }
.board-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.board-card-sev { color: var(--faint); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.board-card-meta { color: var(--muted); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.finding-board-card .title { font-size: 13px; line-height: 1.35; }
.finding-board-card .detail { font-size: 12.5px; }
.finding-board-card .evidence { font-size: 11px; overflow-wrap: anywhere; }
.finding-board-card .disp { width: 100%; }
.finding-board-card .disp .d { flex: 1; padding-left: 6px; padding-right: 6px; }
.finding-board-card .finding-review .note { min-width: 0; flex-basis: 100%; }

/* ============================================================================
   Fix list (the action-first "what do I do?" view)
   ============================================================================ */
.fix-ready {
  display: flex; gap: 14px; align-items: center; padding: 18px 20px; margin-bottom: 8px;
  background: linear-gradient(180deg, var(--ok-tint), var(--paper)); border: 1px solid var(--ok-ring);
  border-radius: var(--r); box-shadow: var(--shadow-sm), var(--edge-hi);
}
.fix-ready .ic {
  width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: var(--ok-wash); color: transparent; box-shadow: inset 0 0 0 1px var(--ok-ring); position: relative;
}
.fix-ready .ic::after { content: ""; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; background: var(--ok-ink); -webkit-mask: var(--ic-check) center/contain no-repeat; mask: var(--ic-check) center/contain no-repeat; }
.fix-ready b { font-size: 15.5px; color: var(--ink); display: block; letter-spacing: -.01em; }
.fix-ready span { color: var(--ink-soft); font-size: 13px; }

.fix-progress { margin-bottom: 6px; padding: 4px 2px 0; }
.fix-progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.fix-progress-top b { font-size: 15.5px; letter-spacing: -.01em; }
.fix-progress-top span { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.fix-bar { display: block; height: 9px; border-radius: var(--r-pill); background: var(--track-bg); overflow: hidden; margin: 10px 0 6px; }
.fix-bar > span { display: block; height: 100%; background: var(--brand-grad); border-radius: var(--r-pill); transition: width .3s ease; }
.fix-hint { color: var(--muted); font-size: 12px; }

.fix-section { margin-top: 24px; }
.fix-section-head { display: flex; align-items: center; gap: 10px; }
.fix-section-head .dot {
  width: 26px; height: 26px; flex: none; border-radius: 8px; position: relative;
  background: var(--st-wash); box-shadow: inset 0 0 0 1px var(--st-ring);
  --st-wash: var(--bad-wash); --st-ring: var(--bad-ring); --st: var(--bad-ink); --st-ic: var(--ic-bang);
}
.fix-section-head .dot::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; background: var(--st); -webkit-mask: var(--st-ic) center/contain no-repeat; mask: var(--st-ic) center/contain no-repeat; }
.fix-section.bad .dot { --st-wash: var(--bad-wash); --st-ring: var(--bad-ring); --st: var(--bad-ink); --st-ic: var(--ic-bang); }
.fix-section.review .dot { --st-wash: var(--review-wash); --st-ring: var(--review-ring); --st: var(--review-ink); --st-ic: var(--ic-eye); }
.fix-section.money .dot { --st-wash: var(--money-wash); --st-ring: var(--money-ring); --st: var(--money-ink); --st-ic: var(--ic-up); }
.fix-section-head h4 { margin: 0; font-size: 15px; font-weight: 820; letter-spacing: -.01em; }
.fix-count { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.fix-section-sub { color: var(--muted); font-size: 12.5px; margin: 6px 0 13px 36px; }

.fix-item {
  display: grid; grid-template-columns: auto 1fr; gap: 15px; padding: 15px 17px; margin-bottom: 11px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow-xs); transition: box-shadow .15s, border-color .15s, transform .12s;
  --st-wash: var(--bad-wash); --st-ring: var(--bad-ring); --st: var(--bad-ink);
}
.fix-item:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.fix-section.bad .fix-item { --st-wash: var(--bad-wash); --st-ring: var(--bad-ring); --st: var(--bad-ink); }
.fix-section.review .fix-item { --st-wash: var(--review-wash); --st-ring: var(--review-ring); --st: var(--review-ink); }
.fix-section.money .fix-item { --st-wash: var(--money-wash); --st-ring: var(--money-ring); --st: var(--money-ink); }
.fix-section .fix-item { background: linear-gradient(180deg, color-mix(in srgb, var(--st-wash) 26%, var(--paper)), var(--paper)); }

.fix-check-wrap { display: grid; place-items: center; gap: 4px; cursor: pointer; user-select: none; height: max-content; }
.fix-check { width: 20px; height: 20px; cursor: pointer; accent-color: var(--green); margin: 0; }
.fix-n { font-size: 10px; font-weight: 800; color: var(--faint); }
.fix-headline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px; }
.fix-title { font-weight: 750; font-size: 14.5px; letter-spacing: -.01em; }
.fix-target {
  font-size: 11.5px; font-weight: 800; color: var(--money-ink); background: var(--money-wash);
  border: 1px solid var(--money-ring); border-radius: 7px; padding: 2px 9px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
}
.fix-target::before { content: ""; width: 12px; height: 12px; background: currentColor; -webkit-mask: var(--ic-up) center/contain no-repeat; mask: var(--ic-up) center/contain no-repeat; }
.fix-target .was { color: var(--muted); font-weight: 600; }
.fix-because { color: var(--ink-soft); font-size: 13px; margin-top: 5px; line-height: 1.5; }
.fix-do { color: var(--navy); font-size: 12.5px; font-weight: 650; margin-top: 6px; }
.fix-refs { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fix-ref { font-size: 11px; font-weight: 800; color: var(--ink-soft); background: var(--tag-bg); border: 1px solid var(--tag-border); border-radius: 6px; padding: 2px 8px; }
.fix-ref-btn { font-family: inherit; line-height: 1.5; cursor: pointer; transition: background .12s, border-color .12s, color .12s, box-shadow .12s; }
.fix-ref-btn:hover { border-color: var(--primary); color: var(--ink); }
.fix-ref-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Inline line-item detail revealed by clicking a #N chip in a finding. */
.fix-line-detail { display: grid; gap: 8px; }
.fix-line-detail:not(:empty) { margin-top: 9px; }
.li-detail { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); box-shadow: var(--shadow-xs); overflow: hidden; animation: pop-in .14s ease; }
.li-detail-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 9px; padding: 8px 11px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.li-detail-no { font-weight: 800; font-size: 12px; color: var(--ink); }
.li-detail-no::before { content: "#"; opacity: .55; }
.li-detail-code { font-size: 11px; font-weight: 700; color: var(--muted); }
.li-detail-desc { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.li-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px 14px; padding: 10px 11px; }
.li-detail-grid div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.li-detail-grid .k { font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 800; color: var(--faint); }
.li-detail-grid .v { font-size: 12.5px; font-weight: 650; color: var(--ink); }
.li-detail-missing { padding: 9px 11px; font-size: 12px; color: var(--muted); }
.fix-note { margin-top: 7px; font-size: 12px; color: var(--muted); font-style: italic; }
.fix-actions { margin-top: 11px; }
.fix-actions .d { background: var(--paper); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 650; color: var(--muted); cursor: pointer; transition: border-color .12s, color .12s, background .12s; }
.fix-actions .d:hover { border-color: var(--line-strong); color: var(--ink); background: var(--paper-2); }
.fix-item.done, .fix-item.dismissed { opacity: .6; background: var(--paper-2); }
.fix-item.done .fix-title, .fix-item.dismissed .fix-title { text-decoration: line-through; text-decoration-color: var(--addressed-line); }

/* ============================================================================
   Notifications (admin)
   ============================================================================ */
.notify-body { padding: 18px; max-width: 600px; }
.notify-toggle { display: flex; align-items: center; gap: 11px; font-weight: 700; cursor: pointer; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper-2); }
.notify-toggle input { width: 19px; height: 19px; accent-color: var(--green); }
#notify-status { margin: 10px 2px 18px; }
.notify-setup { border-top: 1px solid var(--line); padding-top: 16px; }
.notify-setup h4 { margin: 0 0 9px; font-size: 13.5px; }
.notify-setup ol { margin: 0 0 10px 18px; padding: 0; font-size: 13px; }
.notify-setup li { margin: 5px 0; }
.notify-topic { display: flex; align-items: center; gap: 9px; margin: 12px 0; }
.notify-topic code { background: var(--paper-3); border: 1px solid var(--line); padding: 8px 11px; border-radius: 8px; font-size: 13.5px; word-break: break-all; font-family: var(--mono); }

/* ============================================================================
   Tables
   ============================================================================ */
.table-wrap {
  overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  background:
    linear-gradient(to right, var(--scroll-cover), rgba(255,255,255,0)) 0 0,
    linear-gradient(to left,  var(--scroll-cover), rgba(255,255,255,0)) 100% 0,
    radial-gradient(farthest-side at 0 50%, var(--scroll-shadow), rgba(0,0,0,0)) 0 0,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-shadow), rgba(0,0,0,0)) 100% 0;
  background-repeat: no-repeat; background-color: var(--scroll-cover);
  background-size: 44px 100%, 44px 100%, 15px 100%, 15px 100%;
  background-attachment: local, local, scroll, scroll;
}
.table-wrap::-webkit-scrollbar { width: 11px; height: 11px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-pill); border: 3px solid var(--paper); }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
#line-items th, #line-items td, #totals th, #totals td,
#batch-table th, #batch-table td, #history-table th, #history-table td,
#activity-table th, #activity-table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--table-line); white-space: nowrap;
}
thead th {
  background: var(--paper-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--faint); font-weight: 800; position: sticky; top: 0; z-index: 1;
  box-shadow: inset 0 -1px 0 var(--line);
}
tbody tr { transition: background .1s; }
#line-items tbody tr:hover, #activity-table tbody tr:hover { background: var(--paper-2); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
#line-items tr.judgment td { background: var(--judgment-bg); }
#line-items { font-variant-numeric: tabular-nums; }
#line-items th.li-act, #line-items td.li-act { width: 1%; padding-left: 4px; padding-right: 10px; text-align: right; }
.li-copy {
  display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper);
  color: var(--muted); cursor: pointer; opacity: 0;
  transition: opacity .12s ease, color .12s ease, border-color .12s ease, background .12s ease;
}
#line-items tbody tr:hover .li-copy { opacity: 1; }
.li-copy:hover { color: var(--ink); border-color: var(--line-strong); background: var(--paper-2); }
.li-copy:focus-visible { opacity: 1; outline: none; box-shadow: var(--focus-ring); }
@media (hover: none) { .li-copy { opacity: 1; } }   /* touch: no hover state, so always show */
.tag { font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: var(--tag-bg); color: var(--navy); border: 1px solid var(--tag-border); text-transform: uppercase; letter-spacing: .3px; }
#totals td { white-space: normal; }
#totals tr.ok td.s { color: var(--ok-ink); } #totals tr.bad td.s { color: var(--bad-ink); font-weight: 800; } #totals td.s { width: 20px; }

#batch-table tr.drill, #history-table tr.drill { cursor: pointer; }
#batch-table tr.drill:hover, #history-table tr.drill:hover { background: var(--paper-2); }
#batch-table tr.bad-row { background: var(--bad-tint); }
#batch-table td.batch-result-cell, #batch-table td.batch-vehicle,
#history-table td.history-result-cell, #history-table td.history-item { white-space: normal; }
.row-result { min-width: 172px; display: grid; gap: 3px; line-height: 1.3; padding-left: 18px; position: relative; }
.row-result::before { content: ""; position: absolute; left: 0; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent); }
.row-result b { font-size: 12.5px; }
.row-result span { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.row-result.ok { color: var(--ok-ink); } .row-result.ok b { color: var(--ok-ink); }
.row-result.review { color: var(--review-ink); } .row-result.review b { color: var(--review-ink); }
.row-result.money { color: var(--money-ink); } .row-result.money b { color: var(--money-ink); }
.row-result.bad { color: var(--bad-ink); } .row-result.bad b { color: var(--bad-ink); }
.row-result span { color: var(--muted); }
.history-item { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; min-width: 240px; }
.history-item b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item > span:not(.tag) { grid-column: 2; color: var(--muted); font-size: 11.5px; }
.empty-state { text-align: center !important; white-space: normal !important; padding: 30px 16px !important; }
.empty-state b { display: block; font-size: 14.5px; margin-bottom: 4px; }
.empty-state span { color: var(--muted); font-size: 12.5px; }
.pill { display: inline-block; min-width: 30px; text-align: center; border-radius: var(--r-pill); padding: 2px 9px; font-weight: 800; color: var(--inverse); font-size: 12px; }
.pill.g { background: var(--green); } .pill.y { background: var(--amber); } .pill.r { background: var(--red); }
.opp-n { display: inline-block; min-width: 18px; text-align: center; background: var(--money); color: var(--inverse); border-radius: var(--r-pill); padding: 0 8px; font-weight: 800; font-size: 12px; }
.x { color: var(--bad-ink); font-weight: 800; }

/* ---- Batch progress ---- */
.batch-progress { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; box-shadow: var(--shadow-sm); }
.batch-progress-copy { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.batch-progress-copy b { font-weight: 750; }
.batch-progress-track { height: 9px; border-radius: var(--r-pill); background: var(--track-bg); overflow: hidden; }
.batch-progress-bar, #batch-progress-bar { display: block; height: 100%; width: 0; background: var(--brand-grad); transition: width .3s; }

/* ============================================================================
   Claim details — full-width horizontal bar (replaces the old identity card)
   ============================================================================ */
.metabar {
  display: flex; flex-wrap: wrap; align-items: stretch;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.mb-cell {
  display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto;
  padding: 11px 18px; border-right: 1px solid var(--line);
}
.metabar > .mb-cell:last-of-type { border-right: 0; }
.mb-cell .k { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; font-weight: 800; color: var(--faint); white-space: nowrap; }
.mb-cell .v { font-size: 14px; font-weight: 650; color: var(--ink); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-cell.mono .v { font-family: var(--mono); font-weight: 600; letter-spacing: 0; }
/* Deductible: the one cell the owner wants impossible to miss. */
.mb-cell.mb-key { background: linear-gradient(180deg, var(--money-tint), var(--paper)); }
.mb-cell.mb-key .k { color: var(--money-ink); }
.mb-cell.mb-key .v { color: var(--money-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
/* The long tail of fields folds away on its own full-width row. */
.mb-more { flex: 1 1 100%; border-top: 1px solid var(--line); }
.mb-more > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; color: var(--link); font-weight: 700; font-size: 12.5px; }
.mb-more > summary::-webkit-details-marker { display: none; }
.mb-more > summary::after { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--ic-chevron) center/contain no-repeat; mask: var(--ic-chevron) center/contain no-repeat; transition: transform .2s; }
.mb-more[open] > summary { color: var(--muted); }
.mb-more[open] > summary::after { transform: rotate(180deg); }
.mb-extra { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); border-top: 1px solid var(--line); background: var(--paper-2); }
.mb-extra .mb-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
:root { --ic-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }

/* ============================================================================
   Totals reconciliation
   ============================================================================ */
.totals-table { width: 100%; }
.totals-line { padding: 13px 16px; font-size: 13.5px; font-weight: 750; display: flex; align-items: center; gap: 10px; }
.totals-line .ic { width: 22px; height: 22px; flex: none; border-radius: 7px; position: relative; }
.totals-line .ic::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; background: currentColor; }
.totals-line.ok { color: var(--ok-ink); }
.totals-line.ok .ic { background: var(--ok-wash); box-shadow: inset 0 0 0 1px var(--ok-ring); }
.totals-line.ok .ic::after { -webkit-mask: var(--ic-check) center/contain no-repeat; mask: var(--ic-check) center/contain no-repeat; }
.totals-line.bad { color: var(--bad-ink); }
.totals-line.bad .ic { background: var(--bad-wash); box-shadow: inset 0 0 0 1px var(--bad-ring); }
.totals-line.bad .ic::after { -webkit-mask: var(--ic-x) center/contain no-repeat; mask: var(--ic-x) center/contain no-repeat; }
.totals-table tr { border-bottom: 1px solid var(--table-line); }
.totals-table td { padding: 9px 16px; }
.totals-more summary { cursor: pointer; color: var(--link); font-weight: 700; font-size: 12.5px; padding: 11px 16px; list-style: none; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 6px; }
.totals-more summary::-webkit-details-marker { display: none; }
.totals-more summary::after { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--ic-chevron) center/contain no-repeat; mask: var(--ic-chevron) center/contain no-repeat; transition: transform .2s; }
.totals-more[open] summary::after { transform: rotate(180deg); }

/* Demoted to a quiet, collapsible footer strip below the line items. */
.recon { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-xs); overflow: hidden; }
.recon .totals-line { font-size: 12.5px; font-weight: 700; }

/* ============================================================================
   Toast + overlay + spinner
   ============================================================================ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--toast-bg); color: var(--inverse); padding: 12px 20px; border-radius: 11px;
  box-shadow: var(--shadow-lg); z-index: 50; font-weight: 600;
  border: 1px solid rgba(255,255,255,.08); animation: toast-in .22s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.toast.bad { background: var(--red); }
.overlay {
  position: fixed; inset: 0; background: var(--overlay-bg); backdrop-filter: blur(2px);
  display: grid; place-items: center; gap: 16px; grid-auto-flow: row; z-index: 40;
  color: var(--inverse); font-weight: 650;
}
.spinner { width: 42px; height: 42px; border: 4px solid rgba(255,255,255,.25); border-top-color: var(--brand-a); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================================
   Support report consent modal
   ============================================================================ */
.report-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: var(--overlay-bg); backdrop-filter: blur(3px); }
.report-card {
  width: min(100%, 470px); background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 22px; display: grid; gap: 14px;
  animation: pop-in .16s ease;
}
.report-warning { justify-self: start; border-radius: 7px; padding: 4px 9px; background: var(--bad-wash); color: var(--bad-ink); border: 1px solid var(--bad-ring); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; }
.report-card h3 { font-size: 21px; line-height: 1.18; font-weight: 850; letter-spacing: -.015em; }
.report-card p { color: var(--ink-soft); line-height: 1.55; }
.report-consent { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--bad-ring); border-radius: var(--r-sm); background: var(--bad-wash); color: var(--ink); font-weight: 650; }
.report-consent input { margin-top: 2px; accent-color: var(--red); width: 17px; height: 17px; }
.report-field { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.report-field textarea, .report-field input { width: 100%; border: 1px solid var(--line-2); border-radius: 9px; background: var(--paper-2); color: var(--ink); padding: 9px 11px; resize: vertical; transition: border-color .15s, box-shadow .15s; }
.report-field textarea:focus, .report-field input:focus { outline: none; border-color: var(--focus); box-shadow: var(--focus-ring); background: var(--paper); }
.report-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }

/* ============================================================================
   Responsive
   ============================================================================ */
@media (max-width: 1040px) { .layout { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; }
  .rail .wordmark { margin-right: auto; }
  .rail-upload { width: auto; flex: 0 0 auto; }
  .rail-nav { grid-auto-flow: column; }
  .rail-field, .theme-toggle { flex: 1 1 180px; }
  .rail-foot { display: none; }
  .content { padding: 18px 16px 40px; }
  .dz-inner { grid-template-columns: 1fr; }
  .dz-setup { border-left: 0; border-top: 1px solid var(--line); padding: 20px 0 0; }
  .review-masthead h1 { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ============================================================================
   Reviewer feedback — standout "flag this finding" + "something missing" actions
   ============================================================================ */
/* Per-finding flag: amber, distinct from the subtle Dismiss/Done controls. It sends
   feedback to the team (not a local dismiss), so it deliberately stands apart. */
.finding-flag { margin-top: 11px; }
.flag-btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit;
  font-size: 12px; font-weight: 800; cursor: pointer; padding: 6px 12px;
  border-radius: var(--r-pill); color: var(--warn-ink); background: var(--warn-wash);
  border: 1px solid var(--warn-ring);
  transition: border-color .14s, transform .12s, box-shadow .14s;
}
.flag-btn:hover { border-color: var(--warn-ink); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.flag-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.flag-btn .flag-ic { font-size: 13px; line-height: 1; }
.fix-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* General "something wrong or missing?" CTA above the findings -- a prominent dashed
   pill so it reads as an invitation to give input. */
.review-bar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.feedback-cta {
  display: inline-flex; align-items: center; gap: 7px; font: inherit;
  font-size: 12.5px; font-weight: 800; cursor: pointer; color: var(--primary);
  background: var(--paper); border: 1.5px dashed var(--primary);
  border-radius: var(--r-pill); padding: 7px 15px;
  transition: background .14s, box-shadow .14s, transform .12s;
}
.feedback-cta:hover { background: var(--info-wash); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.feedback-cta:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.feedback-cta .fb-ic { font-size: 13px; }

/* Feedback modal (reuses .report-modal / .report-card / .report-field / .report-actions). */
.feedback-card { border-top: 4px solid var(--warn-ink); }
.feedback-eyebrow { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; color: var(--warn-ink); margin-bottom: 4px; }
.feedback-context { margin: 2px 0 12px; padding: 9px 12px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--muted); font-size: 12.5px; font-weight: 650; }
.feedback-q { font-size: 12.5px; font-weight: 750; color: var(--ink-soft); margin: 2px 0 8px; }
.feedback-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.fb-kind { font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; padding: 8px 13px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--paper-2); color: var(--ink-soft); transition: background .12s, color .12s, border-color .12s; }
.fb-kind:hover { border-color: var(--primary); }
.fb-kind.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.fb-kind:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Feedback admin table */
.fb-reason { white-space: normal !important; max-width: 560px; line-height: 1.4; }
.fb-ctx { color: var(--faint); font-size: 11px; margin-top: 3px; }
.fb-est { font-weight: 600; color: var(--accent); text-decoration: none; }
.fb-est:hover { text-decoration: underline; }
.fb-est-none { font-weight: 600; color: var(--ink); }
.fb-claim { color: var(--faint); font-size: 11px; font-weight: 400; margin-top: 2px; }
