/* ===========================================================================
   GenkiCars calculators (shaken, car cost, loan, tolls)
   The request tool's look: white cards on white with layered shadows, one
   green accent, big tap targets. Mobile first. Built on the tokens in
   site.css; self-contained so a calculator page does not load match.css.
   =========================================================================== */

body.page-calc { background: #fff; }
.c-page { padding-block: clamp(16px, 3vw, 36px) clamp(40px, 6vw, 72px); }

.c-crumbs { display: flex; gap: .5rem; align-items: center; font-size: .88rem; color: var(--ink-3); margin-block-end: 1rem; }
.c-crumbs a { color: var(--ink-3); }

.c-head { margin-block-end: 18px; }
.c-head h1 { font-size: clamp(1.7rem, 1.15rem + 2.2vw, 2.6rem); letter-spacing: -.025em; margin: 0 0 .35em; }
.c-lead { color: var(--ink-2); font-size: clamp(1rem, .95rem + .3vw, 1.12rem); margin: 0 0 .7rem; max-width: 68ch; }
.c-answer { margin: 0; max-width: 72ch; padding: 12px 16px; border-radius: var(--r); background: var(--green-tint); border: 1px solid rgba(34,197,94,.25); color: var(--ink); }

/* ---- rate status line -------------------------------------------------- */
.c-status {
  display: flex; gap: 12px; align-items: flex-start;
  margin-block-end: 20px; padding: 12px 16px; border-radius: var(--r);
  background: var(--bg-soft); border: 1px solid var(--line); font-size: .93rem;
  transition: background-color .25s ease, border-color .25s ease;
}
.c-status__text { display: grid; gap: 2px; }
.c-status__text strong { font-size: .98rem; }
.c-status__text span { color: var(--ink-2); }
.c-status__icon { flex: 0 0 22px; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; position: relative; }
.c-status--ok { background: var(--green-tint); border-color: rgba(34,197,94,.3); }
.c-status--ok .c-status__icon { background: var(--green); }
.c-status--ok .c-status__icon::after { content: ""; position: absolute; left: 7px; top: 4px; width: 6px; height: 11px; border: solid #0a0a0a; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.c-status--warn { background: var(--amber-bg); border-color: #cbd5e1; }
.c-status--warn .c-status__icon { background: var(--amber); }
.c-status--warn .c-status__icon::after { content: "!"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .8rem; }
.c-status--loading .c-status__icon { border: 3px solid var(--line-strong); border-top-color: var(--green); animation: c-spin .8s linear infinite; }
@keyframes c-spin { to { transform: rotate(360deg); } }

/* ---- layout ------------------------------------------------------------ */
.c-grid { display: grid; gap: 18px; align-items: start; }
@media (min-width: 1000px) {
  .c-grid { grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; }
  .c-result { position: sticky; top: calc(var(--header-h) + 16px); }
}
.c-form { display: grid; gap: 16px; min-width: 0; }

.c-card {
  margin: 0; padding: clamp(16px, 3vw, 22px); min-width: 0;
  background: var(--bg); border: 1px solid rgba(16,20,24,.06); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.c-group > legend { float: inline-start; width: 100%; padding: 0; margin-block-end: 12px; font-weight: 700; font-size: 1.05rem; }
.c-fields { clear: both; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .c-fields { grid-template-columns: 1fr 1fr; } }
.c-field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.c-field--wide { grid-column: 1 / -1; }
.c-field[hidden], [data-show][hidden] { display: none; }
.c-field > label, .c-label { font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.c-hint { margin: 0; font-size: .84rem; color: var(--ink-3); line-height: 1.5; }
.c-hint a { color: var(--link); }

.c-input { position: relative; display: flex; }
.c-input input, .c-input__solo, .c-select {
  width: 100%; min-height: 48px; padding: 10px 14px;
  font: inherit; font-size: 16px; color: var(--ink);       /* 16px: no zoom on focus (iPhone) */
  background: var(--bg-soft); border: 1px solid var(--line-strong); border-radius: var(--r);
  box-shadow: 0 1px 2px rgba(16,20,24,.05), inset 0 1px 2px rgba(16,20,24,.04);
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
  -moz-appearance: textfield;
}
.c-input input::-webkit-outer-spin-button, .c-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.c-input--unit input { padding-inline-end: 64px; }
.c-unit { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); font-size: .85rem; font-weight: 600; color: var(--ink-3); pointer-events: none; }
.c-input input:focus, .c-input__solo:focus, .c-select:focus { outline: none; border-color: var(--green); background: var(--bg); box-shadow: 0 0 0 3px var(--green-ring), 0 4px 12px rgba(16,20,24,.06); }
.c-pair { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }

/* Choice tiles: the request form's big buttons. */
.c-tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.c-tile {
  position: relative; display: grid; gap: 2px; align-content: center; min-height: 56px; padding: 10px 14px;
  border: 1px solid rgba(16,20,24,.1); border-radius: var(--r); background: var(--bg); cursor: pointer;
  box-shadow: var(--shadow-sm); transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, transform .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.c-tile:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.c-tile input { position: absolute; opacity: 0; pointer-events: none; }
.c-tile__t { font-weight: 700; font-size: .95rem; }
.c-tile__s { font-size: .8rem; color: var(--ink-3); }
.c-tile:has(input:checked) { border-color: var(--green); background: var(--green-tint); box-shadow: 0 0 0 1px var(--green) inset, var(--shadow-sm); }
.c-tile:has(input:focus-visible) { outline: 3px solid var(--green-ring); outline-offset: 2px; }

.c-note { margin: 0; padding: 10px 14px; border-radius: var(--r); background: var(--amber-bg); color: var(--ink); font-size: .9rem; }
.c-note[hidden] { display: none; }

/* ---- result ------------------------------------------------------------ */
.c-result__h { margin: 0; font-size: .95rem; font-weight: 600; color: var(--ink-3); }
.c-total { margin: 2px 0 0; font-size: clamp(2.1rem, 1.6rem + 2vw, 2.8rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.c-total__sub { margin: 4px 0 14px; color: var(--ink-2); font-size: .95rem; }
.c-lines { width: 100%; border-collapse: collapse; font-size: .93rem; }
.c-lines th, .c-lines td { padding: 9px 0; border-top: 1px solid var(--line); vertical-align: top; text-align: start; font-weight: 500; }
.c-lines td { text-align: end; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; padding-inline-start: 12px; }
.c-lines__n { display: block; font-size: .8rem; color: var(--ink-3); font-weight: 400; margin-top: 1px; }
.c-lines__g th { padding-top: 14px; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); border-top: 0; }
.c-lines tr[hidden] { display: none; }
.c-bar { display: block; height: 4px; margin-top: 6px; border-radius: 4px; background: var(--bg-sunken); overflow: hidden; }
.c-bar::after { content: ""; display: block; height: 100%; width: var(--w, 0%); background: var(--green); border-radius: inherit; transition: width .3s ease; }
.is-tick { animation: c-tick .35s ease; }
@keyframes c-tick { from { color: var(--green-darker); } }
.c-recalc { margin-top: 14px; }
.c-route { margin-top: 14px; }
.c-route[hidden] { display: none; }

/* The phone's pinned total, just above the tab bar. */
.c-dock { display: none; }
@media (max-width: 999px) {
  .is-live .c-dock {
    display: flex; align-items: center; gap: 12px;
    position: fixed; inset-inline: 0; bottom: calc(56px + env(safe-area-inset-bottom)); z-index: 110;
    padding: 10px 16px; background: var(--logo-ink); color: #fff;
    box-shadow: 0 -6px 20px rgba(16,20,24,.18);
  }
  .c-dock span { font-size: .85rem; opacity: .8; }
  .c-dock strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; margin-inline-end: auto; }
  .c-dock a { color: var(--green); font-weight: 700; font-size: .9rem; }
  .is-live .c-page { padding-bottom: 80px; }
  /* The chat bubble sits above the pinned total, not on top of it. */
  .page-calc:has(.is-live) .gkc-launch { bottom: calc(56px + env(safe-area-inset-bottom) + 64px); }
}

/* ---- explanations ------------------------------------------------------ */
.c-sec { margin-block-start: clamp(32px, 5vw, 52px); max-width: 80ch; }
.c-sec h2 { font-size: clamp(1.25rem, 1.05rem + .8vw, 1.6rem); letter-spacing: -.02em; margin: 0 0 .6rem; }
.c-sec h3 { font-size: 1.05rem; margin: 1.3rem 0 .3rem; }
.c-sec p, .c-sec li { color: var(--ink-2); line-height: 1.7; }
.c-sec p { margin: 0 0 .8rem; }
.c-table { width: 100%; border-collapse: collapse; margin: .4rem 0 1rem; font-size: .93rem; }
.c-table th, .c-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: start; }
.c-table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.c-table td.n, .c-table th.n { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.c-src { padding-inline-start: 1.1rem; display: grid; gap: .55rem; }
.c-src strong { display: block; color: var(--ink); }
.c-src a { color: var(--link); word-break: break-word; }
.c-src__d { display: block; font-size: .82rem; color: var(--ink-3); }
.c-small { font-size: .85rem; color: var(--ink-3); }

.c-cta {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  margin-block-start: clamp(32px, 5vw, 52px); padding: clamp(18px, 3vw, 26px);
  border-radius: var(--r-lg); background: var(--bg-soft); border: 1px solid var(--line);
}
.c-cta h2 { margin: 0 0 .25rem; font-size: 1.15rem; }
.c-cta p { margin: 0; color: var(--ink-2); max-width: 60ch; }
