/* Delivery Mix Diagnostic. Light theme. Tokens approximate the Nessoris look; replace with the site's own values. */
:root {
  --ink: #06080c; --navy: #0d1626; --blue: #1670cc; --blue-d: #0f5aa8; --accent: #3aa0ff; --sky: #e8f3ff; --paper: #f5f7fb; --mist: #e4e9f1;
  --line: #d6dce6; --muted: #56627a; --orange: #d9480f; --orange-bg: #fff1e6; --green: #0b7a4b; --green-bg: #e3f6ec; --amber-bg: #fff6dc; --white: #fff;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 14px; --shadow: 0 1px 2px rgba(6,8,12,.06), 0 8px 24px rgba(6,8,12,.06);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--ink); background: var(--white); font-variant-numeric: tabular-nums; -webkit-text-size-adjust: 100%; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--navy); }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
h3 { font-size: 1.15rem; margin-top: 1.8em; }
p { margin: 0 0 .9em; }
a { color: var(--blue-d); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.site-head { background: var(--ink); }
.head-row { display: flex; justify-content: space-between; align-items: center; min-height: 64px; gap: 12px; }
.brand { display: inline-flex; align-items: center; }
.brand img { height: 30px; width: auto; display: block; }
.oo { height: 30px; width: auto; max-width: 55vw; }

.hero { background: radial-gradient(900px 460px at 82% 45%, rgba(58,160,255,.20), transparent 62%), var(--ink); color: #fff; padding: 56px 0 40px; }
.hero h1 { color: #fff; max-width: 22ch; font-weight: 700; }
.hero .eyebrow { color: var(--accent); }
.hero .lead { color: #c5cfdf; }
.hero-note { color: #9aa7bd; font-size: .9rem; margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 600; color: var(--blue-d); margin-bottom: .6em; }
.lead { font-size: 1.12rem; max-width: 46rem; color: #28324a; font-weight: 300; }
.live { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); color: #fff; border-radius: var(--r); padding: 20px 24px; margin: 28px 0 12px; max-width: 36rem; backdrop-filter: blur(6px); }
.live p { margin: 0; }
.live-label { font-size: .9rem; opacity: .8; }
.live-num { font-size: clamp(1.7rem, 5vw, 2.4rem); font-weight: 700; line-height: 1.2; margin: 4px 0; }
.live-num.pos { color: var(--accent); } .live-num.neg { color: #ffb27a; }
.live-range { font-size: .95rem; opacity: .9; }
.muted { color: var(--muted); font-size: .9rem; }
.help { color: var(--muted); max-width: 46rem; }
.help.sm, .sm { font-size: .85rem; }

.sec { padding: 44px 0; }
.sec.alt { background: var(--paper); }
.n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--accent); font-size: 1rem; font-weight: 600; flex: none; }

.row { display: flex; flex-wrap: wrap; align-items: flex-end; }
.row.gap { gap: 16px 24px; margin-top: 16px; }
.row.between { justify-content: space-between; align-items: center; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; font-weight: 600; color: var(--navy); }
input[type=text], input[type=email], input:not([type]), input[type=number], select {
  font: inherit; font-weight: 400; color: var(--ink); padding: 10px 12px; min-height: 44px; border: 1px solid #98a3ba; border-radius: 8px; background: #fff; max-width: 100%;
}
input[aria-invalid=true] { border-color: var(--orange); background: var(--orange-bg); }
.total { margin: 0; align-self: center; font-weight: 600; }

.trows { display: grid; gap: 8px; max-width: 520px; margin: 12px 0; }
.trow { display: grid; grid-template-columns: 1fr 96px 44px; gap: 8px; align-items: center; }
.trow .role { font-weight: 600; }
.x { min-height: 44px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 1.3rem; cursor: pointer; color: var(--muted); }
.x:hover { color: var(--orange); border-color: var(--orange); }

.lbl { font-weight: 600; margin: 16px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; padding: 10px 14px; min-height: 44px; border: 1px solid #98a3ba; border-radius: 999px; background: #fff; cursor: pointer; color: var(--navy); }
.chip[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin: 20px 0 8px; }
.slider label { font-weight: 600; display: block; margin-bottom: 6px; }
.slider.narrow { max-width: 480px; margin-top: 20px; }
.sl-row { display: flex; align-items: center; gap: 10px; }
.sl-row input[type=range] { flex: 1; min-width: 0; accent-color: var(--blue); height: 44px; }
.sl-row input[type=number] { width: 84px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.opt input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--blue); }
.opt.big { margin-top: 16px; font-weight: 600; }
.note { background: var(--sky); border-left: 4px solid var(--blue); padding: 10px 14px; border-radius: 6px; }
.callout { background: var(--sky); border-radius: var(--r); padding: 16px 20px; margin: 24px 0; }
.callout.warn { background: var(--orange-bg); border-left: 4px solid var(--orange); }
.callout p { margin: 6px 0 0; }
.tag { font-size: .75rem; font-weight: 600; background: var(--orange-bg); color: #a43d00; border-radius: 999px; padding: 4px 10px; }

.seg { border: 1px solid #98a3ba; border-radius: 999px; padding: 2px; display: inline-flex; margin: 0; background: #fff; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 8px 16px; border-radius: 999px; min-height: 40px; line-height: 24px; font-weight: 600; }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 1px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 18px 0 8px; }
.kpi { border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; background: #fff; box-shadow: var(--shadow); }
.kpi p { margin: 0; }
.k-l { font-size: .85rem; color: var(--muted); font-weight: 600; }
.k-v { font-size: 1.6rem; font-weight: 700; color: var(--navy); line-height: 1.3; }
.k-v.pos, .pos { color: var(--blue-d); } .k-v.neg, .neg { color: var(--orange); }
.k-s { font-size: .82rem; color: var(--muted); }

.chart { width: 100%; height: auto; display: block; margin: 8px 0; }
.ch-t { font: 12px var(--font); fill: #3a4660; } .ch-v { font: 600 13px var(--font); fill: var(--navy); } .ch-v.sm { font-size: 12px; }
.ch-zero { stroke: #3a4660; stroke-width: 1.5; } .ch-grid { stroke: var(--mist); }
.ch-band { fill: var(--sky); stroke: var(--blue); stroke-width: 1; }
.ch-dot { fill: #fff; stroke: var(--blue); stroke-width: 3; } .ch-dot.base { fill: var(--blue); }
.ch-pos { fill: var(--blue); } .ch-neg { fill: var(--orange); } .ch-total { fill: var(--navy); }
.ch-area { fill: var(--sky); } .ch-line { fill: none; stroke-width: 3; }
.ch-line.flat { stroke: #7b8aa8; } .ch-line.comp { stroke: var(--blue); } .ch-t.comp { fill: var(--blue-d); font-weight: 600; }
.lad.l0 { fill: #aab4c8; } .lad.l1 { fill: #7ea0ff; } .lad.l2 { fill: var(--blue); } .lad.l3 { fill: var(--navy); }
.mix.h { fill: #aab4c8; } .mix.p { fill: var(--blue); } .mix.a { fill: var(--navy); } .mix-t { fill: #fff; font: 600 13px var(--font); }
.mix.h + .mix-t { fill: var(--ink); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 4px 0 12px; font-size: .88rem; }
.legend li::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .h::before { background: #aab4c8; } .legend .p::before { background: var(--blue); } .legend .a::before { background: var(--navy); }

.dt summary, details summary { cursor: pointer; color: var(--blue-d); font-size: .88rem; }
.tscroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--mist); font-size: .82rem; }
.atable .ovr { width: 96px; min-height: 36px; padding: 6px 8px; }
.atable .u { color: var(--muted); font-size: .8rem; }
.atable tr.edited { background: var(--sky); }
.rng { white-space: nowrap; color: var(--muted); }
.badge { font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.st-sourced { background: #d9f2e6; color: #075f3a; } .st-secondary { background: #e0eaff; color: #1a3fcc; }
.st-directional { background: #fff0cc; color: #7a5200; } .st-assumed { background: #ffe0d0; color: #a43d00; }

.counter { background: #fff; border: 1px dashed #98a3ba; border-radius: var(--r); padding: 12px 16px; }
.dividend { font-weight: 700; font-size: 1.15rem; color: var(--navy); }

.ready-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 860px) { .ready-grid { grid-template-columns: 1.5fr 1fr; } .ready-side { position: sticky; top: 16px; align-self: start; } }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.spine { border: 1px solid var(--line); border-radius: var(--r); padding: 6px 16px 12px; margin: 0 0 14px; background: #fff; }
.spine > legend { font-weight: 700; color: var(--blue-d); padding: 0 6px; }
.q { margin: 10px 0; } .q > legend { font-weight: 600; padding: 0; margin-bottom: 2px; }
.score { font-size: 1.3rem; font-weight: 700; color: var(--navy); }
.sbar { display: grid; grid-template-columns: 110px 1fr 32px; gap: 8px; align-items: center; font-size: .9rem; margin: 6px 0; }
.track { background: var(--mist); border-radius: 6px; height: 10px; overflow: hidden; }
.fill { background: var(--blue); height: 100%; width: 0; }
.sv { text-align: right; font-weight: 600; }
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.pack { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: var(--r); padding: 14px 16px; }
.pack h4 { margin-bottom: .3em; } .pack p { margin: 0; font-size: .92rem; }

.gate { background: radial-gradient(800px 360px at 10% 0%, rgba(58,160,255,.18), transparent 60%), var(--ink); color: #fff; }
.gate h2, .gate .help { color: #fff; } .gate .help { opacity: .85; }
.gate .fld { color: #fff; } .gate a { color: #bcd0ff; } .gate .opt { font-size: .92rem; }
.err { background: var(--orange-bg); color: #8a3000; padding: 10px 14px; border-radius: 6px; margin: 10px 0; }
.ok { color: #9fe3bf; font-weight: 600; }
.gate .ok.sm { color: #bcd0ff; }
.btn { font: inherit; font-weight: 600; background: var(--blue); color: #fff; border: 2px solid var(--blue); border-radius: 8px; padding: 12px 22px; min-height: 48px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.btn:hover { background: var(--blue-d); border-color: var(--blue-d); }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--blue-d); border-color: var(--blue); }
.btn.ghost:hover { background: var(--sky); }
.gate .btn.ghost { color: #fff; border-color: #8fa8ff; } .gate .btn.ghost:hover { background: rgba(255,255,255,.1); }
.cta { margin-top: 28px; align-items: center; }

.foot { padding: 28px 0 48px; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); }

/* report view */
#report { position: fixed; inset: 0; z-index: 50; overflow: auto; background: #fff; padding: 0 16px 48px; }
.rep-bar { position: sticky; top: 0; display: flex; gap: 10px; padding: 12px 0; background: #fff; border-bottom: 1px solid var(--line); max-width: 860px; margin: 0 auto; }
.rep { max-width: 860px; margin: 0 auto; padding-top: 16px; }
.rep h2 { margin-top: 1.6em; display: block; border-bottom: 2px solid var(--mist); padding-bottom: 4px; }
.rep .big { font-size: 1.8rem; font-weight: 700; }
.plain { padding-left: 1.2em; } .rep-t { font-size: .78rem; }

@media (max-width: 560px) {
  .sec { padding: 32px 0; } .hero { padding: 32px 0 24px; }
  .trow { grid-template-columns: 1fr 84px 44px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media print {
  @page { margin: 14mm; }
  body.report-open #app, body.report-open .noprint { display: none !important; }
  #report { position: static; overflow: visible; padding: 0; }
  .rep { max-width: none; } .rep h2, .rep .callout, .chart { break-inside: avoid; }
  body { font-size: 11pt; }
}
.rep-t { display: block; overflow-x: auto; }

.costbox { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 16px 14px; margin: 20px 0 4px; background: #fff; max-width: 640px; }
.costbox > legend { font-weight: 700; color: var(--blue-d); padding: 0 6px; }
.costbox .note { margin: 10px 0 0; }

/* view toggle */
.viewbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.viewrow { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.viewrow .muted { margin: 0; }
.seg.big span { padding: 8px 22px; }
.view-simple .full-only { display: none !important; }
body:not(.view-simple) .simple-only { display: none !important; }
.more { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.more p { margin: 0; }

/* verdict, checks, cards */
.verdict { border-radius: var(--r); padding: 18px 22px; margin: 16px 0 6px; background: var(--sky); border-left: 5px solid var(--blue); }
.verdict.pos { background: var(--green-bg); border-color: var(--green); }
.verdict.mid { background: var(--amber-bg); border-color: #b7791f; }
.verdict.neg { background: var(--orange-bg); border-color: var(--orange); }
.verdict p { margin: 0; }
.v-main { font-size: clamp(1.05rem, 2.4vw, 1.3rem); font-weight: 600; color: var(--navy); line-height: 1.4; }
.v-conf { margin-top: 6px !important; color: #34405a; }
.checks { border: 1px solid #f0d9a8; background: #fffbf0; border-radius: var(--r); padding: 4px 20px 10px; margin: 20px 0; }
.checks h3 { margin-top: .8em; font-size: 1rem; }
.checks ul { margin: 0; padding-left: 1.2em; } .checks li { margin: 4px 0; }
.cards2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 20px 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 4px 22px 18px; box-shadow: var(--shadow); }
.card h3 { margin-top: .9em; }
.card .chart.mixbar { margin: 4px 0 10px; }
.rec { border-top: 4px solid var(--accent); }
.rec-mix { font-weight: 600; color: var(--navy); }
.be-num { font-size: 2rem; font-weight: 700; color: var(--navy); margin: 0; line-height: 1.2; }
.be-num span { font-size: 1rem; color: var(--muted); font-weight: 500; }
.ok-dark { color: var(--green); font-weight: 600; }

/* value loop */
.loop-grid { display: grid; grid-template-columns: 1fr; gap: 8px 32px; align-items: center; }
.loop-grid.two { align-items: start; margin-top: 8px; }
@media (min-width: 860px) { .loop-grid { grid-template-columns: 1.1fr 1fr; } }
.chart.loop { max-width: 560px; margin: 0 auto; }
.lp-core { fill: #fff; stroke: var(--mist); stroke-width: 1; }
.lp-arc { fill: none; stroke: #9db7d6; stroke-width: 3; }
.lp-head { fill: #9db7d6; }
.lp-node { fill: var(--ink); } .lp-node.on { fill: var(--blue); }
.lp-num { font: 600 15px var(--font); fill: #fff; }
.lp-t { font: 600 13px var(--font); fill: var(--navy); }
.lp-c { font: 500 14px var(--font); fill: var(--muted); }
.steps { counter-reset: st; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: st; position: relative; padding: 8px 0 8px 44px; border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(st); position: absolute; left: 0; top: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: .85rem; font-weight: 600; }
.steps strong { display: block; color: var(--navy); }
.measures { padding-left: 1.3em; } .measures li { margin: 6px 0; }
table.bl .num { font-weight: 600; white-space: nowrap; color: var(--navy); }
#loop .counter { margin-top: 24px; }

/* value drivers */
.outcome { font-weight: 600; color: var(--navy); background: var(--sky); border-radius: var(--r); padding: 12px 18px; max-width: 46rem; }
.vds { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 18px 0; }
.vd { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.vd h4 { margin: 4px 0 6px; } .vd p { font-size: .9rem; margin: 0 0 10px; }
.vd-n { font-weight: 700; color: var(--accent); font-size: .9rem; }
.vd-m { margin-top: auto !important; color: var(--muted); font-size: .84rem !important; }
.vd-m .badge { display: inline-block; margin-bottom: 4px; }
table.rg th[scope=row] { white-space: nowrap; }

/* report */
.rep-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink); color: #c5cfdf; padding: 16px 20px; border-radius: var(--r); margin-bottom: 20px; font-size: .85rem; flex-wrap: wrap; }
.rep-head img { height: 26px; width: auto; }
.rep-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 16px 0; }
.rep-kpis > div { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.rep-kpis p { margin: 0; }
.rep-loop .chart.loop { max-width: 420px; margin: 0; }
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rep-kpis { grid-template-columns: repeat(4, 1fr); }
  .rep-loop, .verdict, .rep-kpis, .rep ol, .rep ul, .rep table.bl { break-inside: avoid; }
  .rep-loop .chart.loop { max-width: 300px; }
}

@media (max-width: 560px) {
  .hero { padding: 36px 0 28px; }
  .viewrow { min-height: 56px; gap: 8px 12px; }
  .viewrow .muted { font-size: .8rem; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px; } .k-v { font-size: 1.25rem; }
  .cards2 { grid-template-columns: 1fr; }
  .card { padding: 2px 16px 14px; }
  .sliders { grid-template-columns: 1fr; }
  .sl-row input[type=number] { width: 72px; }
  .btn { width: 100%; justify-content: center; }
  .seg .btn { width: auto; }
  .row.between { align-items: flex-start; }
  .rep-kpis { grid-template-columns: 1fr 1fr; }
  .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  #res-body .chart.band { display: none; }
  .band-mob { display: grid !important; }
  .viewrow .muted { display: none; }
  #loop .chart.loop { display: none; }
}
.band-mob { display: none; grid-template-columns: 1fr 1fr 1fr; gap: 8px; list-style: none; padding: 0; margin: 8px 0 12px; }
.band-mob li { border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; background: #fff; }
.band-mob li.base { border: 2px solid var(--blue); }
.band-mob span { display: block; font-size: .78rem; color: var(--muted); }
.band-mob strong { font-size: 1.05rem; }
