/* CD calculator page */
.cd-hero { margin: 40px 0 24px; text-align: center; }
.cd-hero h1 { max-width: 20ch; margin: 14px auto 0; font-size: clamp(2.2rem, 5.6vw, 4.2rem); line-height: 1.04; letter-spacing: -.045em; }
.cd-hero .tagline { margin-top: 18px; }
.cd-hero-pill { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px; margin: 22px auto 0; padding: 10px 18px; border: 1px solid rgba(92,200,255,.35); border-radius: 999px; background: rgba(92,200,255,.08); color: #cfeeff; font-weight: 800; font-size: .95rem; }

/* ---- inputs ---- */
.cd-tool { margin-top: 24px; padding: clamp(20px, 4vw, 38px); border: 1px solid rgba(92,200,255,.34); border-radius: 28px; background: radial-gradient(circle at top left, rgba(92,200,255,.14), transparent 40%), rgba(8,10,16,.94); box-shadow: 0 26px 90px rgba(0,0,0,.3); }
.cd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; }
.cd-field, .cd-fieldset { min-width: 0; display: grid; gap: 8px; align-content: start; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.035); }
/* Grid items default to min-width:auto, so a <select> sized to its widest option ("District of
   Columbia") pushes its whole column past a phone viewport. Both levels have to be allowed to
   shrink: the fields inside .cd-grid, and the controls inside each field. */
.cd-grid > *, .cd-field > *, .cd-fieldset > *, .cd-input > * { min-width: 0; }
.cd-input select { max-width: 100%; }
.cd-fieldset { border: 0; margin: 0; padding: 18px; }
.cd-field > label, .cd-fieldset > legend { padding: 0; color: #e5e7eb; font-weight: 800; font-size: .98rem; }
.cd-help { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.cd-input { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid rgba(255,255,255,.2); border-radius: 14px; background: rgba(0,0,0,.3); }
.cd-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(92,200,255,.15); }
.cd-input span { color: var(--muted); font-weight: 800; white-space: nowrap; }
.cd-input input, .cd-input select { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; outline: none; }
.cd-input select { font-size: 1.05rem; }
.cd-input select option { background: #0b1018; color: var(--text); }
.cd-input input::-webkit-outer-spin-button, .cd-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cd-input input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.cd-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.cd-chip { min-height: 38px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.04); color: #e5e7eb; font: inherit; font-weight: 800; font-size: .88rem; cursor: pointer; transition: border-color .15s, background .15s; }
.cd-chip:hover { border-color: rgba(255,255,255,.4); }
.cd-chip:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.cd-chip[aria-pressed="true"] { border-color: var(--blue); background: rgba(92,200,255,.18); color: #fff; }
.cd-payouts { display: grid; gap: 8px; }
.cd-payout { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.04); color: #e5e7eb; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.cd-payout:hover { border-color: rgba(255,255,255,.4); }
.cd-payout:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.cd-payout[aria-pressed="true"] { border-color: var(--blue); background: rgba(92,200,255,.18); }
.cd-payout strong { font-size: .98rem; }
.cd-payout small { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.cd-toggle { display: flex; align-items: flex-start; gap: 10px; color: #e5e7eb; font-size: .9rem; line-height: 1.5; cursor: pointer; }
.cd-toggle input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--blue); flex: none; }

/* ---- results ---- */
.cd-results { margin-top: 24px; padding: clamp(22px, 4vw, 40px); border: 1px solid rgba(56,217,138,.45); border-radius: 26px; background: linear-gradient(135deg, rgba(56,217,138,.14), rgba(255,255,255,.03)); text-align: center; }
.cd-results-label { margin: 0; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .13em; font-size: .76rem; }
.cd-headline { display: block; margin: 12px 0 0; font-size: clamp(2.2rem, 6.6vw, 4.4rem); line-height: 1; letter-spacing: -.045em; color: var(--green); }
.cd-headline-note { margin: 12px auto 0; max-width: 60ch; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.cd-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; margin-top: 24px; }
.cd-tile { padding: 18px 14px; border: 1px solid rgba(255,255,255,.13); border-radius: 18px; background: rgba(5,7,13,.55); }
.cd-tile[hidden] { display: none; }
.cd-tile > span { display: block; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; line-height: 1.35; }
.cd-tile > strong { display: block; margin-top: 8px; font-size: clamp(1.3rem, 3vw, 1.85rem); line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.cd-tile > small { display: block; margin-top: 6px; color: var(--muted); font-size: .78rem; }
.cd-note-line { margin: 16px 0 0; padding: 12px 16px; border: 1px solid rgba(246,196,83,.35); border-radius: 14px; background: rgba(246,196,83,.08); color: #fde9bd; font-size: .9rem; line-height: 1.55; }
.cd-note-line[hidden] { display: none; }

.cd-verdict { margin-top: 20px; padding: 20px; border-radius: 20px; border: 1px solid var(--line); text-align: left; }
.cd-verdict.cd-verdict-good { border-color: rgba(56,217,138,.5); background: rgba(56,217,138,.1); }
.cd-verdict.cd-verdict-bad { border-color: rgba(255,77,109,.5); background: rgba(255,77,109,.1); }
.cd-verdict h3 { margin: 0 0 6px; font-size: clamp(1.15rem, 2.6vw, 1.5rem); letter-spacing: -.02em; }
.cd-verdict p { margin: 0; color: #d7dde7; font-size: .95rem; line-height: 1.6; }

/* ---- tables ---- */
.cd-panel { margin-top: 24px; padding: clamp(20px, 4vw, 34px); border: 1px solid var(--line); border-radius: 24px; background: rgba(14,20,33,.82); }
.cd-panel h2 { margin: 0 0 8px; font-size: clamp(1.35rem, 3vw, 1.95rem); letter-spacing: -.03em; }
.cd-panel > p { margin: 0 0 16px; color: var(--muted); line-height: 1.6; }
.cd-table-wrap { overflow-x: auto; }
.cd-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.cd-table caption { caption-side: bottom; margin-top: 12px; color: var(--muted); font-size: .86rem; text-align: left; line-height: 1.55; }
.cd-table th, .cd-table td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.cd-table thead th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.cd-table th:first-child, .cd-table td:first-child, .cd-table thead th:first-child { text-align: left; }
.cd-table tbody tr:last-child td { border-bottom: 0; }
.cd-breakdown { display: grid; gap: 1px; margin-top: 4px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--line); }
.cd-breakdown div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 13px 16px; background: #0b1018; }
.cd-breakdown div[hidden] { display: none; }
.cd-breakdown dt, .cd-breakdown span:first-child { color: var(--muted); font-weight: 700; font-size: .92rem; }
.cd-breakdown strong { font-variant-numeric: tabular-nums; font-size: 1rem; }
.cd-breakdown div.cd-breakdown-total { background: rgba(255,255,255,.05); }

.cd-disclaimer { margin-top: 20px; padding: 16px 18px; border: 1px solid rgba(255,159,28,.4); border-radius: 16px; background: rgba(255,159,28,.08); color: #ffe3bb; font-size: .9rem; line-height: 1.62; }
.cd-disclaimer strong { color: #fff; }

@media (max-width: 620px) {
  .cd-results { text-align: left; }
  .cd-headline-note { margin-left: 0; }
}
