/* CountSift — styles
   A dense, bordered desktop-tool look: 1px rules carry the structure,
   one teal accent for actions, status colours reserved for the data. */

:root {
  --bg: #EDEFF2;
  --panel: #FFFFFF;
  --panel-2: #F5F6F8;
  --ink: #1D2329;
  --ink-2: #4A5561;
  --ink-3: #6E7A86;
  --line: #C9D0D7;
  --line-soft: #E3E7EB;
  --accent: #0F6E68;
  --accent-hover: #0B5953;
  --accent-soft: #DCEEEC;
  --under: #A6261C; --under-bg: #FBEAE8;
  --over:  #7F5000; --over-bg:  #FFF0CC;
  --ok:    #1E6B3A; --ok-bg:    #E2F2E7;
  --unv:   #5C6873; --unv-bg:   #EBEEF1;
  --radius: 3px;
  --font: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); }
body {
  margin: 0;
  font: 13px/1.45 var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
svg { fill: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  height: 46px; padding: 0 20px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-mark { color: var(--accent); }
.brand-mark-2 { opacity: .55; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand-tag { color: var(--ink-3); border-left: 1px solid var(--line); padding-left: 10px; margin-left: 2px; }

.steps { list-style: none; margin: 0 auto; padding: 0; display: flex; gap: 22px; }
.steps li { display: flex; color: var(--ink-3); white-space: nowrap; }
.step {
  display: flex; align-items: center; gap: 7px; padding: 2px 0; margin: 0;
  border: 0; border-radius: var(--radius); background: none; color: inherit; font-weight: inherit; white-space: nowrap;
}
.step:disabled { cursor: default; }
.step-n {
  width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 600; border: 1px solid var(--line); color: var(--ink-3); background: var(--panel);
}
.steps li.is-current { color: var(--ink); font-weight: 600; }
.steps li.is-current .step-n { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps li.is-done { color: var(--ink-2); }
.steps li.is-done .step { cursor: pointer; }
.steps li.is-done .step:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.steps li.is-done .step-n { border-color: var(--accent); color: var(--accent); }

/* ---------- Layout ---------- */
#app { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 20px 48px; }
.view { display: flex; flex-direction: column; gap: 18px; }
.intro { max-width: 68ch; display: flex; flex-direction: column; gap: 10px; }
.intro h1 { font-size: 21px; line-height: 1.25; font-weight: 650; letter-spacing: -.012em; }
.intro p { color: var(--ink-2); font-size: 13.5px; }
.intro-compact { gap: 6px; }
.intro-compact h1 { font-size: 17px; }
.privacy {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 8px 10px; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: var(--panel); color: var(--ink) !important; font-size: 12.5px !important; max-width: 60ch;
}
.privacy svg { flex: none; margin-top: 2px; color: var(--accent); }
.sample-cta { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 12.5px; }
.sample-cta .btn { flex: none; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.muted { color: var(--ink-3); }

/* ---------- Buttons & controls ---------- */
.btn {
  height: 30px; padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { background: var(--panel-2); border-color: #B5BEC7; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-outline { height: 32px; padding: 0 14px; border-color: var(--accent); color: var(--accent); font-weight: 600; }
.btn-outline:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--panel-2); border-color: transparent; }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12.5px; }

select, .search, input[type="range"] { accent-color: var(--accent); }
select, .search {
  height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); width: 100%;
}
select:hover, .search:hover { border-color: #B5BEC7; }
.search { width: 200px; }

.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.actions-spacer { flex: 1; }
.actions-note { color: var(--ink-3); }

/* ---------- Alerts & progress ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px;
  padding: 9px 12px; border: 1px solid #E4B4AE; border-left: 3px solid var(--under);
  background: var(--under-bg); color: #5E1B14; border-radius: var(--radius);
}
.alert span { flex: 1; white-space: pre-line; }
.alert-close { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; color: inherit; padding: 0 2px; }

/* Neutral notices (file skipped / replaced) and data warnings above the results table. */
.notice {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px;
  padding: 9px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: var(--panel); color: var(--ink); border-radius: var(--radius);
}
.notice > span, .notice > div { flex: 1; }
#notice-text { white-space: pre-line; }
.notice-warn { margin-bottom: 0; border-color: #E6C77A; border-left-color: #D59A00; background: var(--over-bg); color: #4A3000; }
.notice-warn ul { margin: 4px 0 0; padding-left: 18px; white-space: normal; }

.progress {
  position: fixed; inset: 46px 0 auto 0; z-index: 6;
  background: var(--panel); border-bottom: 1px solid var(--line); padding: 8px 20px;
  display: flex; align-items: center; gap: 12px;
}
.progress-bar { flex: 1; height: 4px; background: var(--line-soft); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 35%; background: var(--accent); animation: slide 1.1s linear infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.progress-text { color: var(--ink-2); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .progress-bar span { animation: none; width: 100%; } }

/* ---------- Drop zones ---------- */
.dropzones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dropzone { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; }
.dropzone-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--line-soft); }
.dropzone-head h2 { font-size: 14px; font-weight: 650; margin-bottom: 3px; }
.dropzone-head p { color: var(--ink-2); font-size: 12.5px; }
.dropzone-target {
  margin: 12px 14px; padding: 26px 14px; text-align: center; cursor: pointer;
  border: 1px dashed #AEB7C0; border-radius: var(--radius); background: var(--panel-2);
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.dropzone-target:hover, .dropzone.is-over .dropzone-target { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-action { color: var(--accent); font-weight: 600; }
.dropzone-or { color: var(--ink-3); }
.filelist { display: flex; flex-direction: column; gap: 10px; padding: 0 14px 14px; }
.filelist:empty { display: none; }

.filecard { border: 1px solid var(--line-soft); border-radius: var(--radius); }
.filecard-head { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 10px; background: var(--panel-2); border-bottom: 1px solid var(--line-soft); }
.filecard-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filecard-meta { color: var(--ink-3); white-space: nowrap; flex: 1; }

/* ---------- Tables ---------- */
.tablewrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 5px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
th { font-weight: 600; color: var(--ink-2); background: var(--panel-2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; }

.preview { font-size: 12px; }
.preview th, .preview td { padding: 3px 8px; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.preview th { position: static; }
.preview th.is-mapped { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 2px 0 var(--accent); }
.preview .role-badge { display: block; font-size: 10.5px; font-weight: 600; color: var(--accent); }
.preview-note { padding: 4px 8px; color: var(--ink-3); font-size: 12px; border-top: 1px solid var(--line-soft); }

/* ---------- Mapping ---------- */
#mapblocks { display: flex; flex-direction: column; gap: 14px; }
.mapblock { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.mapblock-head { display: flex; align-items: baseline; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); }
.role-tag { font-size: 11.5px; font-weight: 600; color: var(--accent); padding: 1px 6px; border: 1px solid var(--accent); border-radius: 2px; }
.mapblock-name { font-weight: 600; }
.mapgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field-label { font-weight: 600; color: var(--ink); display: flex; gap: 6px; align-items: baseline; }
.field-label em { font-style: normal; font-weight: 400; color: var(--ink-3); font-size: 12px; }
.field-hint { color: var(--ink-3); font-size: 12px; }
.field.is-invalid select { border-color: var(--under); }
.mapblock .tablewrap { max-height: 240px; }

.options { padding: 12px 14px; }
.options h2 { font-size: 14px; font-weight: 650; margin-bottom: 10px; }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.radio { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); }
.radio input { margin: 3px 0 0; }
#threshold-field output { font-weight: 500; color: var(--accent); }
#threshold-field.is-disabled { opacity: .45; }

/* ---------- Results: summary strip ---------- */
.summary { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.summary-cell { padding: 12px 16px 11px; border-left: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 2px; }
.summary-cell:first-child { border-left: 0; }
.summary-value { font-size: 22px; font-weight: 650; letter-spacing: -.015em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.summary-value.is-under { color: var(--under); }
.summary-value.is-over { color: var(--over); }
.summary-of { color: var(--ink-3); font-size: 14px; font-weight: 500; }
.summary-label { color: var(--ink-2); }
.summary-sub { color: var(--ink-3); font-size: 12px; }

/* ---------- Results: toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.chip { height: 26px; padding: 0 9px; border: 0; border-left: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip:first-child { border-left: 0; }
.chip:hover { background: var(--panel-2); }
.chip.is-on { background: var(--ink); color: #fff; }
.chip .count { color: var(--ink-3); font-size: 12px; }
.chip.is-on .count { color: rgba(255,255,255,.65); }
.toolbar-actions { margin-left: auto; display: flex; gap: 8px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-under { background: var(--under); }
.dot-over { background: #D59A00; }
.dot-ok { background: var(--ok); }
.dot-unv { background: #9AA5AF; }

/* ---------- Results: table ---------- */
.results th .sort { border: 0; background: none; padding: 0; cursor: pointer; font-weight: 600; color: inherit; }
.results th .sort::after { content: ""; display: inline-block; width: 0; height: 0; margin-left: 6px; border: 4px solid transparent; vertical-align: 1px; }
.results th .sort.asc::after  { border-bottom-color: var(--ink-2); border-top: 0; vertical-align: 2px; }
.results th .sort.desc::after { border-top-color: var(--ink-2); border-bottom: 0; }
.results .col-name { width: 40%; }
.results .col-status { width: 150px; }
.results td { height: 32px; }

.row-cust td { background: var(--panel-2); font-weight: 600; border-top: 1px solid var(--line); }
.row-cust:first-child td { border-top: 0; }
.toggle { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; cursor: pointer; font-weight: 600; text-align: left; }
.toggle::before { content: ""; width: 0; height: 0; border: 4px solid transparent; border-left: 5px solid var(--ink-2); margin-left: 2px; transition: transform .12s; }
.row-cust.is-open .toggle::before { transform: rotate(90deg); }
.cust-src { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; margin-left: 19px; }
.cust-issues { font-weight: 500; color: var(--ink-2); font-size: 12.5px; }
.cust-impact .impact { display: block; white-space: nowrap; }
.cust-impact .est { display: block; margin-left: 0; font-weight: 400; }
.row-cust .diff-under { color: var(--under); }
.row-cust .diff-over { color: var(--over); }

.row-item td:first-child { padding-left: 29px; }
.row-item .note { display: block; color: var(--ink-3); font-size: 12px; }
.row-item .diff-under { color: var(--under); font-weight: 600; }
.row-item .diff-over { color: var(--over); font-weight: 600; }
.est { color: var(--ink-3); font-size: 11.5px; margin-left: 3px; }
.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.row-item.status-under td.col-status { color: var(--under); }
.row-item.status-over td.col-status { color: var(--over); }
.row-item.status-matched td.col-status { color: var(--ok); }
.row-item.status-unverified td.col-status { color: var(--unv); }
.empty { padding: 28px; text-align: center; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.results-foot { color: var(--ink-3); font-size: 12px; }
.contact-line { color: var(--ink-2); font-size: 12.5px; margin-top: -6px; }
.contact-line a, .foot a { color: var(--accent); }

/* ---------- Footer ---------- */
.foot { display: flex; gap: 6px 16px; flex-wrap: wrap; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; background: var(--panel); }

/* ---------- Print ---------- */
.print-head { display: none; }
@media print {
  html, body { background: #fff; }
  .topbar, .foot, .toolbar, .actions, .alert, .notice:not(.notice-warn), .progress, .results-foot, .contact-line, .empty .btn { display: none !important; }
  #app { max-width: none; padding: 0; }
  .print-head { display: block; margin-bottom: 14px; }
  .print-head h1 { font-size: 18px; }
  .print-head p { color: var(--ink-2); font-size: 11.5px; }
  .summary { break-inside: avoid; }
  .results th { position: static; }
  .row-item[hidden] { display: table-row !important; }
  .toggle::before { display: none; }
  .row-cust td { background: #f3f3f3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  tr { break-inside: avoid; }
  .results td, .results th { font-size: 11px; height: auto; padding: 3px 8px; }
}

/* ---------- Narrow screens ---------- */
@media (max-width: 900px) {
  .topbar { gap: 12px; height: auto; padding: 8px 16px; flex-wrap: wrap; }
  .steps { margin: 0; order: 3; width: 100%; gap: 4px 14px; flex-wrap: wrap; }
  .brand-tag { display: none; }
  #app { padding: 16px 16px 40px; }
  .dropzones, .options-grid { grid-template-columns: minmax(0, 1fr); }
  .mapgrid { grid-template-columns: 1fr 1fr; }
  .summary { grid-template-columns: 1fr 1fr; }
  .summary-cell { border-top: 1px solid var(--line-soft); }
  .summary-cell:nth-child(-n+2) { border-top: 0; }
  .summary-cell:nth-child(odd) { border-left: 0; }
  .search { width: 100%; }
  .toolbar-actions { margin-left: 0; }
  .results .col-name { width: auto; }
}
@media (max-width: 560px) {
  .sample-cta { flex-direction: column; align-items: flex-start; gap: 6px; }
  .mapgrid, .summary { grid-template-columns: 1fr; }
  .summary-cell { border-left: 0; }
  .summary-cell:nth-child(2) { border-top: 1px solid var(--line-soft); }
}

/* ================================================================
   Visual polish: overrides the base styles above.
   Softer surfaces, rounder corners, larger type, one clear hierarchy.
   ================================================================ */
:root {
  --bg: #F3F5F7; --panel: #FFFFFF; --panel-2: #F8F9FB;
  --ink: #15202B; --ink-2: #4A5562; --ink-3: #737E8A;
  --line: #DFE3E8; --line-soft: #ECEFF2;
  --accent: #0F6E68; --accent-hover: #0B5953; --accent-soft: #E6F2F1;
  --radius: 8px; --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 2px 6px rgba(17, 24, 39, .04);
}
body { font-size: 14px; line-height: 1.5; }

/* Top bar & stepper */
.topbar { height: 60px; padding: 0 28px; box-shadow: 0 1px 0 rgba(17, 24, 39, .02); }
.brand-name { font-size: 16px; font-weight: 700; }
.brand-tag { font-size: 13px; }
.steps { gap: 0; align-items: center; }
.steps li { align-items: center; }
.steps li + li::before { content: ""; width: 32px; height: 1px; background: var(--line); margin: 0 8px; }
.step { gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; font-size: 13px; }
.step-n { width: 22px; height: 22px; font-size: 11.5px; }
.steps li.is-current .step { background: var(--accent-soft); color: var(--accent-hover); }
.steps li.is-done .step:hover { background: var(--panel-2); text-decoration: none; }
.steps li.is-done .step-n { background: var(--accent-soft); border-color: transparent; }

/* Layout & type */
#app { max-width: 1120px; padding: 40px 24px 72px; }
.view { gap: 22px; }
.intro { gap: 12px; }
.intro h1 { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
.intro p { font-size: 15px; line-height: 1.6; max-width: 64ch; }
.intro-compact { gap: 6px; }
.intro-compact h1 { font-size: 22px; }
.intro-compact p { font-size: 14px; }
.panel { border-radius: var(--radius-lg); box-shadow: var(--shadow); }

/* Upload hero: centred, one line each for the demo and the privacy promise */
#view-upload .intro { max-width: 820px; margin: 8px auto 6px; align-items: center; text-align: center; gap: 14px; }
#view-upload .intro h1 { font-size: 32px; }
#view-upload .intro > p:not(.privacy) { max-width: 60ch; }
.sample-cta { justify-content: center; gap: 12px; margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.privacy {
  align-items: center; gap: 8px; width: fit-content; max-width: none; white-space: nowrap;
  margin-top: 4px; padding: 6px 12px; border: 0; background: transparent;
  color: var(--ink-3) !important; font-size: 13px !important;
}
.privacy svg { margin-top: 0; color: var(--accent); }

/* Buttons & inputs */
.btn { height: 36px; padding: 0 14px; border-radius: var(--radius); border-color: var(--line); font-weight: 500; }
.btn:hover { border-color: #C9D0D8; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-primary { padding: 0 18px; box-shadow: 0 1px 2px rgba(15, 110, 104, .25); }
.btn-primary:disabled { opacity: 1; background: #E4E8EC; border-color: #E4E8EC; color: #8D97A2; box-shadow: none; }
.btn-outline { height: 36px; padding: 0 16px; background: var(--panel); }
.btn-quiet { height: 32px; border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { border-color: transparent; background: var(--panel-2); color: var(--ink); }
select, .search { height: 36px; padding: 0 10px; border-radius: var(--radius); }
select:focus, .search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 110, 104, .15); }
.search {
  width: 210px; padding-left: 32px;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737E8A' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 10px center;
}
.actions { gap: 12px; }
.actions-note { font-size: 13px; }
.alert, .notice { border-radius: var(--radius); padding: 10px 14px; }

/* Drop zones & loaded files */
.dropzones { gap: 20px; align-items: start; }
.dropzone { border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.dropzone-head { padding: 18px 20px 4px; border-bottom: 0; }
.dropzone-head h2 { font-size: 16px; margin-bottom: 4px; }
.dropzone-head p { font-size: 13px; color: var(--ink-3); }
.dropzone-target {
  flex-direction: column; gap: 2px; margin: 14px 20px 20px; padding: 30px 16px 28px;
  border: 1.5px dashed #CBD2DA; border-radius: 10px; background: var(--panel-2);
  transition: border-color .15s, background-color .15s;
}
.dropzone-target::before {
  content: ""; width: 40px; height: 40px; margin-bottom: 10px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230F6E68' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4'/%3E%3Cpath d='m6 10 6-6 6 6'/%3E%3Cpath d='M4 20h16'/%3E%3C/svg%3E") no-repeat center;
}
.dropzone-action { font-size: 14px; }
.dropzone-or { font-size: 13px; }
.filelist { padding: 0 20px 20px; gap: 12px; }
.filecard { border-color: var(--line); border-radius: 10px; overflow: hidden; }
.filecard-head { padding: 10px 8px 4px 14px; background: var(--panel); border-bottom: 0; }
.filecard-name { font-size: 13.5px; }
.filecard-meta { font-size: 12.5px; }
.filecard-cols { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 12px; }
.filecard-cols span { padding: 2px 8px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line-soft); color: var(--ink-2); font-size: 12px; }

/* Tables */
th { color: var(--ink-3); }

/* Mapping previews: one header line per column. Mapped columns read in full
   ink with an accent underline (plus a field pill when the column's own name
   doesn't already say it); columns CountSift ignores are dimmed. */
.preview { font-size: 12.5px; }
.preview th, .preview td { padding: 7px 12px; }
.preview th { border-bottom: 1px solid var(--line); }
.preview th.is-mapped { color: var(--ink); background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--accent); }
.preview .role-badge {
  display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; line-height: 18px; vertical-align: 1px;
}
.preview td.is-off { color: #A3ACB6; }
.preview-note { padding: 8px 12px; font-size: 12.5px; }

/* Mapping */
#mapblocks { gap: 18px; }
.mapblock { border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.mapblock-head { align-items: center; padding: 14px 20px; }
.role-tag { padding: 2px 10px; border: 0; border-radius: 999px; background: var(--accent-soft); font-size: 12px; }
.mapblock-name { font-size: 15px; }
.mapblock-head .muted { font-size: 13px; }
.mapgrid { gap: 16px 20px; padding: 16px 20px 20px; }
.field { gap: 6px; }
.field-label { font-size: 13px; }
.field-hint { line-height: 1.45; }
.mapblock .tablewrap { max-height: none; }
.options { padding: 20px; }
.options h2 { font-size: 16px; margin-bottom: 14px; }
.options-grid { gap: 28px; }
.radio { color: var(--ink); }
#threshold { width: 100%; }

/* Results: summary cards */
.summary { gap: 12px; background: none; border: 0; border-radius: 0; }
.summary .summary-cell {
  padding: 16px 18px; gap: 3px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.summary .summary-cell:nth-child(2) { border-color: #EBC9C4; background: linear-gradient(180deg, #FFF7F6, #FFFFFF 70%); }
.summary-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.summary-label { font-size: 13px; font-weight: 500; color: var(--ink); margin-top: 2px; }
.summary-sub { font-size: 12.5px; }

/* Results: toolbar */
.toolbar { gap: 12px; }
.chips { padding: 3px; gap: 2px; border-radius: 10px; }
.chip { height: 30px; padding: 0 10px; border: 0; border-radius: 7px; font-size: 13px; }
.toolbar-actions { gap: 6px; }

/* Results: table */
.results th { height: 40px; padding: 0 14px; vertical-align: middle; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.results th .sort { text-transform: inherit; letter-spacing: inherit; }
.results td { height: 46px; padding: 9px 14px; vertical-align: middle; }
.results .col-status { width: 180px; }
.row-cust td { border-top: 1px solid var(--line); }
.row-cust .toggle { font-size: 14px; font-weight: 650; }
.cust-src { margin-left: 21px; margin-top: 1px; }
.cust-issues { font-size: 13px; color: var(--ink-3); }
.cust-impact .impact { font-weight: 650; }
.row-item td:first-child { padding-left: 35px; }
.row-item .note { margin-top: 1px; }
.status { padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.row-item.status-under .status { background: var(--under-bg); }
.row-item.status-over .status { background: var(--over-bg); }
.row-item.status-matched .status { background: var(--ok-bg); }
.row-item.status-unverified .status { background: var(--unv-bg); }
.dot { width: 7px; height: 7px; }
.empty { padding: 40px 20px; }
.results-foot { font-size: 12.5px; }
.contact-line { margin-top: 0; padding: 12px 16px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-hover); font-size: 13.5px; font-weight: 500; }
.contact-line a { font-weight: 600; }
.foot { padding: 14px 28px; font-size: 12.5px; }

@media (max-width: 900px) {
  .topbar { padding: 10px 16px; }
  .steps li + li::before { width: 14px; margin: 0 4px; }
  #app { padding: 24px 16px 48px; }
  .intro h1, #view-upload .intro h1 { font-size: 24px; }
  .summary .summary-cell { border: 1px solid var(--line); }
}
@media (max-width: 720px) { .privacy { white-space: normal; } }
@media (max-width: 560px) { .step { padding-right: 8px; } .search { width: 100%; } }
@media print {
  .summary .summary-cell { box-shadow: none; background: #fff; }
  .panel, .mapblock { box-shadow: none; }
  .status { padding: 0; background: none !important; }
}

/* ================================================================
   Run sequence: the sample walkthrough and the comparison progress.
   Every animation here moves only transform and opacity.
   ================================================================ */
@keyframes cs-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes cs-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes cs-rise     { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cs-drop     { from { opacity: 0; transform: translateY(-16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes cs-pop      { from { transform: scale(.7); } to { transform: none; } }
@keyframes cs-spin     { to { transform: rotate(360deg); } }
@keyframes cs-skip-in  { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* View cross-fade (SWAP_MS in app.js). The outgoing view is lifted out of the flow. */
#app { position: relative; }
.view-leaving { position: absolute; z-index: 2; margin: 0; pointer-events: none; animation: cs-fade-out .26s ease both; }
.view-entering { animation: cs-fade-in .26s ease both; }
body.is-running #app { min-height: calc(100vh - 60px); }
body.is-running #app, body.is-running .steps { pointer-events: none; }

/* Stage 1: sample files land in the upload cards */
.filecard.is-arriving { animation: cs-drop .42s cubic-bezier(.2, .8, .3, 1) both; animation-delay: var(--d, 0ms); }
.sample-tag {
  flex: none; padding: 1px 8px; border: 1px dashed #BFC7D0; border-radius: 999px;
  color: var(--ink-2); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
/* The tag drops to its own line rather than cutting off the file name. */
.filecard.is-sample .filecard-head { flex-wrap: wrap; row-gap: 6px; padding-right: 14px; }

/* Stepper: the connector fills, the current pill fades in, the number pops */
.steps li { position: relative; }
.steps li + li::after {
  content: ""; position: absolute; left: 8px; top: 50%; width: 32px; height: 2px; margin-top: -1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left center;
  transition: transform .45s cubic-bezier(.4, 0, .2, 1);
}
.steps li.is-reached::after { transform: scaleX(1); }
.step { position: relative; isolation: isolate; }
.step::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--accent-soft); opacity: 0; transition: opacity .3s ease;
}
.steps li.is-current .step { background: transparent; }
.steps li.is-current .step::before { opacity: 1; }
.steps li.is-current .step-n { animation: cs-pop .35s cubic-bezier(.3, 1.5, .5, 1); }

/* Stages 2–3: the progress card */
.run { align-items: center; padding-top: 12px; }
.run-card {
  width: 100%; max-width: 560px; padding: 24px 26px 22px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.view-entering .run-card { animation: cs-rise .34s cubic-bezier(.2, .8, .3, 1) both; }
.run-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.run-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin: 2px 0 12px; }
.run-body { transition: opacity .14s ease; }
.run-body.is-swapping { opacity: 0; }
.run-list { list-style: none; margin: 0; padding: 0; }
.run-line {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line-soft); opacity: .45; transition: opacity .2s ease;
}
.run-line:first-child { border-top: 0; }
.run-line.is-active, .run-line.is-done { opacity: 1; }
.run-text b { font-weight: 600; }
.run-text i { font-style: normal; color: var(--ink-3); }
.run-arrow { color: var(--ink-3); margin: 0 8px; }
.run-sep { color: var(--ink-3); }
.run-dots { transition: opacity .2s ease; }
.run-line.is-done .run-dots { opacity: 0; }
.run-count {
  font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
  opacity: 0; transform: translateX(-6px); transition: opacity .25s ease, transform .25s ease;
}
.run-line.is-done .run-count { opacity: 1; transform: none; }
.run-icon { position: relative; width: 20px; height: 20px; }
.run-icon > * { position: absolute; inset: 0; width: 20px; height: 20px; border-radius: 50%; }
.run-ring { border: 1.5px solid var(--line); transition: opacity .15s ease; }
.run-spin { border: 2px solid var(--accent-soft); border-top-color: var(--accent); opacity: 0; }
.run-line.is-active .run-spin { opacity: 1; animation: cs-spin .7s linear infinite; }
.run-line.is-active .run-ring, .run-line.is-done .run-ring { opacity: 0; }
.run-check { opacity: 0; transform: scale(.4); transition: opacity .18s ease, transform .3s cubic-bezier(.3, 1.5, .5, 1); }
.run-check circle { fill: var(--accent); }
.run-check path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.run-line.is-done .run-check { opacity: 1; transform: none; }
.run-note { margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }

/* Stage 4: customer groups come in from the top (delays set in app.js) */
#results-body tr.reveal { animation: cs-rise .34s cubic-bezier(.2, .8, .3, 1) both; animation-delay: var(--d, 0ms); }
#view-results:focus { outline: none; }

/* Skip, shown during the sample walkthrough */
.run-skip {
  position: fixed; left: 50%; bottom: 20px; z-index: 8; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 16px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 13px; white-space: nowrap;
  box-shadow: 0 6px 20px rgba(17, 24, 39, .18); animation: cs-skip-in .3s ease both;
}
.run-skip-btn {
  height: 28px; padding: 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600;
}
.run-skip-btn:hover { background: rgba(255, 255, 255, .24); }

/* Sample report banner */
.sample-banner {
  position: relative; display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 10px 44px 10px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
#sample-banner-close { position: absolute; top: 17px; right: 14px; }
.sample-banner:focus { outline: none; }
.sample-banner-text { flex: 1 1 260px; color: var(--ink-2); }
.sample-banner-text strong { color: var(--ink); }
.sample-banner-actions { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; }
.link-btn { height: 32px; padding: 0 2px; border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 900px) {
  .steps li + li::after { left: 4px; width: 14px; }
  .run-card { padding: 20px 18px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .filecard.is-arriving, #results-body tr.reveal, .view-entering .run-card, .run-skip { animation-name: cs-fade-in; }
  .steps li + li::after { transform: none; opacity: 0; transition: opacity .2s ease; }
  .steps li.is-reached::after { opacity: 1; }
  .steps li.is-current .step-n { animation: none; }
  .run-line.is-active .run-spin { animation: none; }
  .run-check, .run-count { transform: none; }
}
@media print {
  .run-skip, .sample-banner-actions, #sample-banner-close { display: none !important; }
}

/* ================================================================
   Matching fixes: plan mismatches, couldn't compare, source checks.
   ================================================================ */
:root { --plan: #4C3FA6; --plan-bg: #EEECFB; }
.dot-plan { background: var(--plan); }
.dot-unr { background: transparent; border: 1.5px solid #9AA5AF; }
.row-item.status-plan td.col-status { color: var(--plan); }
.row-item.status-plan .status { background: var(--plan-bg); }
.row-item.status-unreadable td.col-status { color: var(--unv); }
.row-item.status-unreadable .status { background: var(--unv-bg); }
.row-item .diff-plan, .row-cust .diff-plan { color: var(--plan); font-weight: 600; }
.rate-was { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.flag {
  display: inline-block; margin-left: 8px; padding: 0 7px; border-radius: 999px; vertical-align: 1px;
  background: var(--over-bg); color: var(--over); font-size: 11px; font-weight: 600; line-height: 18px; white-space: nowrap;
}

/* Notes about what wasn't checked (no source covers an item, devices left out) */
.notice-info { margin-bottom: 0; }
.notice-info ul { margin: 0; padding-left: 18px; }
.notice-info li + li { margin-top: 2px; }

/* A source file that looks like a billing export */
.filecard-warn {
  display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 0 14px 12px; padding: 8px 10px;
  border-radius: var(--radius); background: var(--over-bg); color: #4A3000; font-size: 12.5px;
}
.filecard-warn > span:first-child { flex: 1 1 220px; }
.filecard-warn-actions { display: flex; align-items: center; gap: 10px; }
.filecard-warn .link-btn { height: 28px; color: #6B4600; }

/* Mapping: ignore devices that have gone quiet */
.mapblock-stale { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; padding: 0 20px 14px; }
.mapblock-stale:empty { display: none; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { margin: 0; accent-color: var(--accent); }
.stale-note { color: var(--ink-3); font-size: 12.5px; }

/* Results toolbar on wide screens: the search box gives up width before anything
   wraps; with every status present the filter strip scrolls within itself. */
@media (min-width: 901px) {
  .toolbar { flex-wrap: nowrap; }
  .toolbar .chips { flex: 0 1 auto; min-width: 0; }
  .toolbar .search { flex: 0 1 210px; min-width: 150px; }
  .toolbar-actions { flex: none; }
}

/* ================================================================
   Launch: "Not checked" lines, phone header.
   ================================================================ */
.dot-unc { background: transparent; border: 1.5px dashed #9AA5AF; }
.row-item.status-unchecked td.col-status { color: var(--unv); }
.row-item.status-unchecked .status { background: var(--unv-bg); }

/* On tablets and phones the stepper wraps under the logo; let the header grow
   with it instead of overlapping the page (the polish layer fixes it at 60px). */
@media (max-width: 900px) {
  .topbar { height: auto; min-height: 60px; }
}
/* On phones the steps wrap; a connector line at the start of a row would dangle. */
@media (max-width: 560px) {
  .steps { gap: 6px 4px; }
  .steps li + li::before, .steps li + li::after { display: none; }
}
