:root {
  color-scheme: light;
  --bg: #ebe6dc;
  --ink: #1c1915;
  --muted: #5c564c;
  --line: #d9d2c5;
  --paper: #f7f4ed;
  --white: #fffcf7;
  --green: #0f5c4c;
  --header: #1c1915;
  --cream: #f4efe4;
  --gold: #fff4d6;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.35;
}

[hidden] { display: none !important; }

input[type="checkbox"] { width: auto; }

.page-title,
.lede,
.banner { grid-column: 1 / -1; }

.first-screen { align-content: start; }

.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 48px;
  background: var(--header);
  color: var(--cream);
}

.topnav-inner {
  height: 48px;
  width: min(1360px, calc(100% - 28px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  color: var(--cream);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.lang-menu { position: relative; }

.lang-menu summary {
  list-style: none;
  cursor: pointer;
  height: 32px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #3d362e;
  background: #2a241e;
  color: var(--cream);
  font-size: 13px;
}

.lang-menu summary::-webkit-details-marker { display: none; }

.lang-menu ul {
  position: absolute;
  right: 0;
  top: 100%;
  margin: 4px 0 0;
  padding: 4px 0;
  list-style: none;
  min-width: 148px;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(28, 25, 21, 0.12);
}

.lang-menu a {
  display: block;
  padding: 6px 12px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.lang-menu a:hover,
.lang-menu a:focus-visible { background: #f3eee4; }

.lang-menu a[aria-current="page"] { font-weight: 700; }

.first-screen {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 8px 14px;
  align-content: start;
  align-items: start;
  width: min(1360px, calc(100% - 28px));
  margin: 0 auto;
  padding: 8px 0 6px;
}

.page-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.lede,
.banner,
.fine,
.kicker,
.partner-sub,
.partner-kicker,
.results-title,
.chart-title,
.price-checked,
.hidden-note,
.v-plan { color: var(--muted); }

.lede,
.banner { margin: 0; font-size: 13px; }

.banner {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 4px 8px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 8px 10px;
  min-width: 0;
}

.field { margin-top: 8px; }

.field-label,
legend {
  display: block;
  padding: 0;
  margin: 0 0 3px;
  font-size: 12px;
  font-weight: 700;
}

fieldset {
  border: 0;
  margin: 8px 0 0;
  padding: 0;
  min-inline-size: 0;
}

.device-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.device-row input[type="range"] { flex: 1; min-width: 0; }

input[type="number"],
input[type="text"] {
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  padding: 3px 6px;
}

#devices-num { width: 4.2rem; }

input[type="radio"] { width: auto; }

.segment { display: flex; flex-wrap: wrap; gap: 4px; }

.segment label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 3px 7px;
  font-size: 13px;
}

.segment label:has(input:checked) {
  background: var(--header);
  color: var(--cream);
  border-color: var(--header);
}

.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 4px;
  font-size: 13px;
}

.check input { margin-top: 2px; }

.fine { margin: 6px 0 0; font-size: 11.5px; line-height: 1.35; }

.flag {
  display: inline-block;
  margin: 8px 0 0;
  background: var(--gold);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
}

.prices { margin-top: 8px; }

.prices summary {
  display: flex;
  flex-direction: column;
  gap: 1px;
  cursor: pointer;
  list-style: none;
}

.prices summary::-webkit-details-marker { display: none; }

.sum-title { font-size: 13px; font-weight: 700; }

.sum-title::before { content: "▸ "; }

.prices[open] .sum-title::before { content: "▾ "; }

.price-checked { font-size: 12px; }

.price-body { padding-top: 6px; }

.price-group {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 700;
}

.price-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.6rem;
  gap: 3px 8px;
  align-items: center;
  margin-top: 6px;
}

.price-grid label { font-size: 11.5px; }

.price-grid input { width: 100%; }

.text-btn,
.csv-btn,
.partner-link {
  font: inherit;
  cursor: pointer;
}

.text-btn {
  margin-top: 8px;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--green);
  font-weight: 700;
  text-decoration: underline;
}

.takeaway-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(240px, 0.95fr);
  gap: 8px;
  align-items: start;
}

.results-title {
  margin: 0 0 2px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.kicker { margin: 0; font-size: 12px; }

.takeaway-line {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.csv-btn {
  margin-top: 8px;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 4px 8px;
  font-weight: 700;
}

.partner {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  padding: 8px 10px;
  min-width: 0;
}

.partner-kicker { margin: 0; font-size: 12px; font-weight: 700; }

.partner-total {
  margin: 1px 0 0;
  font-size: 14px;
  font-weight: 700;
}

.partner-save {
  margin: 2px 0 0;
  color: var(--green);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 700;
}

.partner-sub { margin: 3px 0 6px; font-size: 11.5px; }

.partner-link {
  display: inline-block;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 700;
}

.disclosure {
  margin: 6px 0 0;
  background: var(--gold);
  color: var(--ink);
  padding: 6px 7px;
  font-size: 12px;
  line-height: 1.35;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.kpi {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 5px 8px;
  min-width: 0;
}

.kpi span,
.kpi small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.kpi strong {
  display: block;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.kpi small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breakdown {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 8px;
  margin-top: 8px;
  align-items: start;
}

.table-wrap,
.chart-wrap { min-width: 0; }

table.costs {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

table.costs th,
table.costs td {
  text-align: right;
  padding: 3px 5px;
  border-bottom: 1px solid #e6dfd3;
  vertical-align: top;
}

table.costs thead th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

table.costs th:nth-child(1) { width: 32%; }
table.costs th:nth-child(2) { width: 14%; }
table.costs th:nth-child(3) { width: 15%; }
table.costs th:nth-child(4) { width: 26%; }
table.costs th:nth-child(5) { width: 13%; }

table.costs th[scope="row"],
table.costs thead th:first-child { text-align: left; }

.v-name,
.v-plan,
.hidden-amt,
.hidden-note {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v-name { font-weight: 700; }

.v-plan,
.hidden-note { font-size: 11px; font-weight: 400; }

tr.is-low { background: #e7f3ef; }

.chart-title { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

.chart {
  display: block;
  width: 100%;
  height: 168px;
  background: var(--white);
  border: 1px solid var(--line);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  font-size: 11px;
  color: var(--muted);
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  vertical-align: -1px;
}

.swatch-intro { background: #1d6a5a; }
.swatch-renew { background: #c4552a; }
.swatch-extra { background: #b8860b; }

.site-footer {
  height: 28px;
  display: flex;
  align-items: center;
}

.site-footer p {
  width: min(1360px, calc(100% - 28px));
  margin: 0 auto;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.missing {
  width: min(1360px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.missing .page-title { white-space: normal; }

.missing-links { padding-left: 18px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible { outline: 2px solid #0f5c4c; outline-offset: 2px; }

button,
summary,
input,
a { -webkit-tap-highlight-color: transparent; }

@media (max-width: 900px) {
  .first-screen,
  .takeaway-row,
  .breakdown,
  .kpis { grid-template-columns: 1fr; }
  .page-title,
  .site-footer p { white-space: normal; }
  .topnav-inner,
  .first-screen,
  .site-footer p,
  .missing { width: min(1360px, calc(100% - 20px)); }
}
