/*
 * GenieSphere 0.1 app styles. Used only by the Core and module pages
 * (core/*, modules/*) and the app shell. Look: the homepage brand (index.html
 * "brand refresh") — navy ink, blue-violet gradients, DM Sans + Playfair
 * Display. Component shapes follow the legacy household hub.
 */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

:root {
  --gs-bg: #F6F8FF;
  --gs-surface: #FFFFFF;
  --gs-surface-soft: #F0F4FF;
  --gs-text: #0B1435;
  --gs-ink: #0B1435;
  --gs-ink-2: #263A70;
  --gs-muted: #5B6584;
  --gs-muted-2: #8C96B3;
  --gs-border: #E2E8F8;
  --gs-border-2: #C8D3EE;

  --gs-accent: #315BFF;
  --gs-accent-dark: #2346E0;
  --gs-accent-deep: #1A2FA8;
  --gs-accent-dim: rgba(49, 91, 255, .08);
  --gs-accent-soft: rgba(49, 91, 255, .05);
  --gs-accent-bd: rgba(49, 91, 255, .22);
  --gs-grad: linear-gradient(115deg, #1234C7, #4934F4);
  --gs-grad-hover: linear-gradient(115deg, #0B248E, #3926CD);
  --gs-grad-spectrum: linear-gradient(100deg, #00BFD9 0%, #2359F5 47%, #8E2AF4 100%);
  --gs-serif: "Playfair Display", Georgia, "Times New Roman", serif;

  --gs-ok-bg: #F0FDFA;     --gs-ok-bd: #99F6E4;     --gs-ok-txt: #0F766E;
  --gs-warn-bg: #FFFBEB;   --gs-warn-bd: #FCD34D;   --gs-warn-txt: #92400E;
  --gs-urgent-bg: #FEF2F2; --gs-urgent-bd: #FECACA; --gs-urgent-txt: #B91C1C;

  --gs-shadow: 0 1px 2px rgba(24, 47, 127, .05), 0 10px 30px rgba(24, 47, 127, .07);
  --gs-shadow-md: 0 18px 55px rgba(24, 47, 127, .12);
  --gs-radius: 18px;
  --gs-radius-lg: 24px;
  --gs-max: 1180px;
  --gs-shell-h: 72px;
  --gs-bottomnav-h: 66px;
}

* { box-sizing: border-box; }
/* Components set display (e.g. .gs-btn is inline-flex); [hidden] must still win. */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  /* The homepage hero's cyan and violet glow, full width at the top of every page. */
  background:
    radial-gradient(ellipse 60% 460px at 12% 0, rgba(0, 214, 236, .11), transparent 70%),
    radial-gradient(ellipse 55% 460px at 88% 0, rgba(132, 42, 255, .09), transparent 70%),
    var(--gs-bg);
  background-repeat: no-repeat;
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--gs-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; }

/* ── Page layout ── */
.gs-shell { max-width: var(--gs-max); margin: 0 auto; padding: 32px 24px 52px; }
.gs-narrow { max-width: 440px; margin: 0 auto; }
.gs-stack > * + * { margin-top: 12px; }
.gs-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gs-spread { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.gs-grow { flex: 1; min-width: 0; }
.gs-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.gs-muted { color: var(--gs-muted); }

/* Page header: eyebrow, big title, subtitle, actions on the right */
.gs-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.gs-eyebrow {
  display: inline-flex; align-items: center; gap: 7px; margin: 0 0 10px;
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gs-accent);
}
.gs-title { font-family: var(--gs-serif); font-size: clamp(32px, 4.5vw, 48px); font-weight: 500; letter-spacing: -.03em; line-height: 1.08; margin: 0 0 10px; color: var(--gs-ink); }
.gs-title em { font-style: normal; background: var(--gs-grad-spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gs-subtitle { color: var(--gs-muted); font-size: 15px; max-width: 560px; margin: 0; line-height: 1.6; }
.gs-section-label {
  display: flex; align-items: center; gap: 12px; margin: 36px 0 14px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gs-muted-2);
}
.gs-section-label::after { content: ''; flex: 1; height: 1px; background: var(--gs-border); }

/* ── Cards and panels ── */
.gs-card {
  background: var(--gs-surface); border: 1px solid var(--gs-border);
  border-radius: var(--gs-radius); box-shadow: var(--gs-shadow); padding: 22px;
}
.gs-panel { background: var(--gs-surface); border: 1px solid var(--gs-border); border-radius: var(--gs-radius-lg); box-shadow: var(--gs-shadow); overflow: hidden; }
/* Panels stacked directly on a page get breathing room (Settings, Nutrition). */
.gs-shell > .gs-panel:not([hidden]) + .gs-panel,
.gs-shell > .gs-panel:not([hidden]) + .gs-panel[hidden] + .gs-panel { margin-top: 24px; }
.gs-shell > .gs-panel + .gs-plan-note { margin-top: 16px; }
.gs-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 24px;
  border-bottom: 1px solid var(--gs-border);
  background: linear-gradient(135deg, rgba(49, 91, 255, .05), rgba(142, 42, 244, .03));
}
.gs-panel-head-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gs-panel-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; color: #fff;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #04CFEA, #315BFF 55%, #8E2AF4); box-shadow: 0 6px 18px rgba(49, 91, 255, .28);
}
.gs-panel-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--gs-ink); }
.gs-panel-sub { margin: 2px 0 0; font-size: 12px; color: var(--gs-muted); }
.gs-panel-body { padding: 20px 24px; }
.gs-panel-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 12px 24px; border-top: 1px solid var(--gs-border); background: var(--gs-surface-soft);
  font-size: 13px; color: var(--gs-muted);
}
.gs-split { display: grid; grid-template-columns: minmax(0, 1fr) 290px; }
.gs-split-side { border-left: 1px solid var(--gs-border); background: var(--gs-surface-soft); padding: 18px 16px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 900px) {
  .gs-split { grid-template-columns: minmax(0, 1fr); }
  .gs-split-side { border-left: 0; border-top: 1px solid var(--gs-border); }
}
.gs-side-label { margin: 0 0 4px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gs-muted-2); }

/* Rows with an icon tile: title + detail on the left, action on the right */
.gs-item-row {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 14px 24px; border-bottom: 1px solid var(--gs-border); text-decoration: none; color: inherit;
  transition: background .13s;
}
.gs-item-row:last-child { border-bottom: 0; }
a.gs-item-row:hover { background: var(--gs-accent-soft); }
.gs-tile {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gs-surface-soft); color: var(--gs-muted);
}
.gs-tile.ok { background: var(--gs-ok-bg); color: var(--gs-ok-txt); }
.gs-tile.warn { background: var(--gs-warn-bg); color: var(--gs-warn-txt); }
.gs-tile.urgent { background: var(--gs-urgent-bg); color: var(--gs-urgent-txt); }
.gs-tile.accent { background: var(--gs-accent-dim); color: var(--gs-accent-deep); }
.gs-item-title { font-size: 14px; font-weight: 600; color: var(--gs-text); line-height: 1.3; }
.gs-item-detail { font-size: 12px; color: var(--gs-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-item-action { font-size: 12px; font-weight: 600; color: var(--gs-accent-dark); white-space: nowrap; text-decoration: none; }
a.gs-item-action:hover { text-decoration: underline; }

/* Compact status chips in the side column */
.gs-stat-chip {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px;
  border: 1px solid var(--gs-border); background: var(--gs-surface); color: var(--gs-text);
  font-size: 13px; text-decoration: none; transition: border-color .14s, background .14s;
}
a.gs-stat-chip:hover { border-color: var(--gs-accent-bd); background: var(--gs-accent-dim); }
.gs-stat-chip .gs-icon { width: 18px; height: 18px; color: var(--gs-accent-dark); }
.gs-stat-chip-title { font-weight: 600; font-size: 12px; }
.gs-stat-chip-sub { font-size: 11px; color: var(--gs-muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Stat cards (overview style): small label, big number, one line of meaning */
.gs-stat { background: var(--gs-surface); border: 1px solid var(--gs-border); border-radius: var(--gs-radius); box-shadow: var(--gs-shadow); padding: 18px 18px 16px; }
.gs-stat-label { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gs-muted); }
.gs-stat-value { margin: 10px 0 6px; font-size: 32px; font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.gs-stat-note { margin: 0; font-size: 12px; color: var(--gs-muted); }

/* Module tiles */
.gs-module {
  display: flex; flex-direction: column; gap: 10px; padding: 22px; text-decoration: none; color: inherit;
  background: var(--gs-surface); border: 1px solid var(--gs-border); border-radius: var(--gs-radius);
  box-shadow: var(--gs-shadow); position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.gs-module::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gs-grad-spectrum); }
.gs-module:hover { transform: translateY(-3px); box-shadow: var(--gs-shadow-md); border-color: var(--gs-border-2); }
.gs-module-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gs-module-name { margin: 0; font-family: var(--gs-serif); font-size: 22px; font-weight: 500; letter-spacing: -.02em; color: var(--gs-ink); }
.gs-module-desc { margin: 0; font-size: 13px; color: var(--gs-muted); line-height: 1.55; }
.gs-module-cta { margin-top: auto; font-size: 13px; font-weight: 700; color: var(--gs-accent-dark); }

/* Status pills */
.gs-pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--gs-surface-soft); color: var(--gs-muted-2); border: 1px solid var(--gs-border);
}
.gs-pill.ok { background: var(--gs-ok-bg); color: var(--gs-ok-txt); border-color: var(--gs-ok-bd); }
.gs-pill.warn { background: var(--gs-warn-bg); color: var(--gs-warn-txt); border-color: var(--gs-warn-bd); }
.gs-pill.urgent { background: var(--gs-urgent-bg); color: var(--gs-urgent-txt); border-color: var(--gs-urgent-bd); }
.gs-pill.accent { background: var(--gs-accent-dim); color: var(--gs-accent-deep); border-color: var(--gs-accent-bd); }
.gs-pill-lg { font-size: 12px; padding: 5px 14px; }

/* ── Forms and buttons ── */
.gs-input {
  font: inherit; font-size: 14px; padding: 11px 16px; min-width: 0;
  border: 1px solid var(--gs-border-2); border-radius: 999px;
  background: var(--gs-surface-soft); color: var(--gs-text); transition: border-color .15s, background .15s;
}
select.gs-input { padding-right: 34px; }
.gs-input:focus { outline: none; border-color: var(--gs-accent); background: var(--gs-surface); box-shadow: 0 0 0 3px var(--gs-accent-dim); }
.gs-label { display: block; font-size: 13px; font-weight: 600; color: var(--gs-text); }
.gs-label .gs-input { margin-top: 6px; width: 100%; }
/* iPhone Safari zooms into any field under 16px when it is tapped, and stays
   zoomed, so the page looks cut off on the right. Phones get 16px fields. */
@media (max-width: 720px) {
  .gs-input, .gs-invite-link-row .gs-input, textarea, select, input { font-size: 16px; }
}
.gs-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--gs-border-2);
  background: transparent; color: var(--gs-text); text-decoration: none;
  transition: filter .15s, transform .12s, background .15s, border-color .15s;
}
.gs-btn:hover { border-color: var(--gs-accent); background: var(--gs-accent-dim); }
.gs-btn-primary { background: var(--gs-grad); border-color: transparent; color: #fff; box-shadow: 0 7px 22px rgba(48, 66, 209, .2); }
.gs-btn-primary:hover { background: var(--gs-grad-hover); border-color: transparent; transform: translateY(-1px); }
.gs-btn-dark { background: linear-gradient(120deg, #0B1435, #162E78); border-color: transparent; color: #fff; }
.gs-btn-dark:hover { background: linear-gradient(120deg, #0B1435, #0B1435); }
.gs-btn:disabled { opacity: .6; cursor: default; transform: none; }
.gs-btn:focus-visible, .gs-input:focus-visible, a:focus-visible { outline: 3px solid #6145FF; outline-offset: 3px; }
.gs-link-btn { font: inherit; font-size: 13px; background: none; border: 0; padding: 0; color: var(--gs-muted); cursor: pointer; text-decoration: underline; }
.gs-link-btn:hover { color: var(--gs-text); }

/* ── Lists ── */
.gs-list { list-style: none; margin: 0; padding: 0; }
.gs-list > li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--gs-border); font-size: 14px; }
.gs-list > li:last-child { border-bottom: 0; }
.gs-list.gs-panel-body { padding: 6px 24px; }
.gs-list input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--gs-accent-dark); flex-shrink: 0; }
.gs-done { text-decoration: line-through; color: var(--gs-muted-2); }
.gs-empty { color: var(--gs-muted); font-size: 14px; }
.gs-status { min-height: 1.2em; margin: 0; font-size: 13px; color: var(--gs-muted); }
/* Page-level status line takes no room until it has a message, so every page
   keeps the same gap between its header and first panel. */
.gs-shell > .gs-status:empty { display: none; }
.gs-shell > .gs-status:not(:empty) { margin: -12px 0 16px; }
.gs-status.gs-error { color: var(--gs-urgent-txt); }

.gs-brand-wordmark { display: block; width: min(100%, 220px); height: auto; object-fit: contain; }

/* ── Dashboard briefing card (homepage "Your day at a glance" style) ── */
.gs-brief {
  display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 28px; margin-bottom: 24px;
  padding: 28px 30px; border-radius: var(--gs-radius-lg); position: relative; overflow: hidden;
  background: linear-gradient(var(--gs-surface), var(--gs-surface)) padding-box, var(--gs-grad-spectrum) border-box;
  border: 1.5px solid transparent; box-shadow: var(--gs-shadow-md);
}
.gs-brief-kicker { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gs-accent); }
.gs-brief-kicker .gs-icon { width: 16px; height: 16px; }
.gs-brief-title { margin: 0 0 16px; font-family: var(--gs-serif); font-size: clamp(26px, 3vw, 34px); font-weight: 500; letter-spacing: -.02em; line-height: 1.15; color: var(--gs-ink); }
.gs-brief-lines { display: grid; gap: 8px; margin-bottom: 20px; }
.gs-brief-line { display: flex; gap: 10px; align-items: baseline; margin: 0; font-size: 15px; line-height: 1.5; color: var(--gs-ink-2); }
.gs-brief-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; transform: translateY(-1px); background: var(--gs-border-2); }
.gs-brief-dot.urgent { background: var(--gs-urgent-txt); }
.gs-brief-dot.warn { background: #D97706; }
.gs-brief-dot.accent { background: var(--gs-accent); }
.gs-brief-actions { margin-bottom: 14px; }
.gs-brief-note { margin: 0; font-size: 12px; color: var(--gs-muted-2); }
.gs-brief-metrics { display: grid; gap: 10px; align-content: center; }
.gs-brief-metric { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--gs-surface-soft); border: 1px solid var(--gs-border); }
.gs-brief-metric-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gs-muted); }
.gs-brief-metric-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--gs-ink); }
@media (max-width: 860px) {
  .gs-brief { grid-template-columns: minmax(0, 1fr); padding: 22px 18px; gap: 18px; }
  .gs-brief-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .gs-brief-metric { flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; }
  .gs-brief-metric-label { font-size: 10px; }
  .gs-brief-metric-value { font-size: 22px; }
  .gs-brief-actions .gs-btn { flex: 1 1 auto; }
}

/* ── Forms ── */
.gs-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.gs-span-2 { grid-column: 1 / -1; }
.gs-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.gs-fieldset legend { padding: 0; margin-bottom: 8px; }
.gs-textarea { border-radius: 16px; resize: vertical; min-height: 84px; line-height: 1.5; }
.gs-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gs-chip { position: relative; display: inline-flex; cursor: pointer; }
.gs-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gs-chip span {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--gs-border-2); background: var(--gs-surface); color: var(--gs-ink-2);
  transition: background .15s, border-color .15s, color .15s;
}
.gs-chip:hover span { border-color: var(--gs-accent-bd); }
.gs-chip input:checked + span { background: var(--gs-accent-dim); border-color: var(--gs-accent); color: var(--gs-accent-deep); font-weight: 600; }
.gs-chip input:focus-visible + span { outline: 3px solid #6145FF; outline-offset: 2px; }
@media (max-width: 720px) { .gs-form-grid { grid-template-columns: minmax(0, 1fr); } }

/* ── Working state ── */
.gs-working-body { display: flex; align-items: center; gap: 18px; padding-top: 28px; padding-bottom: 28px; }
.gs-spinner {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%;
  border: 3px solid var(--gs-accent-dim); border-top-color: var(--gs-accent);
  animation: gs-spin .9s linear infinite;
}
@keyframes gs-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gs-spinner { animation-duration: 2.4s; } }

/* ── Nutrition plan ── */
.gs-macro-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* Segmented control (Nutrition: this week / next week) */
.gs-seg { display: inline-flex; gap: 4px; padding: 4px; margin-top: 14px; border-radius: 999px; background: var(--gs-surface); border: 1px solid var(--gs-border-2); box-shadow: 0 4px 14px rgba(48, 66, 209, .06); }
.gs-seg[hidden] { display: none; }
.gs-seg-btn { font: inherit; font-size: 14px; font-weight: 600; padding: 8px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--gs-ink-2); cursor: pointer; white-space: nowrap; }
.gs-seg-btn:not([aria-pressed="true"]):not(:disabled):hover { color: var(--gs-ink); }
.gs-seg-btn[aria-pressed="true"] { background: var(--gs-grad); color: #fff; box-shadow: 0 6px 18px rgba(48, 66, 209, .2); }
.gs-seg-btn:disabled { cursor: default; opacity: .6; }
.gs-seg-btn:focus-visible { outline: 2px solid var(--gs-accent); outline-offset: 2px; }
.gs-day-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.gs-day-tab {
  font: inherit; font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--gs-border-2); background: var(--gs-surface); color: var(--gs-ink-2);
}
.gs-day-tab:hover { border-color: var(--gs-accent-bd); }
.gs-day-tab[aria-selected="true"] { background: var(--gs-grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(48, 66, 209, .2); }
/* Phones: macros in a 2x2 grid, day tabs scroll sideways. After the base rules so it wins. */
@media (max-width: 720px) {
  .gs-macro-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gs-day-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 2px 16px 6px; }
  .gs-day-tabs::-webkit-scrollbar { display: none; }
  .gs-day-tab { flex-shrink: 0; }
}
.gs-meal-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gs-meal { background: var(--gs-surface); border: 1px solid var(--gs-border); border-radius: var(--gs-radius); box-shadow: var(--gs-shadow); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.gs-meal-type { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gs-accent); }
.gs-meal-time { color: var(--gs-muted-2); letter-spacing: .02em; }
.gs-meal-title { margin: 0; font-family: var(--gs-serif); font-size: 21px; font-weight: 500; letter-spacing: -.01em; line-height: 1.25; color: var(--gs-ink); }
.gs-meal-nutrition { margin: 0; font-size: 12px; color: var(--gs-muted); font-variant-numeric: tabular-nums; }
.gs-meal-warning { margin: 0; padding: 8px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; line-height: 1.4; background: var(--gs-warn-bg); color: var(--gs-warn-txt); border: 1px solid var(--gs-warn-bd); }
.gs-plan-note { margin: 14px 0 0; font-size: 12px; color: var(--gs-muted); }
.gs-meal-details { margin-top: 4px; border-top: 1px solid var(--gs-border); padding-top: 10px; font-size: 13px; color: var(--gs-ink-2); }
.gs-meal-details summary { cursor: pointer; font-weight: 600; color: var(--gs-accent-dark); list-style-position: inside; }
.gs-meal-ingredients, .gs-meal-steps { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 4px; line-height: 1.5; }
.gs-grocery-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 28px; }
.gs-grocery-group .gs-side-label { margin-top: 12px; }
.gs-grocery-group .gs-list > li { padding: 8px 0; font-size: 14px; }

/* ── Sign-in page (core/auth/login.html) ── */
.gs-btn-block { width: 100%; padding-top: 13px; padding-bottom: 13px; font-size: 15px; }
.gs-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.gs-auth-brand {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 44px 56px;
  background: linear-gradient(150deg, #0B1435 0%, #162E78 100%);
}
.gs-auth-brand::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 10% 8%, rgba(0, 214, 236, .28), transparent 70%),
    radial-gradient(ellipse 60% 55% at 95% 90%, rgba(142, 42, 244, .32), transparent 70%);
}
.gs-auth-logo img { height: 44px; width: auto; display: block; filter: brightness(0) invert(1); }
.gs-auth-pitch { max-width: 480px; }
.gs-auth-kicker { margin: 0 0 18px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.gs-auth-headline { margin: 0 0 28px; font-family: var(--gs-serif); font-size: clamp(34px, 3.4vw, 48px); font-weight: 500; letter-spacing: -.02em; line-height: 1.12; }
.gs-auth-headline em { font-style: normal; background: linear-gradient(100deg, #5EEAF4 0%, #8FA8FF 50%, #C9A2FF 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gs-auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.gs-auth-points li { position: relative; padding-left: 28px; font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, .86); }
.gs-auth-points li::before {
  content: ''; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(135deg, #04CFEA, #8E2AF4); box-shadow: 0 0 0 4px rgba(255, 255, 255, .08);
}
.gs-auth-foot { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .6); }
.gs-auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.gs-auth-card { width: 100%; max-width: 400px; }
.gs-auth-logo-mobile { display: none; }
.gs-auth-title { margin: 0 0 6px; font-family: var(--gs-serif); font-size: 40px; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; color: var(--gs-ink); }
.gs-auth-sub { margin: 0 0 28px; font-size: 15px; color: var(--gs-muted); }
.gs-auth-row { display: flex; justify-content: flex-end; margin-top: 8px; }
.gs-auth-link { color: var(--gs-accent); font-weight: 600; font-size: 14px; text-decoration: none; }
.gs-auth-link:hover { text-decoration: underline; }
.gs-auth-alt { margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--gs-border); font-size: 14px; color: var(--gs-muted); text-align: center; }
@media (max-width: 860px) {
  .gs-auth { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .gs-auth-brand { display: none; }
  .gs-auth-form-wrap { padding: 40px 20px 32px; align-items: flex-start; }
  .gs-auth-logo-mobile { display: block; margin-bottom: 36px; }
  .gs-auth-logo-mobile img { height: 40px; width: auto; display: block; }
  .gs-auth-title { font-size: 34px; }
}

/* ── Settings: household members and invitations ── */
.gs-people > li.gs-person { gap: 14px; padding: 14px 0; }
.gs-person-avatar { width: 38px; height: 38px; font-size: 15px; flex-shrink: 0; }
.gs-person .gs-item-title { margin: 0; }
.gs-person .gs-item-detail { margin: 2px 0 0; overflow-wrap: anywhere; white-space: normal; overflow: visible; text-overflow: clip; }
.gs-input[readonly] { background: transparent; color: var(--gs-muted); border-style: dashed; }
.gs-invite-link-row .gs-input[readonly] { background: var(--gs-surface); color: var(--gs-text); border-style: solid; }
.gs-invite-result { margin: 0 24px 22px; padding: 18px 20px; border-radius: 18px; background: var(--gs-accent-soft); border: 1px solid var(--gs-accent-bd); }
.gs-invite-result[hidden] { display: none; }
.gs-invite-result-title { margin: 0 0 12px; font-weight: 700; color: var(--gs-ink); }
.gs-invite-link-row { display: flex; gap: 8px; }
.gs-invite-link-row .gs-input { flex: 1; font-size: 13px; background: var(--gs-surface); }
.gs-invite-result-note { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--gs-muted); }
.gs-invite-from { margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gs-accent); }
.gs-hint { margin: 6px 0 0; font-size: 13px; color: var(--gs-muted); }
.gs-label-hint { font-weight: 500; color: var(--gs-muted); }
.gs-invite-result-title + .gs-invite-result-note { margin: 0 0 12px; }
.gs-invite-show-link { font-weight: 600; color: var(--gs-accent); text-decoration: none; }
.gs-invite-show-link:hover { text-decoration: underline; color: var(--gs-accent-dark); }
.gs-invite-link-row[hidden] { display: none; }
.gs-person-actions { display: flex; gap: 16px; flex-shrink: 0; }
@media (max-width: 720px) {
  .gs-invite-result { margin: 0 16px 18px; padding: 16px; }
  .gs-invite-link-row { flex-wrap: wrap; }
  .gs-invite-link-row .gs-input { flex-basis: 100%; }
  .gs-invite-link-row .gs-btn { flex: 1; }
}

/* ── Tasks (core/tasks) and Home upkeep (modules/home) ── */
.gs-btn-sm { padding: 7px 14px; font-size: 13px; }
.gs-icon-btn {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; border: 1px solid transparent; background: transparent;
  font: 400 22px/1 inherit; color: var(--gs-muted-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.gs-icon-btn-spacer { visibility: hidden; pointer-events: none; }
.gs-icon-btn:hover { color: var(--gs-urgent-txt); background: var(--gs-urgent-bg); border-color: var(--gs-urgent-bd); }
.gs-task-form { display: grid; grid-template-columns: minmax(0, 1fr) 170px 170px auto; gap: 12px; align-items: end; }
.gs-task-form-btn { height: 44px; }
.gs-task-groups { display: grid; gap: 18px; }
.gs-task-group .gs-side-label { margin-bottom: 2px; }
.gs-task-group-overdue .gs-side-label { color: var(--gs-urgent-txt); }
.gs-task-list > li.gs-task, .gs-upkeep-list > li.gs-upkeep { gap: 14px; padding: 14px 0; }
.gs-task-main, .gs-upkeep-main { flex: 1 1 auto; min-width: 0; }
.gs-task-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--gs-ink); overflow-wrap: anywhere; }
.gs-task-meta { margin: 3px 0 0; font-size: 13px; color: var(--gs-muted); display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.gs-task-source { font-size: 10px; padding: 2px 8px; }
.gs-task-who { width: auto; min-width: 120px; padding: 7px 30px 7px 12px; font-size: 13px; flex-shrink: 0; }
.gs-task-done .gs-task-title { text-decoration: line-through; color: var(--gs-muted-2); font-weight: 500; }
.gs-upkeep-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.gs-upkeep-every { width: auto; padding: 7px 30px 7px 12px; font-size: 13px; }
.gs-upkeep-last { width: auto; padding: 7px 30px 7px 12px; font-size: 13px; flex-shrink: 0; }
.gs-upkeep-setup .gs-upkeep-every { flex-shrink: 0; }
.gs-upkeep-off .gs-upkeep-main { opacity: .55; }
.gs-upkeep-off .gs-upkeep-every, .gs-upkeep-off .gs-upkeep-last { opacity: .45; pointer-events: none; }
.gs-upkeep input[type="checkbox"], .gs-task input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--gs-accent-dark); flex-shrink: 0; }
@media (max-width: 720px) {
  .gs-task-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .gs-task-form-title, .gs-task-form-btn { grid-column: 1 / -1; }
  .gs-task-list > li.gs-task, .gs-upkeep-list > li.gs-upkeep { flex-wrap: wrap; }
  .gs-task .gs-task-main { flex-basis: calc(100% - 80px); }
  .gs-task .gs-task-who { margin-left: 34px; }
  .gs-upkeep .gs-upkeep-main { flex-basis: calc(100% - 140px); }
  .gs-upkeep-actions { width: 100%; justify-content: flex-start; }
  .gs-upkeep-setup .gs-upkeep-every, .gs-upkeep-setup .gs-upkeep-last { margin-left: 34px; }
  .gs-upkeep-setup .gs-upkeep-every, .gs-upkeep-setup .gs-upkeep-last { flex: 0 1 220px; }
}

/* ── App shell (shared/components/gs-shell.js) ── */
.gs-topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(248, 250, 255, .9);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid var(--gs-border);
}
.gs-topbar-inner {
  max-width: var(--gs-max); margin: 0 auto; padding: 0 24px;
  height: var(--gs-shell-h); display: flex; align-items: center; gap: 28px;
}
.gs-topbar-brand { display: flex; align-items: center; flex-shrink: 0; }
.gs-topbar-brand img { height: 42px; width: auto; display: block; }
.gs-topnav { display: flex; gap: 2px; flex: 1; min-width: 0; }
.gs-nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 12px; border: 1px solid transparent;
  color: var(--gs-muted); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.gs-nav-link:hover { color: var(--gs-text); background: var(--gs-surface-soft); }
.gs-nav-link.is-active { color: var(--gs-accent-deep); background: var(--gs-accent-dim); border-color: var(--gs-accent-bd); }
.gs-topnav .gs-icon { width: 17px; height: 17px; }
.gs-icon {
  width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}

.gs-account { position: relative; margin-left: auto; }
.gs-account-btn {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 5px;
  border-radius: 999px; border: 1px solid var(--gs-border-2); background: var(--gs-surface);
  font: inherit; font-size: 13px; font-weight: 600; color: var(--gs-text); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.gs-account-btn:hover { border-color: var(--gs-accent); background: var(--gs-accent-soft); }
.gs-avatar {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--gs-grad); color: #fff; font-weight: 700; font-size: 13px;
}
.gs-account-label { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-account-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
  min-width: 240px; max-width: min(320px, calc(100vw - 32px));
  background: var(--gs-surface); border: 1px solid var(--gs-border); border-radius: 16px;
  box-shadow: var(--gs-shadow-md); padding: 6px;
}
.gs-account-menu[hidden] { display: none; }
.gs-account-who {
  margin: 0 0 4px; padding: 10px 12px 12px; font-size: 13px; color: var(--gs-muted);
  border-bottom: 1px solid var(--gs-border); overflow-wrap: anywhere;
}
.gs-menu-item {
  display: block; width: 100%; text-align: left; font: inherit; font-size: 14px; font-weight: 500;
  padding: 10px 12px; border: 0; border-radius: 10px; background: none;
  color: var(--gs-text); text-decoration: none; cursor: pointer;
}
.gs-menu-item:hover { background: var(--gs-surface-soft); }
.gs-menu-item[aria-current="page"] { color: var(--gs-accent-deep); background: var(--gs-accent-dim); }
.gs-menu-item[hidden] { display: none; }

.gs-bottomnav { display: none; }
@media (max-width: 720px) {
  .gs-shell { padding: 22px 16px 40px; }
  .gs-topbar-inner { padding: 0 16px; }
  .gs-topnav { display: none; }
  .gs-account-label { display: none; }
  .gs-account-btn { padding: 0 5px; }
  .gs-panel-head, .gs-panel-body, .gs-list.gs-panel-body, .gs-item-row, .gs-panel-foot { padding-left: 16px; padding-right: 16px; }
  .gs-panel-sub { display: none; }
  /* Long titles keep the full width; a pill or button beside them drops to
     a second line, lined up under the title instead of squeezing it. */
  .gs-panel-head { flex-wrap: wrap; row-gap: 10px; }
  .gs-panel-head-left { flex: 1 1 210px; }
  .gs-panel-head > .gs-pill, .gs-panel-head > .gs-btn { margin-left: 52px; }
  .gs-item-row { grid-template-columns: 36px minmax(0, 1fr); }
  .gs-item-row .gs-item-action { display: none; }  /* the whole row is the link */
  .gs-page-header { margin-bottom: 20px; }
  .gs-bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    background: #fff; border-top: 1px solid var(--gs-border);   /* solid: page text must not show through */
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .04);
  }
  .gs-bottomnav .gs-nav-link {
    flex-direction: column; justify-content: center; gap: 3px; padding: 6px 2px; border-radius: 10px;
    font-size: 10px; font-weight: 700; color: var(--gs-muted-2);
  }
  .gs-bottomnav .gs-nav-link.is-active { color: var(--gs-accent-deep); }
  body.gs-has-shell { padding-bottom: calc(var(--gs-bottomnav-h) + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .gs-module, .gs-btn, .gs-item-row, .gs-nav-link { transition: none; }
  .gs-module:hover, .gs-btn-primary:hover { transform: none; }
}

/* Notifications (core/notifications) */
.gs-note-list.gs-panel-body { padding-top: 4px; padding-bottom: 4px; }
.gs-note-list > li.gs-note { padding: 0; }
.gs-note-link { display: flex; align-items: flex-start; gap: 14px; width: 100%; padding: 14px 0; color: inherit; text-decoration: none; }
.gs-note-link:hover .gs-note-title { color: var(--gs-accent-deep); }
.gs-note .gs-tile { width: 36px; height: 36px; border-radius: 11px; }
.gs-note .gs-tile .gs-icon { width: 18px; height: 18px; }
.gs-note-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gs-note-title { font-size: 15px; font-weight: 500; color: var(--gs-text); overflow-wrap: anywhere; }
.gs-note-unread .gs-note-title { font-weight: 700; }
.gs-note-body { font-size: 13px; color: var(--gs-muted); overflow-wrap: anywhere; }
.gs-note-meta { font-size: 12px; color: var(--gs-muted); }
.gs-note-dot { width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: var(--gs-accent); flex-shrink: 0; }
.gs-pref-list { display: flex; flex-direction: column; }
.gs-pref { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--gs-border); cursor: pointer; }
.gs-pref:last-child { border-bottom: 0; }
.gs-pref-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gs-pref-title { font-size: 15px; font-weight: 600; color: var(--gs-text); }
.gs-pref-sub { font-size: 13px; line-height: 1.45; color: var(--gs-muted); }
.gs-switch {
  appearance: none; -webkit-appearance: none; flex-shrink: 0; position: relative; margin: 0;
  width: 46px; height: 28px; border-radius: 999px; background: #CBD3EA; cursor: pointer; transition: background .15s;
}
.gs-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(11, 20, 53, .25); transition: transform .15s;
}
.gs-switch:checked { background: var(--gs-accent-dark); }
.gs-switch:checked::after { transform: translateX(18px); }
.gs-switch:disabled { opacity: .55; cursor: default; }
.gs-switch:focus-visible { outline: 2px solid var(--gs-accent); outline-offset: 2px; }
.gs-account-btn { position: relative; }
.gs-badge {
  position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #E5484D; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  border: 2px solid var(--gs-surface); box-sizing: content-box;
}
.gs-badge[hidden] { display: none; }
.gs-menu-count { float: right; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--gs-accent-dim); color: var(--gs-accent-deep); font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }

/* Date fields: iPhone Safari gives them a wide native minimum and its own
   height, which pushed "Due" over "Who" on the Tasks form. */
input.gs-input[type="date"] {
  -webkit-appearance: none; appearance: none; min-width: 0; width: 100%;
  min-height: 44px; text-align: left; display: block;
}
input.gs-input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.gs-task-form > label { min-width: 0; }
.gs-task-form .gs-input { height: 44px; box-sizing: border-box; }

/* Home Genie: homes and vehicles (modules/home) */
.gs-page-header .gs-seg { flex-wrap: wrap; }
.gs-asset .gs-panel-title { font-size: 18px; }
.gs-asset-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.gs-asset-use { font-size: 11px; padding: 2px 9px; }
.gs-use-business { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }
.gs-asset-empty { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.gs-asset-empty .gs-empty { margin: 0; }
.gs-asset-foot .gs-link-btn { font-weight: 600; color: var(--gs-accent-deep); text-decoration: none; }
.gs-asset-foot .gs-link-btn:hover { text-decoration: underline; }
.gs-asset-foot .gs-link-quiet { color: var(--gs-muted); font-weight: 500; }
.gs-asset-tools { display: inline-flex; gap: 18px; align-items: center; }
.gs-upkeep-add { border-top: 1px solid var(--gs-border); padding-top: 16px; }
.gs-seg-inline { margin-top: 0; box-shadow: none; }
.gs-asset-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.gs-asset-form > .gs-seg, .gs-asset-form-btn { grid-column: 1 / -1; justify-self: start; }
.gs-asset-form > label { min-width: 0; }
.gs-asset-form .gs-input { height: 44px; box-sizing: border-box; }
.gs-asset-form > label[hidden] { display: none; }
@media (max-width: 720px) {
  .gs-asset-form { grid-template-columns: minmax(0, 1fr); }
  .gs-asset-form-btn { justify-self: stretch; }
  .gs-seg-inline { display: flex; }
  .gs-seg-inline .gs-seg-btn { flex: 1 1 0; }
}

/* ── Genie (core/genie) ── */
.gs-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gs-link-more { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--gs-accent-deep); text-decoration: none; }
.gs-link-more:hover { text-decoration: underline; }
.gs-genie-brief { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gs-genie-brief-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--gs-border); border-left-width: 4px; border-radius: 14px; background: var(--gs-surface); }
.gs-genie-brief-row.gs-tone-overdue { border-left-color: var(--gs-urgent-txt); }
.gs-genie-brief-row.gs-tone-week { border-left-color: var(--gs-accent); }
.gs-genie-brief-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gs-genie-brief-title { font-weight: 600; color: var(--gs-ink); overflow-wrap: anywhere; }
.gs-genie-brief-meta { font-size: 13px; color: var(--gs-muted); }
.gs-tone-overdue .gs-genie-brief-meta { color: var(--gs-urgent-txt); }
.gs-genie-brief-empty { font-size: 14px; color: var(--gs-muted); padding: 4px 2px; }
.gs-genie-mark { background: var(--gs-grad-spectrum); color: #fff; }
.gs-genie-chat { display: flex; flex-direction: column; gap: 14px; }
.gs-genie-msg { display: flex; gap: 10px; align-items: flex-start; max-width: 100%; }
.gs-genie-msg > .gs-genie-ico { flex: 0 0 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--gs-grad-spectrum); color: #fff; }
.gs-genie-msg > .gs-genie-ico .gs-icon { width: 16px; height: 16px; }
.gs-genie-bubble { min-width: 0; flex: 1 1 auto; font-size: 15px; line-height: 1.5; color: var(--gs-text); }
.gs-genie-bubble > p { margin: 0 0 8px; white-space: pre-line; }
.gs-genie-bubble > p:last-of-type { margin-bottom: 0; }
.gs-genie-genie .gs-genie-bubble { background: var(--gs-surface-soft); border: 1px solid var(--gs-border); border-radius: 4px 18px 18px 18px; padding: 12px 14px; }
.gs-genie-me { justify-content: flex-end; }
.gs-genie-me .gs-genie-bubble { flex: 0 1 auto; max-width: 85%; background: var(--gs-grad); color: #fff; border-radius: 18px 4px 18px 18px; padding: 10px 14px; }
.gs-genie-thinking .gs-genie-bubble { color: var(--gs-muted); font-style: italic; }
.gs-genie-error .gs-genie-bubble { background: var(--gs-urgent-bg); border-color: var(--gs-urgent-bd); color: var(--gs-urgent-txt); }
.gs-genie-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.gs-genie-chip { font: inherit; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--gs-accent-bd); background: var(--gs-accent-soft); color: var(--gs-accent-deep); cursor: pointer; text-align: left; }
.gs-genie-chip:hover { background: var(--gs-accent-dim); }
.gs-genie-ask { display: flex; gap: 8px; align-items: flex-end; margin-top: 16px; }
.gs-genie-input { flex: 1 1 auto; resize: none; border-radius: 22px; min-height: 46px; max-height: 160px; line-height: 1.4; padding: 12px 16px; font-size: 16px; }
.gs-genie-send { flex: 0 0 auto; min-height: 46px; }
.gs-genie-card { margin-top: 10px; background: var(--gs-surface); border: 1px solid var(--gs-border); border-radius: 16px; padding: 12px 14px; box-shadow: var(--gs-shadow); }
.gs-genie-card-head { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gs-accent-deep); }
.gs-genie-card-head .gs-icon { width: 14px; height: 14px; }
.gs-genie-card-title { margin: 6px 0 0; font-weight: 700; color: var(--gs-ink); overflow-wrap: anywhere; }
.gs-genie-card-meta { margin: 2px 0 0; font-size: 13px; color: var(--gs-muted); }
.gs-genie-card-items { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.gs-genie-draft { margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--gs-surface-soft); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.gs-genie-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.gs-genie-card-note { font-size: 13px; color: var(--gs-muted); }
.gs-genie-card-ok { font-size: 13px; font-weight: 700; color: var(--gs-ok-txt); }
.gs-genie-card-done { border-color: var(--gs-ok-bd); background: var(--gs-ok-bg); }
.gs-genie-card-dismissed { opacity: .55; }
.gs-genie-can { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; color: var(--gs-text); }
.gs-genie-never { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--gs-warn-bg); border: 1px solid var(--gs-warn-bd); color: var(--gs-warn-txt); font-size: 14px; }
@media (max-width: 640px) {
  .gs-genie-me .gs-genie-bubble { max-width: 92%; }
  .gs-genie-card-foot .gs-btn { flex: 1 1 auto; }
}

/* ── Floating Genie (ADR-023): button on every page, chat in a sheet ── */
.gs-genie-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 45;
  width: 58px; height: 58px; border: 0; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gs-grad-spectrum); color: #fff;
  box-shadow: 0 10px 28px rgba(35, 89, 245, .35), 0 2px 6px rgba(24, 47, 127, .18);
  transition: transform .15s ease, box-shadow .15s ease;
}
.gs-genie-fab .gs-icon { width: 26px; height: 26px; }
.gs-genie-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(35, 89, 245, .42), 0 2px 6px rgba(24, 47, 127, .18); }
.gs-genie-fab:focus-visible { outline: 3px solid var(--gs-accent-bd); outline-offset: 3px; }
.gs-genie-fab[aria-busy="true"] { opacity: .7; cursor: progress; }
body.gs-has-genie-fab .gs-shell { padding-bottom: 96px; }   /* last row never sits under the button */
html.gs-genie-open .gs-genie-fab { display: none; }

html.gs-genie-open, html.gs-genie-open body { overflow: hidden; }
.gs-genie-sheet { position: fixed; inset: 0; z-index: 60; }
.gs-genie-sheet[hidden] { display: none; }
.gs-genie-sheet-backdrop { position: absolute; inset: 0; background: rgba(12, 22, 60, .28); }
.gs-genie-sheet-panel {
  position: absolute; right: 24px; bottom: 24px; width: 420px;
  height: min(720px, calc(100vh - 48px)); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--gs-surface); border: 1px solid var(--gs-border); border-radius: 22px;
  box-shadow: var(--gs-shadow-md);
  animation: gs-genie-in .18s ease-out;
}
@keyframes gs-genie-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.gs-genie-sheet-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 14px 18px; border-bottom: 1px solid var(--gs-border);
}
.gs-genie-sheet-titles { flex: 1 1 auto; min-width: 0; }
.gs-genie-sheet-title { margin: 0; font-weight: 800; font-size: 17px; color: var(--gs-ink); }
.gs-genie-sheet-sub { margin: 1px 0 0; font-size: 12px; color: var(--gs-muted); }
.gs-genie-sheet-full { font-size: 13px; font-weight: 700; color: var(--gs-accent-deep); text-decoration: none; white-space: nowrap; }
.gs-genie-sheet-full:hover { text-decoration: underline; }
.gs-genie-sheet-close {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--gs-border);
  background: var(--gs-surface); color: var(--gs-muted); font-size: 24px; line-height: 1; cursor: pointer;
}
.gs-genie-sheet-close:hover { color: var(--gs-ink); background: var(--gs-surface-soft); }
.gs-genie-sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px; -webkit-overflow-scrolling: touch; }
.gs-genie-sheet-body .gs-genie-suggest { margin-top: 14px; }
.gs-genie-sheet-foot { flex: 0 0 auto; padding: 10px 14px 12px; border-top: 1px solid var(--gs-border); background: var(--gs-surface); }
.gs-genie-sheet-foot .gs-genie-ask { margin-top: 0; }
.gs-genie-sheet-foot .gs-genie-usage { margin: 6px 4px 0; font-size: 12px; }
.gs-genie-sheet-foot .gs-genie-usage:empty { display: none; }

@media (max-width: 720px) {
  .gs-genie-fab { right: 16px; bottom: calc(var(--gs-bottomnav-h) + env(safe-area-inset-bottom, 0px) + 14px); width: 54px; height: 54px; }
  body.gs-has-genie-fab .gs-shell { padding-bottom: 84px; }
  /* Phone: a sheet over almost the whole screen that follows the visible
     viewport, so the typing box stays above the keyboard. */
  .gs-genie-sheet-panel {
    left: 0; right: 0; bottom: auto; width: auto; max-height: none;
    top: calc(var(--gs-vvt, 0px) + 36px);
    height: calc(var(--gs-vvh, 100dvh) - 36px);
    border-radius: 22px 22px 0 0; border-bottom: 0;
    animation-name: gs-genie-up;
  }
  @keyframes gs-genie-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .gs-genie-sheet-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .gs-genie-sheet-body { padding: 16px 14px; }
  .gs-genie-sheet-sub { display: none; }
  .gs-genie-sheet-head .gs-panel-icon { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .gs-genie-fab, .gs-genie-sheet-panel { transition: none; animation: none; }
}

/* ── Snap a meal (Nutrition, ADR-025) ── */
.gs-snap { margin-bottom: 22px; }
.gs-snap-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gs-snap-actions .gs-btn { cursor: pointer; }
.gs-snap-actions .gs-btn.is-disabled { opacity: .55; pointer-events: none; }
.gs-snap-result { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px 22px; align-items: start; }
.gs-snap-photo { width: 180px; aspect-ratio: 1; object-fit: cover; border-radius: 16px; border: 1px solid var(--gs-border); grid-row: span 2; }
.gs-snap-wait, .gs-snap-error { display: flex; align-items: center; gap: 10px; color: var(--gs-muted); font-size: 15px; padding-top: 8px; }
.gs-snap-error { color: var(--gs-urgent-txt); }
.gs-snap-info { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.gs-snap-dish { margin: 0; font-weight: 700; font-size: 17px; color: var(--gs-ink); }
.gs-snap-total { margin: 2px 0 0; font-family: var(--gs-serif); font-size: 34px; line-height: 1.1; color: var(--gs-ink); letter-spacing: -.01em; }
.gs-snap-macros { margin: 0 0 6px; font-size: 14px; color: var(--gs-muted); }
.gs-snap-allergen { grid-column: 1 / -1; padding: 12px 14px; border-radius: 14px; background: var(--gs-urgent-bg); border: 1px solid var(--gs-urgent-bd); color: var(--gs-urgent-txt); font-size: 14px; line-height: 1.45; }
.gs-snap-items { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--gs-border); }
.gs-snap-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--gs-border); }
.gs-snap-item.is-removed .gs-snap-item-name { text-decoration: line-through; color: var(--gs-muted); }
.gs-snap-item-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gs-snap-item-name { font-weight: 600; color: var(--gs-ink); overflow-wrap: anywhere; }
.gs-snap-item-sub { font-size: 13px; color: var(--gs-muted); }
.gs-snap-step { flex: 0 0 auto; display: inline-flex; align-items: center; border: 1px solid var(--gs-border-2); border-radius: 999px; overflow: hidden; }
.gs-snap-step-btn { width: 36px; height: 36px; border: 0; background: var(--gs-surface-soft); color: var(--gs-ink); font-size: 18px; cursor: pointer; }
.gs-snap-step-btn:disabled { color: var(--gs-muted-2); cursor: default; }
.gs-snap-step-val { min-width: 40px; text-align: center; font-size: 14px; font-weight: 700; color: var(--gs-ink); }
.gs-snap-drop { flex: 0 0 auto; border: 0; background: none; color: var(--gs-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 8px 4px; }
.gs-snap-drop:hover { color: var(--gs-ink); }
.gs-snap-note { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--gs-muted); }
.gs-snap-result > .gs-hint { grid-column: 1 / -1; margin: 0; }
@media (max-width: 720px) {
  .gs-snap .gs-panel-sub { display: block; }
  .gs-snap-actions { width: 100%; margin-left: 0 !important; }
  .gs-snap-actions .gs-btn { flex: 1 1 0; justify-content: center; }
  .gs-snap-result { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
  .gs-snap-photo { width: 96px; grid-row: auto; }
  .gs-snap-total { font-size: 28px; }
  .gs-snap-item { flex-wrap: wrap; row-gap: 8px; }
  .gs-snap-item-main { flex-basis: 100%; }
  .gs-snap-step-btn { width: 40px; height: 40px; }
}

/* ── Plate scanner (meal-photo.js): live camera, guide frame, scan line ── */
html.gs-scan-open, html.gs-scan-open body { overflow: hidden; }
html.gs-scan-open .gs-genie-fab { display: none; }
.gs-scan { position: fixed; inset: 0; z-index: 80; background: #05081a; color: #fff; overflow: hidden; --gs-scan-size: min(82vw, 58vh, 520px); }
.gs-scan-video, .gs-scan-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gs-scan-still { inset: auto; left: 50%; top: 46%; width: var(--gs-scan-size); height: var(--gs-scan-size); transform: translate(-50%, -50%); border-radius: 26px; }
.gs-scan.is-scanning .gs-scan-video, .gs-scan.is-error .gs-scan-video { visibility: hidden; }
/* Darkens everything outside the guide square. */
.gs-scan-shade { position: absolute; left: 50%; top: 46%; width: var(--gs-scan-size); height: var(--gs-scan-size); transform: translate(-50%, -50%); border-radius: 26px; box-shadow: 0 0 0 200vmax rgba(5, 8, 26, .62); pointer-events: none; }
.gs-scan-frame { position: absolute; left: 50%; top: 46%; width: var(--gs-scan-size); height: var(--gs-scan-size); transform: translate(-50%, -50%); border-radius: 26px; overflow: hidden; pointer-events: none; }
.gs-scan-corner { position: absolute; width: 44px; height: 44px; border: 4px solid #fff; filter: drop-shadow(0 0 6px rgba(94, 234, 244, .7)); }
.gs-scan-tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 26px; }
.gs-scan-tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 26px; }
.gs-scan-bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 26px; }
.gs-scan-br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 26px; }
.gs-scan-line {
  position: absolute; left: 6%; right: 6%; top: 0; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, #5EEAF4 20%, #fff 50%, #C9A2FF 80%, transparent);
  box-shadow: 0 0 18px 4px rgba(94, 234, 244, .55), 0 -40px 60px rgba(94, 234, 244, .12);
  animation: gs-scan-sweep 2.4s ease-in-out infinite alternate;
}
.gs-scan.is-scanning .gs-scan-line { animation-duration: 1.1s; }
.gs-scan.is-scanning .gs-scan-frame::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .35) 1px, transparent 1.4px); background-size: 18px 18px;
  animation: gs-scan-pulse 1.1s ease-in-out infinite alternate;
}
.gs-scan.is-error .gs-scan-line, .gs-scan.is-error .gs-scan-frame::after { display: none; }
@keyframes gs-scan-sweep { from { top: 2%; } to { top: calc(98% - 3px); } }
@keyframes gs-scan-pulse { from { opacity: .15; } to { opacity: .55; } }
.gs-scan-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px 20px; }
.gs-scan-title { font-weight: 700; font-size: 17px; letter-spacing: .01em; }
.gs-scan-close { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.gs-scan-hint { position: absolute; left: 20px; right: 20px; top: calc(46% + var(--gs-scan-size) / 2 + 18px); margin: 0; text-align: center; font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, .92); text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.gs-scan-bar { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 18px 24px calc(22px + env(safe-area-inset-bottom, 0px)); }
.gs-scan-side { justify-self: start; color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; padding: 10px 4px; }
.gs-scan-shutter { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 5px; cursor: pointer; }
.gs-scan-shutter > span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--gs-grad-spectrum); transition: transform .12s ease; }
.gs-scan-shutter:active > span { transform: scale(.9); }
.gs-scan-shutter:disabled { opacity: .45; cursor: default; }
.gs-scan.is-scanning .gs-scan-bar, .gs-scan.is-error .gs-scan-bar { visibility: hidden; }
.gs-scan-error { position: absolute; left: 20px; right: 20px; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); padding: 18px; border-radius: 20px; background: rgba(255, 255, 255, .96); color: var(--gs-ink); }
.gs-scan-error p { margin: 0 0 14px; font-size: 15px; line-height: 1.45; }
.gs-scan-error-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.gs-scan-error-actions .gs-btn { flex: 1 1 0; justify-content: center; cursor: pointer; }
.gs-scan.is-error .gs-scan-hint { display: none; }
@media (prefers-reduced-motion: reduce) {
  .gs-scan-line { animation: none; top: 50%; }
  .gs-scan.is-scanning .gs-scan-frame::after { animation: none; opacity: .3; }
}

