:root {
  --navy: #1F2A44;
  --navy2: #2C3E63;
  --teal: #0E8F82;
  --teal2: #0A6F65;
  --teal-hi: #12B3A2;
  --mint: #5EEAD4;
  --bg: #EDF1F8;
  --card: #FFFFFF;
  --ink: #1A2533;
  --muted: #5C6880;
  --line: #D6DDE9;
  --good: #0E8F82;
  --warn: #B4552D;
  --accent-grad: linear-gradient(135deg, #0E8F82, #12B3A2);
  --navy-grad: linear-gradient(145deg, #1F2A44 0%, #2C3E63 100%);
  font-variant-numeric: tabular-nums;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827;
    --card: #1C2535;
    --ink: #E8EDF5;
    --muted: #8A96AA;
    --line: #2E3A50;
    --navy: #0F1929;
    --navy2: #1A2840;
    --warn: #E9A277;
  }
}
:root[data-theme="light"] {
  --bg: #EDF1F8; --card: #FFFFFF; --ink: #1A2533; --muted: #5C6880;
  --line: #D6DDE9; --navy: #1F2A44; --navy2: #2C3E63; --warn: #B4552D;
}
:root[data-theme="dark"] {
  --bg: #111827; --card: #1C2535; --ink: #E8EDF5; --muted: #8A96AA;
  --line: #2E3A50; --navy: #0F1929; --navy2: #1A2840; --warn: #E9A277;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
}
/* ── Header ── */
.header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.mark {
  width: 38px; height: 38px;
  background: var(--accent-grad);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 20px; color: #fff;
  flex-shrink: 0;
}
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: .12em; color: var(--navy); }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .05em; margin-top: 1px; }
.tier-select {
  width: 100%; padding: 8px 12px; border: 1.5px solid var(--line);
  border-radius: 8px; background: var(--bg); color: var(--ink);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.tier-select:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.cost-row.unset span:last-child { color: var(--warn); font-weight: 700; }
/* Wraps, because it now carries two selectors rather than one.
   Adding the edition control pushed this row to 733px at a 375px viewport and
   the marketing-viewport spec caught it: nowrap on a flex row means the widest
   line sets the page width, and the whole page scrolls sideways on a phone. */
.pack-selector-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* min-width:0 lets a select shrink below its content width inside a flex row;
   without it the intrinsic width of the longest option wins and the row
   overflows again the moment an industry name gets longer. */
.pack-selector-wrap > select { min-width: 0; max-width: 100%; }
/* The tier note is a sentence, not a label, so it takes its own row and is the
   one .pack-label allowed to wrap. Without this it inherits white-space:nowrap
   below and pushes the header 93px past a 375px screen. */
#tierNote { flex-basis: 100%; white-space: normal; letter-spacing: 0; text-transform: none; }
.pack-label { font-size: 11px; color: var(--teal2); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
select#packSelect {
  background: #fff;
  border: 1.5px solid var(--navy);
  color: var(--teal2);
  border-radius: 8px;
  padding: 8px 32px 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231F2A44' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 220px;
}
select#packSelect:focus { outline: 2px solid var(--teal-hi); outline-offset: 2px; }
select#packSelect option { background: #fff; color: var(--teal2); }
/* ── Pack headline ── */
.pack-hero {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 18px 28px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.pack-title { font-size: 19px; font-weight: 800; color: var(--navy); margin: 0; }
.pack-tagline { font-size: 13px; color: var(--muted); }
/* ── Layout ── */
.main { max-width: 1100px; margin: 0 auto; padding: 24px 24px 40px; }
.grid { display: grid; grid-template-columns: 1fr 1.18fr; gap: 18px; }
/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 2px 12px rgba(15,28,50,.06);
}
.card-title {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--teal2); margin-bottom: 18px;
}
/* ── Fields ── */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 7px;
}
.field-val { color: var(--navy2); font-weight: 800; font-size: 14px; }
input[type=range] {
  width: 100%; accent-color: var(--teal); height: 4px;
  cursor: pointer;
}
input[type=range]:focus-visible,
.tier-select:focus-visible,
select#packSelect:focus-visible {
  outline: 3px solid var(--teal-hi);
  outline-offset: 3px;
  border-radius: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .bar-fill { transition: none; }
}
.field-hint { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
/* ── Results ── */
.result-headline {
  background: var(--navy-grad);
  border-radius: 10px; padding: 18px 20px; margin-bottom: 16px;
}
.result-eyebrow { font-size: 10.5px; color: rgba(200,215,240,.65); letter-spacing: .07em; text-transform: uppercase; }
.result-big { font-size: 48px; font-weight: 900; color: #fff; line-height: 1; margin: 6px 0 4px; }
.result-net { font-size: 12.5px; color: rgba(200,215,240,.75); }
/* ── Bars ── */
.bars { margin: 4px 0 14px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bar-lab { width: 155px; font-size: 11.5px; color: var(--ink); flex-shrink: 0; line-height: 1.3; }
.bar-track { flex: 1; background: var(--bg); border-radius: 4px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width .35s ease; }
.bar-amt { width: 80px; text-align: right; font-size: 12px; font-weight: 700; color: var(--navy2); flex-shrink: 0; }
/* ── Stats ── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; text-align: center;
}
.stat-val { font-size: 22px; font-weight: 800; color: var(--teal2); }
.stat-lab { font-size: 10.5px; color: var(--muted); margin-top: 3px; line-height: 1.3; }
/* ── Cost breakdown ── */
.cost-table { margin-top: 4px; }
.cost-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--muted);
}
.cost-row:last-child { border-bottom: none; font-weight: 800; color: var(--ink); font-size: 13px; }
.cost-row span:last-child { font-weight: 700; color: var(--ink); }
/* ── Assumptions ── */
.assumptions {
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.assumptions summary {
  padding: 16px 22px; cursor: pointer;
  font-weight: 700; font-size: 13.5px; color: var(--ink);
  list-style: none; display: flex; justify-content: space-between; align-items: center;
  user-select: none;
}
.assumptions summary::after {
  content: '＋'; font-size: 16px; color: var(--teal); transition: transform .2s;
}
.assumptions[open] summary::after { content: '－'; }
.ass-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px; padding: 0 22px 20px;
}
.ass-field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.ass-field input {
  width: 100%; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; color: var(--ink); background: var(--bg);
}
.ass-field input:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: transparent; }
.disclaimer {
  font-size: 11px; color: var(--muted); padding: 0 22px 18px;
  line-height: 1.6; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 14px;
}
/* ── Responsive ── */
@media (max-width: 780px) {
  .grid { grid-template-columns: 1fr; }
  .header { padding: 16px 18px; }
  .main { padding: 16px 14px 32px; }
  .pack-hero { padding: 14px 18px; }
  select#packSelect { min-width: 170px; }
}
