/* ============================================================
   Shared Design System — Magnificent Marina
   ============================================================ */

/* === Google Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Inter:wght@300;400;500&display=swap');

/* === Design Tokens === */
:root {
  --bg:           #F4EFE8;
  --bg-secondary: #EDE7DF;
  --bg-card:      #E8E1D8;
  --text:         #1A1814;
  --text-muted:   #7A736C;
  --accent:       #C4A882;
  --border:       #D8D0C6;
  --surface:      #FDFAF6;
  --success:      #7A9E7E;
  --warn:         #C4A457;
  --danger:       #B07070;
  --text-on-color: #FFFFFF;
  --nav-h:        60px;
  --radius:       2px;
  --radius-md:    4px;
  --radius-lg:    8px;
  --shadow-sm:    0 1px 3px rgba(26,24,20,0.06);
  --shadow-md:    0 4px 16px rgba(26,24,20,0.08);
  --shadow-lg:    0 8px 32px rgba(26,24,20,0.10);
  --transition:   0.2s ease;
  --font-serif:   'Cormorant Garamond', serif;
  --font-sans:    'Inter', sans-serif;
}

[data-theme="dark"] {
  --bg:           #110F0C;
  --bg-secondary: #1A1814;
  --bg-card:      #221F1B;
  --text:         #F0EBE3;
  --text-muted:   #8A857E;
  --accent:       #C4A882;
  --border:       #2C2A26;
  --surface:      #1A1814;
  --success:      #8DB391;
  --warn:         #D4B86A;
  --danger:       #C98484;
  --text-on-color: #FFFFFF;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}
img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font-sans); }
ul { list-style: none; }
input, select, textarea { font-family: var(--font-sans); }

/* === Navigation === */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
  gap: 24px;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo-img {
  height: 44px;
  width: auto;
  object-fit: contain;
  display: block;
  background: transparent;
}

.nav-logo-text {
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--transition);
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }

.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 14px;
  transition: background 0.3s, border-color var(--transition);
  flex: 1;
  max-width: 240px;
}
.nav-search:focus-within {
  border-color: var(--accent);
}
.nav-search input {
  background: none;
  border: none;
  outline: none;
  font-size: 12px;
  color: var(--text);
  width: 100%;
  min-width: 0;
}
.nav-search input::placeholder { color: var(--text-muted); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color var(--transition);
  padding: 4px 0;
}
.btn-icon:hover { color: var(--text); }

.nav-mobile-btn { display: none; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: var(--radius);
  padding: 10px 24px;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), opacity var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.btn-primary:hover { opacity: 0.82; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn-accent {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
}
.btn-accent:hover { opacity: 0.85; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}
.btn-ghost:hover { color: var(--text); }

.btn-sm { padding: 7px 16px; font-size: 10px; }
.btn-lg { padding: 13px 32px; font-size: 12px; }

/* === SVG Icons === */
.icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }
.icon-xl { width: 24px; height: 24px; }

/* === Badges === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius);
  font-weight: 500;
  white-space: nowrap;
}
.badge-accent   { background: var(--accent); color: var(--surface); }
.badge-muted    { background: var(--bg-secondary); color: var(--text-muted); border: 1px solid var(--border); }
.badge-new      { background: var(--text); color: var(--bg); }
.badge-discount { background: var(--success); color: var(--text-on-color); }
.badge-oos      { background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border); }

/* === Tags / Chips === */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  background: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  cursor: pointer;
  font-family: var(--font-sans);
  white-space: nowrap;
}
.tag:hover,
.tag.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

/* === Form Elements === */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}
.form-input,
.form-select,
.form-textarea {
  font-family: var(--font-sans);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  transition: border-color var(--transition), background 0.3s;
  outline: none;
  width: 100%;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--accent); }
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }
.form-textarea  { resize: vertical; min-height: 80px; line-height: 1.6; }
.form-select    { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A736C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-row       { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint      { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

/* === Card === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: background 0.3s, border-color 0.3s;
}
.card-padded { padding: 24px; }

/* === Section Layout === */
.section {
  padding: 64px 40px;
}
.section-sm { padding: 40px 40px; }
.section-lg { padding: 96px 40px; }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 36px;
  gap: 16px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 300;
  color: var(--text);
  line-height: 1.1;
}
.section-sub {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 300;
  margin-top: 6px;
  line-height: 1.6;
}
.section-eyebrow {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  display: block;
}

/* === Similarity Score Bar === */
.score-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.score-track {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.score-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.6s ease;
}
.score-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
  min-width: 32px;
  text-align: right;
}

/* === Divider === */
hr.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
  transition: border-color 0.3s;
}

/* === Stat Card === */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  transition: background 0.3s, border-color 0.3s;
}
.stat-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.stat-value {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 300;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-delta {
  font-size: 11px;
  color: var(--success);
}
.stat-delta.neg { color: var(--danger); }

/* === Data Table === */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  font-size: 13px;
  color: var(--text);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-secondary); }

/* === Tab Bar === */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 12px 20px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--text);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* === Pill Group (attribute chips) === */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pill {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: none;
  white-space: nowrap;
}
.pill-required { border-color: var(--accent); color: var(--accent); }
.pill-excluded { border-color: var(--danger); color: var(--danger); text-decoration: line-through; }

/* === Empty State === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  text-align: center;
  gap: 12px;
}
.empty-state .icon { color: var(--text-muted); width: 40px; height: 40px; }
.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 300;
  max-width: 280px;
}

/* === Toast / Alert Banner === */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.5;
  border: 1px solid var(--border);
  background: var(--surface);
}
.alert-banner.info   { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.alert-banner.success { border-color: var(--success); background: color-mix(in srgb, var(--success) 8%, var(--surface)); }
.alert-banner.warn   { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }

/* === Footer === */
.site-footer { background: var(--bg); }

.footer-main {
  border-top: 1px solid var(--border);
  padding: 60px 40px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  transition: border-color 0.3s;
}
.footer-logo {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 14px;
}
.footer-brand p {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 240px;
  margin-bottom: 20px;
}
.footer-col h4 {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 18px;
  font-weight: 500;
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.footer-col ul a {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer-col ul a:hover { color: var(--text); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 22px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: border-color 0.3s;
  flex-wrap: wrap;
}
.footer-bottom p {
  font-size: 12px;
  font-weight: 300;
  color: var(--text-muted);
}
.footer-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-nav a {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer-nav a:hover { color: var(--text); }

/* === Responsive === */
@media (max-width: 960px) {
  .nav           { padding: 0 24px; gap: 16px; }
  .nav-links     { display: none; }
  .nav-search    { display: none; }
  .nav-mobile-btn { display: flex; }
  .section, .section-sm, .section-lg { padding-left: 24px; padding-right: 24px; }
  .footer-main   { grid-template-columns: 1fr 1fr; gap: 32px; padding: 48px 24px; }
  .footer-brand  { grid-column: 1 / -1; }
  .footer-bottom { padding: 20px 24px; }
}

@media (max-width: 600px) {
  .nav           { padding: 0 16px; }
  .section, .section-sm, .section-lg { padding-left: 16px; padding-right: 16px; }
  .footer-main   { grid-template-columns: 1fr; padding: 40px 16px; gap: 28px; }
  .footer-bottom { padding: 18px 16px; flex-direction: column; align-items: flex-start; }
  .footer-nav    { gap: 14px; }
  .form-row      { grid-template-columns: 1fr; }
}

/* === Error pages (404, 403) === */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 16px;
  gap: 12px;
}
.error-code {
  font-family: var(--font-serif);
  font-size: 64px;
  font-weight: 300;
  color: var(--accent);
  line-height: 1;
}
.error-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  color: var(--text);
}
.error-text {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 360px;
  font-weight: 300;
}
.error-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* === Shared additions: hidden, drawer, account state, toasts, dialogs, skeletons, gates === */
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.nav-search { margin: 0; }
.nav-account { gap: 8px; }
.nav-account-name { display: none; }
.nav-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-on-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}
@media (min-width: 961px) {
  .nav-account-name { display: inline; }
}

.nav-drawer {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  z-index: 190;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 24px;
  box-shadow: var(--shadow-lg);
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
.nav-drawer-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
}
.nav-drawer-search input {
  background: none; border: none; outline: none;
  font-size: 14px; color: var(--text); width: 100%;
}
.nav-drawer-links { display: flex; flex-direction: column; }
.nav-drawer-links a {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.nav-drawer-links a.active, .nav-drawer-links a:hover { color: var(--text); }
@media (min-width: 961px) {
  .nav-drawer { display: none !important; }
}
@media (max-width: 600px) {
  .nav-drawer { padding: 12px 16px 20px; }
}
body.nav-open { overflow: hidden; }

.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  line-height: 1.4;
  animation: toast-in 0.2s ease;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-leaving { opacity: 0; transition: opacity 0.2s; }
.toast-text { flex: 1; }
.toast-action {
  background: none;
  border: 1px solid currentColor;
  color: inherit;
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 600px) {
  .toast-stack { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}

.mm-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  padding: 0;
  max-width: min(560px, calc(100vw - 32px));
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.mm-dialog::backdrop { background: rgba(26, 24, 20, 0.55); }
.mm-dialog-body { padding: 28px; }
.mm-dialog-wide { max-width: min(960px, calc(100vw - 32px)); }
.mm-dialog-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 16px;
}
.mm-dialog-text { font-size: 14px; color: var(--text); margin-bottom: 20px; }
.mm-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.mm-dialog-close {
  position: absolute;
  top: 12px; right: 12px;
  background: none; border: none;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
}
.mm-dialog-close:hover { color: var(--text); }

.btn-danger {
  background: var(--danger);
  color: var(--text-on-color);
  border: 1px solid var(--danger);
}
.btn-danger:hover { opacity: 0.85; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-secondary) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s infinite;
  border-radius: var(--radius-md);
  min-height: 120px;
}
.skeleton-card { aspect-ratio: 3 / 4; min-height: 0; }
.skeleton-row { min-height: 56px; }
.skeleton-line { min-height: 14px; margin-bottom: 10px; }
@keyframes skeleton-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.empty-state-error p { color: var(--danger); }
.empty-state-error .retry-btn { margin-top: 12px; }

.field-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 6px;
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--danger) !important;
}
.form-error {
  color: var(--danger);
  font-size: 13px;
  margin: 8px 0 0;
}
.form-note {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 6px;
}

.gate {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(var(--nav-h) + 48px) 16px 48px;
}
.gate-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.gate-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 6px;
}
.gate-subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.gate-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.gate-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: -1px;
}
.gate-tab.active, .gate-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.gate-form .form-group { margin-bottom: 14px; }
.gate-form .btn { width: 100%; margin-top: 6px; }
.gate-footnote { font-size: 12px; color: var(--text-muted); margin-top: 16px; text-align: center; }
@media (max-width: 600px) {
  .gate-card { padding: 24px 20px; }
}

.img-caption {
  position: absolute;
  left: 8px; bottom: 8px;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-on-color);
  background: rgba(26, 24, 20, 0.55);
  padding: 3px 7px;
  border-radius: var(--radius);
  pointer-events: none;
}
.is-busy { opacity: 0.6; pointer-events: none; }

.footer-actions { display: flex; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
.section-header-center { justify-content: center; text-align: center; }

/* === Legal and about pages === */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 48px) 24px 64px;
}
.legal-page h1 {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 400;
  margin-bottom: 8px;
}
.legal-page h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  margin: 32px 0 10px;
}
.legal-page p, .legal-page li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  font-weight: 300;
  margin-bottom: 12px;
}
.legal-page ul { list-style: disc; padding-left: 20px; }
.legal-page .legal-meta { color: var(--text-muted); font-size: 12px; margin-bottom: 24px; }
.legal-page .placeholder {
  background: color-mix(in srgb, var(--warn) 14%, var(--surface));
  border: 1px dashed var(--warn);
  padding: 2px 6px;
  border-radius: var(--radius);
  font-style: normal;
}
.legal-page a { color: var(--accent); text-decoration: underline; }
.legal-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.legal-nav a {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.legal-nav a.active, .legal-nav a:hover { color: var(--text); }

/* === Guided tour === */
.tour[hidden] { display: none !important; }
.tour-ring {
  position: fixed;
  top: var(--tour-top, 0);
  left: var(--tour-left, 0);
  width: var(--tour-width, 0);
  height: var(--tour-height, 0);
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 2px var(--accent), 0 0 0 9999px rgba(26, 24, 20, 0.55);
  z-index: 500;
  pointer-events: none;
  transition: top 0.2s, left 0.2s, width 0.2s, height 0.2s;
}
.tour-card {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 510;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 20px 22px;
  max-width: 420px;
  margin: 0 auto;
}
.tour-card-floating {
  left: var(--tour-card-left, 16px);
  right: auto;
  bottom: auto;
  top: var(--tour-card-top, 16px);
  width: 420px;
  margin: 0;
}
.tour-step {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.tour-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 8px;
}
.tour-text { font-size: 13px; line-height: 1.6; color: var(--text); font-weight: 300; margin-bottom: 16px; }
.tour-actions { display: flex; align-items: center; gap: 8px; }
.tour-spacer { flex: 1; }
body.tour-open { overflow-x: hidden; }

/* === Legal tables === */
.legal-page .legal-table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 13px; }
.legal-page .legal-table th, .legal-page .legal-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); line-height: 1.5; }
.legal-page .legal-table th { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); font-weight: 500; }
.legal-page strong { font-weight: 500; }
@media (max-width: 640px) { .legal-page .legal-table { display: block; overflow-x: auto; } }
