/* Kohli — components. iOS grammar: grouped inset lists, large titles,
   hairline separators, no drop shadows. Depth comes from surface colour. */

/* ============ Navigation bar ============ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: var(--safe-top);
  background: var(--nav);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid transparent;
  transition: border-color 0.2s ease;
}
.navbar.scrolled { border-bottom-color: var(--hairline); }

.navbar-inner {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
}
.navbar-title {
  flex: 1;
  text-align: center;
  font-size: 1em;
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.navbar.scrolled .navbar-title { opacity: 1; transform: none; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  justify-content: center;
  border-radius: 8px;
  font-size: 1em;
  color: var(--text);
  transition: opacity 0.15s ease, background 0.15s ease;
}
.nav-btn:active { opacity: 0.4; }
.nav-btn.icon-only { padding: 0; }
.nav-btn .icon { width: 22px; height: 22px; }

.title-block {
  padding: 4px 20px 8px;
}
.title-block .large-title { margin-bottom: 2px; }

/* ============ Grouped sections ============ */
.section { margin: 0 0 26px; }
.section-header {
  padding: 0 20px 7px;
  font-size: 0.78em;
  font-weight: 400;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.section-footer {
  padding: 7px 20px 0;
  font-size: 0.78em;
  color: var(--text-2);
  line-height: 1.4;
}

.group {
  background: var(--surface);
  border-radius: var(--radius);
  margin: 0 16px;
  overflow: hidden;
}

/* ============ Rows ============ */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 11px 16px;
  position: relative;
  width: 100%;
  text-align: left;
  background: var(--surface);
  color: var(--text);
  transition: background 0.12s ease;
}
.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 0.5px;
  background: var(--separator);
}
.row.has-leading + .row.has-leading::before { left: 52px; }
button.row:active, .row.tappable:active { background: var(--pressed); }

.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-size: 1em; }
.row-sub { font-size: 0.8em; color: var(--text-2); }
.row-value { color: var(--text-2); font-size: 1em; flex-shrink: 0; }

.row-leading {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--fill);
}
.row-leading .icon { width: 17px; height: 17px; }

.chevron { color: var(--text-3); flex-shrink: 0; }
.chevron .icon { width: 15px; height: 15px; }

.row.destructive .row-title { color: var(--destructive); }
.row.centered { justify-content: center; }
.row.centered .row-title { color: var(--accent); font-weight: 500; }

/* ============ Checkbox ============ */
.check {
  width: 25px;
  height: 25px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.6px solid var(--text-3);
  display: grid;
  place-items: center;
  background: transparent;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.check .icon { width: 14px; height: 14px; color: var(--on-accent); opacity: 0; transform: scale(0.6); transition: opacity 0.16s ease, transform 0.16s ease; }
.check.on { background: var(--accent); border-color: var(--accent); }
.check.on .icon { opacity: 1; transform: none; }
.check:active { transform: scale(0.88); }

.row.done .row-title { color: var(--text-3); text-decoration: line-through; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: var(--radius);
  font-size: 1em;
  font-weight: 600;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.btn:active { opacity: 0.75; transform: scale(0.985); }
.btn:disabled { opacity: 0.32; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-secondary { background: var(--fill); color: var(--text); }
.btn-plain { color: var(--text); font-weight: 500; min-height: 44px; }
.btn-danger { background: var(--fill); color: var(--destructive); }
.btn-block { display: flex; width: 100%; }

/* ============ Tab bar ============ */
/* A floating pill rather than a full-width bar — it reads lighter and
   lets the content run underneath it. */
.tabbar {
  display: flex;
  flex-shrink: 0;
  position: relative;
  margin: 0 12px calc(10px + var(--safe-bottom));
  border-radius: 30px;
  overflow: hidden;
  background: var(--nav);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border: 0.5px solid var(--card-edge);
  box-shadow: var(--lift-2);
  z-index: 30;
}

/* The glass bubble that slides between tabs. Layered translucency plus a
   specular highlight — that combination is what reads as glass rather
   than as a grey rectangle. */
.tab-pill {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(var(--tabbar-h) - 8px);
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.75) 0%, rgba(255,255,255,0.25) 46%, rgba(255,255,255,0.10) 100%),
    rgba(120,120,128,0.14);
  -webkit-backdrop-filter: blur(14px) saturate(190%);
  backdrop-filter: blur(14px) saturate(190%);
  box-shadow:
    inset 0 0.5px 0 rgba(255,255,255,0.95),
    inset 0 -0.5px 0 rgba(255,255,255,0.35),
    0 1px 2px rgba(0,0,0,0.06),
    0 4px 12px rgba(0,0,0,0.055);
  transition:
    transform 0.52s cubic-bezier(0.32, 1.32, 0.42, 1),
    width 0.52s cubic-bezier(0.32, 1.32, 0.42, 1);
  will-change: transform, width;
}
.tab-pill.instant { transition: none; }

:root[data-appearance="dark"] .tab-pill {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.06) 48%, rgba(255,255,255,0.02) 100%),
    rgba(120,120,128,0.22);
  box-shadow:
    inset 0 0.5px 0 rgba(255,255,255,0.22),
    inset 0 -0.5px 0 rgba(255,255,255,0.06),
    0 2px 10px rgba(0,0,0,0.4);
}

.tab {
  flex: 1;
  height: var(--tabbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-3);
  position: relative;
  z-index: 1;
  transition: color 0.32s ease;
}
.tab .icon { width: 25px; height: 25px; }
.tab span { font-size: 10px; letter-spacing: 0; font-weight: 500; }
.tab.active { color: var(--text); }
.tab:active { opacity: 0.6; }

/* ============ Sheets ============ */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  /* Invisible without .in, so it must not take taps without .in either.
     A backdrop whose removal timer never fired — iOS suspends timers in a
     standalone app — would otherwise sit unseen over everything and swallow
     every tap. */
  pointer-events: none;
  transition: opacity 0.28s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-backdrop.in { opacity: 1; pointer-events: auto; }

.sheet {
  width: 100%;
  max-width: 780px;
  max-height: 92%;
  background: var(--bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding-bottom: var(--safe-bottom);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}
.sheet-backdrop.in .sheet { transform: none; }

.sheet-head {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 12px;
  border-bottom: 0.5px solid var(--hairline);
  flex-shrink: 0;
}
.sheet-head .headline { flex: 1; text-align: center; }
.sheet-head .nav-btn { flex-shrink: 0; }
.sheet-head .nav-btn.confirm { font-weight: 600; }
.sheet-body { overflow-y: auto; padding: 20px 0 24px; }

/* Centred dialog (confirmations) */
.dialog-backdrop { align-items: center; padding: 24px; }
.dialog {
  width: 100%;
  max-width: 300px;
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.sheet-backdrop.in .dialog { transform: none; opacity: 1; }
.dialog-body { padding: 20px 18px 16px; text-align: center; }
.dialog-body .headline { margin-bottom: 5px; }
.dialog-actions { display: flex; border-top: 0.5px solid var(--hairline); }
.dialog-actions button {
  flex: 1;
  min-height: 46px;
  font-size: 1em;
  color: var(--text);
  transition: background 0.12s ease;
}
.dialog-actions button:active { background: var(--pressed); }
.dialog-actions button + button { border-left: 0.5px solid var(--hairline); }
.dialog-actions .confirm { font-weight: 600; }
.dialog-actions .danger { color: var(--destructive); font-weight: 600; }

/* ============ Fields ============ */
.field { padding: 0 16px; margin-bottom: 14px; }
.field-label {
  display: block;
  padding: 0 4px 6px;
  font-size: 0.78em;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.input, .textarea, .select {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 13px 16px;
  font-size: 1em;
  color: var(--text);
  border: 1.5px solid transparent;
  transition: border-color 0.15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--text-3); outline: none; }
.textarea { min-height: 92px; resize: none; line-height: 1.45; }
.select {
  background-image: none;
  cursor: pointer;
  padding-right: 40px;
}

.input-inline {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0;
  font-size: 1em;
}

/* Segmented control */
.segmented {
  display: flex;
  background: var(--fill);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
  margin: 0 16px;
}
.segmented button {
  flex: 1;
  min-height: 32px;
  border-radius: 7px;
  font-size: 0.82em;
  font-weight: 500;
  color: var(--text);
  transition: background 0.18s ease;
}
.segmented button.active { background: var(--surface); font-weight: 600; }

/* Toggle */
.toggle {
  width: 51px;
  height: 31px;
  border-radius: 16px;
  background: var(--fill-strong);
  padding: 2px;
  flex-shrink: 0;
  transition: background 0.22s ease;
  display: flex;
}
.toggle .knob {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle.on { background: var(--accent); }
.toggle.on .knob { transform: translateX(20px); }
:root[data-appearance="dark"] .toggle.on .knob { background: #000; }

/* Chips (member pickers, filters) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px; }
.chip {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--fill);
  font-size: 0.88em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}
.chip.on { background: var(--accent); color: var(--on-accent); }

/* Avatar */
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--fill-strong);
  display: grid;
  place-items: center;
  font-size: 0.75em;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
  letter-spacing: 0;
}
.avatar.lg { width: 76px; height: 76px; font-size: 1.5em; }
.avatar.has-photo { background: var(--fill); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ============ Empty state ============ */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 54px 40px;
  text-align: center;
}
.empty .icon { width: 34px; height: 34px; color: var(--text-3); }
.empty .headline { color: var(--text); }
.empty p { color: var(--text-2); font-size: 0.88em; line-height: 1.45; max-width: 260px; }
.empty .btn { margin-top: 6px; }

/* ============ Calendar ============ */
.cal-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 12px 6px;
}
.cal-head span {
  text-align: center;
  font-size: 0.68em;
  color: var(--text-2);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 12px;
  gap: 1px 0;
}
.cal-day {
  aspect-ratio: 1 / 1;
  max-height: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 50%;
  font-size: 0.94em;
  color: var(--text);
  position: relative;
  transition: background 0.14s ease;
}
.cal-day.dim { color: var(--text-3); }
.cal-day.today { font-weight: 700; }
.cal-day.selected { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.cal-day .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-2);
  position: absolute;
  bottom: 5px;
}
.cal-day.selected .dot { background: var(--on-accent); }

/* Progress meter */
.meter { height: 4px; border-radius: 2px; background: var(--fill-strong); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.35s ease; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 20px);
  transform: translate(-50%, 12px);
  background: var(--accent);
  color: var(--on-accent);
  padding: 11px 18px;
  border-radius: 22px;
  font-size: 0.86em;
  font-weight: 500;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
  max-width: 84%;
  text-align: center;
}
.toast.in { opacity: 1; transform: translate(-50%, 0); }

.icon { width: 20px; height: 20px; display: block; flex-shrink: 0; }

/* ============ Product artwork ============ */

/* Drawn on the device, not a photograph — see js/items.js for why. */
.tile {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  background: var(--surface-sunk);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.tile .icon { width: 25px; height: 25px; opacity: 0.9; }
.tile.lg { width: 84px; height: 84px; border-radius: 18px; }
.tile.lg .icon { width: 44px; height: 44px; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }

.row.has-tile + .row.has-tile::before { left: 74px; }

/* Live preview under the "add an item" box */
.preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 16px 0;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  transition: max-height 0.36s var(--ease-out), opacity 0.28s var(--ease-out),
              padding 0.36s var(--ease-out);
}
.preview.in { max-height: 390px; opacity: 1; padding-top: 14px; padding-bottom: 14px; }
.preview .preview-main { min-width: 0; flex: 1; }
.preview .preview-cat { font-size: 0.8em; color: var(--text-2); margin-bottom: 5px; }
.preview .preview-name { font-weight: 600; margin-bottom: 7px; }

.web-price-line { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--text-2); }
.web-price-line .icon { width: 16px; height: 16px; flex-shrink: 0; }
.web-price-line span { min-width: 0; }
.web-price-line b, .web-price-line i { display: block; }
.web-price-line b { color: var(--text); font-size: .7em; font-weight: 600; }
.web-price-line i { margin-top: 1px; overflow: hidden; font-size: .66em; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.web-price-line.loading .icon { animation: syrix-pulse 1.2s ease-in-out infinite; }
.web-price-strip { display: flex; gap: 6px; margin-top: 7px; overflow-x: auto; scrollbar-width: none; }
.web-price-strip::-webkit-scrollbar { display: none; }
.web-price-strip a { display: flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 6px 9px; border-radius: 10px; background: var(--fill); color: var(--text); font-size: .68em; }
.web-price-strip a:active { transform: scale(.97); }
.web-price-strip b { font-weight: 500; color: var(--text-2); }
.web-price-strip span { font-weight: 650; }
.web-price-caveat { display: block; margin-top: 6px; color: var(--text-3); font-size: .6em; line-height: 1.35; }

@media (prefers-reduced-motion: reduce) {
  .web-price-line.loading .icon { animation: none; }
}

.shops { display: flex; flex-wrap: wrap; gap: 5px; }
.shop-chip {
  font-size: 0.72em;
  padding: 4px 9px;
  border-radius: 11px;
  background: var(--fill);
  color: var(--text-2);
  white-space: nowrap;
}

/* ============ Member strip ============ */

.member-strip {
  display: flex;
  gap: 10px;
  padding: 2px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.member-strip::-webkit-scrollbar { display: none; }

.member-card {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 16px 8px 18px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 0.5px solid var(--card-edge);
  color: var(--text);
  text-align: center;
}
.member-card b { font-size: 0.86em; font-weight: 600; letter-spacing: -0.01em; }
.member-card small { font-size: 0.72em; color: var(--text-2); }
.member-card .avatar {
  width: 54px;
  height: 54px;
  font-size: 0.92em;
  box-shadow: 0 0 0 1px var(--card-edge), 0 0 0 4px var(--card);
}
.member-card.on { border-color: var(--text-3); }
.member-card.on .avatar { box-shadow: 0 0 0 1.5px var(--text-2), 0 0 0 5px var(--card); }

/* The underline marking whose device this is */
.member-card.on::after {
  content: "";
  position: absolute;
  bottom: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 2px;
  border-radius: 1px;
  background: var(--text);
}

/* ============ Person page ============ */

.person-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px 20px 22px;
  text-align: center;
}
.person-head .name { font-size: 1.5em; font-weight: 700; letter-spacing: -0.022em; }
.person-head .meta { color: var(--text-2); font-size: 0.88em; }

.stat-row { display: flex; gap: 10px; padding: 0 16px 4px; }
.stat {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
}
.stat b { display: block; font-size: 1.5em; font-weight: 700; letter-spacing: -0.02em; }
.stat small { font-size: 0.7em; color: var(--text-2); }

/* ============ Map ============ */

.map-wrap {
  margin: 0 16px 14px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  position: relative;
  box-shadow: var(--lift-2), var(--edge);
}
.map-canvas { display: block; width: 100%; height: auto; }

.map-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-top: 0.5px solid var(--separator);
  font-size: 0.74em;
  color: var(--text-2);
}

.map-note {
  margin: 0 16px 20px;
  padding: 13px 15px;
  border-radius: var(--radius);
  background: var(--fill);
  font-size: 0.78em;
  color: var(--text-2);
  line-height: 1.5;
  display: flex;
  gap: 10px;
}
.map-note .icon { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }

.dot-live {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  flex-shrink: 0;
}

/* ============ Family Hub grid (Today) ============ */

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 16px 4px;
}
.quick {
  position: relative;
  background: var(--card);
  border: 0.5px solid var(--card-edge);
  border-radius: var(--radius-lg);
  padding: 15px 13px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  color: var(--text);
  text-align: left;
  min-height: 108px;
}
.quick .icon { width: 22px; height: 22px; color: var(--text); }
.quick b { font-size: 0.92em; font-weight: 600; letter-spacing: -0.01em; }
.quick small { font-size: 0.72em; color: var(--text-2); line-height: 1.25; }
.quick .stack-tight { display: flex; flex-direction: column; gap: 3px; }
.quick .badge {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  background: var(--fill-strong);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
  padding: 0 7px;
}

/* ============ Home header ============ */

.home-head { padding: 8px 20px 20px; }
.home-head-row { display: flex; align-items: flex-start; gap: 12px; }
.home-head-row .large-title { flex: 1; }

.bell {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0.5px solid var(--card-edge);
  background: var(--card);
  display: grid;
  place-items: center;
  color: var(--text);
  flex-shrink: 0;
  position: relative;
  margin-top: 2px;
}
.bell .icon { width: 20px; height: 20px; }
.bell:active { background: var(--pressed); }
.bell-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--destructive);
  border: 1.5px solid var(--card);
}

.home-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  color: var(--text-2);
  font-size: 0.86em;
}
.home-meta .icon { width: 17px; height: 17px; flex-shrink: 0; }

/* ============ Overview card ============ */

.overview {
  margin: 0 16px;
  background: var(--card);
  border: 0.5px solid var(--card-edge);
  border-radius: var(--radius-lg);
  padding: 18px 16px 6px;
}
.overview-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.overview-head .icon { width: 21px; height: 21px; margin-top: 2px; color: var(--text-2); }
.overview-head .stack-tight { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.overview-head b { font-size: 1.06em; font-weight: 600; letter-spacing: -0.015em; }
.overview-head small { font-size: 0.78em; color: var(--text-2); }

.pill-btn {
  padding: 8px 15px;
  border-radius: 20px;
  border: 0.5px solid var(--separator);
  font-size: 0.8em;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  flex-shrink: 0;
}
.pill-btn:active { background: var(--pressed); }

.overview-stats { display: flex; align-items: stretch; }
.ov-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0 4px 18px;
  min-width: 0;
}
.ov-stat + .ov-stat { border-left: 0.5px solid var(--separator); padding-left: 16px; }
.ov-box {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 0.5px solid var(--card-edge);
  display: grid;
  place-items: center;
  background: var(--fill);
}
.ov-box .icon { width: 19px; height: 19px; }
.ov-num { font-size: 1.55em; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.ov-label { font-size: 0.8em; }
.ov-sub { font-size: 0.72em; color: var(--text-2); }

/* ============ Wide card (a list at a glance) ============ */

.wide-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 16px;
  padding: 16px;
  background: var(--card);
  border: 0.5px solid var(--card-edge);
  border-radius: var(--radius-lg);
  color: var(--text);
  text-align: left;
  width: calc(100% - 32px);
}
.wide-card .round-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--fill);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.wide-card .round-icon .icon { width: 21px; height: 21px; }
.wide-card .wide-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wide-card .wide-main b { font-size: 1.02em; font-weight: 600; letter-spacing: -0.015em; }
.wide-card .wide-main small { font-size: 0.8em; color: var(--text-2); line-height: 1.35; }
.wide-card .count-pill {
  padding: 7px 13px;
  border-radius: 16px;
  border: 0.5px solid var(--separator);
  font-size: 0.76em;
  color: var(--text-2);
  flex-shrink: 0;
}
.wide-card .chevron { margin-left: 2px; }

/* ============ Weather ============ */

.weather-line {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 20px 14px;
  color: var(--text-2);
  font-size: 0.84em;
}
.weather-line .icon { width: 18px; height: 18px; }
.weather-line b { color: var(--text); font-weight: 600; }

/* ============ Chat ============ */

.chat-pad { padding-bottom: 0; display: flex; flex-direction: column; min-height: 100%; }

.thread { padding: 4px 16px 14px; flex: 1; }

.thread-day {
  text-align: center;
  font-size: 0.7em;
  color: var(--text-2);
  margin: 16px 0 12px;
  letter-spacing: 0.02em;
}

.bubble-row { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 3px; }
.bubble-row.mine { align-items: flex-end; }

.bubble-name {
  font-size: 0.68em;
  color: var(--text-2);
  padding: 6px 12px 3px;
  font-weight: 600;
}

.bubble {
  max-width: 78%;
  background: var(--surface);
  border-radius: 19px;
  padding: 9px 13px 8px;
  position: relative;
  font-size: 0.96em;
  line-height: 1.36;
  overflow: hidden;
  box-shadow: var(--lift-1);
}
.bubble-row.mine .bubble {
  background: var(--accent);
  color: var(--on-accent);
}

.bubble-text { white-space: pre-wrap; word-break: break-word; }

.bubble-time {
  font-size: 0.62em;
  opacity: 0.5;
  margin-left: 8px;
  float: right;
  position: relative;
  top: 6px;
}

.bubble-photo {
  display: block;
  width: 100%;
  max-width: 240px;
  border-radius: 12px;
  margin: -3px 0 5px;
}

/* A floating pill, matching the tab bar below it. */
.composer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 16px 10px;
  padding: 8px;
  border-radius: 32px;
  background: var(--card);
  border: 0.5px solid var(--card-edge);
  box-shadow: var(--lift-2);
}
.composer-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  background: var(--fill);
  border: 0.5px solid var(--card-edge);
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 0.96em;
}
.composer-input:focus { border-color: var(--text-3); }

.composer-btn, .composer-send {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--text);
  background: var(--fill);
  border: 0.5px solid var(--card-edge);
}
.composer-send {
  background: var(--text);
  color: var(--bg);
  border-color: transparent;
}
.composer-btn:active, .composer-send:active { opacity: 0.6; transform: scale(0.94); }

/* ============ Add bar ============ */

/* Big, obvious, and the button genuinely adds — it is not decoration. */
.add-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px;
  padding: 7px 7px 7px 14px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--lift-1), var(--edge);
}
.add-input {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  background: transparent;
  border: none;
  font-size: 1em;
}
.add-input::placeholder { color: var(--text-3); }

.add-cam {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--fill);
  color: var(--text);
  flex-shrink: 0;
}
.add-cam:active { background: var(--fill-strong); }

.add-go {
  min-height: 38px;
  padding: 0 17px;
  border-radius: 10px;
  background: var(--fill);
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.92em;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}
.add-go.ready { background: var(--accent); color: var(--on-accent); }
.add-go:active { transform: scale(0.95); }

/* ============ Price strip (live, while typing) ============ */

.price-strip {
  display: flex;
  gap: 7px;
  margin-top: 9px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.price-strip::-webkit-scrollbar { display: none; }

.price-pill {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 11px;
  border-radius: 11px;
  background: var(--fill);
  min-width: 70px;
}
.price-pill b { font-size: 0.66em; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.price-pill span { font-size: 0.92em; font-weight: 600; letter-spacing: -0.02em; }
.price-pill i { font-size: 0.6em; font-style: normal; color: var(--text-2); }
.price-pill.best { background: var(--accent); }
.price-pill.best b, .price-pill.best span, .price-pill.best i { color: var(--on-accent); }
.price-pill.best b, .price-pill.best i { opacity: 0.7; }

/* The price button on every list row — the way into the comparison. */
.price-tag {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 58px;
  padding: 6px 9px;
  border-radius: 11px;
  border: 0.5px dashed var(--separator);
  color: var(--text-2);
  flex-shrink: 0;
}
.price-tag b { font-size: 0.86em; font-weight: 600; letter-spacing: -0.02em; display: flex; }
.price-tag b .icon { width: 15px; height: 15px; }
.price-tag i { font-size: 0.6em; font-style: normal; }
.price-tag.known { border-style: solid; border-color: transparent; background: var(--fill); color: var(--text); }
.price-tag.known i { color: var(--text-2); }
.price-tag:active { background: var(--fill-strong); }

/* ============ Price comparison ============ */

.price-row { gap: 8px; }
.price-row.best .row-title { font-weight: 600; }

.price-set {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--fill);
  color: var(--text);
  font-size: 0.85em;
  font-weight: 600;
  flex-shrink: 0;
}
.price-row.best .price-set { background: var(--accent); color: var(--on-accent); }
.price-set:active { opacity: 0.6; }

.price-link {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  flex-shrink: 0;
  border-radius: 8px;
}
.price-link:active { background: var(--pressed); }

/* ============ Calories ============ */

.kcal-card {
  margin: 0 16px;
  padding: 20px 18px 16px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--lift-1), var(--edge);
  text-align: center;
}
.kcal-big {
  font-size: 2.2em;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.kcal-big small {
  font-size: 0.4em;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0;
}

/* ============ Lock screen ============ */

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  display: grid;
  place-items: center;
  padding: 24px;
  transition: opacity 0.3s ease;
}
.lock-screen.out { opacity: 0; pointer-events: none; }
.lock-screen.working { opacity: 0.55; pointer-events: none; }

.lock-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  text-align: center;
}
.lock-mark {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 0.5px solid var(--card-edge);
  background: var(--card);
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}
.lock-mark .icon { width: 27px; height: 27px; }

.lock-input {
  width: 100%;
  max-width: 280px;
  min-height: 52px;
  text-align: center;
  font-size: 1.3em;
  letter-spacing: 0.35em;
  background: var(--surface);
  border: 1.5px solid var(--separator);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 8px;
}
.lock-input:focus { border-color: var(--text-3); }

.lock-error { color: var(--destructive); min-height: 18px; }

@keyframes lock-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}
.lock-screen.shake .lock-inner { animation: lock-shake 0.48s both; }

:root[data-locked="yes"] #root { visibility: hidden; }

/* ============ Credit ============ */

.credit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  padding: 30px 30px 10px;
  color: var(--text-3);
  font-size: 0.74em;
  line-height: 1.6;
}
.credit .brand-mark { color: var(--text-3); margin-bottom: 10px; }
.credit b { display: block; color: var(--text-2); font-weight: 600; margin-bottom: 3px; }
.credit a { color: var(--text-2); text-decoration: none; border-bottom: 0.5px solid var(--text-3); }

/* A festival that hasn't been date-checked yet */
.needs-check {
  font-size: 0.62em;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--fill);
  color: var(--text-2);
  white-space: nowrap;
}
