:root {
  --cream: #FAF5EF;
  --cream-deep: #F5E6D3;
  --warm-white: #FFFFFF;
  --border-cream: #EADBC8;
  --border-cream-soft: #E8DDD0;
  --text-dark: #5C3D2E;
  --text-mid: #8B6F4E;
  --text-light: #B8927A;
  --text-faint: #A89684;
  --text-ghost: #C8B5A1;
  --gold: #D4A574;
  --gold-deep: #B8895A;
  --gold-light: #F0E4D4;
  --us-bg: #FBF1E0;
  --us-border: #E8C896;
  --us-text: #7A5928;
  --us-text-light: #A88B5C;
  --success-bg: #DDE8D5;
  --success-text: #5A7242;
  --success-deep: #4D5C3F;
  --warn-bg: #F0D6D0;
  --warn-text: #8B4F3D;
  --info-bg: #F0E0D0;
  --pending-bg: #E8DDD0;

  --admin-bg: #2A2520;
  --admin-card: #3D342C;
  --admin-card-deep: #2F2823;
  --admin-card-warm: #4A3D2C;
  --admin-border: #4D4138;
  --admin-border-warm: #6B5638;
  --admin-text: #F5E6D3;
  --admin-text-mid: #B8A590;
  --admin-text-faint: #8B7560;
  --admin-flag-bg: #4A2A2A;
  --admin-flag-border: #6B3838;
  --admin-flag-text: #FFD9D9;
  --admin-flag-icon: #E89B9B;
  --admin-flag-card: #3D2828;
  --admin-flag-deep: #8B3A3A;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; }

.hidden { display: none !important; }

/* Lock screen */
.lock-screen {
  position: fixed;
  inset: 0;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.lock-content {
  text-align: center;
  padding: 2rem;
  max-width: 320px;
  width: 100%;
}
.lock-icon { font-size: 32px; color: var(--gold); margin-bottom: 12px; }
.lock-title { margin: 0 0 6px; font-size: 24px; color: var(--text-dark); font-weight: 500; }
.lock-tagline { margin: 0 0 2.5rem; font-size: 13px; color: var(--text-faint); font-style: italic; }
#password-input {
  width: 100%;
  background: var(--warm-white);
  border: 0.5px solid var(--border-cream);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 16px;
  text-align: center;
  color: var(--text-dark);
  margin-bottom: 12px;
  outline: none;
}
#password-input:focus { border-color: var(--gold); }
#unlock-btn {
  width: 100%;
  background: var(--gold);
  color: var(--warm-white);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
}
.lock-error {
  margin: 1rem 0 0;
  font-size: 12px;
  color: var(--warn-text);
  min-height: 16px;
}

/* View containers */
.view { min-height: 100vh; padding-bottom: calc(80px + env(safe-area-inset-bottom)); padding-top: env(safe-area-inset-top); }
.her-view { background: var(--cream); }
.admin-view { background: var(--admin-bg); color: var(--admin-text); padding-bottom: calc(60px + env(safe-area-inset-bottom)); }

/* Bottom nav (her view) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--warm-white);
  border-top: 0.5px solid var(--border-cream-soft);
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 6px 2px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  gap: 1px;
  z-index: 100;
}
.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 1px;
  min-height: 44px;
  border-radius: var(--radius-md);
  color: var(--text-light);
  font-size: 8px;
  transition: background 0.15s;
}
.nav-btn i { font-size: 16px; margin-bottom: 2px; }
.nav-btn.active { background: var(--cream-deep); color: var(--text-mid); font-weight: 500; }

/* Admin nav */
.admin-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--admin-card);
  border-top: 0.5px solid var(--admin-border);
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  padding: 8px 4px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
}
.admin-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 2px;
  min-height: 44px;
  border-radius: var(--radius-md);
  color: var(--text-light);
}
.admin-nav-btn i { font-size: 18px; }
.admin-nav-btn.active { background: var(--admin-card-warm); color: var(--gold); }

/* Page wrapper */
.page {
  padding: 1.5rem;
  max-width: 480px;
  margin: 0 auto;
}

/* Common card styles */
.card {
  background: var(--warm-white);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 0.5px solid var(--border-cream);
  margin-bottom: 8px;
}
.admin-card {
  background: var(--admin-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 0.5px solid var(--admin-border);
  margin-bottom: 8px;
}
.admin-card-deep {
  background: var(--admin-card-deep);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 0.5px solid var(--admin-border);
  margin-bottom: 8px;
}

.section-label {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.admin-section-label {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--admin-text-faint);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.page-title {
  margin: 0 0 1.25rem;
  font-size: 22px;
  color: var(--text-dark);
  font-weight: 500;
}
.admin-page-title {
  margin: 0 0 1.25rem;
  font-size: 22px;
  color: var(--admin-text);
  font-weight: 500;
}

/* Today header */
.today-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.today-header .day { font-size: 11px; color: var(--text-light); letter-spacing: 0.5px; text-transform: uppercase; margin: 0; }
.today-header .date { font-size: 22px; color: var(--text-dark); margin: 0; font-weight: 500; }

.toggle-pill {
  background: var(--warm-white);
  border: 0.5px solid var(--border-cream-soft);
  border-radius: 20px;
  padding: 3px;
  display: flex;
  gap: 2px;
}
.toggle-pill button {
  font-size: 11px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  color: var(--text-light);
}
.toggle-pill button.active { background: var(--gold); color: var(--warm-white); font-weight: 500; }

/* Anytime ritual cards */
.anytime-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1.25rem; }
.anytime-card {
  flex: 1;
  min-width: 140px;
  background: var(--warm-white);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 0.5px solid var(--border-cream);
  position: relative;
  cursor: pointer;
  transition: transform 0.15s;
}
.anytime-card:active { transform: scale(0.98); }
.anytime-card .badge {
  position: absolute;
  top: 8px;
  right: 10px;
  background: var(--gold);
  color: var(--warm-white);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
}
.anytime-card .name { margin: 0 0 2px; font-size: 13px; color: var(--text-dark); }
.anytime-card .desc { margin: 0; font-size: 10px; color: var(--text-faint); font-style: italic; }
.anytime-card.pulsing { animation: pulse 0.4s ease-out; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); box-shadow: 0 0 20px var(--gold); } 100% { transform: scale(1); } }

/* Calendar items */
.cal-item {
  background: var(--warm-white);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 6px;
  border: 0.5px solid var(--border-cream);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.cal-item.us { background: var(--us-bg); border-color: var(--us-border); }
.cal-item .checkbox {
  width: 18px; height: 18px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.cal-item .checkbox.us-checkbox { border-color: #C8923D; }
.cal-item .checkbox.checked { background: var(--gold); }
.cal-item .checkbox.checked.us-checkbox { background: #C8923D; }
.cal-item .checkbox i { font-size: 12px; color: var(--warm-white); display: none; }
.cal-item .checkbox.checked i { display: block; }
.cal-item .item-body { flex: 1; }
.cal-item .item-title { margin: 0; font-size: 13px; color: var(--text-dark); }
.cal-item .item-title.us-title { color: var(--us-text); font-weight: 500; }
.cal-item .item-title.done { text-decoration: line-through; opacity: 0.6; }
.cal-item .item-meta { margin: 0; font-size: 11px; color: var(--text-faint); }
.cal-item .item-meta.us-meta { color: var(--us-text-light); }
.cal-item .grip { color: var(--text-ghost); font-size: 12px; cursor: grab; }
.cal-item .note-icon { color: var(--text-light); font-size: 14px; }
.cal-item .item-time {
  flex-shrink: 0;
  width: 36px;
  text-align: center;
  font-size: 10px;
  color: var(--text-faint);
  line-height: 1.4;
  margin: 0;
}

/* Day timeline */
.day-timeline { margin-bottom: 1.25rem; }
.tl-hour {
  display: flex;
  align-items: flex-start;
  min-height: 52px;
  border-top: 0.5px solid var(--border-cream);
  padding: 6px 0;
}
.tl-hour.now { background: linear-gradient(to right, rgba(212,165,116,0.06), transparent); }
.tl-hour-label {
  width: 44px;
  flex-shrink: 0;
  font-size: 10px;
  color: var(--text-ghost);
  line-height: 1;
  padding-top: 3px;
}
.tl-hour.now .tl-hour-label { color: var(--gold); font-weight: 600; }
.tl-hour-content { flex: 1; min-width: 0; }
.tl-now-dot {
  display: inline-block;
  width: 5px; height: 5px;
  background: var(--gold);
  border-radius: 50%;
  margin-left: 2px;
  vertical-align: middle;
  margin-top: -1px;
}

/* Week strip */
.week-strip {
  background: var(--warm-white);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 1rem;
  border: 0.5px solid var(--border-cream);
}
.week-strip-inner {
  display: flex;
  align-items: center;
  gap: 6px;
}
.week-strip-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.week-strip-day {
  text-align: center;
  padding: 6px 2px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.week-strip-day.today { background: var(--gold); }
.week-strip-day .dow { margin: 0; font-size: 9px; color: var(--text-faint); }
.week-strip-day.today .dow { color: var(--warm-white); }
.week-strip-day .num { margin: 2px 0 0; font-size: 12px; color: var(--text-dark); }
.week-strip-day.today .num { color: var(--warm-white); font-weight: 500; }
.week-strip-day .dots { display: flex; justify-content: center; gap: 2px; margin-top: 4px; min-height: 4px; }
.week-strip-day .dot { width: 4px; height: 4px; background: var(--gold); border-radius: 50%; }
.week-strip-day.today .dot { background: var(--warm-white); }
.week-strip .nav-arrow { color: var(--text-light); font-size: 16px; cursor: pointer; padding: 12px 8px; }

/* Action buttons row */
.action-row { display: flex; gap: 8px; }
.btn-primary {
  flex: 1;
  background: var(--gold);
  color: var(--warm-white);
  padding: 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-secondary {
  flex: 1;
  background: var(--warm-white);
  border: 0.5px solid var(--text-light);
  color: var(--text-mid);
  padding: 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Week view (expanded days) */
.day-section { margin-bottom: 14px; }
.day-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.day-section-header .label { margin: 0; font-size: 12px; color: var(--text-dark); font-weight: 500; }
.day-section-header .label .num { color: var(--text-faint); font-weight: 400; margin-left: 4px; }
.day-section-header .label .today-tag { color: var(--gold); font-weight: 500; }
.day-section-empty { font-size: 11px; color: var(--text-ghost); font-style: italic; padding-left: 4px; }
.day-drop-target.drag-over { background: var(--cream-deep); border-radius: var(--radius-md); padding: 4px; }

/* Glossary cards */
.glossary-card {
  background: var(--warm-white);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 0.5px solid var(--border-cream);
}
.glossary-card .word { margin: 0 0 4px; font-size: 14px; color: var(--text-dark); font-weight: 500; }
.glossary-card .def { margin: 0; font-size: 12px; color: var(--text-mid); line-height: 1.6; }

/* Permissions */
.permission-card {
  background: var(--warm-white);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 0.5px solid var(--border-cream);
}
.permission-card .p-row {
  display: flex; justify-content: space-between; align-items: start;
  margin-bottom: 6px; gap: 8px;
}
.permission-card .p-text { margin: 0; font-size: 13px; color: var(--text-dark); flex: 1; }
.permission-card .p-meta {
  display: flex; justify-content: space-between; align-items: center;
}
.permission-card .p-time { margin: 0; font-size: 11px; color: var(--text-faint); }
.permission-card .p-edit-btn {
  color: var(--text-light); font-size: 11px;
  display: flex; align-items: center; gap: 4px;
}
.status-badge {
  font-size: 10px; padding: 3px 8px; border-radius: 10px;
  white-space: nowrap; font-weight: 500;
}
.status-submitted { background: var(--pending-bg); color: var(--text-mid); }
.status-considering { background: var(--us-bg); color: var(--text-mid); }
.status-discuss { background: var(--info-bg); color: var(--text-mid); }
.status-approved { background: var(--success-bg); color: var(--success-text); }
.status-declined { background: var(--warn-bg); color: var(--warn-text); }

/* Menu (rewards/responses) */
.menu-tabs { display: flex; gap: 8px; margin-bottom: 1.25rem; }
.menu-tab {
  flex: 1;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  text-align: center;
  font-size: 12px;
  background: var(--warm-white);
  border: 0.5px solid var(--border-cream);
  color: var(--text-light);
}
.menu-tab.active.shine { background: var(--success-bg); color: var(--success-text); border: none; font-weight: 500; }
.menu-tab.active.miss { background: var(--warn-bg); color: var(--warn-text); border: none; font-weight: 500; }

.menu-item-card {
  background: var(--warm-white);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 0.5px solid var(--border-cream);
}
.menu-item-row { display: flex; align-items: start; gap: 10px; }
.menu-item-icon {
  background: var(--pending-bg);
  width: 28px; height: 28px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.menu-item-icon i { font-size: 14px; color: var(--text-mid); }
.menu-item-name { margin: 0 0 2px; font-size: 13px; color: var(--text-dark); font-weight: 500; }
.menu-item-desc { margin: 0; font-size: 12px; color: var(--text-mid); line-height: 1.5; }

.coming-later {
  margin-top: 1rem;
  padding: 10px 12px;
  background: var(--warm-white);
  border-radius: var(--radius-md);
  border-left: 2px solid var(--gold);
}
.coming-later .label {
  margin: 0 0 4px; font-size: 11px; color: var(--text-light);
  letter-spacing: 0.5px; text-transform: uppercase;
}
.coming-later .text {
  margin: 0; font-size: 12px; color: var(--text-mid);
  line-height: 1.5; font-style: italic;
}

.share-wish-btn {
  width: 100%;
  margin-top: 1rem;
  background: transparent;
  border: 0.5px dashed var(--text-light);
  color: var(--text-mid);
  padding: 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* Commitments (her view) */
.commitment-card {
  background: var(--warm-white);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 0.5px solid var(--border-cream);
}
.commitment-row { display: flex; align-items: start; gap: 10px; margin-bottom: 12px; }
.commitment-icon {
  background: var(--pending-bg);
  width: 28px; height: 28px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.commitment-icon i { font-size: 14px; color: var(--text-mid); }
.commitment-text {
  margin: 0; font-size: 13px; color: var(--text-dark);
  line-height: 1.5;
}
.commitment-buttons { display: flex; gap: 8px; padding-left: 38px; }
.thumb-btn {
  background: var(--warm-white);
  border: 0.5px solid var(--border-cream);
  color: var(--text-light);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  display: flex; align-items: center; gap: 4px;
  transition: transform 0.15s;
}
.thumb-btn i { font-size: 13px; }
.thumb-btn.voted-up { animation: thumbVotedUp 6s ease-out forwards; }
.thumb-btn.voted-down { animation: thumbVotedDown 6s ease-out forwards; }
@keyframes thumbVotedUp {
  0%   { transform: scale(1.2);  background: var(--gold-light, #fdf0d5); color: var(--gold); border-color: var(--gold); }
  10%  { transform: scale(1.06); background: var(--gold-light, #fdf0d5); color: var(--gold); border-color: var(--gold); }
  65%  { transform: scale(1.06); background: var(--gold-light, #fdf0d5); color: var(--gold); border-color: var(--gold); }
  100% { transform: scale(1);    background: var(--warm-white); color: var(--text-light); border-color: var(--border-cream); }
}
@keyframes thumbVotedDown {
  0%   { transform: scale(1.2);  background: #ffeaea; color: #e05252; border-color: #e05252; }
  10%  { transform: scale(1.06); background: #ffeaea; color: #e05252; border-color: #e05252; }
  65%  { transform: scale(1.06); background: #ffeaea; color: #e05252; border-color: #e05252; }
  100% { transform: scale(1);    background: var(--warm-white); color: var(--text-light); border-color: var(--border-cream); }
}

/* Milestones path */
.path-container {
  position: relative;
  padding-left: 24px;
  margin-bottom: 1rem;
}
.path-line {
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border-cream-soft);
}
.path-stage {
  position: relative;
  margin-bottom: 14px;
}
.path-dot {
  position: absolute;
  left: -22px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--cream);
}
.path-stage.now .path-dot {
  width: 16px; height: 16px;
  left: -24px; top: 0;
  border: 3px solid var(--cream-deep);
  box-shadow: 0 0 0 1px var(--gold);
}
.path-stage.ahead .path-dot {
  background: var(--cream);
  border: 2px solid var(--border-cream-soft);
}
.path-stage .stage-label { margin: 0; font-size: 11px; color: var(--text-light); }
.path-stage.now .stage-label { font-weight: 500; }
.path-stage.ahead .stage-label { color: var(--text-ghost); }
.path-stage .stage-name { margin: 0; font-size: 13px; color: var(--text-dark); font-weight: 500; }
.path-stage.now .stage-name { font-size: 14px; }
.path-stage.ahead .stage-name { color: var(--text-faint); font-weight: 400; }
.path-stage .stage-desc {
  margin: 4px 0 0; font-size: 12px; color: var(--text-mid);
  font-style: italic; line-height: 1.5;
}

.hint-card {
  background: var(--warm-white);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 1.5rem;
  border: 0.5px solid var(--us-border);
  border-left: 2px solid var(--gold);
}
.hint-row { display: flex; align-items: start; gap: 8px; }
.hint-row > i { font-size: 14px; color: var(--text-light); margin-top: 2px; }
.hint-card .hint-label {
  margin: 0 0 4px; font-size: 11px; color: var(--text-light);
  letter-spacing: 0.5px; text-transform: uppercase;
}
.hint-card .hint-text {
  margin: 0; font-size: 12px; color: var(--text-dark); line-height: 1.6;
}

/* Achievements */
.achievement-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.achievement-card {
  background: var(--warm-white);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 0.5px solid var(--border-cream);
  text-align: center;
}
.achievement-card.locked { opacity: 0.5; }
.achievement-card.unlocking { animation: unlockPulse 1.5s ease-out; }
@keyframes unlockPulse {
  0% { transform: scale(0.9); box-shadow: 0 0 0 transparent; }
  50% { transform: scale(1.05); box-shadow: 0 0 30px var(--gold); }
  100% { transform: scale(1); box-shadow: 0 0 0 transparent; }
}
.achievement-card i { font-size: 24px; color: var(--gold); margin-bottom: 4px; display: block; }
.achievement-card.locked i { color: var(--text-ghost); }
.achievement-card .name { margin: 0; font-size: 12px; color: var(--text-dark); font-weight: 500; }
.achievement-card.locked .name { color: var(--text-faint); }
.achievement-card .meta { margin: 0; font-size: 10px; color: var(--text-faint); }
.achievement-card.locked .meta { color: var(--text-ghost); }

/* Modals */
.modal-container {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal {
  background: var(--cream);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 0.5px solid var(--border-cream-soft);
}
.modal.dark {
  background: var(--admin-bg);
  border-color: var(--admin-border);
  color: var(--admin-text);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.modal-title { margin: 0; font-size: 18px; color: var(--text-dark); }
.modal.dark .modal-title { color: var(--admin-text); }
.modal-close { font-size: 20px; color: var(--text-light); padding: 8px; cursor: pointer; }
.modal-input, .modal-textarea {
  width: 100%;
  background: var(--warm-white);
  border: 0.5px solid var(--border-cream);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 16px;
  color: var(--text-dark);
  margin-bottom: 14px;
  outline: none;
}
.modal.dark .modal-input, .modal.dark .modal-textarea {
  background: var(--admin-card-deep);
  border-color: var(--admin-border);
  color: var(--admin-text);
}
.modal-textarea { min-height: 100px; resize: vertical; font-family: inherit; }
.modal-input:focus, .modal-textarea:focus { border-color: var(--gold); }
.modal-button {
  width: 100%;
  background: var(--gold);
  color: var(--warm-white);
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
}
.modal-button.secondary {
  background: transparent;
  border: 0.5px solid var(--border-cream);
  color: var(--text-mid);
}
.modal-button.danger {
  background: var(--admin-flag-deep);
  color: var(--admin-flag-text);
}
.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}
.type-option {
  background: var(--warm-white);
  padding: 10px;
  border-radius: var(--radius-md);
  text-align: center;
  border: 0.5px solid var(--border-cream);
  font-size: 12px;
  color: var(--text-mid);
  cursor: pointer;
}
.type-option.selected { background: var(--gold); color: var(--warm-white); border-color: var(--gold); font-weight: 500; }

/* Toast */
.toast-container {
  position: fixed;
  bottom: calc(100px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  pointer-events: none;
}
.toast {
  background: var(--text-dark);
  color: var(--warm-white);
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13px;
  margin-bottom: 6px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Floating counter */
.floating-counter {
  position: fixed;
  right: 16px;
  bottom: calc(90px + env(safe-area-inset-bottom));
  background: var(--gold);
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 90;
}
.floating-counter i { font-size: 20px; color: var(--warm-white); }
.counter-menu {
  position: fixed;
  right: 16px;
  bottom: calc(160px + env(safe-area-inset-bottom));
  background: var(--admin-card);
  border: 0.5px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 8px;
  z-index: 91;
  min-width: 180px;
  max-height: calc(100vh - 200px - env(safe-area-inset-bottom));
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.counter-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--admin-text);
  border-radius: var(--radius-sm);
}
.counter-menu-item:hover, .counter-menu-item:active { background: var(--admin-card-deep); }
.counter-menu-item .count {
  float: right;
  font-size: 11px;
  color: var(--admin-text-faint);
}

/* Admin specific */
.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1.25rem;
}
.admin-page-header .day-tag {
  background: var(--admin-card-warm);
  color: var(--gold);
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 10px;
  font-weight: 500;
}

.flagged-card {
  background: var(--admin-flag-bg);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
  border: 0.5px solid var(--admin-flag-border);
  border-left: 2px solid var(--admin-flag-icon);
}
.flagged-card .flag-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.flagged-card .flag-header i { font-size: 16px; color: var(--admin-flag-icon); }
.flagged-card .flag-header p {
  margin: 0; font-size: 12px; color: var(--admin-flag-text);
  font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase;
}
.flag-item {
  background: var(--admin-flag-card);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.flag-item:last-child { margin-bottom: 0; }
.flag-item p { margin: 0; font-size: 12px; color: var(--admin-text); flex: 1; }
.flag-item i { font-size: 13px; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.stat-card {
  background: var(--admin-card);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 0.5px solid var(--admin-border);
}
.stat-card .label {
  margin: 0 0 4px; font-size: 10px; color: var(--admin-text-faint);
  letter-spacing: 0.5px; text-transform: uppercase;
}
.stat-card .value {
  margin: 0; font-size: 22px; color: var(--admin-text); font-weight: 500;
}
.stat-card .value.small { font-size: 14px; }
.stat-card .sub { margin: 0; font-size: 10px; color: var(--admin-text-mid); }

.live-mirror {
  background: var(--admin-card);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
  border: 0.5px solid var(--admin-border);
}
.live-mirror .lm-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.live-mirror .lm-header span {
  background: var(--admin-card-deep);
  color: var(--admin-text-mid);
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 8px;
}
.live-mirror .preview {
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 0.5px solid var(--border-cream-soft);
}

.toggle-switch {
  width: 32px; height: 18px;
  background: var(--admin-border);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
.toggle-switch.on { background: var(--gold); }
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  width: 14px; height: 14px;
  background: var(--admin-text-faint);
  border-radius: 50%;
  transition: all 0.2s;
  left: 2px;
}
.toggle-switch.on::after { left: auto; right: 2px; background: var(--warm-white); }

.admin-add-btn {
  width: 100%;
  background: transparent;
  border: 0.5px dashed var(--text-light);
  color: var(--gold);
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

.admin-section-divider {
  margin: 1.5rem 0 0.75rem;
  font-size: 11px; color: var(--admin-text-faint);
  letter-spacing: 0.5px; text-transform: uppercase;
}

/* Insights */
.insights-card {
  background: var(--admin-card);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
  border: 0.5px solid var(--admin-border);
  border-left: 2px solid var(--gold);
}
.insights-card p {
  margin: 0 0 6px; font-size: 11px;
  color: var(--admin-text-mid); line-height: 1.5;
}
.insights-card p:last-child { margin-bottom: 0; }

/* Activity feed */
.activity-row {
  display: flex; gap: 10px;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--admin-border);
}
.activity-row:last-child { border-bottom: none; }
.activity-row > i { font-size: 13px; margin-top: 2px; }
.activity-row .activity-text { flex: 1; }
.activity-row .activity-text p { margin: 0; }
.activity-row .activity-text p:first-child { font-size: 12px; color: var(--admin-text); }
.activity-row .activity-text p:last-child { font-size: 10px; color: var(--admin-text-faint); }

/* Settings danger zone */
.danger-zone {
  background: var(--admin-flag-bg);
  border: 0.5px solid var(--admin-flag-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1.5rem;
}
.danger-zone h3 {
  margin: 0 0 12px; font-size: 14px;
  color: var(--admin-flag-text);
}

/* ── Lists ────────────────────────────────── */
.lists-picker {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 20px;
  scrollbar-width: none;
}
.lists-picker::-webkit-scrollbar { display: none; }

.list-pill {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 0.5px solid var(--border-cream);
  background: var(--warm-white);
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.list-pill.active {
  background: var(--cream-deep);
  color: var(--text-mid);
  border-color: var(--border-cream-soft);
}
.list-pill.list-add-pill {
  background: transparent;
  border-style: dashed;
  color: var(--text-faint);
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.list-header .page-title { margin: 0; }
.list-delete-btn {
  background: transparent;
  border: none;
  font-size: 11px;
  color: var(--text-faint);
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border-cream-soft);
}
.list-item.checked .list-item-text {
  text-decoration: line-through;
  color: var(--text-faint);
}
.list-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-cream);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.list-check.checked {
  background: var(--gold);
  border-color: var(--gold);
  color: white;
}
.list-check i { font-size: 11px; }
.list-item-text {
  flex: 1;
  margin: 0;
  font-size: 14px;
  color: var(--text-dark);
  line-height: 1.4;
}
.list-item-del {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  font-family: inherit;
  opacity: 0;
  transition: opacity 0.15s;
}
.list-item:hover .list-item-del,
.list-item:active .list-item-del { opacity: 1; }

.list-done-divider {
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 16px 0 4px;
}

.list-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 10px 0;
}
.list-add-input {
  flex: 1;
  border: none;
  border-bottom: 1px solid var(--border-cream);
  background: transparent;
  font-size: 16px;
  color: var(--text-dark);
  font-family: inherit;
  padding: 4px 0;
  outline: none;
}
.list-add-input::placeholder { color: var(--text-faint); }
.list-add-submit {
  background: transparent;
  border: none;
  color: var(--gold);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}

/* Admin overrides */
#admin-view .list-pill {
  background: var(--admin-card);
  border-color: var(--admin-border);
  color: var(--admin-text-mid);
}
#admin-view .list-pill.active {
  background: var(--admin-card-warm);
  color: var(--gold);
  border-color: var(--gold);
}
#admin-view .list-pill.list-add-pill {
  background: transparent;
  color: var(--admin-text-faint);
}
#admin-view .list-delete-btn { color: var(--admin-text-faint); }
#admin-view .list-item { border-bottom-color: var(--admin-border); }
#admin-view .list-item-text { color: var(--admin-text); }
#admin-view .list-item.checked .list-item-text { color: var(--admin-text-faint); }
#admin-view .list-check { border-color: var(--admin-border); }
#admin-view .list-item-del { color: var(--admin-text-faint); }
#admin-view .list-done-divider { color: var(--admin-text-faint); }
#admin-view .list-add-input {
  border-bottom-color: var(--admin-border);
  color: var(--admin-text);
}
#admin-view .list-header .page-title { color: var(--admin-text); }
.danger-zone p {
  font-size: 11px; color: var(--admin-text-mid); line-height: 1.5;
}
.danger-btn {
  background: var(--admin-flag-deep);
  color: var(--admin-flag-text);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  margin-top: 8px;
}

/* iOS: show delete button on touch devices (no hover state) */
@media (hover: none) {
  .list-item-del { opacity: 0.5; }
}

/* iOS: prevent zoom on select elements (font-size must be ≥16px) */
select.modal-input { font-size: 16px; }

/* Helpers */
.row-flex { display: flex; align-items: center; gap: 8px; }
.row-flex.between { justify-content: space-between; }
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }

/* Icon picker */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  background: var(--admin-card-deep);
  border-radius: var(--radius-md);
  border: 0.5px solid var(--admin-border);
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
  margin-bottom: 14px;
}
.icon-grid-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--admin-text-mid);
  font-size: 18px;
}
.icon-grid-item:active, .icon-grid-item.selected {
  background: var(--admin-card-warm);
  color: var(--gold);
}