/* Self-hosted fonts (preload in HTML) — optional prevents visible fallback swap */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: optional;
  src: url("fonts/plus-jakarta-sans.woff2") format("woff2");
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: italic;
  font-weight: 400;
  font-display: optional;
  src: url("fonts/plus-jakarta-sans-italic.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: optional;
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
}

/* SecondMind — theme tokens (warm default + light / pink) */

:root {
  --radius: 4px;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --page-pad: 1.5rem;
  --page-max: 1040px;
  --display: var(--sans);
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --text-xs: 0.72rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.5rem;
  --scroll-size: 8px;
  --scroll-track: transparent;
}

/* Warm — original poster ink palette */
:root,
html[data-theme="warm"] {
  --bg: #0a0a09;
  --bg-elevated: #10100e;
  --surface: #161412;
  --surface-hover: #1c1a18;
  --border: #2a2824;
  --border-subtle: #1e1c1a;
  --text: #edeae4;
  --text-secondary: #9c9890;
  --text-tertiary: #686560;
  --spot-gold: #e8c04a;
  --spot-rust: #e85a38;
  --spot-slate: #5eb8a8;
  --spot-gold-soft: rgba(232, 192, 74, 0.15);
  --spot-rust-soft: rgba(232, 90, 56, 0.14);
  --spot-slate-soft: rgba(122, 154, 148, 0.12);
  --accent: var(--spot-gold);
  --accent-alt: var(--spot-rust);
  --role-category: var(--text-secondary);
  --role-meta: var(--spot-slate);
  --role-quiet: var(--spot-slate);
  --accent-soft: var(--spot-gold-soft);
  --accent-alt-soft: var(--spot-rust-soft);
  --focus: rgba(228, 184, 74, 0.22);
  --highlight: rgba(222, 107, 74, 0.28);
  --overlay-bg: rgba(0, 0, 0, 0.55);
  --scroll-thumb: #3a3834;
  --scroll-thumb-hover: #52504a;
  --rail-gold: var(--spot-gold);
  --rail-slate: var(--spot-slate);
}

/* Light — paper-bright workspace */
html[data-theme="light"] {
  --bg: #f6f5f2;
  --bg-elevated: #efeeea;
  --surface: #ffffff;
  --surface-hover: #f0efec;
  --border: #d4d2cc;
  --border-subtle: #e6e4de;
  --text: #1a1814;
  --text-secondary: #5c5850;
  --text-tertiary: #8a8580;
  --spot-gold: #b8860b;
  --spot-rust: #c44a28;
  --spot-slate: #2a7a68;
  --spot-gold-soft: rgba(184, 134, 11, 0.12);
  --spot-rust-soft: rgba(196, 74, 40, 0.1);
  --spot-slate-soft: rgba(42, 122, 104, 0.1);
  --accent: var(--spot-gold);
  --accent-alt: var(--spot-rust);
  --role-category: var(--text-secondary);
  --role-meta: var(--spot-slate);
  --role-quiet: var(--spot-slate);
  --accent-soft: var(--spot-gold-soft);
  --accent-alt-soft: var(--spot-rust-soft);
  --focus: rgba(184, 134, 11, 0.2);
  --highlight: rgba(196, 74, 40, 0.14);
  --overlay-bg: rgba(26, 24, 20, 0.35);
  --scroll-thumb: #c8c6c0;
  --scroll-thumb-hover: #a8a6a0;
  --rail-gold: var(--spot-gold);
  --rail-slate: var(--spot-slate);
}

/* Pink — rose night tint; rose + gold + periwinkle accents */
html[data-theme="pink"] {
  --bg: #0c080a;
  --bg-elevated: #120d10;
  --surface: #1a1218;
  --surface-hover: #221a22;
  --border: #342830;
  --border-subtle: #261e26;
  --text: #f2eaee;
  --text-secondary: #b8a4b0;
  --text-tertiary: #7a6874;
  --spot-gold: #ff9ec4;
  --spot-rust: #e8b050;
  --spot-slate: #88b0e0;
  --spot-gold-soft: rgba(255, 158, 196, 0.15);
  --spot-rust-soft: rgba(232, 176, 80, 0.14);
  --spot-slate-soft: rgba(136, 176, 224, 0.12);
  --accent: var(--spot-gold);
  --accent-alt: var(--spot-rust);
  --role-category: var(--text-secondary);
  --role-meta: var(--spot-slate);
  --role-quiet: var(--spot-slate);
  --accent-soft: var(--spot-gold-soft);
  --accent-alt-soft: var(--spot-rust-soft);
  --focus: rgba(255, 158, 196, 0.22);
  --highlight: rgba(232, 176, 80, 0.2);
  --overlay-bg: rgba(8, 4, 8, 0.58);
  --scroll-thumb: #3e3040;
  --scroll-thumb-hover: #564858;
  --rail-gold: var(--spot-gold);
  --rail-slate: var(--spot-slate);
}

:root {
  /* legacy aliases */
  --blue: var(--spot-gold);
  --amber: var(--spot-rust);
  --mint: var(--spot-slate);
  --blue-soft: var(--spot-gold-soft);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.55;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 769px) {
  html, body { font-size: 0.875rem; }
}

/* Shared scrollbars — thin, muted, same on page + nested panes */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

*::-webkit-scrollbar {
  width: var(--scroll-size);
  height: var(--scroll-size);
}

*::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

*::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
  background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

body::before {
  content: "";
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  z-index: 50;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    var(--rail-gold) 0%,
    var(--rail-gold) 42%,
    var(--rail-slate) 42%,
    var(--rail-slate) 100%
  );
  opacity: 0.55;
}

/* Header — identical on home + catalog pages */
.site-header {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 0.9rem var(--page-pad);
  padding-top: calc(0.9rem + var(--safe-top));
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.site-nav {
  margin-left: auto;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--page-pad);
  padding-bottom: calc(var(--s-3) + var(--safe-bottom));
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  background: var(--bg-elevated);
}

.ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ico-sm { width: 15px; height: 15px; }
.ico-lg { width: 26px; height: 26px; }

.brand-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--spot-slate);
  transition: color 0.12s;
}

.brand:hover .brand-icon { color: var(--spot-gold); }

.brand-icon .ico { width: 22px; height: 22px; }

.brand-title {
  display: inline-flex;
  align-items: baseline;
  gap: 0.1em;
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
  user-select: none;
}

.brand-word {
  display: inline-block;
}

.brand-word-second {
  font-weight: 700;
  font-style: normal;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.brand-word-mind {
  font-weight: 700;
  font-style: normal;
  color: var(--spot-gold);
  letter-spacing: -0.03em;
  transition: color 0.15s ease, filter 0.15s ease;
}

.brand:hover .brand-word-second {
  color: var(--text);
}

.brand:hover .brand-word-mind {
  color: var(--spot-gold);
  filter: brightness(1.08);
}

@media (min-width: 769px) {
  .brand-title { font-size: 1.62rem; }
}

.header-tools {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}

.nav-link {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-decoration: none;
  padding: var(--s-1) 0;
  border-bottom: 2px solid transparent;
  transition: color 0.12s, border-color 0.12s;
}

.nav-link:hover { color: var(--text); }

.nav-link.active {
  color: var(--spot-gold);
  border-bottom-color: var(--spot-gold);
  font-weight: 600;
}

.nav-link .nav-badge {
  margin-left: 0.35rem;
  vertical-align: middle;
}

.nav-badge[hidden] {
  display: none !important;
}

.btn-capture {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  font-family: var(--sans);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.btn-capture-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
}

.btn-capture:hover {
  color: var(--spot-slate);
  border-color: var(--spot-slate);
  background: var(--spot-slate-soft);
}

.btn-capture:hover .ico { opacity: 1; color: var(--spot-slate); }

.btn-capture .ico {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.btn-capture .badge {
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-size: 0.65rem;
  font-family: var(--mono);
  line-height: 1rem;
  text-align: center;
}

.btn-capture .badge:empty,
.btn-capture .badge[data-count="0"] {
  display: none;
}

@media (max-width: 640px) {
  :root {
    --page-pad: 1rem;
  }

  .site-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: var(--s-2) var(--s-3);
    padding: var(--s-3) var(--page-pad);
    padding-top: calc(var(--s-3) + var(--safe-top));
  }

  .brand-icon {
    width: 32px;
    height: 32px;
  }

  .brand-title {
    font-size: 1.28rem;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-left: 0;
    width: 100%;
    gap: var(--s-4);
    padding-top: var(--s-2);
    border-top: 1px solid var(--border-subtle);
  }

  .header-tools {
    grid-column: 2;
    grid-row: 1;
    gap: var(--s-2);
  }

  .nav-link {
    font-size: var(--text-xs);
    padding: var(--s-1) 0;
  }

  .btn-capture-label {
    display: none;
  }

  .btn-capture {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    justify-content: center;
  }

  .btn-icon {
    width: 2.25rem;
    height: 2.25rem;
  }

  .server-badge {
    font-size: 0.6rem;
    padding: 0.15rem 0.35rem;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-1);
  }

  .page {
    padding: var(--s-4) var(--page-pad) var(--s-6);
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.footer-brand .ico {
  width: 13px;
  height: 13px;
  color: var(--text-tertiary);
}

.site-footer strong {
  color: var(--text-secondary);
  font-weight: 500;
}

.meta-date { color: var(--text-tertiary); }

.page {
  position: relative;
  z-index: 1;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--s-5) var(--page-pad) var(--s-7);
  counter-reset: section;
}

@media (min-width: 769px) {
  .page { padding: var(--s-7) var(--page-pad) 5rem; }
}

.section { margin-bottom: var(--s-6); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-4);
  border-bottom: 1px solid var(--border-subtle);
}

.section-head h2 {
  font-family: var(--sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
}

.section-head h2::before {
  content: counter(section, decimal-leading-zero);
  counter-increment: section;
  font-family: var(--mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--spot-slate);
  flex-shrink: 0;
}

.section-aside {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.section-head a {
  font-size: var(--text-xs);
  font-family: var(--mono);
  color: var(--text-tertiary);
  text-decoration: none;
}

.section-head a:hover { color: var(--spot-gold); }

.empty-block {
  padding: var(--s-6);
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.empty-block code {
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* Shared markdown prose */
.prose {
  max-width: 62ch;
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: 1.65;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin: var(--s-5) 0 var(--s-2);
}

.prose h1:first-child,
.prose h2:first-child,
.prose h3:first-child { margin-top: 0; }

.prose h1 { font-size: var(--text-lg); }
.prose h2 { font-size: var(--text-base); }
.prose h3 { font-size: var(--text-sm); }

.prose p { margin-bottom: var(--s-4); }

.prose a {
  color: var(--spot-gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose a:hover { color: var(--spot-rust); }

.prose strong { color: var(--spot-gold); font-weight: 600; }

.prose ul, .prose ol { margin: 0 0 var(--s-4) 1.25rem; }
.prose li { margin-bottom: var(--s-1); }

.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--spot-gold);
  background: var(--spot-gold-soft);
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
}

.prose pre {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: var(--s-4);
  overflow-x: auto;
  margin: var(--s-4) 0 var(--s-5);
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: var(--text-xs);
  line-height: 1.6;
}

.prose table {
  display: block;
  width: 100%;
  border-collapse: collapse;
  margin: var(--s-4) 0 var(--s-5);
  font-size: var(--text-sm);
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.prose th, .prose td {
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--s-2) var(--s-3);
  text-align: left;
}

.prose tr:last-child td { border-bottom: none; }

.prose th {
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
}

.prose blockquote {
  border-left: 3px solid var(--spot-rust);
  padding-left: var(--s-4);
  margin: var(--s-4) 0;
  color: var(--text-secondary);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--s-6) 0;
}

.prose img {
  max-width: 100%;
  border-radius: var(--radius);
}

/* Capture sheet — queue to inbox from any page */
.capture-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--overlay-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.capture-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.capture-sheet {
  position: fixed;
  z-index: 90;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  padding-bottom: var(--safe-bottom);
}

.capture-sheet.open { transform: translateX(0); }

.capture-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-4) var(--s-3);
  border-bottom: 1px solid var(--border-subtle);
}

.capture-head h2 {
  font-family: var(--sans);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.capture-head p {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--s-1);
  max-width: 28ch;
  line-height: 1.45;
}

.capture-head p code {
  font-family: var(--mono);
  color: var(--spot-gold);
}

.capture-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
}

.capture-close:hover {
  color: var(--text);
  border-color: var(--text-tertiary);
}

.capture-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.capture-field label {
  display: block;
  font-size: var(--text-xs);
  font-family: var(--mono);
  color: var(--text-tertiary);
  margin-bottom: var(--s-1);
}

.capture-field input,
.capture-field textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  outline: none;
  resize: vertical;
}

.capture-field textarea {
  min-height: 180px;
  line-height: 1.5;
}

.capture-field input:focus,
.capture-field textarea:focus {
  border-color: var(--spot-rust);
  box-shadow: 0 0 0 2px var(--focus);
}

.capture-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.capture-actions button {
  flex: 1;
  min-width: 7rem;
  padding: 0.55rem 0.75rem;
  font-family: var(--sans);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--border-subtle);
}

.capture-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text) !important;
}

.capture-primary:hover { background: var(--text-secondary); }

.capture-secondary {
  background: transparent;
  color: var(--text-secondary);
}

.capture-secondary:hover {
  color: var(--text);
  border-color: var(--text-tertiary);
}

.capture-status {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.45;
  min-height: 1.3em;
}

.capture-status.ok { color: var(--spot-slate); }
.capture-status.err { color: var(--spot-rust); }

.capture-queue {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--s-3);
}

.capture-queue h3 {
  font-size: var(--text-xs);
  font-family: var(--mono);
  color: var(--text-tertiary);
  margin-bottom: var(--s-1);
}

.capture-queue-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.45;
  margin-bottom: var(--s-2);
}

.capture-queue-hint code {
  font-family: var(--mono);
  font-size: var(--text-xs);
}

.capture-queue-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  max-height: 160px;
  overflow-y: auto;
}

.capture-queue-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-2);
  padding: var(--s-2);
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  font-size: var(--text-xs);
}

.capture-queue-item .q-title {
  color: var(--text);
  font-weight: 500;
  margin-bottom: 2px;
}

.capture-queue-item .q-meta {
  font-family: var(--mono);
  color: var(--text-tertiary);
}

.capture-queue-item button {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: var(--text-xs);
  padding: 0;
}

.capture-queue-item button:hover { color: var(--spot-rust); }

.capture-queue-empty {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.capture-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.45;
}

.capture-hint code {
  font-family: var(--mono);
  color: var(--spot-gold);
  font-size: 0.9em;
}

/* —— Soft-nav / mobile app shell (SEO: progressive enhancement only) —— */

.app-tabbar {
  display: none;
}

.account-chip {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
}

.account-chip .ico {
  width: 18px;
  height: 18px;
}

.account-chip:hover {
  color: var(--spot-gold);
  border-color: var(--border-subtle);
}

body.is-soft-nav {
  cursor: progress;
}

body.is-soft-nav .site-header {
  opacity: 0.92;
}

@media (max-width: 640px) {
  :root {
    --app-tabbar-h: 3.5rem;
  }

  body {
    padding-bottom: calc(var(--app-tabbar-h) + var(--safe-bottom));
  }

  /* Single-row header; tabs live in bottom bar */
  .site-header {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--s-2);
    padding: 0.65rem var(--page-pad);
    padding-top: calc(0.65rem + var(--safe-top));
  }

  .site-nav {
    display: none !important;
  }

  .account-chip {
    display: inline-flex;
  }

  .app-tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    height: calc(var(--app-tabbar-h) + var(--safe-bottom));
    padding: 0.35rem 0.25rem var(--safe-bottom);
    background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-subtle);
  }

  .app-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    text-decoration: none;
    color: var(--text-tertiary);
    font-size: 0.65rem;
    font-weight: 550;
    letter-spacing: 0.01em;
    border-radius: var(--radius);
    min-height: 2.75rem;
    -webkit-tap-highlight-color: transparent;
  }

  .app-tab-icon {
    display: grid;
    place-items: center;
  }

  .app-tab .ico {
    width: 22px;
    height: 22px;
  }

  .app-tab.active {
    color: var(--spot-gold);
  }

  .app-tab:active {
    transform: scale(0.96);
  }

  .catalog-shell {
    min-height: calc(100dvh - var(--app-tabbar-h) - var(--safe-bottom));
  }

  .site-footer {
    display: none;
  }

  /* Larger touch targets */
  .btn-icon,
  .btn-capture {
    min-width: 2.5rem;
    min-height: 2.5rem;
  }
}

@supports (padding: max(0px)) {
  @media (max-width: 640px) {
    .app-tabbar {
      padding-bottom: max(var(--safe-bottom), 0.35rem);
    }
  }
}
