/* Rhythm visual system — loaded last to normalize every product surface. */
:root {
  color-scheme: light;
  --bg: #f3f4f1;
  --bg-elevated: #f8f9f6;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-hover: #fafbf8;
  --ink: #19201b;
  --ink-soft: #3f4942;
  --muted: #768078;
  --faint: #9ca39d;
  --line: #e4e8e2;
  --line-strong: #d5dbd4;
  --accent: #49664f;
  --accent-strong: #38533f;
  --accent-soft: #e5eee5;
  --accent-faint: #f0f5ef;
  --danger: #b44949;
  --danger-soft: #f9eaea;
  --warning: #987128;
  --shadow-xs: 0 1px 2px rgba(24, 36, 27, 0.04);
  --shadow-sm: 0 6px 18px rgba(24, 36, 27, 0.055);
  --shadow-md: 0 18px 48px rgba(24, 36, 27, 0.09);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111512;
  --bg-elevated: #171c18;
  --surface: rgba(26, 32, 27, 0.9);
  --surface-solid: #1a201b;
  --surface-hover: #202720;
  --ink: #f1f4ef;
  --ink-soft: #cad1ca;
  --muted: #929c94;
  --faint: #6f7971;
  --line: #29312a;
  --line-strong: #39433a;
  --accent: #a9c4ac;
  --accent-strong: #c2d8c3;
  --accent-soft: #26362a;
  --accent-faint: #1e2b21;
  --danger: #ee9a9a;
  --danger-soft: #422626;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    color-scheme: dark;
    --bg: #111512;
    --bg-elevated: #171c18;
    --surface: rgba(26, 32, 27, 0.9);
    --surface-solid: #1a201b;
    --surface-hover: #202720;
    --ink: #f1f4ef;
    --ink-soft: #cad1ca;
    --muted: #929c94;
    --faint: #6f7971;
    --line: #29312a;
    --line-strong: #39433a;
    --accent: #a9c4ac;
    --accent-strong: #c2d8c3;
    --accent-soft: #26362a;
    --accent-faint: #1e2b21;
  }
}

html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 72% -10%, rgba(104, 140, 108, .09), transparent 30rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); color: var(--ink); }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
button, input, select, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent); outline-offset: 2px; }

h1, h2, h3 {
  color: var(--ink);
  font-weight: 720;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 3.5vw, 2.75rem); line-height: 1.06; letter-spacing: -.052em; }
h2 { font-size: clamp(1.6rem, 2.5vw, 2.15rem); line-height: 1.12; letter-spacing: -.04em; }
h3 { font-size: 1.04rem; line-height: 1.3; letter-spacing: -.022em; }
.eyebrow {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 760;
  letter-spacing: .095em;
  text-transform: uppercase;
}
.muted { color: var(--muted); line-height: 1.55; }

/* Application shell */
.sidebar {
  z-index: 30;
  width: 256px;
  padding: 26px 16px 16px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elevated) 86%, transparent);
  backdrop-filter: blur(22px) saturate(1.25);
  overflow-y: auto;
}
.brand {
  gap: 11px;
  margin: 0 10px 30px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 760;
  letter-spacing: -.03em;
}
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--ink), color-mix(in srgb, var(--ink) 76%, var(--accent)));
  box-shadow: 0 5px 14px rgba(20, 30, 22, .16), inset 0 1px rgba(255,255,255,.16);
  color: var(--surface-solid);
  font-size: .95rem;
}
.brand > .brand-logo {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  overflow: hidden;
  place-items: center;
  border: 1px solid color-mix(in srgb, #d9d2bf 24%, transparent);
  border-radius: 13px;
  background: #090a09;
  box-shadow: 0 5px 14px rgba(10, 14, 11, .2), inset 0 1px rgba(255,255,255,.08);
  color: inherit;
}
.brand > .brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand > .brand-name {
  display: inline;
  width: auto;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  line-height: 1;
}
.sidebar-nav { display: grid; gap: 3px; padding-bottom: 150px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 570;
  transition: color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}
.nav-item:hover {
  background: color-mix(in srgb, var(--surface-solid) 60%, transparent);
  color: var(--ink);
  transform: translateX(2px);
}
.nav-item.active {
  border-color: color-mix(in srgb, var(--accent) 12%, transparent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: var(--shadow-xs);
}
.nav-icon {
  display: grid;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 500;
}
.sidebar-lower { position: absolute; inset: auto 16px 16px; display: grid; gap: 10px; }
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-solid) 66%, transparent);
}
.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-soft), var(--accent-faint));
  color: var(--accent-strong);
  font-size: .78rem;
  font-weight: 800;
}
.user-meta { display: grid; min-width: 0; flex: 1; }
.user-meta strong { overflow: hidden; color: var(--ink); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { overflow: hidden; color: var(--muted); font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-button:hover { background: var(--accent-soft); color: var(--accent-strong); }

.content {
  width: min(calc(100% - 256px), 1400px);
  max-width: none;
  margin-left: 256px;
  padding: 28px clamp(28px, 4vw, 68px) 70px;
}
.global-bar {
  position: relative;
  z-index: 20;
  align-items: center;
  min-height: 42px;
  margin-bottom: clamp(30px, 4vw, 52px);
}
.global-search {
  display: flex;
  width: min(340px, 42vw);
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-solid) 75%, transparent);
  box-shadow: var(--shadow-xs);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.global-search:focus-within {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--surface-solid);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}
.global-search input {
  width: 100%;
  height: 40px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: .84rem;
}
.global-search kbd {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--faint);
  font: 600 .62rem ui-monospace, monospace;
  white-space: nowrap;
}
.quick-add summary, .primary-button {
  display: inline-flex;
  min-height: 41px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid color-mix(in srgb, var(--ink) 84%, transparent);
  border-radius: 12px;
  background: var(--ink);
  box-shadow: 0 5px 14px rgba(20, 30, 22, .13);
  color: var(--surface-solid);
  font-size: .82rem;
  font-weight: 680;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), opacity .16s;
}
.quick-add summary:hover, .primary-button:hover {
  color: var(--surface-solid);
  box-shadow: 0 8px 22px rgba(20, 30, 22, .18);
  transform: translateY(-1px);
}
.quick-add[open] summary { transform: translateY(1px); }
.quick-add { position: relative; }
.quick-add summary { list-style: none; }
.quick-add summary::-webkit-details-marker { display: none; }
.quick-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  display: grid;
  width: 260px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-md);
  animation: menu-in .16s var(--ease);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-5px) scale(.98); } }
.menu-label { margin: 4px 9px 7px; color: var(--faint); font-size: .65rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.quick-menu a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 9px;
  align-items: center;
  padding: 9px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}
.quick-menu a:hover { background: var(--accent-faint); }
.quick-menu a > span:first-child { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent-strong); }
.quick-menu a > span:last-child { display: grid; }
.quick-menu strong { font-size: .78rem; }
.quick-menu small { color: var(--muted); font-size: .67rem; }

/* Page composition */
.topbar { align-items: flex-end; margin-bottom: 30px; gap: 24px; }
.page-heading > div:first-child { min-width: 0; max-width: 760px; }
.page-heading h1 { overflow-wrap: anywhere; }
.topbar > div:last-child { display: flex; align-items: center; gap: 12px; }
.topbar a:not(.primary-button) { color: var(--muted); font-size: .8rem; font-weight: 620; text-decoration: none; }
.topbar a:not(.primary-button):hover { color: var(--accent-strong); }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
a.card:hover, .note-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 270px;
  padding: clamp(30px, 4vw, 48px);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 88% 18%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 17rem),
    linear-gradient(135deg, var(--surface-solid), var(--accent-faint));
  box-shadow: var(--shadow-sm);
}
.hero-card::after {
  position: absolute;
  width: 220px;
  height: 220px;
  border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 50%;
  content: "";
  inset: -100px -70px auto auto;
}
.progress-ring {
  position: relative;
  z-index: 1;
  border-color: var(--accent-soft);
  background: color-mix(in srgb, var(--surface-solid) 64%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent);
}
.day-grid, .tile-grid { gap: 14px; }
.day-grid .card { min-height: 150px; }
.card h3 { margin-bottom: 14px; }
.settings-card { width: min(100%, 740px); min-height: 0; padding: clamp(24px, 4vw, 38px); }
.settings-card hr { margin: 30px 0; border: 0; border-top: 1px solid var(--line); }

/* Controls */
.form-stack { gap: 20px; margin-top: 24px; }
.form-stack > div, .form-stack > label { display: grid; gap: 7px; }
.form-stack label {
  color: var(--ink-soft);
  font-size: .76rem;
  font-weight: 680;
  letter-spacing: .005em;
}
.form-stack input:not([type="checkbox"]):not([type="radio"]),
.form-stack select,
.form-stack textarea,
.search-form input,
.item-row input[type="datetime-local"],
.item-row input[type="date"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: 0;
  background: var(--surface-solid);
  box-shadow: inset 0 1px 2px rgba(20, 30, 22, .025);
  color: var(--ink);
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.form-stack textarea { min-height: 120px; resize: vertical; }
.form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus, .search-form input:focus {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 11%, transparent);
}
.form-stack input[type="checkbox"], .form-stack input[type="radio"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}
.form-stack ul:not(.errorlist) { display: grid; gap: 8px; margin: 0; padding: 10px 0; list-style: none; }
.form-stack ul:not(.errorlist) label { display: flex; align-items: center; gap: 8px; font-weight: 520; }
.helptext, .form-stack small { color: var(--muted); font-size: .7rem; font-weight: 450; }
.errorlist { padding: 8px 10px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); }
.primary-button { width: fit-content; }
.secondary-button {
  display: inline-flex;
  min-height: 41px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-solid);
  color: var(--ink-soft);
  font-size: .8rem;
  font-weight: 650;
  text-decoration: none;
}
.secondary-button:hover { background: var(--accent-faint); color: var(--accent-strong); }
.form-card { box-shadow: var(--shadow-sm); }
.form-actions { display: flex !important; grid-template-columns: none !important; align-items: center; justify-content: flex-end; gap: 9px !important; padding-top: 8px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.danger-zone > div { display: grid; }
.danger-zone strong { color: var(--ink-soft); font-size: .75rem; }
.danger-zone small { color: var(--muted); font-size: .65rem; }
.danger-zone > a { color: var(--danger); font-size: .72rem; font-weight: 650; text-decoration: none; }
.text-button, .habit-check {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-solid);
  color: var(--accent-strong);
  font-size: .75rem;
  font-weight: 660;
  text-decoration: none;
  cursor: pointer;
  transition: background .16s, border-color .16s, transform .16s;
}
.text-button:hover, .habit-check:hover { border-color: var(--line-strong); background: var(--accent-faint); transform: translateY(-1px); }
.circle-check {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--surface-solid);
  color: transparent;
  cursor: pointer;
  transition: color .16s, border-color .16s, background .16s, transform .16s;
}
.circle-check:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); transform: scale(1.05); }
.filter-bar { gap: 7px; margin: -8px 0 24px; padding: 2px 0; }
.filter-bar a {
  min-height: 35px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: .74rem;
  font-weight: 620;
  white-space: nowrap;
  transition: border-color .16s, background .16s, color .16s;
}
.filter-bar a:hover { border-color: var(--line-strong); background: var(--accent-faint); color: var(--accent-strong); }

/* Lists, status and data */
.stack-list { gap: 9px; }
.item-row {
  min-height: 66px;
  padding: 14px 17px;
  border-radius: 15px;
}
.item-row:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.item-row > a { min-width: 0; flex: 1; color: var(--ink); text-decoration: none; }
.item-row time { min-width: 120px; color: var(--muted); font-size: .72rem; font-weight: 620; }
.drag-handle { opacity: .45; transition: opacity .16s; }
.item-row:hover .drag-handle { opacity: 1; }
.progress-track { height: 7px; background: var(--accent-soft); }
.progress-track span { border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #8aab8d)); }
.empty-state {
  padding: 64px 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-solid) 35%, transparent);
}
.notice {
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  border-radius: 11px;
  background: var(--accent-faint);
  color: var(--accent-strong);
  font-size: .8rem;
}
.history-card { min-height: 0; }
.polished-history { margin-top: 14px; padding: 24px; }
.polished-history .heatmap { margin-top: 26px; }
.polished-history .soft-badge i { width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }
.reminder-row > div { display: grid; min-width: 0; flex: 1; }
.reminder-row strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.reminder-row small { color: var(--muted); font-size: .66rem; }
.reminder-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.status-dot.active { background: #6f9a73; box-shadow: 0 0 0 4px color-mix(in srgb, #6f9a73 13%, transparent); }
.status-dot.sent { background: #6987a5; }
.heatmap { grid-template-columns: repeat(auto-fill, 13px); gap: 5px; }
.heatmap span { width: 13px; height: 13px; border-radius: 4px; }
.markdown-body { min-height: 320px; padding: clamp(25px, 4vw, 42px); }
.analytics-grid { margin-top: 14px; }
.note-card { min-height: 190px; }
.filter-bar a.selected { border-color: color-mix(in srgb, var(--accent) 18%, var(--line)); background: var(--accent-soft); color: var(--accent-strong); }
.empty-panel {
  display: grid;
  min-height: 340px;
  place-items: center;
  place-content: center;
  padding: 54px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--surface-solid) 42%, transparent);
  text-align: center;
}
.empty-panel > span { display: grid; width: 52px; height: 52px; margin-bottom: 18px; place-items: center; border-radius: 16px; background: var(--accent-soft); color: var(--accent); font-size: 1.3rem; }
.empty-panel h2 { margin: 0 0 8px; font-size: 1.4rem; }
.empty-panel p { max-width: 390px; margin: 0 0 22px; color: var(--muted); font-size: .83rem; }
.full-span { grid-column: 1 / -1; }
.habit-row { min-height: 82px; padding: 12px 14px; }
.habit-row > a { display: flex; min-width: 0; flex: 1; align-items: center; gap: 13px; }
.habit-symbol { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 13px; background: color-mix(in srgb, var(--habit-color) 13%, var(--surface-solid)); color: var(--habit-color); font-weight: 800; }
.habit-copy { display: grid; min-width: 0; }
.habit-copy .eyebrow { margin: 0 0 2px; font-size: .59rem; }
.habit-copy strong { overflow: hidden; color: var(--ink); font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.habit-copy small { color: var(--muted); font-size: .67rem; }
.habit-actions { display: flex; align-items: center; gap: 10px; }
.streak-badge { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .7rem; font-weight: 650; }
.streak-badge b { color: #c77735; }
.task-row > a { display: grid; }
.task-row > a strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.task-row > a small { color: var(--muted); font-size: .67rem; }
.circle-check.done { border-color: var(--accent); background: var(--accent); color: var(--surface-solid); }
.priority-dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--muted); }
.priority-3 { background: #c98a3f; }.priority-4 { background: #c85a58; }
.soft-badge { display: inline-flex; align-items: center; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--muted); font-size: .62rem; font-weight: 680; white-space: nowrap; }
.goal-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.goal-card { min-height: 320px; padding: 24px; }
.goal-top, .goal-progress-label, .card-footer, .note-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.goal-symbol { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 1.1rem; }
.goal-card h3 { margin: 22px 0 7px; font-size: 1.2rem; }
.goal-card h3 a { color: var(--ink); text-decoration: none; }
.goal-progress-label { margin-top: 24px; color: var(--muted); font-size: .68rem; }
.goal-progress-label strong { color: var(--ink); }
.milestone-list { display: grid; gap: 4px; margin: 18px 0; }
.milestone-button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 6px 0; border: 0; background: none; color: var(--ink-soft); font-size: .72rem; text-align: left; cursor: pointer; }
.milestone-button span { display: grid; width: 18px; height: 18px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: white; font-size: .58rem; }
.milestone-button.done { color: var(--muted); text-decoration: line-through; }
.milestone-button.done span { border-color: var(--accent); background: var(--accent); }
.goal-checkpoint-summary { display: flex; align-items: center; gap: 10px; min-height: 62px; margin: 18px 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elevated); }
.goal-checkpoint-icon { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.goal-checkpoint-summary > div { display: grid; min-width: 0; }
.goal-checkpoint-summary strong { font-size: .72rem; }
.goal-checkpoint-summary small { color: var(--muted); font-size: .61rem; line-height: 1.45; }
.card-footer { margin-top: auto; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: .65rem; }
.card-footer a { font-weight: 650; text-decoration: none; }
.note-search { position: relative; width: min(100%, 500px); }
.note-search span { position: absolute; z-index: 1; top: 9px; left: 13px; color: var(--muted); }
.note-search input { padding-left: 36px; }
.notes-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.note-card { position: relative; display: block; overflow: hidden; padding: 23px; }
.note-meta { color: var(--faint); font-size: .62rem; font-weight: 650; }
.pin-badge { color: var(--accent); }
.note-card h3 { margin: 25px 0 9px; font-size: 1.06rem; }
.note-card > p { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: .76rem; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.note-arrow { position: absolute; right: 20px; bottom: 17px; color: var(--faint); opacity: 0; transform: translateX(-5px); transition: .18s var(--ease); }
.note-card:hover .note-arrow { opacity: 1; transform: none; }
.view-switcher { width: fit-content; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-solid); }
.view-switcher a { border: 0; }
.calendar-shell { min-height: 450px; padding: 0; overflow: hidden; }
.calendar-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.calendar-title > div { display: flex; align-items: center; gap: 12px; }
.calendar-title h2 { margin: 0; font-size: 1.2rem; }
.calendar-title .eyebrow { margin: 0; }
.calendar-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.agenda-list { padding: 8px 16px 16px; }
.agenda-row { display: flex; min-height: 74px; align-items: center; gap: 15px; padding: 11px 8px; border-bottom: 1px solid var(--line); }
.agenda-row:last-child { border-bottom: 0; }
.date-tile { display: grid; width: 43px; height: 48px; flex: 0 0 43px; place-items: center; place-content: center; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); line-height: 1; }
.date-tile strong { font-size: .9rem; }
.date-tile small { margin-top: 4px; color: var(--muted); font-size: .56rem; font-weight: 700; text-transform: uppercase; }
.agenda-copy { display: grid; min-width: 0; flex: 1; }
.agenda-copy span { color: var(--muted); font-size: .62rem; }
.agenda-copy a { overflow: hidden; color: var(--ink); font-size: .82rem; font-weight: 680; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.agenda-row form { display: flex; align-items: center; gap: 7px; }
.agenda-row input { max-width: 190px; min-height: 36px !important; font-size: .7rem; }
.calendar-empty { min-height: 340px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.metric-card { display: flex; min-height: 138px; align-items: center; gap: 15px; padding: 22px; }
.metric-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 13px; font-size: 1rem; }
.metric-icon.green { background: var(--accent-soft); color: var(--accent); }
.metric-icon.blue { background: #e5edf5; color: #58789a; }
.metric-icon.amber { background: #f7ead8; color: #a26d2b; }
.metric-card > div { display: grid; }
.metric-card p { margin: 0; color: var(--muted); font-size: .68rem; font-weight: 650; }
.metric-card strong { color: var(--ink); font-size: 1.8rem; letter-spacing: -.05em; }
.metric-card small { color: var(--faint); font-size: .62rem; }
.analytics-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr); gap: 14px; margin-top: 14px; }
.chart-card, .consistency-card { min-height: 390px; padding: 23px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title-row h3, .card-title-row .eyebrow { margin: 0; }
.chart-wrap { height: 285px; margin-top: 24px; }
.consistency-list { display: grid; margin-top: 16px; }
.consistency-list > div { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.consistency-list > div:last-child { border: 0; }
.consistency-list > div > span:nth-child(2) { display: grid; min-width: 0; flex: 1; }
.consistency-list strong { overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.consistency-list small { color: var(--muted); font-size: .62rem; font-weight: 500; }
.consistency-list b { color: var(--ink); font-size: .78rem; text-align: right; }
.settings-layout { display: grid; grid-template-columns: 190px minmax(0, 740px); gap: 18px; align-items: start; }
.settings-nav { position: sticky; top: 24px; display: grid; min-height: 0; padding: 8px; }
.settings-nav a { padding: 9px 10px; border-radius: 9px; color: var(--muted); font-size: .74rem; font-weight: 600; text-decoration: none; }
.settings-nav a:hover, .settings-nav a.active { background: var(--accent-soft); color: var(--accent-strong); }
.toggle-field { grid-template-columns: 1fr auto; align-items: center; padding: 4px 0; }
.toggle-field input { width: 38px !important; height: 22px !important; appearance: none; border-radius: 999px; background: var(--line-strong); cursor: pointer; transition: background .16s; }
.toggle-field input::after { display: block; width: 18px; height: 18px; margin: 2px; border-radius: 50%; background: white; box-shadow: var(--shadow-xs); content: ""; transition: transform .16s; }
.toggle-field input:checked { background: var(--accent); }
.toggle-field input:checked::after { transform: translateX(16px); }
.preferences-form { margin-top: 0; }
.settings-section { display: grid; gap: 16px; padding: 4px 0 28px; scroll-margin-top: 24px; }
.settings-section + .settings-section { padding-top: 28px; border-top: 1px solid var(--line); }
.settings-section-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 2px; }
.settings-section-heading > span { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.settings-section-heading > div { display: grid; }
.settings-section-heading h2 { margin: 0; font-size: .94rem; letter-spacing: -.02em; }
.settings-section-heading p { margin: 2px 0 0; color: var(--muted); font-size: .68rem; }
.setting-field { display: grid; gap: 7px; }
.setting-field label, .toggle-field label { color: var(--ink-soft); font-size: .75rem; font-weight: 650; }
.settings-save { display: flex; justify-content: flex-end; padding-top: 2px; }
.settings-hint { margin: -6px 0 8px; color: var(--muted); font-size: .66rem; }
.push-guidance { display: grid; gap: 5px; margin: -2px 0 14px 47px; padding: 13px 15px; border: 1px solid var(--warning-line, #dfc68e); border-radius: 11px; background: var(--warning-soft, #fff8e8); color: var(--ink-soft); }
.push-guidance[hidden] { display: none; }
.push-guidance strong { font-size: .72rem; }
.push-guidance p { margin: 0; color: var(--muted); font-size: .66rem; line-height: 1.55; }
.push-guidance .text-button { width: fit-content; margin-top: 4px; }
.data-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.data-panel:first-of-type { margin-top: 34px; }
.data-panel > div { display: flex; align-items: center; gap: 11px; }
.data-panel > div > span { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.data-panel > div > div { display: grid; }
.data-panel strong { font-size: .76rem; }
.data-panel small { color: var(--muted); font-size: .65rem; }
.search-hero { width: min(100%, 680px); margin-bottom: 28px; }
.search-hero input { min-height: 50px; font-size: .9rem; }
.search-hero span { top: 13px; }
.result-label { margin-bottom: 12px; color: var(--muted); font-size: .7rem; font-weight: 620; }
.search-results { grid-template-columns: repeat(2, 1fr); }
.result-card { min-height: 210px; padding: 20px; }
.result-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.result-heading > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.result-heading h3 { margin: 0; }
.result-card > a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 3px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: .74rem; text-decoration: none; }
.result-card > a:hover { color: var(--accent-strong); }
.search-empty { min-height: 280px; }
.upload-intro { display: flex; align-items: center; gap: 13px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.upload-intro > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: var(--accent-soft); color: var(--accent); }
.upload-intro h3, .upload-intro p { margin: 0; }
.upload-intro p { color: var(--muted); font-size: .7rem; }
.file-drop { padding: 26px; border: 1px dashed var(--line-strong); border-radius: 14px; background: var(--bg); text-align: center; }
.file-drop input { margin-top: 10px; }
.review-layout { display: grid; grid-template-columns: minmax(220px, .55fr) minmax(0, 1fr); gap: 18px; max-width: 980px; }
.review-prompt { position: relative; overflow: hidden; min-height: 400px; padding: 30px; border-radius: var(--radius-lg); background: linear-gradient(145deg, #647f69, #344c3a); color: white; }
.review-prompt::after { position: absolute; right: -80px; bottom: -80px; width: 230px; height: 230px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; content: ""; }
.review-prompt > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: rgba(255,255,255,.13); }
.review-prompt blockquote { position: absolute; right: 30px; bottom: 30px; left: 30px; margin: 0; font-size: 1.2rem; font-weight: 570; line-height: 1.4; letter-spacing: -.03em; }
.review-prompt.weekly { background: linear-gradient(145deg, #67778d, #39475c); }
.delete-card { width: min(100%, 560px); min-height: 0; margin: 10vh auto 0; padding: 42px; text-align: center; box-shadow: var(--shadow-md); }
.delete-card h1 { font-size: 1.7rem; }
.delete-card > p:not(.eyebrow) { color: var(--muted); }
.delete-icon { display: grid; width: 48px; height: 48px; margin: 0 auto 20px; place-items: center; border-radius: 15px; background: var(--danger-soft); color: var(--danger); font-size: 1.4rem; }
.delete-card form { display: flex; justify-content: center; gap: 9px; margin-top: 26px; }
.danger-button { min-height: 41px; padding: 9px 14px; border: 1px solid var(--danger); border-radius: 12px; background: var(--danger); color: white; font-size: .78rem; font-weight: 670; cursor: pointer; }
.danger-button:hover { filter: brightness(.94); }
.reflection-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 14px; margin-bottom: 38px; }
.reflection-history-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 28px; align-items: start; }
.reflection-timeline { position: relative; display: grid; gap: 9px; }
.reflection-timeline::before { position: absolute; z-index: -1; top: 0; bottom: 0; left: 24px; width: 1px; background: var(--line); content: ""; }
.reflection-entry { display: flex; min-height: 88px; align-items: center; gap: 14px; padding: 14px 16px; color: var(--ink); text-decoration: none; }
.reflection-date { display: grid; width: 48px; height: 52px; flex: 0 0 48px; place-items: center; place-content: center; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-solid); line-height: 1; }
.reflection-date strong { font-size: 1rem; }
.reflection-date small { margin-top: 4px; color: var(--muted); font-size: .57rem; font-weight: 740; text-transform: uppercase; }
.reflection-copy { display: grid; min-width: 0; flex: 1; }
.reflection-copy > div { display: flex; align-items: center; gap: 8px; }
.reflection-copy strong { font-size: .78rem; }
.reflection-copy p { overflow: hidden; margin: 5px 0 0; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.reflection-copy p b { margin-right: 4px; color: var(--accent); font-size: .6rem; letter-spacing: .05em; text-transform: uppercase; }
.mood-badge { padding: 3px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: .56rem; font-weight: 680; }
.entry-arrow { color: var(--faint); transition: transform .16s; }
.reflection-entry:hover .entry-arrow { color: var(--accent); transform: translateX(3px); }
.reflection-empty { min-height: 300px; }
.weekly-review-list { display: grid; gap: 10px; }
.weekly-review-card { display: block; min-height: 170px; padding: 18px; color: var(--ink); text-decoration: none; }
.weekly-review-card > div { display: flex; align-items: center; gap: 10px; }
.week-symbol { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: .65rem; font-weight: 800; }
.weekly-review-card > div > span:last-child { display: grid; }
.weekly-review-card strong { font-size: .76rem; }
.weekly-review-card small { color: var(--muted); font-size: .61rem; }
.weekly-review-card p { margin: 18px 0; color: var(--muted); font-size: .71rem; line-height: 1.55; }
.weekly-review-card > span:last-child { color: var(--accent); font-size: .64rem; font-weight: 650; }
.weekly-empty { min-height: 210px; }

/* Read-only detail surfaces */
.detail-layout { display: grid; width: 100%; max-width: 1120px; grid-template-columns: minmax(0, 1fr) 248px; gap: 20px; align-items: start; }
.detail-card { min-height: 0; padding: clamp(24px, 4vw, 38px); background: var(--surface-solid); box-shadow: var(--shadow-sm); }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.detail-field { display: grid; gap: 5px; min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--bg-elevated); }
.detail-field small { color: var(--muted); font-size: .61rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.detail-field strong { overflow-wrap: anywhere; color: var(--ink); font-size: .78rem; }
.detail-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.detail-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.detail-section h2 { margin: 0 0 13px; font-size: 1rem; }
.detail-section > p:not(.eyebrow) { color: var(--ink-soft); font-size: .82rem; line-height: 1.75; }
.detail-section .markdown-body { min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.detail-section .markdown-body > :first-child { margin-top: 0; }
.detail-section .markdown-body > :last-child { margin-bottom: 0; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.detail-links { display: grid; border-top: 1px solid var(--line); }
.detail-links a { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: .76rem; font-weight: 640; text-decoration: none; }
.detail-links a span { color: var(--accent); }
.detail-links a b { margin-left: auto; color: var(--faint); }
.detail-actions { position: sticky; top: 24px; display: grid; gap: 13px; min-height: 0; padding: 21px; background: var(--surface-solid); box-shadow: var(--shadow-xs); }
.detail-actions h2 { margin: 0 0 3px; font-size: .9rem; }
.detail-actions form, .detail-actions button { width: 100%; }
.detail-actions > a { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-solid); color: var(--accent-strong); font-size: .72rem; font-weight: 650; text-align: center; text-decoration: none; }
.detail-actions > a:hover { border-color: var(--line-strong); background: var(--accent-faint); }
.detail-actions > a.danger-link { border-color: color-mix(in srgb, var(--danger) 20%, var(--line)); background: color-mix(in srgb, var(--danger-soft) 48%, transparent); color: var(--danger); }
.section-caption { margin: 3px 0 0; color: var(--muted); font-size: .65rem; }
.detail-checklist { display: grid; margin-top: 12px; border-top: 1px solid var(--line); }
.milestone-row { display: grid; min-height: 66px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.milestone-toggle { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface-solid); color: var(--accent); cursor: pointer; }
.milestone-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }
.milestone-copy { display: grid; min-width: 0; }
.milestone-copy strong { overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.milestone-copy small { color: var(--muted); font-size: .62rem; }
.milestone-row.done .milestone-toggle { border-color: var(--accent); background: var(--accent); color: var(--surface-solid); }
.milestone-row.done .milestone-copy strong { color: var(--muted); text-decoration: line-through; }
.milestone-actions { display: flex; align-items: center; gap: 9px; }
.milestone-actions a { color: var(--muted); font-size: .65rem; font-weight: 650; text-decoration: none; }
.milestone-actions a:hover { color: var(--accent-strong); }
.milestone-actions a.danger-link:hover { color: var(--danger); }
.reflection-detail { width: min(100%, 820px); }
.reflection-detail .detail-section { margin-top: 0; padding: 22px 0; }
.reflection-detail .detail-section:first-child { padding-top: 0; }
.reflection-detail .detail-section:last-child { padding-bottom: 0; }
.note-document { width: min(100%, 920px); min-height: 0; padding: clamp(26px, 5vw, 54px); background: var(--surface-solid); box-shadow: var(--shadow-sm); }
.habit-overview { min-height: 0; margin-bottom: 14px; padding: 18px; background: var(--surface-solid); }
.callout-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 0; margin-bottom: 18px; padding: 18px 20px; }
.callout-card > div { display: flex; align-items: center; gap: 12px; }
.callout-card > div > span { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.callout-card > div > div { display: grid; }
.callout-card strong { font-size: .78rem; }
.callout-card small { color: var(--muted); font-size: .68rem; }

/* Progressive modal layer */
.app-modal {
  width: min(94vw, 680px);
  max-height: min(88vh, 860px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-solid);
  box-shadow: 0 30px 90px rgba(8, 14, 10, .28);
  color: var(--ink);
}
.app-modal::backdrop {
  background: rgba(8, 12, 9, .52);
  backdrop-filter: blur(5px);
  animation: modal-backdrop-in .18s var(--ease);
}
.app-modal[open] { animation: modal-in .2s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@keyframes modal-backdrop-in { from { opacity: 0; } }
.modal-shell { display: flex; max-height: min(88vh, 860px); flex-direction: column; }
.modal-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 27px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, var(--surface-solid), var(--accent-faint));
}
.modal-header .eyebrow { margin-bottom: 4px; }
.modal-header h2 { margin: 0; font-size: 1.4rem; }
.modal-subtitle { max-width: 480px; margin: 5px 0 0; color: var(--muted); font-size: .72rem; }
.modal-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-solid) 70%, transparent);
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { border-color: var(--line-strong); background: var(--surface-solid); color: var(--ink); }
.modal-body { min-height: 160px; overflow-y: auto; overscroll-behavior: contain; }
.modal-body > .settings-card, .modal-body > .delete-card {
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 26px 27px 28px;
  border: 0;
  border-radius: 0;
  background: var(--surface-solid);
  box-shadow: none;
}
.modal-body .form-stack { margin-top: 0; }
.modal-body .danger-zone { display: none; }
.modal-loader { display: grid; min-height: 180px; place-items: center; place-content: center; color: var(--muted); font-size: .72rem; }
.modal-loader span { width: 24px; height: 24px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: modal-spin .7s linear infinite; }
.modal-loader p { margin: 9px 0 0; }
@keyframes modal-spin { to { transform: rotate(360deg); } }
.app-modal.loading .modal-header { opacity: .65; }

/* Today dashboard */
.page-subtitle { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }
.today-hero { align-items: center; }
.hero-copy { position: relative; z-index: 2; max-width: 650px; }
.hero-copy h2 { margin: 18px 0 11px; }
.hero-copy > p { max-width: 560px; color: var(--muted); font-size: .94rem; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-solid) 55%, transparent);
  color: var(--accent-strong);
  font-size: .67rem;
  font-weight: 720;
}
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 11%, transparent); }
.hero-stats { display: flex; gap: 28px; margin-top: 28px; }
.hero-stats span { display: grid; }
.hero-stats strong { color: var(--ink); font-size: 1.12rem; }
.hero-stats small { color: var(--muted); font-size: .68rem; }
.progress-ring {
  display: grid;
  width: 152px;
  height: 152px;
  flex: 0 0 152px;
  padding: 11px;
  place-items: center;
  border: 0;
  background: conic-gradient(var(--accent) calc(var(--progress) * 1%), var(--accent-soft) 0);
}
.progress-ring::before { position: absolute; inset: 11px; border-radius: 50%; background: var(--surface-solid); content: ""; }
.progress-ring > div { position: relative; z-index: 1; display: grid; text-align: center; }
.progress-ring strong { font-size: 1.65rem; letter-spacing: -.04em; }
.progress-ring span { color: var(--muted); font-size: .65rem; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 42px 0 17px; }
.section-heading h2 { margin: 0; font-size: 1.35rem; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-heading > a { color: var(--muted); font-size: .75rem; font-weight: 650; text-decoration: none; }
.section-heading > a:hover { color: var(--accent-strong); }
.section-heading.compact { margin-top: 0; }
.planner-grid { margin-top: 0; }
.planner-card { min-height: 190px !important; padding: 21px; }
.card-heading { display: flex; align-items: center; gap: 12px; }
.card-heading h3 { margin: 0; }
.card-heading .eyebrow { margin-bottom: 2px; }
.time-icon { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 11px; font-size: 1rem; }
.time-icon.morning { background: #fff2d9; color: #9a6c1d; }
.time-icon.afternoon { background: #e4edf7; color: #52749b; }
.time-icon.evening { background: #ece7f5; color: #745b96; }
.mini-list { display: grid; gap: 8px; margin-top: 22px; }
.mini-list a { display: flex; align-items: center; gap: 8px; overflow: hidden; color: var(--ink-soft); font-size: .78rem; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.mini-list a span { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--accent); }
.empty-copy { margin: 0; color: var(--muted); font-size: .76rem; }
.today-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 44px; }
.dashboard-list { min-height: 0; padding: 6px; }
.dashboard-row { display: flex; min-height: 64px; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 13px; transition: background .15s; }
.dashboard-row + .dashboard-row { border-top: 1px solid var(--line); border-top-left-radius: 0; border-top-right-radius: 0; }
.dashboard-row:hover { background: var(--accent-faint); }
.dashboard-row > a:not(.text-button) { display: grid; min-width: 0; flex: 1; color: var(--ink); text-decoration: none; }
.dashboard-row strong { overflow: hidden; font-size: .79rem; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-row small { color: var(--muted); font-size: .66rem; }
.dashboard-row time { color: var(--muted); font-size: .68rem; font-weight: 620; }
.row-symbol { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--row-colour) 13%, var(--surface-solid)); color: var(--row-colour); font-size: .7rem; font-weight: 800; }
.completion-button { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface-solid); color: transparent; cursor: pointer; transition: .16s var(--ease); }
.completion-button:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); transform: scale(1.06); }
.completion-button.done { border-color: var(--accent); background: var(--accent); color: var(--surface-solid); }
.soft-empty { display: grid; min-height: 158px; place-items: center; place-content: center; text-align: center; }
.soft-empty span { display: grid; width: 38px; height: 38px; margin-bottom: 10px; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.soft-empty p { margin: 0 0 3px; color: var(--ink-soft); font-size: .8rem; font-weight: 680; }
.soft-empty small { color: var(--muted); font-size: .68rem; }
.reflection-banner { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 36px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(115deg, var(--surface-solid), var(--accent-faint)); }
.reflection-banner > div { display: flex; align-items: center; gap: 13px; }
.reflection-banner > div:first-child > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: var(--accent-soft); color: var(--accent); }
.reflection-banner h3, .reflection-banner p { margin: 0; }
.reflection-banner .eyebrow { margin-bottom: 2px; }
.reflection-banner h3 { font-size: .95rem; }
.reflection-banner div div > p:last-child { color: var(--muted); font-size: .72rem; }
.reflection-banner > div:last-child > a:not(.primary-button) { color: var(--muted); font-size: .75rem; font-weight: 620; text-decoration: none; }

/* Authentication */
.auth-page { overflow: hidden; }
.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(380px, 48%) 1fr;
  padding: 0;
}
.auth-card {
  display: flex;
  width: min(100%, 520px);
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  justify-self: center;
  padding: clamp(36px, 7vw, 84px);
  border: 0;
  background: transparent;
  box-shadow: none;
}
.auth-card h1 { margin-bottom: 10px; }
.auth-brand { margin: 0 0 52px; }
.auth-subtitle { margin: 0 0 5px; color: var(--muted); font-size: .83rem; }
.auth-form .primary-button { width: 100%; margin-top: 2px; }
.form-inline-meta { display: flex !important; align-items: center; justify-content: space-between; gap: 12px !important; }
.form-inline-meta a { color: var(--accent); font-size: .7rem; font-weight: 620; text-decoration: none; }
.remember-label { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 7px !important; color: var(--muted) !important; font-size: .68rem !important; font-weight: 500 !important; }
.auth-links { padding-top: 6px; border-top: 1px solid var(--line); }
.auth-links span { color: var(--muted); font-size: .72rem; }
.auth-links a { font-size: .75rem; font-weight: 620; text-decoration: none; }
.auth-visual {
  position: relative;
  display: grid;
  overflow: hidden;
  margin: 18px;
  place-items: center;
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 40%, rgba(255,255,255,.18), transparent 18rem),
    linear-gradient(145deg, #67826b, #314b38);
}
.auth-visual::after {
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 50%;
  content: "";
}
.auth-orbit { position: absolute; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; }
.orbit-one { width: 44%; aspect-ratio: 1; }
.orbit-two { width: 82%; aspect-ratio: 1; }
.auth-quote { position: relative; z-index: 2; width: min(76%, 460px); color: white; }
.auth-quote span { display: block; height: 35px; color: rgba(255,255,255,.55); font: 4rem Georgia, serif; }
.auth-quote p { font-size: clamp(1.45rem, 2.7vw, 2.4rem); font-weight: 580; line-height: 1.25; letter-spacing: -.04em; }

/* Mobile */
.mobile-nav { display: none; }
@media (max-width: 980px) {
  .sidebar { width: 220px; }
  .content { width: calc(100% - 220px); margin-left: 220px; padding-inline: 28px; }
  .today-columns { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  body { background: var(--bg); }
  .sidebar { display: none; }
  .content { width: 100%; margin-left: 0; padding: 18px 17px calc(104px + env(safe-area-inset-bottom)); }
  .global-bar { justify-content: space-between; margin-bottom: 30px; }
  .global-search { width: min(100%, 250px); }
  .global-search kbd { display: none; }
  .quick-add { display: none; }
  .topbar { align-items: center; margin-bottom: 22px; }
  .topbar h1 { font-size: 2rem; }
  .topbar > div:last-child { gap: 8px; }
  .hero-card { min-height: 225px; padding: 26px; }
  .hero-card h2 { font-size: 1.7rem; }
  .progress-ring { width: 104px; height: 104px; flex: 0 0 104px; }
  .day-grid, .tile-grid { grid-template-columns: 1fr; }
  .planner-grid { grid-template-columns: 1fr; }
  .planner-card { min-height: 0 !important; }
  .today-columns { margin-top: 36px; }
  .reflection-banner { align-items: flex-start; flex-direction: column; }
  .reflection-banner > div:last-child { width: 100%; justify-content: flex-end; }
  .metric-grid, .analytics-layout, .settings-layout { grid-template-columns: 1fr; }
  .review-layout, .search-results { grid-template-columns: 1fr; }
  .reflection-history-layout { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-actions { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; }
  .detail-actions h2 { grid-column: 1 / -1; }
  .detail-actions .detail-field { grid-column: 1 / -1; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reflection-summary { grid-template-columns: repeat(2, 1fr); }
  .review-prompt { min-height: 240px; }
  .settings-nav { position: static; grid-template-columns: repeat(4, auto); overflow-x: auto; }
  .agenda-row form { width: 100%; }
  .agenda-row input { max-width: none; flex: 1; }
  .card { border-radius: 16px; }
  .item-row { flex-wrap: wrap; }
  .item-row time { width: 100%; }
  .habit-row { align-items: stretch; flex-direction: column; }
  .habit-actions { justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line); }
  .data-panel { align-items: flex-start; }
  .mobile-nav {
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
    box-shadow: 0 -8px 30px rgba(20, 30, 22, .07);
    backdrop-filter: blur(20px);
  }
  .mobile-nav > a {
    display: grid;
    gap: 2px;
    place-items: center;
    color: var(--muted);
    font-size: .61rem;
    font-weight: 620;
  }
  .mobile-nav > a span { font-size: 1.08rem; }
  .mobile-nav > a.active { color: var(--accent-strong); }
  .mobile-create { position: relative; display: grid; place-items: center; }
  .mobile-create summary {
    display: grid;
    width: 50px;
    height: 50px;
    margin-top: -29px;
    place-items: center;
    border: 4px solid var(--bg);
    border-radius: 50%;
    background: var(--ink);
    box-shadow: 0 8px 20px rgba(20, 30, 22, .2);
    color: var(--surface-solid);
    font-size: 1.4rem;
    list-style: none;
  }
  .mobile-create > div {
    position: absolute;
    right: -74px;
    bottom: 66px;
    display: grid;
    width: 170px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-solid);
    box-shadow: var(--shadow-md);
  }
  .mobile-create > div a { padding: 10px; border-radius: 8px; color: var(--ink); font-size: .78rem; text-decoration: none; }
  .mobile-create > div a:hover { background: var(--accent-faint); }
  .mobile-more { position: relative; display: grid; place-items: center; }
  .mobile-more > summary {
    display: grid;
    gap: 2px;
    place-items: center;
    color: var(--muted);
    font-size: .61rem;
    font-weight: 620;
    list-style: none;
    cursor: pointer;
  }
  .mobile-more > summary::-webkit-details-marker { display: none; }
  .mobile-more > summary span { font-size: .9rem; letter-spacing: .05em; }
  .mobile-more > summary.active, .mobile-more[open] > summary { color: var(--accent-strong); }
  .mobile-more[open]::before {
    position: fixed;
    z-index: 54;
    inset: 0;
    background: rgba(8, 12, 9, .42);
    backdrop-filter: blur(3px);
    content: "";
    animation: sheet-fade .18s var(--ease);
  }
  .mobile-sheet {
    position: fixed;
    z-index: 55;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 9px 18px calc(24px + env(safe-area-inset-bottom));
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    background: var(--surface-solid);
    box-shadow: 0 -18px 55px rgba(10, 18, 12, .2);
    animation: sheet-up .22s var(--ease);
  }
  @keyframes sheet-up { from { opacity: 0; transform: translateY(24px); } }
  @keyframes sheet-fade { from { opacity: 0; } }
  .sheet-handle { width: 38px; height: 4px; margin: 0 auto 18px; border-radius: 999px; background: var(--line-strong); }
  .sheet-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
  .sheet-heading h3, .sheet-heading .eyebrow { margin: 0; }
  .sheet-heading h3 { font-size: 1rem; }
  .sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
  .sheet-grid a {
    display: grid;
    min-height: 82px;
    place-items: center;
    place-content: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg-elevated);
    color: var(--ink-soft);
    text-decoration: none;
  }
  .sheet-grid a span { display: grid; width: 30px; height: 30px; margin-bottom: 5px; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: .9rem; }
  .sheet-grid a strong { font-size: .65rem; }
  .sheet-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
  .sheet-footer a, .sheet-footer button { display: flex; width: 100%; min-height: 40px; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 11px; background: transparent; color: var(--muted); font-size: .68rem; font-weight: 620; text-decoration: none; }
  .auth-shell { display: block; padding: 0; }
  .auth-card { width: min(100%, 480px); min-height: 100vh; padding: 34px 24px; }
  .auth-visual { display: none; }
  .app-modal {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    margin: auto 0 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
  }
  .modal-shell { max-height: 92vh; }
  .modal-header { padding: 21px 19px 17px; }
  .modal-body > .settings-card, .modal-body > .delete-card { padding: 22px 19px calc(24px + env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) {
  .global-search { width: 100%; }
  .topbar { align-items: stretch; flex-direction: column; }
  .topbar > div:last-child { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; }
  .topbar > .primary-button { width: 100%; }
  .primary-button { padding-inline: 12px; }
  .hero-card { display: grid; }
  .progress-ring { justify-self: end; }
  .reflection-summary { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-actions { grid-template-columns: 1fr; }
  .callout-card { align-items: stretch; flex-direction: column; }
  .callout-card .primary-button { width: 100%; }
  .data-panel { align-items: stretch; flex-direction: column; }
  .data-panel .text-button { width: 100%; }
  .push-guidance { margin-left: 0; }
  .push-guidance .text-button { width: 100%; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .form-actions > * { width: 100%; }
  .agenda-row { align-items: flex-start; flex-wrap: wrap; }
  .agenda-row > .text-button { margin-left: 58px; }
  .metric-card { min-height: 112px; padding: 18px; }
  .milestone-row { grid-template-columns: auto minmax(0, 1fr); }
  .milestone-actions { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
