@font-face { font-family: "Public Sans"; src: url("../vendor/fonts/public-sans-latin-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../vendor/fonts/newsreader-latin-var.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
/* "Preparer's workpaper" tokens, see DESIGN.md. Old names map onto the new system. */
:root {
  --paper: #ffffff; --desk: #f3f5f8; --ink: #151a24; --pen: #1d4a9a; --pen-dk: #163a7c; --hl: #ffe066; --hl-dk: #e0b400;
  --n50: #f6f7f9; --n100: #eef0f4; --n200: #e1e5ec; --n300: #c9d0db; --n400: #9aa4b4; --n500: #6b7587; --n600: #4b5466; --n700: #343c4c; --n800: #222836;
  --ok: #1c7a4a; --warn: #9a5800; --err: #c2332f;
  --bg: var(--desk); --card: var(--paper); --ink2: var(--n600); --mute: #5e6878; --line: var(--n200); --line2: var(--n100);
  --blue: var(--pen); --blue2: #e9eef8; --green: var(--ok); --green2: #e6f3ec; --red: var(--err); --red2: #fbeaea;
  --amber: var(--warn); --amber2: #fdf2dc; --teal: var(--n700); --teal2: var(--n100); --violet: var(--n700); --violet2: var(--n100); --grey2: var(--n100);
  --r: 6px; --r-sm: 4px; --r-lg: 8px; --sh: none; --sh-over: 0 1px 2px rgba(21, 26, 36, .08), 0 12px 32px rgba(21, 26, 36, .16);
  --ease: cubic-bezier(.2, .7, .2, 1); --t: 160ms;
  --display: "Newsreader", Georgia, "Times New Roman", serif;
  font-family: "Public Sans", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; }
.muted { color: var(--mute); } .sm { font-size: 12px; } .red { color: var(--red); } .green { color: var(--green); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; } .r { text-align: right; } .mt { margin-top: 16px; } .w30 { width: 30%; }

.app { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.side { background: #101828; color: #d6dbe4; padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; }
.brand b { display: block; font-size: 16px; color: #fff; }
.brand small { color: #98a2b3; font-size: 11.5px; }
.logo { width: 34px; height: 34px; border-radius: 8px; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.sidehead { font-size: 11px; color: #7c8798; margin-top: 4px; }
.clist { display: flex; flex-direction: column; gap: 4px; }
.citem { text-align: left; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 9px 10px; color: inherit; cursor: pointer; position: relative; }
.citem:hover { background: #1b2537; }
.citem.on { background: #1e2a40; border-color: #2e3d5a; }
.citem .cn { font-weight: 600; color: #fff; font-size: 13.5px; padding-right: 4px; }
.citem .cm { font-size: 11.5px; color: #98a2b3; margin: 2px 0 5px; }
.privacy { font-size: 12px; background: #17233a; border: 1px solid #263552; border-radius: 8px; padding: 10px; color: #b7c0cf; }
.privacy b { color: #fff; }
.side .timesaved { background: #13203a; border-color: #263552; color: #d6dbe4; }
.side .timesaved .tbig { color: #fff; } .side .timesaved .tsub, .side .timesaved .tlab { color: #98a2b3; }
.side .btn.ghost { color: #c9d1de; border-color: #33415c; }
.mobile-top { display: none; }
.mainwrap { min-width: 0; display: flex; flex-direction: column; }
.main { padding: 22px 26px 30px; flex: 1; min-width: 0; }
.foot { font-size: 11.5px; color: var(--mute); padding: 10px 26px 18px; }

/* chips / tags / badges */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.chip.sm { font-size: 10.5px; padding: 1px 7px; }
.c-grey { background: var(--grey2); color: #4f5a6b; } .c-blue { background: var(--blue2); color: var(--blue); }
.c-teal { background: var(--teal2); color: var(--teal); } .c-amber { background: var(--amber2); color: var(--amber); }
.c-green { background: var(--green2); color: var(--green); } .c-red { background: var(--red2); color: var(--red); }
.c-violet { background: var(--violet2); color: var(--violet); }
.chip[data-st="parsing"]::before { content: ""; width: 8px; height: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: var(--blue2); color: var(--blue); white-space: nowrap; }
.tag.xs { font-size: 10px; padding: 0 5px; } .tag.dark { background: #2c3445; color: #fff; } .tag.violet { background: var(--violet2); color: var(--violet); }
.tag.teal { background: var(--teal2); color: var(--teal); } .tag.red { background: var(--red2); color: var(--red); } .tag.amber { background: var(--amber2); color: var(--amber); } .tag.blue { background: var(--blue2); }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 5px; white-space: nowrap; margin-right: 3px; }
.badge.ok { background: var(--green2); color: var(--green); } .badge.bad { background: var(--red); color: #fff; } .badge.warn { background: var(--amber2); color: var(--amber); }
.cf { font-style: normal; display: inline-block; min-width: 20px; text-align: center; font-size: 9.5px; font-weight: 700; line-height: 14px; border-radius: 7px; padding: 0 4px; margin-left: 5px; vertical-align: 1px; }
.c-hi { background: var(--green2); color: var(--green); } .c-md { background: var(--amber2); color: var(--amber); } .c-lo { background: var(--red); color: #fff; }
.c-ed { background: var(--blue); color: #fff; } .c-ok { background: var(--green); color: #fff; }

/* buttons */
.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 13px; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #c4ccd8; background: #fafbfc; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; } .btn.primary:hover { background: #1c4189; }
.btn.warn { background: var(--violet); border-color: var(--violet); color: #fff; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 12px; } .btn.xs { padding: 3px 8px; font-size: 11.5px; border-radius: 6px; } .btn.full { width: 100%; }
input.mini { width: 80px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; font-size: 12px; }

/* page header */
.phead { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; flex-wrap: wrap; }
.crumb { font-size: 12px; color: var(--mute); }
.phead h1 { font-size: 24px; letter-spacing: -.01em; margin: 2px 0 4px; }
.meta { color: var(--ink2); font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pstats { display: flex; gap: 10px; }
.pst { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 7px 14px; text-align: center; min-width: 92px; }
.pst b { display: block; font-size: 17px; } .pst span { font-size: 11px; color: var(--mute); }
.pst.ok b { color: var(--green); } .pst.bad b { color: var(--red); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 16px 0 16px; overflow-x: auto; }
.tab { background: none; border: none; padding: 9px 14px; font-weight: 600; color: var(--ink2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.on { color: var(--blue); border-bottom-color: var(--blue); }
.tab .cnt { background: var(--amber2); color: var(--amber); border-radius: 9px; font-size: 11px; padding: 0 6px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); margin-bottom: 16px; }
.cardh { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line2); flex-wrap: wrap; }
.cardh h3 { font-size: 15px; }
.cardf { padding: 12px 16px; border-top: 1px solid var(--line2); text-align: right; }
.tscroll { overflow-x: auto; }
.empty { text-align: center; padding: 60px 20px; background: #fff; border: 1px dashed #cdd4df; border-radius: var(--r); color: var(--ink2); }
.empty.sm { padding: 30px; }
.empty .eico { font-size: 34px; } .empty h3 { margin: 8px 0 6px; color: var(--ink); } .empty p { max-width: 520px; margin: 0 auto 14px; }

/* upload */
.uplayout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.drop { border: 2px dashed #b9c4d6; background: #fbfcfe; border-radius: 14px; padding: 30px 24px; text-align: center; cursor: pointer; transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease); }
.drop.over { border-color: var(--blue); background: var(--blue2); }
.dico { font-size: 34px; color: var(--blue); } .drop h3 { font-size: 19px; margin: 4px 0; } .drop p { color: var(--ink2); margin: 0 0 14px; }
.dact { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.privnote { margin-top: 14px; font-size: 12px; color: var(--teal); }
.uphelp { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; font-size: 13px; color: var(--ink2); }
.uphelp h4 { color: var(--ink); margin-bottom: 6px; } .uphelp ol { padding-left: 18px; margin: 0; } .uphelp li { margin: 6px 0; }
.prog { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink2); }
.pbar, .tbar { width: 200px; height: 8px; background: var(--line2); border-radius: 4px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--blue); transition: width .3s var(--ease); }
.pipe { display: flex; align-items: center; gap: 8px; padding: 12px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line2); }
.pp { display: flex; align-items: center; gap: 6px; } .pp b { font-size: 15px; } .arr { color: #b2bac7; }
table { border-collapse: collapse; width: 100%; }
.qt th, .ct th, .rt th { text-align: left; font-size: 11.5px; color: var(--mute); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.qt td, .ct td, .rt td { padding: 8px 12px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.qt td.n { color: var(--mute); width: 34px; } .qt .fn { font-weight: 600; font-size: 13px; }
.sub { font-size: 11.5px; color: var(--mute); margin-top: 2px; } .sub.red { color: var(--red); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.qt tr.q-parsing { background: #f6f9ff; } .qt tr.q-ocr { background: #fff7f7; }

/* review grid */
.toolbar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { border: 1px solid var(--line); background: #fff; border-radius: var(--r-sm); padding: 4px 11px; font-size: 12.5px; cursor: pointer; font-weight: 500; }
.fchip span { color: var(--mute); font-size: 11.5px; margin-left: 2px; }
.fchip.on { background: var(--ink); border-color: var(--ink); color: #fff; } .fchip.on span { color: #cfd5df; }
.tright { display: flex; gap: 8px; }
.search { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; width: 220px; background: #fff; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink2); margin-bottom: 10px; flex-wrap: wrap; }
.legend .cf { margin: 0 4px 0 0; }
.gridwrap { overflow: auto; max-height: calc(100vh - 262px); min-height: 300px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.grid { border-collapse: separate; border-spacing: 0; font-size: 12.5px; width: max-content; min-width: 100%; }
.grid th { position: sticky; background: #f3f5f9; color: var(--ink2); font-weight: 600; font-size: 11.5px; padding: 6px 9px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line2); white-space: nowrap; z-index: 3; text-align: left; }
.grid tr.g1 th { top: 0; height: 30px; } .grid tr.g2 th { top: 30px; }
.grid th.gh { text-align: center; background: #e9edf4; color: var(--ink); font-size: 10.5px; }
.grid th.num { text-align: right; }
.grid td { padding: 6px 9px; border-bottom: 1px solid var(--line2); border-right: 1px solid var(--line2); white-space: nowrap; background: #fff; vertical-align: middle; }
.grid td.c { cursor: pointer; } .grid td.c:hover { background: #f0f5ff; box-shadow: inset 0 0 0 1px #9db6e6; }
.grid .fz { position: sticky; z-index: 2; } .grid th.fz { z-index: 5; top: 0; }
.grid .fz1 { left: 0; width: 132px; min-width: 132px; } .grid .fz2 { left: 132px; width: 260px; min-width: 260px; max-width: 260px; box-shadow: 2px 0 0 #dfe4ec; }
.grid .fzr { position: sticky; right: 0; z-index: 2; box-shadow: -2px 0 0 #dfe4ec; text-align: right; } .grid th.fzr { z-index: 5; top: 0; }
.grid td.fzr .btn { margin-left: 3px; }
.grid td.payer { cursor: pointer; white-space: normal; } .grid td.payer:hover .pn { color: var(--blue); text-decoration: underline; }
.grid .pn { font-weight: 600; font-size: 12.5px; line-height: 1.3; } .grid .fnm { font-size: 10.5px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid tr.s-review td.fz1, .grid tr.s-ocr td.fz1 { box-shadow: inset 3px 0 0 var(--amber); } .grid tr.s-ocr td.fz1 { box-shadow: inset 3px 0 0 var(--red); }
.grid tr.s-approved td.fz1, .grid tr.s-overridden td.fz1 { box-shadow: inset 3px 0 0 var(--green); }
.grid tr.s-excluded td { color: #a5adba; background: #fafafa; }
.grid tr:hover td { background: #fafcff; }
.grid .neg { color: var(--red); }
.grid .codes { display: inline-flex; gap: 4px; }
.cd { background: var(--grey2); border-radius: 4px; padding: 0 5px; font-size: 11.5px; } .cd b { color: var(--blue); } .cd.st { background: var(--amber2); }
.grid td.chk { cursor: pointer; } .grid .tagcol { min-width: 112px; }
.tagsel { font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; background: #fff; }
.tagsel.weak { border-color: var(--amber); background: var(--amber2); }
.shimmer { display: inline-block; width: 46px; height: 9px; border-radius: 4px; background: linear-gradient(90deg, var(--n100), var(--n200), var(--n100)); background-size: 200% 100%; animation: sh 1.1s infinite; }
@keyframes sh { to { background-position: -200% 0; } }

/* checks */
.gatecard { display: flex; gap: 14px; align-items: flex-start; border-radius: var(--r); padding: 16px 18px; margin-bottom: 16px; border: 1px solid; }
.gatecard.ok { background: var(--green2); border-color: #b5e0c6; } .gatecard.bad { background: #fff5f5; border-color: #f2c4c4; }
.gatecard .gi { font-size: 22px; } .gatecard h3 { font-size: 16px; margin-bottom: 4px; }
.gatecard ul { margin: 4px 0 8px; padding-left: 18px; color: var(--ink2); } .gatecard p { margin: 2px 0 8px; color: var(--ink2); }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.kpi b { font-size: 22px; display: block; } .kpi span { font-size: 12px; color: var(--mute); }
.iss { display: flex; flex-direction: column; border-left: 3px solid; padding: 4px 9px; margin: 3px 0 5px; border-radius: 0 6px 6px 0; font-size: 12.5px; }
.iss span { color: var(--ink2); font-size: 12px; }
.iss.s-red { border-color: var(--red); background: #fff6f6; } .iss.s-red b { color: var(--red); }
.iss.s-amber { border-color: #e2a440; background: #fffaf0; } .iss.s-info { border-color: #8aa4d6; background: #f6f8fd; } .iss.s-ok { border-color: var(--green); background: #f3fbf6; } .iss.s-ok b { color: var(--green); }
.ct a { color: var(--ink); text-decoration: none; } .ct a:hover { color: var(--blue); }

/* roll-up */
.rollhead { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-bottom: 4px; }
.rollhead .gatecard { margin-bottom: 16px; }
.expbtns { display: flex; gap: 8px; margin: 8px 0 6px; }
.mapnote { font-size: 12px; color: var(--amber); font-weight: 600; }
.rgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; }
.rgrid .span2 { grid-column: span 2; }
.rt td, .rt th { padding: 6px 10px; font-size: 12.5px; }
.rt td.num, .rt th.num, .qt td.num { white-space: nowrap; }
.rt td.form { white-space: nowrap; }
.rt td.ein { white-space: nowrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; }
.rt tr.tot td { font-weight: 700; background: #f6f8fb; border-top: 1px solid var(--line); }
.rt tr.exprow { cursor: pointer; } .rt tr.exprow:hover td { background: #f6f9ff; }
.sublines td { background: #fafbfd; } .sublines div { display: flex; justify-content: space-between; font-size: 12px; padding: 1px 0 1px 18px; color: var(--ink2); }
.card h4 { padding: 0 16px; font-size: 13.5px; } .card > p { padding: 0 16px 12px; margin: 6px 0 0; }
.prev td, .prev th { white-space: nowrap; font-size: 11.5px; }
.timesaved { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--sh); }
.timesaved .th { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.tblk { margin: 6px 0 10px; } .tlab { font-size: 11px; color: var(--mute); }
.tbig { font-size: 24px; font-weight: 800; color: var(--green); } .tbig small { font-size: 12px; font-weight: 600; color: var(--mute); }
.tbar { width: 100%; height: 6px; background: var(--green2); margin: 4px 0; } .tbar i { display: block; height: 100%; background: var(--blue); }
.tsub, .tnote { font-size: 11.5px; color: var(--mute); }
.timesaved.compact { padding: 10px 12px; margin: 0; } .timesaved.compact .tbig { font-size: 20px; } .timesaved.compact .tblk { margin: 2px 0; }

/* side panel */
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100vw); background: #fff; box-shadow: -10px 0 30px rgba(16, 24, 40, .16); z-index: 40; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.ph { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ph .pt { font-weight: 700; font-size: 16px; }
.x { border: none; background: var(--grey2); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 14px; flex: none; }
.pbody { overflow-y: auto; padding: 14px 18px 30px; flex: 1; }
.fhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.flab { font-size: 12px; color: var(--mute); font-weight: 700; }
.fsrc { font-size: 12.5px; color: var(--blue); font-weight: 600; }
.fval { font-size: 22px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.fval .cf { font-size: 11px; line-height: 17px; vertical-align: 4px; }
.fconf { font-size: 12.5px; color: var(--ink2); margin: 6px 0 10px; } .fconf ul { margin: 4px 0 0; padding-left: 18px; }
.codes-t { margin-bottom: 10px; } .codes-t td, .codes-t th { padding: 5px 8px; font-size: 12.5px; }
.editbox { background: #f7f9fc; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; display: grid; gap: 8px; margin-bottom: 12px; }
.editbox label { font-size: 12px; color: var(--ink2); display: grid; gap: 3px; }
.editbox input { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fff; }
.ebtns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.recbox { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-bottom: 12px; }
.rbh { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.rollcalc { border: 1px solid; border-radius: 9px; padding: 10px 12px; margin-bottom: 12px; }
.rollcalc.ok { border-color: #b5e0c6; background: #f4fbf7; } .rollcalc.bad { border-color: #f0b9b9; background: #fff6f6; }
.rch { font-weight: 800; font-size: 15px; margin-bottom: 6px; } .rollcalc.bad .rch { color: var(--red); } .rollcalc.ok .rch { color: var(--green); }
.rollcalc table td { padding: 3px 0; font-size: 13px; } .rollcalc table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.rollcalc tr.t td { border-top: 1px solid var(--line); font-weight: 700; } .rollcalc tr.red td { color: var(--red); }
.hint { background: var(--amber2); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; margin: 8px 0; }
.qbibox { background: var(--blue2); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; margin-bottom: 10px; }
.srch { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 6px; }
.pgtabs { display: flex; gap: 4px; flex-wrap: wrap; }
.pgt { border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: 11.5px; padding: 2px 8px; cursor: pointer; }
.pgt.hit { border-color: #f0c35a; } .pgt.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.viewer { border: 1px solid var(--line); border-radius: 8px; background: #e9ecf1; max-height: 560px; overflow: auto; margin-bottom: 12px; }
.vload { padding: 40px 16px; text-align: center; color: var(--mute); font-size: 13px; }
.pgwrap { position: relative; background: #fff; }
.pgwrap canvas { display: block; }
.hl { position: absolute; background: rgba(255, 196, 0, .35); outline: 2px solid #e8a400; border-radius: 2px; animation: pulse 1.4s ease-in-out 2; }
@keyframes pulse { 50% { background: rgba(255, 196, 0, .6); } }
.ocrnote { margin-top: 10px; background: var(--red2); color: #7f1d1d; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; }

/* modal / toast */
.modal { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal[hidden], .panel[hidden], .toast[hidden] { display: none; }
.mbox { background: #fff; border-radius: 12px; padding: 20px 22px; width: min(520px, 100%); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.mbox h3 { font-size: 17px; margin-bottom: 6px; } .mbody { font-size: 13px; color: var(--ink2); } .mbody ul { padding-left: 18px; }
.mlab { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; margin-top: 8px; }
.mlab textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-weight: 400; resize: vertical; }
.merr { color: var(--red); font-size: 12px; min-height: 16px; margin-top: 4px; }
.mact { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #101828; color: #fff; padding: 9px 16px; border-radius: 9px; font-size: 13px; z-index: 70; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }

/* responsive */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rollhead, .rgrid, .uplayout { grid-template-columns: minmax(0, 1fr); } .rgrid .span2 { grid-column: auto; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .mobile-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #101828; color: #fff; padding: 10px 14px; position: sticky; top: 0; z-index: 20; }
  .mobile-top b { color: #fff; } .mobile-top .logo { width: 28px; height: 28px; font-size: 11px; }
  .mobile-top select { max-width: 60vw; border-radius: 7px; padding: 5px 6px; background: #1e2a40; color: #fff; border: 1px solid #33415c; font-size: 12.5px; }
  .main { padding: 14px 12px 24px; }
  .phead h1 { font-size: 20px; } .pstats { width: 100%; } .pst { flex: 1; min-width: 0; padding: 6px 8px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid .fz1 { width: 0; min-width: 0; padding: 0; font-size: 0; } .grid .fz1 .chip { display: none; }
  .grid .fz2 { left: 0; width: 160px; min-width: 160px; max-width: 160px; }
  .gridwrap { max-height: 70vh; }
  .tright { width: 100%; } .search { flex: 1; width: auto; min-width: 0; }
  .legend { display: none; }
  .grid .fzr, .grid th.fzr { position: static; box-shadow: none; }
  .grid .fz2 { box-shadow: 2px 0 0 #dfe4ec, inset 3px 0 0 var(--rowc, transparent); }
  .grid tr.s-review { --rowc: var(--amber); } .grid tr.s-ocr { --rowc: var(--red); } .grid tr.s-approved, .grid tr.s-overridden { --rowc: var(--green); }
  .filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; width: 100%; } .fchip { flex: none; }
  .foot { padding: 10px 12px 18px; }
  .drop { padding: 22px 14px; }
}
.gridwrap { scroll-padding-left: 404px; scroll-padding-right: 170px; scroll-padding-top: 64px; }
@media (min-width: 1600px) { body.panel-open .mainwrap { margin-right: 600px; } }

/* ---------- polish: hero, demo button, before/after, guided tour ---------- */
.pstats { align-items: stretch; }
.demo-btn { background: var(--pen); border-color: var(--pen); color: #fff; }
.demo-btn:hover { background: var(--pen-dk); border-color: var(--pen-dk); }
.demo-btn small { font-weight: 500; opacity: .85; margin-left: 4px; }
.pstats > .demo-btn { align-self: center; padding: 10px 16px; font-size: 14px; }
.btn.lg { padding: 11px 18px; font-size: 14.5px; border-radius: 9px; }

.hero { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(220px, 1fr); gap: 22px; align-items: center; margin-bottom: 18px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 28px 32px; }
.hero .hk { font-size: 12px; font-weight: 700; color: var(--blue); margin-bottom: 6px; }
.hero.done .hk { color: var(--green); }
.hero h2 { font-size: 25px; line-height: 1.25; letter-spacing: -.015em; max-width: 760px; }
.hero p { color: var(--ink2); max-width: 720px; margin: 10px 0 0; }
.hero .hact { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero .pbar.big { width: 100%; max-width: 560px; height: 12px; border-radius: 6px; margin-top: 12px; }
.hstats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.hstats > div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-width: 150px; }
.hstats b { display: block; font-size: 22px; letter-spacing: -.01em; } .hstats span { font-size: 12px; color: var(--mute); }
.amber { color: var(--amber); }
.hq { font-size: 14px; font-style: italic; color: var(--ink2); border-left: 3px solid #f0b429; padding: 4px 0 4px 14px; line-height: 1.5; }
.hq span { display: block; font-style: normal; font-size: 11.5px; color: var(--mute); margin-top: 6px; }

.sav { display: flex; flex-direction: column; gap: 16px; }
.savq .hq { font-size: 16px; background: #fff; border: 1px solid var(--line); border-left: 4px solid #f0b429; border-radius: 10px; padding: 14px 18px; }
.ba { display: grid; grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.bacol { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--sh); }
.bacol.before { border-top: 4px solid var(--red); } .bacol.after { border-top: 4px solid var(--blue); } .bacol.win { border-top: 4px solid var(--green); background: #f6fcf8; }
.bah { font-size: 12px; font-weight: 700; color: var(--ink2); }
.babig { font-size: 40px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 4px; }
.bacol.before .babig { color: var(--red); }
.bamath { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--ink2); background: var(--grey2); border-radius: 6px; padding: 6px 8px; margin-top: 6px; }
.bacol ul { margin: 12px 0 0; padding-left: 18px; color: var(--ink2); font-size: 13px; } .bacol li { margin: 3px 0; }
.baarrow { display: grid; place-items: center; font-size: 26px; color: var(--mute); }
.savt td, .savt th { padding: 10px 12px; }
.agrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; padding: 14px 16px; }
.agrid label { font-size: 13px; color: var(--ink2); display: flex; flex-direction: column; gap: 4px; }
.agrid label small { color: var(--mute); font-size: 11.5px; }
.agrid input.mini { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; }

.tour { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.tour[hidden] { display: none; }
.tour .thole { position: fixed; border-radius: var(--r); box-shadow: 0 0 0 9999px rgba(21, 26, 36, .5), 0 0 0 3px var(--hl) inset; transition: top .3s var(--ease), left .3s var(--ease), width .3s var(--ease), height .3s var(--ease); pointer-events: none; }
.tour.final .thole { display: none; }
.tour.final { background: rgba(10, 16, 32, .55); }
.tour .tcard { position: fixed; pointer-events: auto; background: #fff; border-radius: var(--r-lg); padding: 16px 18px 14px; box-shadow: var(--sh-over); transition: top .3s var(--ease), left .3s var(--ease); }
.tour .tprog { height: 4px; background: var(--line2); border-radius: 2px; overflow: hidden; margin-bottom: 10px; }
.tour .tprog i { display: block; height: 100%; width: 0; background: var(--pen); }
.tour .tstep { font-size: 12px; font-weight: 600; color: var(--mute); }
.tour h4 { font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1.2; margin: 2px 0 6px; }
.tour p { margin: 0 0 12px; color: var(--ink2); font-size: 14px; line-height: 1.5; }
.tour .tbtns { display: flex; gap: 6px; align-items: center; } .tour .tsp { flex: 1; }

@media (max-width: 1180px) { .ba { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .baarrow { display: none; } .bacol.win { grid-column: 1 / -1; } .hero { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .hero { padding: 16px; } .hero h2 { font-size: 19px; } .hero .hact .btn { flex: 1 1 100%; } .hstats > div { flex: 1 1 40%; min-width: 0; }
  .ba, .agrid { grid-template-columns: minmax(0, 1fr); } .babig { font-size: 32px; }
  .pstats > .demo-btn { flex: 1 1 100%; }
  .tour .tbtns .btn { padding: 5px 8px; }
}
.agrid .ain { display: flex; align-items: center; gap: 8px; } .agrid .ain input { width: 84px; } .agrid .ain em { font-style: normal; color: var(--mute); font-size: 12.5px; }
@media (max-width: 900px) {
  .pstats { flex-wrap: wrap; } .pst span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; } .tabs .tab { flex: none; }
}
@media (max-width: 600px) { .codes-t td, .codes-t th { padding: 5px 5px; } .codes-t .mini { width: 64px; } .codes-t th { letter-spacing: 0; } }

/* ---------- design pass: "Preparer's workpaper" (DESIGN.md) ---------- */
body { font-size: 14px; color: var(--ink); -webkit-font-smoothing: antialiased; }
.ic { width: 1.1em; height: 1.1em; vertical-align: -.2em; margin-right: .4em; flex: none; }
.ic.sm { width: .95em; height: .95em; margin: 0 0 0 2px; color: var(--mute); }
button .ic:last-child:not(:first-child) { margin: 0 0 0 .35em; }
.x .ic, .btn.xs .ic:only-child { margin: 0; }
:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }
.side :focus-visible, .mobile-top :focus-visible { outline-color: var(--hl); }
.btn, .tab, .fchip, .citem, .pgt, .x { transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease); }
.btn { border-radius: var(--r-sm); border-color: var(--n300); }
.btn:hover { border-color: var(--n400); background: var(--n50); }
.btn:active { background: var(--n100); }
.btn.primary:active, .demo-btn:active { background: var(--pen-dk); }
.btn.lg { border-radius: var(--r-sm); }
.btn.warn { background: var(--paper); border-color: var(--err); color: var(--err); }
.btn.warn:hover { background: var(--red2); border-color: var(--err); }
.chip, .fchip, .cf, .tab .cnt { border-radius: var(--r-sm); }
.chip.sm { font-size: 11px; }
.tag.dark { background: var(--n700); }
.logo { border-radius: var(--r-sm); background: var(--pen); font-family: var(--display); font-size: 15px; font-weight: 700; }
.brand small { color: var(--n400); }
.side { background: var(--ink); }
.sidehead { font-size: 12px; color: var(--n400); }
.citem { border-radius: var(--r); } .citem:hover { background: var(--n800); } .citem.on { background: var(--n800); border-color: var(--n700); }
.privacy, .side .timesaved { background: transparent; border: 1px solid var(--n700); border-radius: var(--r); }
.privacy .ic, .timesaved .th .ic { color: var(--hl); }
.mobile-top { background: var(--ink); }
/* engagement header: form-style fields, figures strip */
.crumb { font-size: 13px; }
.phead h1 { font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.15; letter-spacing: -.01em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.phead h1 .chip { font-family: "Public Sans", Arial, sans-serif; font-size: 12px; letter-spacing: 0; }
dl.meta { display: flex; gap: 0; margin: 8px 0 0; flex-wrap: wrap; }
dl.meta > div { padding: 0 16px; border-left: 1px solid var(--line); } dl.meta > div:first-child { padding-left: 0; border-left: 0; }
dl.meta dt { font-size: 12px; color: var(--mute); } dl.meta dd { margin: 1px 0 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.pstats { gap: 0; align-items: center; }
.pst { background: none; border: 0; border-left: 1px solid var(--line); border-radius: 0; padding: 2px 18px; min-width: 0; text-align: left; }
.pst b { font-size: 20px; font-weight: 700; } .pst span { font-size: 12px; }
.pstats > .demo-btn { margin-right: 14px; padding: 9px 14px; font-size: 14px; background: var(--paper); color: var(--pen); border-color: var(--pen); }
.pstats > .demo-btn:hover { background: var(--blue2); }
.tab { font-size: 14px; } .tab.on { color: var(--ink); border-bottom-color: var(--pen); }
.tab .cnt { font-weight: 700; }
/* hero: one sentence, one figures strip, one primary button */
.hero { grid-template-columns: minmax(0, 7fr) minmax(240px, 4fr); gap: 32px; align-items: start; }
.hero .hk { font-size: 13px; font-weight: 600; color: var(--mute); margin-bottom: 8px; display: flex; align-items: center; }
.hero.done .hk { color: var(--ok); }
.hero h2 { font-family: var(--display); font-weight: 500; font-size: 30px; line-height: 1.2; letter-spacing: -.012em; max-width: 32ch; }
.hstats { gap: 0; margin-top: 20px; }
.hstats > div { background: none; border: 0; border-left: 1px solid var(--line); border-radius: 0; padding: 0 24px; min-width: 0; }
.hstats > div:first-child { border-left: 0; padding-left: 0; }
.hstats b { font-family: var(--display); font-size: 34px; font-weight: 600; line-height: 1.1; }
.hstats span { font-size: 13px; }
.hero .hact { margin-top: 24px; gap: 8px; }
.hero .hact .btn.ghost { border-color: transparent; color: var(--pen); text-decoration: underline; text-underline-offset: 3px; }
.hero .hact .btn.ghost:hover { background: transparent; color: var(--pen-dk); }
.hq { font-family: var(--display); font-size: 19px; font-style: italic; line-height: 1.4; color: var(--n700); border-left: 0; padding: 0; text-indent: -.4em; }
.hq span { font-family: "Public Sans", Arial, sans-serif; font-style: normal; font-size: 12px; color: var(--mute); margin-top: 10px; text-indent: 0; }
.hero .hq { padding-top: 4px; }
/* figures strips instead of boxed cards */
.kpis { gap: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.kpi { border: 0; border-left: 1px solid var(--line2); border-radius: 0; background: none; padding: 14px 16px; }
.kpi:first-child { border-left: 0; }
.kpi b { font-family: var(--display); font-size: 28px; font-weight: 600; }
.card { box-shadow: none; } .cardh h3 { font-size: 15px; font-weight: 650; }
.gridwrap, .timesaved { box-shadow: none; }
.uphelp, .drop { border-radius: var(--r); }
.drop { border: 1.5px dashed var(--n300); background: var(--paper); }
.dico, .empty .eico { color: var(--pen); } .dico .ic, .empty .eico .ic { width: 30px; height: 30px; margin: 0; stroke-width: 1.5; }
.privnote { color: var(--n600); display: flex; align-items: center; justify-content: center; }
.arr { display: inline-flex; color: var(--n300); } .arr .ic { margin: 0; }
.qt th, .ct th, .rt th, .grid th, .grid th.gh { font-size: 12px; font-weight: 600; color: var(--n600); background: var(--n50); }
.grid th.gh { color: var(--ink); background: var(--n100); }
/* issues: tinted rows, no accent bars */
.iss { border-left: 0; border-radius: var(--r-sm); padding: 5px 9px; }
.iss.s-amber b { color: var(--warn); } .iss.s-info { background: var(--n50); }
.gatecard { border-radius: var(--r); } .gatecard .gi { display: grid; } .gatecard .gi .ic { width: 24px; height: 24px; margin: 0; }
.gatecard.ok .gi { color: var(--ok); } .gatecard.bad .gi { color: var(--err); }
.hint, .ocrnote { display: flex; gap: 2px; align-items: baseline; flex-wrap: wrap; border-radius: var(--r-sm); }
.hint { background: #fff8d6; }
/* before / after */
.savq .hq { font-size: 22px; background: none; border: 0; padding: 4px 0 4px .4em; border-radius: 0; max-width: 60ch; }
.bacol { border-radius: var(--r); box-shadow: none; }
.bacol.before, .bacol.after, .bacol.win { border-top: 1px solid var(--line); }
.bacol.win { background: var(--paper); border-color: var(--ok); }
.bah { font-size: 13px; font-weight: 600; color: var(--n600); }
.babig { font-family: var(--display); font-size: 48px; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; }
.bacol.after .babig { color: var(--pen); }
.bamath { font-family: inherit; font-size: 13px; border-radius: var(--r-sm); background: var(--n50); }
.baarrow { color: var(--n300); } .baarrow .ic { width: 28px; height: 28px; margin: 0; }
/* panel, modal, toast */
.panel { box-shadow: var(--sh-over); }
.ph .pt { font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1.2; }
.x { border-radius: var(--r-sm); display: grid; place-items: center; } .x:hover { background: var(--n200); }
.flab { font-size: 13px; font-weight: 600; color: var(--n600); }
.fval { font-family: var(--display); font-size: 30px; font-weight: 600; }
.editbox, .recbox, .rollcalc, .viewer { border-radius: var(--r); }
.pgt { border-radius: var(--r-sm); } .pgt.hit { border-color: var(--hl-dk); }
.hl { background: rgba(255, 224, 102, .45); outline-color: var(--hl-dk); }
.mbox { border-radius: var(--r-lg); box-shadow: var(--sh-over); } .mbox h3 { font-family: var(--display); font-size: 22px; font-weight: 600; }
.toast { background: var(--ink); border-radius: var(--r); }
.tlab { font-size: 12px; } .tbig { font-family: var(--display); font-weight: 600; }
.tour .tbtns .btn { display: inline-flex; align-items: center; }
.tour .tbtns .ic { margin-right: .3em; }
.tour .tbtns [data-t="next"] .ic { margin: 0 0 0 .3em; }
@media (max-width: 900px) {
  .phead h1 { font-size: 24px; }
  dl.meta > div { padding: 0 10px; } dl.meta dd { font-size: 13px; }
  .pstats { margin-top: 4px; }
  .pstats > .demo-btn { margin: 0 0 10px; flex: 1 1 100%; }
  .pst { flex: 1; padding: 2px 10px; } .pst:first-of-type { border-left: 0; padding-left: 0; }
  .hero { padding: 20px 16px; gap: 16px; } .hero h2 { font-size: 23px; }
  .hstats > div { flex: 1 1 0; padding: 0 12px; } .hstats b { font-size: 24px; white-space: nowrap; }
  .hq { font-size: 17px; }
  .kpi { border-top: 1px solid var(--line2); } .kpi b { font-size: 24px; }
  .babig { font-size: 38px; }
}
.grid td, .rt td, .qt td, .ct td, .pst b, .hstats b, .kpi b, .babig, .bamath, .fval, .tbig, .rollcalc td, .pp b { font-variant-numeric: tabular-nums; }
.phead h1, .hero h2, .ph .pt, .mbox h3 { word-spacing: .06em; }
.brand b { white-space: nowrap; }
@media (max-width: 1180px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .hero h2 { max-width: 30ch; }
  .hero .hq { padding-top: 16px; border-top: 1px solid var(--line2); }
}
@media (max-width: 600px) {
  dl.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 0; }
  dl.meta > div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .hero .hact .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (max-width: 600px) {
  /* queue on phones: file, status, open. Payer, form and parse time live in the review grid */
  .qt th:nth-child(1), .qt td:nth-child(1), .qt th:nth-child(3), .qt td:nth-child(3), .qt th:nth-child(4), .qt td:nth-child(4), .qt th:nth-child(6), .qt td:nth-child(6) { display: none; }
  .qt td, .qt th { padding: 8px 8px; }
  .prog .pbar { width: 90px; }
}
@media (max-width: 600px) {
  .qt { table-layout: fixed; } .qt th:nth-child(2) { width: 58%; } .qt th:nth-child(7) { width: 0; }
  .qt .fn, .qt .sub { overflow-wrap: anywhere; }
  .qt .chip { white-space: normal; }
  .qt td:nth-child(7) { padding: 0; } .qt td:nth-child(7):not(:empty) { padding: 8px 4px; }
}
@media (max-width: 600px) { .qt th:nth-child(7), .qt td:nth-child(7) { display: none; } .qt th:nth-child(2) { width: 60%; } }
