@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/inter-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/space-grotesk-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   APOLLO SUITE — shared dark design system
   One system, four apps. Each app overrides --accent only.
   Header type: Space Grotesk · Body type: Inter
   ============================================================ */

:root {
  /* registered Apollo palette */
  --bg:        #171719;   /* canvas */
  --surface:   #202023;   /* raised surface */
  --surface-2: #303035;   /* surface muted */
  --fg:        #e4e4e7;   /* primary text */
  --text-2:    #b9b9c4;   /* secondary text */
  --muted:     #b9b9c4;   /* legacy alias → secondary text */
  --border:    #3a3a42;   /* hairline */
  --focus:     #93c5fd;   /* shared focus / cross-suite accent */

  /* functional state colour — destructive / error only (not brand) */
  --danger:       oklch(0.70 0.16 25);
  --danger-text:  oklch(0.86 0.07 25);
  --danger-solid: oklch(0.48 0.16 25);

  --page-bg:   #171719;

  /* per-app accent slots — overridden in each app file */
  --accent:       var(--focus);
  --accent-solid: var(--focus);
  --accent-ink:   #171719;

  --accent-soft: color-mix(in oklch, var(--accent) 16%, transparent);
  --accent-line: color-mix(in oklch, var(--accent) 40%, var(--border));
  --fg-soft:     color-mix(in oklch, var(--fg) 6%, transparent);
  --ink-soft:    color-mix(in oklch, var(--accent-solid) 12%, transparent);

  --font-display: 'Space Grotesk', 'SF Pro Display', system-ui, -apple-system, 'Segoe UI', Helvetica Neue, Arial, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'SF Pro Text', 'Segoe UI', Helvetica Neue, Arial, sans-serif;
  --font-mono:    'Space Grotesk', ui-monospace, 'SF Mono', Menlo, monospace;

  --fs-h1: 26px;
  --fs-h2: 20px;
  --fs-h3: 16px;
  --fs-body: 15px;
  --fs-meta: 12px;

  --radius-card: 8px;
  --radius-pill: 999px;

  --ease: cubic-bezier(0.2, 0, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background:
    radial-gradient(70% 55% at 50% -10%, color-mix(in oklch, var(--accent) 10%, var(--page-bg)) 0%, var(--page-bg) 62%),
    var(--page-bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

/* ─── stage + caption ─────────────────────────────────────────── */
.stage { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.caption {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.caption::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.caption strong { color: var(--fg); font-weight: 600; }

/* ─── device frame (iPhone 15 Pro, 390 × 844) ─────────────────── */
.device {
  position: relative;
  width: 390px; height: 844px;
  border-radius: 56px;
  padding: 12px;
  background: linear-gradient(160deg, #3a3a42 0%, #202023 48%, #000 100%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.07) inset,
    0 0 0 2px #000 inset,
    0 34px 70px -16px rgba(0,0,0,0.75),
    0 10px 24px -10px rgba(0,0,0,0.6);
  isolation: isolate;
}
.device::before, .device::after {
  content: '';
  position: absolute;
  width: 3px;
  background: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.10) 8%, transparent 16%, transparent 84%, rgba(255,255,255,0.06) 92%, transparent 100%);
  top: 100px; bottom: 100px;
  pointer-events: none;
}
.device::before { left: -1px; }
.device::after  { right: -1px; }

.island {
  position: absolute;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  width: 124px; height: 36px;
  background: #000;
  border-radius: 999px;
  z-index: 5;
}
.btn-rail { position: absolute; width: 4px; background: #000; border-radius: 2px; }
.btn-rail.left-1  { left: -3px; top: 174px; height: 32px; }
.btn-rail.left-2  { left: -3px; top: 220px; height: 60px; }
.btn-rail.left-3  { left: -3px; top: 290px; height: 60px; }
.btn-rail.right-1 { right: -3px; top: 250px; height: 100px; }

/* ─── screen surface ──────────────────────────────────────────── */
.screen {
  position: relative;
  width: 100%; height: 100%;
  background: var(--bg);
  border-radius: 44px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.statusbar {
  flex: 0 0 47px;
  padding: 18px 26px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.statusbar .right { display: inline-flex; align-items: center; gap: 6px; }
.statusbar svg { width: 17px; height: 11px; fill: var(--fg); }
.statusbar .battery { width: 25px; }

.content {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 6px 0 26px;
}
.content::-webkit-scrollbar { display: none; }

.home-indicator { flex: 0 0 28px; position: relative; }
.home-indicator::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 8px;
  transform: translateX(-50%);
  width: 134px; height: 5px;
  background: var(--fg);
  border-radius: 999px;
  opacity: 0.85;
}

/* ─── layout primitives ───────────────────────────────────────── */
.pad { padding-inline: 20px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid-2 > *, .grid-3 > * { min-width: 0; }

.header {
  padding: 10px 20px 12px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.header h1 {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0;
}
.icon-btn {
  width: 36px; height: 36px; flex: none;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--fg);
  cursor: pointer;
  transition: background 150ms var(--ease), border-color 150ms var(--ease);
}
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--accent-line); }

/* ─── app bar (icon · page statement · action) ────────────────── */
.appbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 10px;
  padding: 4px 18px 12px;
}
.appbar .mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  overflow: hidden;
}
.appbar .mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.appbar .status {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.appbar .status::before {
  content: '';
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.appbar .icon-btn { width: 34px; height: 34px; justify-self: end; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 0 0 6px;
}
.h2 { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
.h3 { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 600; line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
.meta { font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--text-2); letter-spacing: 0.01em; margin: 0; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; letter-spacing: -0.01em; }

.section-label {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-2);
  margin: 0 0 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.section-label a { color: var(--accent); text-decoration: none; font-weight: 600; letter-spacing: 0.06em; }

/* ─── card ────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
}
.card.accent {
  background: var(--accent-solid);
  color: var(--accent-ink);
  border-color: transparent;
}
.card.accent .meta,
.card.accent .eyebrow { color: color-mix(in oklch, var(--accent-ink) 62%, transparent); }
.card.flat {
  background: transparent; border: 0;
  padding: 13px 0; border-top: 1px solid var(--border); border-radius: 0;
}
.card.flat:first-child { border-top: 0; padding-top: 0; }

/* ─── list row ────────────────────────────────────────────────── */
.list-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.list-row:first-child { border-top: 0; }
.list-row .body { min-width: 0; }
.list-row .body .title, .list-row .body .sub { overflow-wrap: anywhere; }
.list-row .avatar {
  width: 42px; height: 42px;
  border-radius: 8px;
  background: color-mix(in oklch, var(--av, var(--accent)) 20%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--av, var(--accent)) 34%, var(--border));
  display: grid; place-items: center;
  color: var(--av, var(--accent));
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600; letter-spacing: 0.01em;
}
.list-row .avatar svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.list-row .body .title { font-size: 15px; font-weight: 500; line-height: 1.25; }
.list-row .body .sub { color: var(--text-2); font-size: 13px; line-height: 1.3; margin-top: 2px; }

/* ─── tab bar ─────────────────────────────────────────────────── */
.tabbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(var(--tabs, 3), 1fr);
  padding: 8px 8px 0;
  border-top: 1px solid var(--border);
  background: color-mix(in oklch, var(--surface) 88%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 10px;
  min-height: 50px;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.02em;
  background: none; border: 0; cursor: pointer;
  transition: color 150ms var(--ease);
}
.tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.tab:hover { color: var(--fg); }
.tab.active { color: var(--accent); }
.tab.active svg { stroke-width: 2; }

/* ─── buttons ─────────────────────────────────────────────────── */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px;
  padding: 14px 20px;
  background: var(--accent-solid);
  color: var(--accent-ink);
  border: 0;
  border-radius: 8px;
  font: inherit; font-family: var(--font-display);
  font-size: 15px; font-weight: 600; letter-spacing: -0.005em;
  cursor: pointer;
  transition: filter 150ms var(--ease), transform 100ms var(--ease);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(0.985); }
.btn-primary svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px;
  padding: 14px 20px;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit; font-family: var(--font-display);
  font-size: 15px; font-weight: 500;
  cursor: pointer;
  transition: background 150ms var(--ease), border-color 150ms var(--ease);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--accent-line); }
.btn-secondary svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; }

/* ─── pills / chips / tags ────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.tag {
  display: inline-flex; align-items: center;
  padding: 5px 11px;
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.chiprow { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chiprow::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: all 150ms var(--ease);
}
.chip:hover { color: var(--fg); border-color: var(--accent-line); }
.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
  font-weight: 600;
}

/* ─── art tiles (brand illustration surfaces) ─────────────────── */
.art {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  display: block;
}
.art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.art::after {
  content: '';
  position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  border-radius: inherit;
  pointer-events: none;
}
.ph-img {
  background:
    radial-gradient(120% 120% at 20% 0%, var(--accent-soft), transparent 60%),
    linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.06em;
}
.ph-img svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.6; }

/* ─── progress + bars ─────────────────────────────────────────── */
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 400ms var(--ease); }
.card.accent .progress { background: color-mix(in oklch, var(--accent-ink) 22%, transparent); }
.card.accent .progress > span { background: var(--accent-ink); }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 12px; }
.bar-row .track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-row .track > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); opacity: 0.9; }
.bar-row .label { font-size: 13px; color: var(--text-2); }
.bar-row .val { font-family: var(--font-mono); font-size: 13px; color: var(--fg); font-variant-numeric: tabular-nums; }

/* ─── stats ───────────────────────────────────────────────────── */
.stat {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 13px;
}
.stat .k { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); margin: 0 0 6px; }
.stat .v { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0; line-height: 1.1; overflow-wrap: anywhere; }
.stat .v small { font-size: 12px; color: var(--text-2); font-weight: 500; margin-left: 2px; }

/* ─── empty state ─────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 40px 24px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.empty .glyph {
  width: 66px; height: 66px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
}
.empty .glyph svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.empty h3 { font-family: var(--font-display); font-size: 18px; letter-spacing: -0.01em; margin: 0; }
.empty p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.5; max-width: 30ch; }

/* ─── checklist (grocery) ─────────────────────────────────────── */
.check {
  display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--border);
  background: none; border-inline: 0; border-bottom: 0; width: 100%;
  color: var(--fg); font: inherit; text-align: left; cursor: pointer;
}
.check:first-child { border-top: 0; }
.check .box {
  width: 22px; height: 22px; border-radius: 8px;
  border: 1.5px solid var(--border);
  display: grid; place-items: center;
  color: transparent;
  transition: all 150ms var(--ease);
}
.check .box svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.6; }
.check .txt { font-size: 14.5px; }
.check .qty { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }
.check.done .box { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--accent-ink); }
.check.done .txt { color: var(--text-2); text-decoration: line-through; }

/* ─── bottom sheet ────────────────────────────────────────────── */
.scrim {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(6,6,8,0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity 220ms var(--ease);
}
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 21;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  padding: 10px 20px 26px;
  transform: translateY(102%);
  transition: transform 300ms var(--ease);
  max-height: 82%;
  overflow-y: auto;
  box-shadow: 0 -20px 50px -20px rgba(0,0,0,0.8);
}
.sheet.open { transform: translateY(0); }
.sheet .grabber { width: 38px; height: 4px; border-radius: 999px; background: var(--surface-2); margin: 6px auto 16px; }

/* ─── focus ring ──────────────────────────────────────────────── */
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ─── view switching ──────────────────────────────────────────── */
[data-view] { display: none; }
[data-view].active { display: block; animation: viewin 260ms var(--ease) both; }
@keyframes viewin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
