@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/noto-sans.woff2") format("woff2");
}

:root {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --ink: #333333;
  --muted: #646b78;
  --line: #d1d5db;
  --brand: #fdd619;
  --on-brand: #333333;
  --header: #fff4c2;
  --on-header: #333333;
  --go: #1c8c4e;
  --on-go: #ffffff;
  --stop: #c62828;
  --on-stop: #ffffff;
  --focus: #111111;
  --danger: #b42318;
  --warn-bg: #fff4b8;
  --warn-ink: #333333;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  --nav-bg: rgba(255, 255, 255, 0.94);
  --backdrop: rgba(0, 0, 0, 0.46);
  --nav: 5.35rem;
  color-scheme: light;
  font-family: "Noto Sans", "Segoe UI", sans-serif;
  font-size: 16.5px;
  line-height: 1.45;
}

:root[data-theme="dark"] {
  --bg: #121212;
  --surface: #1e1e1e;
  --ink: #f3f3f3;
  --muted: #b5b5b5;
  --line: #3a3a3a;
  --go: #3dcc78;
  --on-go: #06210f;
  --stop: #ef5350;
  --on-stop: #2a0707;
  --focus: #fdd619;
  --danger: #ff8a80;
  --warn-bg: #3a3208;
  --warn-ink: #ffe58a;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --nav-bg: rgba(18, 18, 18, 0.94);
  --backdrop: rgba(0, 0, 0, 0.66);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled,
.btn.primary:disabled,
.menu button:disabled {
  opacity: 0.48;
  cursor: default;
  background: var(--bg);
  color: var(--muted);
  border-color: var(--line);
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.app {
  --pad-top: calc(1rem + env(safe-area-inset-top));
  width: min(42rem, 100%);
  margin: 0 auto;
  padding: var(--pad-top) 1rem calc(var(--nav) + 1.5rem + env(safe-area-inset-bottom));
}

.booting, .lock { padding: 2rem 0.25rem; }
.brand {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--on-header);
}
.logo { height: 40px; width: auto; max-width: 148px; object-fit: contain; display: block; }
.logo-plate { display: inline-flex; align-items: center; background: transparent; line-height: 0; }
.brand-lockup { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.date, .quiet, .lede, .since { color: var(--muted); }
.date { margin: 0.1rem 0 0; }
.top {
  display: block;
  margin: calc(var(--pad-top) * -1) -1rem 1.1rem;
  padding: calc(0.7rem + env(safe-area-inset-top)) 1rem 0.75rem;
  background: var(--header);
  color: var(--on-header);
}
.top-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}
.top-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.4rem; }
a.theme-toggle { display: inline-flex; align-items: center; text-decoration: none; font: inherit; }
.top .date, .top .offline, .top .sync-status { color: var(--on-header); }
.offline, .sync-status { margin: 0.35rem 0 0; font-size: 0.92rem; }
.local-status {
  display: block;
  width: 100%;
  margin: 0.55rem 0 0;
  padding: 0.5rem 0.7rem;
  text-align: left;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--on-header) 28%, transparent);
  background: color-mix(in srgb, #ffffff 42%, var(--brand));
  color: var(--on-header);
}
.local-status strong, .local-status small { display: block; }
.local-status small { font-weight: 500; }
.offline-status {
  display: block;
  width: 100%;
  margin: 0.55rem 0 0;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  border: 1px solid #7a1c14;
  background: #fff;
  color: #7a1c14;
}
.offline-status strong, .offline-status small { display: block; }
.offline-status small { font-weight: 500; color: #333; }
.diverge-status {
  display: block;
  width: 100%;
  margin: 0.55rem 0 0;
  padding: 0.5rem 0.7rem;
  text-align: left;
  border-radius: 10px;
  border: 1px solid #7a1c14;
  background: #fff;
  color: #7a1c14;
}
.diverge-status strong, .diverge-status small { display: block; }
.diverge-status small { font-weight: 500; color: #333; }
.version-block { margin-top: 1.1rem; }
.version-block p { margin: 0.15rem 0; }
.version-block .row-actions { margin-top: 0.55rem; }
.diverge-list { margin: 0.2rem 0 0.85rem; padding-left: 1.15rem; }
.diverge-list li { margin: 0.15rem 0; }
.sync-status.is-ok { font-weight: 650; }
.sync-status.is-bad, .top .sync-status.is-bad { color: #7a1c14; font-weight: 650; }
.header-actions { display: flex; align-items: center; gap: 0.4rem; }
.theme-toggle {
  border: 1px solid color-mix(in srgb, var(--on-header) 35%, transparent);
  background: transparent;
  color: var(--on-header);
  border-radius: 8px;
  min-height: 2.75rem;
  padding: 0.3rem 0.75rem;
  font-weight: 700;
}
.icon-btn {
  border: 1px solid color-mix(in srgb, var(--on-header) 35%, transparent);
  background: transparent;
  color: var(--on-header);
  border-radius: 8px;
  width: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
}
.icon-btn.is-on {
  background: color-mix(in srgb, var(--on-header) 14%, transparent);
  border-color: var(--on-header);
}
.theme-icon { width: 1.35rem; height: 1.35rem; display: block; pointer-events: none; }

.hero { display: grid; justify-items: center; text-align: center; gap: 0.75rem; padding: 0.5rem 0 1.25rem; }
.lede { max-width: 24rem; margin: 0; }
.since { margin: 0; }
.elapsed {
  margin: 0;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  font-size: clamp(3rem, 12vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.current-cat { display: flex; align-items: center; gap: 0.45rem; margin: 0; }
.go {
  width: 10.5rem;
  height: 10.5rem;
  border: 0;
  border-radius: 50%;
  background: var(--go);
  color: var(--on-go);
  font-size: 1.55rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--go) 16%, transparent), var(--shadow);
  touch-action: manipulation;
}
.go.is-on {
  background: var(--stop);
  color: var(--on-stop);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--stop) 18%, transparent), var(--shadow);
}
@media (prefers-reduced-motion: no-preference) {
  .go.is-on { animation: pulse 2.4s ease-in-out infinite; }
}
@keyframes pulse {
  50% { box-shadow: 0 0 0 16px color-mix(in srgb, var(--stop) 8%, transparent), var(--shadow); }
}

.chips, .mode-switch { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.chip, .choice-btn, .btn, .nav button, .pad button, .menu button, .week-day, .day {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
}
.chip, .btn { min-height: 2.75rem; padding: 0.45rem 0.9rem; }
.chip.is-on, .choice-btn.is-on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.menu button:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); color: var(--on-brand); border-color: transparent; font-weight: 700; }
.btn.secondary { background: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.btn.wide, .btn.primary, .btn.danger, .btn.secondary.wide { width: 100%; border-radius: 14px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }

.total-row, .big-total {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin: 0.5rem 0 1rem;
}
.total-row strong, .big-total strong {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: 1.7rem;
}
.total-row span, .big-total span { color: var(--muted); }

.banner {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  margin: 0.8rem 0;
}
.banner p { margin: 0 0 0.6rem; }
.limit-notes ul { margin: 0 0 0.6rem; padding-left: 1.1rem; }
.limit-notes li + li { margin-top: 0.35rem; }
.limit-notes .limit-basis { margin: 0; font-size: 0.85rem; }
.quiet-banner { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.share-note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  margin: 0.8rem 0;
}
.share-note p { margin: 0 0 0.35rem; }
.help-shot { margin: 0; }
.help-shot img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
}
.help-shot figcaption, .help h3 { margin: 0; }
.help h3 { font-size: 1.05rem; }
.help-shot figcaption { color: var(--muted); font-size: 0.92rem; }
.check-code {
  margin: 0.4rem 0;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}
.section-head h2, .day-block h3, .pager h2, h2 { font-size: 1.15rem; font-weight: 650; }
.section-head { margin-top: 1rem; }
.empty { color: var(--muted); }

.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.entry {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 16px;
  padding: 0.8rem 0.9rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.75rem;
}
.entry.is-overlap { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); }
.entry-time, .entry-dur { font-variant-numeric: tabular-nums; }
.entry-time { font-weight: 650; }
.entry-dur { color: var(--muted); }
.entry-meta, .entry-note, .entry-flag { grid-column: 1 / -1; color: var(--muted); font-size: 0.95rem; }
.entry-flag { color: var(--warn-ink); }
.dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.35rem;
  vertical-align: -0.05rem;
}
.cat-unterricht { background: #1d4e89; }
.cat-vorbereitung { background: #0e6b52; }
.cat-korrekturen { background: #8a4b08; }
.cat-besprechungen { background: #5c4d7a; }
.cat-organisation { background: #3f5d56; }
.cat-sonstiges, .cat-none { background: #8a8178; }
.cat-unclear { background: #a15c07; }
.cat-none { background: transparent; border: 1.5px dashed var(--muted); }

.bar { display: block; height: 0.45rem; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: inherit; }
.stats { list-style: none; margin: 0.5rem 0 1rem; padding: 0; display: grid; gap: 0.7rem; }
.stat-label { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.25rem; }
.stat-label strong { white-space: nowrap; }

.pager { display: grid; grid-template-columns: 2.75rem 1fr 2.75rem; align-items: center; gap: 0.5rem; }
.pager h2 { text-align: center; margin: 0; }
.pager button, .pad button {
  min-height: 2.75rem;
  border-radius: 12px;
}
.week-bars { list-style: none; margin: 0.5rem 0 1rem; padding: 0; display: grid; gap: 0.4rem; }
.week-day {
  width: 100%;
  display: grid;
  grid-template-columns: 7.5rem 1fr auto;
  gap: 0.6rem;
  align-items: center;
  border-radius: 12px;
  padding: 0.45rem 0.6rem;
  text-align: left;
}
.week-day.is-today { border-color: var(--go); }
.day-block { margin: 1.2rem 0; }

.month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.3rem;
  margin: 0.8rem 0 1rem;
}
.dow { text-align: center; color: var(--muted); font-size: 0.78rem; }
.day {
  aspect-ratio: 1;
  border-radius: 12px;
  padding: 0.15rem;
  display: grid;
  align-content: center;
  justify-items: center;
}
.day b { font-weight: 600; }
.day small { color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1em; }
.day.is-today { border-color: var(--brand); }
.day.is-selected { background: var(--ink); color: var(--surface); }
.day.is-selected small { color: inherit; }


.menu-section { display: grid; gap: 0.4rem; margin-top: 1.15rem; }
.section-body {
  display: grid;
  gap: 0.85rem;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.section-body > p,
.section-body > .banner,
.section-body > .form-error { margin: 0; }
.section-body .stats-list,
.section-body .prose { margin: 0; }
.group-label {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  font-weight: 700;
}
.banner-link {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}
.menu-section > h3 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.menu { display: grid; gap: 0.5rem; }
.wipe-warn {
  margin: 0 0 0.8rem;
  padding: 0.9rem 1rem;
  border: 2px solid var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  font-weight: 700;
}
.menu button {
  width: 100%;
  text-align: left;
  border-radius: 16px;
  padding: 0.8rem 0.9rem;
  display: grid;
}
.menu small, .choice-btn small { color: var(--muted); }
.choice-btn.is-on small { color: inherit; opacity: 0.8; }

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  background: var(--nav-bg);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.app-version {
  margin: 0;
  padding: 0 0.75rem 0.4rem;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--muted);
}
.nav button {
  border: 0;
  border-radius: 0;
  background: transparent;
  min-height: 3.25rem;
  color: var(--muted);
}
.nav button[aria-current="page"] { color: var(--ink); font-weight: 700; box-shadow: inset 0 -3px 0 var(--brand); }
.nav-admin { display: flex; overflow-x: auto; scrollbar-width: none; }
.nav-admin button { flex: 1 0 auto; padding-inline: 0.75rem; white-space: nowrap; }
.worktime-row { display: grid; gap: 0.5rem; border: 1px solid var(--line); border-radius: 12px; padding: 0.75rem; margin: 0 0 0.75rem; }
.preview-table, .data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.preview-table th, .preview-table td, .data-table th, .data-table td { padding: 0.3rem 0.35rem; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.preview-table th:first-child, .preview-table td:first-child, .data-table th:first-child, .data-table td:first-child { text-align: left; }
select { width: 100%; min-height: 2.75rem; border: 1px solid var(--line); background: var(--bg); color: inherit; border-radius: 12px; padding: 0.5rem 0.6rem; font-size: 16px; }
.plan-grid { display: grid; grid-template-columns: 2.6rem repeat(5, minmax(0, 1fr)); gap: 0.2rem; font-size: 0.8rem; }
.plan-grid .plan-head { text-align: center; color: var(--muted); }
.plan-grid .plan-slot { color: var(--muted); align-self: center; line-height: 1.1; }
.plan-grid button { min-height: 2.75rem; padding: 0.1rem; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; overflow: hidden; color: inherit; }
.plan-grid button.is-set { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.day-plan { list-style: none; margin: 0.4rem 0 0.8rem; padding: 0; display: grid; gap: 0.35rem; }
.day-plan button { width: 100%; display: flex; justify-content: space-between; gap: 0.6rem; align-items: center; min-height: 2.75rem; padding: 0.35rem 0.7rem; border: 1px solid var(--line); background: var(--surface); color: inherit; border-radius: 12px; text-align: left; }
.day-plan .is-out { text-decoration: line-through; color: var(--muted); }
.day-plan .is-sub { border-color: var(--brand); font-weight: 600; }
.balance-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; text-align: center; margin: 0.5rem 0 0.9rem; padding: 0.6rem; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; }
.balance-card small { display: block; color: var(--muted); }
.balance-card strong { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.95rem; }
.mau-quick { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.4rem 0 0.8rem; }
.message-item { border-bottom: 1px solid var(--line); padding: 0.55rem 0; }
.message-item.is-new h3 { color: var(--ink); }
.message-item p { margin: 0.2rem 0; white-space: pre-wrap; }
.nav-admin button {
  font-size: 0.72rem;
  line-height: 1.15;
  padding: 0.4rem 0.15rem;
  min-width: 0;
  white-space: normal;
  hyphens: manual;
}
body.admin-panels .view > .menu-section { display: none; }
body.admin-panels .view > .menu-section.is-on { display: grid; }
@media (max-width: 520px) {
  body.admin-panels .top-bar { grid-template-columns: 1fr; }
  body.admin-panels .top-actions { justify-content: flex-start; }
}

.backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
html.ios-standalone .backdrop { position: absolute; }
.sheet {
  width: min(40rem, 100%);
  max-height: min(92dvh, 860px);
  overflow: auto;
  background: var(--surface);
  color: var(--ink);
  border-radius: 22px 22px 0 0;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
}
.sheet-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.sheet-bar h2 { margin: 0; }
.sheet form, .prose { display: grid; gap: 0.75rem; }
label { display: block; }
label > input,
label > textarea,
label > select {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
}
label > input[type="checkbox"],
label > input[type="radio"],
label > input[type="hidden"] {
  display: inline-block;
  width: auto;
  margin-top: 0;
}
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 12px;
  padding: 0.7rem 0.75rem;
  font-size: 16px;
  touch-action: auto;
  user-select: text;
  -webkit-user-select: text;
}
input[type="color"] {
  height: 3rem;
  padding: 0.35rem;
  cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch,
input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 8px;
}
.choices { border: 0; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.choices legend { margin-bottom: 0.3rem; }
.stats-profile { display: grid; gap: 0.75rem; margin: 0.5rem 0 0.25rem; }
.stats-profile > p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.choice { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 0.55rem; }
.choice input { width: auto; }
.choice-btn, .stack { display: grid; }
.choice-btn {
  width: 100%;
  text-align: left;
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.4rem;
}
.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.preview { min-height: 1.4em; color: var(--muted); margin: 0; }
.form-error { color: var(--danger); margin: 0.2rem 0; }
.category-save { order: 1; }
.category-row { display: flex; gap: 0.4rem; align-items: center; }
.category-row input[type="text"], .category-row input:not([type="color"]):not([type="hidden"]) { width: auto; flex: 1; min-width: 0; }
.category-row input[type="color"] { width: 2.75rem; height: 2.75rem; padding: 0.2rem; flex: none; }
.category-row .btn { width: auto; border-radius: 999px; padding: 0.45rem 0.7rem; }
.stats-list { list-style: none; padding: 0; margin: 0.5rem 0 1rem; }
.stats-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.feedback-list li { align-items: flex-start; }
.feedback-copy { flex: 1; min-width: 0; }
.feedback-copy p { margin: 0.2rem 0; overflow-wrap: anywhere; }
.stats-person { margin: 0.75rem 0; }
.stats-person summary { cursor: pointer; padding: 0.35rem 0; }
.stats-days { width: 100%; border-collapse: collapse; margin: 0.4rem 0 0.8rem; }
.stats-days th, .stats-days td { text-align: left; padding: 0.35rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.stats-days td:last-child, .stats-days th:last-child { text-align: right; white-space: nowrap; }
.secret {
  font-family: ui-monospace, monospace;
  font-size: 0.92rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  user-select: all;
  background: var(--bg);
  border-radius: 12px;
  padding: 0.8rem;
}
.qr { background: white; border-radius: 12px; padding: 0.6rem; }
.qr svg { width: min(100%, 280px); height: auto; display: block; margin: 0 auto; }
.scan { width: 100%; border-radius: 12px; background: #111; min-height: 220px; max-height: 46vh; object-fit: cover; }
.overlap-card { border: 1px solid var(--line); border-radius: 16px; padding: 0.8rem; margin-bottom: 0.7rem; }
.overlap-card h3 { margin: 0 0 0.4rem; }

.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.45rem; margin: 0.8rem 0; }
.pad button { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.dots { display: flex; gap: 0.45rem; min-height: 1rem; margin: 0.8rem 0; }
.dots i { width: 0.7rem; height: 0.7rem; border-radius: 50%; border: 1.5px solid var(--ink); display: block; }
.dots i.is-on { background: var(--ink); }
.lock { text-align: center; max-width: 22rem; margin: 8vh auto; padding-bottom: 2.5rem; }
.lock .app-version {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.45rem 0.75rem calc(0.45rem + env(safe-area-inset-bottom));
  background: var(--bg);
}
.lock h1 { font-weight: 650; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav) + 0.4rem);
  transform: translateX(-50%);
  width: min(40rem, calc(100% - 1.5rem));
  background: var(--ink);
  color: var(--surface);
  border-radius: 16px;
  padding: 0.75rem 0.9rem;
  z-index: 15;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
}
.toast p { margin: 0; }
.toast .btn { color: inherit; pointer-events: auto; }
.view.has-toast { padding-bottom: 6.5rem; }
.quick-add { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; align-items: center; }
.quick-add span { color: var(--muted); }
.long-hint { margin: 0; max-width: 24rem; color: var(--danger, #b42318); font-weight: 600; }

.app-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: calc(var(--pad-top) * -1) -1rem 0;
  padding: calc(0.55rem + env(safe-area-inset-top)) 1rem 0.55rem;
  background: var(--header);
  color: var(--on-header);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--on-header) 14%, transparent);
}
.app-bar .brand-lockup { flex: 1 1 auto; min-width: 0; gap: 0.5rem; }
.app-bar .logo { height: 32px; }
.brand-text { min-width: 0; }
.brand-text .brand { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text .date { margin: 0; font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--on-header); }
.head-timer {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.25rem 0.75rem;
  border: 0;
  border-radius: 999px;
  background: var(--go);
  color: var(--on-go);
  font-weight: 650;
}
.head-timer.is-running { background: var(--stop); color: var(--on-stop); }
.head-timer strong { font-variant-numeric: tabular-nums; }
.bar-theme { display: none; }
.top-note { margin: 0 -1rem 1.1rem; padding: 0 1rem 0.75rem; background: var(--header); color: var(--on-header); }
.top-note.is-empty { padding: 0; background: transparent; }
.top-note .offline, .top-note .sync-status, .top-note .date { color: var(--on-header); }
.top-note .sync-status.is-bad { color: #7a1c14; font-weight: 650; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 24; background: var(--backdrop); display: none; }
.drawer-backdrop.is-open { display: block; }
.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 25;
  width: min(20rem, 86vw);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(0.55rem + env(safe-area-inset-top)) 0.6rem calc(1rem + env(safe-area-inset-bottom));
  background: var(--surface);
  color: var(--ink);
  border-right: 1px solid var(--line);
  transform: translateX(-102%);
  visibility: hidden;
  outline: 0;
}
.drawer.is-open { transform: none; visibility: visible; }
@media (prefers-reduced-motion: no-preference) {
  .drawer.is-open { animation: drawer-in 0.16s ease-out; }
  @keyframes drawer-in { from { transform: translateX(-30%); opacity: 0.6; } }
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0 0.3rem 0.5rem; }
.drawer-head .brand { color: var(--ink); }
.drawer-tools { display: inline-flex; gap: 0.4rem; }
.drawer-tools .icon-btn { color: var(--ink); }
.drawer-group { padding: 0.35rem 0; border-top: 1px solid var(--line); }
.drawer-group h2 { margin: 0.35rem 0.5rem 0.2rem; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.drawer-group button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.3rem 0.55rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
}
.drawer-group button:hover { background: var(--bg); }
.drawer-group button[aria-current="page"] { background: var(--brand); color: var(--on-brand); font-weight: 650; }
.drawer-group small { color: var(--muted); }
.drawer-group button[aria-current="page"] small { color: inherit; }
.lock-badge { flex: 0 0 auto; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 0.75rem; font-weight: 650; }
body.menu-open { overflow: hidden; }
@media (min-width: 480px) {
  .bar-theme { display: inline-flex; }
}

@media (min-width: 800px) {
  .app { --pad-top: 0; }
  body.with-nav .app-bar, body.with-nav .top-note {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: max(1rem, calc(50vw - 20rem));
    padding-right: max(1rem, calc(50vw - 20rem));
  }
  .top {
    width: 100vw;
    max-width: 100vw;
    margin: 0 0 1.1rem;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
    padding: 0.85rem max(1rem, calc(50vw - 20rem)) 0.75rem;
  }
  .backdrop { align-items: center; padding: 1rem; }
  .sheet { border-radius: 22px; max-height: min(88dvh, 860px); }
  .dock {
    background: transparent;
    border-top: 0;
    padding: 0 0 0.55rem;
  }
  .nav {
    width: min(42rem, calc(100% - 2rem));
    margin: 0 auto 0.35rem;
    background: var(--nav-bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
  }
}

@media (min-width: 1024px) {
  body.with-nav .app { width: auto; margin: 0 0 0 15rem; padding-bottom: 2rem; }
  body.with-nav .app-bar, body.with-nav .top-note { margin-left: -1rem; margin-right: -1rem; padding-left: 1.5rem; padding-right: 1.5rem; }
  body.with-nav .top-note.is-empty { padding: 0; }
  body.with-nav main.view { max-width: 42rem; margin: 0 auto; }
  body.with-nav .drawer { width: 15rem; z-index: 6; transform: none; visibility: visible; animation: none; }
  body.with-nav .drawer-backdrop { display: none; }
  body.with-nav .menu-btn, body.with-nav .drawer-tools { display: none; }
  body.with-nav .dock { display: none; }
  body.with-nav .toast { bottom: 1rem; left: calc(50% + 7.5rem); }
  body.with-nav .view.has-toast { padding-bottom: 5rem; }
  body.menu-open { overflow: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
}
