/* Locked-In core CSS — generated by scripts/bundle-css.cjs (v=207). Edit css/* then re-run. */

/* --- css/tokens.css --- */
:root {
  color-scheme: dark;
  --bg: #101310;
  --surface: #171b17;
  --surface-raised: #1d231d;
  --surface-soft: #222a22;
  --text: #f2f4ed;
  --text-muted: #a0aa9e;
  --text-subtle: #8b9488;
  --border: #303a30;
  --accent: #b7f36b;
  --accent-strong: #9bd94f;
  --accent-ink: #16200d;
  --danger: #ff8d83;
  --danger-bg: rgba(255, 91, 79, .12);
  --warning: #f2c66d;
  --shadow: 0 24px 80px rgba(0,0,0,.22);
  --radius: 18px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f0; --surface: #ffffff; --surface-raised: #f0f2eb; --surface-soft: #e8ece2;
  --text: #20251d; --text-muted: #5f685a; --text-subtle: #626b5d; --border: #d9dfd3;
  --accent: #35570f; --accent-strong: #2c4a0c; --accent-ink: #fff; --danger: #b83b32;
  --danger-bg: rgba(184,59,50,.1); --warning: #8a5b00; --shadow: 0 24px 80px rgba(40,50,30,.08);
}

:root[data-theme="forest"] {
  --bg: #0b1714; --surface: #11231d; --surface-raised: #173128; --surface-soft: #1e3a2e;
  --text: #edf8ef; --text-muted: #a1c2ae; --text-subtle: #779c86; --border: #2b4a3b;
  --accent: #76e4a0; --accent-strong: #55ca83; --accent-ink: #092116;
}

:root[data-theme="pink"] {
  color-scheme: light;
  --bg: #ebebeb;
  --surface: #f7f6f5;
  --surface-raised: #f2d3d0;
  --surface-soft: #d4d3d1;
  --text: #3f3c3b;
  --text-muted: #736e6c;
  --text-subtle: #8a8583;
  --border: #d4d3d1;
  --accent: #f7b4ae;
  --accent-strong: #e89a93;
  --accent-ink: #3f3c3b;
  --danger: #c75b55;
  --danger-bg: rgba(199, 91, 85, .12);
  --warning: #a87a3a;
  --shadow: 0 24px 80px rgba(63, 60, 59, .08);
}

:root[data-theme="violet"] {
  --bg: #15121e; --surface: #201b2c; --surface-raised: #292338; --surface-soft: #342b45;
  --text: #f6f0ff; --text-muted: #b9accd; --text-subtle: #9383ac; --border: #423653;
  --accent: #d0a5ff; --accent-strong: #b984f3; --accent-ink: #241333;
}

:root[data-theme="blue"] {
  color-scheme: dark;
  --bg:#0b1424; --surface:#111f34; --surface-raised:#192b45; --surface-soft:#213854;
  --text:#f0f6ff; --text-muted:#b1c5df; --text-subtle:#9ab0cd; --border:#35506f;
  --accent:#73baff; --accent-strong:#4da4f5; --accent-ink:#07182a; --danger:#ffaaa7;
  --danger-bg:rgba(255,91,79,.14); --warning:#ffd27d; --shadow:0 24px 80px rgba(0,0,0,.28);
}

:root[data-theme="pink"] .panel, :root[data-theme="pink"] input, :root[data-theme="pink"] textarea, :root[data-theme="pink"] select,
:root[data-theme="blue"] .panel, :root[data-theme="blue"] input, :root[data-theme="blue"] textarea, :root[data-theme="blue"] select { color:var(--text); }

/* Locked-In v3 — QA / responsive / information architecture polish */

:root { --focus-ring: color-mix(in srgb, var(--accent) 28%, transparent); }

/* --- css/base.css --- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body { margin: 0; min-width: 320px; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.55; transition: background .2s ease, color .2s ease; }

button, input, select, textarea { font: inherit; }

button, .button, select, input, textarea { touch-action: manipulation; }

button, select { cursor: pointer; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

a { color: inherit; }

.skip-link { position: absolute; top: -100px; left: 16px; z-index: 100; padding: 10px 14px; background: var(--accent); color: var(--accent-ink); border-radius: 8px; }

.skip-link:focus { top: 12px; }

@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

.is-hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .table-scroll { scroll-behavior: auto; }
  .table-scroll-shell.is-hinting .table-scroll {
    filter: none;
    transform: none;
    transition: none;
  }
  .table-scroll-shell.is-hinting .table-scroll-hint,
  .table-scroll-shell.is-hinting .table-scroll-hint-pill {
    animation: none !important;
  }
  .table-scroll-shell.is-hinting .table-scroll-hint {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; transition-duration:.01ms !important; }
  .goal-progress-track > span { transition: none; }
}

/* --- css/layout.css --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) calc(clamp(18px, 5vw, 76px) + env(safe-area-inset-right, 0px)) 16px calc(clamp(18px, 5vw, 76px) + env(safe-area-inset-left, 0px));
  background: var(--nav-bg, color-mix(in srgb, var(--bg) 90%, transparent));
  border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  backdrop-filter: blur(16px);
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.header-actions .theme-picker {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}

.floating-timer {
  position: fixed;
  top: calc(78px + env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 34;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 14px;
  width: min(680px, calc(100% - 24px));
  margin: 0;
  padding: 12px 18px 12px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-raised) 92%, transparent);
  color: var(--text);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.floating-timer:hover {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--border));
  background: color-mix(in srgb, var(--surface-raised) 96%, var(--accent));
}

.floating-timer:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.floating-timer.is-hidden,
.floating-timer[hidden] { display: none !important; }

.floating-timer-intent {
  justify-self: start;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 650;
}

.floating-timer-center {
  justify-self: center;
  display: grid;
  justify-items: center;
  gap: 3px;
  line-height: 1.05;
}

.floating-timer-clock {
  font: 750 18px var(--mono);
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.floating-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font: 750 10px var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.floating-timer.is-break .floating-timer-badge { color: var(--warning); }

.floating-timer-action {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font: 750 12px var(--font);
  letter-spacing: .02em;
  white-space: nowrap;
}

.floating-timer:hover .floating-timer-action { color: var(--accent-strong); }

body.has-floating-timer { scroll-padding-top: 160px; }

body.has-floating-timer .page-shell { padding-top: 18px; }

@media (max-width: 760px) {
  .floating-timer {
    top: calc(70px + env(safe-area-inset-top, 0px));
    width: calc(100% - 20px);
    border-radius: 18px;
    padding: 12px 14px;
  }
  .floating-timer-intent { font-size: 14px; }
  .floating-timer-clock { font-size: 17px; }
}

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; flex-shrink: 0; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  overflow: hidden;
  background: transparent;
  color: var(--accent-ink);
  flex: 0 0 auto;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-copy { display: grid; line-height: 1.1; gap: 5px; }

.brand-copy strong {
  color: var(--nav-text, var(--text));
  font-size: 16px;
  letter-spacing: -.04em;
}

.brand-copy small {
  color: var(--nav-text-muted, var(--text-subtle));
  font: 700 8px var(--mono);
  letter-spacing: .13em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--nav-text-muted, var(--text-muted));
  text-decoration: none;
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--nav-text, var(--text));
  background: var(--nav-surface, var(--surface-raised));
}

.menu-toggle { display: none; width: 44px; height: 44px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }

.menu-toggle span { display: block; height: 2px; margin: 4px 0; background: var(--text); border-radius: 3px; transition: transform .2s ease, opacity .2s ease; }

.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(6px) rotate(45deg); }

.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }

.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-6px) rotate(-45deg); }

.page-shell { width: min(1100px, calc(100% - 48px)); margin: 0 auto; flex: 1 0 auto; display: flex; flex-direction: column; }

.screen { display: none; padding: clamp(46px, 7vw, 86px) 0 48px; }

.screen.is-active { display: block; flex: 0 0 auto; }

@media (prefers-reduced-motion: no-preference) {
  .screen.is-active { animation: enter .24s ease both; }
}

/* Hide the browser focus “wrap” from programmatic heading focus when changing screens. */

.screen h1:focus { outline: none; box-shadow: none; }

.screen h1:focus:not(:focus-visible) { outline: none; }

.screen h1:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

.back-to-top { position: fixed; right: calc(22px + env(safe-area-inset-right, 0px)); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 50; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 15px; background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); font-size: 24px; font-weight: 800; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease, visibility .2s ease; }

.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

.about-section { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 32px; padding: 42px 0; margin-top: 20px; border-top: 1px solid var(--border); }

.about-section h2 { margin: 0; font-size: clamp(24px, 4vw, 38px); line-height: 1.05; letter-spacing: -.06em; }

.about-section > p { color: var(--text-muted); font-size: 13px; }

.about-section > a { grid-column: 2; width: fit-content; color: var(--accent); font-size: 12px; font-weight: 700; text-decoration: none; }

.about-section > a:hover { text-decoration: underline; }

.site-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding: 20px 0 calc(28px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

.site-footer a { color: var(--text); text-decoration: none; }

.site-footer a:hover { color: var(--accent); }

.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  flex-wrap: wrap;
}

.footer-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 0;
  min-width: 0;
}

.footer-copy {
  margin: 0;
  color: var(--text-subtle);
  font-size: 12px;
  font-weight: 600;
}

.footer-dot {
  margin: 0 0.45em;
  color: var(--text-subtle);
}

.footer-feedback {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--text-subtle);
  font-size: 12px;
  font-weight: 600;
}

.footer-feedback::before {
  content: "·";
  margin: 0 0.45em;
  color: var(--text-subtle);
}

.footer-feedback a {
  color: var(--text-muted);
  text-decoration: none;
  text-underline-offset: 0.18em;
}

.footer-feedback a:hover,
.footer-feedback a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  outline: none;
}

.social-links {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.social {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  transition: color .15s ease, background .15s ease;
}

.social:hover,
.social:focus-visible {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  outline: none;
}

@media (prefers-reduced-motion: reduce) { .back-to-top { transition: none; } }

.back-to-top { cursor: pointer; pointer-events: none; }

.back-to-top.is-visible { pointer-events: auto; }

body.is-history .about-section { display: none; }

.section-hero h1, .about-section h2 { letter-spacing: -.035em; }

.back-to-top { opacity:0; transform:translateY(8px); transition:opacity .2s,transform .2s; }

.back-to-top.is-visible { opacity:1; transform:none; }

@media (max-width: 760px) {
  .focus-goals-grid { grid-template-columns: 1fr; }
}

/* --- css/components.css --- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

.button { display: inline-flex; justify-content: center; align-items: center; gap: 12px; min-height: 46px; padding: 12px 17px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; font-weight: 750; text-decoration: none; transition: transform .15s ease, background .15s ease, border-color .15s ease; }

.button:hover { transform: translateY(-1px); }

.button:active { transform: translateY(0); }

.button-primary { background: var(--accent); color: var(--accent-ink); }

.button-primary:hover { background: var(--accent-strong); }

.button-secondary { background: var(--surface-raised); color: var(--text); border-color: var(--border); }

.button-secondary:hover { border-color: var(--text-subtle); }

.button-danger { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }

.button-danger-outline { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }

.button-ghost {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
}

.button-ghost:hover,
.button-ghost:focus-visible {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-raised);
}

.button-full { width: 100%; min-height: 52px; justify-content: space-between; padding-inline: 18px; }

.button-small { min-height: 38px; padding: 9px 12px; font-size: 11px; }

.text-button { border: 0; background: transparent; color: var(--text-muted); padding: 10px 0; font-size: 13px; }

.text-button:hover { color: var(--text); }

kbd { padding: 3px 5px; border: 1px solid var(--border); border-radius: 5px; color: var(--text-muted); font: 10px var(--mono); }

.keyboard-hint { margin-top: 20px; color: var(--text-subtle); font-size: 10px; }

.metric-explanation { color: var(--text-subtle); font-size: 11px; line-height: 1.5; }

.metric-box { display: grid; gap: 9px; min-width: 0; padding: 17px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 12px; }

.metric-box strong { overflow-wrap: anywhere; font-size: 15px; }

.import-label { display: inline-flex; align-items: center; }

.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.section-hero { margin-bottom: 28px; }

.section-hero h1 { font-size: clamp(37px, 6vw, 60px); }

.title-period { color: var(--accent); }

.section-hero > p:last-child { color: var(--text-muted); margin: 13px 0 0; }

.summary-card { display: grid; gap: 10px; padding: 20px; }

.summary-card strong { font: 750 clamp(22px, 4vw, 32px) var(--mono); letter-spacing: -.06em; }

.search-field { display: flex; align-items: center; gap: 10px; width: min(340px, 100%); padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-muted); transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease; }

/* Active filter glow — uses theme --accent so it follows Dark/Light/Pink/etc. */
.compact-field.is-filter-active > span {
  color: var(--accent);
}

.compact-field.is-filter-active select,
.compact-field.is-filter-active .date-field-trigger,
.search-field.is-filter-active,
.todos-filter-field.is-filter-active select,
.todos-filter-field.is-filter-active .todo-menu-trigger,
.todos-filter-day-btn.is-filter-active {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
  background-color: color-mix(in srgb, var(--accent) 14%, var(--surface-raised, var(--surface)));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent),
    0 0 14px color-mix(in srgb, var(--accent) 30%, transparent),
    0 0 28px color-mix(in srgb, var(--accent) 14%, transparent);
}

.search-field.is-filter-active {
  color: var(--accent);
}

.compact-field.is-filter-pulse select,
.compact-field.is-filter-pulse .date-field-trigger,
.search-field.is-filter-pulse,
.todos-filter-field.is-filter-pulse select,
.todos-filter-day-btn.is-filter-pulse {
  animation: filter-active-pulse .85s ease;
}

@keyframes filter-active-pulse {
  0% {
    box-shadow:
      0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent),
      0 0 0 color-mix(in srgb, var(--accent) 0%, transparent);
  }
  40% {
    box-shadow:
      0 0 0 3px color-mix(in srgb, var(--accent) 42%, transparent),
      0 0 22px color-mix(in srgb, var(--accent) 45%, transparent),
      0 0 40px color-mix(in srgb, var(--accent) 22%, transparent);
  }
  100% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent),
      0 0 14px color-mix(in srgb, var(--accent) 30%, transparent),
      0 0 28px color-mix(in srgb, var(--accent) 14%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .compact-field.is-filter-pulse select,
  .compact-field.is-filter-pulse .date-field-trigger,
  .search-field.is-filter-pulse,
  .todos-filter-field.is-filter-pulse select,
  .todos-filter-day-btn.is-filter-pulse {
    animation: none;
  }
}

.search-field input { width: 100%; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; color: var(--text); }

.search-field:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }

.search-field input:focus-visible { outline: 0; }

.table-scroll-shell {
  position: relative;
  min-width: 0;
}

.table-scroll {
  overflow-x: auto;
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
  transition: filter .25s ease, transform .25s ease;
}

.table-scroll:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  border-radius: 10px;
}

.table-scroll-shell::before,
.table-scroll-shell::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 10px;
  width: 28px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
  z-index: 2;
}

.table-scroll-shell::before {
  left: 0;
  background: linear-gradient(90deg, var(--surface) 15%, transparent);
}

.table-scroll-shell::after {
  right: 0;
  background: linear-gradient(270deg, var(--surface) 15%, transparent);
}

.table-scroll-shell.can-scroll-left::before,
.table-scroll-shell.can-scroll-right::after { opacity: 1; }

.table-scroll-hint {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 6;
  place-items: center;
  padding: 20px;
  pointer-events: none;
  background: color-mix(in srgb, var(--bg) 28%, transparent);
}

.table-scroll-hint-pill {
  margin: 0;
  padding: 14px 18px;
  max-width: min(420px, 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border));
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: var(--shadow);
  font: 750 14px var(--font);
  letter-spacing: .01em;
  line-height: 1.35;
  text-align: center;
}

.empty-state { display: none; padding: 48px 20px; text-align: center; }

.empty-state.is-visible { display: block; }

.empty-state > span { color: var(--accent); font-size: 35px; }

.empty-state h2 { margin: 10px 0 6px; font-size: 20px; }

.empty-state p { max-width: 350px; margin: 0 auto 18px; color: var(--text-muted); font-size: 13px; }

.local-data-note { color: var(--text-subtle); font-size: 11px; }

.creator-credit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--text-subtle);
  font-size: 12px;
  font-weight: 600;
}

.creator-credit > span a {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  text-underline-offset: .18em;
}

.creator-credit > span a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.toast { position: fixed; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 80; max-width: min(400px, calc(100% - 40px)); padding: 13px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }

.toast.is-visible { opacity: 1; transform: translateY(0); }

.confirm-dialog { width: min(440px, calc(100% - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.confirm-dialog::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(4px); }

.leave-customize-dialog { width: min(480px, calc(100% - 32px)); }

.leave-customize-dialog::backdrop {
  background: color-mix(in srgb, var(--bg) 55%, rgba(0, 0, 0, 0.55));
  backdrop-filter: blur(12px) saturate(0.85);
  -webkit-backdrop-filter: blur(12px) saturate(0.85);
}

.leave-customize-name-field {
  margin: 18px 0 0;
}

.leave-customize-actions {
  flex-wrap: wrap;
  justify-content: stretch;
}

.leave-customize-actions .button {
  flex: 1 1 auto;
}

.confirm-content { padding: 26px; }

.confirm-content h2 { margin: 0 0 10px; font-size: 25px; letter-spacing: -.05em; }

.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

.end-session-actions { flex-wrap: wrap; }

html.is-page-blurred,
html.is-page-blurred body {
  overflow: hidden;
}

html.is-page-blurred .page-shell,
html.is-page-blurred .site-header,
html.is-page-blurred .floating-timer,
html.is-page-blurred .back-to-top {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  .leave-customize-dialog::backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  html.is-page-blurred .page-shell,
  html.is-page-blurred .site-header,
  html.is-page-blurred .floating-timer,
  html.is-page-blurred .back-to-top {
    filter: none;
    opacity: 0.45;
  }
}

.focus-chart { display: block; width: 100%; height: 220px; margin: 14px 0 4px; }

.active-session-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; margin: -12px 0 24px; }

.active-session-banner strong { font-size: 15px; }

.active-session-banner p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }

@media(max-width:520px){ .active-session-banner { align-items: stretch; flex-direction: column; } }

.table-scroll-shell { width: 100%; max-width: 100%; }

.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }

.editor-save { margin-top:8px; }

.editor-save:disabled { opacity:.45; cursor:not-allowed; }

.save-state { display:inline-block; margin:8px 0 0 10px; font-size:12px; color:var(--text-muted); }

.save-state[data-state="dirty"] { color:var(--warning); }

.save-state[data-state="saved"] { color:var(--accent); }

.save-state[data-state="error"] { color:var(--danger); }

/* Theme-aware session editor modal */

.edit-session-dialog { width: min(620px, calc(100% - 28px)); max-height: min(85vh, 760px); overflow: auto; padding: 0; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.edit-session-dialog::backdrop { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(6px); }

.edit-session-content { padding: clamp(20px, 4vw, 32px); display: flex; flex-direction: column; gap: 10px; }

.edit-session-content h2 { margin: 0 0 8px; font-size: clamp(24px, 4vw, 32px); letter-spacing: -.04em; }

.edit-session-content label { margin-top: 8px; color: var(--text-muted); font-size: 12px; font-weight: 700; }

.edit-session-title, .edit-session-notes { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 12px; padding: 13px 14px; background: var(--surface-raised, var(--bg)); color: var(--text); font: inherit; outline: none; transition: border-color .18s, box-shadow .18s; }

.edit-session-title { font-size: 19px; font-weight: 650; }

.edit-session-notes { resize: vertical; min-height: 130px; line-height: 1.6; }

.edit-session-title:focus, .edit-session-notes:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring, color-mix(in srgb, var(--accent) 28%, transparent)); }

.dialog-action-spacer { flex: 1; }

@media (max-width: 560px) { .edit-session-content .dialog-actions { flex-wrap: wrap; } .dialog-action-spacer { display: none; } .edit-session-content .dialog-actions .button { flex: 1 1 auto; } }

.theme-picker { position: relative; margin-left: 8px; padding-left: 14px; border-left: 1px solid var(--border); }

.theme-button { display:inline-flex; align-items:center; gap:8px; min-height:38px; padding:8px 10px; border:1px solid var(--border); border-radius:10px; background:var(--surface); color:var(--text-muted); font-size:12px; line-height:1; }

.theme-button:hover { color:var(--text); border-color:var(--text-subtle); }

.theme-swatch,.swatch { width:13px; height:13px; border-radius:50%; border:1px solid color-mix(in srgb, var(--text) 20%, transparent); display:inline-block; flex:0 0 auto; }

.theme-swatch { background:var(--accent); }

.theme-name { line-height:1; }

.theme-caret {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: -2px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg);
}

.theme-popover { display:none; position:absolute; right:0; top:calc(100% + 9px); width:190px; padding:7px; background:var(--surface); border:1px solid var(--border); border-radius:13px; box-shadow:var(--shadow); z-index:50; }

.theme-popover.is-open { display:grid; }

.theme-popover > button,
.theme-popover .user-theme-btn {
  display:flex; align-items:center; gap:9px; width:100%; border:0; border-radius:8px; background:transparent; color:var(--text); padding:9px; text-align:left; font-size:12px; font-weight:650;
}

.theme-popover > button:hover,
.theme-popover > button.is-selected,
.theme-popover .user-theme-btn:hover,
.theme-popover .user-theme-btn.is-selected { background:var(--surface-raised); }

.theme-popover > button.is-selected,
.theme-popover .user-theme-btn.is-selected { font-weight:750; }

.user-theme-list {
  display: grid;
  gap: 2px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.user-theme-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 2px;
}

.user-theme-btn .user-theme-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-theme-delete {
  width: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.user-theme-delete:hover,
.user-theme-delete:focus-visible {
  background: var(--surface-raised);
  color: var(--text);
}

.swatch-dark { background:#b7f36b; }

.swatch-light {
  background:#f5f5f0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #20251d 22%, transparent);
}

.swatch-forest { background:#76e4a0; }

.swatch-violet { background:#d0a5ff; }

.swatch-pink {
  background: #f7b4ae;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #3f3c3b 22%, transparent);
}

.swatch-blue { background:#73baff; }

.swatch-custom {
  background: conic-gradient(from 90deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff, #c77dff, #ff6b6b);
}

.active-session-banner { margin:0 0 18px; padding:14px 18px; display:flex; align-items:center; justify-content:space-between; gap:18px; }

.active-session-banner p { margin:3px 0 0; color:var(--text-muted); font-size:12px; }

.notes-card-heading,.panel-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; }

.notes-card-heading h2,.panel-heading h2 { margin:0 0 6px; letter-spacing:-.03em; }

.notes-card-heading p { margin:0; color:var(--text-muted); font-size:12px; }

.summary-card small { display:block; margin-top:7px; color:var(--text-subtle); font-size:10px; }

.compact-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  color: var(--text-subtle);
  font: 750 9px var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.compact-field span { display: block; line-height: 1; }

.compact-field input,
.compact-field select {
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  font-family: var(--font);
  letter-spacing: normal;
  text-transform: none;
}

.compact-field:focus-within input,
.compact-field:focus-within select,
.date-field:focus-within .date-field-trigger {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.date-field-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  font-family: var(--font);
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  cursor: pointer;
}

.date-field-trigger:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.date-field-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-field-value.is-empty { color: var(--text-subtle); }

.compact-field-select { position: relative; }

.compact-field-select select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75L6 6.25L10.5 1.75' stroke='%238b9488' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
}

.compact-field-select::after { display: none; }

.focus-chart { display:block; width:100%; height:230px; margin-top:18px; }

.notes-hero {
  margin-bottom: 18px;
}

.notes-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 4vw, 40px);
}

.notes-hero > p {
  margin: 0;
  max-width: 36rem;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.notes-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px 12px;
  margin: 0 0 18px;
}

.notes-search {
  flex: 0 1 14rem;
  width: 14rem;
  max-width: 100%;
  margin: 0;
  align-self: end;
}

.notes-search input {
  height: 40px;
  min-height: 40px;
  font-size: 13px;
}

.notes-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 10px;
  min-width: 0;
}

.notes-filters .compact-field {
  min-width: 7.5rem;
}

.notes-filters .compact-field select {
  height: 40px;
  min-height: 40px;
}

.notes-clear-filters-btn {
  min-height: 40px;
  height: 40px;
}

.notes-clear-filters-btn.is-hidden,
.notes-clear-filters-btn[hidden] {
  display: none !important;
}

.notes-filters .compact-field.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.notes-filters .compact-field.is-hidden,
.notes-filters .compact-field[hidden] {
  display: none !important;
}

.notes-filters .date-field-trigger {
  height: 40px;
  min-height: 40px;
  min-width: 7.5rem;
  padding: 0 10px;
  font-size: 12px;
}

.notes-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 1 1 100%;
  flex-wrap: wrap;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--text);
}

.notes-filter-bar.is-hidden,
.notes-filter-bar[hidden] { display: none !important; }

.notes-filter-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.notes-filter-copy strong {
  color: var(--accent);
  font: 750 10px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.notes-filter-bar.is-flashing {
  animation: notes-filter-flash .9s ease;
}

@keyframes notes-filter-flash {
  0%, 100% { box-shadow: none; }
  35% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .notes-filter-bar.is-flashing { animation: none; }
}

.notes-columns {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 28px;
  align-items: start;
}

.notes-columns.is-inbox-empty {
  grid-template-columns: 1fr;
}

.notes-columns.is-inbox-empty .notes-inbox-panel {
  display: none;
}

.notes-columns.is-sessions-empty {
  grid-template-columns: 1fr;
}

.notes-section {
  min-width: 0;
}

.notes-section.is-empty .notes-section-head {
  margin-bottom: 8px;
}

.notes-empty-state {
  display: grid;
  gap: 4px;
  padding: 10px 0;
}

.notes-empty-state strong {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.notes-empty-state p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
  max-width: 36rem;
}

.edit-session-notes-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-raised);
}

.edit-session-notes-summary .local-data-note { margin: 0; }

.view-notes-dialog { width: min(560px, calc(100% - 28px)); }

.view-notes-content { max-height: min(80vh, 720px); overflow: auto; }

.view-notes-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.view-notes-header h2 {
  margin: 0;
}

.dialog-close-btn {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin: -4px -6px 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.dialog-close-btn:hover,
.dialog-close-btn:focus-visible {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  outline: none;
}

.view-session-notes-list { margin: 12px 0 18px; }

.view-notes-add { margin-bottom: 8px; }

.view-notes-add .button { margin-top: 10px; }

.edit-note-context { margin: 0 0 4px; color: var(--text-muted); font-size: 13px; }

.note-composer-dialog {
  width: min(560px, calc(100% - 28px));
}

.note-composer {
  gap: 8px;
}

.note-composer-label {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.note-composer-title {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-raised, var(--bg));
  color: var(--text);
  font: inherit;
  font-size: clamp(20px, 3.4vw, 26px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.note-composer-group {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-raised, var(--bg));
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.note-composer-group:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring, color-mix(in srgb, var(--accent) 28%, transparent));
}

.note-composer-body {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-raised, var(--bg));
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  min-height: 180px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.note-composer-title:focus,
.note-composer-body:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring, color-mix(in srgb, var(--accent) 28%, transparent));
}

.note-composer-title::placeholder,
.note-composer-body::placeholder {
  color: var(--text-subtle);
  font-weight: 500;
}

.note-composer-hint {
  margin: 2px 0 0;
  color: var(--text-subtle);
  font-size: 12px;
  line-height: 1.4;
}

.note-group-dialog {
  width: min(400px, calc(100% - 28px));
}

.note-group-form {
  gap: 10px;
}

.note-group-form h2 {
  margin: 0;
  font-size: clamp(22px, 4vw, 28px);
}

.note-group-copy {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.note-group-name-input {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-raised, var(--bg));
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.note-group-name-input::placeholder {
  color: var(--text-subtle);
  font-weight: 500;
}

.note-group-name-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring, color-mix(in srgb, var(--accent) 28%, transparent));
}

.note-group-form .dialog-actions {
  margin-top: 14px;
}

.toast-action { margin-left:12px; border:1px solid currentColor; background:transparent; color:inherit; border-radius:7px; padding:5px 8px; font-weight:800; font-size:11px; }

.goal-progress-track {
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 80%, transparent);
  overflow: hidden;
}

.goal-progress-track > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: inherit;
  transition: width .25s ease;
}

.focus-goals-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 10px;
}

.focus-goal-block {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--surface));
  transition: border-color .18s ease, background .18s ease;
}

.focus-goals-panel.is-dirty .focus-goal-block {
  border-color: color-mix(in srgb, var(--warning) 50%, var(--border));
  background: color-mix(in srgb, var(--warning) 6%, var(--surface-raised));
}

.goal-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.goal-editor-head > label {
  margin: 0;
  padding-top: 8px;
  font-weight: 750;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.goal-time-wrap {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 0;
}

.goal-progress-foot {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.goal-progress-copy {
  margin: 0;
  color: var(--text-subtle);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.focus-goals-options {
  margin-top: 0;
  flex-shrink: 0;
}

.goal-time-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color .18s, background .18s, box-shadow .18s;
}

.goal-time-edit.is-out-of-range {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--border));
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 18%, transparent);
}

.goal-limit-hint {
  margin: 0;
  max-width: 14rem;
  padding: 4px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  color: var(--danger);
  font: 650 11px var(--font);
  line-height: 1.35;
  text-align: right;
}

.goal-limit-hint[hidden] {
  display: none !important;
}

.goal-time-edit input {
  width: 2.4rem;
  min-height: 28px;
  margin: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: 750 13px var(--mono);
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

.goal-time-edit input::-webkit-outer-spin-button,
.goal-time-edit input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.goal-time-edit input:focus {
  outline: none;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.goal-time-sep {
  color: var(--text-subtle);
  font: 700 11px var(--mono);
}

.focus-goals-panel.is-dirty .goal-time-edit {
  border-color: color-mix(in srgb, var(--warning) 45%, var(--border));
}

.focus-goals-actions {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.focus-goals-actions[hidden] {
  display: none !important;
}

.focus-goals-hint {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--warning) 12%, var(--surface));
  color: var(--warning);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.focus-goals-save-btn {
  width: 100%;
  min-height: 44px;
  font-size: 14px;
  font-weight: 750;
}

.goal-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  margin: 0;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--text-subtle) 42%, transparent) 0%,
    color-mix(in srgb, var(--text-subtle) 42%, transparent) var(--goal-fill, 0%),
    var(--surface-soft) var(--goal-fill, 0%),
    var(--surface-soft) 100%
  );
  border: 0;
  outline: none;
  cursor: pointer;
}

.goal-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--accent-ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
  cursor: grab;
}

.goal-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--accent-ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
  cursor: grab;
}

.goal-slider:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Legacy class kept for any leftover markup */
.goal-hm-fields,
.goal-hm-field {
  display: none;
}

#setup-edit-goals-btn { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* --- css/setup.css --- */
.hero { max-width: 730px; margin: 0 auto 44px; text-align: center; }

.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; color: var(--accent); font: 750 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; }

.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 15px color-mix(in srgb, var(--accent) 65%, transparent); }

.hero h1, .section-hero h1 { margin: 0; font-size: clamp(42px, 7vw, 76px); font-weight: 750; line-height: .99; letter-spacing: -.075em; }

.hero h1 span { color: var(--accent); }

.hero-copy { max-width: 460px; margin: 20px auto 0; color: var(--text-muted); font-size: 16px; }

.setup-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .8fr); gap: 20px; align-items: start; }

.setup-panel { padding: clamp(22px, 3.2vw, 36px); }

.section-heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 26px; }

.section-heading .eyebrow { margin-bottom: 8px; }

.section-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.05em; }

.field { display: flex; flex-direction: column; gap: 9px; margin-bottom: 20px; min-width: 0; }

.field label { font-size: 13px; font-weight: 700; }

.field input:not([type="radio"]):not([type="checkbox"]), .field select { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); }

.field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 44px;
  border-radius: 12px;
  background-color: var(--surface-raised, var(--bg));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1.75 2L7 7.25L12.25 2' stroke='%238b9488' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 9px;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, background-color .18s;
}

.field select:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.field select option,
.field select optgroup {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.field input::placeholder { color: var(--text-subtle); opacity: 1; }

.field input:focus, .field select:focus {
  border-color: var(--accent);
  outline: 3px solid color-mix(in srgb, var(--accent) 18%, transparent);
  background-color: var(--surface-raised, var(--bg));
}

.duration-preset-select {
  font-variant-numeric: tabular-nums;
}

.duration-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.duration-chip {
  min-height: 36px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font: 700 13px var(--font);
  cursor: pointer;
}

.duration-chip:hover,
.duration-chip:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--text);
  outline: none;
}

.duration-chip.is-selected {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--text);
}

.field-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.setup-intent-field {
  gap: 8px;
}

.setup-todo-pick-row select {
  min-height: 42px;
  font-size: 13px;
}

.setup-todo-link-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.setup-todo-link-bar.is-hidden,
.setup-todo-link-bar[hidden] {
  display: none !important;
}

.setup-todo-link-label {
  color: var(--accent);
  font: 750 10px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.setup-todo-link-name {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-intent-field.has-linked-todo #task-intent {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}

.setup-intent-field.has-linked-todo .setup-todo-pick-row {
  display: none !important;
}

.setup-intent-field .recent-goals-label {
  margin-top: 4px;
}

.hardcore-hint.is-hidden { display: none !important; }

.recent-goals-label {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.recent-goals-label.is-hidden { display: none !important; }

.custom-duration { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; padding: 16px; margin: -7px 0 22px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 12px; }

.custom-duration .field { margin-bottom: 0; }

.custom-hint { grid-column: 1 / -1; margin-top: 10px; }

.privacy-note { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 14px 0 0; color: var(--text-muted); font-size: 11px; font-weight: 650; }

.privacy-note span { color: var(--accent); font-size: 8px; }

.side-column { display: flex; flex-direction: column; gap: 14px; }

.setup-heatmap-panel {
  display: block;
  width: 100%;
  padding: 20px;
  min-width: 0;
  margin: 0;
  text-align: left;
}

.setup-heatmap-panel .panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.setup-heatmap-panel h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.03em;
}

.setup-heatmap-go {
  flex: 0 0 auto;
  margin: 0;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: 700 11px var(--font);
  letter-spacing: .02em;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.setup-heatmap-go:hover,
.setup-heatmap-go:focus-visible {
  color: var(--accent-strong, var(--accent));
  outline: none;
}

.setup-heatmap-note {
  margin: 0 0 14px;
  text-align: left;
  max-width: none;
}

.tip-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.tip-card p { margin: 0; }

.tip-card strong { color: var(--text); }

.tip-icon { color: var(--accent); font-size: 22px; line-height: 1; }

.section-hero .eyebrow { margin-bottom: 12px; }

.confirm-content > p:not(.eyebrow) { color: var(--text-muted); font-size: 13px; }

.hero { margin-bottom: 28px; }

.hero h1 { font-size: clamp(38px, 6vw, 68px); }

.rule-note {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.rule-note strong { color: var(--text); }

.optional-label { color: var(--text-muted); font-weight: 500; }

.prefs-panel {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.prefs-panel.is-collapsed .prefs-head {
  border-style: dashed;
  background: transparent;
}

.prefs-panel.is-collapsed .prefs-head-hint {
  color: var(--text-muted);
}

.prefs-panel.is-collapsed {
  margin-bottom: 0;
}

.prefs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color .15s ease, background .15s ease;
}

.prefs-panel.is-open .prefs-head {
  padding: 0;
  border-color: transparent;
  background: transparent;
}

.prefs-head-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.prefs-head .eyebrow {
  margin: 0;
}

.prefs-head-hint {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.prefs-panel.is-open .prefs-head-hint {
  display: none;
}

.prefs-head:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.prefs-panel.is-open .prefs-head:hover {
  background: transparent;
  border-color: transparent;
}

.prefs-head:hover .eyebrow { color: var(--accent-strong); }

.prefs-head:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.prefs-caret-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.prefs-panel.is-open .prefs-caret-wrap {
  width: 22px;
  height: 22px;
  border-color: transparent;
  background: transparent;
}

.prefs-caret {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-right: 1.8px solid var(--accent);
  border-bottom: 1.8px solid var(--accent);
  transform: rotate(45deg);
  margin-top: -3px;
  transition: transform .18s ease, margin-top .18s ease;
}

.prefs-panel.is-open .prefs-caret {
  transform: rotate(225deg);
  margin-top: 3px;
}

.prefs-body {
  margin-top: 14px;
}

.prefs-body .settings-permission-status {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.prefs-body #settings-notify-permit-btn {
  margin: 0 0 10px;
  width: fit-content;
}

.prefs-body.is-hidden,
.prefs-body[hidden] {
  display: none !important;
}

.prefs-group {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.prefs-group:last-child { margin-bottom: 0; }

.prefs-group-label {
  margin: 0 0 2px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.prefs-toggle {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  column-gap: 12px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}

.prefs-toggle:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.prefs-toggle:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.prefs-toggle input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
}

.prefs-toggle-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.prefs-toggle-copy strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.prefs-toggle-copy small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.prefs-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.prefs-card:has(#pref-pomodoro:checked) {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.prefs-toggle-nested {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 10px 12px;
}

.prefs-toggle-nested:hover,
.prefs-toggle-nested:has(input:checked) {
  border-color: transparent;
  background: transparent;
}

.prefs-card-extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px 12px 42px;
  border-top: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}

.prefs-card-extra.is-hidden,
.prefs-card-extra[hidden] { display: none !important; }

.prefs-card:has(#pref-pomodoro:checked) .prefs-card-extra {
  border-top-color: color-mix(in srgb, var(--accent) 22%, var(--border));
}

.prefs-card-extra > label {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.prefs-pomodoro-controls {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.prefs-card-extra select,
.prefs-pomodoro-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: auto;
  min-width: 7.5rem;
  min-height: 40px;
  margin: 0;
  padding: 8px 38px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1.75 2L7 7.25L12.25 2' stroke='%238b9488' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 9px;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, background-color .18s;
}

.prefs-card-extra select:hover,
.prefs-pomodoro-select:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background-color: var(--surface-raised, var(--bg));
}

.prefs-card-extra select:focus,
.prefs-pomodoro-select:focus {
  border-color: var(--accent);
  outline: 3px solid color-mix(in srgb, var(--accent) 22%, transparent);
  background-color: var(--surface-raised, var(--bg));
}

.prefs-card-extra select option,
.prefs-pomodoro-select option {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.prefs-pomodoro-custom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 4px 10px 4px 8px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg);
}

.prefs-pomodoro-custom.is-hidden,
.prefs-pomodoro-custom[hidden] {
  display: none !important;
}

.prefs-pomodoro-custom input {
  width: 3.4rem;
  min-height: 30px;
  margin: 0;
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: 700 13px var(--mono);
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

.prefs-pomodoro-custom input::-webkit-outer-spin-button,
.prefs-pomodoro-custom input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.prefs-pomodoro-custom input:focus {
  outline: none;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.prefs-pomodoro-custom-unit {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.prefs-pomodoro-hint {
  flex: 1 1 100%;
  margin: 0;
  max-width: 22rem;
  padding: 6px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  color: var(--danger);
  font: 650 11px var(--font);
  line-height: 1.35;
}

.prefs-pomodoro-hint[hidden] {
  display: none !important;
}

.prefs-pomodoro-select.is-invalid,
.prefs-pomodoro-custom.is-invalid {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--border));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 18%, transparent);
}

.prefs-segment {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.prefs-segment-option {
  position: relative;
  display: grid;
  margin: 0;
  cursor: pointer;
}

.prefs-segment-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.prefs-segment-option span {
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  transition: background .15s ease, color .15s ease;
}

.prefs-segment-option:hover span {
  color: var(--text);
}

.prefs-segment-option input:checked + span {
  background: var(--accent);
  color: var(--accent-ink);
}

.prefs-segment-option input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.prefs-hint {
  margin: 2px 0 0;
  color: var(--text-subtle);
  font-size: 12px;
  line-height: 1.45;
}

.recent-goals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.recent-goals.is-hidden { display: none; }

.recent-goal-chip {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 999px;
  overflow: hidden;
}

.recent-goal-chip:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }

.recent-goal-apply {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 7px 4px 7px 12px;
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.recent-goal-apply small {
  display: block;
  margin-top: 2px;
  color: var(--text-subtle);
  font-size: 11px;
}

.recent-goal-remove {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-subtle);
  width: 30px;
  flex: 0 0 30px;
  padding: 0;
  font: 600 16px/1 var(--mono);
  cursor: pointer;
}

.recent-goal-remove:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.recent-goal-remove:focus-visible,
.recent-goal-apply:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.focus-goal-card {
  display: grid;
  gap: 12px;
  padding: 20px 22px;
  min-width: 0;
}

.focus-goal-card > .eyebrow { margin: 0; }

.focus-goal-card .goal-progress-row strong {
  min-width: 0;
  font-size: 22px;
  letter-spacing: -.03em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.focus-goal-card #setup-edit-goals-btn {
  flex: 0 0 auto;
  padding: 0;
  white-space: nowrap;
}

.focus-goal-card .goal-progress-track { margin: 0; }

.focus-goal-card #setup-weekly-progress-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

/* --- css/timer.css --- */
.timer-topline { display: flex; justify-content: space-between; align-items: center; }

.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: 999px; color: var(--accent); font: 750 10px var(--mono); letter-spacing: .1em; }

.status-pill.is-break { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); }

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.timer-content { max-width: 640px; margin: 34px auto 0; text-align: center; }

.timer-content > .eyebrow { justify-content: center; }

.session-intent { margin: 0; font-size: clamp(28px, 5vw, 46px); line-height: 1.08; letter-spacing: -.06em; overflow-wrap: anywhere; }

.timer-subtitle { color: var(--text-muted); margin: 10px 0 0; font-size: 14px; }

.timer-face {
  margin: 26px 0 18px;
  font: 750 clamp(66px, 13vw, 124px)/1 var(--mono);
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.timer-progress, .progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }

.timer-progress span, .progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .3s linear; }

.timer-next-break {
  margin: 12px 0 0;
  color: var(--accent);
  font: 650 13px var(--font);
  letter-spacing: 0.01em;
}

.timer-next-break.is-hidden { display: none; }

.timer-status-message {
  min-height: 0;
  margin: 14px 0 0;
  color: var(--warning);
  font-size: 13px;
  font-weight: 650;
}

.timer-status-message.is-hidden { display: none; }

.timer-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.timer-actions .button { min-width: 180px; }

.timer-secondary {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  justify-items: center;
}

.timer-meta {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}

.timer-meta > div { display: grid; gap: 4px; padding: 13px 8px; }

.timer-meta > div + div { border-left: 1px solid var(--border); }

.timer-meta span {
  color: var(--text-muted);
  font: 700 10px var(--mono);
  letter-spacing: .08em;
}

.timer-meta strong {
  font: 700 14px var(--mono);
  color: var(--text);
}

.timer-completion-meta strong {
  color: var(--accent);
}

.expected-end-meta { align-content: center; }

.expected-end-meta strong { display: block; }

.expected-end-meta small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font: 650 10px var(--font);
  letter-spacing: 0;
  text-transform: none;
}

.expected-end-meta small.is-delayed { color: var(--warning); }


.sticky-notes {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--text);
  text-align: left;
}

.sticky-notes[hidden] { display: none !important; }

.sticky-notes-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 14px 9px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.sticky-notes-chip:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.sticky-notes-chip:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.sticky-notes-chip-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  transition: transform .18s ease;
}

.sticky-notes-chip-label {
  font: 750 13px var(--font);
  letter-spacing: .01em;
}

.sticky-notes-count {
  min-width: 1.4em;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  color: var(--text-muted);
  font: 700 10px var(--mono);
  letter-spacing: .04em;
  text-align: center;
}

.sticky-notes-count:empty { display: none; }

.sticky-notes.is-open .sticky-notes-chip-icon { transform: rotate(45deg); }

.sticky-notes-body {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}

.sticky-notes-body[hidden] { display: none !important; }

.sticky-notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  /* Keep overflow visible so the shared note-options menu is not clipped. */
  max-height: none;
  overflow: visible;
}

.sticky-notes-empty {
  margin: 0;
  padding: 4px 0;
  color: var(--text-subtle);
  font-size: 12px;
}

.sticky-note-item {
  margin: 0;
  padding: 0 0 8px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  display: grid;
  gap: 4px;
}

.sticky-note-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.sticky-note-item p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sticky-note-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sticky-note-item-meta small {
  color: var(--text-subtle);
  font-size: 10px;
}

.sticky-note-item-meta .note-card-actions {
  margin-top: 0;
}

.sticky-note-item-meta .note-options-toggle {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 16px;
}

.sticky-note-item-meta .note-options-menu {
  top: auto;
  bottom: calc(100% + 6px);
  min-width: 160px;
  z-index: 20;
}

.sticky-notes textarea {
  width: 100%;
  min-height: 56px;
  resize: vertical;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
}

.sticky-notes textarea::placeholder { color: var(--text-subtle); }

.sticky-notes textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.sticky-notes-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sticky-notes-state { color: var(--text-subtle); font-size: 11px; }

.sticky-notes-state[data-state="dirty"] { color: var(--warning); }

.sticky-notes-state[data-state="saved"] { color: var(--accent); }

.sticky-notes-state[data-state="error"] { color: var(--danger); }

.timer-content .keyboard-hint {
  margin-top: 16px;
  color: var(--text-muted);
}

.timer-content .keyboard-hint kbd {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-soft);
}

@media (max-width: 760px) {
  .timer-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .timer-meta > div + div { border-left: 1px solid var(--border); }

  .timer-meta > div:nth-child(2n + 1) { border-left: 0; }

  .timer-meta > div:nth-child(n + 3) { border-top: 1px solid var(--border); }

  .timer-meta > div:nth-child(5) {
    grid-column: 1 / -1;
    border-left: 0;
  }

  .timer-actions { flex-wrap: wrap; }

  .timer-actions .button { min-width: min(180px, 100%); }
}

/* --- css/mobile.css --- */
/* Mobile / narrow-viewport polish — loaded last so it wins over screen CSS. */

html, body {
  overflow-x: clip;
  max-width: 100%;
}

/* Skip layout/paint for off-screen SPA sections until opened. */
.screen:not(.is-active) {
  content-visibility: hidden;
  contain-intrinsic-size: 1px 800px;
}

img, svg, canvas, video {
  max-width: 100%;
  height: auto;
}

.site-header {
  position: sticky;
  flex-wrap: nowrap;
  gap: 10px;
}

@media (max-width: 760px) {
  .site-header {
    padding: calc(10px + env(safe-area-inset-top, 0px)) calc(14px + env(safe-area-inset-right, 0px)) 10px calc(14px + env(safe-area-inset-left, 0px));
    gap: 8px;
    /* backdrop-filter is expensive while sticky-scrolling on phones */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--nav-bg, var(--bg));
  }

  .floating-timer {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .customize-actions {
    position: static;
    top: auto;
    z-index: auto;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--surface);
    box-shadow: none;
  }

  .brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .brand-copy small {
    display: none;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 11px 10px;
    flex: 0 0 auto;
    overflow: visible;
  }

  .menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    margin: 0;
    flex: 0 0 2px;
    background: var(--text);
    border-radius: 3px;
  }

  .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-7px) rotate(-45deg);
  }

  .site-nav {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 10px;
    right: 10px;
    z-index: 40;
    margin: 0;
    padding: 10px;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .header-actions {
    margin-left: auto;
  }

  .nav-link {
    width: 100%;
    justify-content: flex-start;
    min-height: 44px;
    padding: 12px 14px;
  }

  .header-actions .theme-picker {
    position: relative;
  }

  .theme-button {
    min-height: 42px;
    padding: 0 10px;
    gap: 8px;
  }

  .theme-button .theme-name {
    max-width: 4.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .theme-popover {
    left: auto;
    right: 0;
    width: min(240px, calc(100vw - 28px));
  }

  .page-shell {
    width: calc(100% - 28px);
    max-width: 100%;
  }

  .screen {
    padding: 28px 0 calc(36px + env(safe-area-inset-bottom, 0px));
  }

  .hero {
    margin-bottom: 18px;
  }

  .hero h1,
  .section-hero h1 {
    font-size: clamp(34px, 10vw, 48px);
    line-height: 1.05;
  }

  .section-hero p {
    font-size: 14px;
  }

  .setup-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .side-column {
    display: grid;
    gap: 14px;
  }

  .panel {
    padding: 16px;
  }

  .panel-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .custom-duration {
    grid-template-columns: 1fr 1fr;
  }

  .prefs-card-extra {
    padding-left: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .prefs-pomodoro-controls {
    width: 100%;
  }

  .prefs-pomodoro-select,
  .prefs-card-extra select {
    width: 100%;
    min-width: 0;
  }

  .prefs-segment {
    width: 100%;
  }

  .setup-todos-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .heatmap-frame,
  .heatmap-frame-compact {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .history-toolbar {
    gap: 10px;
  }

  .history-search,
  .history-filters-main,
  .history-clear-filters-btn,
  .history-actions {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
  }

  .history-filters-main {
    grid-template-columns: 1fr 1fr;
  }

  .history-clear-filters-btn,
  .history-actions {
    align-self: stretch;
  }

  .history-actions {
    justify-content: flex-end;
  }

  .history-session {
    padding: 14px 12px;
  }

  .history-session-head {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .history-session-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .history-session-sub {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .history-session-stats {
    margin-left: 0;
    justify-content: flex-start;
    gap: 8px 12px;
  }

  .history-summary-item {
    padding: 10px 8px;
  }

  .history-summary-item strong {
    font-size: 18px;
  }

  .focus-week-reset {
    flex-direction: column;
    align-items: stretch;
  }

  .focus-week-reset-controls {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .focus-week-reset select {
    width: 100%;
  }

  .settings-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-actions .button {
    width: 100%;
  }

  .settings-stack {
    grid-template-columns: 1fr;
  }

  .timer-actions {
    flex-direction: column;
  }

  .timer-actions .button {
    width: 100%;
    min-width: 0;
  }

  .timer-face {
    font-size: clamp(52px, 16vw, 84px);
  }

  .footer-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-feedback::before {
    display: none;
  }

  .back-to-top {
    right: calc(14px + env(safe-area-inset-right, 0px));
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
  }

  .floating-timer {
    top: calc(64px + env(safe-area-inset-top, 0px));
    width: calc(100% - 16px);
    border-radius: 16px;
    padding: 10px 12px;
    column-gap: 10px;
  }

  .confirm-dialog,
  .leave-customize-dialog,
  .edit-session-dialog,
  .view-notes-dialog,
  .note-composer-dialog,
  .note-group-dialog {
    width: calc(100% - 20px);
    max-width: 100%;
  }

  .leave-customize-actions {
    flex-direction: column-reverse;
  }

  .leave-customize-actions .button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .page-shell {
    width: calc(100% - 20px);
  }

  .history-filters-main {
    grid-template-columns: 1fr;
  }

  .history-summary {
    grid-template-columns: 1fr;
  }

  .history-summary-item + .history-summary-item {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .history-summary-item small {
    display: block;
  }

  .theme-button .theme-name,
  .theme-button .theme-caret {
    display: none;
  }

  .theme-button {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .setup-todos-source {
    grid-template-columns: 1fr;
  }

  .notes-filters .compact-field {
    flex: 1 1 100%;
  }

  .insights-stats {
    grid-template-columns: 1fr 1fr;
  }
}
