/* Customer-facing calculator (/calculator/), laid out like the booth
   mockup: inputs left, a sticky result card right (result first under
   820px). The shell (header, footer, page width, theme tokens) is
   public.css; the tokens below are this page's own, in both themes. */
:root {
  --calc-surface-2: #eaf1f3;
  --calc-line: #d5e0e4;
  --calc-accent: #087f8c;
  --calc-accent-soft: #d6eef0;
  --calc-on-accent: #ffffff;
  --calc-good: #1d7a46;
  --calc-good-soft: #dcf1e4;
  --calc-focus: #22c3d6;
  --calc-bad: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --calc-surface-2: #132a3f;
    --calc-line: #22394f;
    --calc-accent: #3fc6d4;
    --calc-accent-soft: #0f3a44;
    --calc-on-accent: #06222a;
    --calc-good: #5fd08f;
    --calc-good-soft: #123826;
    --calc-focus: #4fd8e8;
    --calc-bad: #ff8a80;
  }
}
:root[data-theme="dark"] {
  --calc-surface-2: #132a3f;
  --calc-line: #22394f;
  --calc-accent: #3fc6d4;
  --calc-accent-soft: #0f3a44;
  --calc-on-accent: #06222a;
  --calc-good: #5fd08f;
  --calc-good-soft: #123826;
  --calc-focus: #4fd8e8;
  --calc-bad: #ff8a80;
}

.calc [hidden] {
  display: none !important;
}
.calc-h1 {
  margin: 0 0 18px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  text-wrap: balance;
}
.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 22px;
  align-items: start;
}
/* Phones and narrow tablets: one column in reading order (sliders, then
   the result), nothing sticky; a summary bar at the bottom of the screen
   shows the answer while the result card is still below. */
@media (max-width: 820px) {
  .calc-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .calc {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}
.calc-panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--calc-line);
  border-radius: 16px;
  background: var(--pub-surface);
}

/* Sliders: big and touch-friendly */
.calc-field {
  margin-bottom: 22px;
}
.calc-field label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 1.02rem;
}
.calc-field output {
  font-family: "Sora", "Inter", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--calc-accent);
  font-variant-numeric: tabular-nums;
}
.calc-hint {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--pub-muted);
}
.calc input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 36px;
  margin: 0;
  background: transparent;
}
.calc input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border: 1px solid var(--calc-line);
  border-radius: 999px;
  background: var(--calc-surface-2);
}
.calc input[type="range"]::-moz-range-track {
  height: 10px;
  border: 1px solid var(--calc-line);
  border-radius: 999px;
  background: var(--calc-surface-2);
}
.calc input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 32px;
  height: 32px;
  margin-top: -12px;
  border: 3px solid var(--pub-surface);
  border-radius: 50%;
  background: var(--calc-accent);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.25);
}
.calc input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border: 3px solid var(--pub-surface);
  border-radius: 50%;
  background: var(--calc-accent);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.25);
}
.calc button:focus-visible,
.calc input:focus-visible,
.calc summary:focus-visible,
.calc a:focus-visible {
  outline: 3px solid var(--calc-focus);
  outline-offset: 2px;
}
/* Mode tabs: At your venue / At events (the flyer's table names). */
.calc-tabs {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 18px;
  padding: 4px;
  border: 1px solid var(--calc-line);
  border-radius: 999px;
  background: var(--calc-surface-2);
}
.calc-tab {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--pub-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.calc-tab[aria-selected="true"] {
  background: var(--calc-accent);
  color: var(--calc-on-accent);
}

/* Number fields (jumps a day, days a year, event days a year). */
.calc-field-num input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--calc-line);
  border-radius: 12px;
  background: var(--calc-surface-2);
  color: var(--pub-text);
  font: 700 1.25rem "Sora", "Inter", sans-serif;
  font-variant-numeric: tabular-nums;
}
.calc-hero-month {
  margin: 2px 0 8px;
  font-size: 1.05rem;
  color: var(--pub-muted);
}

/* Result: sticky beside the sliders on wide screens, never taller than
   the screen (it scrolls inside if it would be). */
@media (min-width: 821px) {
  .calc-result {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* Summary bar (phones): pinned to the bottom, tap to jump to the result. */
.calc-sumbar {
  display: none;
}
@media (max-width: 820px) {
  .calc-sumbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    max-height: 72px;
    margin: 0;
    padding: 8px max(16px, env(safe-area-inset-right, 0px))
      calc(8px + env(safe-area-inset-bottom, 0px))
      max(16px, env(safe-area-inset-left, 0px));
    border: 0;
    border-top: 2px solid var(--calc-accent);
    background: var(--pub-surface);
    box-shadow: 0 -4px 16px rgb(0 0 0 / 0.12);
    color: var(--pub-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease;
  }
  .calc-sumbar.is-off {
    transform: translateY(110%);
    visibility: hidden;
  }
}
.calc-sumbar-text {
  min-width: 0;
  font-size: 0.95rem;
  line-height: 1.3;
}
.calc-sumbar-text b {
  font-family: "Sora", "Inter", sans-serif;
  font-size: 1.15rem;
  color: var(--calc-accent);
  font-variant-numeric: tabular-nums;
}
.calc-sumbar-go {
  flex: none;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--calc-accent);
  color: var(--calc-on-accent);
  font-weight: 700;
  font-size: 0.9rem;
}
.calc-eyebrow {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pub-muted);
}
.calc-hero {
  margin: 6px 0 4px;
  font-family: "Sora", "Inter", sans-serif;
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--calc-accent);
  font-variant-numeric: tabular-nums;
}
.calc-hero-unit {
  font-size: 0.55em;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}
.calc-hero-sub {
  margin: 0 0 18px;
  font-size: 1.1rem;
}
.calc-hero-sub b,
.calc-split-label b {
  font-variant-numeric: tabular-nums;
}
.calc-payback {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--calc-good-soft);
  color: var(--calc-good);
  font-family: "Sora", "Inter", sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.3;
}
.calc-payback svg {
  flex: none;
}
.calc-split-label {
  margin: 0 0 8px;
}
/* A thin rule between the split sentence and the cost line. */
.calc-divider {
  height: 0;
  margin: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--calc-line);
}
.calc-costs {
  margin: 14px 0 22px;
  font-size: 0.92rem;
  color: var(--pub-muted);
}
.calc-costs b {
  font-weight: 600;
  color: var(--pub-text);
}
.calc-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.calc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  border: 0;
  border-radius: 12px;
  background: var(--calc-accent);
  color: var(--calc-on-accent);
  font: 700 1.1rem "Sora", "Inter", sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.calc-btn-small {
  min-height: 48px;
  font-size: 1rem;
}
/* Limited time offer banner (?promo=...): full width above the headline,
   stacked compactly on phones so the result still comes soon after. */
.calc-offer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 28px;
  align-items: center;
  margin-bottom: 20px;
  padding: 18px 22px;
  border: 2px solid var(--calc-accent);
  border-radius: 16px;
  background: var(--calc-accent-soft);
}
@media (max-width: 820px) {
  .calc-offer {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 16px;
  }
}
.calc-offer p {
  margin: 0;
}
.calc-offer-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--calc-accent);
}
.calc-offer-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-family: "Sora", "Inter", sans-serif;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 700;
  line-height: 1.3;
}
.calc-offer-list li + li {
  margin-top: 4px;
}
.calc-offer-worth {
  font-family: "Inter", sans-serif;
  font-size: 0.85em;
  font-weight: 500;
  color: var(--pub-muted);
  white-space: nowrap;
}
.calc-offer-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}
@media (max-width: 820px) {
  .calc-offer-side {
    text-align: left;
  }
}
.calc-offer-total {
  font-family: "Sora", "Inter", sans-serif;
  font-size: 1.05rem;
}
.calc-offer-total b {
  font-size: 1.6rem;
  color: var(--calc-accent);
  font-variant-numeric: tabular-nums;
}
.calc-offer-urgent {
  font-weight: 600;
}
.calc-offer-code {
  font-size: 0.88rem;
  color: var(--pub-muted);
}
.calc-offer-code b {
  color: var(--pub-text);
  letter-spacing: 0.04em;
}
.calc-math-offer {
  font-weight: 600;
}
/* Red that reads on the card in both themes (AA: 6.5:1 light, 7.0:1 dark). */
.calc-math-excluded {
  color: var(--calc-bad);
  font-weight: 500;
}
.calc-btn2 {
  min-height: 52px;
  border: 1px solid var(--calc-line);
  border-radius: 12px;
  background: var(--pub-surface);
  color: var(--pub-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.calc-sendbox {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid var(--calc-line);
  border-radius: 12px;
}
@media (max-width: 480px) {
  .calc-sendbox {
    grid-template-columns: minmax(0, 1fr);
  }
}
.calc-sendbox form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.calc-sendbox input {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--calc-line);
  border-radius: 10px;
  background: var(--pub-bg);
  color: var(--pub-text);
  font: inherit;
}
.calc-small {
  margin: 0;
  font-size: 0.82rem;
  color: var(--pub-muted);
}
/* The QR code stays dark on white in both themes, so phones can read it. */
.calc-qr {
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff;
}
.calc-qr img,
.calc-qr canvas {
  width: 112px !important;
  height: 112px !important;
}
.calc-qrcap {
  max-width: 128px;
  margin-top: 4px;
  font-size: 0.78rem;
  text-align: center;
  color: var(--pub-muted);
}
/* Honeypot: off screen, not display:none (some bots skip hidden fields). */
.calc-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.calc-send-error {
  color: var(--calc-bad);
  font-weight: 600;
}
.calc-thanks {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--calc-good-soft);
  color: var(--calc-good);
  font-weight: 600;
}
.calc-math {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--calc-line);
}
.calc-math summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  color: var(--pub-muted);
  cursor: pointer;
}
.calc-math-body {
  font-size: 0.92rem;
}
.calc-math-body p {
  margin: 6px 0 12px;
}
.calc-math-body table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.calc-math-body td {
  padding: 7px 4px;
  border-bottom: 1px solid var(--calc-line);
}
.calc-math-body td.n {
  text-align: right;
  white-space: nowrap;
}
.calc-math-body tr.total td {
  font-weight: 700;
  border-bottom: 0;
}
.calc-fine {
  margin: 18px 0 0;
  font-size: 0.82rem;
  color: var(--pub-muted);
}

/* The tagline at the right of the header: one line beside the logo,
   a little smaller on narrow phones so it still fits. */
.calc-tagline {
  min-width: 0;
  text-align: right;
  text-wrap: balance;
}
@media (max-width: 420px) {
  .calc-tagline {
    font-size: 0.8rem;
    line-height: 1.25;
  }
}

/* Edge to edge (viewport-fit=cover, home screen apps): the navy header
   runs under the status bar and notch; content keeps clear of them. */
.pub-bar {
  padding-top: env(safe-area-inset-top, 0px);
}
.pub-wrap {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.pub-footer {
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}

/* Booth mode (?booth=1): no footer. */
.is-booth .pub-footer {
  display: none;
}
.calc-flash {
  animation: calc-flash 0.6s ease;
}
@keyframes calc-flash {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .calc-sumbar {
    transition: none;
  }
  .calc-flash {
    animation: none;
  }
}
