/* ==========================================================================
   Revenue calculator on the product pages (ctn-private/calc.php, js/calc.js).
   Loaded only on a page that shows one. Inputs on the page colour, results on
   Polar Night with the brand edge pattern and the spectrum as a thin top edge.
   Numbers change with - and + buttons or by typing; there are no sliders, so
   a thumb scrolling the page cannot change a value.
   Mobile first, square corners. PURE ASCII ONLY in this file.
   ========================================================================== */

.pcalc { --pc-edge: var(--grad-spectrum);
  /* outline of anything you tap: 3.2:1 on white, the WCAG minimum for controls is 3:1.
     The lighter silver stays for dividers. */
  --pc-line: var(--line-strong); }
.pcalc { scroll-margin-top: 84px; }   /* the hero button lands with the heading clear of the header */
.pcalc .sec-head { margin-bottom: 28px; }
.pcalc .sec-head .sub { max-width: 60ch; }

.pc { display: grid; gap: 24px; align-items: start; }

/* ---- inputs ---- */
.pc-in { display: grid; gap: 24px; min-width: 0; }
.pc-in fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.pc-in legend { padding: 0; margin-bottom: 10px; font-size: var(--fs-micro); font-weight: 600; color: var(--silver-dark); }
.pc-group { display: grid; gap: 24px; }
.pc-group[hidden] { display: none; }

/* how you charge: a two-way switch */
.pc-mode { display: grid; grid-template-columns: 1fr 1fr; }
.pc-mode legend { grid-column: 1 / -1; }
.pc-mode label { position: relative; cursor: pointer; }
.pc-mode input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pc-mode span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 6px 10px; text-align: center;
  border: 1px solid var(--pc-line); background: #fff; color: var(--polar-night); font-size: var(--fs-sub); font-weight: 600; line-height: 1.2; }
.pc-mode label + label span { border-left: 0; }
.pc-mode input:checked + span { background: var(--polar-night); border-color: var(--polar-night); color: #fff; }
.pc-mode input:focus-visible + span { outline: 2px solid var(--signal-blue); outline-offset: 2px; }

.pc-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--silver-dark); }

/* one number: the label above, then  -  [ value ]  +  */
.pc-lab { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; margin-bottom: 6px; }
.pc-lab label { font-size: var(--fs-sub); font-weight: 600; color: var(--polar-night); line-height: 1.3; }
/* Reset: only there once the number differs from where it started */
.pc-undo { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; min-height: 28px; padding: 0 2px; border: 0; background: none;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--signal-blue); cursor: pointer; touch-action: manipulation; }
.pc-undo[hidden] { display: none; }
/* a bigger invisible tap area than the words, 44px tall */
.pc-undo { position: relative; }
.pc-undo::after { content: ""; position: absolute; left: -8px; right: -8px; top: -8px; bottom: -8px; }
.pc-undo:hover span { text-decoration: underline; text-underline-offset: 3px; }
.pc-undo:focus-visible { outline: 2px solid var(--signal-blue); outline-offset: 2px; }
.pc-step { display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; height: 52px; }
.pc-btn { display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--pc-line); border-radius: 0;
  background: #fff; color: var(--polar-night); font: inherit; font-size: 24px; font-weight: 400; line-height: 1; cursor: pointer;
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.pc-btn:hover { background: var(--cold-daylight); }
.pc-btn:active { background: var(--polar-night); border-color: var(--polar-night); color: #fff; }
.pc-btn:focus-visible { outline: 2px solid var(--signal-blue); outline-offset: 2px; position: relative; z-index: 1; }
.pc-btn:disabled { color: var(--silver-light); background: #fff; cursor: default; }
.pc-num { display: flex; align-items: center; justify-content: center; min-width: 0; border-top: 1px solid var(--pc-line);
  border-bottom: 1px solid var(--pc-line); background: #fff; }
.pc-num:focus-within { border-color: var(--signal-blue); box-shadow: inset 0 0 0 1px var(--signal-blue); }
.pc-num > span { color: var(--silver-dark); font-size: 18px; font-weight: 600; }
.pc-num input { width: 6ch; min-width: 0; height: 100%; padding: 0 0 0 2px; border: 0; background: none; outline: 0;
  font: inherit; font-size: var(--fs-large); font-weight: 600; color: var(--polar-night); text-align: center; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield; }
.pc-num > span + input { text-align: left; }
@supports (field-sizing: content) { .pc-num input { width: auto; min-width: 1ch; field-sizing: content; } }
.pc-num input::-webkit-outer-spin-button, .pc-num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---- results ---- */
.pc-out { position: relative; overflow: hidden; padding: 28px 22px 24px; background: var(--polar-night); color: #fff; }
.pc-out::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--pc-edge); }
.pc-out::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; height: 100%; width: auto; aspect-ratio: 494 / 604; max-width: 60%;
  background: url("/images/brand/edge-c.svg") left center / auto 100% no-repeat; opacity: .06; pointer-events: none; }
.pc-out > * { position: relative; z-index: 1; }

.pc-more { margin: 4px 0 22px; padding-top: 14px; border-top: 1px solid var(--line-on-dark); font-size: 14px; line-height: 1.5; color: var(--on-dark-muted); }
.pc-cta { width: 100%; justify-content: center; padding-left: 18px; padding-right: 18px; }   /* room for "Discuss your $8,493 a month" on one line */
/* "Email me this estimate": a quiet second step under the call button */
.pc-mail { margin-top: 14px; text-align: center; }
.pc-mail-open { padding: 4px 0; border: 0; background: none; color: #fff; font: inherit; font-size: 15px; font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--spec-ice); text-underline-offset: 4px; cursor: pointer; }
.pc-mail-open:hover { color: var(--spec-ice); }
.pc-mail-open:focus-visible { outline: 2px solid var(--spec-ice); outline-offset: 3px; }
.pc-mail-f { margin-top: 12px; text-align: left; }
.pc-mail-f label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: #fff; }
.pc-mail-row { display: flex; gap: 8px; }
.pc-mail-row input { flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line-on-dark); border-radius: 0;
  background: oklch(100% 0 0 / .06); color: #fff; font: inherit; font-size: 16px; }
.pc-mail-row input:focus { outline: 2px solid var(--spec-ice); outline-offset: 1px; border-color: var(--spec-ice); }
.pc-mail-send { flex: 0 0 auto; padding-left: 22px; padding-right: 22px; }
.pc-mail-err { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--spec-coral); }
.pc-mail-fine { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--on-dark-muted); }
.pc-mail-fine a { color: #fff; text-decoration: underline; }
.pc-mail-done { margin: 12px 0 0; font-size: 15px; font-weight: 600; color: #fff; }
.pc-fine { margin: 20px 0 0; max-width: 72ch; font-size: 13px; line-height: 1.5; color: var(--silver-dark); }
.pc-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (min-width: 640px) {
  .pc-out { padding: 32px 30px 28px; }
  /* label and stepper on one line once there is room */
  .pc-field { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: center; column-gap: 16px; }
  .pc-lab { margin: 0; }
  
}
@media (min-width: 900px) {
  /* desktop: compact enough that the inputs and the result fit on one screen */
  .pcalc .sec-head { margin-bottom: 28px; }
  .pcalc .sec-head h2 { margin-bottom: 10px; }
  /* the inputs and the result box stand the same height, the inputs spread
     to fill it; the box keeps its button at the bottom */
  .pc { grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); gap: 56px; align-items: stretch; }
  .pc-in { gap: 20px; grid-template-rows: auto 1fr; }
  .pc-group { gap: 14px; align-content: space-between; }
  .pc-group[data-model="membership"] { align-content: start; }
  .pc-in legend { margin-bottom: 8px; }
  .pc-mode span { min-height: 48px; }
  .pc-step { height: 48px; grid-template-columns: 48px minmax(0, 1fr) 48px; }
  .pc-field { grid-template-columns: minmax(0, 1fr) 200px; }
  
  .pc-out { display: flex; flex-direction: column; padding: 26px 28px 24px; }
  .pc-cta { margin-top: auto; }

  
  .pc-more { margin-bottom: 18px; padding-top: 12px; }
  .pc-fine { margin-top: 24px; }
}

/* ==========================================================================
   The working-out: sessions presets, the week strip and the sum.
   ========================================================================== */

/* labels: sentence case, one style for every input */
.pcsum .pc-mode legend { margin-bottom: 8px; font-size: var(--fs-sub); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--polar-night); }
.pcsum .pc-lab .pc-labt { font-size: var(--fs-sub); font-weight: 600; color: var(--polar-night); line-height: 1.3; }

/* ---- sessions a day: three presets are the main way in, Other opens a box ---- */
.pc-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.seg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 6px 4px;
  border: 1px solid var(--pc-line); border-radius: 0; background: #fff; color: var(--polar-night); font: inherit; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.seg b { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1; }
.seg span { font-size: var(--fs-micro); font-weight: 600; line-height: 1.2; color: var(--silver-dark); white-space: nowrap; }
.seg-other b { font-family: inherit; font-size: var(--fs-sub); font-weight: 600; line-height: 24px; }
.seg-other.has-n b { font-family: var(--display); font-size: 24px; font-weight: 400; line-height: 1; }
.seg:hover { border-color: var(--signal-blue); }
.seg[aria-pressed="true"] { background: var(--polar-night); border-color: var(--polar-night); color: #fff; }
.seg[aria-pressed="true"] span { color: var(--on-dark-muted); }
.seg:focus-visible { outline: 2px solid var(--signal-blue); outline-offset: 2px; position: relative; z-index: 1; }
.pc-own { margin-top: 8px; }
.pc-own[hidden] { display: none; }

/* ---- days you're open: the week ---- */
.pw { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.pw-day { height: 48px; padding: 0; border: 1px solid var(--pc-line); border-radius: 0; background: #fff; color: var(--polar-night);
  font: inherit; font-size: var(--fs-sub); font-weight: 600; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.pw-day:hover { border-color: var(--signal-blue); }
.pw-day[aria-pressed="true"] { background: var(--polar-night); border-color: var(--polar-night); color: #fff; }
.pw-day:focus-visible { outline: 2px solid var(--signal-blue); outline-offset: 2px; position: relative; z-index: 1; }
.pw-count { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--silver-dark); }

/* ---- the working-out ---- */
.ps { display: grid; grid-template-columns: 1.25em auto minmax(0, 1fr); column-gap: 12px; row-gap: 8px; align-items: baseline; }
.ps-l, .ps-total { display: contents; }
.ps-l[hidden] { display: none; }
.ps-op { justify-self: center; font-size: 20px; color: var(--spec-ice); line-height: 1; }
.ps b { justify-self: end; font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.1; color: #fff; white-space: nowrap; }
.ps-t { font-size: var(--fs-sub); line-height: 1.3; color: var(--on-dark-muted); }
.ps-q b { font-size: var(--fs-large); color: var(--on-dark-muted); }
.ps-q .ps-t { font-size: 14px; color: var(--on-dark-muted); }
.ps-rule { grid-column: 1 / -1; height: 1px; margin: 6px 0 4px; background: oklch(100% 0 0 / .35); }
.ps-total b { grid-column: 2; font-size: clamp(44px, 12vw, 56px); line-height: 1; }
.ps-total .ps-t { grid-column: 3; font-size: var(--fs-body); color: #fff; }
/* on a phone the total takes its own line, so a five-figure month does not
   squeeze the labels above it; from 640px it lines up under the figures */
.ps .ps-total { display: flex; grid-column: 1 / -1; align-items: baseline; flex-wrap: wrap; column-gap: 10px; }
.ps-year { margin: 12px 0 0; font-size: 16px; color: var(--on-dark-muted); }
.ps-year span { font-weight: 600; color: #fff; }
.pcsum .pc-more { margin-top: 16px; }

/* a number that just changed lights up once, so the eye finds it */
@keyframes ps-lit { 0%, 30% { color: var(--spec-ice); } 100% { color: #fff; } }
@keyframes ps-lit-soft { 0%, 30% { color: var(--spec-ice); } 100% { color: var(--on-dark-muted); } }
.ps-l.is-new b { animation: ps-lit .9s ease-out; }
.ps-l.is-new .ps-t { animation: ps-lit-soft .9s ease-out; }
.ps-total b.is-new { animation: ps-lit .9s ease-out; }
.pc-bar.is-new b { animation: ps-lit .9s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .ps-l.is-new b, .ps-l.is-new .ps-t, .ps-total b.is-new, .pc-bar.is-new b { animation: none; }
  .pc-bar { transition: none; }
}

/* phones: the total pinned to the bottom from the first number to set until
   the sum itself is on screen (js/calc.js decides when) */
.pc-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--polar-night); color: #fff; cursor: pointer;
  border-top: 2px solid transparent; border-image: var(--pc-edge) 1; transform: translateY(110%); transition: transform .25s var(--ease-out); }
.pc-bar.on { transform: none; }
.pc-bar > span:first-child { font-size: 14px; color: var(--on-dark-muted); }
.pc-bar-v { font-size: 14px; color: var(--on-dark-muted); white-space: nowrap; }
.pc-bar b { font-family: var(--display); font-size: 24px; font-weight: 400; line-height: 1; color: #fff; }
@media (min-width: 900px) { .pc-bar { display: none; } }

@media (min-width: 640px) {
  /* the week sits where the steppers sit, lined up with their right edge */
  .ps .ps-total { display: contents; }
  /* every control in one right-hand column, as wide as the week */
  .pcsum .pc-field { grid-template-columns: minmax(0, 1fr) 332px; }
  .pc-sess .pc-own { grid-column: 2; }
  .pw { grid-template-columns: repeat(7, 44px); }
  .pw-count { grid-column: 1 / -1; justify-self: end; margin-top: 6px; }
}
@media (min-width: 900px) {
  .pw-day { height: 44px; }
  .seg { min-height: 56px; }
  .seg b, .seg-other.has-n b { font-size: 22px; }
  .seg-other:not(.has-n) b { font-size: var(--fs-sub); }
  .ps b { font-size: 28px; }
  .ps-q b { font-size: var(--fs-large); }
  .ps-total b { font-size: 56px; }
}

/* ==========================================================================
   Site style (Nov 2026): the controls use the same language as the rest of
   the site. Resting: white with a hairline and the control shadow. Chosen:
   a light Signal Blue tint with a Signal Blue edge, the shared chosen look.
   No solid Polar Night blocks on the light side; Polar Night is the result box.
   ========================================================================== */
.pc-mode span, .seg, .pw-day, .pc-btn, .pc-num { border-color: var(--line-strong); box-shadow: var(--shadow-control);
  transition: background-color .15s var(--ease-out), border-color .15s var(--ease-out), color .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.pc-num { box-shadow: none; }
.pc-step { box-shadow: var(--shadow-control); }
.pc-step .pc-btn { box-shadow: none; }
.pc-mode span:hover, .seg:hover, .pw-day:hover { border-color: var(--signal-blue); }
.pc-mode input:checked + span, .seg[aria-pressed="true"], .pw-day[aria-pressed="true"] {
  background: var(--chosen-bg); border-color: var(--signal-blue); color: var(--deep-blue);
  box-shadow: inset 0 0 0 1px var(--signal-blue); }
.seg[aria-pressed="true"] span { color: var(--signal-blue); }
/* a day you are closed reads as off, not just as a different box */
.pw-day[aria-pressed="false"] { color: var(--silver-dark); font-weight: 400; }
.pc-btn { color: var(--signal-blue); }
.pc-btn:active { background: var(--signal-blue); border-color: var(--signal-blue); color: #fff; }
.pc-num:focus-within { border-color: var(--signal-blue); box-shadow: inset 0 0 0 1px var(--signal-blue); }
@media (prefers-reduced-motion: reduce) { .pc-mode span, .seg, .pw-day, .pc-btn, .pc-num { transition: none; } }

/* labels that need two lines break between words, never inside one */
.pc-mode label { display: grid; }   /* both halves stand the same height when one wraps */
.pc-mode span { hyphens: manual; text-wrap: balance; }
.seg span { white-space: normal; text-wrap: balance; text-align: center; }

/* even spacing between the rows instead of stretching them to the result box */
.pc-in, .pc-group { gap: 28px; }
@media (min-width: 640px) {
  /* "How you charge for it" sits in the label column like every other row */
  .pc-mode { grid-template-columns: minmax(0, 1fr) 166px 166px; column-gap: 0; align-items: stretch; }
  .pc-mode legend { float: left; grid-column: 1; align-self: center; margin: 0; padding-right: 16px; }
}
@media (min-width: 900px) {
  .pc { align-items: start; }
  .pc-in { grid-template-rows: none; gap: 28px; }
  .pc-group, .pc-group[data-model="membership"] { gap: 28px; align-content: start; }
}

/* ==========================================================================
   Desktop layout (Nov 2026). Label-left rows put a fixed 332px column of
   controls in the middle of a wide screen: big gaps on both sides of it,
   labels that wrapped inside it, and rows shorter than the result box. Now
   every size uses the phone's order, the label over its control, and the
   controls fill the inputs column, which takes the larger share of the row.
   ========================================================================== */
@media (min-width: 640px) {
  .pc-field, .pcsum .pc-field { grid-template-columns: minmax(0, 1fr); column-gap: 0; }
  .pc-lab { margin: 0 0 8px; }
  .pc-sess .pc-own { grid-column: 1; }
  .pw { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .pw-count { justify-self: start; }
  .pc-mode { grid-template-columns: 1fr 1fr; align-items: stretch; }
  .pc-mode legend { float: none; grid-column: 1 / -1; align-self: auto; margin: 0 0 8px; padding: 0; }
  .pc-mode label + label span { border-left: 0; }
}
@media (min-width: 900px) {
  .pc { grid-template-columns: minmax(0, 7fr) minmax(340px, 5fr); gap: 64px; align-items: start; }
  .pc-in, .pc-group, .pc-group[data-model="membership"] { gap: 24px; }
  .seg { min-height: 64px; }
  .pw-day { height: 48px; }
  .pc-out { padding: 30px 32px 28px; }
}
