/* VV Promo Pricing - cool slate workspace; the deep blue is the same as the Excel header so screen and file match. */
:root {
  --ink: #1d2733;
  --ink-2: #4a5866;
  --ink-3: #75828f;
  --page: #e9eef0;
  --surface: #ffffff;
  --line: #d3dbe0;
  --line-2: #e6ebee;
  --blue: #1f4e78;
  --blue-2: #2c6699;
  --blue-wash: #e4edf5;
  /* result colours = Excel fills (text versions darkened for contrast) */
  --win: #e2f0d9;   --win-ink: #2f6b2a;
  --tie: #ddebf7;   --tie-ink: #1f4e78;
  --disc: #fce4d6;  --disc-ink: #9a4b16;
  --nobb: #ededed;  --nobb-ink: #555;
  --err: #fff2cc;   --err-ink: #7a5d00;
  --nl: #d9d9d9;    --nl-ink: #444;
  --nf: #f8cbad;    --nf-ink: #8c3511;
  --warn: #8a5300;
  --radius: 6px;
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.5 var(--font); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- top bar */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 10px 24px;
  background: var(--blue); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: .01em; }
.brand svg { width: 24px; height: 24px; }
.brand svg path { fill: #fff; } .brand svg circle { fill: var(--blue); }
.conn { display: flex; gap: 14px; margin-left: auto; font-size: 13px; color: #d7e3ee; flex-wrap: wrap; }
.conn span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #8fd18a; }
.conn span.off::before { background: #f0b35a; }
.topbar .ghost { color: #fff; border-color: rgba(255,255,255,.45); }
.topbar .ghost:hover { background: rgba(255,255,255,.12); }

/* ---------- layout */
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; max-width: 1480px; margin: 0 auto; padding: 24px; }
.rail { position: sticky; top: 72px; align-self: start; min-width: 0; }
.rail ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.rail li { margin: 0 0 4px -2px; border-left: 2px solid transparent; }
.rail a { display: block; padding: 7px 12px; color: var(--ink-3); text-decoration: none; font-size: 14px; }
.rail li.done a { color: var(--ink-2); }
.rail li.done { border-left-color: var(--blue-2); }
.rail li.current { border-left-color: var(--blue); }
.rail li.current a { color: var(--blue); font-weight: 600; }
.rail li.locked a { pointer-events: none; color: #a6b1ba; }
.work { min-width: 0; }

.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px 24px; margin-bottom: 18px; }
.step h2 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; font-size: 19px; font-weight: 700; line-height: 1.3; }
.stepno { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 50%; background: var(--blue-wash);
  color: var(--blue); font-size: 14px; font-weight: 700; flex: none; transform: translateY(-1px); }
.step.complete .stepno { background: var(--blue); color: #fff; }

.row { display: flex; flex-wrap: wrap; gap: 14px 22px; margin: 12px 0; align-items: flex-end; }
.row > label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); min-width: 240px; }
.row > label.grow { flex: 1; max-width: 560px; }
.row small { font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
select, input[type=number], input[type=password], input[type=text] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px;
  background: #fff; min-height: 38px; }
input[type=number] { width: 110px; }
.check { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; font-weight: 400 !important; color: var(--ink) !important; font-size: 14px !important; min-width: 0 !important; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }
.note { color: var(--ink-2); font-size: 14px; margin: 8px 0 14px; max-width: 78ch; }
.warn { color: var(--warn); background: #fff6e5; border-left: 3px solid #e3a43a; padding: 8px 12px; font-size: 14px; border-radius: 0 4px 4px 0; max-width: 90ch; }
.error { color: #8c1d18; background: #fdecea; border-left: 3px solid #d0453b; padding: 8px 12px; font-size: 14px; border-radius: 0 4px 4px 0; }

/* ---------- buttons */
button { cursor: pointer; border-radius: 5px; border: 1px solid transparent; padding: 8px 16px; min-height: 38px; font-weight: 600; font-size: 14px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.primary { background: var(--blue); color: #fff; }
.primary:hover:not(:disabled) { background: var(--blue-2); }
.secondary { background: #fff; color: var(--blue); border-color: var(--blue); }
.secondary:hover:not(:disabled) { background: var(--blue-wash); }
.ghost { background: transparent; border-color: var(--line); color: var(--ink-2); padding: 6px 12px; min-height: 32px; font-weight: 500; }
.ghost:hover { background: var(--line-2); }

/* ---------- upload */
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 20px; border: 2px dashed #b9c6cf;
  border-radius: var(--radius); text-align: center; cursor: pointer; background: #f7f9fa; }
.drop:hover, .drop.over { border-color: var(--blue-2); background: var(--blue-wash); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop strong { font-size: 15.5px; }
.drop span { color: var(--ink-3); font-size: 13.5px; }
.drop.loaded { border-style: solid; border-color: var(--blue-2); background: #fff; }

/* ---------- tables */
.tablewrap { overflow: auto; border: 1px solid var(--line); border-radius: 5px; max-width: 100%; }
.tablewrap.results { max-height: 560px; }
table.grid { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.grid th { position: sticky; top: 0; background: var(--blue); color: #fff; font-weight: 600; text-align: left; padding: 8px 10px; vertical-align: bottom;
  max-width: 220px; white-space: normal; line-height: 1.3; z-index: 1; }
.grid td { padding: 6px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.grid tr:nth-child(even) td { background: #fafbfc; }
.grid td.num { text-align: right; }
.grid td.res-win { background: var(--win) !important; color: var(--win-ink); }
.grid td.res-tie { background: var(--tie) !important; color: var(--tie-ink); }
.grid td.res-disc { background: var(--disc) !important; color: var(--disc-ink); }
.grid td.res-nobb { background: var(--nobb) !important; color: var(--nobb-ink); }
.grid td.res-err { background: var(--err) !important; color: var(--err-ink); }
.grid td.res-nl { background: var(--nl) !important; color: var(--nl-ink); }
.grid td.res-nf { background: var(--nf) !important; color: var(--nf-ink); }
.grid td.wrap { white-space: normal; min-width: 280px; }
#supTable td:first-child, #supTable th:first-child { width: 40px; text-align: center; }
details > summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 14px; margin: 6px 0; }
.preview .tablewrap { margin-top: 8px; max-height: 320px; }

/* ---------- progress */
.progress { margin-top: 14px; max-width: 640px; }
.progress .bar { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--blue-2); transition: width .25s ease; }
.progress p { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
.choices { border: 0; padding: 0; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.choices legend { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; padding: 0; }
.choices label { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 5px; padding: 8px 12px; cursor: pointer; font-size: 14px; }
.choices label:has(input:checked) { border-color: var(--blue); background: var(--blue-wash); }
.choices input { accent-color: var(--blue); }
.opts { margin-bottom: 16px; }

/* ---------- the outcome bar: share of SKUs by result, click a segment to filter */
.outcome { margin: 4px 0 6px; }
.outcome .stack { display: flex; height: 54px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.outcome .seg { display: flex; min-width: 96px; flex-direction: column; justify-content: center; padding: 0 12px; min-width: 0; border: 0; border-radius: 0;
  border-right: 2px solid #fff; text-align: left; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.outcome .seg:last-child { border-right: 0; }
.outcome .seg b { font-size: 19px; line-height: 1.1; white-space: nowrap; }
.outcome .seg small { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.outcome.filtered .seg:not(.on) { opacity: .35; }
.seg.win { background: var(--win); color: var(--win-ink); } .seg.tie { background: var(--tie); color: var(--tie-ink); }
.seg.disc { background: var(--disc); color: var(--disc-ink); } .seg.nobb { background: var(--nobb); color: var(--nobb-ink); }
.seg.err { background: var(--err); color: var(--err-ink); } .seg.nl { background: var(--nl); color: var(--nl-ink); }
.seg.nf { background: var(--nf); color: var(--nf-ink); }
.outcome .legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.outcome .legend button { background: none; border: 0; padding: 0; min-height: 0; font-weight: 500; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.outcome .legend i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; border: 1px solid rgba(0,0,0,.12); }
.outcome .legend button.on { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 26px; font-size: 13.5px; color: var(--ink-2); margin: 10px 0 2px; }
.facts b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- column picker */
.cols { margin: 10px 0 14px; border-top: 1px solid var(--line-2); padding-top: 8px; }
#colCount { color: var(--ink-3); font-weight: 400; }
.colbtns { display: flex; gap: 8px; margin: 10px 0; }
.colgroups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px 22px; }
.colgroups fieldset { border: 0; border-top: 2px solid var(--blue-wash); margin: 0; padding: 8px 0 0; }
.colgroups legend { font-weight: 700; font-size: 13.5px; padding: 0 6px 0 0; color: var(--blue); }
.colgroups label { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 3px 0; cursor: pointer; }
.colgroups input { accent-color: var(--blue); margin-top: 3px; }

.pager { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); margin: 8px 0 14px; }
.downloads { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; padding-top: 14px; border-top: 1px solid var(--line-2); }
.howto { margin-top: 18px; }
.howto dl { margin: 8px 0 0; font-size: 14px; max-width: 95ch; }
.howto dt { font-weight: 700; margin-top: 8px; }
.howto dd { margin: 2px 0 0; color: var(--ink-2); }

/* ---------- gate + admin */
.gate { display: grid; place-items: center; padding: 60px 16px; }
.gate-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 30px; width: min(520px, 100%); }
.gate-box h1 { font-size: 21px; margin: 0 0 8px; }
.gate-box p { color: var(--ink-2); }
.gate-box form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.gate-box code, #adminBody code { background: var(--blue-wash); padding: 1px 5px; border-radius: 3px; font-size: 13px; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; width: min(760px, 94vw); color: var(--ink); }
dialog::backdrop { background: rgba(20, 32, 44, .45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); margin: 0; }
.dlg-head h3 { margin: 0; font-size: 17px; }
#adminBody { padding: 16px 20px 22px; max-height: 76vh; overflow: auto; }
#adminBody table { font-size: 13px; border-collapse: collapse; width: 100%; }
#adminBody td { padding: 5px 8px; border-bottom: 1px solid var(--line-2); }
#adminBody td:first-child { font-family: var(--font); font-weight: 600; white-space: nowrap; }
#adminBody pre { background: #f4f6f8; padding: 10px; border-radius: 4px; overflow: auto; max-height: 260px; font-size: 12px; }
#adminBody section { margin-top: 18px; }
#adminBody h4 { margin: 0 0 8px; font-size: 15px; }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; gap: 12px; }
  .rail { position: static; }
  .rail ol { display: flex; overflow-x: auto; border-left: 0; border-bottom: 2px solid var(--line); }
  .rail li { margin: 0 0 -2px; border-left: 0; border-bottom: 2px solid transparent; flex: none; }
  .rail li.current { border-bottom-color: var(--blue); } .rail li.done { border-bottom-color: var(--blue-2); }
  .step { padding: 18px 16px; }
  .row > label { min-width: 0; width: 100%; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .conn { order: 3; width: 100%; margin-left: 0; }
  .outcome .seg small { display: none; }
}

/* Watermark: small and light in the bottom-right corner; clicks pass through it */
.watermark { position: fixed; right: 16px; bottom: 10px; z-index: 5; pointer-events: none; user-select: none;
  font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--ink); opacity: .35; }
