:root {
  --surface: rgba(255, 251, 246, 0.96);
  --surface-soft: rgba(255, 248, 241, 0.96);
  --control-bg: rgba(255, 250, 244, 0.96);
  --timer-core-bg: #fff8ee;
  --timer-core-ink: #241816;
  --timer-core-muted: #785e52;
  --ink: #231815;
  --muted: #67554b;
  --line: rgba(54, 35, 25, 0.12);
  --accent: #c4512d;
  --focus-glow: rgba(196, 81, 45, 0.14);
  --active-bg: #08070a;
  --shadow: 0 10px 28px rgba(70, 40, 25, 0.08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f8f2ea 0%, #f3eadf 100%);
  transition:
    background-color 520ms ease,
    background 520ms ease,
    color 260ms ease;
}

body.session-fadeout::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background: var(--active-bg);
  animation: sessionFadeToLight 650ms ease forwards;
}

@keyframes sessionFadeToLight {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

body.session-live {
  --surface: rgba(24, 19, 30, 0.96);
  --surface-soft: rgba(35, 27, 44, 0.96);
  --control-bg: rgba(35, 27, 44, 0.98);
  --timer-core-bg: #111014;
  --timer-core-ink: #ffffff;
  --timer-core-muted: #d7c7e8;
  --ink: #f5edf9;
  --muted: #c9b6d7;
  --line: rgba(226, 210, 237, 0.16);
  --accent: #c4512d;
  --focus-glow: rgba(196, 81, 45, 0.2);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  background: var(--active-bg);
}

body.dark-mode {
  --surface: rgba(18, 18, 20, 0.96);
  --surface-soft: rgba(30, 30, 34, 0.96);
  --control-bg: rgba(30, 30, 34, 0.98);
  --timer-core-bg: #111214;
  --timer-core-ink: #ffffff;
  --timer-core-muted: #d4d4dc;
  --ink: #f7f7f8;
  --muted: #bebec6;
  --line: rgba(255, 255, 255, 0.15);
  --accent: #c4512d;
  --focus-glow: rgba(196, 81, 45, 0.2);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  background: linear-gradient(180deg, #101113 0%, #17191d 100%);
}

html.preload-dark {
  --surface: rgba(18, 18, 20, 0.96);
  --surface-soft: rgba(30, 30, 34, 0.96);
  --control-bg: rgba(30, 30, 34, 0.98);
  --timer-core-bg: #111214;
  --timer-core-ink: #ffffff;
  --timer-core-muted: #d4d4dc;
  --ink: #f7f7f8;
  --muted: #bebec6;
  --line: rgba(255, 255, 255, 0.15);
  --accent: #c4512d;
  --focus-glow: rgba(196, 81, 45, 0.2);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  background: linear-gradient(180deg, #101113 0%, #17191d 100%);
}

html.preload-dark body {
  color: var(--ink);
  background: linear-gradient(180deg, #101113 0%, #17191d 100%);
}

html.preload-dark .app-nav,
body.dark-mode .app-nav,
body.session-live .app-nav {
  border-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(196, 81, 45, 0.08)),
    rgba(18, 18, 22, 0.72);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

html.preload-dark .nav-actions,
body.dark-mode .nav-actions,
body.session-live .nav-actions {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.page-shell {
  width: min(1100px, calc(100% - 24px));
  margin: 0 auto;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: 6px 0 16px;
}

.app-nav {
  position: sticky;
  top: 8px;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(255, 245, 236, 0.32)),
    rgba(255, 250, 244, 0.66);
  box-shadow:
    0 18px 42px rgba(70, 40, 25, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  transform-origin: top center;
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    visibility 220ms ease,
    background-color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

body.nav-hidden .app-nav {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-18px) scale(0.98);
}

body.nav-hidden .nav-panel,
body.nav-hidden .session-workspace {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  justify-self: end;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(54, 35, 25, 0.06);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.22);
}

.brand-chip,
.nav-chip,
.account-item {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.brand-chip,
.nav-chip {
  border-color: transparent;
  background: transparent;
}

.brand-chip {
  position: relative;
  padding: 10px 15px;
  border-radius: 17px;
  letter-spacing: -0.02em;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 22px rgba(196, 81, 45, 0.18);
}

.nav-chip {
  padding: 9px 12px;
  border-radius: 14px;
  color: var(--muted);
}

.brand-chip,
.nav-chip,
.account-item {
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.brand-chip,
.nav-chip {
  cursor: pointer;
}

.brand-chip {
  font-weight: 800;
}

.report-chip {
  min-width: 88px;
}

.nav-visibility-toggle,
.nav-restore-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  line-height: 1;
  box-shadow: var(--shadow);
}

.nav-visibility-toggle {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
}

.nav-restore-button {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 45;
  width: 42px;
  height: 42px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 180ms ease;
}

body.nav-hidden .nav-restore-button {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-restore-button[hidden] {
  display: none;
}

.nav-visibility-toggle:hover,
.nav-restore-button:hover {
  border-color: rgba(196, 81, 45, 0.22);
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.nav-popovers {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  width: 100%;
  pointer-events: none;
}

.nav-panel {
  position: fixed;
  top: 70px;
  left: 12px;
  display: grid;
  gap: 12px;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100svh - 92px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

#reportPanel {
  width: min(520px, calc(100vw - 24px));
}

.nav-panel[hidden] {
  display: none;
}

.nav-panel h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.wide-panel {
  width: min(760px, calc(100vw - 24px));
}

.account-panel {
  width: min(310px, calc(100vw - 24px));
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mini-grid div {
  padding: 10px;
  border: 1px solid rgba(54, 35, 25, 0.08);
  border-radius: 8px;
  background: var(--surface-soft);
}

.mini-grid strong,
.mini-grid span {
  display: block;
}

.mini-grid strong {
  font-size: 0.96rem;
}

.mini-grid span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.popover-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.account-item {
  padding: 10px 11px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.google-login {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.google-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.account-actions {
  display: grid;
  gap: 6px;
}

.coffee-block {
  display: grid;
  padding: 10px;
  border: 1px solid rgba(196, 81, 45, 0.22);
  border-radius: 14px;
  background: rgba(196, 81, 45, 0.08);
}

.auth-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.auth-status,
.privacy-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.auth-status {
  color: var(--ink);
  font-weight: 800;
}

.auth-form {
  display: grid;
  gap: 7px;
}

.auth-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.auth-actions .secondary-button,
.google-login {
  padding: 10px 12px;
}

.account-item.danger {
  color: #d85d65;
}

.account-item.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.panel-tabs,
.calendar-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-chip,
.calendar-strip button {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.tab-chip {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.86rem;
}

.tab-chip.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.date-search {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.date-chip {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.report-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calendar-strip button {
  display: grid;
  gap: 4px;
  min-width: 48px;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: center;
}

.calendar-strip span {
  color: var(--muted);
  font-size: 0.82rem;
}

.calendar-strip .is-hot {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.calendar-strip .is-hot span {
  color: rgba(255, 255, 255, 0.78);
}

.calendar-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  overflow: hidden;
}

.calendar-head,
.calendar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.calendar-head > div:not(.calendar-nav) {
  display: none;
}

.calendar-nav {
  display: flex;
  gap: 8px;
}

.calendar-head button,
.calendar-actions button,
.calendar-grid button {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.calendar-head button {
  font-weight: 800;
}

.arrow-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-grid span,
.calendar-grid button {
  min-width: 0;
  min-height: 28px;
  border-radius: 6px;
  text-align: center;
  font-size: 0.82rem;
}

.calendar-grid span {
  color: var(--muted);
  font-weight: 800;
}

.calendar-grid button:hover {
  background: rgba(196, 81, 45, 0.1);
}

.calendar-grid .muted-day {
  color: var(--muted);
}

.calendar-grid .selected-day {
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.archive-strip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.archive-strip span {
  color: var(--muted);
  font-size: 0.84rem;
}

.archive-strip strong {
  font-size: 0.9rem;
  text-align: right;
}

.archive-list {
  display: grid;
  gap: 8px;
}

.archive-list div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.archive-list span {
  color: var(--muted);
  font-size: 0.82rem;
}

.archive-list strong {
  font-size: 0.92rem;
}

.history-list {
  max-height: 420px;
  overflow: auto;
}

.history-card {
  display: grid;
  gap: 8px;
}

.history-card ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-card li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.history-card li.is-done {
  color: var(--ink);
}

.history-card li span {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--accent);
}

.history-empty {
  color: var(--muted);
}

.theme-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.notification-control {
  display: flex;
  gap: 8px;
  align-items: center;
}

.notification-control span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.theme-toggle {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.account-item.coffee {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.support-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 7, 10, 0.58);
  animation: supportBackdropIn 180ms ease-out both;
}

.support-modal[hidden] {
  display: none;
}

.support-card {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform-origin: center;
  animation: supportCardIn 320ms cubic-bezier(0.2, 0.85, 0.2, 1.15) both;
}

.support-portrait {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 2px solid rgba(196, 81, 45, 0.24);
  border-radius: 22px;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.5), transparent 30%),
    linear-gradient(135deg, var(--accent), #7d2e1c);
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
  box-shadow: 0 16px 28px rgba(196, 81, 45, 0.2);
}

.support-card h3,
.support-card p {
  margin: 0;
}

.support-card p:not(.section-tag) {
  color: var(--muted);
  line-height: 1.55;
}

.support-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@keyframes supportBackdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes supportCardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-modal,
  .support-card {
    animation: none;
  }
}

.brand-chip:hover,
.nav-chip:hover {
  border-color: rgba(196, 81, 45, 0.18);
  transform: translateY(-1px);
}

.brand-chip:hover {
  background: var(--accent);
  color: #fff;
}

.nav-chip:hover {
  background: rgba(196, 81, 45, 0.09);
  color: var(--ink);
}

.account-item:hover,
.popover-close:hover {
  transform: translateY(-1px);
}

.nav-chip.is-selected {
  border-color: rgba(196, 81, 45, 0.16);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 22px rgba(196, 81, 45, 0.22);
}

.coffee-nav {
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.section-tag {
  margin: 0 0 8px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.workspace {
  display: grid;
  align-items: center;
}

.mini-footer {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
  margin: 0 auto;
  padding-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: center;
  opacity: 0.72;
}

.mini-footer a {
  color: inherit;
  font-weight: 800;
  text-decoration: none;
}

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

.legal-page {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
  color: var(--ink);
  line-height: 1.7;
}

.legal-page h1,
.legal-page h2 {
  line-height: 1.15;
}

.legal-page h1 {
  margin: 18px 0;
  font-size: clamp(2rem, 7vw, 3.2rem);
}

.legal-page h2 {
  margin: 28px 0 8px;
  font-size: 1.05rem;
}

.legal-page p {
  color: var(--muted);
}

.legal-page a,
.legal-back {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.hero-panel {
  display: grid;
  place-items: center;
  align-self: stretch;
  min-height: 0;
  padding: 4px 0;
}

.timer-stage,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition:
    background-color 520ms ease,
    background 520ms ease,
    border-color 520ms ease,
    box-shadow 520ms ease;
}

.timer-stage {
  display: grid;
  gap: 16px;
  width: min(100%, 560px);
  padding: 22px;
  border-radius: var(--radius-xl);
  justify-items: center;
  transition: padding 220ms ease, gap 220ms ease;
}

.timer-stage.is-running {
  gap: 14px;
  padding: 20px;
}

.active-context,
.session-meta {
  max-height: 220px;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height 260ms ease,
    opacity 180ms ease,
    transform 220ms ease,
    margin 220ms ease;
}

.timer-stage.is-running .active-context,
.timer-stage.is-running .session-meta {
  max-height: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.mode-switcher {
  display: inline-flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-bg);
}

.mode-pill,
.primary-button,
.secondary-button,
.task-cta,
.parking-remove {
  font: inherit;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.mode-pill,
.primary-button,
.secondary-button,
.task-cta,
.parking-remove {
  cursor: pointer;
}

.mode-pill {
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.mode-pill.is-active {
  background: var(--accent);
  color: #fff;
}

.timer-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 360px);
  aspect-ratio: 1;
}

.timer-ring {
  width: 100%;
  height: auto;
  transform: rotate(-90deg);
}

.ring-track,
.ring-progress {
  fill: none;
  stroke-width: 18;
}

.ring-track {
  stroke: rgba(91, 63, 48, 0.1);
}

.ring-progress {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 641;
  stroke-dashoffset: 641;
}

.timer-core {
  position: absolute;
  inset: 50%;
  display: grid;
  place-items: center;
  width: 74%;
  height: 74%;
  padding: 16px;
  border-radius: 50%;
  text-align: center;
  background: var(--timer-core-bg);
  box-shadow: inset 0 0 0 1px rgba(70, 40, 25, 0.08);
  transform: translate(-50%, -50%);
}

.timer-core p {
  margin: 0;
}

.timer-readout {
  color: var(--timer-core-ink);
  font-variant-numeric: tabular-nums;
  font-size: clamp(3rem, 9vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.06em;
}

#timerLabel,
#timerHint {
  color: var(--timer-core-muted);
}

#timerHint {
  max-width: 15ch;
  font-size: 0.9rem;
  line-height: 1.4;
}

.timer-actions {
  display: flex;
  gap: 12px;
}

.primary-button,
.secondary-button {
  padding: 14px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
}

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

body.session-live .primary-button {
  color: #fff;
}

.secondary-button {
  background: var(--control-bg);
  color: var(--ink);
  border-color: var(--line);
}

.skip-button {
  width: 52px;
  padding-inline: 0;
  font-size: 2rem;
  line-height: 1;
}

.skip-button span {
  display: grid;
  place-items: center;
  transform: translateY(-1px);
}

.mode-pill:hover,
.primary-button:hover,
.secondary-button:hover,
.task-cta:hover,
.parking-remove:hover {
  transform: translateY(-1px);
}

.active-context {
  position: relative;
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(54, 35, 25, 0.08);
  border-radius: 18px;
  background: var(--surface-soft);
  text-align: center;
}

.session-card {
  text-align: left;
}

.session-control-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 470px);
  margin: 0 auto;
}

.session-summary-copy {
  min-width: 0;
  text-align: center;
}

.session-summary-copy strong {
  line-height: 1.25;
}

.quick-task-picker {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.quick-task-picker[hidden] {
  display: none;
}

.quick-task-picker span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.quick-task-picker select {
  min-width: 170px;
  padding: 8px 10px;
  border-radius: 10px;
}

.session-workspace {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 90;
  display: grid;
  gap: 12px;
  width: min(560px, calc(100vw - 28px));
  max-height: min(62svh, 620px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
}

.session-workspace[hidden] {
  display: none;
}

.session-work-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.session-work-header h3 {
  margin: 0;
  font-size: 1rem;
}

.task-focus-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.task-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 800;
}

.task-check-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.context-label {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.session-summary-copy,
.session-summary-copy strong,
.session-summary-copy > span {
  display: block;
}

.session-summary-copy strong {
  font-size: 1.08rem;
}

.session-summary-copy > span {
  color: var(--muted);
}

.session-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
  margin: 0;
}

.session-meta div,
.insight-strip div {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid rgba(54, 35, 25, 0.08);
}

.session-meta div {
  text-align: center;
}

.session-meta dt,
.insight-strip span {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.session-meta dd,
.insight-strip strong {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.panel {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
}

.insight-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.88rem;
}

.task-form,
.parking-form,
.settings-form,
.project-form {
  display: grid;
  gap: 10px;
}

.task-form {
  grid-template-columns: 1.2fr 0.55fr;
  align-items: end;
}

.task-form-compact {
  grid-template-columns: 1.2fr 0.8fr auto;
}

.project-form {
  grid-template-columns: 1fr 0.45fr auto;
  align-items: end;
}

.project-focus-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.project-focus-card progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--control-bg);
}

.project-focus-card progress::-webkit-progress-bar {
  background: var(--control-bg);
}

.project-focus-card progress::-webkit-progress-value,
.project-focus-card progress::-moz-progress-bar {
  background: var(--accent);
}

.settings-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
}

.management-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 12px;
}

.management-grid article {
  display: grid;
  gap: 10px;
}

label span {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(54, 35, 25, 0.12);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid transparent;
  border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--focus-glow);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.task-list,
.parking-list,
.project-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-item,
.parking-item,
.project-item {
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid rgba(54, 35, 25, 0.08);
  border-radius: 14px;
  background: var(--surface-soft);
}

.task-item {
  grid-template-columns: auto 1fr;
}

.checklist-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.checklist-item.is-done .task-title {
  color: var(--muted);
  text-decoration: line-through;
}

.project-item,
.parking-item {
  grid-template-columns: 1fr auto;
}

.task-item.is-active {
  border-color: rgba(196, 81, 45, 0.34);
  box-shadow: inset 0 0 0 1px rgba(196, 81, 45, 0.12);
}

.task-badge,
.task-cta,
.parking-remove {
  border-radius: 999px;
  font: inherit;
}

.task-badge {
  padding: 7px 9px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.task-title,
.project-name {
  margin: 0;
  font-weight: 800;
}

.task-subtitle,
.parking-item span,
.project-meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.task-cta,
.parking-remove {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
}

body.dark-mode .task-cta,
body.dark-mode .parking-remove,
body.session-live .task-cta,
body.session-live .parking-remove,
html.preload-dark .task-cta,
html.preload-dark .parking-remove {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
}

.parking-form {
  grid-template-columns: 1fr auto;
}

.insight-strip {
  display: grid;
  gap: 8px;
}

.is-running .timer-core {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 0 10px rgba(225, 138, 255, 0.08);
}

@media (max-width: 1024px) {
  .management-grid,
  .settings-form,
  .project-form,
  .task-form-compact {
    grid-template-columns: 1fr;
  }

  .task-form {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1100px);
    gap: 12px;
    padding-bottom: 14px;
  }

  .app-nav {
    width: 100%;
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr auto;
    top: 6px;
    border-radius: 20px;
  }

  .nav-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .nav-visibility-toggle {
    justify-self: end;
  }

  .brand-chip {
    justify-self: start;
  }

  .nav-popovers {
    top: 0;
    width: calc(100% - 20px);
    left: 10px;
  }

  .mini-grid {
    grid-template-columns: 1fr;
  }

  .report-grid,
  .date-search,
  .theme-tools {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .timer-stage,
  .panel {
    padding: 18px;
  }

  .hero-panel {
    min-height: 0;
    padding: 0;
  }

  .mini-footer {
    width: min(100%, 620px);
    font-size: 0.74rem;
  }

  .session-meta {
    grid-template-columns: 1fr;
  }

  .timer-actions,
  .parking-form,
  .settings-form {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .timer-actions {
    display: grid;
  }

  .task-item {
    grid-template-columns: 1fr;
  }
}
