/* AprèsSchool styles. Loaded by index.html. */
/* ── Tokens ── */
:root {
  --gold:        #C8960C;
  --gold-dark:   #A67C00;
  --gold-light:  #FFF8E1;
  --gold-mid:    #F5D96B;
  --green:       #3B6E32;
  --green-dark:  #2A5122;
  --green-light: #EAF4E8;
  --green-mid:   #7DC471;
  --orange:      #E8640A;
  --orange-light:#FFF0E6;

  /* Light sidebar: warm beige with dark green text */
  --sidebar-bg:          #EDE8DC;
  --sidebar-text:        #2A4A20;
  --sidebar-active-text: #1A2E12;
  --sidebar-active-bg:   rgba(58,110,50,0.12);
  --sidebar-hover-bg:    rgba(58,110,50,0.07);
  --sidebar-border:      #D8D2C4;
  --sidebar-logo-border: #CEC8BA;

  --bg:            #FAFAF8;
  --surface:       #FFFFFF;
  --surface-2:     #F4F2EC;
  --border:        #E4E0D6;
  --border-subtle: #EDE9E2;

  --text-primary:   #1A1A12;
  --text-secondary: #4E4C3C;
  --text-muted:     #8A8672;

  --accent:       #E8640A;
  --accent-light: #FFF0E6;

  --cal-today:          #C8960C;
  --cal-event:          #3B6E32;
  --cal-event-text:     #FFFFFF;
  --cal-event-dim:      #E4E0D6;
  --cal-event-dim-text: #AAA490;

  --tab-active-border: #C8960C;
  --tab-active-text:   #7A5800;

  --tag-bg:   #EAF4E8;
  --tag-text: #2A5122;

  --chat-header:      #2A4A20;
  --chat-header-text: #D4E8C8;
  --chat-bg:          #FFFFFF;
  --chat-border:      #E4E0D6;

  /* weekly calendar */
  --cal-week-time-w: 52px;
  --cal-hour-h:      52px;

  color-scheme: light;
}


/* ── Reset ── */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Inter', system-ui, sans-serif; font-size: 14px; background: var(--bg); color: var(--text-primary); }

/* ── App shell ── */
.app { display: flex; height: 100%; overflow: hidden; }

/* ── Sidebar ── */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: 24px;
  border-right: 1px solid var(--sidebar-border);
}
.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--sidebar-logo-border);
  margin-bottom: 10px;
  line-height: 1;
}
.logo-apres  { font-size: 19px; font-weight: 800; color: var(--gold-dark);  letter-spacing: -0.5px; }
.logo-school { font-size: 19px; font-weight: 800; color: var(--green);      letter-spacing: -0.5px; }

.sidebar-nav { list-style: none; padding: 0 8px; }
.sidebar-nav li a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 7px;
  color: var(--sidebar-text);
  text-decoration: none; font-size: 13px; font-weight: 500;
  transition: background 0.12s, color 0.12s; cursor: pointer;
}
.sidebar-nav li a:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-active-text); }
.sidebar-nav li.active a { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600; }
.nav-icon { width: 17px; text-align: center; font-size: 14px; opacity: 0.75; }
.sidebar-nav li.active .nav-icon { opacity: 1; }

.sidebar-user {
  margin-top: auto; padding: 12px 14px 0;
  display: flex; align-items: center; gap: 9px;
  color: var(--sidebar-text); font-size: 12px;
}
.sidebar-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--green-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0;
}

/* ── Main ── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ── Page header ── */
.page-header {
  padding: 14px 24px 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.page-header-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.page-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }

.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 6px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text-secondary);
  font-family: inherit; transition: background 0.1s;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn-primary:hover { background: var(--green-dark); }
.btn-orange { background: var(--orange); color: #fff; border-color: var(--orange); }
.btn-orange:hover { opacity: 0.9; }

/* Tab bar */
.tab-bar { display: flex; }
.tab {
  padding: 8px 14px 10px; font-size: 12.5px; font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2.5px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: color 0.12s, border-color 0.12s; user-select: none;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--tab-active-text); border-bottom-color: var(--tab-active-border); font-weight: 600; }

/* ── Main body ── */
.main-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; background: var(--bg); }

/* ── Calendar (weekly) ── */
.calendar-section {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex; flex-direction: column;
}
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav-btn {
  width: 22px; height: 22px; border-radius: 5px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-family: inherit;
}
.cal-nav-btn:hover { background: var(--surface-2); }
.cal-view-btns { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.cal-view-btn {
  padding: 3px 10px; font-size: 11.5px; font-weight: 500;
  color: var(--text-secondary); background: var(--surface);
  cursor: pointer; border: none; border-right: 1px solid var(--border); font-family: inherit;
}
.cal-view-btn:last-child { border-right: none; }
.cal-view-btn.active { background: var(--surface-2); color: var(--text-primary); font-weight: 600; }
.cal-today-btn:disabled { opacity: .5; cursor: default; background: var(--surface); }
.cal-today-btn { padding: 3px 11px; font-size: 11.5px; height: 24px; margin-right: 4px; }
.cal-range-wrap { position: relative; margin-left: 6px; }
.cal-range-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 13.5px 'Inter', system-ui, sans-serif; color: var(--text-primary);
  background: none; border: 1px solid transparent; border-radius: 6px;
  padding: 3px 8px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.cal-range-btn:hover, .cal-range-btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--border); }
.cal-range-btn svg { color: var(--text-muted); transition: transform .15s; }
.cal-range-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.mini-cal {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 244px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(30,40,20,.16); padding: 10px 10px 8px;
}
.mc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mc-title { font-size: 13px; font-weight: 700; }
.mc-arrows { display: flex; gap: 2px; }
.mc-arrow {
  width: 26px; height: 26px; border: none; background: none; border-radius: 50%;
  font-size: 15px; color: var(--text-secondary); cursor: pointer;
}
.mc-arrow:hover { background: var(--surface-2); }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.mc-dow { font-size: 10px; font-weight: 600; color: var(--text-muted); text-align: center; padding: 4px 0; }
.mc-day {
  height: 30px; border: none; background: none; font: 500 12px 'Inter', system-ui, sans-serif;
  color: var(--text-primary); cursor: pointer; border-radius: 50%; position: relative;
  font-variant-numeric: tabular-nums;
}
.mc-day:hover { background: var(--surface-2); }
.mc-day.out { color: var(--text-muted); opacity: .55; }
.mc-day.in-range { background: var(--green-light); border-radius: 0; }
.mc-day.in-range.range-start { border-radius: 15px 0 0 15px; }
.mc-day.in-range.range-end   { border-radius: 0 15px 15px 0; }
.mc-day.selected { background: var(--green); color: #fff; font-weight: 700; border-radius: 50%; }
.mc-day.today:not(.selected) { color: var(--gold-dark); font-weight: 800; }
.mc-day.today::after {
  content: ''; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px;
  margin-left: -2px; border-radius: 50%; background: var(--gold);
}
.mc-day.has-ev::before {
  content: ''; position: absolute; right: 5px; top: 5px; width: 4px; height: 4px;
  border-radius: 50%; background: var(--orange); opacity: .8;
}
.mc-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border-subtle); margin-top: 6px; padding-top: 7px; }
.mc-link { background: none; border: none; font: 600 11.5px 'Inter', system-ui, sans-serif; color: var(--green); cursor: pointer; padding: 3px 4px; }
.mc-link:hover { text-decoration: underline; }
.mc-legend { font-size: 10px; color: var(--text-muted); }
.cal-cell .cal-date { cursor: pointer; }
.cal-cell .cal-date:hover { background: var(--surface-2); }

/* Weekly grid */
.week-grid {
  display: flex; overflow: hidden;
  height: 200px;
}
.week-time-col {
  width: var(--cal-week-time-w); flex-shrink: 0;
  border-right: 1px solid var(--border-subtle);
  overflow: hidden; position: relative;
}
.week-days-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
.week-days-inner {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  position: relative;
}
.week-day-header-row {
  display: grid;
  grid-template-columns: var(--cal-week-time-w) repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.week-day-header {
  padding: 5px 4px;
  text-align: center; font-size: 10.5px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em;
}
.week-day-header span { display: block; font-size: 16px; font-weight: 700; color: var(--text-primary); line-height: 1.2; margin-top: 1px; }
.week-day-header.today span { color: var(--cal-today); }
.week-day-header-corner { width: var(--cal-week-time-w); }

#cal-container { height: var(--cal-h, 200px); display: flex; flex-direction: column; overflow: hidden; }
.week-body { display: flex; overflow-y: auto; flex: 1; min-height: 0; }
.month-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 12px 6px; }
.cal-resizer {
  height: 11px; display: flex; align-items: center; justify-content: center;
  cursor: row-resize; touch-action: none; border-top: 1px solid var(--border-subtle);
  background: var(--surface); outline: none;
}
.cal-resizer span { width: 36px; height: 4px; border-radius: 2px; background: var(--border); transition: background .15s, width .15s; }
.cal-resizer:hover span, .cal-resizer:focus-visible span, .cal-resizer.dragging span { background: var(--green-mid); width: 48px; }
body.resizing, body.resizing * { cursor: row-resize !important; user-select: none; }
.week-time-labels { width: var(--cal-week-time-w); flex-shrink: 0; }
.week-time-label {
  height: var(--cal-hour-h); font-size: 10px; font-weight: 500;
  color: var(--text-muted); text-align: right;
  padding: 0 8px 0 0; position: relative; top: -6px;
  border-right: 1px solid var(--border-subtle);
}
.week-columns { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); }
.week-col { border-right: 1px solid var(--border-subtle); position: relative; }
.week-col:last-child { border-right: none; }
.hour-line {
  position: absolute; left: 0; right: 0;
  border-top: 1px solid var(--border-subtle);
}
.week-event {
  position: absolute; left: 2px; right: 2px;
  border-radius: 4px; padding: 2px 5px;
  font-size: 9.5px; font-weight: 600;
  background: var(--cal-event); color: #fff;
  overflow: hidden; cursor: pointer;
  transition: opacity 0.15s;
}
.week-event.orange { background: var(--orange); }
.week-event.gold   { background: var(--gold); }
.week-event.purple { background: #7C3AED; }
.week-event.teal   { background: #2A9D8F; }
.week-event.dim {
  background: var(--cal-event-dim);
  color: var(--cal-event-dim-text);
  filter: grayscale(1); opacity: 0.5;
}
/* Imported from an external calendar: kept in the owner's color (unlike .dim,
   which desaturates) but visibly translucent/textured so it never reads as a
   real, editable AprèsSchool event. */
.week-event.takeout { background: #B45309; }
.week-event.imported, .cal-event.imported {
  opacity: .55;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.4) 0 4px, transparent 4px 9px);
}
.week-event.imported:hover { opacity: .8; filter: none; }
.week-event-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-event-time  { font-size: 8.5px; opacity: 0.8; font-weight: 400; }

/* ── Scrollable content area ── */
.content-scroll { flex: 1; overflow-y: auto; }
.page-content { display: none; }
.page-content.active { display: block; }

/* ── Content sections ── */
.content-section { padding: 18px 24px; }

/* ── Forms ── */
.account-form { max-width: 500px; }
.form-row { margin-bottom: 14px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.form-label { display: block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 5px; }
.form-input {
  width: 100%; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface); color: var(--text-primary);
  font-size: 13px; font-family: inherit;
  outline: none; transition: border-color 0.12s;
}
.form-input:focus { border-color: var(--gold); }
select.form-input { appearance: auto; }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.section-heading { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 12px; }

.pref-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}
.pref-row:last-child { border-bottom: none; }
.pref-label { font-size: 13px; }
.pref-sublabel { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.pref-row-col { display: flex; flex-direction: column; }
.pill {
  font-size: 10.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
  white-space: nowrap;
}
.pill.full   { background: var(--green-light); color: var(--green-dark); }
.pill.view   { background: var(--gold-light);  color: var(--gold-dark); }
.pill.none   { background: var(--surface-2);   color: var(--text-muted); border: 1px solid var(--border); }
.pill.orange { background: var(--orange-light); color: var(--orange); }

/* Connection cards */
.connections-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 12px; }
.conn-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.conn-card-top { display: flex; align-items: center; gap: 10px; }
.conn-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.conn-name { font-size: 13px; font-weight: 600; }
.conn-desc { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.conn-status { display: flex; align-items: center; justify-content: space-between; }
.conn-connected { font-size: 11px; color: var(--green); font-weight: 600; }
.conn-unconnected { font-size: 11px; color: var(--text-muted); }
.conn-warn { font-size: 11px; color: var(--orange); font-weight: 600; }
/* Families: sidebar picker, limited-access notice, access section on a person's card */
.family-row { display: flex; flex-direction: column; gap: 3px; padding: 0 2px; }
.family-label { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.family-name-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12.5px; font-weight: 600; min-width: 0; }
.family-name-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.family-select { width: 100%; font: 600 12.5px 'Inter', system-ui, sans-serif; padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 11.5px; color: var(--green-dark); text-decoration: underline; cursor: pointer; flex-shrink: 0; }
.access-note { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: var(--gold-light); color: var(--gold-dark); font-size: 12.5px; line-height: 1.45; }
.access-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; font-size: 12.5px; }
.access-grid select { justify-self: start; }
.access-who { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 8px; }
.access-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.invite-link { display: flex; gap: 6px; margin-top: 8px; }
.invite-link input { flex: 1; min-width: 0; font-size: 12px; }
.invite-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.invite-card ul { margin: 6px 0 12px; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.orders-top { margin-bottom: 16px; }
.orders-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.orders-email-note { font-size: 12.5px; color: var(--text-muted); }
.orders-email-note b { color: var(--text-secondary); font-weight: 600; }
.orders-drag-note { margin: 10px 0 0; font-size: 12.5px; color: var(--text-muted); }
.billing-empty { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; padding: 6px 0 2px; }
.warn-text { color: var(--orange); font-weight: 600; }
.gcal-card { grid-column: 1 / -1; }
.gcal-card .conn-status { flex-wrap: wrap; gap: 8px; }
.gcal-card .conn-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.gcal-note { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }

/* ── People page ──
   Flexbox, not grid: a sticky child's "don't scroll past me" boundary is the
   grid AREA in CSS Grid (the full row height, ignoring align-self) but the
   actual shrunk box in Flexbox — grid made the sidebar drift near the bottom
   of a long detail panel instead of staying properly pinned. */
.people-layout { display: flex; gap: 18px; align-items: flex-start; }
/* Account pages are settings, not scheduling: no calendar there */
body[data-page="account"] .calendar-section, body[data-page="account"] .cal-resizer { display: none; }
/* People: on phones, a dropdown replaces the list (see the 640px block) */
.people-select { display: none; margin: 8px 12px 10px; width: calc(100% - 24px); }
.people-layout > div:first-child { flex: 0 0 240px; }
.people-layout > .detail-card { flex: 1 1 auto; min-width: 0; }
/* The list (children or caregivers) stays put while a long detail/edit panel
   on the right scrolls past it — desktop only; on the narrow layout the two
   columns stack, where "pinned" would just mean it covers the page below it. */
@media (min-width: 641px) {
  .people-layout > div:first-child { position: sticky; top: 0; }
}
.people-selector { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.people-selector:last-child { margin-bottom: 0; }
.people-selector-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-bottom: 1px solid var(--border-subtle); background: var(--surface-2);
}
.people-selector-title { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }
.icon-btn {
  width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--border);
  background: var(--surface); color: var(--green);
  font-size: 14px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background 0.1s;
}
.icon-btn:hover { background: var(--green-light); }
.people-list { list-style: none; }
.people-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; cursor: pointer;
  border-bottom: 1px solid var(--border-subtle); transition: background 0.1s;
}
.people-item:last-child { border-bottom: none; }
.people-item:hover { background: var(--surface-2); }
.people-item.selected { background: var(--gold-light); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.avatar.gold   { background: var(--gold-dark); }
.avatar.orange { background: var(--orange); }
.avatar.teal   { background: #2A9D8F; }
.person-name { font-size: 13px; font-weight: 500; }
.person-sub  { font-size: 11px; color: var(--text-muted); }
.role-badge { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 4px; background: var(--gold-light); color: var(--gold-dark); }

.detail-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.detail-card-header {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.avatar-lg {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.avatar-lg.gold { background: var(--gold-dark); }
.detail-name { font-size: 14px; font-weight: 700; }
.detail-sub  { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }
.detail-body { padding: 12px 16px; }
.field-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 20px; background: var(--tag-bg); color: var(--tag-text); }
.tag.gold   { background: var(--gold-light);   color: var(--gold-dark); }
.tag.orange { background: var(--orange-light); color: var(--orange); }
.field-group { margin-bottom: 14px; }

/* ── Classes page ── */
.classes-layout { display: grid; grid-template-columns: 220px 1fr; gap: 18px; }
.enrolled-list { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.enrolled-group-header { padding: 6px 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); background: var(--surface-2); border-bottom: 1px solid var(--border-subtle); }
.enrolled-item { display: flex; align-items: center; padding: 9px 12px; gap: 9px; cursor: pointer; border-bottom: 1px solid var(--border-subtle); transition: background 0.1s; }
.enrolled-item:hover { background: var(--surface-2); }
.enrolled-item.selected { background: var(--green-light); box-shadow: inset 3px 0 0 var(--green); }
.enrolled-item:focus-visible, .week-event:focus-visible, .cal-event:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.week-event:hover:not(.dim) { filter: brightness(1.08); }
.week-event.dim:hover { opacity: .8; }
.session-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--gold-light); border: 1px solid var(--gold-mid); border-radius: 9px;
  padding: 9px 12px; margin-bottom: 12px; font-size: 12.5px;
}
.session-banner b { font-weight: 700; }
.session-banner .sb-actions { display: flex; gap: 6px; }
.session-banner .btn { padding: 4px 10px; font-size: 11.5px; }
.class-detail.flash { animation: flash 1.2s ease; }
.detail-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.enrolled-item:last-child { border-bottom: none; }
.class-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.enrolled-item-name { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.enrolled-item-meta { font-size: 11px; color: var(--text-muted); }

.class-detail { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.class-detail-title { font-size: 16px; font-weight: 700; margin-bottom: 3px; }
.class-detail-meta { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 12px; }
.enrolled-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: var(--green-light); color: var(--green-dark); margin-bottom: 12px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.info-item { background: var(--surface-2); border-radius: 8px; padding: 8px 11px; }
.info-item-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 3px; }
.info-item-value { font-size: 12.5px; font-weight: 500; }
.progress-bar-track { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.progress-bar-fill  { height: 100%; background: var(--green); border-radius: 3px; }

/* ── Meals page ── */
.cookbook-search { display: flex; gap: 10px; margin-bottom: 16px; }
.search-input {
  flex: 1; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text-primary);
  font-size: 13px; font-family: inherit; outline: none;
}
.search-input:focus { border-color: var(--gold); }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.recipe-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px; overflow: hidden; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.recipe-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.recipe-thumb {
  height: 90px; display: flex; align-items: center; justify-content: center;
  font-size: 36px; position: relative;
}
.recipe-thumb.pasta    { background: linear-gradient(135deg,#FFF3CD,#FFE08A); }
.recipe-thumb.chicken  { background: linear-gradient(135deg,#FFE9D0,#FFCDA0); }
.recipe-thumb.salad    { background: linear-gradient(135deg,#D4EDDA,#A8D8B0); }
.recipe-thumb.soup     { background: linear-gradient(135deg,#FFF0CC,#FFD980); }
.recipe-thumb.tacos    { background: linear-gradient(135deg,#FCE4EC,#F48FB1); }
.recipe-thumb.pancakes { background: linear-gradient(135deg,#FFF8E1,#FFE082); }
.recipe-info { padding: 8px 10px; }
/* ── Meal planning: drag + picker ── */
.recipe-card[draggable="true"] { cursor: grab; position: relative; }
.recipe-card.dragging { opacity: .45; transform: none; }
.recipe-plan-btn {
  position: absolute; left: 6px; top: 6px;
  font: 600 10.5px/1 'Inter', system-ui, sans-serif;
  background: var(--green); color: #fff; border: none; border-radius: 12px;
  padding: 5px 9px; cursor: pointer;
}
.recipe-plan-btn:hover { background: var(--green-dark); }
.meal-hint {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  font-size: 12px; color: var(--text-secondary);
  background: var(--gold-light); border: 1px dashed var(--gold-mid);
  border-radius: 8px; padding: 8px 12px;
}
.week-col.drop-ok { background: rgba(58,110,50,0.06); }
.drop-ghost {
  position: absolute; left: 2px; right: 2px; border-radius: 4px;
  border: 2px dashed var(--green); background: rgba(58,110,50,0.12);
  font-size: 9px; font-weight: 600; color: var(--green-dark); padding: 2px 4px;
  pointer-events: none;
}
.cal-cell.drop-ok { outline: 2px dashed var(--green); outline-offset: -2px; }
.week-event .ev-x {
  position: absolute; top: 1px; right: 3px; background: none; border: none;
  color: inherit; font-size: 11px; cursor: pointer; opacity: .75; line-height: 1;
}
.week-event .ev-x:hover { opacity: 1; }
.week-event.just-added { animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(.9); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }

.plan-pop {
  position: fixed; z-index: 50; width: 260px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(30,40,20,.18); padding: 14px;
}
.plan-pop h4 { font-size: 13px; margin-bottom: 10px; }
.plan-pop .lbl { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 10px 0 6px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  font: 500 11.5px 'Inter', system-ui, sans-serif; padding: 5px 9px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); cursor: pointer;
}
.chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.chip small { opacity: .7; font-weight: 400; }
.plan-pop .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: var(--green-dark); color: #fff; font-size: 12.5px; padding: 9px 16px; border-radius: 20px;
}
.recipe-name { font-size: 12px; font-weight: 600; margin-bottom: 2px; line-height: 1.3; }
.recipe-meta { font-size: 10.5px; color: var(--text-muted); }
.recipe-badge {
  position: absolute; top: 6px; right: 6px;
  font-size: 9.5px; font-weight: 700;
  padding: 2px 5px; border-radius: 4px;
  background: var(--gold); color: #fff;
}
.browse-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 10px; }
.category-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.category-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: 24px;
  border: 1.5px solid var(--border); background: var(--surface);
  font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: all 0.12s; color: var(--text-primary);
}
.category-chip:hover { border-color: var(--green); color: var(--green); }
.category-chip.active { background: var(--green); border-color: var(--green); color: #fff; }
.chip-icon { font-size: 14px; }
.search-results-label { font-size: 11.5px; color: var(--text-muted); margin: 8px 0 12px; }
.result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 9px;
  margin-bottom: 8px; cursor: pointer; transition: background 0.1s;
}
.result-item:hover { background: var(--surface-2); }
.result-thumb { width: 44px; height: 44px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.result-thumb.pasta   { background: linear-gradient(135deg,#FFF3CD,#FFE08A); }
.result-thumb.chicken { background: linear-gradient(135deg,#FFE9D0,#FFCDA0); }
.result-thumb.salad   { background: linear-gradient(135deg,#D4EDDA,#A8D8B0); }
.result-name  { font-size: 13.5px; font-weight: 600; }
.result-meta  { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.result-action { margin-left: auto; flex-shrink: 0; }



/* ── Pantry ── */
.pantry-top { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pantry-add { display: flex; gap: 8px; flex: 1 1 380px; min-width: 0; }
.pantry-add .search-input { height: 40px; font-size: 13.5px; min-width: 0; }
.pantry-scan-btn { display: inline-flex; align-items: center; gap: 7px; height: 40px; border-color: var(--green); color: var(--green-dark); font-weight: 600; }
.pantry-scan-btn:hover { background: var(--green-light); }
.pantry-staples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 16px; font-size: 11.5px; color: var(--text-muted); }
.staple { font: 500 11.5px 'Inter', system-ui, sans-serif; padding: 4px 10px; border-radius: 14px; border: 1px dashed var(--border); background: var(--surface); color: var(--text-secondary); cursor: pointer; }
.staple:hover { border-style: solid; border-color: var(--green); color: var(--green-dark); }
.pantry-make { margin-bottom: 18px; }
.pantry-make:empty { display: none; }
.make-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.make-card { display: flex; gap: 10px; align-items: center; padding: 9px 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; text-align: left; font-family: inherit; color: var(--text-primary); }
.make-card:hover { border-color: var(--green-mid); }
.make-emoji { font-size: 22px; }
.make-name { font-size: 12.5px; font-weight: 600; }
.make-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.make-bar { height: 4px; border-radius: 2px; background: var(--border-subtle); margin-top: 5px; overflow: hidden; }
.make-bar i { display: block; height: 100%; background: var(--green); }
.pantry-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.pantry-filter { max-width: 200px; height: 32px; padding: 6px 10px; font-size: 12.5px; }
.pantry-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; align-items: start; }
.pgroup { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.pgroup-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border-subtle); font-size: 12.5px; font-weight: 700; }
.pgroup-head span { font-weight: 500; color: var(--text-muted); font-size: 11.5px; }
.pitem { display: grid; grid-template-columns: minmax(0, 1fr) auto 26px; gap: 8px; align-items: center; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
.pitem:last-child { border-bottom: none; }
.pitem.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 40% { background: var(--gold-light); } 100% { background: transparent; } }
.pitem-name { display: flex; align-items: center; min-width: 0; }
.pitem-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem .out-pill { flex-shrink: 0; }
.conf-note { font-size: 10.5px; color: var(--orange); padding: 0 7px 3px; }
.pitem.out .pitem-name > span { color: var(--text-muted); text-decoration: line-through; }
.pitem .out-pill { font-size: 10px; font-weight: 700; color: var(--orange); background: var(--orange-light); border: none; border-radius: 10px; padding: 2px 7px; margin-left: 6px; cursor: pointer; text-decoration: none; }
.qty { display: inline-flex; align-items: center; gap: 2px; }
.qty button { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); cursor: pointer; font-size: 13px; line-height: 1; }
.qty button:hover { border-color: var(--green); color: var(--green); }
.qty b { min-width: 64px; text-align: center; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pitem-x { width: 24px; height: 24px; border: none; background: none; color: var(--text-muted); border-radius: 6px; cursor: pointer; font-size: 14px; }
.pitem-x:hover { background: var(--surface-2); color: var(--text-primary); }
.pgroup-empty { padding: 14px 12px; font-size: 12px; color: var(--text-muted); }

/* Interests & skill level — bubble tags with an autocomplete input */
.tagbox {
  position: relative; width: 100%; min-height: 34px; padding: 5px 6px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--surface);
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
}
.tagbox:focus-within { border-color: var(--gold); }
.tagbubble {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--tag-bg); color: var(--tag-text);
  border-radius: 20px; padding: 3px 3px 3px 10px; font-size: 12px; font-weight: 500;
}
.tagbubble-name { white-space: nowrap; }
.tagbubble-level {
  border: none; background: none; color: inherit; font: inherit; font-size: 11px;
  opacity: .7; padding: 0 1px; cursor: pointer; appearance: none; -webkit-appearance: none; max-width: 78px;
}
.tagbubble-x {
  width: 17px; height: 17px; border: none; background: none; color: inherit;
  border-radius: 50%; cursor: pointer; font-size: 13px; line-height: 1; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .1s;
}
.tagbubble:hover .tagbubble-x, .tagbubble-x:focus { opacity: .65; }
.tagbubble-x:hover { opacity: 1 !important; background: rgba(0,0,0,.08); }
.tagbox-input {
  flex: 1; min-width: 100px; border: none; outline: none; background: none;
  font-size: 13px; font-family: inherit; color: var(--text-primary); padding: 4px 2px;
}
.tagbox-menu {
  position: absolute; left: 0; top: calc(100% + 4px); z-index: 30; width: 100%; max-height: 220px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(30,40,20,.16); padding: 4px;
}
.tagbox-opt {
  display: block; width: 100%; text-align: left; padding: 7px 9px; border: none; background: none;
  border-radius: 6px; cursor: pointer; font-family: inherit; font-size: 13px; color: var(--text-primary);
}
.tagbox-opt:hover, .tagbox-opt.active { background: var(--surface-2); }

/* scan flow */
.scan-body { padding: 18px 22px 22px; overflow-y: auto; }
.scan-previews { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.scan-previews img { width: 92px; height: 92px; object-fit: cover; border-radius: 9px; border: 1px solid var(--border); }
.scan-layout { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: start; }
.scan-photo { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.scan-photo img { display: block; width: 100%; }
.scan-photo .scanline { position: absolute; left: 0; right: 0; height: 3px; background: var(--green-mid); box-shadow: 0 0 12px var(--green-mid); animation: scan 1.4s ease-in-out infinite alternate; }
@keyframes scan { from { top: 4%; } to { top: 94%; } }
.review-note { font-size: 12px; background: var(--gold-light); color: var(--text-secondary); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; line-height: 1.5; }
.review-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.review-table th { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); text-align: left; padding: 0 4px 6px; }
.review-table td { padding: 3px 4px; border-top: 1px solid var(--border-subtle); vertical-align: middle; }
.review-table tr.off td:not(:first-child) { opacity: .4; }
.review-table input[type="text"], .review-table input[type="number"], .review-table select {
  width: 100%; min-width: 0; padding: 5px 7px; border: 1px solid transparent; border-radius: 6px;
  font: 12.5px 'Inter', system-ui, sans-serif; color: var(--text-primary); background: transparent;
}
.review-table input:hover, .review-table select:hover { border-color: var(--border); }
.review-table input:focus, .review-table select:focus { border-color: var(--gold); background: var(--surface); outline: none; }
.review-table input[type="checkbox"] { accent-color: var(--green); width: 15px; height: 15px; }
.conf { font-size: 10px; font-weight: 700; border-radius: 9px; padding: 2px 7px; white-space: nowrap; }
.conf.hi { background: var(--green-light); color: var(--green-dark); }
.conf.lo { background: var(--orange-light); color: var(--orange); }
.conf.dup { background: var(--gold-light); color: var(--gold-dark); }
.review-add { margin-top: 8px; }
.review-scroll { overflow-x: auto; }
@media (max-width: 640px) {
  .scan-layout { grid-template-columns: 1fr; }
  .scan-photo { max-width: 200px; }
}

/* ── Colors + transport (class details & People) ── */
.kid-name-chip { font-weight: 700; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 5px; }
.swatch {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); cursor: pointer;
  box-shadow: 0 0 0 1px var(--border); padding: 0; position: relative;
}
.swatch:hover { transform: scale(1.1); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--text-primary); }
.swatch[aria-checked="true"]::after { content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 800; }
.swatch-note { font-size: 11px; color: var(--text-muted); margin-left: 4px; }
.swatch-reset { background: none; border: none; font: 600 11px 'Inter', system-ui, sans-serif; color: var(--green); cursor: pointer; padding: 2px 4px; }
.swatch-reset:hover { text-decoration: underline; }

.transport { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--surface); }
.tp-half {
  display: flex; flex-direction: column; gap: 5px; align-items: flex-start; text-align: left;
  padding: 9px 12px; border: none; background: var(--surface-2); cursor: pointer; font-family: inherit; color: var(--text-primary); min-width: 0;
}
.tp-half + .tp-half { border-left: 1px solid var(--border); }
.tp-half:hover { background: var(--green-light); }
.tp-half:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.tp-label { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.tp-person { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; min-width: 0; max-width: 100%; }
.tp-person .tp-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-person svg { color: var(--text-muted); flex-shrink: 0; }
.tp-av { width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 9px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tp-note { font-size: 10.5px; color: var(--text-muted); }
.tp-note.custom { color: var(--gold-dark); font-weight: 600; }
.tp-foot { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; margin-bottom: 12px; }
.tp-all { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }
.meal-strip { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: 16px 24px 0; padding: 8px 8px 8px 12px; background: var(--gold-light); border: 1px solid var(--gold-mid); border-radius: 9px; font-size: 12.5px; }
.chef-btn { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; padding: 6px 10px; border: 1px solid var(--gold-mid);
  border-radius: 8px; background: var(--surface); cursor: pointer; font-family: inherit; color: var(--text-primary); }
.chef-btn:hover { background: var(--green-light); }
.ev-body { padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.ev-body > .transport, .ev-body > .ev-confirm, .ev-body > .ev-status { align-self: stretch; }
.ev-title { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; text-wrap: balance; }
.ev-title .class-dot { width: 12px; height: 12px; }
.ev-dash { color: var(--text-muted); font-weight: 400; }
.ev-when { font-size: 13px; color: var(--text-secondary); margin-top: -6px; }
.ev-meta { font-size: 12px; color: var(--text-secondary); }
.ev-meta span { font-weight: 700; color: var(--text-muted); text-transform: uppercase; font-size: 10.5px; letter-spacing: .06em; margin-right: 4px; }
.ev-confirm { background: var(--orange-light); border: 1px solid #F6C9A6; border-radius: 9px; padding: 11px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 9px; }
.ev-confirm-row { display: flex; gap: 8px; justify-content: flex-end; }
.ev-status { background: var(--green-light); border-radius: 9px; padding: 9px 12px; font-size: 12.5px; color: var(--green-dark); display: flex; justify-content: space-between; gap: 10px; }
.ev-off { opacity: .5; }
.week-event.skipped, .cal-event.skipped { opacity: .5; text-decoration: line-through; }
.week-event.split, .cal-event.split { text-shadow: 0 1px 2px rgba(0,0,0,.45); }   /* white text stays readable across both colors */
.sb-when { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sb-step { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--gold-mid); background: var(--surface); color: var(--text-secondary); cursor: pointer; font-size: 14px; line-height: 1; }
.sb-step:hover:not(:disabled) { background: var(--gold-light); }
.sb-step:disabled { opacity: .35; cursor: default; }
.sb-count { font-size: 11px; color: var(--text-muted); margin-left: 4px; }
.confirm-drivers { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; margin-bottom: 14px; }
.confirm-drivers > div { padding: 10px 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 5px; }
.confirm-drivers > div + div { border-left: 1px solid var(--border); }
.confirm-text { font-size: 13px; line-height: 1.55; margin-bottom: 8px; max-width: 60ch; }

.tp-pop {
  position: fixed; z-index: 120; width: 260px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(30,40,20,.18); padding: 6px;
}
.tp-pop h4 { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); padding: 6px 8px 4px; }
.tp-opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px; border: none; background: none; border-radius: 7px; cursor: pointer; font-family: inherit; color: var(--text-primary); }
.tp-opt:hover { background: var(--surface-2); }
.tp-opt[aria-selected="true"] { background: var(--green-light); }
.tp-opt .tp-av { width: 28px; height: 28px; font-size: 10.5px; }
.tp-opt-name { font-size: 13px; font-weight: 600; }
.tp-opt-sub { font-size: 11px; color: var(--text-muted); }
.tp-opt .check { margin-left: auto; color: var(--green); font-weight: 700; }
.tp-scope { display: flex; gap: 4px; padding: 4px 6px 6px; }
.tp-scope button { flex: 1; font: 500 11px 'Inter', system-ui, sans-serif; padding: 5px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); cursor: pointer; }
.tp-scope button.on { background: var(--green); border-color: var(--green); color: #fff; }
.tp-pop hr { border: none; border-top: 1px solid var(--border-subtle); margin: 4px 2px; }
.tp-link { display: block; width: 100%; text-align: left; background: none; border: none; font: 600 12px 'Inter', system-ui, sans-serif; color: var(--green); padding: 7px 8px; cursor: pointer; border-radius: 7px; }
.tp-link:hover { background: var(--surface-2); }
.apply-link { background: none; border: none; font: 600 11.5px 'Inter', system-ui, sans-serif; color: var(--green); cursor: pointer; padding: 0; }
.apply-link:hover { text-decoration: underline; }
/* ── Find tabs ── */
.find-search { position: relative; margin-bottom: 16px; max-width: 720px; }
.find-search .find-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.find-search .search-input { width: 100%; padding-left: 36px; height: 40px; font-size: 13.5px; }
.rtag.saved { background: var(--green); color: #fff; }
.result-actions { margin-left: auto; display: flex; gap: 6px; flex-shrink: 0; }
.save-toggle { display: inline-flex; align-items: center; gap: 5px; }
.save-toggle.is-saved { color: var(--green-dark); border-color: #CFE3CA; background: var(--green-light); font-weight: 600; }
.result-item.saved { border-color: #CFE3CA; }
.recipe-saved {
  position: absolute; top: 6px; right: 6px; font-size: 10.5px; font-weight: 700;
  background: var(--green); color: #fff; border-radius: 10px; padding: 3px 8px;
}
.recipe-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; }
.card-save {
  font: 600 11px 'Inter', system-ui, sans-serif; color: var(--green-dark); background: var(--surface);
  border: 1px solid #CFE3CA; border-radius: 12px; padding: 3px 9px; cursor: pointer;
}
.card-save:hover { background: var(--green-light); }
.card-saved-note { font-size: 11px; font-weight: 600; color: var(--green); }
.ord-items { list-style: none; margin: 4px 0 14px; }
.ord-items li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
.ord-items li:last-child { border-bottom: none; }
.ord-item-price { color: var(--text-muted); flex-shrink: 0; }
.ord-total { font-size: 13.5px; font-weight: 700; margin-bottom: 10px; }
.recipe-card.is-saved { border-color: #CFE3CA; }
/* ── Browse filters ── */
.browse-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 6px; }
.browse-cats { flex: 1 1 360px; min-width: 0; }
.browse-cats .category-chips { margin-bottom: 10px; }
button.category-chip { font-family: inherit; color: var(--text-primary); cursor: pointer; }
.browse-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filter { display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.filter-btn {
  height: 34px; display: inline-flex; align-items: center; gap: 7px;
  padding: 0 12px; border: 1.5px solid var(--border); border-radius: 18px;
  background: var(--surface); color: var(--text-primary);
  font: 500 12.5px 'Inter', system-ui, sans-serif; cursor: pointer;
}
.filter-btn:hover, .filter-btn:focus-visible { border-color: var(--green); outline: none; }
.filter-select {
  appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5 5 6.5 8 3.5' fill='none' stroke='%238A8672' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.filter-select.set { border-color: var(--green); background-color: var(--green-light); color: var(--green-dark); font-weight: 600; }
.kid-dd { position: relative; }
.kid-btn .kid-av, .kid-opt .kid-av {
  width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 9.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kid-btn { padding-left: 6px; }
.kid-btn.set { border-color: var(--green); background: var(--green-light); color: var(--green-dark); font-weight: 600; }
.kid-btn svg { color: var(--text-muted); }
.kid-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 250px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(30,40,20,.16); padding: 6px;
}
.kid-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px; border: none; background: none; border-radius: 7px; cursor: pointer;
  font-family: inherit; color: var(--text-primary);
}
.kid-opt:hover { background: var(--surface-2); }
.kid-opt[aria-selected="true"] { background: var(--green-light); }
.kid-opt .kid-av { width: 28px; height: 28px; font-size: 11px; }
.kid-opt-name { font-size: 13px; font-weight: 600; }
.kid-opt-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.kid-opt .check { margin-left: auto; color: var(--green); font-weight: 700; }
.kid-menu hr { border: none; border-top: 1px solid var(--border-subtle); margin: 4px 2px; }
.kid-menu { max-width: calc(100vw - 32px); }
@media (max-width: 860px) { .kid-menu { left: 0; right: auto; } }   /* button sits at the left on narrow screens */

.kid-summary {
  display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-secondary);
  background: var(--green-light); border-radius: 8px; padding: 9px 12px; margin: 4px 0 16px;
}
.kid-summary:empty { display: none; }
.kid-summary strong { color: var(--green-dark); }
.kid-summary .rule { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid #CFE3CA; border-radius: 12px; padding: 2px 9px; font-size: 11.5px; }
.result-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.rtag { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 10px; background: var(--tag-bg); color: var(--tag-text); }
.rtag.gold { background: var(--gold-light); color: var(--gold-dark); }
.browse-empty { font-size: 12.5px; color: var(--text-muted); padding: 18px; text-align: center; border: 1px dashed var(--border); border-radius: 9px; }
.browse-hidden { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }
.browse-hidden summary { cursor: pointer; font-weight: 600; color: var(--text-secondary); }
.browse-hidden ul { margin: 6px 0 0 18px; line-height: 1.7; }


/* ── Cookbook toolbar ── */
.add-recipe-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.recipe-card.filtered-out { display: none; }
.empty-state {
  display: grid; justify-items: center; gap: 10px; text-align: center;
  padding: 48px 24px 44px; background: var(--surface);
  border: 1px dashed var(--border); border-radius: 12px;
}
.empty-state h3 { margin: 0; font-size: 19px; font-weight: 700; color: var(--text-primary); }
.empty-state p { margin: 0 0 6px; max-width: 44ch; font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); }
.btn.btn-lg { font-size: 14px; padding: 11px 22px; border-radius: 9px; }
.empty-state p.empty-or { margin: -2px 0 4px; font-size: 12.5px; color: var(--text-muted); }
/* Orders, grouped by eatery: one card per place, each order with its price and items */
.imports-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 12px; padding: 9px 12px; border: 1px dashed var(--border); border-radius: 8px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.imports-bar .spacer { flex: 1; }
.import-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border-subtle); font-size: 13px; }
.import-row:first-child { border-top: none; }
.import-help { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin: 4px 0 0; }
.import-help summary { cursor: pointer; font-weight: 600; color: var(--green-dark); }
.import-help ul, .import-help ol { margin: 6px 0 0; padding-left: 18px; }
.import-help li + li { margin-top: 4px; }
.tp-busy { color: var(--orange); }
.imp-every { display: flex; align-items: center; gap: 7px; margin: 10px 0 0; font-size: 12.5px; color: var(--text-secondary); cursor: pointer; }
.order-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.order-group { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.order-group-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px; border-bottom: 1px solid var(--border-subtle); }
.order-group-emoji { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center; font-size: 18px; background: linear-gradient(135deg,#FCEEDD,#F3C99A); }
.order-group-name { font-weight: 700; font-size: 14px; line-height: 1.25; }
.order-group-sub { font-size: 11.5px; color: var(--text-muted); }
.order-row { padding: 10px 14px 12px; cursor: grab; border-top: 1px solid var(--border-subtle); }
.order-row:first-of-type { border-top: none; }
.order-row:hover { background: var(--surface-2); }
.order-row.dragging { opacity: .5; }
.order-row-top { display: flex; align-items: baseline; gap: 8px; }
.order-price { font-weight: 700; font-size: 14px; }
.order-when { font-size: 11.5px; color: var(--text-muted); }
.order-row-top .card-save { margin-left: auto; }
.order-items { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.order-items li { display: flex; justify-content: space-between; gap: 10px; }
.order-items li span:last-child { color: var(--text-muted); white-space: nowrap; }
.cookbook-empty { font-size: 12.5px; color: var(--text-muted); padding: 24px; text-align: center; border: 1px dashed var(--border); border-radius: 10px; grid-column: 1 / -1; }

/* ── Modal (recipe viewer + add recipe) ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(26, 30, 18, .48); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  animation: fadeIn .15s ease;
}
.modal {
  width: min(760px, 100%); max-height: min(88vh, 900px);
  background: var(--surface); border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(20, 26, 12, .3);
  display: flex; flex-direction: column; animation: rise .18s ease;
}
.modal.narrow { width: min(560px, 100%); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
body.modal-open { overflow: hidden; }

.modal-toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; position: relative;
  padding: 10px 50px 10px 12px; border-bottom: 1px solid var(--border-subtle); background: var(--surface);
}
.modal-toolbar .tb-close { position: absolute; top: 10px; right: 10px; }
.modal-toolbar .spacer { flex: 1; }
.tb-btn {
  height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  font: 500 12.5px 'Inter', system-ui, sans-serif; color: var(--text-primary); cursor: pointer;
}
.tb-btn:hover { background: var(--surface-2); }
.tb-btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.tb-btn.primary:hover { background: var(--green-dark); }
.tb-icon {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; border-radius: 8px; color: var(--text-secondary); cursor: pointer; position: relative;
}
.tb-icon:hover { background: var(--surface-2); color: var(--text-primary); }
.tb-icon.on { color: var(--orange); }
.tb-sep { width: 1px; height: 20px; background: var(--border); margin: 0 2px; }
.tb-icon svg, .tb-btn svg { width: 16px; height: 16px; }

.modal-body { overflow-y: auto; }
.rv-hero { display: flex; gap: 18px; align-items: center; padding: 20px 24px 18px; }
.rv-thumb { width: 84px; height: 84px; border-radius: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 42px; }
.rv-title { font-size: 22px; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.rv-source { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.rv-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; }
.rv-stat { display: flex; flex-direction: column; gap: 1px; }
.rv-stat b { font-size: 14px; font-variant-numeric: tabular-nums; }
.rv-stat span { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper button { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 13px; line-height: 1; color: var(--text-secondary); }
.stepper button:hover { border-color: var(--green); color: var(--green); }
.rv-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }

.rv-cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0; border-top: 1px solid var(--border-subtle); }
.rv-col { padding: 18px 24px 24px; }
.rv-col + .rv-col { border-left: 1px solid var(--border-subtle); }
.rv-h { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; display: flex; justify-content: space-between; }
.rv-h small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.ing { display: flex; gap: 9px; align-items: flex-start; padding: 5px 0; font-size: 13px; line-height: 1.4; cursor: pointer; }
.ing input { margin-top: 2px; accent-color: var(--green); }
.ing b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ing input:checked ~ span { color: var(--text-muted); text-decoration: line-through; }
.steps { list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 12px; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: 13px; line-height: 1.55; max-width: 60ch; }
.steps li::before { content: counter(st); width: 22px; height: 22px; border-radius: 50%; background: var(--gold-light); color: var(--gold-dark); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.steps .timer { display: inline-block; margin-left: 4px; font-size: 11px; font-weight: 600; color: var(--green); background: var(--green-light); border-radius: 10px; padding: 0 7px; }
.rv-notes { margin-top: 18px; font-size: 12.5px; color: var(--text-secondary); background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }

/* Cook mode */
.cook { padding: 28px 32px 32px; display: flex; flex-direction: column; gap: 18px; min-height: 340px; }
.cook-progress { display: flex; gap: 4px; }
.cook-progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--border); }
.cook-progress i.done { background: var(--green); }
.cook-step-n { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.cook-text { font-size: 22px; line-height: 1.45; font-weight: 500; max-width: 34ch; text-wrap: pretty; }
.cook-nav { display: flex; justify-content: space-between; margin-top: auto; }

/* Add recipe */
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px 22px; border-bottom: 1px solid var(--border-subtle); }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.ar-body { padding: 18px 22px 22px; overflow-y: auto; }
.ar-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.ar-method {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px;
  border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer;
  font: 600 12px 'Inter', system-ui, sans-serif; color: var(--text-secondary); text-align: center;
}
.ar-method svg { width: 20px; height: 20px; }
.ar-method:hover { border-color: var(--green-mid); }
.ar-method.on { border-color: var(--green); background: var(--green-light); color: var(--green-dark); }
.ar-hint { font-size: 12px; color: var(--text-muted); margin-top: 8px; line-height: 1.5; }
/* Choosing which location of an eatery an order is picked up from */
.loc-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.loc-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.loc-opt:has(input:checked) { border-color: var(--accent, #3B6E32); background: var(--surface-2); }
.loc-opt input { margin-top: 3px; }
.loc-addr { font-size: 14px; font-weight: 600; color: var(--text); }
.loc-why { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.loc-why b { color: var(--accent, #3B6E32); font-weight: 600; }
.ar-row { display: flex; gap: 8px; }
.ar-drop {
  border: 1.5px dashed var(--border); border-radius: 10px; padding: 26px 16px; text-align: center;
  font-size: 13px; color: var(--text-secondary); cursor: pointer; display: block;
}
.ar-drop:hover, .ar-drop.over { border-color: var(--green); background: var(--green-light); }
.ar-drop input { display: none; }
.ar-text { width: 100%; min-height: 150px; resize: vertical; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font: 13px/1.5 'Inter', system-ui, sans-serif; color: var(--text-primary); background: var(--surface); outline: none; }
.ar-text:focus, .ar-field input:focus, .ar-field textarea:focus { border-color: var(--gold); }
.ar-parsing { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 0; font-size: 13px; color: var(--text-secondary); }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--green-light); border-top-color: var(--green); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ar-found { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.ar-review-note { font-size: 12px; background: var(--gold-light); color: var(--text-secondary); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; }
.ar-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.ar-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.ar-field label { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); }
.ar-field input, .ar-field textarea, .ar-field select { width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: 13px/1.5 'Inter', system-ui, sans-serif; color: var(--text-primary); background: var(--surface); outline: none; }
.ar-field textarea { min-height: 110px; resize: vertical; }
.ar-field.found input, .ar-field.found textarea { background: #FBFDF9; border-color: #CFE3CA; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--border-subtle); }

@media (max-width: 640px) {
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { max-height: 94vh; border-radius: 14px 14px 0 0; }
  .rv-cols { grid-template-columns: 1fr; }
  .rv-col + .rv-col { border-left: none; border-top: 1px solid var(--border-subtle); }
  .ar-methods { grid-template-columns: repeat(2, 1fr); }
  .ar-grid { grid-template-columns: 1fr 1fr; }
  .tb-btn .lbl-long { display: none; }
}

/* ── Chat window ── */
.chat-area { position: fixed; bottom: 0; right: 20px; z-index: 100; display: flex; flex-direction: column; align-items: flex-end; }
.chat-tabs  { display: flex; gap: 3px; align-items: flex-end; }
.chat-tab {
  background: var(--chat-header); color: #8AAA78;
  border-radius: 8px 8px 0 0; padding: 6px 12px;
  font-size: 11.5px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  opacity: 0.72; transition: opacity 0.15s; white-space: nowrap;
}
.chat-tab:hover { opacity: 0.88; }
.chat-tab.active { opacity: 1; color: #C8E0B8; padding-top: 7px; }
.chat-dot { width: 6px; height: 6px; border-radius: 50%; background: #5DBB63; flex-shrink: 0; }
.chat-tab-x { font-size: 10px; opacity: 0.5; margin-left: 3px; }
.chat-window {
  width: 285px; background: var(--chat-bg);
  border: 1px solid var(--chat-border); border-bottom: none;
  border-radius: 10px 0 0 0; box-shadow: 0 -4px 24px rgba(0,0,0,0.11);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-window-header {
  background: var(--chat-header); color: #C8E0B8;
  padding: 8px 12px; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.chat-minimize { margin-left: auto; font-size: 16px; opacity: 0.6; line-height: 1; }
.chat-messages { flex: 1; padding: 10px; height: 165px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; }
.msg { max-width: 82%; font-size: 12px; padding: 6px 10px; border-radius: 10px; line-height: 1.45; }
.msg.incoming { background: var(--surface-2); color: var(--text-primary); align-self: flex-start; border-bottom-left-radius: 3px; }
.msg.outgoing { background: var(--green); color: #fff; align-self: flex-end; border-bottom-right-radius: 3px; }
.msg-time { font-size: 9.5px; color: var(--text-muted); text-align: center; margin: 2px 0; }
.chat-input-row { display: flex; border-top: 1px solid var(--chat-border); }
.chat-input { flex: 1; padding: 8px 10px; font-size: 12px; font-family: inherit; border: none; background: var(--chat-bg); color: var(--text-primary); outline: none; }
.chat-send { padding: 0 11px; background: none; border: none; color: var(--green); font-size: 14px; cursor: pointer; opacity: 0.8; }
.chat-send:hover { opacity: 1; }

/* Stripe badge */
.stripe-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-muted);
  margin-top: 14px;
}
.stripe-logo {
  background: #635BFF; color: #fff;
  font-size: 9px; font-weight: 800;
  padding: 2px 5px; border-radius: 3px;
  letter-spacing: 0.04em;
}

/* ── Hamburger + drawer (tablet and phone) ── */
.title-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.menu-btn, .nav-close {
  display: none; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-left: -6px; border: none; border-radius: 8px;
  background: none; color: var(--sidebar-text); cursor: pointer;
}
.menu-btn:hover, .nav-close:hover { background: var(--sidebar-hover-bg); }
.nav-scrim { position: fixed; inset: 0; z-index: 150; background: rgba(26, 30, 18, .42); animation: fadeIn .2s ease; }
body.nav-open { overflow: hidden; }

/* ── Calendar collapse ── */
.cal-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.cal-header { gap: 8px 12px; }
.cal-nav { order: 1; flex: 1; min-width: 0; }
.cal-right { order: 2; }
.cal-header > .cal-collapse { order: 3; flex-shrink: 0; }
.cal-color-wrap { display: flex; align-items: center; gap: 6px; }
.cal-color-label { font-size: 10.5px; font-weight: 600; color: var(--text-muted); }
.cal-color-btn {
  padding: 3px 10px; font-size: 11.5px; font-weight: 500;
  color: var(--text-secondary); background: var(--surface);
  cursor: pointer; border: none; border-right: 1px solid var(--border); font-family: inherit;
}
.cal-color-btn:last-child { border-right: none; }
.cal-color-btn.active { background: var(--surface-2); color: var(--text-primary); font-weight: 600; }
.cal-collapse {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  font: 500 11.5px 'Inter', system-ui, sans-serif; color: var(--text-secondary); cursor: pointer;
}
.cal-collapse:hover { background: var(--surface-2); }
.cal-collapse svg { transition: transform .2s; }
.calendar-section.collapsed .cal-collapse svg { transform: rotate(180deg); }
.calendar-section.collapsed .cal-view-btns,
.calendar-section.collapsed .cal-color-wrap,
.calendar-section.collapsed #cal-container,
.calendar-section.collapsed .cal-resizer { display: none; }
.calendar-section.collapsed .cal-header { border-bottom: none; }
/* "Up next", beside the page title */
.page-upnext { display: flex; align-items: center; gap: 7px; min-width: 0; margin-left: 10px; padding-left: 12px; border-left: 1px solid var(--border); font-size: 12.5px; color: var(--text-secondary); }
.page-upnext:empty { display: none; }
body[data-page="account"] .page-upnext { display: none; }
.page-upnext .un-label { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); flex-shrink: 0; }
.page-upnext .un-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.page-upnext .un-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-upnext .un-text b { color: var(--text-primary); font-weight: 600; }

@media (max-width: 860px) {
  .menu-btn, .nav-close { display: inline-flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 160; width: min(280px, 84vw);
    padding-top: env(safe-area-inset-top, 0px);
    transform: translateX(-102%); visibility: hidden;
    transition: transform .25s cubic-bezier(.3,.7,.3,1), box-shadow .25s, visibility 0s linear .25s;
  }
  .sidebar.open {
    transform: none; visibility: visible; box-shadow: 8px 0 30px rgba(26,30,18,.22);
    transition: transform .25s cubic-bezier(.3,.7,.3,1), box-shadow .25s, visibility 0s;
  }
  .sidebar-logo { display: flex; align-items: center; }
  .nav-close { margin: -6px -6px -6px auto; }
  .sidebar-nav li a { padding: 11px 12px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

@media (max-width: 640px) {
  .page-header { padding: 10px 16px 0; }
  .cal-header { flex-wrap: wrap; gap: 6px 8px; padding: 8px 12px; }
  .cal-header > .cal-collapse { order: 2; }
  .cal-right { order: 3; width: 100%; justify-content: space-between; gap: 8px; }
  .page-upnext { margin-left: 4px; padding-left: 10px; }
  .page-upnext .un-more, .page-upnext .un-up { display: none; }
  .cal-range-btn { font-size: 12.5px; padding: 3px 4px; }
  .cal-today-btn { margin-right: 0; }
  .meal-hint { display: block; line-height: 1.5; }
  .people-layout, .classes-layout, .info-grid, .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .people-layout { flex-direction: column; align-items: stretch; gap: 12px; }
  .people-layout > div:first-child { flex: none; position: static; }
  .people-layout .people-list { display: none; }
  .people-layout .people-select { display: block; }
  .recipe-grid { grid-template-columns: 1fr 1fr; }
  .connections-grid { grid-template-columns: 1fr; }
  .chat-area { right: 4px; }
  .chat-window { width: calc(100vw - 8px); }
}

/* ── Live database pieces ── */
.sidebar-user { flex-direction: column; align-items: stretch; gap: 8px; }
.me-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.me-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-switch { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px dashed var(--sidebar-border); border-radius: 8px; background: rgba(255,255,255,.45); }
.dev-switch-label { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); display: flex; justify-content: space-between; }
.dev-switch .btn { width: 100%; justify-content: center; }
.dev-switch-label > span:last-child { white-space: nowrap; flex-shrink: 0; }
#me-email { text-transform: none; letter-spacing: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; margin-right: 6px; }
.signin-form { display: grid; gap: 4px; padding: 18px 22px 22px; }
.signin-err { font-size: 12px; color: var(--orange); min-height: 16px; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 40px;
  background: #FFFFFF; color: #1F1F1F; border: 1px solid #747775; border-radius: 8px; cursor: pointer;
  font: 500 14px 'Roboto', 'Inter', system-ui, sans-serif;
}
.google-btn:hover { background: #F8F9FA; }
.google-btn:disabled { opacity: .6; cursor: default; }
.google-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 12px 0 8px; font-size: 12px; color: var(--text-muted); }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-legal { display: flex; justify-content: center; gap: 8px; padding: 0 22px 18px; font-size: 12px; color: var(--text-muted); }
.auth-legal a { color: var(--text-muted); }
.auth-legal a:hover { color: var(--green-dark); }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-top: 10px; font-size: 12.5px; color: var(--text-muted); }
.dev-note { font-size: 10px; line-height: 1.4; color: var(--text-muted); }
.sync-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); margin-right: 4px; vertical-align: 0; }
.sync-dot.on { background: var(--green-mid); }
.sync-dot.err { background: var(--orange); }
.pill-select {
  font: 600 11px 'Inter', system-ui, sans-serif; padding: 3px 22px 3px 9px; border-radius: 20px;
  border: 1px solid var(--border); background-color: var(--surface-2); color: var(--text-secondary); cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5 5 6.5 8 3.5' fill='none' stroke='%238A8672' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.pill-select.full { background-color: var(--green-light); color: var(--green-dark); border-color: #CFE3CA; }
.pill-select.view { background-color: var(--gold-light); color: var(--gold-dark); border-color: var(--gold-mid); }
.form-input[readonly] { background: var(--surface-2); color: var(--text-muted); }
.save-note { font-size: 11.5px; color: var(--text-muted); align-self: center; }

/* ── One editing pattern everywhere ──
   Quick choices (colors, dropdowns) save the moment you pick them.
   Typed details show as text; "Edit" turns them into a form with Save / Cancel. */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-head .section-heading { margin-bottom: 0; }
.account-form.viewing .form-input { border-color: transparent; background: transparent; padding-left: 0; color: var(--text-primary); opacity: 1; -webkit-text-fill-color: var(--text-primary); }
.account-form.viewing select.form-input { appearance: none; -webkit-appearance: none; }
.account-form.viewing .form-row.empty { display: none; }
.account-form.viewing .edit-only, .account-form:not(.viewing) .view-only { display: none; }
.auto-note { font-size: 11.5px; color: var(--text-muted); }
.kid-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 14px; margin-bottom: 14px; }
.kid-fact .v { font-size: 13px; margin-top: 3px; }
.kid-fact .v small { color: var(--text-muted); font-size: 11px; }
.kid-form .form-row { margin-bottom: 12px; }
.kid-form .row-edit { display: grid; grid-template-columns: 150px 1fr 28px; gap: 8px; align-items: center; margin-bottom: 6px; }
.kid-form .row-edit .lbl { font-size: 12.5px; font-weight: 500; }
.kid-form .row-edit .pitem-x { width: 28px; height: 28px; }
.kid-form .ht { display: grid; grid-template-columns: 1fr 1fr 1fr 1.3fr; gap: 8px; }
.kid-form textarea.form-input { min-height: 64px; resize: vertical; font-family: inherit; }
.add-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.add-row select, .add-row input { max-width: 200px; }
.form-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--border-subtle); padding-top: 12px; margin-top: 6px; }
.form-foot .spacer { flex: 1; }
.btn-danger { color: var(--orange); border-color: var(--orange); }
.btn-danger.confirm { background: var(--orange); color: #fff; }
/* room at the bottom so the chat window never covers buttons */
.content-scroll { padding-bottom: 380px; }   /* the open chat window is ~360px tall */
body.chat-min .content-scroll { padding-bottom: 56px; }
.kid-empty { padding: 18px; text-align: center; font-size: 12.5px; color: var(--text-muted); }
@media (max-width: 640px) { .kid-form .row-edit { grid-template-columns: 1fr 1fr 28px; } .kid-form .ht { grid-template-columns: 1fr 1fr; } }

/* ── Month view ── */
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:1px;background:var(--border-subtle);border:1px solid var(--border);border-radius:8px;overflow:hidden}
.cal-day-header{background:var(--surface-2);text-align:center;padding:5px 2px;font-size:10px;font-weight:600;color:var(--text-muted);letter-spacing:.05em;text-transform:uppercase}
.cal-cell{background:var(--surface);min-height:64px;padding:4px 3px 2px}
.cal-cell.other-month{background:var(--surface-2)}
.cal-date{font-size:10.5px;font-weight:500;color:var(--text-muted);display:inline-flex;width:19px;height:19px;align-items:center;justify-content:center;border-radius:50%;margin-bottom:2px}
.cal-cell.today .cal-date{background:var(--cal-today);color:#fff;font-weight:700}
.cal-cell.other-month .cal-date{opacity:.35}
.cal-event{display:block;font-size:9.5px;font-weight:500;padding:1px 4px;border-radius:3px;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:var(--cal-event);color:var(--cal-event-text)}
.cal-event.orange{background:var(--orange)}
.cal-event.gold{background:var(--gold)}
.cal-event.purple{background:#7C3AED}
.cal-event.teal{background:#2A9D8F}
.cal-event.dim{background:var(--cal-event-dim);color:var(--cal-event-dim-text);filter:grayscale(1);opacity:.5}
.cal-event{cursor:pointer}
