/* ============================================================
   timer.now — Design System
   Focus-first countdown UI. Deep indigo + warm amber, clean and
   trustworthy, with a first-class dark mode. Structure & rhythm
   adapted from the sudoku.by design language.
   ============================================================ */

:root {
  --indigo: #4f46e5;
  --indigo-dark: #4338ca;
  --indigo-deep: #312e81;
  --indigo-light: #eef2ff;
  --indigo-border: #c7d2fe;

  --amber: #f59e0b;
  --amber-dark: #d97706;
  --amber-light: #fffbeb;

  --go: #10b981;         /* running accent */
  --danger: #ef4444;

  --text: #1e2233;
  --text-muted: #5b6478;
  --text-light: #94a0b8;

  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --surface-3: #eef1f7;
  --border: #e4e8f0;
  --border-strong: #d3d9e6;

  --shadow-sm: 0 1px 3px rgba(24, 28, 48, .07);
  --shadow: 0 6px 18px rgba(24, 28, 48, .10);
  --shadow-lg: 0 18px 44px rgba(24, 28, 48, .16);
  --shadow-glow: 0 10px 40px rgba(79, 70, 229, .28);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --nav-height: 64px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --grad-hero: radial-gradient(1200px 600px at 50% -10%, rgba(79,70,229,.16), transparent 60%);
}

:root[data-theme="dark"] {
  --indigo: #818cf8;
  --indigo-dark: #a5b4fc;
  --indigo-deep: #c7d2fe;
  --indigo-light: #1c1f36;
  --indigo-border: #2c3157;

  --amber: #fbbf24;
  --amber-dark: #f59e0b;
  --amber-light: #241f10;

  --text: #e7eaf3;
  --text-muted: #a3adc4;
  --text-light: #6b7490;

  --surface: #14172a;
  --surface-2: #0f1220;
  --surface-3: #1c2036;
  --border: #262b45;
  --border-strong: #333a5c;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow: 0 6px 18px rgba(0,0,0,.5);
  --shadow-lg: 0 18px 44px rgba(0,0,0,.6);
  --shadow-glow: 0 10px 40px rgba(129,140,248,.25);

  --grad-hero: radial-gradient(1200px 600px at 50% -10%, rgba(129,140,248,.18), transparent 60%);
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* The [hidden] attribute must beat component display rules (.btn, .chip,
   .timer-fs-exit are display:inline-flex/grid, which otherwise override the UA
   [hidden]{display:none} and leave hidden widget buttons visible). */
[hidden] { display: none !important; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--surface-2);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--indigo); text-decoration: none; transition: color .15s; }
a:hover { color: var(--indigo-dark); }
img, svg, video { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.18; color: var(--text); font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; font-weight: 700; }
p { color: var(--text-muted); }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--indigo); color: #fff;
  padding: .6rem 1rem; border-radius: 0 0 var(--radius-sm) 0; z-index: 500;
}
.skip-link:focus { left: 0; }

/* ---- layout ---- */
.container { max-width: 1160px; margin: 0 auto; padding: 0 1.25rem; }
.container-sm { max-width: 760px; margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 3.25rem 0; }
.section-tight { padding: 2rem 0; }
.logo-dot { color: var(--amber); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: inherit; font-weight: 700; font-size: .95rem; cursor: pointer;
  border: 1.5px solid transparent; border-radius: var(--radius-sm);
  padding: .6rem 1.15rem; transition: transform .08s, background .15s, box-shadow .15s, border-color .15s;
  white-space: nowrap; text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--indigo); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--indigo-dark); color: #fff; box-shadow: var(--shadow-glow); }
.btn-accent { background: var(--amber); color: #201400; }
.btn-accent:hover { background: var(--amber-dark); color: #201400; }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--indigo); color: var(--indigo); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-lg { font-size: 1.05rem; padding: .8rem 1.7rem; }
.btn-sm { font-size: .82rem; padding: .4rem .8rem; }
.btn-full { width: 100%; }

/* ---- nav ---- */
.site-nav {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height); position: sticky; top: 0; z-index: 100;
}
.nav-inner { display: flex; align-items: center; height: 100%; gap: .5rem; }
.nav-logo {
  display: flex; align-items: center; gap: .5rem; font-size: 1.32rem; font-weight: 800;
  color: var(--text); letter-spacing: -.03em; margin-right: 1.5rem; flex-shrink: 0;
}
.nav-logo img { border-radius: 7px; }
.nav-links { display: flex; align-items: center; gap: .1rem; flex: 1; list-style: none; }
.nav-links a, .nav-dropdown-trigger {
  display: flex; align-items: center; gap: .3rem; padding: .45rem .8rem; border-radius: var(--radius-sm);
  font-size: .93rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; cursor: pointer;
}
.nav-links a:hover, .nav-links a.active, .nav-dropdown-trigger:hover { background: var(--indigo-light); color: var(--indigo); }
.nav-has-dropdown { position: relative; }
.nav-dropdown-trigger svg { transition: transform .15s; }
.nav-has-dropdown:hover .nav-dropdown-trigger svg, .nav-has-dropdown.open .nav-dropdown-trigger svg { transform: rotate(180deg); }
.nav-mega {
  /* "Popular" is the right-most nav item, so anchor the panel to the trigger's
     RIGHT edge (extends leftward) — left:0 would push its last column off the
     viewport on 860-1080px desktops, where body{overflow-x:hidden} clips it. */
  position: absolute; top: 100%; right: 0; left: auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 720px; max-width: calc(100vw - 1.5rem); padding: 1rem; z-index: 300;
  /* Hidden by opacity (not display) so the invisible hover-bridge below stays
     in the layout and the menu never closes while the cursor crosses the gap. */
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .12s ease, transform .12s ease, visibility .12s;
  margin-top: 10px;
}
/* Transparent bridge that fills the visual gap between the trigger and the
   panel, so moving the mouse down from "Popular" keeps the menu open. */
.nav-mega::before {
  content: ""; position: absolute; top: -14px; left: 0; right: 0; height: 16px;
}
.nav-has-dropdown:hover .nav-mega,
.nav-has-dropdown:focus-within .nav-mega,
.nav-has-dropdown.open .nav-mega {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-mega-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.nav-mega-heading { font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--text-light); padding: .3rem .6rem; }
.nav-mega-col a { display: block; padding: .38rem .6rem; border-radius: var(--radius-sm); font-size: .88rem; font-weight: 500; color: var(--text-muted); }
.nav-mega-col a:hover { background: var(--indigo-light); color: var(--indigo); }
.nav-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

.theme-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--indigo); border-color: var(--indigo-border); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-hamburger { display: none; flex-direction: column; gap: 5px; width: 42px; height: 42px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; cursor: pointer; align-items: center; justify-content: center; }
.nav-hamburger span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile-panel {
  position: fixed; top: var(--nav-height); left: 0; right: 0; bottom: 0; background: var(--surface);
  padding: 1rem 1.25rem 3rem; overflow-y: auto; transform: translateX(100%); transition: transform .25s; z-index: 90;
}
.nav-mobile-panel.open { transform: translateX(0); }
.mob-link { display: block; padding: .8rem .5rem; font-weight: 700; color: var(--text); border-bottom: 1px solid var(--border); }
.mob-link.active { color: var(--indigo); }
.nav-mobile-heading { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--text-light); padding: 1rem .5rem .3rem; }
.mob-sub-link { display: inline-block; width: calc(50% - .3rem); padding: .55rem .5rem; color: var(--text-muted); font-size: .9rem; font-weight: 500; }

/* ---- footer ---- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 3rem 0 1.5rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 2rem; }
.footer-brand { font-size: 1.3rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: .6rem; }
.footer-desc { font-size: .9rem; color: var(--text-muted); max-width: 30ch; }
.footer-heading { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--text-light); margin-bottom: .8rem; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.footer-links a { font-size: .9rem; color: var(--text-muted); font-weight: 500; }
.footer-links a:hover { color: var(--indigo); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); font-size: .82rem; color: var(--text-light); }
.footer-legal { display: inline-flex; gap: .5rem; align-items: center; }
.footer-legal a { color: var(--text-light); }
.footer-legal a:hover { color: var(--indigo); }
.footer-legal .sep { color: var(--border-strong); }

/* ---- hero ---- */
.hero { background: var(--grad-hero); padding: 2.5rem 0 1rem; }
.hero h1 { margin-bottom: .7rem; }
.hero-sub { font-size: 1.1rem; color: var(--text-muted); max-width: 60ch; margin: 0 auto; }
.reviewed-date { margin-top: .45rem; color: var(--text-light); font-size: .78rem; }
.hero-center { text-align: center; }

/* ---- timer widget ---- */
.timer-app { max-width: 520px; margin: 0 auto; }
.page-timer .timer-app, .page-home .timer-app { margin-top: 1.5rem; }
.timer-stage {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem 1.5rem; box-shadow: var(--shadow); text-align: center; position: relative;
}
.timer-app.is-running .timer-stage { border-color: var(--indigo-border); box-shadow: var(--shadow-glow); }
.timer-name-row { margin-bottom: .5rem; }
.timer-name {
  width: 100%; max-width: 320px; text-align: center; border: none; background: transparent;
  font-size: 1.05rem; font-weight: 700; color: var(--text); padding: .3rem .5rem; border-radius: var(--radius-sm);
}
.timer-name::placeholder { color: var(--text-light); font-weight: 500; }
.timer-name:focus { outline: none; background: var(--surface-3); }

.timer-face { position: relative; width: 280px; height: 280px; margin: .5rem auto 1rem; }
.timer-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--surface-3); stroke-width: 12; }
.ring-progress { fill: none; stroke: var(--amber); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset .3s linear, stroke .3s; }
.timer-app.is-running .ring-progress { stroke: var(--indigo); }
/* Visual "Time Timer" mode: a filled wedge that depletes as time runs down. The
   --frac custom property (1 -> 0) is set from JS; the pie is hidden until the
   Visual toggle adds .is-visual. */
.timer-pie { display: none; position: absolute; inset: 6px; border-radius: 50%;
  background: conic-gradient(var(--amber) calc(var(--frac, 1) * 360deg), var(--surface-3) 0);
  transition: background .3s linear; }
.timer-app.is-visual .timer-pie { display: block; }
.timer-app.is-visual.is-running .timer-pie { background: conic-gradient(var(--indigo) calc(var(--frac, 1) * 360deg), var(--surface-3) 0); }
.timer-app.is-visual .timer-ring { display: none; }
.timer-app.is-visual .timer-clock { text-shadow: 0 1px 6px var(--surface); }
.timer-clock {
  position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono);
  font-size: 3.4rem; font-weight: 700; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums;
}
.timer-app.is-finished .timer-clock { color: var(--danger); }
.timer-app.cue-green .timer-stage { border-color: color-mix(in srgb, var(--go) 55%, var(--border)); }
.timer-app.cue-green .ring-progress { stroke: var(--go); }
.timer-app.cue-amber .timer-stage { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 8%, var(--surface)); }
.timer-app.cue-amber .ring-progress, .timer-app.cue-amber .timer-clock { stroke: var(--amber); color: var(--amber-dark); }
.timer-app.cue-red .timer-stage { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.timer-app.cue-red .timer-clock { color: var(--danger); }

.timer-adjust { margin: .25rem 0 1.25rem; }
.adjust-fields { display: flex; justify-content: center; gap: .6rem; margin-bottom: .8rem; }
.adjust-field { display: flex; flex-direction: column; gap: .25rem; }
.adjust-field span { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-light); }
.adjust-field input {
  width: 72px; text-align: center; font-family: var(--mono); font-size: 1.3rem; font-weight: 700;
  padding: .5rem; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
}
.adjust-field input:focus { outline: none; border-color: var(--indigo); background: var(--surface); }
.adjust-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.timer-adjust.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

.chip {
  display: inline-flex; align-items: center; gap: .35rem; font-family: inherit; font-size: .82rem; font-weight: 600;
  padding: .4rem .75rem; border-radius: 999px; border: 1.5px solid var(--border-strong); background: var(--surface);
  color: var(--text-muted); cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--indigo-border); color: var(--indigo); }
.chip.toggle-on { background: var(--indigo-light); border-color: var(--indigo-border); color: var(--indigo); }
.chip-clear:hover { border-color: var(--danger); color: var(--danger); }

.timer-controls { display: flex; justify-content: center; gap: .6rem; margin-bottom: 1rem; }
.timer-controls .btn-lg { min-width: 120px; }
.timer-toggles { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
/* alarm sound settings row */
.timer-sound { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .5rem .9rem;
  margin: 0 auto .8rem; padding: .6rem .9rem; max-width: 460px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); }
.ts-field { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.timer-sound select { font-family: inherit; font-size: .85rem; font-weight: 600; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: .3rem .5rem; cursor: pointer; }
.timer-sound input[type="range"] { width: 90px; accent-color: var(--indigo); cursor: pointer; }
.timer-app.sound-off .timer-sound { opacity: .5; }
.timer-app.sound-off .ts-vol, .timer-app.sound-off #sound-select { pointer-events: none; }
.timer-stage.is-fullscreen .timer-sound { display: none; }
/* interval-timer routine builder */
.seq-builder { margin: .2rem auto 1rem; max-width: 480px; display: flex; flex-direction: column; gap: .6rem; }
.seq-builder-fields { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: .6rem; }
.seq-builder-fields .ts-field { flex-direction: column; align-items: flex-start; gap: .25rem; text-transform: none; letter-spacing: 0; font-size: .74rem; }
.seq-builder-fields input { width: 96px; font-family: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .38rem .55rem; }
.seq-share { display: flex; gap: .5rem; }
.seq-share input { flex: 1; min-width: 0; font-family: var(--mono); font-size: .76rem; color: var(--text-muted);
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .45rem .6rem; }
.timer-stage.is-fullscreen .seq-builder { display: none; }

/* alarm clock */
.al-clock { text-align: center; margin: .5rem 0 1rem; }
.al-clock #al-now { font-family: var(--mono); font-size: clamp(2.6rem, 11vw, 4.2rem); font-weight: 700;
  letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.timer-stage.is-fullscreen .al-clock #al-now { font-size: min(14vw, 18vh); }
.timer-app.is-ringing .al-clock #al-now { color: var(--amber); }
.al-setup { display: flex; flex-direction: column; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.al-count { text-align: center; }
.al-status { font-size: .9rem; font-weight: 600; color: var(--text-muted); margin-bottom: .3rem; }
.al-remain { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; color: var(--indigo);
  font-variant-numeric: tabular-nums; margin-bottom: .8rem; }
.timer-app.is-ringing .al-remain { display: none; }

/* multi-timer */
.multi-app { max-width: 580px; margin: 0 auto; }
.mt-add-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; justify-content: center; margin-bottom: 1rem; }
.mt-add-row #mt-name { flex: 1; min-width: 150px; font-family: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .5rem .7rem; }
.mt-add-row .ts-field { flex-direction: column; align-items: flex-start; gap: .2rem; text-transform: none; letter-spacing: 0; font-size: .72rem; }
.mt-add-row input[type="number"] { width: 72px; font-family: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .45rem .5rem; }
.mt-total { text-align: center; font-family: var(--mono); font-weight: 700; color: var(--indigo); margin-bottom: .8rem; min-height: 1.2em; }
.mt-list { display: flex; flex-direction: column; gap: .5rem; }
.mt-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .9rem;
  padding: .7rem .5rem .7rem 1rem; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); transition: border-color .15s; }
.mt-row.is-running { border-color: var(--indigo); }
.mt-row.is-done { border-color: var(--go); }
.mt-row-name { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-row-time { font-family: var(--mono); font-size: 1.35rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.mt-row.is-done .mt-row-time { color: var(--go); font-size: 1rem; }
.mt-row-ctrl { display: flex; gap: .35rem; }
.mt-toggle { min-width: 62px; justify-content: center; }
.mt-empty { text-align: center; color: var(--text-muted); font-size: .9rem; padding: 1.2rem 1rem; max-width: 44ch; margin: 0 auto; }
.timer-hint { font-size: .78rem; color: var(--text-light); }
.timer-hint kbd {
  font-family: var(--mono); font-size: .72rem; background: var(--surface-3); border: 1px solid var(--border-strong);
  border-radius: 4px; padding: .05rem .35rem; color: var(--text-muted);
}

.timer-fs-exit { position: absolute; top: 1rem; right: 1rem; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); cursor: pointer; display: grid; place-items: center; z-index: 5; }

/* sequence widget (pomodoro / tabata) */
.seq-phase-label { font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em; margin-bottom: .25rem; color: var(--indigo); }
.seq-round { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-light); margin: -.5rem 0 1rem; }
#sequence-app.tone-work .ring-progress { stroke: var(--indigo); }
#sequence-app.tone-work .seq-phase-label { color: var(--indigo); }
#sequence-app.tone-rest .ring-progress { stroke: var(--amber); }
#sequence-app.tone-rest .seq-phase-label { color: var(--amber-dark); }
#sequence-app.tone-long .ring-progress { stroke: var(--go); }
#sequence-app.tone-long .seq-phase-label { color: var(--go); }
#sequence-app.is-finished .timer-clock { color: var(--go); font-size: 2.2rem; }

/* countdown-to-a-date */
.cd-setup { display: flex; flex-direction: column; align-items: center; gap: .8rem; margin: 1rem 0 1.25rem; }
.cd-label { font-weight: 700; color: var(--text); font-size: .95rem; }
.cd-input { font-family: var(--mono); font-size: 1.05rem; padding: .6rem .9rem; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); }
.cd-input:focus { outline: none; border-color: var(--indigo); background: var(--surface); }
.cd-input.shake { animation: shake .4s; }
.cd-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.cd-units { display: flex; align-items: baseline; justify-content: center; gap: .35rem; margin: 1.25rem 0 .5rem; }
.cd-unit { display: flex; flex-direction: column; align-items: center; min-width: 68px; }
.cd-num { font-family: var(--mono); font-size: 3rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }
.cd-unit small { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-light); font-weight: 700; margin-top: .35rem; }
.cd-sep { font-family: var(--mono); font-size: 2.4rem; font-weight: 700; color: var(--border-strong); }
.cd-target-label { color: var(--text-muted); font-size: .9rem; margin-bottom: 1rem; }
.cd-done { font-size: 1.3rem; font-weight: 800; color: var(--go); margin: .5rem 0 1rem; }
#countdown-app.is-done .cd-num { color: var(--go); }
.timer-stage.is-fullscreen .cd-num { font-size: min(12vw, 7rem); }
.timer-stage.is-fullscreen .cd-unit { min-width: min(16vw, 140px); }

/* stopwatch */
.timer-clock-sw { font-size: 3rem; font-variant-numeric: tabular-nums; }
.sw-laps { max-width: 340px; margin: .5rem auto 1rem; max-height: 220px; overflow-y: auto; }
.sw-lap-row { display: grid; grid-template-columns: 1fr auto auto; gap: .8rem; padding: .45rem .2rem; border-bottom: 1px solid var(--border); font-size: .88rem; }
.sw-lap-row span:first-child { color: var(--text-muted); font-weight: 600; }
.sw-lap-split { color: var(--text-light); font-family: var(--mono); }
.sw-lap-total { color: var(--text); font-family: var(--mono); font-weight: 700; }

/* fullscreen */
.timer-stage.is-fullscreen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 0; border: none; box-shadow: none; background: var(--surface-2); padding: 2rem;
}
.timer-stage.is-fullscreen .timer-face { width: min(60vh, 60vw); height: min(60vh, 60vw); }
.timer-stage.is-fullscreen .timer-clock { font-size: min(14vw, 9rem); }
.timer-stage.is-fullscreen .timer-hint { display: none; }

/* finish flash */
.timer-stage.flash { animation: flashpulse 1s ease-in-out 2; }
@keyframes flashpulse {
  0%,100% { background: var(--surface); }
  50% { background: color-mix(in srgb, var(--amber) 22%, var(--surface)); }
}

/* ---- quick-pick grids ---- */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .7rem; }
.pick {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
  padding: .9rem .5rem; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-weight: 700; text-align: center; transition: .15s;
}
.pick:hover { border-color: var(--indigo); color: var(--indigo); transform: translateY(-2px); box-shadow: var(--shadow); }
.pick .pick-num { font-size: 1.25rem; font-family: var(--mono); }
.pick .pick-unit { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-light); font-weight: 700; }

/* ---- category cards ---- */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.cat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.6rem; transition: .2s; display: flex; flex-direction: column; gap: .5rem;
}
.cat-card:hover { border-color: var(--indigo-border); box-shadow: var(--shadow); transform: translateY(-3px); }
.cat-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--indigo-light); color: var(--indigo); display: grid; place-items: center; margin-bottom: .3rem; }
.cat-card h3 { color: var(--text); }
.cat-card p { font-size: .9rem; }
.cat-card .cat-link { margin-top: auto; font-weight: 700; font-size: .9rem; color: var(--indigo); }

/* ---- feature grid ---- */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.feat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem;
}
.feat h3 { font-size: 1rem; margin-bottom: .3rem; display: flex; align-items: center; gap: .5rem; }
.feat p { font-size: .86rem; }
.feat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex-shrink: 0; }

/* ---- use-case grid (homepage "what people use it for") ---- */
.uses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .7rem; }
.use-card { display: flex; flex-direction: column; gap: .18rem; padding: .9rem 1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); transition: .15s; }
.use-card:hover { border-color: var(--indigo); transform: translateY(-2px); box-shadow: var(--shadow); }
.use-name { font-weight: 700; color: var(--text); font-size: .95rem; }
.use-desc { font-size: .82rem; color: var(--text-muted); line-height: 1.4; }

/* wider quick-pick tiles for text labels (countdowns) */
.pick-wide { padding: .8rem .6rem; }

/* ---- embed box ---- */
.embed-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.4rem 1.5rem; }
.embed-controls { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .7rem; }
.embed-controls input { width: 90px; font-family: inherit; font-size: .9rem; color: var(--text);
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .35rem .55rem; }
.embed-code { width: 100%; font-family: var(--mono); font-size: .82rem; color: var(--text); resize: vertical;
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .8rem; line-height: 1.5; }
.embed-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .8rem; align-items: center; }
.embed-title-input { width: 100%; font-family: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .55rem .7rem; }
.embed-preview { display: block; width: 100%; margin: .8rem auto 0; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-2); }

/* ---- trust / E-E-A-T strip ---- */
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.25rem; }
.trust-item { display: flex; gap: .7rem; align-items: flex-start; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.trust-item svg { width: 26px; height: 26px; color: var(--indigo); flex-shrink: 0; margin-top: .1rem; }
.trust-item strong { display: block; font-size: .92rem; color: var(--text); margin-bottom: .15rem; }
.trust-item span { display: block; font-size: .82rem; color: var(--text-muted); line-height: 1.45; }

/* ---- prose / content ---- */
.prose { max-width: 72ch; }
.prose p { margin-bottom: 1.1rem; color: var(--text-muted); }
.prose h2 { margin: 2rem 0 .9rem; }
.prose h3 { margin: 1.5rem 0 .6rem; }
.prose ul, .prose ol { margin: 0 0 1.1rem 1.2rem; color: var(--text-muted); }
.prose li { margin-bottom: .4rem; }
.prose a { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.prose img { border-radius: var(--radius); margin: 1.5rem 0; border: 1px solid var(--border); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: .92rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: .55rem .75rem; text-align: left; }
.prose th { background: var(--surface-3); font-weight: 700; color: var(--text); }
.prose blockquote { border-left: 3px solid var(--amber); padding-left: 1rem; margin: 1.25rem 0; color: var(--text-muted); font-style: italic; }

.lead { font-size: 1.12rem; color: var(--text-muted); }

/* how-to steps */
.steps { list-style: none; counter-reset: step; display: grid; gap: .9rem; }
.steps li { counter-increment: step; position: relative; padding-left: 3.2rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 2.3rem; height: 2.3rem;
  background: var(--indigo); color: #fff; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
}
.steps strong { display: block; color: var(--text); margin-bottom: .1rem; }

/* conversions table (preset "in numbers") */
.conv-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.conv-table th, .conv-table td { padding: .7rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.conv-table tr:last-child th, .conv-table tr:last-child td { border-bottom: none; }
.conv-table th { font-weight: 600; color: var(--text-muted); font-size: .9rem; width: 55%; }
.conv-table td { font-family: var(--mono); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* tick list ("what you can get done") */
.tick-list { list-style: none; display: grid; gap: .55rem; }
.tick-list li { position: relative; padding-left: 1.9rem; color: var(--text-muted); }
.tick-list li::before { content: ""; position: absolute; left: 0; top: .5rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--amber-light); border: 1.5px solid var(--amber); }
.tick-list li::after { content: ""; position: absolute; left: .38rem; top: .72rem; width: .32rem; height: .58rem; border: solid var(--amber-dark); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* directory collapsible headings */
.hub-summary { list-style: none; cursor: pointer; }
.hub-summary::-webkit-details-marker { display: none; }
.hub-summary h3 { display: inline-flex; align-items: center; gap: .4rem; }
.hub-summary h3::after { content: "▸"; color: var(--indigo); font-size: .8em; transition: transform .15s; }
details[open] > .hub-summary h3::after { transform: rotate(90deg); }

/* use cases */
.uc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; }
.uc { display: flex; gap: .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.uc-check { color: var(--amber); flex-shrink: 0; margin-top: .15rem; }
.uc strong { display: block; color: var(--text); font-size: .95rem; }
.uc p { font-size: .86rem; margin: 0; }

/* faq */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: .7rem; overflow: hidden; }
.faq-item summary { list-style: none; cursor: pointer; padding: 1rem 1.2rem; font-weight: 700; color: var(--text); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.4rem; color: var(--indigo); font-weight: 400; transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 1.2rem 1.1rem; color: var(--text-muted); font-size: .93rem; }

/* related timers */
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.rel { padding: .7rem .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem; color: var(--text); text-align: center; }
.rel:hover { border-color: var(--indigo); color: var(--indigo); }

/* section head */
.section-head { text-align: center; max-width: 60ch; margin: 0 auto 1.75rem; }
.section-head p { margin-top: .5rem; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--indigo); margin-bottom: .5rem; }

/* ---- hub page ---- */
.hub-group { margin-bottom: 2rem; }
.hub-group h2 { font-size: 1.15rem; margin-bottom: .8rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .55rem; }
.hub-link { padding: .65rem .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem; color: var(--text); }
.hub-link:hover { border-color: var(--indigo); color: var(--indigo); background: var(--indigo-light); }

/* ---- blog ---- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.blog-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: .2s; }
.blog-card:hover { border-color: var(--indigo-border); box-shadow: var(--shadow); transform: translateY(-3px); }
.blog-card-img { aspect-ratio: 16/9; background: var(--surface-3); object-fit: cover; width: 100%; }
.blog-card-body { padding: 1.2rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.blog-tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.tag { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--indigo); background: var(--indigo-light); padding: .18rem .5rem; border-radius: 5px; }
.blog-card h3 { color: var(--text); font-size: 1.08rem; }
.blog-card h3 a { color: inherit; }
.blog-card h3 a:hover { color: var(--indigo); }
.blog-card .blog-excerpt { font-size: .88rem; color: var(--text-muted); flex: 1; }
.blog-meta { font-size: .78rem; color: var(--text-light); display: flex; gap: .6rem; }

.article-hero { max-width: 820px; margin: 0 auto; }
.article-hero img { width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--border); margin-top: 1.25rem; }
.article-body { max-width: 720px; margin: 2rem auto 0; }
.article-meta { display: flex; gap: .8rem; align-items: center; font-size: .85rem; color: var(--text-light); margin: .5rem 0 0; }

/* breadcrumbs — site-wide bar directly under the nav/logo */
.breadcrumb-bar { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.breadcrumb-bar .crumbs { margin: 0; padding: .6rem 0; }
.crumbs { font-size: .82rem; color: var(--text-light); display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.crumbs a { color: var(--text-muted); font-weight: 600; }
.crumbs a:hover { color: var(--indigo); }
.crumbs .sep { color: var(--text-light); }
.crumbs [aria-current="page"] { color: var(--text); font-weight: 600; }

/* TL;DR summary box */
.tldr { display: flex; gap: .75rem; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--indigo); border-radius: var(--radius); padding: .9rem 1.1rem; margin: 0 auto 1.25rem; max-width: 640px; text-align: left; }
.tldr-badge { flex-shrink: 0; font-size: .66rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #fff; background: var(--indigo); border-radius: 6px; padding: .18rem .45rem; margin-top: .1rem; }
.tldr p { margin: 0; color: var(--text); font-size: .95rem; }

/* Tip callout */
.tip { display: flex; gap: .65rem; align-items: flex-start; background: var(--amber-light); border: 1px solid var(--amber); border-radius: var(--radius); padding: .85rem 1.1rem; margin: 1.1rem 0; }
.tip::before { content: "💡"; font-size: 1.1rem; line-height: 1.3; flex-shrink: 0; }
.tip p { margin: 0; color: var(--text); font-size: .92rem; }
.tip strong { color: var(--amber-dark); }
:root[data-theme="dark"] .tip { background: var(--amber-light); }

/* rich prose blocks injected from the content engine */
.rich h3 { font-size: 1.15rem; margin: 1.5rem 0 .6rem; }
.rich p { margin-bottom: 1rem; color: var(--text-muted); }
.rich ul, .rich ol { margin: 0 0 1.1rem 1.2rem; color: var(--text-muted); }
.rich li { margin-bottom: .4rem; }
.rich strong { color: var(--text); }
.rich a { font-weight: 600; }
.rich table { width: 100%; border-collapse: collapse; margin: 1.1rem 0; font-size: .92rem; }
.rich th, .rich td { border: 1px solid var(--border); padding: .55rem .7rem; text-align: left; }
.rich th { background: var(--surface-3); font-weight: 700; color: var(--text); }

/* callout */
.callout { background: var(--indigo-light); border: 1px solid var(--indigo-border); border-radius: var(--radius); padding: 1.1rem 1.3rem; }
.callout strong { color: var(--indigo-dark); }
.guide-callout { display: flex; flex-direction: column; gap: .3rem; }
.guide-hook { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--amber-dark); }
.guide-callout h3 { margin: 0; }
.guide-callout h3 a { color: var(--text); }
.guide-callout h3 a:hover { color: var(--indigo); }
.guide-callout p { font-size: .9rem; margin: 0; }
.guide-callout .cat-link { font-weight: 700; font-size: .9rem; color: var(--indigo); margin-top: .2rem; }

/* search */
.search-form { display: flex; gap: .6rem; }
.search-form input { flex: 1; padding: .7rem 1rem; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 1rem; font-family: inherit; }
.search-form input:focus { outline: none; border-color: var(--indigo); }
.search-results { display: grid; gap: .5rem; }
.search-hit { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 0 .8rem; align-items: baseline; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.search-hit:hover { border-color: var(--indigo); box-shadow: var(--shadow-sm); }
.search-kind { grid-row: 1 / 3; align-self: center; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--indigo); background: var(--indigo-light); border-radius: 5px; padding: .2rem .45rem; }
.search-name { font-weight: 700; color: var(--text); }
.search-desc { grid-column: 2; font-size: .85rem; color: var(--text-muted); }

/* glossary */
.glossary { display: grid; gap: 1rem; }
.glossary-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.3rem; scroll-margin-top: 80px; }
.glossary-item dt { font-weight: 800; font-size: 1.05rem; color: var(--text); margin-bottom: .3rem; }
.glossary-item dd { margin: 0; color: var(--text-muted); font-size: .93rem; }
.glossary-item dd a { font-weight: 600; }

/* error pages */
.error-wrap { text-align: center; padding: 5rem 0; }
.error-code { font-family: var(--mono); font-size: 4rem; font-weight: 700; color: var(--indigo); }

/* utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }

/* ---- responsive ---- */
@media (max-width: 940px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .footer-about { grid-column: 1 / -1; }
  .cat-grid { grid-template-columns: 1fr; }
  .trust { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr 1fr; }
  .blog-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav-links, .nav-has-dropdown { display: none; }
  .nav-hamburger { display: flex; }
}
@media (max-width: 560px) {
  .uc-grid { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .timer-face { width: 240px; height: 240px; }
  .timer-clock { font-size: 2.9rem; }
  .adjust-field input { width: 62px; }
  .timer-controls { flex-wrap: wrap; }
  /* Wide tables (Tabata 4-col schedule, conversions) must scroll inside their
     own box on narrow screens — body has overflow-x:hidden, so an unguarded
     table would be clipped rather than reachable. */
  .rich table, .prose table, .conv-table {
    display: block; overflow-x: auto; white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
