/* Light only, by design. */
:root {
  color-scheme: light;
  --ground: #ffffff;
  --ink: #111111;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f4f5f7;
  --danger: #b91c1c;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); }
body {
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}
button { cursor: pointer; touch-action: manipulation; }
.view { max-width: 560px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 16px 24px; }

h1 { font-size: 26px; line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 17px; margin: 28px 0 12px; }
p { margin: 0; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--muted); margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.muted { color: var(--muted); margin-top: 4px; }
.small { font-size: 13px; line-height: 1.4; }
.empty { color: var(--muted); text-align: center; padding: 48px 0; }

.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.nav-row { align-items: center; }
.center { text-align: center; flex: 1; }
.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); display: grid; place-items: center; padding: 0;
}
.icon-btn:disabled { opacity: 0.3; cursor: default; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.small { width: 36px; height: 36px; margin-left: auto; }

.btn {
  font: inherit; font-weight: 600; font-size: 16px; min-height: 48px; padding: 0 18px;
  border-radius: 14px; border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); padding: 0 8px; }
.btn.wide { width: 100%; margin-top: 10px; }
.danger { color: var(--danger) !important; }

/* Track */
.now {
  border-radius: 20px; padding: 14px 16px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--c) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--c) 35%, #fff);
}
.now:not(.on) { background: var(--soft); border-color: var(--line); }
.now-name { font-size: 22px; font-weight: 700; color: color-mix(in srgb, var(--c) 80%, #000); }
.now-name.idle { color: var(--ink); }
.timer { font-size: 48px; font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.now-foot { display: flex; align-items: center; justify-content: space-between; }
.now-foot .muted { margin: 0; }
.now-foot .btn.quiet { min-height: 40px; padding: 0 4px; text-decoration: underline; }
.note {
  display: block; width: 100%; margin-top: 8px; font: inherit; font-size: 16px; padding: 10px 14px;
  border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink);
}

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cat-group-label { grid-column: 1 / -1; margin: 8px 0 0; }
.cat-name, .entry-note, .entry-name, .acct-row b, .keybox { overflow-wrap: anywhere; }
.cat {
  min-width: 0; font: inherit; color: var(--ink); text-align: left; background: #fff;
  min-height: 76px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 6px;
  transition: transform 0.08s ease;
}
.cat:active { transform: scale(0.97); }
.cat-name { font-size: 16px; font-weight: 600; line-height: 1.2; }
.cat-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 16px; }
.cat.active { background: var(--c); border-color: var(--c); color: #fff; }
.cat.active .cat-time { color: rgba(255, 255, 255, 0.85); }
.cat.active .dot { background: #fff; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }

.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.strip div { background: var(--soft); border-radius: 14px; padding: 12px; }
.strip b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.strip span { font-size: 12px; color: var(--muted); }

/* Day */
.timeline { display: flex; flex-direction: column; gap: 8px; }
.entry {
  font: inherit; color: var(--ink); text-align: left; width: 100%; background: #fff;
  display: flex; align-items: stretch; gap: 12px; padding: 12px 14px 12px 12px;
  border: 1px solid var(--line); border-radius: 14px;
}
.bar { width: 5px; border-radius: 3px; background: var(--c); flex: none; }
.entry-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.entry-name { font-weight: 600; }
.entry-note { font-size: 14px; color: #374151; margin-top: 4px; }
.entry-dur { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; align-self: center; }
.live { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--c); margin-left: 8px; }
.gap {
  font: inherit; font-size: 14px; color: var(--muted); width: 100%; background: transparent;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border: 1.5px dashed #d1d5db; border-radius: 14px;
}
.gap .fill { font-weight: 600; color: var(--ink); text-decoration: underline; }

/* Week */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--soft); border-radius: 16px; padding: 14px; }
.stat.big { grid-column: 1 / -1; }
.stat b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.stat.big b { font-size: 44px; letter-spacing: -0.02em; }
.stat span { font-size: 13px; color: var(--muted); }
.bars { display: flex; flex-direction: column; gap: 16px; }
.barlabel { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; margin-bottom: 6px; }
.barlabel b { font-variant-numeric: tabular-nums; }
.track { position: relative; height: 10px; background: var(--soft); border-radius: 6px; }
.fillbar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); border-radius: 6px; }
.guess { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); }
.legend { margin-top: 14px; }
.guess-key { display: inline-block; width: 2px; height: 12px; background: var(--ink); vertical-align: -2px; margin-right: 8px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 8px; }
.daycol { font: inherit; color: var(--ink); background: none; border: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.col { width: 100%; height: 96px; background: var(--soft); border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.col span { width: 100%; background: var(--ink); }
.daycol b { font-size: 13px; font-variant-numeric: tabular-nums; }
.daycol > span:last-child { font-size: 12px; color: var(--muted); }

/* Review and Setup */
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.card h2 { margin-top: 0; margin-bottom: 8px; }
.recap-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.recap-row:last-child { border-bottom: none; }
.recap-row b { font-variant-numeric: tabular-nums; text-align: right; }
.q { display: block; margin: 20px 0; }
.q span { display: block; font-weight: 600; margin-bottom: 8px; }
textarea, .field input, .cat-edit .name, .guess-in input {
  font: inherit; font-size: 16px; width: 100%; padding: 12px 14px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
textarea { resize: vertical; min-height: 64px; line-height: 1.4; }
.field { display: block; margin: 12px 0; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input { min-height: 48px; -webkit-appearance: none; appearance: none; }

.cat-edit { display: grid; grid-template-columns: 36px 1fr; gap: 10px 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.swatch { width: 36px; height: 36px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); padding: 0; }
.cat-opts { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { font: inherit; font-size: 14px; padding: 8px 12px; border: none; background: #fff; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.guess-in { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.guess-in input { width: 76px; padding: 8px 10px; }
.hidden-list { margin-top: 14px; }
.hidden-list summary { color: var(--muted); font-size: 14px; padding: 6px 0; }
.hidden-cat { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }

/* Sheet */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 560px; margin: 0 auto;
  max-height: 90vh; overflow: auto; background: #fff; border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { margin: 0; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.chip {
  font: inherit; font-size: 14px; color: var(--ink); background: #fff;
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 999px;
}
.chip[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }
.chip[aria-pressed="true"] .dot { background: #fff; }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet-actions .primary { flex: 1; }
.problem { color: var(--danger); font-weight: 600; margin-top: 8px; }
.problem:empty { display: none; }

/* Toast and banner */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 15; padding: 0 16px; pointer-events: none; }
.toast {
  max-width: 528px; margin: 0 auto; pointer-events: auto; background: var(--ink); color: #fff;
  border-radius: 16px; padding: 12px 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.toast.error { background: var(--danger); }
.toast-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.toast button { font: inherit; font-size: 14px; font-weight: 600; color: #fff; background: rgba(255, 255, 255, 0.16); border: none; border-radius: 10px; padding: 8px 12px; white-space: nowrap; }
.toast .chips { margin-top: 10px; justify-content: flex-start; flex-wrap: wrap; font-size: 14px; }
.banner { background: #fef2f2; color: #991b1b; font-weight: 600; padding: 10px 14px; border-radius: 12px; margin-top: 8px; }

/* Fix-it prompts */
.btn.link { min-height: 40px; padding: 0; text-decoration: underline; color: var(--ink); background: none; border: none; font-size: 15px; }
.now .btn.link { margin-top: 6px; }
.now-foot > span:last-child { display: inline-flex; gap: 14px; }
.longrun {
  background: #fff; border: 1.5px solid var(--ink); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 14px;
}
.longrun p { font-size: 15px; line-height: 1.4; }
.check-actions { display: flex; gap: 8px; margin-top: 10px; }
.check-actions .btn { flex: 1; min-height: 44px; font-size: 15px; padding: 0 10px; }
.pending-note {
  margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: #fff;
  border: 1px dashed var(--muted); font-size: 14px; font-weight: 600;
}
.pending-note .btn.link { min-height: 0; font-size: 14px; margin-left: 4px; }
.room { margin-top: 12px; padding: 12px 14px; border: 1.5px solid var(--ink); border-radius: 14px; }
.room ul { margin: 8px 0 4px; padding-left: 20px; }
.room li { margin: 4px 0; }

/* Work hours and category hints */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.days-pick { display: flex; width: 100%; }
.days-pick button { flex: 1; padding: 10px 0; }
.cat-edit .hint-in {
  grid-column: 2; font: inherit; font-size: 14px; width: 100%; padding: 8px 12px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.guide { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 6px; }
.guide summary { font-weight: 600; padding: 10px 0; cursor: pointer; }
.guide p { display: flex; gap: 8px; align-items: baseline; font-size: 14px; line-height: 1.4; margin: 8px 0; }
.guide .dot { flex: none; transform: translateY(1px); }
.track-layout > .guide { order: 5; }

/* Widget setup */
.steps { margin: 12px 0; padding-left: 20px; font-size: 14px; line-height: 1.45; }
.steps li { margin: 6px 0; }
.links { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 8px; }
.linkrow {
  font: inherit; font-size: 15px; color: var(--ink); background: #fff; text-align: left;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 12px;
}
.linkrow > span:nth-child(2) { flex: 1; }
.linkrow .copy { font-size: 13px; font-weight: 600; text-decoration: underline; }

/* Phone order: timer, evening prompt, buttons, then totals. Desktop uses grid areas below. */
.track-layout { display: flex; flex-direction: column; }
.track-layout > .now { order: 0; }
.track-layout > .evening { order: 1; margin: 0 0 12px; }
.track-layout > .grid { order: 2; }
.track-layout > .strip { order: 3; }
.track-layout > .add { order: 4; }

/* Evening prompt and reviews */
.evening {
  font: inherit; color: var(--ink); text-align: left; width: 100%; margin-top: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; background: #fff; border: 1.5px solid var(--ink); border-radius: 16px;
}
.evening > span { display: flex; flex-direction: column; }
.evening svg { width: 20px; height: 20px; flex: none; }
.day-review { margin-top: 20px; }
.day-review .recap { margin: 10px 0 4px; }
.recap-row .dot { margin-right: 6px; }
.day-review .q { margin: 16px 0; }
.daily-notes h2 { margin-bottom: 4px; }
.note-day { padding: 12px 0; border-bottom: 1px solid var(--line); }
.note-day:last-child { border-bottom: none; padding-bottom: 0; }
.note-day p + p { margin-top: 4px; }

/* Desktop: use the width instead of one long column. */
@media (min-width: 900px) {
  .view { max-width: 1140px; padding: 28px 32px 32px; }
  .top { margin-bottom: 20px; }

  .track-layout {
    display: grid; grid-template-columns: 380px 1fr; column-gap: 24px; align-items: start;
    grid-template-areas: "now cats" "strip cats" "evening cats" "add cats" "guide cats";
    grid-template-rows: auto auto auto auto auto 1fr;
  }
  .track-layout > .now { grid-area: now; margin: 0; }
  .track-layout > .grid { grid-area: cats; grid-template-columns: repeat(3, 1fr); grid-auto-rows: auto; gap: 12px; }
  .track-layout > .strip { grid-area: strip; }
  .track-layout > .evening { grid-area: evening; margin: 12px 0 0; }
  .track-layout > .add { grid-area: add; }
  .track-layout > .guide { grid-area: guide; }
  .cat { min-height: 100px; padding: 14px 16px; }
  .cat-name { font-size: 17px; }

  .day-layout { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
  .day-review { margin-top: 0; position: sticky; top: 24px; max-height: calc(100vh - 140px); overflow: auto; }

  .week-layout {
    display: grid; grid-template-columns: 400px 1fr; column-gap: 40px; align-items: start;
    grid-template-areas: "stats bars" "days bars"; grid-template-rows: auto 1fr;
  }
  .w-stats { grid-area: stats; }
  .w-bars { grid-area: bars; }
  .w-bars h2 { margin-top: 0; }
  .w-bars .bars { gap: 10px; }
  .w-bars .barlabel { margin-bottom: 4px; }
  .w-bars .barrow .muted { margin-top: 2px; font-size: 12px; }
  .w-days { grid-area: days; }

  .review-layout { display: grid; grid-template-columns: 380px 1fr; gap: 32px; align-items: start; }
  .review-side { position: sticky; top: 24px; max-height: calc(100vh - 140px); overflow: auto; }
  .review-main .q:first-child { margin-top: 0; }

  .setup-layout {
    display: grid; grid-template-columns: 1fr 1.4fr; column-gap: 24px; align-items: start;
    grid-template-areas: "account cats" "principle cats" "start cats" "data cats" "home cats" "widget cats"; grid-template-rows: auto auto auto auto auto 1fr;
  }
  .s-account { grid-area: account; }
  .s-principle { grid-area: principle; }
  .s-start { grid-area: start; }
  .s-cats { grid-area: cats; }
  .s-data { grid-area: data; }
  .s-home { grid-area: home; }
  .s-widget { grid-area: widget; }

  .sheet {
    top: 50%; bottom: auto; left: 50%; right: auto; width: 520px; margin: 0;
    transform: translate(-50%, -50%); border-radius: 20px; padding-bottom: 20px;
  }
  nav.tabs { grid-template-columns: repeat(5, 120px); justify-content: center; }
}

@media (hover: hover) {
  .cat:hover, .entry:hover, .gap:hover, .evening:hover, .btn:hover, .icon-btn:not(:disabled):hover { border-color: #b8bdc4; }
  .cat.active:hover { border-color: var(--c); }
}

/* Tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.tabs button {
  font: inherit; font-size: 11px; font-weight: 600; color: var(--muted); background: none; border: none;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; min-height: 52px;
}
.tabs svg { width: 24px; height: 24px; }
.tabs button[aria-current="page"] { color: var(--ink); }

/* Sign up, log in, reset */
body.auth { padding-bottom: 24px; }
.auth-view { max-width: 420px; }
.auth-view h1 { margin: 8px 0 6px; }
.auth-view form { margin-top: 8px; }
.auth-head { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; margin: 16px 0 24px; }
.auth-head img { border-radius: 10px; }
.auth-links { margin-top: 16px; font-size: 15px; color: var(--muted); }
.auth-links a, .muted a { color: var(--ink); font-weight: 600; }
.field .pw { display: flex; gap: 6px; align-items: center; margin: 0; }
.pw input { flex: 1; }
.field select { width: 100%; min-height: 48px; font: inherit; font-size: 16px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.as-btn { display: flex; align-items: center; justify-content: center; text-decoration: none; box-sizing: border-box; }
.keybox { font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; user-select: all; }
.acct-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.acct-row:last-of-type { border-bottom: none; }
.acct-row .btn { min-height: 40px; }
.btn.primary.danger-fill { background: var(--danger); border-color: var(--danger); }

/* Discipline Mastery, matching the approved light-only mockup. */
.dm { --faint: #c4c8ce; max-width: 560px; margin-inline: auto; line-height: 1.3; }
.dm .tally { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; flex: none; }
.dm .tally small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.dm .cheer { border: 1px solid var(--line); background: var(--soft); border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; }
.dm .cheer-msg { font-weight: 650; font-size: 15px; line-height: 1.35; }
.dm .cheer-sub { font-size: 13px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.dm .wbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 10px; align-items: end; }
.dm .wbar { display: grid; gap: 4px; justify-items: center; font-size: 11px; color: var(--muted); font-weight: 600; }
.dm .wbar i { display: block; width: 100%; height: 36px; border-radius: 5px; background: var(--ground); border: 1px solid var(--line); position: relative; overflow: hidden; }
.dm .wbar i::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); background: var(--ink); }
.dm .wbar.today { color: var(--ink); }
.dm .seg { border: 0; display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.dm .seg button { font: inherit; font-size: 14px; font-weight: 600; border: 0; background: none; color: var(--muted); border-radius: 9px; min-height: 36px; }
.dm .seg button[aria-pressed="true"] { background: var(--ground); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.dm .disciplines { display: grid; gap: 8px; }
.dm .discipline { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 16px; min-height: 68px; background: var(--ground); }
.dm .mark { flex: none; width: 56px; display: grid; place-items: center; background: none; border: 0; padding: 0; border-radius: 16px 0 0 16px; }
.dm .box { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--ink); display: grid; place-items: center; transition: background .12s ease; }
.dm .box svg { width: 18px; height: 18px; opacity: 0; }
.dm .mark[aria-checked="true"] .box { background: var(--ink); }
.dm .mark[aria-checked="true"] .box svg { opacity: 1; }
.dm .open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: none; border: 0; font: inherit; color: var(--ink); text-align: left; padding: 10px 12px 10px 0; border-radius: 0 16px 16px 0; }
.dm .h-text { min-width: 0; flex: 1; display: grid; gap: 5px; }
.dm .h-name { font-weight: 600; overflow-wrap: anywhere; }
.dm .h-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dm .h-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dm .dots { display: inline-flex; gap: 4px; flex: none; }
.dm .dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--faint); }
.dm .dot.done { background: var(--ink); border-color: var(--ink); }
.dm .dot.pre { border: 0; background: none; width: 9px; position: relative; }
.dm .dot.pre::after { content: ""; position: absolute; left: 1px; right: 1px; top: 4px; height: 1.5px; background: var(--line); }
.dm .dot.is-today { outline: 1.5px solid var(--ink); outline-offset: 1.5px; }
.dm .pending { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border: 1px dashed var(--muted); color: var(--muted); border-radius: 6px; padding: 0 5px; }
.dm .pbtn { font: inherit; font-weight: 600; font-size: 16px; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--ground); color: var(--ink); width: 100%; }
.dm .pbtn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.dm .add { margin-top: 12px; }
.dm .archived { margin-top: 16px; font-size: 14px; color: var(--muted); }
.dm .archived summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.dm .archived p { padding: 4px 0 0 2px; }
.dm .locked { font-size: 13px; color: var(--muted); margin-top: 12px; text-align: center; }
.dm .offline { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; text-align: center; padding: 6px; border: 1px dashed var(--muted); border-radius: 10px; margin-bottom: 12px; color: var(--muted); }
.dm .back { font: inherit; font-size: 15px; font-weight: 600; background: none; border: 0; color: var(--ink); padding: 6px 0; display: inline-flex; align-items: center; gap: 4px; }
.dm .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.dm .stat { background: var(--ground); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.dm .stat b { display: block; font-size: 22px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.dm .stat span { font-size: 12px; color: var(--muted); }
.dm .mon { margin-top: 18px; }
.dm .mon h6 { font-size: 13px; margin: 0 0 6px; font-weight: 700; display: flex; justify-content: space-between; }
.dm .mon h6 span { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.dm .cal { max-width: 320px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dm .cal .wd { font-size: 10px; font-weight: 700; color: var(--muted); text-align: center; }
.dm .cal .c { aspect-ratio: 1; max-width: 100%; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--faint); border: 1px solid transparent; background: none; padding: 0; font-family: inherit; }
.dm .cal .c.miss { border-color: var(--line); color: var(--muted); }
.dm .cal .c.done { background: var(--ink); color: #fff; }
.dm .cal .c.today { outline: 2px solid var(--ink); outline-offset: 1px; }
.dm .cal button.c { cursor: pointer; }
.dm .legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 10px; }
.dm .legend span { display: inline-flex; align-items: center; gap: 4px; }
.dm .legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.dm .page-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.dm .grab { width: 40px; height: 5px; background: var(--line); border-radius: 3px; margin: 0 auto 4px; }
.dm .hint { font-size: 13px; color: var(--muted); }
.dm .group-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px 2px; overflow-wrap: anywhere; }
.dm .group-label:first-child { margin-top: 2px; }
.dm .run { flex: none; text-align: right; min-width: 44px; }
.dm .run b { display: block; font-size: 24px; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.dm .run span { font-size: 11px; color: var(--muted); font-weight: 600; }
.dm .run.zero b { color: var(--faint); }
.dm .bigrun { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 4px; }
.dm .bigrun b { font-size: 56px; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.dm .bigrun span { font-size: 15px; font-weight: 600; color: var(--muted); }
.dm .stats.three { grid-template-columns: repeat(3, 1fr); }
.dm .stats.three .stat b { font-size: 19px; }
.dm .runs { margin-top: 18px; }
.dm .runs h6 { font-size: 13px; margin: 0 0 4px; font-weight: 700; }
.dm .runs ol { list-style: none; margin: 0; padding: 0; }
.dm .runs li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 7px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.dm .runs li span:first-child { color: var(--muted); }
.dm .runs li b { font-weight: 650; }
.dm .best-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border: 1px solid var(--ink); border-radius: 5px; padding: 0 4px; margin-left: 6px; }
.dm .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dm .chip { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: var(--ground); color: var(--ink); cursor: pointer; }
.dm .h-meta { justify-content: flex-start; gap: 10px; flex-wrap: wrap; }
.dm .back svg { width: 18px; height: 18px; }
.dm .mark { min-height: 48px; }
.dm .seg button { min-height: 44px; }
.dm .archived .back { display: block; text-align: left; min-height: 44px; }
.dm .cal button.c { min-height: 36px; }
.dm .chip { min-height: 44px; }
.dm .dot { display: inline-block; margin: 0; }
.dm .stats { margin-bottom: 0; }
.dm .bigrun { margin-bottom: 12px; }
.dm.sheet { display: grid; gap: 12px; }
.dm.sheet .field { margin: 0; }
.dm.sheet h2 { margin: 0; font-size: 19px; }
.dm .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dm .pbtn:focus-visible, .dm .mark:focus-visible, .dm .open:focus-visible, .dm .cal button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn.quiet[data-view="week"] { display: flex; align-items: center; gap: 4px; }
.btn.quiet[data-view="week"] svg { width: 18px; height: 18px; }

/* Daily Kaizen Principle */
.principle-link { display: flex; align-items: center; gap: 7px; width: 100%; font: inherit; font-size: 14px; color: var(--muted); background: none; border: 0; padding: 2px 0 12px; text-align: left; cursor: pointer; }
.principle-link svg { width: 16px; height: 16px; flex: none; }
.principle-link b { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.principle-link:focus-visible, .q-done:focus-visible, .rewardbar:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.qsheet { padding: 10px 22px calc(26px + env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.qsheet > * { text-align: left; margin: 0; overflow-wrap: anywhere; }
.qsheet .grab { width: 40px; height: 5px; background: var(--line); border-radius: 3px; margin: 0 auto 4px; }
.q-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.q-principle { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.q-text { font-family: ui-serif, "New York", Georgia, serif; font-size: 23px; line-height: 1.32; letter-spacing: -0.01em; text-wrap: pretty; }
.q-by { font-size: 13px; color: var(--muted); }
.q-ask { border-top: 1px solid var(--line); padding-top: 12px; font-size: 14px; line-height: 1.4; }
.q-ask span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.q-cta { display: block; text-align: left; border: 1px solid var(--ink); border-radius: 14px; padding: 12px 14px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 650; line-height: 1.3; }
.q-cta small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; margin-top: 3px; text-decoration: underline; text-underline-offset: 2px; }
.q-done { font: inherit; font-size: 15px; font-weight: 600; background: none; border: 0; color: var(--muted); padding: 4px 0; cursor: pointer; justify-self: start; text-align: left; }
.reward-wrap { position: fixed; left: 0; right: 0; bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 14; padding: 0 12px; pointer-events: none; }
.rewardbar { display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; max-width: 536px; margin: 0 auto; text-align: left; background: var(--ink); color: #fff; border: 0; border-radius: 14px; padding: 12px 14px; font: inherit; font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(17,17,17,.18); pointer-events: auto; cursor: pointer; }
.rewardbar svg { width: 20px; height: 20px; flex: none; }
.rewardbar span span { color: rgba(255,255,255,.75); font-weight: 500; }
.principle-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; }
.principle-switch input { appearance: none; width: 44px; height: 26px; flex: none; border: 1px solid var(--line); border-radius: 20px; background: var(--line); position: relative; cursor: pointer; }
.principle-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; }
.principle-switch input:checked { background: var(--ink); border-color: var(--ink); }
.principle-switch input:checked::after { left: 21px; }

/* Bot check and admin accounts */
.bot-check { margin: 12px 0 0; text-align: left; min-width: 0; }
.check-note { text-align: left; }
.s-accounts { grid-column: 1 / -1; text-align: left; }
.admin-account { display: grid; justify-items: start; gap: 6px; padding: 16px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.admin-account p { margin: 0; }
.admin-sheet { text-align: left; }
