:root {
  color-scheme: light;
  --bg-primary: #ede6db;
  --bg-secondary: #e2d9cb;
  --bg-card: #ffffff;
  --bg-card-subtle: rgba(255, 255, 255, 0.7);
  --bg-card-hover: #ffffff;
  --text-primary: #342a38;
  --text-secondary: #6f665e;
  --text-muted: #928a81;
  --accent-clay: #b86747;
  --accent-clay-dark: #88432f;
  --accent-olive: #5a664e;
  --accent-olive-tint: rgba(90, 102, 78, 0.12);
  --accent-clay-tint: rgba(184, 103, 71, 0.12);
  --line: rgba(52, 42, 56, 0.13);
  --line-strong: rgba(52, 42, 56, 0.24);
  --shadow-subtle: 0 1px 3px rgba(52, 42, 56, 0.05);
  --shadow-card: 0 2px 8px rgba(52, 42, 56, 0.07);
  --shadow-float: 0 8px 24px rgba(52, 42, 56, 0.1);
  --radius-card: 11px;
  --radius-button: 12px;
  --radius-pill: 999px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--bg-primary);
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(184, 103, 71, 0.07) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 10%, rgba(90, 102, 78, 0.05) 0%, transparent 40%),
    var(--bg-primary);
}

button, a { -webkit-tap-highlight-color: transparent; }

button { font: inherit; }

button:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent-clay);
  outline-offset: 3px;
}

.app-shell {
  display: flex;
  flex-direction: column;
  width: min(100%, 720px);
  min-height: 100svh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 18px env(safe-area-inset-bottom);
}

.topbar {
  display: flex;
  align-items: center;
  min-height: 68px;
}

.wordmark {
  color: var(--text-primary);
  font-size: 1.18rem;
  font-weight: 750;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.wordmark__accent { color: var(--accent-clay); }

.lucide-icon { display: block; width: 1em; height: 1em; }
.icon-slot { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; }

.main-content {
  flex: 1;
  width: 100%;
  padding: clamp(14px, 4vw, 28px) 0 120px;
}

.screen { outline: none; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-olive);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  max-width: 18ch;
  margin-bottom: 10px;
  color: var(--text-primary);
  font-size: clamp(2.3rem, 8.5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.screen--today {
  margin-top: clamp(-24px, -3vw, -12px);
}

.screen--today h1 {
  max-width: 14ch;
  margin-bottom: 10px;
  font-size: clamp(2.3rem, 9.5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.screen-intro {
  max-width: 38ch;
  margin-bottom: 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.screen--today .screen-intro {
  margin-bottom: 18px;
  font-size: 0.92rem;
}

.today-shell {
  min-height: 0;
  margin-bottom: 14px;
}

.empty-state { display: grid; gap: 8px; place-items: start; }
.empty-state--compact { margin-top: 14px; }

.screen--today .empty-state {
  gap: 6px;
  padding: 18px 0 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.empty-state__seal {
  display: grid;
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
  place-items: center;
  border: 1.5px solid var(--accent-olive);
  border-radius: 50%;
  color: var(--accent-olive);
  background: #ffffff;
}

.empty-state__title {
  margin-bottom: 0;
  color: var(--text-primary);
  font-size: 1.02rem;
  font-weight: 720;
  letter-spacing: -0.015em;
}

.empty-state__copy {
  max-width: 36ch;
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.empty-state__action {
  min-height: 44px;
  margin-top: 10px;
  padding: 10px 18px;
  border: 0;
  border-radius: var(--radius-button);
  background: var(--text-primary);
  color: #ffffff;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 750;
  box-shadow: var(--shadow-card);
}

.empty-state__action:hover, .empty-state__action:focus-visible {
  background: var(--accent-clay-dark);
}

/* Reassurance Status (Quiet & Compact) */
.reassurance {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 4px 2px;
  border-top: 1px solid var(--line);
  color: var(--text-secondary);
}

.reassurance__symbol {
  display: grid;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1.5px solid var(--accent-olive);
  border-radius: 50%;
  color: var(--accent-olive);
  background: transparent;
}

.reassurance__symbol .lucide-icon { width: 11px; height: 11px; }

.reassurance__title {
  margin-bottom: 1px;
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 750;
}

.reassurance__copy {
  max-width: 38ch;
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.35;
}

/* Checklist Header */
.checklist-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 6px;
}

.checklist-header__label,
.completed-section__label {
  margin: 0;
  color: var(--accent-olive);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.checklist-header__count {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  text-align: right;
}

.checklist-list,
.completed-list { display: grid; }

.checklist-list {
  gap: 8px;
}

/* Check Row (Clean Crisp Surface over Warm Background) */
.check-row {
  display: flex;
  min-height: 66px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  box-shadow: var(--shadow-subtle);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  overflow: hidden;
}

.check-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
}

.check-row__main {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 64px;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.check-row__main:active { color: var(--accent-clay-dark); }

.check-row__indicator {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--accent-olive);
  transition: transform 0.15s ease, color 0.15s ease;
}

.check-row__indicator .lucide-icon { width: 22px; height: 22px; }

.check-row__main:hover .check-row__indicator {
  transform: scale(1.08);
  color: var(--accent-clay);
}

.check-row__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1.04rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.check-row--one-off {
  border-left: 3.5px solid var(--accent-clay);
  background: #fffdfa;
}

.check-row--one-off .check-row__title {
  color: var(--accent-clay-dark);
}

.check-row__tag, .checked-row__tag {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-clay-tint);
  color: var(--accent-clay-dark);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Keep the deliberate Later action available without adding a clock glyph or a
   default Not yet label to every untouched row. */
.check-row .check-row__later {
  display: grid;
  width: 58px;
  min-height: 64px;
  place-items: center;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.check-row .check-row__later:hover, .check-row .check-row__later:focus-visible { color: var(--accent-clay-dark); }

/* Show Back action only when item is deliberately in Not Yet state */
.check-row--not-yet {
  background: rgba(184, 103, 71, 0.08);
  border-color: rgba(184, 103, 71, 0.32);
}

.check-row--not-yet .check-row__title {
  color: var(--text-secondary);
}

.check-row--not-yet .check-row__later {
  display: grid;
  width: 58px;
  min-height: 64px;
  place-items: center;
  border: 0;
  border-left: 1px solid rgba(184, 103, 71, 0.2);
  background: transparent;
  color: var(--accent-clay-dark);
  cursor: pointer;
}

.check-row__state {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(184, 103, 71, 0.15);
  color: var(--accent-clay-dark);
  font-size: 0.68rem;
  font-weight: 750;
  white-space: nowrap;
}

.check-row__later-label {
  font-size: 0.72rem;
  font-weight: 750;
}

/* Completed Items Drawer (Compact & Recoverable) */
.completed-section {
  margin-top: 16px;
  padding: 2px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-card-subtle);
}

.completed-section__label {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  list-style: none;
}

.completed-section__label::-webkit-details-marker { display: none; }
.completed-section__label::after { content: '+'; color: var(--accent-olive); font-size: 1rem; font-weight: 400; }
.completed-section[open] .completed-section__label::after { content: '−'; }

.completed-list { padding-bottom: 4px; }

.checked-row {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  padding: 8px 6px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}

.checked-row:first-child { border-top: 0; }

.checked-row:hover, .checked-row:focus-visible {
  color: var(--text-primary);
  background: rgba(90, 102, 78, 0.06);
}

.checked-row .check-row__indicator { color: var(--accent-olive); }

.checked-row__title {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.96rem;
  font-weight: 500;
  color: #5a505e;
  text-decoration: line-through;
  text-decoration-color: rgba(90, 102, 78, 0.45);
}

/* All Clear State */
.all-clear {
  display: grid;
  gap: 3px;
  margin-top: 18px;
  padding: 20px 18px;
  border: 1px solid rgba(90, 102, 78, 0.25);
  border-radius: var(--radius-card);
  background: rgba(90, 102, 78, 0.07);
  text-align: center;
  place-items: center;
}

.all-clear__seal {
  display: grid;
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
  place-items: center;
  border: 2px solid var(--accent-olive);
  border-radius: 50%;
  color: var(--accent-olive);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(90, 102, 78, 0.15);
}

.all-clear__seal .lucide-icon { width: 18px; height: 18px; }

.all-clear__title {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 780;
  letter-spacing: -0.03em;
}

.all-clear__copy {
  margin: 0;
  color: var(--accent-olive);
  font-size: 0.92rem;
  font-weight: 600;
}

/* Undo Bar */
.undo-bar {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 8px 0 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.undo-bar__message { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.undo-bar__button {
  padding: 8px 0 8px 10px;
  border: 0;
  background: transparent;
  color: var(--accent-clay-dark);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 750;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Forms & Inputs (Clean White Surfaces + Polished Ergonomics) */
.capture-form,
.important-form {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.capture-form { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }

.capture-form input,
.important-form input,
.important-form select,
.recurring-form input,
.recurring-form select {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-button);
  outline: none;
  background: #ffffff;
  color: var(--text-primary);
  font-size: 0.98rem;
  box-shadow: var(--shadow-subtle);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.capture-form input:focus,
.important-form input:focus,
.important-form select:focus,
.recurring-form input:focus,
.recurring-form select:focus {
  border-color: var(--accent-clay);
  box-shadow: 0 0 0 3px rgba(184, 103, 71, 0.16);
}

.capture-form input::placeholder,
.important-form input::placeholder,
.recurring-form input::placeholder {
  color: #928a81;
}

.form-submit,
.form-cancel {
  min-height: 52px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 750;
  transition: background 0.12s ease, transform 0.1s ease, box-shadow 0.12s ease;
}

.form-submit {
  background: var(--text-primary);
  color: #fdfbf7;
  letter-spacing: -0.01em;
  box-shadow: 0 3px 12px rgba(52, 42, 56, 0.15);
}

.form-submit:hover {
  background: var(--accent-clay-dark);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(52, 42, 56, 0.2);
}

.form-submit:active { transform: translateY(0); }

.form-cancel {
  min-height: 50px;
  border-color: var(--line);
  background: transparent;
  color: var(--text-secondary);
}

.form-cancel:hover {
  background: rgba(52, 42, 56, 0.05);
}

.form-field { display: grid; gap: 7px; }
.form-field label { color: var(--text-secondary); font-size: 0.74rem; font-weight: 750; }
.form-field label span { font-weight: 400; }
.form-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; }

/* Settings / Recurring */
.settings-section { margin-top: 28px; }
.settings-section--packs { margin-top: 36px; }
.settings-section__heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.settings-section h2 { margin: 0; color: var(--text-primary); font-size: 1.35rem; font-weight: 780; letter-spacing: -0.035em; }
.eyebrow--small { margin-bottom: 6px; font-size: 0.64rem; }
.settings-section__note { color: var(--text-muted); font-size: 0.68rem; text-align: right; }
.section-copy { max-width: 40ch; margin: -3px 0 16px; color: var(--text-secondary); font-size: 0.86rem; line-height: 1.5; }

.recurring-form { display: grid; gap: 12px; margin-bottom: 22px; }
.specific-days { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-button); background: #ffffff; }
.specific-days legend { padding: 0 5px; color: var(--text-secondary); font-size: 0.74rem; font-weight: 750; }
.weekday-options { display: flex; flex-wrap: wrap; gap: 8px; }
.weekday-options label { display: inline-flex; min-height: 36px; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--text-secondary); cursor: pointer; font-size: 0.74rem; font-weight: 600; }
.weekday-options input { accent-color: var(--accent-olive); }

.recurring-list { display: grid; }
.recurring-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 68px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  box-shadow: var(--shadow-subtle);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.recurring-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--line-strong);
}

.recurring-row__content { min-width: 0; }
.recurring-row__title { margin: 0 0 3px; overflow: hidden; color: var(--text-primary); font-size: 0.98rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.recurring-row__meta { margin: 0; color: var(--text-secondary); font-size: 0.7rem; }
.recurring-row__actions { display: flex; }
.recurring-row--disabled .recurring-row__title { color: var(--text-muted); text-decoration: line-through; }
.recurring-row--disabled .recurring-row__meta { color: var(--accent-clay-dark); }

/* Packs */
.pack-list { display: grid; }
.pack-category { margin: 16px 0 8px; color: var(--accent-olive); font-size: 0.68rem; font-weight: 750; letter-spacing: 0.11em; text-transform: uppercase; }
.pack-category:first-child { margin-top: 0; }

.pack-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 74px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  box-shadow: var(--shadow-subtle);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.pack-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--line-strong);
}

.pack-row__content, .pack-row__preview { min-width: 0; }
.pack-row__preview { padding: 4px 0; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; text-align: left; }
.pack-row__preview:hover, .pack-row__preview:focus-visible { color: var(--accent-clay-dark); }
.pack-row__preview:disabled { color: inherit; cursor: default; }
.pack-row__title { margin: 0 0 3px; color: var(--text-primary); font-size: 0.98rem; font-weight: 750; }
.pack-row__description { max-width: 44ch; margin: 0 0 5px; color: var(--text-secondary); font-size: 0.78rem; line-height: 1.35; }
.pack-row__meta { margin: 0; color: var(--accent-olive); font-size: 0.68rem; font-weight: 600; }
.pack-row__action {
  min-width: 76px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1.5px solid var(--text-primary);
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
  transition: background 0.12s ease, color 0.12s ease;
}

.pack-row__action:hover, .pack-row__action:focus-visible { background: var(--text-primary); color: #fdfbf7; }
.pack-row__action--added, .pack-row__action--added:hover { border-color: var(--line); background: transparent; color: var(--text-muted); cursor: default; }

/* Pack Bottom Sheet */
.pack-sheet-open { overflow: hidden; }
.pack-sheet-backdrop {
  position: fixed;
  z-index: 5;
  inset: 0;
  display: flex;
  align-items: end;
  justify-content: center;
  background: rgba(36, 30, 38, 0.4);
  backdrop-filter: blur(4px);
}

.pack-sheet {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(100%, 720px);
  max-height: min(88svh, 680px);
  padding: 20px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-strong);
  border-radius: 20px 20px 0 0;
  background: var(--bg-primary);
  box-shadow: 0 -18px 46px rgba(36, 30, 38, 0.2);
}

.pack-sheet__heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding-bottom: 15px; }
.pack-sheet__heading-copy { min-width: 0; }
.pack-sheet__title { margin: 0 0 5px; color: var(--text-primary); font-size: 1.5rem; font-weight: 780; letter-spacing: -0.045em; line-height: 1; }
.pack-sheet__description { max-width: 40ch; margin: 0; color: var(--text-secondary); font-size: 0.84rem; line-height: 1.45; }
.pack-sheet__close { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #ffffff; color: var(--text-primary); cursor: pointer; }
.pack-sheet__close .lucide-icon { width: 18px; height: 18px; }
.pack-sheet__items { overflow: auto; padding: 4px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pack-sheet__item { display: flex; min-height: 50px; align-items: center; gap: 12px; padding: 0 6px; border-bottom: 1px solid rgba(52, 42, 56, 0.08); color: var(--text-primary); cursor: pointer; font-size: 0.92rem; font-weight: 550; }
.pack-sheet__item:last-child { border-bottom: 0; }
.pack-sheet__item input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent-olive); }
.pack-sheet__item-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pack-sheet__footer { padding-top: 14px; }
.pack-sheet__footer .form-submit { width: 100%; }

/* Contextual Lifetime prompt */
.upgrade-sheet-open { overflow: hidden; }
.upgrade-sheet-backdrop {
  position: fixed;
  z-index: 6;
  inset: 0;
  display: flex;
  align-items: end;
  justify-content: center;
  padding-top: 24px;
  background: rgba(36, 30, 38, 0.38);
  backdrop-filter: blur(4px);
}
.upgrade-sheet {
  width: min(100%, 720px);
  padding: 22px 18px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-strong);
  border-radius: 20px 20px 0 0;
  background: var(--bg-primary);
  box-shadow: 0 -18px 46px rgba(36, 30, 38, 0.2);
}
.upgrade-sheet__heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.upgrade-sheet__title { margin: 0; color: var(--text-primary); font-size: 1.45rem; font-weight: 780; letter-spacing: -0.04em; line-height: 1.05; }
.upgrade-sheet__close { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--text-primary); cursor: pointer; }
.upgrade-sheet__close .lucide-icon { width: 18px; height: 18px; }
.upgrade-sheet__reason { margin: 18px 0 5px; color: var(--text-primary); font-size: 0.9rem; font-weight: 650; line-height: 1.4; }
.upgrade-sheet__copy { max-width: 42ch; margin: 0; color: var(--text-secondary); font-size: 0.86rem; line-height: 1.5; }
.upgrade-sheet__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.upgrade-sheet__actions .form-submit, .upgrade-sheet__actions .form-cancel { flex: 1 1 180px; }
.upgrade-sheet__note { flex: 1 1 100%; margin: 0; color: var(--text-muted); font-size: 0.72rem; }

.settings-section--access { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); }

/* Tomorrow & Important Lists */
.tomorrow-list,
.important-list { display: grid; }

.light-empty-state {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.tomorrow-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: 58px;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  margin-bottom: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  box-shadow: var(--shadow-subtle);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.tomorrow-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--line-strong);
}

.tomorrow-row__title { min-width: 0; overflow: hidden; color: var(--text-primary); font-size: 1rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.quiet-action { min-height: 44px; padding: 8px 8px; border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 0.72rem; font-weight: 750; }
.quiet-action:hover, .quiet-action:focus-visible { color: var(--accent-clay-dark); }
.quiet-action--delete { color: #9a6653; }

.important-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: 72px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  box-shadow: var(--shadow-subtle);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.important-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--line-strong);
}

.important-row__content { min-width: 0; }
.important-row__title { margin: 0 0 3px; overflow: hidden; color: var(--text-primary); font-size: 0.98rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.important-row__meta { margin: 0; overflow: hidden; color: var(--text-secondary); font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }
.important-row__status { color: var(--accent-olive); font-size: 0.7rem; font-weight: 750; text-align: right; white-space: nowrap; }
.important-row__actions { display: flex; }

.important-row--healthy .important-row__status { color: var(--accent-olive); }
.important-row--approaching { border-left: 3.5px solid var(--accent-clay); }
.important-row--approaching .important-row__status { color: var(--accent-clay); font-weight: 750; }
.important-row--urgent,
.important-row--expired { border-left: 3.5px solid var(--accent-clay-dark); background: rgba(184, 103, 71, 0.07); }
.important-row--expired .important-row__title { color: var(--accent-clay-dark); }

@media (max-width: 380px) {
  .capture-form { grid-template-columns: minmax(0, 1fr) auto; }
  .capture-form .form-cancel { grid-column: 2; }
  .form-field-row { grid-template-columns: 1fr; }
  .important-row { grid-template-columns: minmax(0, 1fr) auto; }
  .important-row__actions { grid-column: 1 / -1; justify-content: flex-end; }
  .important-row__status { align-self: end; }
  .settings-section__heading { align-items: start; flex-direction: column; gap: 5px; }
  .settings-section__note { text-align: left; }
  .pack-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .pack-row__action { max-width: 86px; padding-right: 8px; padding-left: 8px; font-size: 0.68rem; }
}

/* Bottom Navigation (Refined Anchored Dock) */
.bottom-nav {
  position: fixed;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(237, 230, 219, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-item {
  display: grid;
  min-height: 54px;
  place-items: center;
  gap: 3px;
  padding: 6px 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 650;
  transition: background 0.12s ease, color 0.12s ease;
}

.nav-item__icon { color: currentColor; font-size: 1.2rem; font-weight: 400; line-height: 1; }
.nav-item--active { background: var(--accent-olive-tint); color: var(--text-primary); font-weight: 750; }

.toast {
  position: fixed;
  z-index: 4;
  right: 18px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  left: 18px;
  width: min(420px, calc(100% - 36px));
  margin: auto;
  padding: 13px 16px;
  border-radius: var(--radius-button);
  background: var(--text-primary);
  color: #ffffff;
  box-shadow: 0 12px 32px rgba(36, 30, 38, 0.25);
  font-size: 0.86rem;
  line-height: 1.4;
}

@media (min-width: 700px) {
  .app-shell { padding-right: 32px; padding-left: 32px; }
  .bottom-nav {
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-radius: 20px 20px 0 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .screen { animation: arrive 160ms ease-out; }
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Local backup controls and release-safe feedback. */
.data-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.data-actions > button { flex: 1 1 150px; }
.data-action--reset { color: var(--accent-clay-dark); }
.data-status { min-height: 1.25em; margin: 12px 0 0; color: var(--accent-olive); font-size: 0.78rem; line-height: 1.4; }
.data-status[data-state="error"] { color: var(--accent-clay-dark); }

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