/* timeheat app styles. "Crisp": flat, technical, rose on warm stone.
   The token block below is a verbatim copy of design/tokens.css, enforced by
   `make check-tokens`. Edit tokens in design/tokens.json first, regenerate
   design/tokens.css, then re-copy the block here. */

/* BEGIN design tokens (verbatim copy of design/tokens.css) */
/* timeheat design tokens — "Crisp": flat, technical, rose on warm stone.
 * Generated from design-system.dc.html (the authored design system).
 * Drop into any page; components read these custom properties.
 * Light on :root; add data-theme="dark" (or "light") on any element to switch —
 * the attribute re-declares the properties, so it scopes to a subtree as
 * happily as to the document. */

:root {
  /* surfaces & lines */
  --bg: #e7e5df;            /* page background — warm stone */
  --card: #ffffff;          /* card & surface fill */
  --card-bd: #e7e5e4;       /* card / field border */
  --hair: #f0eeec;          /* hairline dividers, subtle fills */
  --field-bd: #e7e5e4;      /* form control border */

  /* text */
  --ink: #1c1917;           /* primary text, headings */
  --muted: #78716c;         /* secondary text, body copy */
  --faint: #a8a29e;         /* labels, captions, placeholders */

  /* brand — rose (per-poll overridable; derived tints re-resolve via .branded) */
  --rose: #ff0043;                                       /* accent, CTAs, fills & icons — never text */
  --rose-ink: color-mix(in srgb, var(--rose), #000 28%); /* accent text — h1, links, copy on tint */
  --rose-deep: #b80030;                                  /* band fill under white copy */
  --rose-bg: color-mix(in srgb, var(--rose) 8%, #fff);   /* tint fill */
  --rose-bd: color-mix(in srgb, var(--rose) 24%, #fff);  /* tint border */
  --pro-gold: #8a6d1a;      /* Pro badge (brightened in dark) */

  /* status & votes */
  --ok-fg: #177347;         /* success / open status */
  --ok-bg: #e7f5ed;         /* success badge fill */
  --danger: #b91c1c;        /* destructive actions, errors */
  --pick-green: #1f8a5b;    /* "my vote — free" marker */
  --pick-amber: #d99408;    /* "my vote — if need be" marker */

  /* heatmap — a scale of its own, not a tint of --rose (see ramp note below) */
  --heat-base: #e11d48;         /* the ramp all cells mix from */
  --heat-full: #ff0043;         /* all-free slot fill */
  --heat-full-outline: #9f1239; /* landing hero variant of the all-free outline */
  --heat-maybe-tint: #fff1f2;   /* if-need-be stripe gap (opaque) */
  --heat-empty: #f1efed;        /* empty / zero-overlap slot */
  --heat-strong: #1c1917;       /* peak-overlap outline */
  --heat-lo-fg: #7f0f2e;        /* low-count cell text */

  /* axes */
  --axis-hour: #44403c;     /* hour axis labels */
  --axis-sub: #cdc8c3;      /* half-hour / past labels */

  /* type — Archivo for everything, mono for machine values ONLY */
  --font: 'Archivo', sans-serif;
  --mono: 'JetBrains Mono', monospace; /* hex, time-zone codes, spec — never times or labels */
  --fs-display: 50px;       /* 700 / -.03em */
  --fs-h2: 32px;            /* 700 / -.02em */
  --fs-h3: 18px;            /* 600 / -.02em */
  --fs-body: 15px;          /* 400 / 1.5 */
  --fs-small: 12px;         /* 400 */
  --ls-display: -.03em;
  --ls-tight: -.02em;       /* h1/h2/h3 default */
  --ls-label: .1em;         /* uppercase labels */
  --ls-eyebrow: .14em;      /* section kickers */
  --ls-wordmark: .16em;     /* TIMEHEAT wordmark */

  /* radius — 8px is the default; 4px only on dense cells, 12px only on floating surfaces */
  --radius-sm: 4px;         /* heat cells, calendar days, badges & chips */
  --radius: 8px;            /* buttons, inputs, cards, banners */
  --radius-lg: 12px;        /* modals, popovers, hero surfaces */
  --radius-pill: 999px;     /* pills & avatars */

  /* elevation — one soft card shadow, deeper shadows only for floating layers */
  --shadow: 0 1px 3px rgba(0, 0, 0, .06);
  --shadow-pop: 0 6px 20px rgba(0, 0, 0, .12);
  --shadow-modal: 0 20px 60px rgba(0, 0, 0, .28);

  /* spacing rhythm — control padding is component-intrinsic and off-scale */
  --sp-1: 6px;              /* icon / inline gaps */
  --sp-2: 12px;             /* internal small component gaps */
  --sp-3: 20px;             /* standard gap between elements */
  --sp-4: 32px;             /* between blocks / cards, also inner card padding */
  --sp-5: 44px;             /* section gaps */
  --sp-6: 64px;             /* page section gaps */
  --gutter-dense: 4px;      /* dense grid gutter */
  --nav-h: 63px;            /* sticky top-bar height; sticky offsets key off it */
}

/* Light re-declared in full so a subtree can force it inside an otherwise dark
 * page — a 1:1 copy of :root, matching the design system. */
[data-theme="light"] {
  --bg: #e7e5df;
  --card: #ffffff;
  --card-bd: #e7e5e4;
  --hair: #f0eeec;
  --field-bd: #e7e5e4;
  --ink: #1c1917;
  --muted: #78716c;
  --faint: #a8a29e;
  --rose: #ff0043;
  --rose-ink: color-mix(in srgb, var(--rose), #000 28%);
  --rose-deep: #b80030;
  --rose-bg: color-mix(in srgb, var(--rose) 8%, #fff);
  --rose-bd: color-mix(in srgb, var(--rose) 24%, #fff);
  --pro-gold: #8a6d1a;
  --ok-fg: #177347;
  --ok-bg: #e7f5ed;
  --danger: #b91c1c;
  --pick-green: #1f8a5b;
  --pick-amber: #d99408;
  --heat-base: #e11d48;
  --heat-full: #ff0043;
  --heat-full-outline: #9f1239;
  --heat-maybe-tint: #fff1f2;
  --heat-empty: #f1efed;
  --heat-strong: #1c1917;
  --heat-lo-fg: #7f0f2e;
  --axis-hour: #44403c;
  --axis-sub: #cdc8c3;
  --font: 'Archivo', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --fs-display: 50px;
  --fs-h2: 32px;
  --fs-h3: 18px;
  --fs-body: 15px;
  --fs-small: 12px;
  --ls-display: -.03em;
  --ls-tight: -.02em;
  --ls-label: .1em;
  --ls-eyebrow: .14em;
  --ls-wordmark: .16em;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06);
  --shadow-pop: 0 6px 20px rgba(0, 0, 0, .12);
  --shadow-modal: 0 20px 60px rgba(0, 0, 0, .28);
  --sp-1: 6px;
  --sp-2: 12px;
  --sp-3: 20px;
  --sp-4: 32px;
  --sp-5: 44px;
  --sp-6: 64px;
  --gutter-dense: 4px;
  --nav-h: 63px;
}

/* Dark is a sibling color set, not a filter. Only color takes a second value —
 * type, spacing, radius and elevation geometry are theme-invariant, and so are
 * --rose, --rose-deep and the fixed heat anchors. */
[data-theme="dark"] {
  --bg: #0f0d0c;
  --card: #1a1715;
  --card-bd: #2a2522;
  --hair: #272320;
  --field-bd: #2a2522;
  --ink: #f5f3f1;
  --muted: #9a928b;
  --faint: #8c837b;         /* raised for WCAG AA on the dark card */
  --rose-ink: #ffc2ce;      /* the light rose-ink is unreadable on the dark card */
  --rose-bg: color-mix(in srgb, var(--rose) 14%, #1a1715);
  --rose-bd: color-mix(in srgb, var(--rose) 30%, #1a1715);
  --pro-gold: #d4a72c;      /* light gold is illegible on the dark card */
  --ok-fg: #3ecf8e;
  --ok-bg: color-mix(in srgb, #3ecf8e 16%, #1a1715);
  --danger: #f87171;
  --pick-green: #3ecf8e;    /* brightened to stay legible on rose heat */
  --pick-amber: #f5b62e;
  --heat-maybe-tint: #272320;
  --heat-empty: #272320;
  --heat-strong: #f5f3f1;
  --heat-lo-fg: #ffc2ce;
  --axis-hour: #9a928b;
  --axis-sub: #8c837b;      /* AA-legible on dark */
  --shadow: 0 1px 3px rgba(0, 0, 0, .3);
}

/* ---------------------------------------------------------------------------
 * Branding — a Pro poll sets exactly ONE token, --rose, on a .branded scope;
 * every accent and the whole heat ramp re-resolve from it, so a branded poll
 * reads as one palette instead of a customer button next to a timeheat
 * heatmap. Unbranded values are hand-tuned literals; branding substitutes the
 * closest derived analogue. Neutrals, --heat-strong, --heat-empty and both
 * axis tiers are never brand-dependent.
 * ------------------------------------------------------------------------- */
.branded {
  --rose-ink: color-mix(in srgb, var(--rose), #000 28%);
  --rose-deep: color-mix(in srgb, var(--rose), #000 28%);
  --rose-bg: color-mix(in srgb, var(--rose) 8%, #fff);
  --rose-bd: color-mix(in srgb, var(--rose) 24%, #fff);
  --heat-base: color-mix(in srgb, var(--rose), #000 10%);
  --heat-full: var(--rose);
  --heat-full-outline: color-mix(in srgb, var(--rose), #000 38%);
  --heat-maybe-tint: color-mix(in srgb, var(--rose) 6%, #fff);
}

[data-theme="dark"] .branded {
  --rose-ink: color-mix(in srgb, var(--rose) 28%, #fff);
  --rose-bg: color-mix(in srgb, var(--rose) 14%, var(--card));
  --rose-bd: color-mix(in srgb, var(--rose) 30%, var(--card));
  --heat-maybe-tint: color-mix(in srgb, var(--rose) 10%, var(--card));
}

/* ---------------------------------------------------------------------------
 * Heat ramp — the availability heatmap does NOT use --rose directly.
 * Cell fill:      rgba(225, 29, 72, a)   where a = 0.16 + 0.84 * (free / total)
 * Cell text:      #fff when a > 0.55, else var(--heat-lo-fg)
 * Full (all free):background var(--heat-full);
 *                 box-shadow: inset 0 0 0 2px var(--heat-strong)
 *                 (landing .hm outlines with var(--heat-full-outline) instead)
 * If-need-be:     repeating-linear-gradient(45deg,
 *                   var(--heat-base) 55% 0 3px, transparent 3px 6px)
 *                 over var(--heat-maybe-tint)
 * Legend ramp:    a = .16 / .4 / .7 / 1
 * ------------------------------------------------------------------------- */
/* END design tokens */

* { box-sizing: border-box; }
/* author display rules (.btn's inline-flex etc) must never defeat hidden */
[hidden] { display: none !important; }

/* scrollbars carry the brand: a 9px rose thumb held 4px off every edge.
   The pseudo-elements cover Chromium and Safari. Firefox has no scrollbar
   parts, so it falls back to the two standard properties, scoped away from
   Chromium because a set standard property disables the parts below. */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; }
  html { scrollbar-color: var(--rose) transparent; }
}
::-webkit-scrollbar { width: 17px; height: 17px; }
::-webkit-scrollbar-thumb {
  background: var(--rose); border-radius: var(--radius-pill);
  border: 4px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-track { background: transparent; }
/* a11y guardrail: keyboard focus shows the 2px rose ring on every interactive
   element; text fields keep the ink border treatment the system authors */
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.input:focus-visible, .dash-find input:focus-visible { outline: none; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  /* sticky footer: main grows so the footer sits at the bottom on short pages */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* width:100% so the flex item fills the row and caps at max-width, instead of
   shrinking to content (its auto side margins would otherwise collapse it,
   making the card track its content and the pick grid wobble on hover) */
main.wrap { flex: 1 0 auto; width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { letter-spacing: var(--ls-tight); margin: 0; }
/* in-app page and card titles; templates put no bare sizes on headings */
.card-title { font-size: var(--fs-h3); font-weight: 600; margin-bottom: 6px; }

/* ---------- layout ---------- */
.wrap { max-width: 680px; margin: 0 auto; padding: var(--sp-4) var(--sp-3) var(--sp-5); }
.wrap.narrow { max-width: 420px; }
.wrap.wide { max-width: min(96vw, 1100px); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-bottom: 1px solid var(--card-bd);
  background: var(--card);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 6px; }
.brand-mark { width: 18px; height: 18px; background: var(--rose); display: inline-block; }
.brand-logo { height: 18px; width: auto; max-width: 120px; display: inline-block; object-fit: contain; }
.brand-word {
  font-size: 12px; font-weight: 700; letter-spacing: var(--ls-wordmark); text-transform: uppercase;
}
.topnav { display: flex; align-items: center; gap: 10px; }
.topnav-name { font-size: 12px; font-weight: 500; color: var(--muted); }
/* centered view switch; same weight as the dashboard card heading */
.topnav-center { display: flex; align-items: center; gap: 16px; }
/* 18px (the h3 tier) on desktop, easing down as the bar tightens so the
   centered switch never runs into the buttons */
.navlink { font-size: clamp(15px, 2.2vw, 18px); font-weight: 700; letter-spacing: -0.02em; color: var(--muted); white-space: nowrap; }
.navlink:hover, .navlink.on { color: var(--ink); }
@media (min-width: 701px) {
  /* true center of the bar; below this it stays in flow so nothing overlaps */
  .topnav-center { position: absolute; left: 50%; transform: translateX(-50%); }
}

/* app footer: back to the landing (logo) + contact + legal; compact, pinned
   to the bottom via the body flex column */
.app-footer { border-top: 1px solid var(--hair); flex-shrink: 0; }
.app-footer-inner {
  max-width: 680px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap;
}
.app-footer .brand-word { color: var(--muted); }
.app-footer .brand:hover .brand-word { color: var(--ink); }
.app-footer-meta { display: flex; align-items: center; gap: 20px; font-size: var(--fs-small); flex-wrap: wrap; }
.app-footer-meta a { color: var(--muted); }
.app-footer-meta a:hover { color: var(--ink); }
.app-footer-contact { font-weight: 500; }
.app-footer-contact i { margin-right: 5px; color: var(--faint); }

/* topbar icon button (theme toggle) */
.iconbtn {
  width: 32px; height: 32px; border: 1px solid var(--field-bd); border-radius: var(--radius);
  background: var(--card); color: var(--muted); font-size: 15px; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.iconbtn:hover { color: var(--ink); }

.credits-chip {
  font-size: var(--fs-small); font-weight: 600; color: var(--rose-ink); background: var(--rose-bg);
  border: 1px solid var(--rose-bd); border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
/* create-form tier banner: what this poll will be, with an upgrade CTA */
.tier-note {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: var(--fs-body); color: var(--ink); background: var(--bg);
  border: 1px solid var(--hair); border-radius: var(--radius); padding: 12px 16px; margin-bottom: var(--sp-3);
}
.tier-note strong { font-size: var(--fs-h3); }
.tier-note.warn { color: var(--rose-ink); background: var(--rose-bg); border-color: var(--rose-bd); }

/* user dropdown (details/summary) */
.usermenu { position: relative; }
.usermenu > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 7px;
  padding: 4px 6px; border-radius: var(--radius);
}
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover { background: var(--hair); }
.usermenu .caret { font-size: var(--fs-small); color: var(--faint); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 168px; z-index: 40;
  background: var(--card); border: 1px solid var(--card-bd); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop); padding: 6px; display: flex; flex-direction: column;
}
.menu-status {
  display: flex; flex-direction: column; gap: 1px;
  padding: 7px 11px 9px; margin-bottom: 4px; border-bottom: 1px solid var(--hair);
}
.menu-user { font-size: var(--fs-body); font-weight: 600; color: var(--ink); }
.menu-credits { font-size: var(--fs-small); color: var(--muted); }
.menu-pro {
  font-size: var(--fs-small); font-weight: 700; letter-spacing: var(--ls-label);
  text-transform: uppercase; color: var(--pro-gold);
}
.menu-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  font: inherit; font-size: var(--fs-body); color: var(--ink); padding: 9px 11px; border-radius: var(--radius-sm); cursor: pointer;
}
.menu-item:hover { background: var(--hair); }
.menu-item.danger { color: var(--danger); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: color-mix(in srgb, var(--rose) 16%, var(--card)); color: var(--rose-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-small); font-weight: 700;
}

/* language switch (EN | ES) and the theme switch in settings */
.langswitch { display: inline-flex; gap: 2px; }
.langswitch a, .langswitch button {
  font-size: var(--fs-small); font-weight: 700; letter-spacing: 0.04em; color: var(--faint);
  padding: 3px 7px; border-radius: var(--radius-sm); background: none; border: none; font-family: inherit; cursor: pointer;
}
.langswitch a:hover, .langswitch button:hover { color: var(--ink); background: var(--hair); }
.langswitch a.on, .langswitch button.on { color: var(--card); background: var(--ink); }

/* ---------- card ---------- */
.card {
  background: var(--card); border: 1px solid var(--card-bd); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: var(--sp-4);
}
.card + .card { margin-top: var(--sp-3); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.eyebrow {
  font-size: var(--fs-small); font-weight: 700; letter-spacing: var(--ls-label); color: var(--faint);
  text-transform: uppercase;
}
.subtle { color: var(--faint); font-size: var(--fs-small); margin: 4px 0 0; }
.error-body { color: var(--ink); font-size: var(--fs-body); margin: 4px 0 18px; }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--field-bd); background: var(--card); color: var(--ink);
  border-radius: var(--radius); padding: 12px 20px; font: inherit; font-size: var(--fs-body); font-weight: 600;
  cursor: pointer; text-align: center; white-space: nowrap; transition: filter .12s, background .12s;
}
.btn:hover { filter: brightness(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.btn-primary { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--card); }
.btn-primary:hover { filter: brightness(0.94); }
.btn-dark:hover { filter: brightness(1.15); }
.btn-sm { padding: 6px 12px; font-size: var(--fs-small); }
.btn-block { display: flex; width: 100%; }
.btn-danger { color: var(--danger); }
/* Sign in with Google + the "or" divider on the auth card */
.btn-google { align-items: center; justify-content: center; gap: 8px; background: var(--card); position: relative; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--faint); font-size: var(--fs-small); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--hair); }
/* "last used" pill: floats off the Google button, or sits inline on a label */
.last-used {
  position: absolute; top: -8px; right: 10px; padding: 1px 8px; border-radius: 999px;
  background: var(--rose); color: #fff; font-size: var(--fs-small); font-weight: 700;
  letter-spacing: var(--ls-label); text-transform: uppercase;
}
.last-used.inline { position: static; margin-left: 6px; vertical-align: 1px; }
/* email-first password field: animates open via grid-template-rows */
.pw-reveal {
  display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
  transition: grid-template-rows .3s ease, opacity .22s ease, visibility 0s .3s;
}
.pw-reveal-inner { overflow: hidden; min-height: 0; }
/* padding lives inside so the collapsed row is truly 0 tall */
.pw-reveal-inner .field { padding-top: 2px; }
.pw-reveal.open {
  grid-template-rows: 1fr; opacity: 1; visibility: visible;
  transition: grid-template-rows .3s ease, opacity .22s ease .08s, visibility 0s;
}
@media (prefers-reduced-motion: reduce) {
  .pw-reveal, .pw-reveal.open { transition: none; }
}
/* text-styled button (PIN resend): a link while enabled, quiet while counting down */
.resend-link { background: none; border: none; padding: 0; font: inherit; font-size: var(--fs-body); color: var(--muted); text-decoration: underline; cursor: pointer; }
.resend-link:hover { color: var(--ink); }
.resend-link:disabled { color: var(--faint); text-decoration: none; cursor: default; }
.btn-row { display: flex; gap: 8px; margin-top: 20px; }
.btn-row .btn { flex: 1; }
.linkbtn {
  background: none; border: none; color: var(--muted); font: inherit; font-size: var(--fs-small);
  cursor: pointer; padding: 0;
}
.linkbtn:hover { color: var(--ink); }

/* ---------- forms ---------- */
.field { margin-bottom: var(--sp-3); }
.label {
  display: block; font-size: var(--fs-small); font-weight: 600; letter-spacing: var(--ls-label);
  color: var(--faint); text-transform: uppercase; margin-bottom: 6px;
}
.input, select.input {
  width: 100%; border: 1px solid var(--field-bd); border-radius: var(--radius);
  padding: 11px 13px; font: inherit; font-size: var(--fs-body); color: var(--ink);
  background: var(--card); appearance: none;
}
.input:focus { outline: none; border-color: var(--ink); }
/* step-1 validation: red border on a required field left empty/zero, with a
   small legend spelling out what's missing */
.input.invalid, .input.invalid:focus, .stepper.invalid { border-color: var(--danger); }
.field-err { display: block; margin-top: 5px; font-size: var(--fs-small); font-weight: 600; color: var(--danger); }
/* native date input (response deadline): tidy the browser default so it reads
   like our other fields; keep the native single-color picker glyph, just make
   it theme-aware so it stays legible on the dark card */
.input[type="date"] { min-height: 44px; cursor: pointer; color-scheme: light; }
[data-theme="dark"] .input[type="date"] { color-scheme: dark; }
.input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.grow0 { flex: none; }

/* number stepper (duration) */
.stepper { display: flex; align-items: center; gap: 4px; border: 1px solid var(--field-bd); border-radius: var(--radius); padding: 3px 5px; }
.stepper .step-btn {
  width: 26px; height: 30px; flex: none; border: none; background: var(--hair); color: var(--ink);
  border-radius: var(--radius-sm); font-size: 15px; line-height: 1; cursor: pointer;
}
.stepper .step-btn:hover { background: var(--field-bd); }
.stepper .step-in {
  width: 34px; border: none; background: none; font: inherit; font-size: var(--fs-body); color: var(--ink);
  text-align: right; -moz-appearance: textfield; padding: 0;
}
.stepper .step-in::-webkit-outer-spin-button,
.stepper .step-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .step-u { font-size: var(--fs-small); color: var(--faint); margin-right: 2px; }

/* segmented toggle */
.seg { display: flex; border: 1px solid var(--field-bd); border-radius: var(--radius); overflow: hidden; }
.seg button {
  flex: 1; border: none; background: var(--card); color: var(--muted);
  padding: 10px; font: inherit; font-size: var(--fs-body); font-weight: 500; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--field-bd); }
.seg button.on { background: var(--ink); color: var(--card); font-weight: 600; }
.seg.rose button.on { background: var(--rose); color: #fff; }
.seg button:disabled { opacity: 0.6; cursor: not-allowed; }
.seg button.locked { background: var(--hair); }

/* checkbox row */
.check {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border-top: 1px solid var(--hair); padding-top: 16px; margin: 4px 0 18px;
}
/* same hairline the .check rows draw, for a non-checkbox row that needs
   setting off from the block above it */
.rule-top { border-top: 1px solid var(--hair); padding-top: 16px; margin-top: 4px; }
/* a checkbox living inside the field above it (the Meet toggle under the
   location input) reads as part of that field, so no separating rule */
.check.no-rule { border-top: 0; padding-top: 0; margin: 8px 0 0; }
/* hairline with the label sitting in the middle of the line */
.rule-label {
  display: flex; align-items: center; gap: 12px; margin: 4px 0 14px;
  font-size: var(--fs-small); font-weight: 600; letter-spacing: var(--ls-label);
  color: var(--faint); text-transform: uppercase;
}
.rule-label::before, .rule-label::after { content: ""; flex: 1; border-top: 1px solid var(--hair); }
.check input { display: none; }
.check .box {
  width: 18px; height: 18px; border-radius: var(--radius-sm); border: 1px solid var(--faint);
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent; font-size: 12px; font-weight: 700;
}
/* var(--card), not #fff: in dark theme --ink is near-white, so a white glyph
   would vanish inside the checked box */
.check input:checked + .box { background: var(--ink); border-color: var(--ink); color: var(--card); }
.check .txt { font-size: var(--fs-body); font-weight: 500; }
/* flexbox centers line boxes, but Archivo's cap-to-baseline band rides ~1px
   above the box's midline; nudge the label (and its trailing lock) onto the
   optical center */
.check .txt, .check .lock-ic { position: relative; top: 1px; }

/* toggle switch */
.switch { display: inline-flex; align-items: center; cursor: pointer; }
.switch input { display: none; }
.switch .track {
  width: 36px; height: 20px; border-radius: 999px; background: var(--field-bd);
  position: relative; transition: background .15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: left .15s;
}
.switch input:checked + .track { background: var(--rose); }
.switch input:checked + .track::after { left: 18px; }

/* custom-branding toggle: switch + a legend that names the active mode */
.brand-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.brand-toggle input { display: none; }
.brand-toggle .track {
  width: 36px; height: 20px; border-radius: 999px; background: var(--field-bd);
  position: relative; transition: background .15s; flex: none;
}
.brand-toggle .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: left .15s;
}
.brand-toggle input:checked + .track { background: var(--rose); }
.brand-toggle input:checked + .track::after { left: 18px; }
.brand-toggle-legend { font-size: var(--fs-body); font-weight: 600; }
.brand-toggle.locked { cursor: default; }
.brand-toggle.locked .brand-toggle-legend { color: var(--muted); }
.brand-toggle.locked .track { opacity: 0.5; }
.brand-toggle .lock-ic { color: var(--muted); }
.brand-locked-note { margin-top: 8px; font-size: var(--fs-small); }

/* ---------- pills / badges ---------- */
.badge {
  font-size: var(--fs-small); font-weight: 700; letter-spacing: var(--ls-label); text-transform: uppercase;
  border-radius: var(--radius-sm); padding: 4px 9px;
}
.badge-open { color: var(--ok-fg); background: var(--ok-bg); }
.badge-closed { color: var(--muted); background: var(--hair); }
.badge-premium { color: var(--rose-ink); background: color-mix(in srgb, var(--rose) 12%, var(--card)); }
/* ad slot: AdSense unit, or the self-promo card until adsense is configured */
.ad-slot { max-width: 720px; margin: 16px auto 0; }
.ad-promo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px;
            border: 1px dashed var(--card-bd); border-radius: var(--radius); font-size: var(--fs-body); color: var(--muted); }
.ad-promo-title { font-weight: 700; color: var(--ink); }
.ad-promo .btn { margin-left: auto; }
/* merged Pro card: crossed reference price + the monthly alternative */
/* the full-width Pro card offers both billing cadences as equal options */
.pro-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.pro-option {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--card-bd); border-radius: var(--radius); padding: 16px 14px 14px;
}
.pro-option.featured { border-color: var(--rose); }
.pro-chip {
  position: absolute; top: -12px; right: 10px; padding: 3px 10px; border-radius: 999px;
  background: var(--rose); color: #fff; font-size: var(--fs-small); font-weight: 700; letter-spacing: var(--ls-label);
}
.pro-option .btn { margin-top: auto; }
/* the unit ("per year") drops to its own line whole, never mid-phrase */
.pro-option .plan-price span { display: inline-block; white-space: nowrap; }
@media (max-width: 420px) { .pro-options { grid-template-columns: 1fr; } }
.plan-joined { font-size: var(--fs-body); font-weight: 600; color: var(--ok-fg); margin: 0; }
/* dashboard quota banner: the free tier's meter, front and center */
.quota-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--rose-ink); background: var(--rose-bg); border-color: var(--rose-bd);
  padding: 16px 20px;
}
.quota-card-text { font-size: var(--fs-body); font-weight: 500; }
.quota-card-text strong { font-size: var(--fs-h3); font-weight: 700; margin-right: 6px; }
/* 11px horizontal padding lines it up with .menu-status / .menu-item text */
.menu-quota { display: block; padding: 2px 11px 6px; font-size: var(--fs-small); color: var(--muted); }
.pill {
  font-size: 12px; font-weight: 600; color: var(--rose-ink); background: var(--rose-bg);
  border-radius: 999px; padding: 4px 11px;
}
.error {
  background: var(--rose-bg); border-left: 3px solid var(--rose); color: var(--rose-ink);
  font-size: var(--fs-small); padding: 10px 12px; margin-bottom: 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.note {
  display: flex; gap: 6px; background: var(--bg); border-left: 3px solid var(--field-bd);
  padding: 12px; font-size: var(--fs-small); line-height: 1.5; color: var(--muted);
  margin-top: var(--sp-3);
}
/* success variant: the settings panes' "Saved" confirmations */
.note-ok { border-left-color: var(--ok-fg); color: var(--ok-fg); margin: 0; }

/* ---------- auth ---------- */
.authwrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.tabs { display: flex; border-bottom: 1px solid var(--hair); margin-bottom: 22px; }
.tabs a {
  flex: 1; text-align: center; padding-bottom: 11px; margin-bottom: -1px;
  font-size: var(--fs-body); font-weight: 500; color: var(--faint);
}
.tabs a.on { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--rose); }

/* ---------- dashboard ---------- */
.poll { display: block; padding: 14px 8px; }
.dash-group .poll + .poll { border-top: 1px solid var(--hair); }
.poll:hover { background: var(--hair); }
.poll-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.poll-name { font-size: var(--fs-body); font-weight: 600; margin-bottom: 3px; }
.poll-sub { font-size: 12px; color: var(--faint); }
.poll-meta { display: flex; align-items: center; gap: 10px; margin-top: 9px; font-size: var(--fs-small); }
.role-owner { color: var(--rose-ink); font-weight: 600; }
.role-part { color: var(--faint); font-weight: 600; }

/* dashboard: the header and each status group are their own cards, so the gap
   between them reads as the boundary between sections */
#dashboard { display: flex; flex-direction: column; gap: var(--sp-3); }
.dash-header { position: sticky; top: var(--nav-h); z-index: 5; padding: var(--sp-3); }
.dash-header .card-head { margin-bottom: 12px; }
/* no search/controls under the heading (empty view): keep the title centered */
.dash-header .card-head:last-child { margin-bottom: 0; }
.dash-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.dash-jump-btn { color: var(--muted); flex: none; }
.dash-jump-btn:hover { color: var(--ink); background: var(--hair); }
.dash-find { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; }
.dash-find i { position: absolute; left: 12px; color: var(--faint); font-size: 12px; pointer-events: none; }
.dash-find input {
  width: 100%; border: 1px solid var(--field-bd); border-radius: var(--radius);
  padding: 9px 12px 9px 32px; font: inherit; font-size: var(--fs-body); color: var(--ink);
  background: var(--card); appearance: none;
}
.dash-find input:focus { outline: none; border-color: var(--ink); }
.dash-group { padding: 10px 20px 16px; }
.dash-group-head {
  display: flex; align-items: center; gap: 9px; margin-bottom: 12px;
  font-size: var(--fs-body); font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink);
}
.dash-count {
  font-size: var(--fs-small); font-weight: 700; color: var(--muted); background: var(--hair);
  border-radius: 999px; padding: 2px 9px; letter-spacing: 0;
}
/* closed polls live behind a disclosure: header only until expanded */
.dash-group-toggle {
  width: 100%; background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit;
}
.dash-group-toggle i { margin-left: auto; font-size: 12px; color: var(--faint); transition: transform 0.15s; }
.dash-group[data-collapsed] .dash-group-toggle i { transform: rotate(-90deg); }
.dash-group[data-collapsed] .dash-group-head { margin-bottom: 0; }
.dash-group[data-collapsed] .poll { display: none; }
.badge-pending { color: var(--pick-amber); background: color-mix(in srgb, var(--pick-amber) 14%, var(--card)); }
.dash-noresults { font-size: var(--fs-small); color: var(--faint); text-align: center; padding: 20px 0; }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-title { font-size: var(--fs-body); font-weight: 600; }
.cal-nav {
  width: 30px; height: 30px; border: 1px solid var(--field-bd); border-radius: var(--radius-sm);
  display: grid; place-items: center; cursor: pointer; background: var(--card); color: var(--ink);
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--gutter-dense); }
.cal-dow { text-align: center; font-size: var(--fs-small); font-weight: 600; color: var(--faint); }
.cal-day {
  height: 38px; border: 1px solid var(--field-bd); border-radius: var(--radius-sm);
  display: grid; place-items: center; font-size: var(--fs-small); cursor: pointer;
  background: var(--card); color: var(--ink); user-select: none;
}
.cal-day.blank { border-color: transparent; background: transparent; cursor: default; }
.cal-day.sel { background: var(--rose); border-color: var(--rose); color: #fff; font-weight: 600; }
/* clearer past/selectable distinction: past = muted fill + faint text */
.cal-day.past { background: var(--hair); color: var(--axis-sub); border-color: transparent; cursor: not-allowed; }

/* ---------- deadline date picker (custom single-date popover) ---------- */
/* reuses .cal-head / .cal-nav / .cal-title / .cal-grid / .cal-dow inside .dp-pop */
.dp { position: relative; }
.dp-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  text-align: left; cursor: pointer; min-height: 44px;
}
.dp-trigger .dp-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-trigger .dp-value.empty { color: var(--faint); }
.dp-trigger .dp-ic { flex: none; color: var(--muted); font-size: 14px; }
.dp-trigger[aria-expanded="true"] { border-color: var(--ink); }
.dp-pop {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: 0;
  width: 272px; max-width: 86vw; padding: 12px;
  background: var(--card); border: 1px solid var(--card-bd); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop); color-scheme: light;
}
[data-theme="dark"] .dp-pop { color-scheme: dark; }
.dp-pop.up { top: auto; bottom: calc(100% + 6px); }
.dp-pop .cal-head { margin-bottom: 10px; }
.dp-pop .cal-nav[aria-disabled="true"] { opacity: 0.3; cursor: default; pointer-events: none; }
.dp-sel { display: flex; gap: 6px; align-items: center; }
.dp-sel select {
  font: inherit; font-size: var(--fs-body); font-weight: 600; color: var(--ink);
  background: var(--card); border: 1px solid var(--field-bd); border-radius: var(--radius-sm);
  padding: 3px 4px 3px 6px; cursor: pointer;
}
.dp-day, .dp-blank { height: 32px; }
.dp-day {
  border: 1px solid transparent; border-radius: var(--radius-sm);
  display: grid; place-items: center; font-size: var(--fs-small); cursor: pointer;
  color: var(--ink); user-select: none;
}
.dp-day:not(.is-disabled):not(.is-sel):hover { background: var(--hair); }
.dp-day.is-disabled { color: var(--axis-sub); cursor: default; }
.dp-day.is-today { border-color: var(--rose); font-weight: 600; }
.dp-day.is-sel { background: var(--rose-ink); border-color: var(--rose-ink); color: #fff; font-weight: 600; }
.dp-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hair);
}
.dp-foot button {
  background: none; border: none; font: inherit; font-size: var(--fs-small); font-weight: 600;
  cursor: pointer; padding: 5px 8px; border-radius: var(--radius-sm);
}
.dp-clear { color: var(--muted); }
.dp-clear:hover { color: var(--danger); background: var(--hair); }
.dp-today { color: var(--rose-ink); }
.dp-today:hover { background: var(--rose-bg); }

/* ---------- hours editor ---------- */
/* hours step: two side-by-side containers (editor | grid), grid collapsible.
   The grid pane sticks to the top of the viewport while the left column of
   date cards scrolls, so the multi-day heatmap stays visible for painting. */
.hours-layout { display: flex; gap: 0; align-items: flex-start; }
.hours-pane { border: 1px solid var(--card-bd); border-radius: var(--radius); background: var(--card); }
.hours-left { flex: 0 0 322px; min-width: 0; padding: 14px; }
.hours-right {
  flex: 1 1 auto; min-width: 0; margin-left: 12px; padding: 10px 12px;
  position: sticky; top: calc(var(--nav-h) + 16px); align-self: flex-start;
}
.hours-layout.grid-collapsed .hours-right { display: none; }
@media (max-width: 720px) {
  .hours-layout { flex-direction: column; align-items: stretch; }
  .hours-left { flex: 1 1 auto; width: 100%; }
  /* on mobile the grid drops below the editor, so sticking to viewport top would
     leave a big blank gap while the user scrolls the editor above it */
  .hours-right { position: static; }
}

/* the chunky horizontal scroll strip that surrounds the day grid, drawn top +
   bottom of the scroller so the user can pan the heatmap from either edge */
.dg-scroller { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.dg-scroller::-webkit-scrollbar { display: none; }
.dg-navrow {
  display: flex; align-items: stretch; gap: 6px; height: 24px; margin: 6px 0;
  user-select: none;
}
.dg-navrow[hidden] { display: none; }
.dg-nav {
  flex: 0 0 34px; border: 1px solid var(--card-bd); background: var(--card);
  color: var(--ink); border-radius: var(--radius-sm); font-size: 15px; font-weight: 700;
  line-height: 1; display: grid; place-items: center; cursor: pointer;
}
.dg-nav:hover:not(:disabled) { background: var(--hair); }
.dg-nav:disabled { opacity: 0.35; cursor: default; }
.dg-track {
  flex: 1 1 auto; position: relative; border: 1px solid var(--card-bd);
  background: var(--hair); border-radius: var(--radius-sm); cursor: pointer;
}
.dg-thumb {
  position: absolute; top: 2px; bottom: 2px; left: 0; min-width: 24px;
  background: var(--ink); border-radius: 3px; opacity: 0.55;
}
.dg-track:hover .dg-thumb { opacity: 0.75; }

/* the X on a date card / editing card so a picked date can be removed inline */
.day-x {
  border: none; background: transparent; color: var(--faint); cursor: pointer;
  font-size: 15px; line-height: 1; width: 22px; height: 22px; border-radius: var(--radius-sm);
  display: grid; place-items: center; flex: none; padding: 0;
}
.day-x:hover { color: var(--danger); background: var(--hair); }
.day-row { position: relative; }
.day-row .day-x { position: absolute; top: 4px; left: 4px; }
.day-edit-head .day-x { margin-right: 8px; }

/* the "orejita": a little ear sticking out of the left container's edge.
   Sticks to the top with the grid pane so the collapse toggle stays reachable
   while the user scrolls the date-card column on the left */
.orejita {
  flex: none; align-self: flex-start; margin: 22px 0 0 -1px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  background: var(--card); border: 1px solid var(--card-bd); border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0; padding: 8px 9px; cursor: pointer;
  font-size: var(--fs-small); font-weight: 600; color: var(--muted);
  box-shadow: var(--shadow);
  position: sticky; top: calc(var(--nav-h) + 38px);
}
@media (max-width: 720px) {
  /* stacked layout: the ear hangs from the bottom edge of the editor as a
     centered pull-tab, instead of poking out the side where nothing is beside it */
  .orejita {
    position: static; align-self: center;
    margin: -1px 0 0; border: 1px solid var(--card-bd); border-top: none;
    border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow);
  }
  /* the grid stacks below the editor here, so the open/closed chevrons
     (left/right on desktop) rotate to up/down */
  .orejita .chev i { transform: rotate(90deg); }
}
.orejita:hover { color: var(--ink); }
.orejita .chev {
  display: inline-grid; place-items: center; width: 16px; height: 16px;
  border: 1px solid var(--card-bd); border-radius: var(--radius-sm); font-size: var(--fs-small); line-height: 1;
}

/* the grid: container fills, but day columns keep a fixed, consistent width */
.dg { display: grid; gap: 2px; align-content: start; justify-content: start; width: 100%; }
/* the mini-map axis labels sit below the type scale on purpose: the pane is a
   dense overview, not reading copy */
.dg-corner { }
.dg-dh { text-align: center; align-self: end; padding-bottom: 3px; }
.dg-dh .dow { font-size: 9px; font-weight: 600; letter-spacing: .06em; color: var(--faint); }
.dg-dh .day { font-size: 11px; font-weight: 600; color: var(--muted); }
.dg-time { font-size: 9px; color: var(--axis-sub); text-align: right; padding-right: 7px; align-self: center; line-height: 1; }
.dg-time.hour { color: var(--axis-hour); font-weight: 700; }
.dg-cell { border: 1px solid var(--field-bd); border-radius: 2px; background: var(--card); cursor: pointer; min-height: 0; }
.dg-cell.hour { border-top-color: var(--axis-sub); }
.dg-cell.on { background: var(--rose); border-color: var(--rose); }
.dg-cell.past { background: var(--hair); border-color: transparent; cursor: not-allowed; opacity: .55; }

.day-edit { border: 1px solid var(--ink); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.day-edit-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.editing-tag { font-size: var(--fs-small); font-weight: 600; color: var(--rose-ink); letter-spacing: var(--ls-label); text-transform: uppercase; }
.range-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 9px; }
.range-row .to { font-size: 12px; color: var(--faint); padding: 0 5px; }
/* time input: a +/- stepper around the 24h value */
.ti-stepper { flex: 1; min-width: 84px; display: flex; align-items: center; justify-content: space-between; gap: 2px; border: 1px solid var(--field-bd); border-radius: var(--radius); padding: 2px; }
.ti-stepper .ti-step { width: 22px; height: 28px; flex: none; border: none; background: var(--hair); border-radius: var(--radius-sm); font-size: 15px; line-height: 1; cursor: pointer; color: var(--ink); }
.ti-stepper .ti-step:hover { background: var(--field-bd); }
.ti-stepper .ti-val { font-size: var(--fs-body); font-weight: 600; white-space: nowrap; padding: 0 10px; }
.range-x {
  width: 28px; height: 34px; flex: none; border: 1px solid var(--field-bd); border-radius: var(--radius-sm);
  display: grid; place-items: center; color: var(--faint); cursor: pointer; background: var(--card);
}
.add-range {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px dashed var(--field-bd); border-radius: var(--radius); padding: 9px; margin-bottom: 16px;
  color: var(--rose-ink); font-size: var(--fs-body); font-weight: 600; cursor: pointer; background: none; width: 100%;
}
.apply-row { display: flex; gap: 8px; }
.apply-row .btn { flex: 1; border-color: var(--ink); font-size: var(--fs-small); padding: 6px 12px; }
.day-row {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--hair); border-radius: var(--radius); margin-bottom: 7px; cursor: pointer;
  /* left padding clears the absolutely-positioned remove X */
  padding: 11px 13px 11px 32px;
}
.day-row:hover { border-color: var(--card-bd); }
.day-row .dl { display: flex; align-items: baseline; gap: 9px; }
.day-row .dow { font-size: var(--fs-body); font-weight: 600; width: 34px; }
.day-row .dt { font-size: 12px; color: var(--faint); }
.chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip { font-size: var(--fs-small); font-weight: 600; color: var(--rose-ink); background: var(--rose-bg); border-radius: var(--radius-sm); padding: 3px 8px; }
.notset { font-size: 12px; font-weight: 500; color: var(--axis-sub); font-style: italic; }

/* ---------- grid (results + entry) ---------- */
/* the left time-axis gutter gives the first column breathing room; mirror a
   small gutter on the right so the last column (and its "Mark all" pill) isn't
   flush against the card edge */
.grid.entry, #heat-grid { padding-right: 8px; }
.grid-dates { display: flex; margin-bottom: 5px; }
.grid-dates .gutter { width: 44px; flex: none; }
.grid-dates .dh { flex: 1; text-align: center; }
.grid-dates .dh .dow { font-size: var(--fs-small); font-weight: 600; letter-spacing: var(--ls-label); color: var(--faint); }
.grid-dates .dh .day { font-size: var(--fs-small); font-weight: 600; color: var(--muted); }
/* "All free" chip under each column header on the reply grid so a wide-open day
   can be tapped once instead of painted slot by slot */
.grid-dates .dh .free-all-btn {
  display: block; margin: 3px auto 0; padding: 2px 8px; font-size: var(--fs-small);
  font-weight: 600; border: 1px solid var(--rose-bd); background: var(--card);
  color: var(--rose-ink); border-radius: 999px; cursor: pointer; line-height: 1;
  letter-spacing: 0.03em;
}
.grid-dates .dh .free-all-btn:hover { background: var(--rose-bg); }
.grow { display: flex; align-items: center; }
.grow .tlabel { width: 44px; flex: none; text-align: right; padding-right: 9px; font-size: var(--fs-small); }
.grow .tlabel.hour { font-weight: 700; color: var(--axis-hour); }
.grow .tlabel.sub { font-weight: 500; color: var(--axis-sub); }
.grow .cells { flex: 1; display: flex; gap: var(--gutter-dense); }
/* a bold dashed break, full width, where the time axis skips hours */
.grid-gap { margin: 8px 0; border-top: 2px dashed var(--faint); }
.cell {
  flex: 1; height: 26px; border-radius: var(--radius-sm); display: grid; place-items: center;
  font-size: var(--fs-small); font-weight: 700; box-sizing: border-box; border: 1px solid transparent;
}
.cell.empty { background: var(--heat-empty); }
/* inset shadow (not a thicker border) so full cells keep the exact column width */
.cell.full { box-shadow: inset 0 0 0 2px var(--heat-strong); }
/* slots outside the polled hours: muted so the grid stays readable */
.cell.inactive { background: var(--heat-empty); }
/* entry grid cells */
.grid.entry .cells { gap: var(--gutter-dense); }
.grid.entry .cell { height: 26px; cursor: pointer; border: 1px solid var(--field-bd); background: var(--heat-empty); }
.grid.entry .cell.inactive {
  cursor: default; border-color: transparent;
  background: repeating-linear-gradient(45deg, var(--hair) 0 5px, var(--card) 5px 10px);
}
.grid.entry .cell.free { background: var(--rose); border-color: var(--rose); }
.grid.entry .cell.if_need_be {
  border-color: var(--rose-bd);
  background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--rose), transparent 40%) 0 3px, var(--rose-bg) 3px 6px);
}
/* "best available" filter: keep the peak-overlap slots (everyone, or the most
   who can when no slot fits everyone), blank the rest */
.grid.only-all .cell:not(.peak):not(.inactive) {
  background: var(--heat-empty) !important; color: transparent !important; border-color: transparent !important;
}
.only-all-note { margin: 0 0 12px; font-size: var(--fs-body); color: var(--faint); font-style: italic; }
.only-all-note .fa-triangle-exclamation { margin-right: 6px; font-style: normal; }

/* "mine" markers on the results heatmap: a small pick-green triangle in the
   top-right corner distinguishes the current respondent's own votes from the
   aggregate rose heat, so I can spot what I said inside the crowd tally.  */
.cell[data-mine] { position: relative; }
.cell[data-mine]::after {
  content: ""; position: absolute; top: 0; right: 0;
  width: 0; height: 0; border-top: 7px solid var(--pick-green); border-left: 7px solid transparent;
}
.cell[data-mine="if_need_be"]::after {
  border-top-color: var(--pick-amber);
}
/* dates-only bars: a solid pick-green baseline stripe under my day */
.bar-col[data-mine] .bar-fill-wrap { border-bottom: 3px solid var(--pick-green); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.bar-col[data-mine="if_need_be"] .bar-fill-wrap { border-bottom-color: var(--pick-amber); border-bottom-style: dashed; }

.sw.mine {
  border: 1px solid var(--field-bd); background: var(--card); position: relative;
}
.sw.mine::after {
  content: ""; position: absolute; top: 0; right: 0;
  width: 0; height: 0; border-top: 7px solid var(--pick-green); border-left: 7px solid transparent;
}

/* respondent-pill hover: spotlight that person's picks by dimming everyone
   else. Their free/if-need-be cells stay at full opacity; no extra outline. */
.grid.roster-active .cell,
.bars.roster-active .bar-col { transition: opacity .1s; }
.grid.roster-active .cell:not(.roster-free):not(.roster-maybe) { opacity: 0.22; }
.grid.roster-active .cell.roster-free,
.grid.roster-active .cell.roster-maybe { opacity: 1; }
.bars.roster-active .bar-col:not(.roster-free):not(.roster-maybe) { opacity: 0.22; }
.resp { cursor: pointer; user-select: none; transition: border-color .12s, background .12s; }
.resp.on { border-color: var(--rose); }
/* clicked pills stay selected */
.resp.sel { border-color: var(--rose); background: var(--rose-bg); }
.resp.sel .nm { color: var(--rose-ink); }
.resp.sel .av { background: var(--rose); color: #fff; }

/* inline "close & pick a time" mode */
.pick-bar {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px;
  background: var(--bg); border: 1px solid var(--card-bd); border-radius: var(--radius); padding: 12px 14px;
}
.pick-bar[hidden] { display: none; }
.pick-bar-main { display: flex; align-items: center; gap: 12px; }
.pick-bar .spacer { flex: 1; }
.pick-bar-title { font-size: var(--fs-body); font-weight: 600; }
.pick-bar-readout { font-size: 12px; color: var(--muted); margin-top: 1px; }
.pick-bar-readout.set { color: var(--pick-green); font-weight: 600; }

/* while picking, fade everything but the heatmap + the pick bar. The roster
   stays (hidden by default here before) so a pill hover can spotlight cells
   on the pick grid too. */
#results.picking #owner-controls,
#results.picking #bottom-cta { display: none !important; }

/* ---------- results header: a sticky band that pins on scroll ---------- */
.rhead {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  position: sticky; top: var(--nav-h); z-index: 8; background: var(--card);
  margin: calc(-1 * var(--sp-4)) calc(-1 * var(--sp-4)) 0; padding: 18px var(--sp-4) 12px;
  border-bottom: 1px solid var(--card-bd);
}
/* baseline-align the status to the title's first line: centre-aligning a small
   all-caps label against a big title (or a wrapped one) leaves it riding high */
.rhead-id { display: flex; align-items: baseline; gap: 11px; flex-wrap: wrap; min-width: 0; }
.rtitle { font-size: var(--fs-h3); font-weight: 600; line-height: 1.15; }
.status {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  font-size: var(--fs-small); font-weight: 600; text-transform: uppercase; letter-spacing: var(--ls-label);
  color: var(--muted); line-height: 1;
}
/* nudge the dot a hair up onto the cap centre (it sits ~0.5px low otherwise) */
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); position: relative; top: -1px; }
.status-open { color: var(--ok-fg); }
.status-open .dot {
  background: var(--ok-fg); position: relative;
}
/* expanding halo so an open poll reads as "live" */
.status-open .dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: currentColor; animation: dot-pulse 1.8s ease-out infinite;
}
@keyframes dot-pulse {
  0%   { transform: scale(1);   opacity: 0.55; }
  70%  { transform: scale(3);   opacity: 0;    }
  100% { transform: scale(3);   opacity: 0;    }
}
@media (prefers-reduced-motion: reduce) {
  .status-open .dot::after { animation: none; }
}
.rhead-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.rsub { font-size: var(--fs-small); color: var(--muted); margin-top: 12px; margin-bottom: 16px; }

/* icon action buttons (share / edit / delete) with a hover tooltip */
.rhead-actions .iconbtn { color: var(--muted); }
.rhead-actions .iconbtn:hover { color: var(--ink); background: var(--hair); }
.rhead-actions .iconbtn.danger:hover { color: var(--danger); border-color: var(--danger); }
[data-tip] { position: relative; }
/* font restated: a tooltip on a Font Awesome icon would otherwise inherit the
   icon font and render its text as glyph boxes */
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 7px); left: 50%;
  transform: translateX(-50%); white-space: nowrap; z-index: 60; pointer-events: none;
  background: var(--ink); color: var(--card); font-size: var(--fs-small); font-weight: 500;
  font-family: var(--font); line-height: 1.4;
  padding: 4px 8px; border-radius: var(--radius-sm); box-shadow: var(--shadow-pop);
}
/* lock tooltips carry a whole sentence: wrap on a measured line instead of
   one endless nowrap strip */
.lock-ic[data-tip]:hover::after {
  white-space: normal; width: max-content; max-width: 240px; text-align: center;
}

/* the "does the meeting fit here?" grid shown while picking; rows follow the
   step chosen in the pick bar (the poll's own grid by default, down to 15m) */
#pick-grid { position: relative; }
.pick-step-row { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
/* .label's form-field bottom margin skews it off the row's center line */
.pick-step-row .label { margin-bottom: 0; }
/* display:flex above beats the UA's [hidden] rule, so restate it: the step
   selector belongs to close mode only, not the open results view */
.pick-step-row[hidden] { display: none; }
.pick-step-row .seg.pick-step button { flex: 0 0 auto; padding: 6px 10px; font-size: 12px; }
/* no per-cell hover outline: the span overlay already previews the meeting,
   and a cell's own outline reads as a line cutting through it */
#pick-grid .cell[data-day] { cursor: pointer; }
/* once a slot is committed, dim everything outside it so the choice stays
   visible while the hover outline follows the cursor. The roster spotlight
   takes over while a respondent pill is hovered/selected (its class-only
   rules would otherwise lose to this ID selector). */
#pick-grid .cell { transition: opacity 0.12s; }
#pick-grid.has-pick:not(.roster-active) .cell:not(.sel) { opacity: 0.6; }
/* a hairline every half hour keeps the time rhythm readable */
#pick-grid .grow.rule { border-top: 1px solid var(--hair); padding-top: 2px; }
/* a start where the meeting would run past the polled hours */
#pick-grid .cell.no-room {
  background: repeating-linear-gradient(45deg, var(--hair) 0 4px, transparent 4px 8px);
  cursor: not-allowed;
}

/* the selected span is drawn as a green border, not a fill */
.pick-overlay {
  position: absolute; pointer-events: none; z-index: 6;
  border: 2px solid var(--pick-green); border-radius: var(--radius-sm);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pick-green) 16%, transparent);
}
/* when the meeting ends mid-slot, the cut edge is dashed instead of solid */
.pick-overlay.partial { border-bottom-style: dashed; }

.bars.picking .bar-col { cursor: pointer; }
.bars .bar-col.pick .bar-fill-wrap { outline: 2px solid var(--pick-green); outline-offset: 2px; border-radius: var(--radius-sm); }

/* hover roster: who can make a given meeting time */
.roster-pop {
  position: fixed; z-index: 50; pointer-events: none; max-width: 230px;
  background: var(--card); border: 1px solid var(--card-bd); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop); padding: 10px 12px; font-size: var(--fs-small);
}
.roster-pop[hidden] { display: none; }
.roster-pop .rt { font-weight: 600; margin-bottom: 7px; }
.roster-pop .rg { display: flex; align-items: center; gap: 6px; font-weight: 600; margin-top: 7px; }
.roster-pop .rn { color: var(--muted); margin-top: 1px; line-height: 1.4; }
.roster-pop .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.roster-pop .dot.ok { background: var(--pick-green); }
.roster-pop .dot.maybe { background: color-mix(in srgb, var(--rose), #fff 30%); }
.roster-pop .dot.no { background: var(--faint); }

/* ---------- heat legend ---------- */
.legend { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; row-gap: 10px; margin-top: 16px; }
.legend .legend-keys { margin-top: 0; padding-top: 0; border-top: 0; }
.scale { display: flex; align-items: center; gap: 7px; }
.scale .ramp { display: flex; }
.scale .ramp i { width: 18px; height: 12px; display: block; }
.scale span { font-size: var(--fs-small); font-weight: 500; color: var(--faint); }
.legend-keys { display: flex; align-items: center; gap: 16px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--hair); }
.legend-keys .k { display: flex; align-items: center; gap: 6px; font-size: var(--fs-small); color: var(--muted); }
.legend-keys .sw { width: 14px; height: 12px; border-radius: var(--radius-sm); box-sizing: border-box; }
.sw.free { background: var(--rose); }
.sw.maybe { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--rose), transparent 45%) 0 2px, transparent 2px 5px), color-mix(in srgb, var(--rose), transparent 50%); }
.sw.all { border: 2px solid var(--heat-strong); background: var(--rose); }
.sw.busy { border: 1px solid var(--field-bd); background: var(--heat-empty); }

/* ---------- best / share ---------- */
.best { display: flex; align-items: center; gap: 10px; border-left: 3px solid var(--rose); background: var(--bg); padding: 9px 13px; margin-bottom: var(--sp-3); }
.best .tag { font-size: var(--fs-small); font-weight: 700; text-transform: uppercase; letter-spacing: var(--ls-label); color: var(--rose-ink); }
.best .val { font-size: var(--fs-body); font-weight: 500; }
.share-cta {
  display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
  background: var(--rose-bg); border: 1px solid var(--rose-bd); border-radius: var(--radius); padding: 12px 14px;
}
.share-cta-text { flex: 1; min-width: 0; }
.share-cta-title { font-size: 12px; font-weight: 700; color: var(--rose-ink); margin-bottom: 2px; }
.share-cta-url { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-cta .btn { flex: none; }

/* ---------- share screen (shown right after a poll is created) ---------- */
.share-live { margin-bottom: 14px; }
.share-url {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--hair); border: 1px solid var(--field-bd);
  border-radius: var(--radius); padding: 8px 8px 8px 14px; margin-bottom: var(--sp-3);
}
.share-url-text {
  flex: 1; min-width: 0; font-size: var(--fs-body); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.share-url .btn { flex: none; }
.share-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  width: 46px; height: 46px; color: #fff; border: 0;
  border-radius: var(--radius); text-decoration: none;
}
.share-btn i { font-size: 20px; }
.share-btn.wa { background: #25d366; }
.share-btn.tg { background: #29a9eb; }
.share-btn.tm { background: #5059c9; }
.share-btn.sl { background: #4a154b; }
.share-btn.em { background: #57534e; }
.share-btn:hover { filter: brightness(1.06); }
.share-actions { margin-top: 26px; border-top: 1px solid var(--hair); padding-top: 20px; }
/* the everyone/most filter toggle above the grid */
.grid-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.toggle-label { font-size: var(--fs-body); color: var(--ink); margin-left: 9px; }
.filterbar { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--hair); border-radius: var(--radius); padding: 9px 12px; margin-bottom: 14px; }
.filterbar.on { border-color: var(--ink); }
.filterbar span { font-size: var(--fs-body); font-weight: 500; }

/* ---------- respondents ---------- */
.resp-wrap { margin-top: 16px; }
.resp-list { display: flex; flex-wrap: wrap; gap: 7px; }
.resp { display: flex; align-items: center; gap: 6px; border: 1px solid var(--hair); border-radius: 999px; padding: 3px 10px 3px 3px; }
.resp .av {
  width: 26px; height: 26px; border-radius: 50%;
  background: color-mix(in srgb, var(--rose) 16%, var(--card)); color: var(--rose-ink);
  display: grid; place-items: center; font-size: var(--fs-small); font-weight: 700;
}
.resp .nm { font-size: var(--fs-small); font-weight: 500; }

/* ---------- dates-only bars ---------- */
.bars { display: flex; gap: 8px; align-items: flex-end; height: 200px; margin-bottom: 14px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-fill-wrap { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.bar-fill {
  width: 100%; border-radius: var(--radius-sm) var(--radius-sm) 0 0; min-height: 26px; box-sizing: border-box;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 5px;
  font-size: var(--fs-small); font-weight: 700; color: #fff; border: 1px solid var(--field-bd);
}
.bar-fill.full { box-shadow: inset 0 0 0 2px var(--heat-strong); }
.bar-lab { margin-top: 8px; text-align: center; }
.bar-lab .dow { font-size: var(--fs-small); font-weight: 600; letter-spacing: var(--ls-label); color: var(--faint); }
.bar-lab .day { font-size: var(--fs-small); font-weight: 600; color: var(--muted); }

/* dates-only reply: every month with a poll date, stacked, no navigation.
   Poll dates are `.pickable` and cycle-click through free / if-need-be / busy;
   non-poll dates stay visible but muted so the calendar reads as real dates. */
.mcal-list { display: flex; flex-direction: column; gap: 20px; }
.mcal-title { font-size: var(--fs-small); font-weight: 600; color: var(--muted); margin-bottom: 8px; letter-spacing: var(--ls-label); text-transform: uppercase; }
.cal-day.disabled { color: var(--faint); background: transparent; border-color: var(--hair); cursor: default; }
.cal-day.pickable { border-color: var(--field-bd); font-weight: 600; }
.cal-day.pickable.free { background: var(--rose); border-color: var(--rose); color: #fff; }
.cal-day.pickable.if_need_be {
  border-color: var(--rose-bd); color: var(--rose-ink);
  background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--rose), transparent 60%) 0 3px, var(--rose-bg) 3px 6px);
}

/* ---------- empty / closed ---------- */
.empty-box { border: 1px dashed var(--field-bd); border-radius: var(--radius); padding: var(--sp-4) 24px; text-align: center; }
.empty-box h3 { font-size: var(--fs-h3); margin-bottom: 6px; }
.empty-box p { font-size: var(--fs-body); color: var(--faint); max-width: 300px; margin: 0 auto 18px; }
.final {
  background: var(--bg); border: 1px solid var(--card-bd);
  border-radius: var(--radius); padding: 16px 18px; margin: var(--sp-3) 0 14px;
}
.final .tag { font-size: var(--fs-small); font-weight: 700; text-transform: uppercase; letter-spacing: var(--ls-label); color: var(--faint); margin-bottom: 5px; }
.final .pick { font-size: var(--fs-h3); font-weight: 600; color: var(--ink); }
.final-foot { display: flex; align-items: baseline; gap: 12px; margin-top: 8px; }
.final-loc { font-size: 12px; color: var(--muted); }

/* add-to-calendar actions on a closed poll */
.cal-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 10px; }
.btn-cal .fa-brands { font-size: 13px; }
.cal-ics {
  display: block; text-align: center; font-size: 12px; color: var(--muted);
  margin-bottom: 16px;
}
.cal-ics:hover { color: var(--ink); }
/* "notify respondents" checkbox on the inline close bar: reuse the poll-form
   .check style; the .check border-top already sets it off on its own line */
.pick-notify { margin: 0; padding-top: 12px; }

/* ---------- steps ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps .s { flex: 1; height: 3px; border-radius: 999px; background: var(--hair); }
.steps .s.on { background: var(--rose); }
.step { display: none; }
.step.on { display: block; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--card); padding: 10px 16px; border-radius: var(--radius);
  font-size: var(--fs-body); opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; }

/* drag-to-paint hints: mouse gets "drag", touch gets "hold, then drag" */
.hint-desk { display: none; }
.hint-touch { display: inline; }
@media (hover: hover) and (pointer: fine) {
  .hint-desk { display: inline; }
  .hint-touch { display: none; }
}
/* long-press paints on touch; keep the callout/magnifier and selection away */
#entry-grid, #hours-grid, #calendar {
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}

/* ============================ mobile ============================ */
@media (max-width: 600px) {
  /* tighter shell + cards so content isn't squeezed by double padding */
  .wrap { padding: 16px 13px 64px; }
  .card { padding: 18px 16px; }
  .authwrap { padding: 16px; min-height: 92vh; align-items: start; padding-top: 48px; }

  /* top bar: keep the essentials, drop the long bits */
  :root { --nav-h: 57px; } /* shorter here: less vertical padding */
  .topbar { padding: 11px 14px; gap: 10px; }
  /* the centered view switch needs the room the wordmark takes */
  .topbar:has(.topnav-center) .brand-word { display: none; }
  .topnav-center { gap: 12px; }
  .navlink { font-size: 15px; }
  /* Spanish labels run long ("Mis encuestas"); step down so both still fit */
  .navlink:lang(es) { font-size: var(--fs-small); }
  /* icon-only create button: the full label doesn't fit next to the switch */
  .topbar .topnav .btn-primary { font-size: 0; padding: 7px 11px; }
  .topbar .topnav .btn-primary::before { content: "+"; font-size: 16px; line-height: 1; }
  .topnav { gap: 8px; }
  .topnav-name { display: none; }
  .credits-chip { display: none; }
  .usermenu > summary { white-space: nowrap; }

  /* results header: let the action row wrap under the title */
  .rhead { flex-wrap: wrap; }
  .rhead .rhead-actions { width: 100%; }
  /* the sticky header eats less when it spans the card edges */
  .rhead { margin: -18px -16px 0; padding: 14px 16px 10px; }
  .dash-header { padding: 16px; }
  .dash-group { padding: 8px 14px 12px; }

  /* heatmap: a touch denser so 3–5 day columns fit */
  .grid-dates .gutter, .grow .tlabel { width: 38px; }
  .grow .cells { gap: 1px; }
  /* narrow columns: the day-wide chip steps under the type scale to fit */
  .grid-dates .dh .free-all-btn { font-size: 10px; }

  /* dates-only bars a bit shorter */
  .bars { height: 168px; }

  /* the close picker bar stacks its actions */
  .pick-bar { flex-wrap: wrap; }
  .pick-bar .spacer { display: none; }
  .pick-bar-text { flex: 1 1 100%; margin-bottom: 8px; }

  /* share box: stack the copy button under the url */
  .share-cta { flex-direction: column; align-items: stretch; gap: 10px; }

  /* responses limit + deadline: two fixed-190px fields overflow the narrow card,
     so stack them and let each take the full width */
  .rule-top { flex-direction: column; align-items: stretch; gap: 14px; }
  .rule-top .field { width: auto !important; }

  /* range editor: pin the delete X to the right edge so it never wraps onto
     its own line, shrink the steppers ("to" becomes a dash) so start and end
     fit side by side, and stack the apply buttons (nowrap text overflows paired) */
  .range-row { position: relative; padding-right: 32px; }
  .range-row .range-x { position: absolute; right: 0; top: 0; }
  .range-row .to { font-size: 0; padding: 0; }
  .range-row .to::before { content: "\2013"; font-size: 12px; color: var(--faint); }
  .ti-stepper { min-width: 0; }
  .ti-stepper .ti-step { width: 18px; }
  .ti-stepper .ti-val { font-size: var(--fs-small); }
  .day-edit { padding: 12px; }
  .apply-row { flex-direction: column; }
}

/* very small phones: avoid horizontal scroll on the heatmap */
@media (max-width: 380px) {
  .grid-dates .gutter, .grow .tlabel { width: 32px; }
  .card { padding: 16px 13px; }
}

/* ---------- billing modal ---------- */
.modal {
  border: none; padding: 0; background: transparent; color: var(--ink);
  width: calc(100% - 32px); max-width: 440px; border-radius: var(--radius-lg);
}
.modal::backdrop { background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(2px); }
.modal-card {
  background: var(--card); border: 1px solid var(--card-bd); border-radius: var(--radius-lg);
  padding: var(--sp-3); box-shadow: var(--shadow-modal);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: var(--fs-h3); }
.modal-x { background: none; border: none; color: var(--faint); font-size: 15px; line-height: 1; padding: 4px; cursor: pointer; }
.modal-x:hover { color: var(--ink); }
.modal-sub { font-size: var(--fs-body); color: var(--muted); margin: 4px 0 18px; }
.plan-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin-bottom: 16px; }
@media (max-width: 640px) { .plan-grid { grid-template-columns: 1fr; } }
.plan { position: relative; display: flex; flex-direction: column; border: 1px solid var(--card-bd); border-radius: var(--radius); padding: 16px; }
.plan-featured { border-color: var(--ink); }
.plan-ribbon {
  position: absolute; top: 0; right: 0; background: var(--rose); color: #fff;
  font-size: var(--fs-small); font-weight: 700; letter-spacing: var(--ls-label); text-transform: uppercase;
  padding: 3px 7px; border-radius: 0 var(--radius) 0 var(--radius);
}
.plan-tag { font-size: var(--fs-small); font-weight: 700; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.plan-price { font-size: var(--fs-h3); font-weight: 700; letter-spacing: var(--ls-tight); }
.plan-price span { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan-desc { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 6px 0 14px; flex: 1; }
.plan .btn { margin-top: auto; }
.plan-muted { opacity: 0.55; pointer-events: none; }
.plan-pro .manage-sub { margin-top: 12px; }

/* purchase confirmation */
.purchase-modal { max-width: 400px; }
.purchase-card { text-align: center; padding: 28px 24px; }
.purchase-brand { justify-content: center; margin-bottom: 14px; }
.purchase-title { font-size: var(--fs-h3); margin-bottom: 6px; }
.purchase-actions { display: flex; gap: 10px; justify-content: center; }
/* the coming-soon shelf under the buyable plans: labeled hairline + Teams */
.soon-divider {
  display: flex; align-items: center; gap: 10px; margin: 4px 0 14px;
  color: var(--faint); font-size: var(--fs-small); font-weight: 700; letter-spacing: var(--ls-label); text-transform: uppercase;
}
.soon-divider::before, .soon-divider::after { content: ""; flex: 1; border-top: 1px solid var(--hair); }
.teams-plan { align-items: center; text-align: center; }
.teams-plan .plan-desc { flex: none; margin: 6px auto 12px; max-width: 380px; }
.teams-plan .btn { display: inline-flex; margin-top: 0; }

/* ---------- settings modal ---------- */
.settings-modal { max-width: 800px; }
.settings-modal .modal-card { max-height: min(90vh, 680px); overflow-y: auto; }
/* scrolling stays, the scrollbar chrome goes */
.settings-modal .modal-card, .settings-panes { scrollbar-width: none; -ms-overflow-style: none; }
.settings-modal .modal-card::-webkit-scrollbar, .settings-panes::-webkit-scrollbar { display: none; }
/* fixed height so the modal doesn't resize as tabs change; tall enough for the
   branding pane so nothing scrolls inside it */
.settings-body { display: flex; align-items: flex-start; gap: 18px; margin-top: 14px; height: 500px; }
.settings-section-title {
  font-size: var(--fs-small); font-weight: 700; letter-spacing: var(--ls-label); text-transform: uppercase;
  color: var(--faint); margin: 0 0 12px;
}
.settings-section-title:not(:first-child) { margin-top: 28px; }
.settings-section-title.danger { color: var(--danger); }
.settings-tabs {
  display: flex; flex-direction: column; gap: 2px; flex: 0 0 128px;
  border-right: 1px solid var(--hair); padding-right: 10px; align-self: stretch;
}
.settings-tab {
  text-align: left; background: none; border: none; font: inherit; font-size: var(--fs-body);
  font-weight: 500; color: var(--muted); padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer;
}
.settings-tab:hover { background: var(--hair); color: var(--ink); }
.settings-tab.on { background: var(--hair); color: var(--ink); font-weight: 600; }
.settings-panes { flex: 1; min-width: 0; height: 100%; overflow-y: auto; }
.settings-pane { display: none; }
.settings-pane.on { display: block; }
.settings-pane .row { flex-wrap: wrap; }
/* reply page: "fill from calendar" bar */
.cal-fill-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.cal-fill-bar .subtle { margin-right: 2px; }
.cal-fill.loading { opacity: 0.6; pointer-events: none; }
/* integrations pane rows */
.int-list { display: flex; flex-direction: column; gap: 2px; }
.int-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.int-row:last-child { border-bottom: 0; }
.int-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.int-name { font-weight: 600; }
.int-acct { font-size: var(--fs-small); }
.int-action { display: flex; align-items: center; gap: 8px; flex: none; }
/* equal width so Connect / Disconnect line up on both edges across rows */
.int-action .btn { min-width: 104px; }
.settings-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; }
.palette-box { border: 1px solid var(--field-bd); border-radius: var(--radius); padding: 12px 14px 14px; margin: 4px 0 16px; }
.palette-box legend {
  font-size: var(--fs-small); font-weight: 600; letter-spacing: var(--ls-label); color: var(--faint);
  text-transform: uppercase; padding: 0 6px; margin-left: -6px;
}
/* labels may wrap to two lines; keep the pickers on one baseline */
.palette-box .row { align-items: flex-end; }
.palette-box .field { margin-bottom: 0; }
.palette-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--hair);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: var(--fs-body); font-weight: 600; color: var(--ink); }
/* account pane: working-hours editor (reuses the poll form's ti-stepper) */
.wh-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; max-width: 380px; }
.wh-row .wh-day { flex: 0 0 40px; font-size: var(--fs-small); font-weight: 600; color: var(--muted); }
.wh-row .to { font-size: 12px; color: var(--faint); padding: 0 2px; }
@media (max-width: 600px) {
  .settings-body { flex-direction: column; gap: 12px; height: auto; }
  .settings-tabs {
    flex-direction: row; flex: none; width: 100%; overflow-x: auto; align-self: auto;
    border-right: none; border-bottom: 1px solid var(--hair); padding: 0 0 8px;
  }
  .settings-tab { white-space: nowrap; }
  .settings-panes { width: 100%; height: auto; flex: 1; min-height: 0; }
}
