/* Colors come from DESIGN.md. Everything else is a token below; no literal
   spacing in rules. */
/* Mona Sans draws its tabular zeros dotted, so figures stay proportional. */
:root {
  --navy-900: #0B1D3A;
  --navy-700: #1E4E86;
  --blue-500: #3D7CC4;
  --blue-200: #9EC4E8;
  --orange-500: #FF6B1A;
  --orange-600: #E85F13;
  --paper: #FFFFFF;
  --mist: #F6F8FB;
  --rule: #DDE4EC;
  --slate: #6E7C90;
  --body-ink: #3B4759;
  --error: #B42318;

  --font: 'Mona Sans', 'Helvetica Neue', Arial, sans-serif;

  /* Fixed rem scale, ratio ~1.2 */
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.375rem;
  --text-xl: 2rem;
  --text-2xl: 2.5rem;
  --text-hero: 2.75rem;

  --space-3xs: 2px;
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-pill: 999px;

  --content-width: 1440px;
  --inputs-width: 600px;
  --input-width: 7.5rem;
  --funnel-height: 100px;
  --answer-width: 54rem;
  --readout-min-height: 3.2em;
  --input-pad-prefix: 1.7em;
  --input-pad-suffix: 2.8em;
  --input-inset: 0.75em;
  --login-width: 32rem;
  --text-display: 3.5rem;
  --mark-cell: 0.625rem;
  --grid-step: 48px;
  --grid-line: rgb(158 196 232 / 0.06);
  --visual-height: 150px;
  --tracker-width: 640px;
  --rate-width: 13rem;
  --step-size: 2.5rem;
  --count-width: 5.5rem;
  --revenue-width: 20rem;

  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: 1.55;
  color: var(--body-ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* hidden always wins over a component's display. */
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Top bar: slim, so the whole tool still fits one screen ── */

.topbar {
  background: var(--navy-900);
}

.topbar-inner {
  max-width: var(--content-width);
  margin-inline: auto;
  padding: var(--space-sm) var(--space-lg);
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}

.topbar-brand {
  margin: 0;
  padding-right: var(--space-sm);
  border-right: 1px solid var(--navy-700);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--blue-200);
}

h1 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 800;
  font-stretch: 118%;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--paper);
}

/* Pages behind sign-in stay blank until the session is confirmed. */
.auth-pending body {
  visibility: hidden;
}

.nav {
  display: flex;
  gap: var(--space-2xs);
  margin-left: var(--space-lg);
  align-self: center;
}

.nav a {
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--blue-200);
  text-decoration: none;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.nav a:hover {
  color: var(--paper);
  background: var(--navy-700);
}

.nav a[aria-current="page"] {
  color: var(--navy-900);
  background: var(--paper);
}

.nav a:focus-visible,
.sign-out:focus-visible {
  outline: 2px solid var(--blue-200);
  outline-offset: var(--space-3xs);
}

.user {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-left: auto;
  align-self: center;
  font-size: var(--text-sm);
  color: var(--blue-200);
}

.user-avatar {
  width: var(--space-lg);
  height: var(--space-lg);
  border-radius: 50%;
}

.user-name {
  color: var(--paper);
  font-weight: 600;
}

.sign-out {
  padding: var(--space-3xs) var(--space-xs);
  background: transparent;
  color: var(--blue-200);
  border: 1px solid var(--navy-700);
  border-radius: var(--radius-sm);
  font: inherit;
  cursor: pointer;
  transition: color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

.sign-out:hover {
  color: var(--paper);
  border-color: var(--blue-200);
}

/* ── Layout ───────────────────────────────────────────── */

.layout {
  max-width: var(--content-width);
  margin-inline: auto;
  padding: var(--space-lg) var(--space-lg) var(--space-2xs);
  display: grid;
  grid-template-columns: var(--inputs-width) minmax(0, 1fr);
  align-items: start;
  gap: var(--space-lg);
}

/* ── Inputs ───────────────────────────────────────────── */

.inputs {
  background: var(--mist);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-lg);
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

fieldset + fieldset {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--rule);
}

/* Floated so the legend sits inside the fieldset, below its top rule. */
legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: var(--space-xs);
  font-size: var(--text-md);
  font-weight: 700;
  font-stretch: 110%;
  line-height: 1.2;
  color: var(--navy-900);
}

/* Label and hint on the left, the input on the right: one row per field. */
.field {
  clear: both;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--input-width);
  grid-template-areas:
    "label input"
    "hint  input"
    "error error";
  column-gap: var(--space-sm);
  align-items: center;
}

.field + .field {
  margin-top: var(--space-xs);
}

.field label {
  grid-area: label;
  align-self: end;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.3;
  color: var(--navy-900);
}

.hint {
  grid-area: hint;
  align-self: start;
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--body-ink);
}

.input-unit {
  grid-area: input;
  position: relative;
  display: flex;
  align-items: center;
}

.input-unit input {
  width: 100%;
  padding-block: var(--space-2xs);
  padding-inline: var(--input-inset);
  background: var(--paper);
  color: var(--navy-900);
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}

.input-unit--prefix input {
  padding-left: var(--input-pad-prefix);
}

.input-unit--suffix input {
  padding-right: var(--input-pad-suffix);
}

.input-unit input:hover {
  border-color: var(--navy-700);
}

.input-unit input:focus-visible {
  outline: none;
  border-color: var(--navy-900);
  box-shadow: 0 0 0 var(--space-3xs) var(--navy-900);
}

.input-unit .unit {
  position: absolute;
  pointer-events: none;
  color: var(--body-ink);
}

.input-unit--prefix .unit {
  left: var(--input-inset);
}

.input-unit--suffix .unit {
  right: var(--input-inset);
}

input[aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: 0 0 0 1px var(--error);
}

.field-error {
  grid-area: error;
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--error);
}

.field-error:not(:empty) {
  margin-top: var(--space-2xs);
}

.capacity-note {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--error);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.form-actions button {
  padding: var(--space-xs) var(--space-sm);
  white-space: nowrap;
  background: transparent;
  color: var(--navy-900);
  border: 1px solid var(--navy-900);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.form-actions button:hover {
  background: var(--navy-900);
  color: var(--paper);
}

.form-actions button:active {
  background: var(--navy-700);
}

.form-actions button:focus-visible {
  outline: 2px solid var(--navy-900);
  outline-offset: var(--space-3xs);
}

.copy-status {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--navy-900);
}

/* ── Answer ───────────────────────────────────────────── */

.answer {
  max-width: var(--answer-width);
}

.status {
  margin: 0;
  max-width: 40ch;
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.35;
  color: var(--navy-900);
  text-wrap: pretty;
}

.answer-line {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 500;
  font-stretch: 110%;
  line-height: 1.3;
  color: var(--navy-900);
  text-wrap: balance;
}

.fig,
.answer-detail output {
  font-weight: 700;
  color: var(--navy-900);
}

.fig--key {
  display: block;
  width: fit-content;
  margin-block: var(--space-2xs) var(--space-xs);
  font-size: var(--text-hero);
  line-height: 1.05;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: var(--orange-500);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.16em;
}

.answer-reps {
  margin: var(--space-xs) 0 0;
  font-size: var(--text-lg);
  line-height: 1.35;
  color: var(--navy-900);
}

.fig--reps {
  font-weight: 800;
  white-space: nowrap;
}

.answer-reps--pending {
  font-weight: 500;
  color: var(--body-ink);
}

.answer-detail {
  margin: var(--space-xs) 0 0;
  max-width: 65ch;
  text-wrap: pretty;
}

/* ── Funnel (after bklit's funnel chart: curved segments,
      halo rings, banded columns) ────────────────────── */

.funnel-figure {
  margin: var(--space-lg) 0 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.funnel {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: auto auto var(--funnel-height) auto auto;
}

/* Subgrid keeps values, shapes and labels on shared rows across stages. */
.stage {
  display: grid;
  grid-row: span 5;
  grid-template-rows: subgrid;
  justify-items: center;
  padding-block: var(--space-md);
  text-align: center;
  outline: none;
  cursor: default;
}

.stage:nth-child(odd) {
  background: var(--mist);
}

.stage + .stage {
  border-left: 1px solid var(--rule);
}

.stage-value {
  font-size: var(--text-md);
  font-weight: 800;
  font-stretch: 105%;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--navy-900);
}

.stage-label {
  margin-top: var(--space-2xs);
  padding-inline: var(--space-2xs);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.25;
  color: var(--body-ink);
}

.stage-flag {
  margin-top: var(--space-2xs);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--navy-900);
  visibility: hidden;
}

.is-weakest .stage-flag {
  visibility: visible;
}

.stage-shape {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--navy-700);
}

.stage-shape svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transition: opacity 150ms var(--ease-out);
}

.ring {
  fill: currentColor;
  transform-box: fill-box;
  transform-origin: center;
  transition: d 240ms var(--ease-out), transform 240ms var(--ease-out-expo), fill 150ms var(--ease-out);
}

.ring-0 { opacity: 0.18; }
.ring-1 { opacity: 0.5; }
.ring-2 { opacity: 1; }

.is-weakest .stage-shape {
  color: var(--orange-500);
}

.pill {
  position: relative;
  padding: var(--space-3xs) var(--space-xs);
  border-radius: var(--radius-pill);
  background: var(--navy-900);
  color: var(--paper);
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 0 0 var(--space-3xs) var(--paper);
}

.pill:empty {
  display: none;
}

.is-weakest .pill {
  background: var(--orange-500);
  color: var(--navy-900);
}

/* A step not yet filled in: a quiet silhouette of what is to come. */
.stage:not(.is-filled) .stage-shape {
  color: var(--rule);
}

.stage:not(.is-filled) .ring-2 {
  opacity: 0.9;
}

.stage:not(.is-known) .stage-value {
  color: var(--slate);
}

/* Hover or focus a known stage: it lifts its halo, the others step back. */
.funnel:has(.stage.is-known:is(:hover, :focus-visible)) .stage:not(:hover, :focus-visible) .stage-shape svg {
  opacity: 0.4;
}

.stage.is-known:is(:hover, :focus-visible) .ring-0 { transform: scaleY(1.12); }
.stage.is-known:is(:hover, :focus-visible) .ring-1 { transform: scaleY(1.06); }

.stage:focus-visible {
  outline: 2px solid var(--navy-900);
  outline-offset: calc(-1 * var(--space-3xs));
}

.stage:focus-visible .stage-label {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  color: var(--navy-900);
}

.funnel-foot {
  display: flex;
  align-items: baseline;
  gap: var(--space-lg);
  min-height: var(--readout-min-height);
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--rule);
}

.readout {
  flex: 1;
  margin: 0;
  font-size: var(--text-sm);
  color: var(--navy-900);
}

.funnel-note {
  font-size: var(--text-xs);
  color: var(--body-ink);
  white-space: nowrap;
}

/* A segment grows in from the left the moment its number arrives.
   The silhouette is already visible, so a paused animation never hides it. */
@keyframes segment-in {
  from {
    transform: scaleX(0.2);
    opacity: 0.3;
  }
}

.stage.is-entering .stage-shape svg {
  transform-origin: left center;
  animation: segment-in 560ms var(--ease-out-expo) backwards;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation: none !important;
  }
}

/* ── Plan and this month, side by side ──────────────── */

.input-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.input-col + .input-col {
  padding-left: var(--space-lg);
  border-left: 1px solid var(--rule);
}

.col-title {
  margin: 0 0 var(--space-xs);
  font-size: var(--text-lg);
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1.2;
  color: var(--navy-900);
}

.month-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs) var(--space-sm);
  margin-bottom: var(--space-xs);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--rule);
}

.month-bar label {
  font-size: var(--text-md);
  font-weight: 800;
  font-stretch: 112%;
  color: var(--navy-900);
}

.month-bar .month-input {
  width: auto;
}

.month-days {
  font-size: var(--text-sm);
  color: var(--body-ink);
}

.plan-sync {
  margin-left: auto;
  white-space: nowrap;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--body-ink);
}

.month-bar .field-error {
  flex-basis: 100%;
}

.col-month {
  font-size: var(--text-sm);
  font-weight: 600;
  font-stretch: 100%;
  color: var(--body-ink);
}

/* Two columns leave no room for hints; screen readers still get them. */
.input-cols .hint {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.input-cols .field label {
  grid-row: 1 / 3;
  align-self: center;
}

.input-cols .input-unit input {
  font-size: var(--text-sm);
}

.input-cols .field + .field {
  margin-top: var(--space-2xs);
}

.month-input {
  grid-area: input;
  width: 100%;
  padding: var(--space-2xs) var(--space-xs);
  background: var(--paper);
  color: var(--navy-900);
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
}

.month-input:hover {
  border-color: var(--navy-700);
}

.month-input:focus-visible {
  outline: none;
  border-color: var(--navy-900);
  box-shadow: 0 0 0 var(--space-3xs) var(--navy-900);
}

.actual-status {
  margin: var(--space-xs) 0 0;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--body-ink);
}

.actual-status:empty {
  display: none;
}

.verdict {
  display: inline-block;
  margin-right: var(--space-xs);
  padding: var(--space-3xs) var(--space-sm);
  border-radius: var(--radius-pill);
  background: var(--navy-900);
  color: var(--paper);
  font-size: var(--text-sm);
  font-weight: 700;
  vertical-align: middle;
}

.verdict--behind {
  background: var(--orange-500);
  color: var(--navy-900);
}

#versus-line,
#detail-line {
  margin-top: var(--space-2xs);
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--body-ink);
}

.stage-plan {
  padding-inline: var(--space-2xs);
  font-size: var(--text-xs);
  line-height: 1.3;
  color: var(--body-ink);
}

.plan-outline {
  fill: none;
  stroke: var(--navy-900);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
  transition: d 240ms var(--ease-out);
}

.funnel:not(.is-compare) .plan-outline {
  display: none;
}

.key {
  display: inline-block;
  width: 1.4em;
  height: 0.7em;
  margin: 0 var(--space-2xs) 0 var(--space-xs);
  border-radius: var(--radius-sm);
}

.key--actual {
  background: var(--navy-700);
}

.key--plan {
  border: 1.5px dashed var(--navy-900);
}

/* ── The one call to action per page ─────────────────── */

.cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  background: var(--orange-500);
  color: var(--navy-900);
  border: 0;
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out), transform 120ms var(--ease-out);
}

.cta:hover {
  background: var(--orange-600);
}

.cta:active {
  transform: scale(0.97);
}

.cta:focus-visible {
  outline: 2px solid var(--navy-900);
  outline-offset: var(--space-3xs);
}

.cta:disabled {
  background: var(--rule);
  color: var(--body-ink);
  cursor: not-allowed;
  transform: none;
}

/* ── Login ─────────────────────────────────────────────
   Navy ground ruled like calibration paper; the product's own funnel,
   worked on an example month, is the imagery. */

.login {
  min-height: 100vh;
  display: grid;
  background-color: var(--navy-900);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-step) var(--grid-step);
  background-position: center;
  color: var(--paper);
}

.login-shell {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding: var(--space-xl);
  display: grid;
  grid-template-columns: minmax(0, var(--login-width)) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2xl);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--blue-200);
}

/* The four-square mark: three blues deepening, one orange result. */
.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, var(--mark-cell));
  gap: var(--space-3xs);
}

.brand-mark i {
  width: var(--mark-cell);
  height: var(--mark-cell);
  border-radius: 17%;
  background: var(--blue-500);
}

.brand-mark i:nth-child(2) { background: var(--navy-700); }
.brand-mark i:nth-child(3) { background: var(--blue-200); }
.brand-mark i:nth-child(4) { background: var(--orange-500); }

.login-title {
  margin: var(--space-lg) 0 var(--space-md);
  font-size: var(--text-display);
  font-weight: 800;
  font-stretch: 118%;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--paper);
  text-wrap: balance;
}

.login-lede {
  margin: 0 0 var(--space-xl);
  max-width: 38ch;
  font-size: var(--text-lg);
  line-height: 1.4;
  color: var(--blue-200);
  text-wrap: pretty;
}

.google-button {
  padding: var(--space-md) var(--space-lg);
  font-size: var(--text-md);
}

.google-mark {
  width: var(--text-lg);
  height: var(--text-lg);
  padding: var(--space-3xs);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.login-note {
  margin: var(--space-sm) 0 0;
  font-size: var(--text-sm);
  color: var(--blue-200);
}

.login-error {
  margin: var(--space-md) 0 0;
  max-width: 48ch;
  font-weight: 600;
  color: var(--paper);
}

.login-error:not(:empty)::before {
  content: "! ";
  color: var(--orange-500);
}

/* Entrance: the text settles in, then the funnel draws left to right. */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(var(--space-sm));
  }
}

.login-panel > * {
  animation: rise-in 700ms var(--ease-out-expo) backwards;
}

.login-panel > :nth-child(2) { animation-delay: 60ms; }
.login-panel > :nth-child(3) { animation-delay: 120ms; }
.login-panel > :nth-child(4) { animation-delay: 180ms; }
.login-panel > :nth-child(5) { animation-delay: 220ms; }

.login-visual {
  margin: 0;
  padding: var(--space-lg);
  border: 1px solid var(--navy-700);
  border-radius: var(--radius-md);
  background: var(--navy-900);
  animation: rise-in 800ms 120ms var(--ease-out-expo) backwards;
}

.visual-caption {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--blue-200);
}

.visual-funnel {
  list-style: none;
  margin: var(--space-md) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: auto auto var(--visual-height) auto;
}

.visual-stage {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  justify-items: center;
  text-align: center;
}

.visual-stage + .visual-stage {
  border-left: 1px solid var(--navy-700);
}

.visual-value {
  font-size: var(--text-lg);
  font-weight: 800;
  font-stretch: 108%;
  line-height: 1.1;
  color: var(--paper);
}

.visual-step {
  min-height: 2.6em;
  padding: var(--space-3xs) var(--space-2xs) 0;
  font-size: var(--text-xs);
  line-height: 1.3;
  color: var(--blue-200);
}

.visual-shape {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--blue-500);
}

.visual-shape svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform-origin: left center;
  animation: draw-in 900ms calc(250ms + var(--i) * 140ms) var(--ease-out-expo) backwards;
}

.visual-stage:first-child .visual-shape {
  color: var(--blue-200);
}

@keyframes draw-in {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

.visual-pill {
  position: relative;
  padding: var(--space-3xs) var(--space-xs);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--navy-900);
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 0 0 var(--space-3xs) var(--navy-900);
  animation: rise-in 500ms calc(700ms + var(--i) * 140ms) var(--ease-out-expo) backwards;
}

.visual-label {
  padding-top: var(--space-xs);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--paper);
}

.visual-answer {
  margin: var(--space-lg) 0 0;
  padding-top: var(--space-md);
  border-top: 1px solid var(--navy-700);
  font-size: var(--text-lg);
  color: var(--blue-200);
}

.visual-answer-fig {
  font-size: var(--text-xl);
  font-weight: 800;
  font-stretch: 112%;
  color: var(--paper);
  text-decoration: underline;
  text-decoration-color: var(--orange-500);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.16em;
}

/* ── Daily tracker ───────────────────────────────────── */

.tracker {
  grid-template-columns: var(--tracker-width) minmax(0, 1fr);
}

.day-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--rule);
}

.day-head .col-title {
  margin: 0;
}

.day-note {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--body-ink);
}

.unfinished {
  margin: var(--space-sm) 0 0;
  padding: var(--space-xs) var(--space-sm);
  background: var(--paper);
  border: 1px solid var(--navy-900);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--navy-900);
}

.counters {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Name and target, the stepper, then the rate: one row per stage. */
.counter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto var(--rate-width);
  align-items: center;
  column-gap: var(--space-md);
  padding-block: var(--space-2xs);
}

.counter + .counter {
  border-top: 1px solid var(--rule);
}

.counter-head {
  display: flex;
  flex-direction: column;
}

.counter-name {
  font-weight: 700;
  font-stretch: 108%;
  color: var(--navy-900);
}

.counter-target {
  font-size: var(--text-xs);
  color: var(--body-ink);
}

.stepper {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.step {
  width: var(--step-size);
  height: var(--step-size);
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--paper);
  color: var(--navy-900);
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 120ms var(--ease-out), border-color 120ms var(--ease-out), transform 100ms var(--ease-out);
}

.step[data-step="1"] {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: var(--paper);
}

.step:hover {
  border-color: var(--navy-700);
}

.step[data-step="1"]:hover {
  background: var(--navy-700);
}

.step:active {
  transform: scale(0.92);
}

.step:focus-visible {
  outline: 2px solid var(--navy-900);
  outline-offset: var(--space-3xs);
}

.step:disabled {
  color: var(--rule);
  border-color: var(--rule);
  cursor: default;
  transform: none;
}

.count {
  width: var(--count-width);
  height: var(--step-size);
  padding: 0 var(--space-2xs);
  background: transparent;
  color: var(--navy-900);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--text-xl);
  font-weight: 800;
  font-stretch: 105%;
  text-align: center;
}

.count:hover {
  border-color: var(--rule);
}

.count:focus-visible {
  outline: none;
  background: var(--paper);
  border-color: var(--navy-900);
  box-shadow: 0 0 0 var(--space-3xs) var(--navy-900);
}

/* A tap nudges the number, so a count that landed is felt, not hunted for. */
@keyframes bump {
  40% { transform: scale(1.12); }
}

.bumped .count {
  animation: bump 180ms var(--ease-out);
}

.counter-rate {
  margin: 0;
  font-size: var(--text-xs);
  line-height: 1.35;
  color: var(--body-ink);
}

.mark {
  font-weight: 700;
  white-space: nowrap;
}

.counter-rate .mark {
  display: block;
}

.mark--ahead {
  color: var(--navy-700);
}

.mark--behind {
  color: var(--error);
}

.day-extras {
  max-width: var(--revenue-width);
}

.day-extras .field {
  grid-template-areas:
    "label label"
    "input input"
    "hint  hint"
    "error error";
  grid-template-columns: 1fr;
  row-gap: var(--space-2xs);
}

.day-extras .field + .field {
  margin-top: 0;
}


.finish-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.finish-status {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--navy-900);
}

.day-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: var(--answer-width);
}

.dial-progress-line {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}

.dial-progress-line .fig--key {
  margin: 0;
}

.dial-progress-of {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--body-ink);
}

.meter {
  height: var(--space-sm);
  margin-top: var(--space-sm);
  background: var(--mist);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.meter-fill {
  display: block;
  height: 100%;
  background: var(--navy-700);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 240ms var(--ease-out-expo);
}

.meter.is-met .meter-fill {
  background: var(--navy-900);
}

/* The saved day presses onto the page like an inspection stamp. */
.stamp-slot:empty {
  display: none;
}

.stamp {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: var(--space-md);
  align-items: center;
  width: fit-content;
  padding: var(--space-md) var(--space-lg);
  border: 2px solid var(--navy-900);
  border-radius: var(--radius-md);
  color: var(--navy-900);
  animation: stamp-in 420ms var(--ease-out-expo) both;
}

.stamp.is-leaving {
  animation: stamp-out 420ms var(--ease-out) both;
}

.stamp-check {
  grid-row: 1 / 4;
  width: var(--text-2xl);
  height: var(--text-2xl);
  fill: none;
  stroke: var(--orange-500);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: check-draw 360ms 220ms var(--ease-out) forwards;
}

.stamp p {
  margin: 0;
}

.stamp-title {
  font-size: var(--text-lg);
  font-weight: 800;
  font-stretch: 115%;
  line-height: 1.1;
}

.stamp-day {
  font-size: var(--text-sm);
  font-weight: 600;
}

.stamp-figures {
  font-size: var(--text-sm);
  color: var(--body-ink);
}

@keyframes stamp-in {
  from {
    opacity: 0;
    transform: scale(1.18) rotate(-2deg);
    filter: blur(6px);
  }
  70% {
    opacity: 1;
    transform: scale(0.98) rotate(0.4deg);
    filter: blur(0);
  }
}

@keyframes stamp-out {
  to {
    opacity: 0;
    transform: translateY(var(--space-xs));
  }
}

@keyframes check-draw {
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .stamp-check {
    stroke-dashoffset: 0;
  }
}

.recent-title {
  margin: 0 0 var(--space-xs);
  font-size: var(--text-md);
  font-weight: 700;
  font-stretch: 110%;
  color: var(--navy-900);
}

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.recent-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-xs) var(--space-2xs);
  border-bottom: 1px solid var(--rule);
  font-size: var(--text-sm);
}

.recent-day {
  font-weight: 700;
  color: var(--navy-900);
}

.recent-row.is-new {
  animation: row-in 900ms var(--ease-out) both;
}

@keyframes row-in {
  from { background: var(--mist); }
}

.recent-empty {
  margin: var(--space-xs) 0 0;
  max-width: 50ch;
  font-size: var(--text-sm);
}

/* ── Team ────────────────────────────────────────────── */

.team {
  max-width: var(--content-width);
  margin-inline: auto;
  padding: var(--space-lg);
}

.team-head {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.team-head .col-title {
  margin: 0;
}

.period {
  display: flex;
  padding: var(--space-3xs);
  background: var(--mist);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
}

.period label {
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--body-ink);
  cursor: pointer;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.period input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.period label:hover {
  color: var(--navy-900);
}

.period label:has(input:checked) {
  background: var(--navy-900);
  color: var(--paper);
}

.period label:has(input:focus-visible) {
  outline: 2px solid var(--navy-900);
  outline-offset: var(--space-3xs);
}

.team-summary {
  margin: var(--space-md) 0 0;
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.35;
  color: var(--navy-900);
}

.team-plan {
  margin: var(--space-2xs) 0 0;
  max-width: 90ch;
  font-size: var(--text-sm);
}

.table-wrap {
  margin-top: var(--space-lg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.team-table th,
.team-table td {
  padding: var(--space-xs) var(--space-sm);
  text-align: right;
  white-space: nowrap;
}

.team-table thead th {
  background: var(--mist);
  border-bottom: 1px solid var(--rule);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--navy-900);
  vertical-align: bottom;
}

.th-plan {
  display: block;
  font-weight: 500;
  color: var(--body-ink);
}

.team-table .col-rep {
  text-align: left;
  font-weight: 700;
  color: var(--navy-900);
}

.team-table tbody tr + tr {
  border-top: 1px solid var(--rule);
}

.team-table tbody tr:hover {
  background: var(--mist);
}

.team-table .num.strong {
  font-weight: 800;
  color: var(--navy-900);
}

.team-table .muted {
  color: var(--slate);
}

.team-table td.muted:not(.num) {
  text-align: left;
}

.team-table tfoot tr {
  border-top: 2px solid var(--navy-900);
  font-weight: 700;
  color: var(--navy-900);
}

.table-note {
  margin: var(--space-sm) 0 0;
  font-size: var(--text-xs);
}

/* Opening line and pitch: picked once, kept until changed. */
.scripts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xs) var(--space-lg);
  padding-block: var(--space-sm);
  border-bottom: 1px solid var(--rule);
}

.script-pick {
  display: grid;
  gap: var(--space-2xs);
  align-content: start;
}

.script-pick label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--navy-900);
}

.script-select,
.script-name {
  width: 100%;
  padding: var(--space-2xs) var(--space-xs);
  background: var(--paper);
  color: var(--navy-900);
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}

.script-select {
  cursor: pointer;
}

.script-select:hover,
.script-name:hover {
  border-color: var(--navy-700);
}

.script-select:focus-visible,
.script-name:focus-visible {
  outline: none;
  border-color: var(--navy-900);
  box-shadow: 0 0 0 var(--space-3xs) var(--navy-900);
}

.script-add {
  display: flex;
  gap: var(--space-2xs);
}

.script-add .script-name {
  flex: 1;
  min-width: 0;
}

.script-save,
.script-cancel {
  padding: var(--space-2xs) var(--space-xs);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

.script-save {
  background: var(--navy-900);
  color: var(--paper);
  border: 1px solid var(--navy-900);
}

.script-save:hover {
  background: var(--navy-700);
}

.script-cancel {
  background: transparent;
  color: var(--navy-900);
  border: 1px solid transparent;
}

.script-cancel:hover {
  border-color: var(--rule);
}

.script-save:focus-visible,
.script-cancel:focus-visible {
  outline: 2px solid var(--navy-900);
  outline-offset: var(--space-3xs);
}

.script-error {
  grid-column: 1 / -1;
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--error);
}

.script-error:empty {
  display: none;
}

.stamp-scripts:empty {
  display: none;
}

.day-side .finish-row {
  margin-top: 0;
}

/* Right now: filled from the team's finished days, not typed. */
.input-unit input[readonly],
.input-unit input[readonly]:hover {
  background: transparent;
  border-color: var(--rule);
  cursor: default;
}

/* What works: opening lines and pitches side by side. */
.what-works {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.works-title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 700;
  font-stretch: 110%;
  color: var(--navy-900);
}

.what-works .table-wrap {
  margin-top: var(--space-xs);
}

.works-table .col-rep {
  white-space: normal;
}

.best-tag {
  display: inline-block;
  margin-left: var(--space-2xs);
  padding: 0 var(--space-xs);
  border-radius: var(--radius-sm);
  background: var(--navy-900);
  color: var(--paper);
  font-size: var(--text-xs);
  font-weight: 700;
  vertical-align: 0.1em;
}

.works-table tr.untracked th {
  font-weight: 600;
  color: var(--body-ink);
}

/* Time on dialer: typed at the end of the day, in line with the counts. */
.counter--time {
  border-top: 1px solid var(--rule);
}

.count--time {
  width: calc(2 * var(--step-size) + var(--count-width) + 2 * var(--space-2xs));
  background: var(--paper);
  border-color: var(--slate);
  font-size: var(--text-lg);
}

.count--time::placeholder {
  color: var(--slate);
}

.count--time:hover {
  border-color: var(--navy-700);
}

.counter--time .field-error {
  grid-area: auto;
  margin: 0;
}
