:root {
  --bg: #faf7f2;
  --bg-subtle: #f3eee5;
  --surface: #ffffff;
  --surface-hover: #fcfaf6;
  --border: #e5ddd0;
  --border-strong: #d3c8b7;
  --text: #1e2420;
  --text-muted: #5d6560;
  --text-soft: #7b837d;

  --primary: #2b6b5b;
  --primary-hover: #215649;
  --primary-soft: #e6f2ee;
  --primary-border: #c1ded6;

  --danger: #b83b32;
  --danger-soft: #fdeceb;
  --warning: #a35e08;
  --warning-soft: #fef4df;
  --ice: #1d5d82;
  --ice-soft: #e6f3fa;
  --success: #246a49;
  --success-soft: #e5f5ec;

  /* Family & Extended Family Tag Tokens */
  --tag-dan-bg: #e3f1f5;
  --tag-dan-fg: #185666;
  --tag-emma-bg: #fbece7;
  --tag-emma-fg: #a93e1e;
  --tag-lydia-bg: #fef2dc;
  --tag-lydia-fg: #8c4f04;
  --tag-david-bg: #f6e9f2;
  --tag-david-fg: #703460;
  --tag-all-bg: #e6f2ee;
  --tag-all-fg: #245b4d;
  --tag-powell-bg: #eef2df;
  --tag-powell-fg: #4b581d;
  --tag-mills-bg: #e8eef8;
  --tag-mills-fg: #314878;
  --tag-sian-bg: #f9eaf0;
  --tag-sian-fg: #8f304e;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(30, 36, 32, 0.05);
  --shadow-sm: 0 2px 8px rgba(30, 36, 32, 0.06);
  --shadow-md: 0 10px 28px rgba(30, 36, 32, 0.12);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1, h2, h3, h4, p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* ===== Shell & Header ===== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 42;
  background: #faf7f2;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.brand-text {
  min-width: 0;
}

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  position: relative;
  flex-shrink: 0;
}

/* ===== Primary Navigation ===== */
.primary-nav {
  position: sticky;
  top: 61px;
  z-index: 38;
  background: rgba(250, 247, 242, 0.96);
  border-bottom: 1px solid var(--border);
}

.primary-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 4px;
}

.nav-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 2.5px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text);
  background: rgba(43, 107, 91, 0.05);
}

.nav-tab[aria-selected="true"] {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.nav-tab[aria-selected="true"] .nav-badge {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-badge:empty {
  display: none;
}

/* ===== Main Content ===== */
.app-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.tab-panel {
  animation: fadeIn 0.18s ease;
}

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

/* ===== Dropdown Menu ===== */
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 60;
}

.dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--bg-subtle);
}

.dropdown-item-danger {
  color: var(--danger);
}

.dropdown-item-danger:hover {
  background: var(--danger-soft);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ===== Buttons & Inputs ===== */
.btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.86rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.btn:hover,
.icon-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.btn:active,
.icon-btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-soft {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--primary);
}

.btn-soft:hover {
  background: #d8ebe4;
  border-color: #a9d2c5;
}

.btn-danger-soft {
  background: var(--danger-soft);
  border-color: #f4c7c3;
  color: var(--danger);
}

.btn-danger-soft:hover {
  background: #fadbd8;
}

.btn-sm {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 0.79rem;
}

.icon-btn-sm {
  min-height: 32px;
  min-width: 32px;
  padding: 4px 8px;
  font-size: 0.85rem;
}

.btn-ghost-delete {
  min-height: 32px;
  min-width: 32px;
  padding: 4px 7px;
  border: none;
  background: transparent;
  color: var(--text-soft);
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.btn-ghost-delete:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-ghost-edit {
  min-height: 32px;
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
}

.btn-ghost-edit:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43, 107, 91, 0.14);
}

.textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.45;
}

.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ===== Cards & Sections ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.card-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.card-body {
  padding: 16px 18px;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.section-heading h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-heading p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Filter & Sub-tab Pills ===== */
.subtab-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  -webkit-overflow-scrolling: touch;
}

.subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.86rem;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.subtab-btn:hover {
  color: var(--text);
}

.subtab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.subtab-pill-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.subtab-btn.active .subtab-pill-count {
  background: var(--primary-soft);
  color: var(--primary);
}

.filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.14s ease;
}

.filter-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.filter-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* ===== Member & Status Badges ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.tag-dan { background: var(--tag-dan-bg); color: var(--tag-dan-fg); }
.tag-emma { background: var(--tag-emma-bg); color: var(--tag-emma-fg); }
.tag-lydia { background: var(--tag-lydia-bg); color: var(--tag-lydia-fg); }
.tag-david { background: var(--tag-david-bg); color: var(--tag-david-fg); }
.tag-all, .tag-both { background: var(--tag-all-bg); color: var(--tag-all-fg); }
.tag-powell { background: var(--tag-powell-bg); color: var(--tag-powell-fg); }
.tag-mills { background: var(--tag-mills-bg); color: var(--tag-mills-fg); }
.tag-sian { background: var(--tag-sian-bg); color: var(--tag-sian-fg); }

.tag-recurring {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
}

.tag-high { background: var(--danger-soft); color: var(--danger); }
.tag-medium { background: var(--warning-soft); color: var(--warning); }
.tag-low { background: var(--bg-subtle); color: var(--text-muted); }

.tag-ready { background: var(--success-soft); color: var(--success); }
.tag-missing { background: var(--warning-soft); color: var(--warning); }
.tag-use-soon { background: #fdebd2; color: #9c4a05; }
.tag-defrost { background: var(--ice-soft); color: var(--ice); }

/* ===== Collapsible Forms ===== */
.inline-form-card {
  background: var(--surface);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.form-grid-wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* ===== TAB 1: Reminders & Weekly Schedule ===== */
.reminders-card {
  margin-bottom: 18px;
}

.reminders-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}

.reminder-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-hover);
  transition: opacity 0.15s ease;
}

.reminder-item.done {
  opacity: 0.6;
}

.reminder-item.done .reminder-title {
  text-decoration: line-through;
}

.reminder-content {
  flex: 1;
  min-width: 0;
}

.reminder-title {
  font-weight: 600;
  font-size: 0.89rem;
  line-height: 1.3;
  margin-bottom: 5px;
}

.reminder-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.countdown-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums;
}

.countdown-overdue { background: var(--danger-soft); color: var(--danger); }
.countdown-soon { background: var(--warning-soft); color: var(--warning); }
.countdown-later { background: var(--bg-subtle); color: var(--text-muted); }

.schedule-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.schedule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Today at a Glance */
.today-card {
  background: linear-gradient(135deg, #fffdf9 0%, #f3eee3 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}

.today-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.today-kicker {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.today-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.today-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.today-tile-btn {
  width: 100%;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.today-tile-btn:hover {
  border-color: var(--primary-border);
  background: var(--surface-hover);
}

.today-tile-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.today-tile-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.today-tile-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.collapsible-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  padding: 0;
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--text);
  text-align: left;
}

.qty-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.manager-box {
  background: var(--surface);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.manager-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.removable-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
}

.removable-chip button {
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 3px;
  border-radius: 50%;
}

.removable-chip button:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.day-jump-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.day-jump-bar::-webkit-scrollbar {
  display: none;
}

.day-jump-btn {
  min-height: 34px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.day-jump-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.day-jump-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.day-jump-btn.is-today:not(.active) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.day-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.day-card-header {
  padding: 11px 14px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.day-card-title {
  font-size: 0.94rem;
  font-weight: 700;
}

.day-card-count {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.attendance-bar {
  padding: 7px 12px;
  background: #fcfaf6;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.attendance-toggles {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.att-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.73rem;
  font-weight: 700;
  transition: all 0.14s ease;
}

.att-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.att-toggle.is-in {
  background: var(--success-soft);
  border-color: #bfe4ce;
  color: var(--success);
}

.att-toggle.is-out {
  background: var(--danger-soft);
  border-color: #f0b9b4;
  color: var(--danger);
  border-style: dashed;
}

.att-summary {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--warning);
}

.dinner-attendance-strip {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.tag-room {
  background: #f1ede4;
  color: #4f5752;
  border: 1px solid var(--border);
  font-weight: 600;
}

.day-events {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.event-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.14s ease;
}

.event-row:hover {
  border-color: var(--border-strong);
}

.event-row.extended-family {
  background: #fcfbf7;
  border-style: dashed;
}

.event-main {
  min-width: 0;
  flex: 1;
}

.event-time {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}

.event-title {
  font-weight: 600;
  font-size: 0.89rem;
  line-height: 1.3;
  margin-bottom: 5px;
}

.event-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.event-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ===== TAB 2: Meals, Pantry & Shopping ===== */
.meals-split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: start;
}

.dinner-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dinner-row {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.dinner-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.dinner-day {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
}

.dinner-name {
  font-weight: 700;
  font-size: 0.94rem;
  margin: 2px 0 5px;
}

.dinner-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.dinner-note {
  font-size: 0.79rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.dinner-edit-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* Shopping List */
.quick-add-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 96px 145px 112px auto;
  gap: 8px;
  margin-bottom: 12px;
}

.staples-section {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
}

.staples-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.staples-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.staple-chip {
  min-height: 30px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  transition: all 0.14s ease;
}

.staple-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.staple-chip.on-list {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--primary);
}

.shopping-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.aisle-group {
  margin-bottom: 14px;
}

.aisle-group:last-child {
  margin-bottom: 0;
}

.aisle-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 4px 2px 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background-color 0.14s ease;
}

.check-item:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.check-item.checked .check-item-text {
  text-decoration: line-through;
  color: var(--text-soft);
}

.custom-checkbox {
  width: 21px;
  height: 21px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.check-item-label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.check-item-text {
  font-size: 0.92rem;
  font-weight: 500;
  word-break: break-word;
}

/* Pantry / Cupboards & Freezers */
.pantry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
}

.pantry-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.pantry-row:last-child {
  border-bottom: none;
}

.pantry-info {
  min-width: 120px;
  flex: 1;
}

.pantry-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.pantry-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.status-pill-btn {
  min-height: 28px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 700;
}

.status-in { background: var(--success-soft); color: var(--success); border-color: #bfe4ce; }
.status-low { background: var(--warning-soft); color: var(--warning); border-color: #f3d59c; }
.status-out { background: var(--danger-soft); color: var(--danger); border-color: #f2c0bc; }

.use-soon-toggle {
  min-height: 28px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.73rem;
  font-weight: 600;
}

.use-soon-toggle.active {
  background: #fdebd2;
  border-color: #ebc086;
  color: #9c4a05;
}

/* Recipes, Meal Finder & Cookbook Snap */
.meal-finder-card {
  background: linear-gradient(135deg, #fffdf9 0%, #f5efe4 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-xs);
}

.meal-finder-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.meal-finder-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.finder-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.finder-label {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  min-width: 72px;
}

.tag-macro {
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 600;
}

.inline-row-edit {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--surface-hover);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  width: 100%;
}

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.recipe-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.recipe-thumb {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
  cursor: zoom-in;
  background: var(--bg-subtle);
}

.recipe-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.recipe-ing-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ing-chip {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.ing-have { background: var(--success-soft); color: var(--success); }
.ing-use-soon { background: #fdebd2; color: #9c4a05; border: 1px solid #ebc086; }
.ing-missing { background: var(--danger-soft); color: var(--danger); }

.recipe-actions {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.photo-preview-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.photo-preview-box img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ===== TAB 3: Lydia's Chores & Pocket Money ===== */
.lydia-banner {
  background: linear-gradient(135deg, #fffdf9 0%, #f5efe2 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}

.lydia-banner-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.lydia-total-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lydia-kicker {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.lydia-total-amount {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.lydia-total-breakdown {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.progress-wrap {
  margin-bottom: 16px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.progress-track {
  height: 10px;
  background: #e9e2d6;
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-pill);
  transition: width 0.25s ease;
}

.pots-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.pot-card.pot-spend {
  background: #f2faf6;
  border-color: var(--primary-border);
}

.pot-card.pot-pop {
  animation: potPop 0.36s ease;
}

@keyframes potPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.pot-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.pot-amount {
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.pot-card.pot-spend .pot-amount {
  color: var(--primary);
}

.pot-note {
  font-size: 0.72rem;
  color: var(--text-soft);
}

.chore-section {
  margin-bottom: 22px;
}

.chore-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.chore-section-header h3 {
  font-size: 1.02rem;
  font-weight: 700;
}

.chore-section-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 10px;
}

.chore-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.12s ease;
}

.chore-card:hover {
  border-color: var(--border-strong);
}

.chore-card.done {
  background: #f3faf6;
  border-color: #a9d5c4;
}

.chore-card.done .chore-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.chore-toggle-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
}

.chore-check-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
  font-weight: 800;
  font-size: 0.9rem;
  transition: all 0.16s ease;
}

.chore-card.done .chore-check-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.chore-emoji {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.chore-title {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
  word-break: normal;
  overflow-wrap: break-word;
}

.token-coin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 28px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.token-1 { background: #fef4df; color: #9a5b06; border: 1px solid #f0d08a; }
.token-2 { background: #e5f5ec; color: #1e6442; border: 1px solid #b5dec6; }
.token-5 { background: #fbece7; color: #a93e1e; border: 1px solid #f0c2b4; }

.chore-card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

/* ===== TAB 4: House Jobs & Weekly Cleaning ===== */
.jobs-filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.job-row.done {
  opacity: 0.65;
  background: var(--surface-hover);
}

.job-row.done .job-title {
  text-decoration: line-through;
}

.job-left {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.job-content {
  min-width: 0;
  flex: 1;
}

.job-title {
  font-weight: 600;
  font-size: 0.94rem;
  line-height: 1.3;
  margin-bottom: 5px;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.job-room {
  font-size: 0.77rem;
  color: var(--text-muted);
}

/* ===== Empty State ===== */
.empty-state {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  background: var(--surface-hover);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
}

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 21, 0.55);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
}

.modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 14px;
  overflow: auto;
  text-align: center;
}

.modal-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 90;
  background: var(--text);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  max-width: calc(100vw - 32px);
  text-align: center;
}

/* ===== Responsive Breakpoints ===== */
@media (max-width: 900px) {
  .meals-split-layout {
    grid-template-columns: 1fr;
  }

  .pots-grid,
  .today-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-add-bar {
    grid-template-columns: minmax(0, 1fr) 110px;
  }
}

@media (max-width: 639px) {
  .btn-label-desktop {
    display: none;
  }

  .header-inner {
    padding: 9px 14px;
  }

  /* Prevent iPhone Safari auto-zoom on input focus */
  .input,
  .select,
  .textarea {
    font-size: 16px;
  }

  /* Equal-width non-truncating mobile sub-tabs */
  .subtab-bar {
    padding: 3px;
    gap: 3px;
    overflow-x: visible;
  }

  .subtab-btn {
    flex: 1 1 0;
    justify-content: center;
    padding: 8px 4px;
    font-size: 0.78rem;
    gap: 4px;
    min-width: 0;
  }

  .subtab-pill-count {
    font-size: 0.68rem;
    padding: 1px 5px;
  }

  /* Single-row swipeable filter strips on mobile */
  .filter-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
    padding-bottom: 2px;
  }

  .filter-strip::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    flex-shrink: 0;
  }

  .jobs-filters-bar {
    gap: 8px;
  }

  /* Thumb-friendly bottom navigation dock on mobile */
  .primary-nav {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: #ffffff;
    border-top: 1px solid var(--border);
    border-bottom: none;
    padding: 4px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 12px rgba(30, 36, 32, 0.08);
  }

  .primary-nav-inner {
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
  }

  .nav-tab {
    flex-direction: column;
    gap: 2px;
    padding: 6px 4px;
    border-bottom: none;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
  }

  .nav-tab[aria-selected="true"] {
    background: var(--primary-soft);
    color: var(--primary);
  }

  .nav-badge {
    position: absolute;
    top: 3px;
    right: 6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.65rem;
  }

  .app-main {
    padding: 12px 12px 92px;
  }

  .chore-grid {
    grid-template-columns: 1fr;
  }

  .check-item {
    min-height: 48px;
  }

  .toast {
    bottom: 78px;
  }

  .quick-add-bar {
    grid-template-columns: minmax(0, 1fr) 110px;
  }

  .quick-add-bar #shopping-item-input,
  .quick-add-bar #shopping-qty-input,
  .quick-add-bar #shopping-aisle-select,
  .quick-add-bar #shopping-store-select {
    grid-column: auto;
  }

  .quick-add-bar #shopping-add-btn {
    grid-column: 1 / -1;
    min-height: 44px;
  }

  .card-header,
  .card-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .today-card {
    padding: 12px 12px;
  }
}

/* ===== Live Cloud Sync Pill & Kid-Mode Header Button ===== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn-kid {
  background: #fff9e8;
  border-color: #ebd08b;
  color: #7a5600;
}

.icon-btn-kid:hover {
  background: #fef1cb;
  border-color: #d8b24d;
  color: #5b3f00;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-size: 0.69rem;
  font-weight: 700;
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid #bfe4ce;
  vertical-align: middle;
}

.sync-pill.sync-offline {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: #eed6a1;
}

.dropdown-meta {
  padding: 8px 12px 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tag-repeat {
  background: #eef4fb;
  color: #21578a;
  border: 1px solid #c7ddf2;
  font-weight: 700;
}

/* ===== Cloud Auth Tabs ===== */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  margin-bottom: 14px;
}

.auth-tab-btn {
  min-height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
}

.auth-tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.auth-error {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
}

/* ===== LYDIA'S KID-FRIENDLY iPAD MODE ===== */
.kid-shell {
  min-height: 100vh;
  background: linear-gradient(180deg, #fffaf0 0%, #f6fbf8 100%);
  padding-bottom: 40px;
}

.kid-header {
  background: #ffffff;
  border-bottom: 2px solid #f0e6d2;
  padding: 14px 18px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.kid-header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kid-greeting {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kid-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffe08a 0%, #f7b84b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.kid-greeting h1 {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
}

.kid-greeting p {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.kid-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 16px 32px;
}

.kid-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.kid-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 72px;
  padding: 10px 8px;
  border-radius: 18px;
  border: 2px solid var(--border);
  background: #ffffff;
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
  transition: transform 0.14s ease, border-color 0.14s ease, background-color 0.14s ease;
}

.kid-tab-btn .kid-tab-emoji {
  font-size: 1.65rem;
  line-height: 1;
}

.kid-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.kid-hero-banner {
  background: linear-gradient(135deg, #fffdf5 0%, #e9f6ef 100%);
  border: 2px solid #c5e3d6;
  border-radius: 22px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.kid-money-total {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.kid-chore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.kid-chore-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 76px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: #ffffff;
  text-align: left;
  box-shadow: var(--shadow-xs);
  transition: transform 0.14s ease, border-color 0.14s ease, background-color 0.14s ease;
}

.kid-chore-btn:active {
  transform: scale(0.98);
}

.kid-chore-btn.done {
  background: #eaf7ef;
  border-color: #7bc79d;
}

.kid-chore-check {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
  flex-shrink: 0;
  background: #ffffff;
  color: transparent;
}

.kid-chore-btn.done .kid-chore-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.kid-chore-emoji {
  font-size: 1.9rem;
  line-height: 1;
  flex-shrink: 0;
}

.kid-chore-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  flex: 1;
}

.kid-chore-btn.done .kid-chore-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.kid-dinner-hero {
  background: linear-gradient(135deg, #fff5e6 0%, #fffdf8 100%);
  border: 2px solid #f0d7a8;
  border-radius: 22px;
  padding: 20px;
  margin-bottom: 16px;
}

.kid-dinner-hero-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--text);
  margin: 6px 0;
}

.kid-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.kid-card {
  background: #ffffff;
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
}

.kid-card.is-today {
  border-color: var(--primary);
  background: #f4fbf7;
}

@media (max-width: 639px) {
  .kid-greeting h1 {
    font-size: 1.12rem;
  }

  .kid-tab-btn {
    min-height: 64px;
    font-size: 0.85rem;
  }

  .kid-chore-grid,
  .kid-list-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Settings, Parent PIN & Weekly Backup Modal ===== */
.settings-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.settings-section:first-child {
  padding-top: 2px;
}

.settings-section:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.settings-heading {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.backup-btn-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pin-input {
  letter-spacing: 0.25em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ===== Defrost Tonight Nudge & Supermarket Badges ===== */
.defrost-nudge {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: #eaf4fb;
  border: 1px solid #b9daf0;
  color: #164e73;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-store-aldi {
  background: #e9f2fc;
  color: #164b8a;
  border: 1px solid #bdd7f5;
  font-weight: 700;
}

.tag-store-lidl {
  background: #fff7dd;
  color: #7a5400;
  border: 1px solid #ebd288;
  font-weight: 700;
}

.tag-store-tesco {
  background: #fdeeee;
  color: #9e2626;
  border: 1px solid #f0c2c2;
  font-weight: 700;
}

/* ===== Voice & Natural-Language Quick Entry Bar ===== */
.voice-bar {
  background: linear-gradient(135deg, #ffffff 0%, #f3f9f5 100%);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}

.voice-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.voice-bar-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.voice-bar-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-bar-form .input {
  flex: 1;
  min-width: 0;
}

.btn-mic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.84rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-mic:hover {
  background: #d7eee0;
}

.btn-mic.is-listening {
  background: #d64545;
  border-color: #b73232;
  color: #ffffff;
  animation: micPulse 1.2s ease-in-out infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 69, 69, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(214, 69, 69, 0); }
}

.today-voice-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--primary-border);
  background: #ffffff;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.today-voice-btn:hover {
  background: var(--primary-soft);
}

.today-voice-btn.is-listening {
  background: #d64545;
  border-color: #b73232;
  color: #ffffff;
}

.voice-confirm-banner {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-md);
  background: #eef8f1;
  border: 1px solid #bce0c9;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.voice-confirm-list {
  margin: 0;
  padding-left: 16px;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.4;
}

.voice-confirm-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ===== Cooked Toggle, Healthy Tag & Dan's Weekly Extras ===== */
.today-dinner-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.today-dinner-jump {
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  color: inherit;
}

.btn-cooked {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 30px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.btn-cooked:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-cooked.is-cooked {
  background: var(--success-soft);
  border-color: #8fd1a8;
  color: var(--success);
}

.dinner-row.is-cooked {
  background: #f7fbf8;
  border-color: #cde6d6;
}

.tag-healthy {
  background: #e9f8ee;
  color: #196b38;
  border: 1px solid #b5e3c6;
  font-weight: 700;
}

.dan-extras-section {
  background: #f6f8fb;
  border: 1px solid #dde6f2;
}

.gemini-scan-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: #eef4ff;
  border: 1px solid #c5dafc;
  color: #1d4e9e;
  font-size: 0.78rem;
  font-weight: 700;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.toast[hidden] {
  display: none;
}

.toast-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.toast-action-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

@media (max-width: 639px) {
  .voice-bar {
    padding: 10px 12px;
  }

  .voice-bar-form {
    flex-wrap: wrap;
  }

  .voice-bar-form .input {
    flex: 1 1 100%;
    order: 1;
  }

  .voice-bar-form .btn-mic {
    flex: 1;
    order: 2;
  }

  .voice-bar-form #btn-voice-run {
    flex: 1;
    order: 3;
    min-height: 40px;
  }
}
