:root {
  --bg: #F7F0E6;
  --bg-2: #EFE4D4;
  --card: #FFFBF7;
  --ink: #2A241E;
  --muted: #6F655C;
  --line: #E6D8C6;
  --teal: #C2410C;
  --teal-dark: #9A3009;
  --teal-soft: #FBE6D0;
  --coral: #D4654A;
  --gold: #E6B25C;
  --danger: #B3402E;
  --ok: #2E7D4F;
  --shadow: 0 8px 28px rgba(42, 36, 30, 0.08);
  --radius: 18px;
  --tab-h: 76px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Segoe UI", "Trebuchet MS", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--font); }
body {
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
a { color: var(--teal-dark); }

#app { min-height: 100dvh; }

.screen {
  min-height: 100dvh;
  padding: calc(20px + var(--safe-t)) 20px calc(28px + var(--safe-b));
}
.screen.narrow { max-width: 440px; margin: 0 auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.brand img { width: 56px; height: 56px; border-radius: 16px; }
.brand h1 { margin: 0; font-size: 1.55rem; letter-spacing: -0.02em; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 0.95rem; }

h2 { margin: 0 0 8px; font-size: 1.45rem; letter-spacing: -0.02em; }
.lede { margin: 0 0 20px; color: var(--muted); font-size: 1.05rem; line-height: 1.4; }

.field { margin: 0 0 16px; }
.field label, .label {
  display: block;
  font-weight: 650;
  margin-bottom: 8px;
  font-size: 1rem;
}
input[type="text"], input[type="search"], input[type="date"], input[type="time"],
input[type="password"], input:not([type]), textarea, select {
  width: 100%;
  border: 2px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  padding: 14px 16px;
  min-height: 56px;
  font-size: 1.05rem;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(194, 65, 12, 0.18);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: 1.08rem;
  padding: 12px 18px;
  box-shadow: var(--shadow);
}
.btn:active { background: var(--teal-dark); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.secondary {
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--line);
  box-shadow: none;
}
.btn.ghost {
  background: transparent;
  color: var(--teal-dark);
  box-shadow: none;
  min-height: 48px;
}
.btn.danger {
  background: transparent;
  color: var(--danger);
  box-shadow: none;
  border: 2px solid #efc4bc;
}
.btn.small { min-height: 48px; width: auto; padding: 8px 16px; font-size: 0.98rem; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { width: auto; flex: 1; }

.error {
  background: #FDECEA;
  color: #8A2A1E;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-weight: 600;
}
.okmsg {
  background: var(--teal-soft);
  color: var(--teal-dark);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-weight: 600;
}

.people { display: grid; gap: 12px; }
.person {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 16px;
  min-height: 72px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 1.15rem;
}
.person:active { border-color: var(--teal); }
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--teal-soft); color: var(--teal-dark);
  font-weight: 800; font-size: 1.15rem; flex: 0 0 auto;
}
.person .meta { color: var(--muted); font-weight: 500; font-size: 0.9rem; margin-top: 2px; }

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.key {
  min-height: 64px;
  border: 0;
  border-radius: 16px;
  background: var(--card);
  border: 2px solid var(--line);
  font-size: 1.5rem;
  font-weight: 700;
}
.key:active { background: var(--teal-soft); border-color: var(--teal); }
.key.wide { grid-column: span 1; }
.pin-dots {
  display: flex; justify-content: center; gap: 14px; margin: 8px 0 18px;
}
.pin-dots span {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--teal);
  background: transparent;
}
.pin-dots span.on { background: var(--teal); }

/* App shell */
.shell { min-height: 100dvh; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 8px); }
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(247, 240, 230, 0.92);
  backdrop-filter: blur(10px);
  padding: calc(10px + var(--safe-t)) 16px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-bottom: 1px solid var(--line);
}
.topbar .who { min-width: 0; }
.topbar h1 { margin: 0; font-size: 1.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .hello { margin: 0; color: var(--muted); font-size: 0.92rem; }
.icon-btn {
  width: 48px; height: 48px; border: 0; border-radius: 14px;
  background: var(--card); border: 2px solid var(--line);
  display: grid; place-items: center; font-size: 1.2rem; flex: 0 0 auto;
}
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + var(--safe-b));
  box-shadow: 0 -8px 24px rgba(42, 36, 30, 0.06);
}
.tab {
  border: 0; background: transparent; color: var(--muted);
  min-height: 60px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-weight: 700; font-size: 0.78rem;
}
.tab .ico { font-size: 1.35rem; line-height: 1; }
.tab.on { color: var(--teal-dark); background: var(--teal-soft); }

.main { padding: 16px 16px 24px; max-width: 560px; margin: 0 auto; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin: 0 0 12px;
}
.card h3 { margin: 0 0 6px; font-size: 1.08rem; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }

.empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
  line-height: 1.45;
}
.empty strong { color: var(--ink); display: block; font-size: 1.1rem; margin-bottom: 6px; }

.today-chores { margin: 0 0 18px; }
.today-chores h2 { margin: 0 0 10px; font-size: 1.25rem; }
.today-btn {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 16px 16px;
  margin: 0 0 10px;
  min-height: 64px;
}
.today-btn .check {
  width: 36px; height: 36px; border-radius: 10px;
  margin-top: 0;
  font-size: 1.15rem;
}
.today-btn.done { border-color: var(--teal); background: var(--teal-soft); }
.today-btn.done .check { background: var(--teal); }
.today-btn.done .t-title { text-decoration: line-through; color: var(--muted); }
.today-btn .t-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.today-btn .t-title { font-weight: 800; font-size: 1.08rem; }
.today-btn .t-who { color: var(--muted); font-size: 0.9rem; font-weight: 650; }
.today-btn.done { cursor: default; }


.day-chores { margin: 0 0 16px; }
.day-chores h3 { margin: 0 0 10px; font-size: 1.05rem; }
.day-chore {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  margin: 0 0 8px;
  min-height: 60px;
}
.day-chore .check {
  width: 32px; height: 32px; border-radius: 10px; margin-top: 0;
}
.day-chore.done { border-color: var(--teal); background: var(--teal-soft); }
.day-chore.done .check { background: var(--teal); }
.day-chore .t-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.day-chore .t-title { font-weight: 800; font-size: 1.02rem; }
.day-chore .t-who { color: var(--muted); font-size: 0.9rem; font-weight: 650; }
.day .chore-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--teal); margin: 0 1px; }
.day.on .chore-dot { background: #fff; }

.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.cal-nav h2 { margin: 0; font-size: 1.25rem; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  margin-bottom: 16px;
}
.dow { text-align: center; font-size: 0.78rem; color: var(--muted); font-weight: 700; padding: 4px 0; }
.day {
  border: 0; background: transparent; border-radius: 12px;
  min-height: 52px; padding: 4px 0 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  font-weight: 650;
}
.day .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; }
.day.today .n { outline: 2px solid var(--teal); }
.day.on .n { background: var(--teal); color: #fff; }
.day .mark {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 6px; margin-top: 2px;
}
.day .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--coral); }
.day .bar { height: 4px; width: 100%; background: var(--coral); border-radius: 0; }
.day .bar.start { width: 70%; margin-left: auto; border-radius: 4px 0 0 4px; }
.day .bar.end { width: 70%; margin-right: auto; border-radius: 0 4px 4px 0; }
.day .bar.mid { width: 100%; }
.day .bar.single { width: 14px; border-radius: 4px; }
.day.on .dot, .day.on .bar { background: #fff; }
.day.out { opacity: 0.35; }

.item {
  display: block; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 16px; margin: 0 0 10px;
}
.item .when { color: var(--teal-dark); font-weight: 700; font-size: 0.88rem; margin-bottom: 2px; }
.item .title { font-weight: 700; font-size: 1.05rem; }
.item .sub { color: var(--muted); margin-top: 4px; font-size: 0.95rem; }
.item .only { margin-top: 6px; font-size: 0.85rem; font-weight: 700; color: var(--teal-dark); }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 0.92rem; line-height: 1.35; }
.who-field { border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px 8px; }
.who-field legend { font-weight: 650; padding: 0 6px; }
.who-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.field label.who-item,
label.who-item,
.who-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 6px 4px;
  border-radius: 12px;
  margin-bottom: 0;
  font-weight: 650;
}
.who-item input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--teal); flex: 0 0 auto; }
.who-item.all-day { margin: 0 0 14px; font-weight: 650; }
.inline-row { display: flex; gap: 10px; align-items: center; }
.inline-row input[type="number"] { width: 90px; min-height: 56px; }
.inline-row select { flex: 1; }

.thread {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px 14px; margin: 0 0 10px; min-height: 72px;
}
.thread .preview { color: var(--muted); font-size: 0.92rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.thread .grow { min-width: 0; flex: 1; }

.chat { display: flex; flex-direction: column; min-height: calc(100dvh - 200px); }
.bubbles { display: flex; flex-direction: column; gap: 10px; padding: 8px 0 16px; }
.bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.bubble.me { align-self: flex-end; background: var(--teal); color: #fff; border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble .who { font-size: 0.78rem; font-weight: 700; margin-bottom: 2px; opacity: 0.85; }
.bubble .t { font-size: 0.75rem; opacity: 0.7; margin-top: 4px; }
.composer {
  position: sticky; bottom: calc(var(--tab-h) + var(--safe-b));
  background: var(--bg);
  padding: 8px 0 10px;
  display: flex; gap: 8px; align-items: flex-end;
}
.composer textarea { min-height: 52px; max-height: 140px; padding: 12px 14px; }
.composer .btn { width: auto; min-width: 88px; min-height: 52px; }

.note {
  width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 16px; margin: 0 0 10px;
}
.note h3 { margin: 0 0 6px; font-size: 1.08rem; }
.note p { margin: 0; color: var(--muted); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.person-block { margin: 0 0 22px; }
.person-block h3 {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 10px; font-size: 1.08rem;
}
.chore {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px 14px; margin: 0 0 8px;
}
.chore.done .ctitle { text-decoration: line-through; color: var(--muted); }
.check {
  width: 28px; height: 28px; border-radius: 8px;
  border: 2px solid var(--teal);
  background: #fff; flex: 0 0 auto; margin-top: 2px;
  display: grid; place-items: center; font-weight: 800; color: #fff;
}
.chore.done .check { background: var(--teal); }
.chore .ctitle { font-weight: 700; }
.chore-edit {
  border: 0; background: transparent; text-align: left; padding: 0; flex: 1; min-width: 0;
  font: inherit; color: inherit;
}
.chore .due { font-size: 0.88rem; margin-top: 2px; color: var(--muted); }
.chore .due.late { color: var(--danger); font-weight: 700; }
.chore .due.today { color: var(--teal-dark); font-weight: 700; }
.chore .x {
  margin-left: auto; border: 0; background: transparent;
  color: var(--muted); font-size: 1.2rem; width: 40px; height: 40px; border-radius: 10px;
}

.banner {
  background: var(--teal-soft);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 14px;
  color: var(--teal-dark);
}
.form-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

.back {
  border: 0; background: transparent; color: var(--teal-dark);
  font-weight: 700; min-height: 44px; padding: 0 0 10px; font-size: 1rem;
}

.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

@media (min-width: 700px) {
  .main, .screen.narrow { max-width: 600px; }
}

.list-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 16px;
}
.list-sw {
  min-height: 48px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  font-weight: 700;
  font-size: 1rem;
}
.list-sw.on {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.grocery-add {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin: 0 0 8px;
}
.grocery-add input {
  flex: 1;
  min-width: 0;
  min-height: 56px;
}
.grocery-add .btn {
  width: auto;
  min-width: 88px;
  min-height: 56px;
  flex: 0 0 auto;
}
.grocery-note {
  width: 100%;
  min-height: 48px;
  margin: 0 0 14px;
}
.g-list { margin-top: 8px; }
.g-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 8px 10px 12px;
  margin: 0 0 8px;
}
.g-item.done { opacity: 0.7; }
.g-item.done .gtitle { text-decoration: line-through; color: var(--muted); }
.g-body {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 2px 0;
  min-height: 48px;
}
.g-item .gtitle { font-weight: 700; font-size: 1.05rem; }
.g-item .gnote { color: var(--ink); margin-top: 2px; font-size: 0.95rem; }
.g-item .added { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
#clear-checked { margin-bottom: 14px; }

.avatar.sm { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar.star { background: var(--teal); color: #fff; }
.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  vertical-align: -1px;
  margin-right: 6px;
}
.item { position: relative; }
.item .item-swatch {
  position: absolute;
  left: 8px;
  top: 18px;
  margin: 0;
  width: 10px;
  height: 10px;
}
.item:has(.item-swatch) { padding-left: 26px; }
.day .special-dot {
  font-size: 0.62rem;
  line-height: 1;
  display: block;
}
.upcoming { margin: 0 0 18px; }
.upcoming h2, .today-chores h2 { margin: 0 0 10px; font-size: 1.15rem; }
.code-big { font-size: 1.6rem; letter-spacing: 0.06em; margin: 8px 0 0; }
.color-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.color-pick {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid transparent;
  padding: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.color-pick.on {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink);
}
.special-item .when { display: flex; align-items: center; gap: 6px; }
.btn.danger {
  background: #fff;
  color: var(--danger);
  border: 2px solid var(--danger);
}

.upcoming-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: var(--card); border: 2px solid var(--line);
  border-radius: 16px; padding: 12px 14px; margin: 0 0 8px; min-height: 56px;
}
.upcoming-item .u-ico { font-size: 1.35rem; flex: 0 0 auto; }
.upcoming-item .t-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.upcoming-item .t-title { font-weight: 800; }
.day.has-miles .miles-mark { font-size: 0.68rem; line-height: 1; margin: 0 1px; }
#scan-grocery { width: 100%; margin: 8px 0 12px; }
.scan-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: #111; color: #fff;
  display: flex; flex-direction: column;
  padding: calc(12px + var(--safe-t)) 16px calc(16px + var(--safe-b));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.scan-overlay h2 { color: #fff; margin: 0 0 8px; }
.scan-overlay > p, .scan-overlay .scan-status { color: #ddd; margin: 0 0 12px; }
.scan-overlay.has-result .scan-stage { display: none; }
.scan-overlay.has-result #scan-manual-box { display: none; }
.scan-confirm, .scan-confirm p, .scan-confirm .hint, .scan-confirm .label,
.scan-facts p, .ing-list p, .ing-allergens p, .ing-result p, .ing-note {
  color: var(--ink);
}
.scan-stage {
  position: relative; flex: 1; min-height: 220px;
  background: #000; border-radius: 18px; overflow: hidden;
}
.scan-stage video, .scan-stage canvas {
  width: 100%; height: 100%; object-fit: cover;
}
.scan-frame {
  position: absolute; inset: 18% 12%;
  border: 3px solid rgba(255,255,255,0.85); border-radius: 16px; pointer-events: none;
}
.scan-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.scan-overlay .btn.secondary { background: #222; color: #fff; border-color: #444; }
.scan-confirm {
  background: var(--card); color: var(--ink);
  border-radius: 18px; padding: 16px; margin-top: 12px;
}
.scan-confirm label { display: block; font-weight: 650; margin-bottom: 6px; }
.scan-manual { display: flex; gap: 8px; }
.scan-manual input { flex: 1; min-width: 0; }
.scan-status { font-size: 0.95rem; color: #ccc; min-height: 1.2em; }
.vehicle-row { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.vehicle-card {
  display: block; width: 100%; text-align: left;
  background: var(--card); border: 2px solid var(--line);
  border-radius: 16px; padding: 12px 14px; color: inherit; font: inherit;
}
.vehicle-card .v-name { font-weight: 800; font-size: 1.05rem; }
.vehicle-card .v-last { color: var(--muted); font-size: 0.92rem; font-weight: 650; margin: 2px 0 6px; }
.v-stat { font-size: 0.92rem; font-weight: 650; margin-top: 4px; }
.v-stat.warn { color: #9A3009; font-weight: 800; }
.v-stat.muted { color: var(--muted); font-weight: 600; }
.vehicle-log.focus { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-soft); }
.form-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

.care-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.care-row:last-child { border-bottom: 0; }
.care-head { margin-bottom: 6px; }
.field.tight { margin: 6px 0 0; }
.field.tight label { font-size: 0.88rem; }
.subcard { margin: 0 0 12px; }
textarea {
  width: 100%; box-sizing: border-box;
  font: inherit; color: inherit;
  background: #fff; border: 2px solid var(--line);
  border-radius: 12px; padding: 10px 12px; min-height: 72px;
}

.btn.ghost {
  background: transparent; color: var(--muted); border: 0;
  box-shadow: none; font-weight: 700;
}
.tour {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg);
  padding: calc(20px + var(--safe-t)) 20px calc(24px + var(--safe-b));
}
.tour-brand {
  display: flex; align-items: center; gap: 12px; margin: 0 0 18px;
}
.tour-brand img {
  width: 48px; height: 48px; border-radius: 12px; background: #C2410C;
}
.tour-brand h1 { margin: 0; font-size: 1.15rem; }
.tour-brand p { margin: 0; color: var(--muted); font-weight: 650; }
.tour-card {
  background: var(--card);
  border-radius: 22px;
  padding: 28px 22px 22px;
  box-shadow: var(--shadow);
  flex: 1;
  display: flex; flex-direction: column;
  border: 2px solid var(--line);
}
.tour-ico { font-size: 2.5rem; line-height: 1; margin-bottom: 12px; }
.tour-card h2 { margin: 0 0 10px; }
.tour-dots { display: flex; gap: 8px; justify-content: center; margin: 20px 0 6px; }
.tour-dots span {
  width: 8px; height: 8px; border-radius: 99px; background: var(--line);
  display: block;
}
.tour-dots span.on { background: var(--teal); width: 22px; }
.tour-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 16px; }
.help-list { margin: 18px 0 8px; }
.help-item {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 0 16px;
  margin: 0 0 10px;
}
.help-item summary {
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  padding: 14px 0;
}
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary::after {
  content: "›";
  float: right;
  color: var(--muted);
  font-weight: 700;
  transform: rotate(90deg);
}
.help-item[open] summary::after { transform: rotate(-90deg); }
.help-body { padding: 0 0 14px; color: var(--ink); }
.help-body p { margin: 0 0 10px; }
.help-steps { margin: 0 0 8px; padding-left: 1.2em; }
.help-steps li { margin: 0 0 8px; }
#replay-tour { width: 100%; margin: 4px 0 0; }

.feature-list { list-style: none; margin: 0; padding: 0; }
.feature-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--card); border: 2px solid var(--line);
  border-radius: 16px; padding: 12px 14px; margin: 0 0 8px;
}
.feature-ico { font-size: 1.4rem; line-height: 1.2; flex: 0 0 auto; }
.feature-item .t-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feature-item .t-title { font-weight: 800; display: block; }
.feature-item .t-who { display: block; }

.feature-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
  white-space: nowrap;
}
.feature-tag.basic { background: var(--teal-soft); color: var(--teal-dark); }
.feature-tag.addon { background: #EEE7DC; color: var(--muted); }
.addon-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin: 0 0 8px;
}
.addon-row .t-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.addon-row .t-title { font-weight: 800; }
.addon-row .t-who { display: block; }
.switch {
  flex: 0 0 auto;
  width: 52px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: #C9BBA9;
  position: relative;
  padding: 0;
  margin-top: 2px;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(42, 36, 30, 0.2);
  transition: transform 0.15s ease;
}
.switch.on { background: var(--teal); }
.switch.on::after { transform: translateX(20px); }

/* Lists switcher with add-ons */
.list-switch.cols-3 { grid-template-columns: repeat(3, 1fr); }
.list-switch.cols-4 { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.list-switch.cols-4 .list-sw { font-size: 0.9rem; padding: 0 4px; }

/* Meal planner */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 6px 8px; margin: 0 0 12px; }
.week-nav strong { text-align: center; flex: 1; font-size: 0.98rem; }
.week-nav .icon-btn { font-size: 1.5rem; line-height: 1; }
.chip-row { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.chip { min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); font-weight: 700; font-size: 0.92rem; color: var(--ink); font-family: inherit; }
.chip.on { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-dark); }
.meal-day { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 10px; }
.meal-day.today { border-color: var(--teal); }
.meal-day h3 { margin: 0 0 8px; font-size: 1.05rem; }
.meal-slot + .meal-slot { margin-top: 8px; }
.meal-slot-name { font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 4px; }
.meal-card { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; background: var(--teal-soft); border: 0; border-radius: 12px; padding: 10px 12px; margin: 0 0 6px; font-family: inherit; color: var(--ink); }
.meal-name { font-weight: 800; font-size: 1.02rem; }
.meal-ing { font-size: 0.86rem; color: var(--muted); margin-top: 2px; }
.meal-add { background: none; border: 2px dashed var(--line); border-radius: 12px; width: 100%; min-height: 44px; color: var(--teal-dark); font-weight: 700; font-family: inherit; font-size: 0.95rem; }
.fav-row, .reward-row, .hist-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fav-row:last-child, .reward-row:last-of-type, .hist-row:last-child { border-bottom: 0; }
.fav-row .t-copy, .reward-row .t-copy, .hist-row .t-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fav-row .t-title, .reward-row .t-title, .hist-row .t-title { font-weight: 700; }
.fav-row .t-who, .reward-row .t-who, .hist-row .t-who { color: var(--muted); font-size: 0.86rem; }
.fav-row .x, .reward-row .x { background: none; border: 0; font-size: 1.5rem; color: var(--muted); width: 40px; height: 40px; }
.check-line { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 0 0 8px; }
.check-line input { width: 22px; height: 22px; accent-color: var(--teal); }
textarea { font-family: inherit; }

/* Chore points */
.pt-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-dark); font-size: 0.78rem; font-weight: 800; vertical-align: middle; }
.chore.done .pt-badge { text-decoration: none; }
.pt-board { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; }
.pt-card { display: flex; align-items: center; gap: 12px; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.pt-card .t-copy { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pt-card .t-title { font-weight: 800; font-size: 1.05rem; }
.pt-card .t-who { color: var(--muted); font-size: 0.9rem; }
.pt-total { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.pt-total strong { font-size: 1.6rem; color: var(--teal-dark); line-height: 1; }
.pt-total small { color: var(--muted); font-size: 0.78rem; }
.reward-row .btn.small { min-height: 40px; padding: 6px 14px; }
.redeem-box { border-color: var(--teal); }
.hist-ico { width: 24px; text-align: center; }
.hist-pts { font-weight: 800; color: var(--ok); }
.hist-pts.neg { color: var(--danger); }
.field input[type="number"] { width: 100%; border: 2px solid var(--line); background: var(--card); border-radius: 14px; padding: 14px 16px; min-height: 56px; font-size: 1.05rem; }

/* Calendar links add-on */
.ext-item { cursor: default; }
.ext-tag { margin-top: 6px; font-size: 0.85rem; font-weight: 700; }
.ext-tag .ext-ro { color: var(--muted); font-weight: 600; }
.cal-link { border-top: 1px solid var(--line); padding: 12px 0; }
.cal-head { display: flex; align-items: center; gap: 10px; }
.cal-head .swatch { width: 14px; height: 14px; flex: none; }
.cal-name { min-width: 0; overflow-wrap: anywhere; }
.cal-status { margin-top: 6px; font-size: 0.9rem; color: var(--muted); }
.cal-status.bad { color: #9b2c1f; font-weight: 600; }
.cal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.cal-actions a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.cal-edit { margin-top: 12px; padding: 12px; background: #faf6f0; border-radius: 14px; }
.cal-how { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.cal-how summary { font-weight: 700; min-height: 40px; display: flex; align-items: center; cursor: pointer; }
.cal-how ol { margin: 8px 0 4px; padding-left: 22px; line-height: 1.45; }
.cal-how li { margin-bottom: 6px; }
#cal-feed-url { font-size: 0.85rem; }

/* Food scanner highlight and ingredient results */
.feature-item.feature-popular {
  border-color: var(--coral, #C2410C);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.12);
  background: #fff8f3;
}
.feature-tag.popular {
  background: #C2410C;
  color: #fff;
}
.scan-facts { margin: 0 0 14px; }
.scan-facts .ing-list,
.scan-facts .ing-allergens,
.scan-overlay .ing-list,
.ing-list, .ing-allergens {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  margin: 0 0 10px;
}
.ing-list p, .ing-allergens p { margin: 6px 0 0; }
.ing-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: var(--bg, #f4efe6); color: var(--ink);
  display: flex; flex-direction: column;
  padding: calc(12px + var(--safe-t, 0px)) 16px calc(16px + var(--safe-b, 0px));
  overflow: auto;
}
.ing-overlay h2 { margin: 0 0 6px; }
.ing-note {
  background: var(--card); border: 2px solid var(--line);
  border-radius: 12px; padding: 8px 12px; font-weight: 650;
  color: var(--muted); margin: 8px 0 10px;
}
.ing-lede { margin: 0 0 12px; }
.ing-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.ing-status { min-height: 1.2em; color: var(--muted); font-weight: 650; margin: 0 0 8px; }
.ing-label { font-weight: 700; margin-bottom: 6px; }
.ing-overlay textarea {
  width: 100%; min-height: 140px; border-radius: 14px;
  border: 2px solid var(--line); padding: 10px 12px; font: inherit;
  margin-bottom: 10px; resize: vertical; background: var(--card);
}
.ing-overlay .btn { width: 100%; margin-bottom: 8px; }
.ing-result { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 14px; margin: 8px 0 12px; }
.ing-rating {
  display: inline-block; font-weight: 800; font-size: 1.1rem;
  border-radius: 999px; padding: 4px 14px; margin-bottom: 8px;
}
.ing-rating.good { background: #d7eedc; color: #1b5e2a; }
.ing-rating.ok { background: #f7e3b8; color: #7a4a08; }
.ing-rating.poor { background: #f6d0c8; color: #8a1f12; }
.ing-flag { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.ing-flag strong { display: block; margin-bottom: 4px; }
.ing-flag p { margin: 0 0 6px; }
.ing-flag.strong strong { color: #8a1f12; }
.ing-found { color: var(--muted); font-size: 0.92rem; font-weight: 650; }
