:root {
  --bg: #f5efe1;
  --bg-2: #efe7d5;
  --surface: #fffdf8;
  --surface-2: #fbf6ea;
  --ink: #1d2a23;
  --ink-2: #32453a;
  --muted: #6f7f74;
  --line: #e4dac6;
  --line-strong: #d5c8ae;
  --green: #14532d;
  --green-2: #1f7a4d;
  --green-3: #2f9c67;
  --green-soft: #dcefe2;
  --cream: #fff7e6;
  --amber: #d97706;
  --amber-2: #f59e0b;
  --amber-soft: #fdecc8;
  --blue: #2563eb;
  --blue-soft: #e2ebff;
  --purple: #7c3aed;
  --purple-soft: #ede6ff;
  --danger: #b42318;
  --danger-soft: #fde4e1;
  --shadow: 0 16px 40px rgba(43, 47, 38, 0.09);
  --shadow-soft: 0 8px 20px rgba(43, 47, 38, 0.06);
  --radius: 26px;
  --radius-sm: 16px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -8%, rgba(245, 158, 11, 0.14), transparent 38%),
    radial-gradient(circle at 96% 2%, rgba(31, 122, 77, 0.12), transparent 34%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.app {
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) clamp(16px, 3vw, 36px) 118px;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 17px;
  color: var(--cream);
  background: linear-gradient(145deg, var(--green), var(--green-2));
  box-shadow: 0 10px 22px rgba(20, 83, 45, 0.26);
  flex: none;
}
.brand-mark svg { width: 27px; height: 27px; stroke-width: 2; }
.brand-text h1 { font-size: clamp(20px, 2.2vw, 25px); letter-spacing: 0.01em; line-height: 1.15; }
.brand-text p { margin-top: 3px; color: var(--muted); font-size: 14px; }
.topbar-side { display: flex; align-items: center; gap: 12px; }
.live-clock {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}
.wake-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.wake-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-3); box-shadow: 0 0 0 4px rgba(47, 156, 103, 0.16); }
.focus-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--green);
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1;
  box-shadow: var(--shadow-soft);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.focus-badge svg { width: 17px; height: 17px; }
.focus-badge:hover { border-color: var(--green-2); }
.focus-badge.active { border-color: var(--green); background: var(--green); color: var(--cream); }

/* ---------- common ---------- */
.card {
  background: var(--surface);
  border: 1px solid rgba(228, 218, 198, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.card-head h2, .card-head h3 { font-size: 19px; line-height: 1.2; }
.card-head p { margin-top: 5px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.head-icon { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; color: var(--green-2); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 19px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--green); color: var(--cream); box-shadow: 0 8px 18px rgba(20, 83, 45, 0.18); }
.btn-primary:hover { background: #0e4325; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-cream { background: var(--cream); color: var(--green); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14); }
.btn-cream:hover { background: #fff; }
.btn-hero-ghost { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 247, 230, 0.34); color: var(--cream); }
.btn-hero-ghost:hover { background: rgba(255, 255, 255, 0.13); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #97190f; }
.btn-danger-ghost { color: var(--danger); border-color: rgba(180, 35, 24, 0.24); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-small { min-height: 38px; padding: 8px 13px; font-size: 13.5px; }
.btn-small svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.8);
  color: var(--ink-2);
  transition: background 0.16s ease, transform 0.16s ease;
}
.icon-btn:hover { background: var(--surface); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- views ---------- */
.view { animation: fadeUp 0.34s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- today ---------- */
.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(330px, 0.82fr);
  gap: 20px;
  align-items: stretch;
}
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 470px;
  padding: clamp(24px, 3vw, 38px);
  border-radius: 32px;
  overflow: hidden;
  overflow: clip;
  color: var(--cream);
  background:
    radial-gradient(circle at 88% 8%, rgba(245, 158, 11, 0.35), transparent 36%),
    radial-gradient(circle at 8% 100%, rgba(47, 156, 103, 0.5), transparent 42%),
    linear-gradient(135deg, #103f24 0%, #14532d 48%, #1f7a4d 100%);
  box-shadow: 0 24px 50px rgba(20, 83, 45, 0.28);
}
.hero::before {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: 18px;
  bottom: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 247, 230, 0.16);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: 68px;
  bottom: 64px;
  border-radius: 50%;
  border: 1px solid rgba(255, 247, 230, 0.12);
  pointer-events: none;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; z-index: 1; }
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(253, 236, 200, 0.28);
  color: #ffe6b4;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.hero-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber-2); }
.hero-check {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 247, 230, 0.3);
  border-radius: 50%;
  background: rgba(255, 247, 230, 0.08);
  color: var(--cream);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background 0.2s ease, transform 0.16s ease;
}
.hero-check.show { opacity: 1; pointer-events: auto; }
.hero-check:hover { background: rgba(255, 247, 230, 0.2); }
.hero-check:active { transform: scale(0.94); }
.hero-check svg { width: 22px; height: 22px; stroke-width: 2.2; }
.hero-title {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  font-size: clamp(30px, 3.8vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  font-weight: 800;
  text-wrap: balance;
  max-width: 16em;
}
.hero-sub {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  margin-bottom: 18px;
  color: rgba(255, 247, 230, 0.72);
  font-size: clamp(14px, 1.4vw, 16px);
  line-height: 1.55;
  max-width: 30em;
}
.hero-time-wrap { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 12px; margin-top: auto; }
.hero-time {
  font-size: clamp(58px, 7.4vw, 92px);
  line-height: 0.92;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
}
.hero-time-label { padding-bottom: 10px; color: rgba(255, 247, 230, 0.62); font-size: 14px; font-weight: 600; }
.hero-progress {
  position: relative;
  z-index: 1;
  height: 9px;
  margin-top: 20px;
  border-radius: 999px;
  background: rgba(255, 247, 230, 0.16);
  overflow: hidden;
}
.hero-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber-2), #ffd88a);
  transition: width 0.9s linear;
}
.hero-next {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  color: rgba(255, 247, 230, 0.74);
  font-size: 14.5px;
  min-height: 22px;
}
.hero-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.timeline-card {
  display: flex;
  flex-direction: column;
  min-height: 470px;
  max-height: min(560px, calc(100vh - 300px));
  padding: 22px 20px 16px;
  overflow: hidden;
}
.timeline-card .card-head { margin-bottom: 8px; }
.timeline {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 2px 4px;
  margin: 0 -2px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.timeline::-webkit-scrollbar { width: 6px; }
.timeline::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
.timeline-item {
  --kind: var(--green-2);
  --kind-soft: var(--green-soft);
  display: grid;
  grid-template-columns: 58px 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  border-radius: 16px;
  border-bottom: 1px dashed rgba(213, 200, 174, 0.55);
  transition: background 0.2s ease, opacity 0.2s ease;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-item.kind-play { --kind: var(--amber); --kind-soft: var(--amber-soft); }
.timeline-item.kind-rest { --kind: var(--blue); --kind-soft: var(--blue-soft); }
.timeline-item.kind-routine { --kind: var(--purple); --kind-soft: var(--purple-soft); }
.timeline-item.is-current { background: var(--kind-soft); }
.timeline-item.is-past { opacity: 0.5; }
.timeline-item.is-done .tl-title { text-decoration: line-through; color: var(--muted); }
.timeline-item.is-done { opacity: 0.58; }
.tl-time { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.tl-time span { display: block; margin-top: 3px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.tl-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--kind); box-shadow: 0 0 0 4px color-mix(in srgb, var(--kind) 14%, transparent); }
.timeline-item.is-current .tl-dot { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--kind) 16%, transparent); }
  50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--kind) 6%, transparent); }
}
.tl-body { min-width: 0; }
.tl-actions { display: flex; align-items: center; gap: 2px; }
.tl-title { font-size: 15px; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-meta { margin-top: 4px; color: var(--muted); font-size: 12px; }
.tl-check, .tl-edit {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.14s ease;
}
.tl-check:hover, .tl-edit:hover { border-color: var(--green-2); color: var(--green-2); }
.tl-check:active, .tl-edit:active { transform: scale(0.92); }
.tl-check svg, .tl-edit svg { width: 16px; height: 16px; }
.timeline-item.is-done .tl-check { background: var(--green); border-color: var(--green); color: #fff; }
.tl-edit { border-color: transparent; opacity: 0.55; }
.tl-edit:hover { border-color: var(--line-strong); background: var(--surface); opacity: 1; }
.timeline-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; flex: 1; padding: 26px 10px 18px; text-align: center; }
.timeline-empty.hidden { display: none; }
.timeline-empty p { color: var(--muted); font-size: 13.5px; line-height: 1.55; max-width: 15em; }
.empty-art { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 20px; background: var(--green-soft); color: var(--green-2); }
.empty-art svg { width: 27px; height: 27px; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }

.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.stat { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 19px; }
.stat-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; flex: none; }
.stat-icon svg { width: 21px; height: 21px; }
.stat-icon.study { background: var(--green-soft); color: var(--green-2); }
.stat-icon.play { background: var(--amber-soft); color: var(--amber); }
.stat-icon.done { background: var(--blue-soft); color: var(--blue); }
.stat-icon.total { background: var(--purple-soft); color: var(--purple); }
.stat strong { display: block; font-size: 21px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }

/* ---------- plan ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 6px 2px 18px;
}
.section-head h2 { font-size: clamp(24px, 2.6vw, 31px); letter-spacing: -0.01em; }
.section-head p { margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.section-actions { display: flex; gap: 10px; flex: none; }

.plan-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px 44px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.55);
}
.plan-empty-art {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 24px;
  background: linear-gradient(145deg, var(--green-soft), var(--amber-soft));
  color: var(--green);
  margin-bottom: 16px;
}
.plan-empty-art svg { width: 34px; height: 34px; }
.plan-empty h3 { font-size: 22px; }
.plan-empty p { margin-top: 7px; color: var(--muted); font-size: 14.5px; }
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 190px)); gap: 12px; margin-top: 22px; }
.template-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  text-align: left;
  transition: border-color 0.18s ease, transform 0.16s ease, box-shadow 0.18s ease;
}
.template-card:hover { border-color: var(--green-2); box-shadow: var(--shadow-soft); transform: translateY(-2px); }
.template-card strong { font-size: 16px; }
.template-card small { color: var(--muted); font-size: 12.5px; }
.template-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; margin-bottom: 5px; }
.template-icon.weekday { background: var(--green-soft); color: var(--green-2); }
.template-icon.weekend { background: var(--amber-soft); color: var(--amber); }
.template-icon svg { width: 21px; height: 21px; }

.plan-list { display: flex; flex-direction: column; gap: 10px; }
.plan-row {
  --kind: var(--green-2);
  --kind-soft: var(--green-soft);
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.18s ease, transform 0.16s ease;
}
.plan-row.kind-play { --kind: var(--amber); --kind-soft: var(--amber-soft); }
.plan-row.kind-rest { --kind: var(--blue); --kind-soft: var(--blue-soft); }
.plan-row.kind-routine { --kind: var(--purple); --kind-soft: var(--purple-soft); }
.plan-row:hover { border-color: var(--line-strong); }
.plan-row.is-current { border-color: var(--kind); box-shadow: 0 0 0 3px color-mix(in srgb, var(--kind) 12%, transparent), var(--shadow-soft); }
.plan-row.is-done { opacity: 0.56; }
.plan-row.is-done .plan-title { text-decoration: line-through; }
.plan-time { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-time span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.plan-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.plan-kind-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--kind); flex: none; }
.plan-title { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-meta { margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.plan-actions { display: flex; align-items: center; gap: 6px; }
.plan-actions .icon-btn { width: 38px; height: 38px; }
.plan-actions .icon-btn svg { width: 17px; height: 17px; }
.plan-actions .tl-check { width: 38px; height: 38px; }

.plan-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line-strong);
}
.tool-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tool-label { color: var(--muted); font-size: 13px; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.settings-card { padding: 22px; }
.settings-card .card-head { margin-bottom: 8px; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(213, 200, 174, 0.55);
  font-size: 14.5px;
}
.setting-row:last-of-type { border-bottom: none; }
.setting-value { color: var(--muted); font-size: 13.5px; text-align: right; }
.setting-inline { display: flex; align-items: center; gap: 10px; }
.setting-inline output { min-width: 42px; text-align: right; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.setting-note { margin-top: 10px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.settings-card select, .settings-card input[type="time"] {
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 600;
}
.settings-card input[type="range"] { width: min(180px, 42vw); accent-color: var(--green-2); }

.switch { position: relative; display: inline-flex; flex: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span {
  display: block;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background 0.2s ease;
}
.switch span::after {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  margin: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease;
}
.switch input:checked + span { background: var(--green-2); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid rgba(31, 122, 77, 0.3); outline-offset: 2px; }
.switch.small span { width: 44px; height: 26px; }
.switch.small span::after { width: 20px; height: 20px; }
.switch.small input:checked + span::after { transform: translateX(18px); }

.bluetooth-help {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
}
.bluetooth-help ol { margin: 6px 0 0; padding-left: 20px; list-style: decimal; color: var(--muted); }
.bluetooth-help p { margin-top: 6px; color: var(--muted); }
.backup-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.app-version { margin-top: 22px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ---------- tabbar ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(228, 218, 198, 0.9);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 16px 40px rgba(43, 47, 38, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 94px;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease;
}
.tab svg { width: 20px; height: 20px; }
.tab:hover { color: var(--ink); }
.tab.active { background: var(--green); color: var(--cream); box-shadow: 0 8px 18px rgba(20, 83, 45, 0.24); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translate(-50%, 14px);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 13px 18px;
  border-radius: 20px;
  text-align: left;
  background: var(--green);
  color: var(--cream);
  box-shadow: 0 18px 40px rgba(20, 83, 45, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 19px; height: 19px; flex: none; color: var(--amber-2); }
.toast span { font-size: 14px; line-height: 1.4; }

/* ---------- persistent reminder ---------- */
.reminder-alert {
  position: fixed;
  left: 50%;
  top: max(14px, env(safe-area-inset-top));
  transform: translate(-50%, 0);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(560px, calc(100vw - 24px));
  padding: 14px 16px;
  border: 2px solid var(--amber);
  border-radius: 22px;
  background: var(--amber-soft);
  color: var(--ink);
  box-shadow: 0 18px 44px rgba(120, 70, 10, 0.26);
  animation: reminderPulse 1.8s ease-in-out infinite;
}
.reminder-alert-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--amber);
  color: #fffdf8;
}
.reminder-alert-icon svg { width: 22px; height: 22px; }
.reminder-alert-body { flex: 1; min-width: 0; }
.reminder-alert-body strong { display: block; font-size: 16.5px; }
.reminder-alert-body p { margin-top: 3px; font-size: 13.5px; font-weight: 600; line-height: 1.45; color: var(--ink-2); }
.reminder-alert .btn { flex: none; min-width: 96px; }
@keyframes reminderPulse {
  0%, 100% { box-shadow: 0 18px 44px rgba(120, 70, 10, 0.26); }
  50% { box-shadow: 0 18px 44px rgba(120, 70, 10, 0.26), 0 0 0 10px rgba(217, 119, 6, 0.14); }
}

/* ---------- dialog ---------- */
.dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: min(92vh, 760px);
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(20, 30, 24, 0.3);
  overflow: auto;
}
.dialog::backdrop { background: rgba(19, 30, 24, 0.46); backdrop-filter: blur(4px); }
.dialog-form { display: flex; flex-direction: column; gap: 18px; padding: 24px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-head h2 { font-size: 23px; }
.dialog-head p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.field-row { display: flex; flex-direction: column; gap: 14px; }
.field-row .field { width: 200px; max-width: 100%; }
.field input[type="text"], .field input[type="time"], .field input[type="number"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 16px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.field input:focus { border-color: var(--green-2); box-shadow: 0 0 0 4px rgba(31, 122, 77, 0.14); }
.voice-row { display: flex; align-items: stretch; gap: 10px; }
.voice-row input[type="text"] { flex: 1; min-width: 0; }
.voice-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--green-2);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}
.voice-btn:hover { border-color: var(--green-2); }
.voice-btn:active { transform: scale(0.95); }
.voice-btn svg { width: 22px; height: 22px; }
.voice-btn.listening {
  background: var(--green);
  border-color: var(--green);
  color: var(--cream);
  animation: voicePulse 1.4s ease-in-out infinite;
}
.voice-hint { font-size: 12.5px; font-weight: 600; line-height: 1.5; color: var(--muted); }
.voice-hint.listening, .voice-hint.success { color: var(--green-2); }
.voice-hint.error { color: var(--danger); }
@keyframes voicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(20, 83, 45, 0.3); }
  50% { box-shadow: 0 0 0 9px rgba(20, 83, 45, 0); }
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-width: 54px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 700;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.chip:hover { border-color: var(--green-2); }
.chip.active { background: var(--green); border-color: var(--green); color: var(--cream); }
.kind-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.kind-option { position: relative; }
.kind-option input { position: absolute; opacity: 0; pointer-events: none; }
.kind-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 8px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.kind-option svg { width: 17px; height: 17px; }
.kind-option input:checked + span { border-color: var(--green-2); background: var(--green-soft); color: var(--green); }
.kind-option.play input:checked + span { border-color: var(--amber); background: var(--amber-soft); color: #8a4b02; }
.kind-option.rest input:checked + span { border-color: var(--blue); background: var(--blue-soft); color: #1d4ed8; }
.kind-option.routine input:checked + span { border-color: var(--purple); background: var(--purple-soft); color: #5b21b6; }
.kind-option input:focus-visible + span { outline: 3px solid rgba(31, 122, 77, 0.28); outline-offset: 2px; }
.dialog-actions { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.dialog-actions .spacer { flex: 1; }

/* ---------- focus mode ---------- */
body.focus-open { overflow: hidden; }
.focus-screen {
  --focus-accent: var(--amber-2);
  --dial: clamp(270px, min(54vh, 86vw), 540px);
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vh, 22px);
  padding: max(18px, env(safe-area-inset-top)) clamp(18px, 5vw, 56px) max(20px, env(safe-area-inset-bottom));
  overflow: auto;
  isolation: isolate;
  color: var(--cream);
  background:
    radial-gradient(circle at 16% 6%, rgba(245, 158, 11, 0.18), transparent 40%),
    radial-gradient(circle at 88% 94%, rgba(47, 156, 103, 0.3), transparent 46%),
    linear-gradient(150deg, #165c34 0%, #0f4527 48%, #082b18 100%);
  animation: focusIn 0.24s ease;
}
.focus-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 76% 44%, color-mix(in srgb, var(--focus-accent) 10%, transparent), transparent 46%),
    radial-gradient(circle at 50% 118%, rgba(255, 247, 230, 0.07), transparent 55%);
}
.focus-screen > * { position: relative; z-index: 1; }
.focus-screen[data-kind="study"] { --focus-accent: #fbbf24; }
.focus-screen[data-kind="play"] { --focus-accent: #fcd34d; }
.focus-screen[data-kind="rest"] { --focus-accent: #93c5fd; }
.focus-screen[data-kind="routine"] { --focus-accent: #d8b4fe; }
.focus-screen:focus { outline: none; }
@keyframes focusIn {
  from { opacity: 0; transform: scale(0.99); }
  to { opacity: 1; transform: scale(1); }
}
.focus-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  flex: none;
}
.focus-pill {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 247, 230, 0.12);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.focus-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--focus-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus-accent) 22%, transparent);
  animation: focusDot 2.6s ease-in-out infinite;
}
@keyframes focusDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}
.focus-now {
  justify-self: center;
  padding: 6px 13px;
  border: 1px solid rgba(255, 247, 230, 0.08);
  border-radius: 999px;
  background: rgba(255, 247, 230, 0.05);
  color: rgba(255, 247, 230, 0.62);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.focus-icon-btn {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border: 1px solid rgba(255, 247, 230, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream);
  transition: background 0.16s ease, border-color 0.16s ease;
}
.focus-icon-btn:hover { border-color: rgba(255, 247, 230, 0.6); background: rgba(255, 255, 255, 0.13); }
.focus-icon-btn svg { width: 19px; height: 19px; }
.focus-body {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  max-width: 1120px;
  margin: 0 auto;
}
.focus-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(24px, 4.5vw, 72px);
  width: 100%;
  padding: clamp(4px, 1.5vh, 18px) 0;
}
.focus-copy { min-width: 0; }
.focus-kicker {
  color: var(--focus-accent);
  font-size: clamp(12px, 1.4vw, 15px);
  font-weight: 800;
  letter-spacing: 0.16em;
}
.focus-title {
  margin-top: 12px;
  max-width: 12em;
  font-size: clamp(36px, 4.8vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.focus-sub {
  display: inline-flex;
  align-items: center;
  margin-top: clamp(14px, 2.4vh, 22px);
  padding: 7px 14px;
  border: 1px solid rgba(255, 247, 230, 0.1);
  border-radius: 999px;
  background: rgba(255, 247, 230, 0.07);
  color: rgba(255, 247, 230, 0.74);
  font-size: clamp(13px, 1.4vw, 16px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.focus-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: clamp(20px, 3.4vh, 30px);
  color: rgba(255, 247, 230, 0.66);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.focus-next svg { width: 16px; height: 16px; flex: none; color: var(--focus-accent); }
.focus-dial {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--dial);
  height: var(--dial);
  flex: none;
  isolation: isolate;
}
.focus-dial::before {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 26%, rgba(255, 247, 230, 0.11), rgba(255, 247, 230, 0.028) 58%, transparent 74%);
  box-shadow: inset 0 1px 0 rgba(255, 247, 230, 0.12), inset 0 -22px 54px rgba(0, 0, 0, 0.22);
}
.focus-dial::after {
  content: "";
  position: absolute;
  inset: -14%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--focus-accent) 22%, transparent), transparent 62%);
  filter: blur(28px);
  opacity: 0.55;
}
.focus-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.focus-ring-track {
  fill: none;
  stroke: rgba(255, 247, 230, 0.13);
  stroke-width: 9;
}
.focus-ring-value {
  fill: none;
  stroke: var(--focus-accent);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.3s linear;
  filter: drop-shadow(0 0 9px color-mix(in srgb, var(--focus-accent) 55%, transparent));
}
.focus-dial-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0 11%;
  text-align: center;
}
.focus-clock {
  font-size: calc(var(--dial) * 0.27);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 0.94;
  letter-spacing: -0.05em;
  text-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  white-space: nowrap;
}
.focus-clock.compact { font-size: calc(var(--dial) * 0.2); }
.focus-clock-label {
  margin-top: clamp(8px, 1.4vh, 14px);
  color: rgba(255, 247, 230, 0.58);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  padding-left: 0.3em;
}
.focus-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-top: 6px;
}
.focus-actions .btn { min-width: 160px; }
.focus-actions .btn svg { width: 18px; height: 18px; }

@media (min-width: 901px) and (orientation: landscape) {
  .focus-screen { --dial: clamp(300px, 54vh, 520px); }
}
@media (max-width: 900px), (orientation: portrait) {
  .focus-main {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: clamp(22px, 3.4vh, 36px);
    text-align: center;
  }
  .focus-copy { display: flex; flex-direction: column; align-items: center; }
  .focus-title { max-width: 12em; font-size: clamp(31px, 6.6vw, 58px); }
  .focus-next { margin-top: 16px; }
}

/* ---------- review ---------- */
.review-range {
  display: flex;
  flex: none;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}
.review-range .chip { min-width: 0; padding: 8px 15px; border: 0; background: transparent; color: var(--muted); }
.review-range .chip:hover { color: var(--ink); }
.review-range .chip.active { background: var(--green); color: var(--cream); box-shadow: 0 4px 10px rgba(20, 83, 45, 0.2); }

.review-card { margin-top: 16px; padding: 22px; }
.review-days { display: flex; flex-direction: column; gap: 10px; }
.review-day {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  overflow: hidden;
}
.review-day[open] { background: var(--surface); }
.review-day-summary {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(70px, 1fr) 50px 14px;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.review-day-summary::-webkit-details-marker { display: none; }
.review-day-summary::after {
  content: "";
  width: 7px;
  height: 7px;
  justify-self: center;
  margin-top: -4px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.18s ease, margin 0.18s ease;
}
.review-day[open] > .review-day-summary::after { margin-top: 4px; transform: rotate(-135deg); }
.review-day-date { display: flex; flex-direction: column; gap: 3px; min-width: 76px; }
.review-day-date strong { font-size: 14.5px; }
.review-day-date span { color: var(--muted); font-size: 12px; }
.review-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.review-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-3), var(--green-2));
}
.review-day-rate { text-align: right; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.review-day-body { padding: 0 14px 12px; border-top: 1px dashed var(--line); }
.review-day-note { padding: 9px 0 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.review-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 11px;
  font-size: 13.5px;
}
.review-item + .review-item { margin-top: 3px; }
.review-item-time { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.review-item-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-item-status { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.review-item.good { background: var(--green-soft); }
.review-item.good .review-item-status { color: var(--green-2); }
.review-item.late { background: var(--amber-soft); }
.review-item.late .review-item-status { color: #8a4b02; }
.review-item.missed { background: var(--danger-soft); }
.review-item.missed .review-item-status { color: var(--danger); }
.review-item.done { background: var(--blue-soft); }
.review-item.done .review-item-status { color: var(--blue); }
.review-item.upcoming { border: 1px dashed var(--line); }

.review-insight { margin-top: 16px; padding: 20px 22px; }
.insight-head { display: flex; align-items: center; gap: 8px; color: var(--green-2); font-size: 14px; }
.insight-head svg { width: 18px; height: 18px; }
.review-insight > p { margin-top: 8px; max-width: 62em; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.review-kinds { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.review-kind-row {
  display: grid;
  grid-template-columns: 10px 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.review-kind-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green-3); }
.review-kind-dot.play { background: var(--amber-2); }
.review-kind-dot.rest { background: var(--blue); }
.review-kind-dot.routine { background: var(--purple); }
.review-kind-count { color: var(--muted); font-weight: 600; }
.review-kind-delta { color: var(--ink-2); font-weight: 700; text-align: right; }
.review-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 10px 18px; text-align: center; }
.review-empty p { max-width: 24em; color: var(--muted); font-size: 13.5px; line-height: 1.55; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .today-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr); }
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .today-grid { grid-template-columns: 1fr; }
  .hero { min-height: 390px; }
  .timeline-card { min-height: 360px; max-height: 460px; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .app { padding: 14px 14px 108px; }
  .topbar { margin-bottom: 14px; }
  .brand-mark { width: 44px; height: 44px; border-radius: 14px; }
  .brand-text h1 { font-size: 19px; }
  .brand-text p { font-size: 12.5px; }
  .live-clock { font-size: 21px; }
  .wake-badge { display: none; }
  .hero { min-height: 360px; padding: 22px; border-radius: 26px; }
  .hero-title { margin-top: 20px; font-size: 30px; }
  .hero-time { font-size: 60px; }
  .hero-actions { margin-top: 20px; }
  .hero-actions .btn { flex: 1; min-width: 132px; }
  .timeline-card { padding: 18px 14px 12px; border-radius: 22px; }
  .timeline-item { grid-template-columns: 52px 12px minmax(0, 1fr) auto; gap: 8px; padding: 11px 6px; }
  .tl-actions .tl-check, .tl-actions .tl-edit { width: 30px; height: 30px; }
  .tl-title { font-size: 14.5px; }
  .stats-row { gap: 10px; margin-top: 12px; }
  .stat { padding: 11px 12px; gap: 9px; border-radius: 16px; }
  .stat-icon { width: 36px; height: 36px; border-radius: 12px; }
  .stat strong { font-size: 19px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .section-actions { width: 100%; }
  .section-actions .btn { flex: 1; }
  .plan-row { grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; padding: 13px 14px; border-radius: 17px; }
  .plan-time { font-size: 15px; }
  .plan-kind-dot { display: none; }
  .plan-actions .tl-check, .plan-actions .icon-btn { width: 34px; height: 34px; }
  .settings-card { padding: 18px; border-radius: 22px; }
  .template-grid { grid-template-columns: 1fr; width: 100%; max-width: 320px; }
  .tabbar { width: calc(100% - 20px); justify-content: space-between; padding: 5px; }
  .tab { flex: 1; justify-content: center; min-width: 0; padding: 10px 8px; }
  .tab span { font-size: 13px; }
  .kind-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog-form { padding: 20px; gap: 16px; }
  .dialog-head h2 { font-size: 21px; }
  .review-range .chip { padding: 8px 12px; font-size: 13px; }
  .focus-badge { min-height: 36px; padding: 7px 10px; }
  .focus-screen { gap: 12px; padding: max(14px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)); }
  .focus-actions .btn { flex: 1; min-width: 130px; }
  .review-card { padding: 18px 14px; border-radius: 22px; }
  .review-day-summary { grid-template-columns: minmax(0, 1fr) 50px 16px; gap: 6px 10px; padding: 11px 12px; }
  .review-bar { grid-column: 1 / -1; grid-row: 2; margin-bottom: 2px; }
  .review-day-rate { grid-column: 2; grid-row: 1; align-self: center; }
  .review-item { grid-template-columns: minmax(0, 1fr) auto; row-gap: 3px; padding: 8px; }
  .review-item-time { grid-column: 1; grid-row: 1; }
  .review-item-status { grid-column: 2; grid-row: 1; }
  .review-item-title { grid-column: 1 / -1; grid-row: 2; font-size: 14px; }
  .review-insight { padding: 18px; }
  .review-kind-row { grid-template-columns: 10px 44px minmax(0, 1fr); }
  .review-kind-delta { grid-column: 2 / -1; grid-row: 2; text-align: left; font-size: 12px; }
  .reminder-alert { gap: 10px; padding: 12px; border-radius: 18px; }
  .reminder-alert-icon { width: 38px; height: 38px; border-radius: 12px; }
  .reminder-alert-body strong { font-size: 15px; }
  .reminder-alert .btn { min-width: 78px; padding-inline: 12px; }
}

@media (max-width: 420px) {
  .topbar { gap: 8px; }
  .brand { gap: 10px; }
  .brand-text h1 { font-size: 17px; }
  .brand-text p { font-size: 12px; }
  .topbar-side { gap: 8px; }
  .live-clock { font-size: 19px; }
  .focus-badge { justify-content: center; min-width: 38px; padding: 8px; }
  .focus-badge span { display: none; }
}

@media (max-height: 620px) {
  .focus-screen {
    --dial: clamp(180px, 46vh, 280px);
    gap: 8px;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .focus-kicker { font-size: 12px; }
  .focus-title { margin-top: 6px; font-size: clamp(22px, 5.4vh, 34px); }
  .focus-sub { margin-top: 8px; padding: 5px 11px; font-size: 12px; }
  .focus-next { margin-top: 10px; font-size: 12px; }
  .focus-actions .btn { min-width: 130px; }
}

@media (max-height: 620px) and (orientation: landscape) {
  .focus-screen { --dial: clamp(170px, 48vh, 280px); }
  .focus-main {
    grid-template-columns: minmax(0, 1fr) auto;
    justify-items: stretch;
    gap: clamp(16px, 4vw, 40px);
    padding: 0;
    text-align: left;
  }
  .focus-copy { align-items: flex-start; }
  .focus-title { max-width: 9em; font-size: clamp(24px, 6.4vh, 34px); }
  .focus-sub { margin-top: 8px; }
  .focus-next { margin-top: 10px; }
  .focus-bar { max-width: none; }
}

@media (max-height: 700px) and (orientation: landscape) {
  .hero { min-height: 340px; }
  .timeline-card { min-height: 340px; }
  .hero-title { margin-top: 16px; }
  .hero-time { font-size: 56px; }
  .hero-actions { margin-top: 16px; }
}

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