:root {
  --bg: #f5f7fb;
  --ink: #1c2433;
  --muted: #8b93a6;
  --card: #ffffff;
  --green: #1f9d78;
  --line: #e6ebf3;
  --shadow: 0 10px 28px rgba(28, 39, 64, 0.06);
  --radius: 22px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", "Avenir Next", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(120, 180, 140, 0.35), transparent 26%),
    radial-gradient(circle at 88% 84%, rgba(150, 190, 160, 0.28), transparent 24%),
    #e7eef2;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.stage { min-height: 100%; display: flex; justify-content: center; }
.phone {
  width: min(100%, 420px);
  height: 100vh;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  box-shadow: 0 24px 60px rgba(20, 30, 50, 0.12);
}
.views { flex: 1; overflow: auto; padding: 10px 16px 12px; }
.error {
  margin: 0;
  padding: 10px 16px;
  background: #fde8e8;
  color: #8d1d1d;
  font-size: 13px;
}

.greet { margin-bottom: 12px; }
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-copy { flex: 1; min-width: 0; }
.logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #1c2430;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 9px;
  flex: none;
}
.logo i { display: block; border-radius: 50%; background: #fff; }
.logo i:nth-child(2),
.logo i:nth-child(3) { background: #8ea0b8; }
.eyebrow { margin: 0; color: var(--muted); font-size: 13px; }
.name-row { display: flex; align-items: center; gap: 6px; }
.name-row h1 { margin: 0; font-size: 28px; letter-spacing: -0.04em; }
.sprout { width: 22px; height: 22px; }
.tagline { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.round {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  flex: none;
  font-size: 20px;
  line-height: 1;
}
.round svg { width: 18px; height: 18px; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 0 8px 0 12px;
  margin-top: 14px;
}
.search-icon { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input {
  flex: 1;
  border: 0;
  background: transparent;
  height: 46px;
  outline: none;
  min-width: 0;
}
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.icon-button, .text-button, .more {
  border: 0;
  background: transparent;
  color: var(--muted);
}
.icon-button { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; }
.icon-button svg { width: 18px; height: 18px; }
.scope-label { margin: 6px 4px 0; color: var(--muted); font-size: 12px; }

.hero {
  position: relative;
  margin-top: 12px;
  min-height: 136px;
  border-radius: 26px;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 16px 32px rgba(20, 28, 40, 0.18);
}
.hero-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 16, 24, 0.78), rgba(10, 16, 24, 0.12) 72%);
}
.hero-copy, .hero-stat { position: relative; z-index: 1; }
.hero-copy { padding: 16px 16px 14px; max-width: 78%; }
.hero-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.02em;
  opacity: 0.9;
}
.hero-kicker svg { width: 16px; height: 16px; }
.hero h2 { margin: 0; font-size: 22px; letter-spacing: -0.03em; line-height: 1.15; }
.hero-copy p { margin: 4px 0 0; font-size: 13px; opacity: 0.9; }
.hero-cta {
  margin-top: 12px;
  border: 0;
  background: #fff;
  color: #1c2433;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
}
.hero-stat {
  position: absolute;
  top: 14px;
  right: 12px;
  margin: 0;
  background: rgba(16, 20, 28, 0.46);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}
.hero-stat span:first-child { color: #7dcea0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 14px 2px 6px;
}
.section-head h2 { margin: 0; font-size: 18px; letter-spacing: -0.03em; }
.text-button { font-size: 13px; padding: 4px; }

.project-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
}
.project-row.is-expanded { flex-wrap: wrap; overflow: visible; }
.project-card {
  width: 156px;
  min-height: 138px;
  flex: none;
  scroll-snap-align: start;
  border: 0;
  border-radius: 22px;
  padding: 14px;
  text-align: left;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.project-row.is-expanded .project-card { width: calc(50% - 6px); }
.project-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
}
.project-icon svg { width: 16px; height: 16px; }
.tone-dark .project-icon { background: rgba(255, 255, 255, 0.12); }
.tone-light .project-icon { background: rgba(255, 255, 255, 0.72); }
.project-card h3 { margin: 0; font-size: 14px; letter-spacing: -0.02em; }
.blurb {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.78;
  min-height: 30px;
}
.progress-row { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.progress-track { flex: 1; height: 4px; border-radius: 99px; background: rgba(20, 30, 40, 0.1); overflow: hidden; }
.progress-bar { height: 100%; border-radius: inherit; width: 0; }
.progress-pct { font-size: 12px; font-weight: 700; }
.tone-dark { color: #f7f8fb; }
.tone-dark .progress-track { background: rgba(255, 255, 255, 0.22); }
.tone-dark .blurb { color: rgba(247, 248, 251, 0.78); }

.task-card, .event-card, .hit-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.task-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 12px 12px 10px;
  margin-bottom: 10px;
}
.check {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid #cfd6e0;
  background: #fff;
  color: transparent;
  padding: 0;
  flex: none;
  line-height: 18px;
  font-size: 12px;
}
.check[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.task-body {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
}
.task-title { display: block; font-weight: 700; font-size: 14px; }
.task-card.is-done .task-title { color: #8b93a3; }
.tag {
  display: inline-block;
  margin-top: 6px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  background: #eef1f6;
  color: #5c677a;
}
.tag-design { background: #e5f6ee; color: #1f9d78; }
.tag-meeting { background: #e7f0ff; color: #3b74d8; }
.tag-work { background: #eef0f4; color: #5c677a; }
.task-side { text-align: right; flex: none; }
.task-time { display: block; color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.more { font-size: 16px; letter-spacing: 1px; padding: 0 2px; }

.hit-head { margin: 8px 2px; font-size: 16px; }
.hit-card {
  width: 100%;
  border: 0;
  text-align: left;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.hit-card strong { display: block; }
.hit-card span { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); font-size: 13px; margin: 8px 2px 12px; }

.schedule-top, .month-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.schedule-top h1, .stub h1 {
  flex: 1;
  text-align: center;
  font-size: 18px;
  margin: 0;
}
.month-row { margin: 16px 2px 8px; }
.month-row h2 { flex: 1; margin: 0; font-size: 20px; letter-spacing: -0.03em; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 8px; }
.day {
  border: 0;
  background: transparent;
  padding: 2px 0 6px;
  color: var(--ink);
}
.dow { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.num {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 700;
}
.day.is-selected .num { background: #1e2430; color: #fff; }

.hour {
  display: grid;
  grid-template-columns: 48px 14px 1fr;
  gap: 4px;
  min-height: 22px;
}
.hour-label { font-size: 11px; color: var(--muted); padding-top: 4px; }
.rail { position: relative; }
.rail::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e6ebf3;
}
.dot {
  position: relative;
  z-index: 1;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 8px 0 0 3px;
  display: block;
  background: #c5ceda;
}
.dot-orange { background: #f0a04b; }
.dot-blue { background: #5b93f0; }
.dot-purple { background: #8b7cf6; }
.dot-green { background: #3dba8b; }
.event-card { padding: 12px 12px 10px; margin: 0 0 8px; border: 1px solid #f2f4f8; }
.event-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.event-title {
  margin: 0;
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 750;
  font-size: 15px;
  text-align: left;
}
.event-status { margin: 2px 0 0; font-size: 12px; font-weight: 650; }
.event-time { margin: 8px 0 0; color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.accent-orange .event-status { color: #e5893a; }
.accent-blue .event-status { color: #3d7fe8; }
.accent-purple .event-status { color: #7b68ee; }
.accent-green .event-status { color: #1f9d78; }
.event-actions { display: flex; gap: 8px; margin-top: 8px; }
.chip {
  border: 0;
  background: #f3f5f8;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: #3d4658;
}
.notes {
  margin: 8px 0 0;
  background: #f3f0ff;
  color: #4e5670;
  border-radius: 12px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.45;
}

.stub { padding-top: 12px; }
.stub h1 { text-align: left; margin-bottom: 8px; }
.stub p, .lede { color: #5c677a; line-height: 1.45; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 650; margin: 12px 0; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 500;
}
.checkline { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 8px 0 12px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.primary, .ghost {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
}
.primary { background: #1c2430; color: #fff; }
.ghost { background: #eef1f6; color: var(--ink); }
#reset-data { display: block; width: 100%; margin-top: 8px; }
#reset-data[data-confirm="yes"] { background: #b42318; color: #fff; }
.status { min-height: 1.2em; color: var(--green); font-size: 13px; }

.tabbar {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid rgba(230, 235, 243, 0.9);
  backdrop-filter: blur(10px);
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: #98a0b0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 650;
  padding: 2px 0;
  min-width: 0;
}
.tab svg { width: 22px; height: 22px; }
.tab.is-active { color: var(--green); }
.tab-icon { position: relative; display: grid; }
.badge {
  position: absolute;
  top: -1px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4d5a;
  border: 1px solid #fff;
}
.fab {
  width: 52px;
  height: 52px;
  margin: -18px 2px 0 4px;
  border-radius: 50%;
  border: 4px solid var(--bg);
  background: #1c1f26;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  flex: none;
  box-shadow: 0 10px 20px rgba(20, 24, 32, 0.25);
}

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(18, 24, 34, 0.42);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 30;
}
.sheet-card, .dialog-card {
  width: min(100%, 420px);
  background: #fff;
  border-radius: 28px 28px 0 0;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  max-height: 88vh;
  overflow: auto;
}
.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: #e1e6ee;
  margin: 4px auto 8px;
}
.sheet-card h2, .dialog-card h2 { margin: 4px 0 8px; font-size: 20px; }
.kinds { display: flex; gap: 8px; }
.kinds button {
  flex: 1;
  border: 0;
  background: #f1f4f8;
  border-radius: 999px;
  padding: 8px;
  font-weight: 700;
}
.sheet[data-kind="task"] #kind-task,
.sheet[data-kind="event"] #kind-event,
.sheet[data-kind="project"] #kind-project {
  background: #1c2430;
  color: #fff;
}
.sheet .only-task,
.sheet .only-event,
.sheet .only-project { display: none; }
.sheet[data-kind="task"] .only-task { display: block; }
.sheet[data-kind="event"] .only-event { display: block; }
.sheet[data-kind="project"] .only-project { display: block; }
.sheet[data-kind="task"] .split.only-task,
.sheet[data-kind="event"] .split.only-event,
.sheet[data-kind="project"] .split.only-project { display: grid; }
.sheet[data-mode="edit"] #kind-switch { display: none; }
.sheet[data-mode="create"] #delete-record { display: none; }
.form-error { color: #b42318; min-height: 1.2em; font-size: 13px; margin: 0; }
.sheet-actions { display: flex; gap: 8px; }
.sheet-actions .primary, .sheet-actions .ghost { flex: 1; }
.dialog-card p { color: #3d4658; line-height: 1.45; }
.dialog-card .primary { width: 100%; }

@media (max-width: 420px) {
  .phone { box-shadow: none; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
