/* Calculator pages: the answer beside the inputs on a wide screen, above them on a phone, so the answer is
   always on the first screen. Sizes come from the kit's variables, so Big and easy scales everything. */
.cx { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "ans" "in" "res"; }
.cx [hidden] { display: none !important; }
.cx-ans { grid-area: ans; padding: 12px 16px; border: 2px solid var(--hx-accent); border-radius: var(--hx-r); background: var(--hx-soft); }
.cx-in { grid-area: in; min-width: 0; }
.cx-res { grid-area: res; min-width: 0; padding: 4px 16px 12px; border: 1px solid var(--hx-line); border-radius: var(--hx-r); background: var(--hx-surf); }
.cx-res > :first-child { margin-top: 8px; }
.cx-res:empty { display: none; }
.cx-ans .cx-mainlab { margin: 0; font-size: var(--hx-small); font-weight: 700; color: var(--hx-accent-ink); }
.cx-ans .hx-out { display: block; margin: 2px 0 0; }
.cx-more { margin: 10px 0 0; display: grid; gap: 6px; }
.cx-more div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; padding-top: 6px; border-top: 1px solid var(--hx-line); }
.cx-more div:first-child { border-top: 0; padding-top: 0; }
.cx-more dd { text-align: right; }
.cx-more dt { font-size: var(--hx-small); color: var(--hx-muted); }
.cx-more dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cx-form { display: grid; gap: var(--hx-gap); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: start; }
.cx-field { min-width: 0; }
.cx-field.wide { grid-column: 1 / -1; }
.cx-field .hx-lab b { font-weight: 700; color: var(--hx-ink); }
.cx-unit { font-weight: 600; }
select.hx-in { appearance: auto; }
textarea.hx-in { min-height: calc(var(--hx-tap) * 2); padding: 10px 12px; resize: vertical; }
.cx-sys { display: inline-flex; gap: 6px; margin: 0 0 10px; }
.cx-sys .hx-btn { min-height: 40px; font-size: var(--hx-small); }
.cx-err { margin: 8px 0 0; }
.cx-table { margin: 18px 0 0; }
.cx-table summary { min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.cx-table summary::before, .cx-moreopts > summary::before { content: "\25B8"; color: var(--hx-accent); }
.cx-table[open] summary::before, .cx-moreopts[open] > summary::before { content: "\25BE"; }
.cx-scroll { overflow-x: auto; max-height: 420px; overflow-y: auto; border: 1px solid var(--hx-line); border-radius: var(--hx-r); }
.cx-table table { width: 100%; border-collapse: collapse; font-size: var(--hx-small); font-variant-numeric: tabular-nums; }
.cx-table th, .cx-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--hx-line); white-space: nowrap; }
.cx-table th { position: sticky; top: 0; background: var(--hx-surf); }
.cx-notice { margin: 12px 0 0; padding: 10px 12px; border-left: 4px solid var(--hx-edge); background: #f6f7f8; font-size: var(--hx-small); line-height: 1.45; color: var(--hx-muted); }
.cx-all { list-style: none; margin: 10px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 18px; }
.cx-all a { display: block; padding: 8px 0; border-bottom: 1px solid var(--hx-line); color: var(--hx-ink); text-decoration: none; }
.cx-all a:hover { color: var(--hx-accent-ink); text-decoration: underline; }
main > .hx-info:has(.cx-suites), main > .hx-info:has(.cx-all) { max-width: 1240px; margin-left: max(0px, calc((100% - 1240px) / 2)); margin-right: auto; padding-left: 24px; padding-right: 24px; box-sizing: border-box; }
.hx-info:has(.cx-suites) > h1, .hx-info:has(.cx-all) > h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.01em; }
.hx-info:has(.cx-suites) > p, .hx-info:has(.cx-all) > p { max-width: 680px; }
@media (max-width: 760px) { main > .hx-info:has(.cx-suites), main > .hx-info:has(.cx-all) { padding-left: 16px; padding-right: 16px; } }
.cx-suites { list-style: none; margin: 22px 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cx-suites a { --t1: #f3f7ff; --t2: #d9e6fb; --t3: #2253b4; display: flex; flex-direction: column; gap: 4px; min-height: 104px; justify-content: center; padding: 16px 18px; border-radius: 16px; background: linear-gradient(135deg, var(--t1), var(--t2)); box-shadow: 0 1px 2px rgba(18, 20, 23, .06); color: var(--hx-ink); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.cx-suites li:nth-child(3n+2) a { --t1: #f1faf5; --t2: #d3eedd; --t3: #11754a; }
.cx-suites li:nth-child(3n) a { --t1: #fef5f7; --t2: #fadce3; --t3: #a8324a; }
.cx-suites a:hover, .cx-suites a:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(18, 20, 23, .12); }
.cx-suites b { font-size: var(--hx-fs); font-weight: 800; color: var(--t3); }
.cx-suites span { font-size: var(--hx-small); color: #2e3642; line-height: 1.35; }
@media (prefers-reduced-motion: reduce) { .cx-suites a { transition: none; } .cx-suites a:hover, .cx-suites a:focus-visible { transform: none; } }
/* What the top calculators add. */
.cx-modes { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.cx-modes .hx-btn { min-height: 44px; font-size: var(--hx-small); }
.cx-help { margin: 4px 0 0; font-size: var(--hx-small); color: var(--hx-muted); line-height: 1.35; }
.cx-range { width: 100%; margin: 8px 0 0; accent-color: var(--hx-accent); height: 28px; }
.cx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.cx-chips button { min-height: 36px; padding: 0 12px; border: 1px solid var(--hx-edge); border-radius: 999px; background: #fff; color: var(--hx-ink); font: 600 var(--hx-small)/1 var(--hx-sans); cursor: pointer; }
.cx-chips button:hover { border-color: var(--hx-accent); }
.cx-moreopts { grid-column: 1 / -1; border-top: 1px solid var(--hx-line); padding-top: 6px; }
.cx-moreopts > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.cx-moreopts > .cx-form { margin-top: 6px; }
.cx-rows { grid-column: 1 / -1; min-width: 0; }
.cx-rows table { width: 100%; border-collapse: collapse; }
.cx-rows th { text-align: left; font-size: var(--hx-small); color: var(--hx-muted); font-weight: 700; padding: 0 6px 4px 0; }
.cx-rows td { padding: 0 6px 6px 0; }
.cx-rows .hx-in { min-width: 0; }
.cx-rm { min-width: 44px; min-height: var(--hx-tap); border: 1px solid var(--hx-line); border-radius: var(--hx-r); background: #fff; color: var(--hx-muted); font: 700 18px/1 var(--hx-sans); cursor: pointer; }
.cx-add { margin-top: 2px; min-height: 44px; font-size: var(--hx-small); }
.cx-insights li { background: var(--hx-soft); }
.cx-insights { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.cx-insights li { padding: 8px 10px; border-radius: 10px; font-size: var(--hx-small); line-height: 1.4; }
.cx-pin { margin-top: 10px; min-height: 40px; font-size: var(--hx-small); }
.cx-delta { display: block; font-size: var(--hx-small); font-weight: 600; color: var(--hx-muted); margin-top: 2px; }
.cx-charts { margin: 18px 0 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cx-chart.wide { grid-column: 1 / -1; }
.cx-chart { margin: 0; padding: 12px; border: 1px solid var(--hx-line); border-radius: var(--hx-r); position: relative; min-width: 0; background: #fff; }
.cx-chart figcaption { font-weight: 700; font-size: var(--hx-small); margin: 0 0 8px; }
.cx-chart svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.cx-donut { max-width: 200px; margin: 0 auto; }
.cx-legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--hx-small); color: var(--hx-muted); }
.cx-legend span { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.cx-tip { margin-top: 6px; font-size: var(--hx-small); color: var(--hx-ink); font-variant-numeric: tabular-nums; }
.cx-bars { display: grid; gap: 8px; }
.cx-bar { display: grid; grid-template-columns: minmax(80px, 1fr) 2fr auto; gap: 8px; align-items: center; font-size: var(--hx-small); }
.cx-track { display: block; height: 12px; background: #f0f2f4; border-radius: 4px; overflow: hidden; }
.cx-track i { display: block; height: 100%; border-radius: 4px; }
.cx-sect table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: var(--hx-small); }
.cx-sect th, .cx-sect td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--hx-line); vertical-align: top; }
.cx-sources { font-size: var(--hx-small); color: var(--hx-muted); }
.cx-sources a { overflow-wrap: anywhere; }
@media (min-width: 761px) {
  .cx { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "in ans" "in res"; align-items: start; }
}
@media print { .cx-notice { display: none; } }
