/* ==========================================================================
   Component library
   Button · GlassCard · Badge · Avatar · Form · Modal · Toast · Dropdown ·
   Tabs · Table · StatCard · ChartCard · EmptyState · LoadingState ·
   Pagination · Breadcrumb · Accordion · Navbar · Footer · DemoBar
   ========================================================================== */

/* ---------- Button ---------- */
.btn {
  --btn-bg: var(--surface-strong);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: .65rem 1.2rem;
  border: 1px solid var(--btn-border);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-button);
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur) var(--ease-out), background var(--dur) var(--ease-out), border-color var(--dur);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(1px) scale(.98); box-shadow: var(--shadow-1); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary {
  --btn-bg: var(--gradient-brand);
  --btn-fg: #fff;
  --btn-border: transparent;
  background: var(--gradient-brand);
  box-shadow: var(--shadow-brand), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primary:hover { box-shadow: 0 16px 36px -10px rgba(var(--brand-primary-rgb), .65), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-secondary {
  --btn-bg: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-muted); box-shadow: none; }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-border: transparent; }
.btn-sm { min-height: 34px; padding: .4rem .85rem; font-size: var(--fs-small); }
.btn-lg { min-height: 52px; padding: .85rem 1.6rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; border-radius: 50%; }
.btn-icon.btn-sm { width: 34px; min-height: 34px; }

/* ---------- Glass card ---------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  box-shadow: var(--shadow-2), var(--shadow-inset-light);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--surface-strong); }
}
.card {
  position: relative;
  padding: var(--sp-6);
  border-radius: var(--r-lg);
}
.card h3 { margin-bottom: var(--sp-2); }
.card p:last-child { margin-bottom: 0; }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .6rem;
  border-radius: var(--r-pill);
  font-size: .75rem;
  font-weight: var(--fw-semibold);
  line-height: 1.5;
  white-space: nowrap;
  background: var(--neutral-bg);
  color: var(--text-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.no-dot::before { display: none; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-primary { background: rgba(var(--brand-primary-rgb), .12); color: var(--brand-primary); }
.badge-demo {
  background: linear-gradient(135deg, var(--brand-orange), #F97316);
  color: #1F1300;
  letter-spacing: .08em;
  font-weight: var(--fw-black);
}
.badge-demo::before { background: #1F1300; animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 50% { opacity: .3; } }

/* ---------- Avatar ---------- */
.avatar {
  --av: 36px;
  width: var(--av); height: var(--av);
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-size: calc(var(--av) * .38);
  font-weight: var(--fw-bold);
  color: #fff;
  background: linear-gradient(135deg, hsl(var(--h, 200) 80% 52%), hsl(calc(var(--h, 200) + 50) 70% 55%));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 2px 6px rgba(0,0,0,.12);
}
.avatar-lg { --av: 56px; }
.avatar-xl { --av: 88px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-5); }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field > label, .field-label {
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  color: var(--text-2);
}
.field .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: .6rem .85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--bg-elev);
  color: var(--text);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.textarea { min-height: 110px; resize: vertical; }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .7rem center;
  background-size: 16px;
}
.input:hover, .select:hover, .textarea:hover { border-color: rgba(var(--brand-primary-rgb), .45); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(var(--brand-primary-rgb), .18);
  border-radius: var(--r-sm);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: .8; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
.field-error { font-size: var(--fs-caption); color: var(--danger); font-weight: var(--fw-medium); }
.field-hint { font-size: var(--fs-caption); color: var(--text-3); }
.form-actions { display: flex; gap: var(--sp-3); justify-content: flex-end; flex-wrap: wrap; margin-top: var(--sp-6); }
.form-alert {
  padding: .75rem 1rem;
  border-radius: var(--r-sm);
  font-size: var(--fs-small);
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: var(--fw-medium);
}
.form-alert.info { background: var(--info-bg); color: var(--info); }
.checkbox { display: inline-flex; align-items: center; gap: .55rem; font-size: var(--fs-small); color: var(--text-2); cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--brand-primary); }

.input-group { position: relative; }
.input-group svg { position: absolute; left: .8rem; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-group .input { padding-left: 2.4rem; }

/* Switch toggle */
.switch { position: relative; display: inline-flex; align-items: center; gap: .7rem; cursor: pointer; font-size: var(--fs-small); color: var(--text-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  width: 42px; height: 24px; flex: none;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  position: relative;
  transition: background var(--dur);
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-1);
  transition: transform var(--dur) var(--ease-spring);
}
.switch input:checked + .track { background: var(--brand-primary); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Stepper (multi-step forms) */
.stepper { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-6); list-style: none; padding: 0; }
.stepper li {
  flex: 1;
  padding-top: .6rem;
  border-top: 3px solid var(--border-strong);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  color: var(--text-3);
}
.stepper li.is-active, .stepper li.is-done { border-color: var(--brand-primary); color: var(--text); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  z-index: var(--z-modal);
  display: grid; place-items: center;
  padding: var(--sp-4);
  background: rgba(5, 10, 22, .5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in var(--dur) var(--ease-out);
}
.modal {
  width: min(640px, 100%);
  max-height: calc(100vh - 2rem);
  display: flex; flex-direction: column;
  border-radius: var(--r-xl);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-3);
  animation: modal-in var(--dur-slow) var(--ease-out);
  overflow: hidden;
}
.modal.modal-lg { width: min(860px, 100%); }
.modal.modal-sm { width: min(440px, 100%); }
.modal-header { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 1.2rem; margin: 0; flex: 1; }
.modal-body { padding: var(--sp-6); overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: var(--sp-3); padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--border); flex-wrap: wrap; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: perspective(900px) translateY(24px) rotateX(8deg) scale(.97); } }

/* ---------- Toast ---------- */
.toast-region {
  position: fixed;
  right: var(--sp-4); bottom: var(--sp-4);
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--sp-2);
  width: min(380px, calc(100vw - 2rem));
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-left: 4px solid var(--info);
  box-shadow: var(--shadow-3);
  font-size: var(--fs-small);
  pointer-events: auto;
  animation: toast-in var(--dur-slow) var(--ease-spring);
}
.toast strong { display: block; color: var(--text); }
.toast span { color: var(--text-2); }
.toast svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.toast-success { border-left-color: var(--success); } .toast-success svg { color: var(--success); }
.toast-error { border-left-color: var(--danger); } .toast-error svg { color: var(--danger); }
.toast-warning { border-left-color: var(--brand-orange); } .toast-warning svg { color: var(--warning); }
.toast-info svg { color: var(--info); }
.toast.is-leaving { opacity: 0; transform: translateX(20px); transition: all var(--dur) var(--ease-out); }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  z-index: var(--z-dropdown);
  min-width: 220px;
  padding: var(--sp-2);
  border-radius: var(--r-md);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform-origin: top right;
  animation: dropdown-in var(--dur) var(--ease-out);
}
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: .6rem;
  width: 100%;
  padding: .55rem .7rem;
  border: 0; border-radius: var(--r-xs);
  background: none;
  color: var(--text);
  font-size: var(--fs-small);
  text-align: left;
  text-decoration: none;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-muted); }
.dropdown-menu svg { width: 16px; height: 16px; color: var(--text-3); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-2) 0; }
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }

/* ---------- Tabs ---------- */
.tabs {
  display: inline-flex; gap: 4px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  padding: .5rem 1rem;
  border: 0; border-radius: var(--r-pill);
  background: none;
  color: var(--text-2);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  transition: background var(--dur), color var(--dur);
}
.tab svg { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 2px; }
.tab[aria-selected="true"] { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); -webkit-overflow-scrolling: touch; }
.data-table { font-size: var(--fs-dash); }
.data-table th {
  position: sticky; top: 0;
  padding: .7rem .9rem;
  text-align: left;
  font-size: .75rem;
  font-weight: var(--fw-semibold);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table th button {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: 0; border: 0; background: none;
  font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit;
}
.data-table th button svg { width: 14px; height: 14px; opacity: .5; }
.data-table th[aria-sort] button svg { opacity: 1; color: var(--brand-primary); }
.data-table td {
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}
.data-table tbody tr { transition: background var(--dur-fast); }
.data-table tbody tr:hover { background: rgba(var(--brand-primary-rgb), .04); }
.data-table .cell-title { display: flex; align-items: center; gap: .65rem; color: var(--text); font-weight: var(--fw-semibold); min-width: 160px; }
.data-table .cell-title small { display: block; font-weight: var(--fw-regular); color: var(--text-3); font-size: .78rem; }
.data-table .cell-actions { display: flex; gap: 2px; justify-content: flex-end; }
.data-table .select.inline { min-height: 32px; padding: .2rem 1.8rem .2rem .6rem; font-size: .8rem; width: auto; border-radius: var(--r-pill); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Stat card ---------- */
.stat-card { padding: var(--sp-5); border-radius: var(--r-lg); display: flex; flex-direction: column; gap: .35rem; position: relative; overflow: hidden; }
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.stat-card .stat-label { font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--text-3); }
.stat-card .stat-value { font-size: 1.75rem; font-weight: var(--fw-black); letter-spacing: -.03em; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-delta { display: inline-flex; align-items: center; gap: .2rem; font-size: .78rem; font-weight: var(--fw-semibold); color: var(--text-3); }
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }
.stat-delta svg { width: 14px; height: 14px; }

/* ---------- Chart card ---------- */
.chart-card { padding: var(--sp-5); border-radius: var(--r-lg); min-width: 0; }
.chart-card h3 { font-size: 1rem; margin: 0; }
.chart-card .chart-sub { font-size: var(--fs-caption); color: var(--text-3); margin: 2px 0 var(--sp-4); }
.chart { width: 100%; position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font-sans); }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .bar { transition: opacity var(--dur); }
.chart .bar:hover, .chart .slice:hover { opacity: .8; }
.chart .dot { transition: r var(--dur-fast); }
.chart-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: var(--sp-3); font-size: var(--fs-caption); color: var(--text-2); list-style: none; padding: 0; }
.chart-legend li { display: inline-flex; align-items: center; gap: .4rem; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none;
  padding: .35rem .6rem; border-radius: var(--r-xs);
  background: var(--text); color: var(--bg);
  font-size: .75rem; font-weight: var(--fw-semibold);
  white-space: nowrap; transform: translate(-50%, -120%);
}
.hbar-list { display: flex; flex-direction: column; gap: .75rem; list-style: none; padding: 0; margin: 0; }
.hbar-list .hbar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .75rem; font-size: var(--fs-small); }
.hbar-list .hbar-track { grid-column: 1 / -1; height: 8px; border-radius: var(--r-pill); background: var(--surface-muted); overflow: hidden; }
.hbar-list .hbar-fill { height: 100%; border-radius: inherit; background: var(--gradient-brand); transform-origin: left; animation: grow-x .9s var(--ease-out); }
@keyframes grow-x { from { transform: scaleX(0); } }

/* ---------- Empty / loading ---------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--sp-2);
  padding: var(--sp-12) var(--sp-6);
}
.empty-state .icon-3d { margin-bottom: var(--sp-3); }
.empty-state h3 { margin: 0; }
.empty-state p { max-width: 380px; margin: 0 0 var(--sp-3); }
.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--surface-muted) 0%, var(--border) 50%, var(--surface-muted) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
  min-height: 14px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-state { display: grid; gap: var(--sp-3); padding: var(--sp-6); }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-3) var(--sp-4); font-size: var(--fs-small); color: var(--text-3); }
.pagination .pages { display: flex; gap: 4px; }
.pagination button { min-width: 34px; height: 34px; border-radius: var(--r-xs); border: 1px solid var(--border); background: var(--bg-elev); font-size: var(--fs-small); }
.pagination button[aria-current="page"] { background: var(--brand-primary); color: #fff; border-color: transparent; }
.pagination button[disabled] { opacity: .4; cursor: not-allowed; }

/* ---------- Breadcrumb ---------- */
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0 0 var(--sp-4); font-size: var(--fs-small); color: var(--text-3); }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; opacity: .6; }
.breadcrumb a { color: var(--text-2); }
.breadcrumb [aria-current] { color: var(--text); font-weight: var(--fw-medium); }

/* ---------- Accordion (FAQ) ---------- */
.accordion { display: grid; gap: var(--sp-3); max-width: 820px; margin-inline: auto; }
.accordion details { border-radius: var(--r-md); padding: 0 var(--sp-5); }
.accordion summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4) 0;
  cursor: pointer; list-style: none;
  font-weight: var(--fw-semibold); color: var(--text);
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary svg { width: 20px; height: 20px; flex: none; transition: transform var(--dur) var(--ease-out); color: var(--brand-primary); }
.accordion details[open] summary svg { transform: rotate(45deg); }
.accordion details p { padding-bottom: var(--sp-4); margin: 0; }

/* ---------- Media tile (product imagery without external images) ---------- */
.media-tile {
  position: relative;
  display: grid; place-items: center;
  width: 100%; aspect-ratio: 4 / 3;
  border-radius: inherit;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 25%, hsla(var(--h, 200), 90%, 75%, .9), transparent 55%),
    linear-gradient(135deg, hsl(var(--h, 200) 75% 55%), hsl(calc(var(--h, 200) + 45) 70% 45%));
  color: #fff;
}
.media-tile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.28), transparent 40%);
  pointer-events: none;
}
.media-tile svg { width: 38%; height: 38%; max-width: 120px; filter: drop-shadow(0 12px 18px rgba(0,0,0,.25)); stroke-width: 1.4; }
.media-tile.sm { aspect-ratio: 1; width: 40px; border-radius: var(--r-sm); }
.media-tile.sm svg { width: 55%; height: 55%; stroke-width: 2; }
.media-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: inherit; background: var(--surface-muted); }
.media-img.sm { width: 40px; height: 40px; aspect-ratio: 1; border-radius: var(--r-sm); }

/* ---------- Brand / logo ---------- */
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none !important; font-weight: var(--fw-black); letter-spacing: -.02em; }
.brand img { height: 38px; width: auto; }
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.05; font-size: 1.05rem; white-space: nowrap; }
.brand .brand-text small { font-size: .68rem; font-weight: var(--fw-medium); letter-spacing: .02em; color: var(--text-3); }
.brand .brand-mono {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 12px; color: #fff; font-size: 1rem;
  background: var(--gradient-brand);
  box-shadow: var(--shadow-brand);
}

/* ---------- Demo bar ---------- */
.demo-bar {
  position: sticky; top: 0;
  z-index: var(--z-demo);
  height: var(--demo-bar-h);
  display: flex; align-items: center;
  background: rgba(7, 11, 22, .92);
  color: #E2E8F0;
  font-size: var(--fs-caption);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.demo-bar .container { display: flex; align-items: center; gap: var(--sp-3); }
.demo-bar .demo-note { color: #CBD5E1; }
.demo-bar button, .demo-bar a {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.06);
  color: #F8FAFC;
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  text-decoration: none;
}
.demo-bar button:hover, .demo-bar a:hover { background: rgba(255,255,255,.14); text-decoration: none; }
.demo-bar svg { width: 15px; height: 15px; }

/* ---------- Navbar ---------- */
.site-header {
  position: sticky; top: var(--demo-bar-h);
  z-index: var(--z-header);
  height: var(--header-h);
  display: flex; align-items: center;
  transition: background var(--dur), box-shadow var(--dur), border-color var(--dur);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: var(--surface);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}
.site-header .container { display: flex; align-items: center; gap: var(--sp-4); }
.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0 auto; padding: 4px; border-radius: var(--r-pill); }
.nav-links a {
  display: block;
  padding: .5rem .85rem;
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: var(--fs-nav);
  font-weight: var(--fw-medium);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur), color var(--dur);
}
.nav-links a:hover { color: var(--text); background: var(--surface-muted); }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--bg-elev); box-shadow: var(--shadow-1); }
.nav-actions { display: flex; align-items: center; gap: var(--sp-2); }
.nav-toggle { display: none; }
.cart-btn { position: relative; }
.cart-count {
  position: absolute; top: -4px; right: -4px;
  min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--brand-orange); color: #1F1300;
  font-size: .7rem; font-weight: var(--fw-black);
}
.mobile-nav {
  position: fixed;
  inset: calc(var(--header-h) + var(--demo-bar-h)) 0 0 0;
  z-index: var(--z-header);
  padding: var(--sp-6) var(--gutter);
  background: var(--surface-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow-y: auto;
  animation: fade-in var(--dur) var(--ease-out);
}
.mobile-nav ul { list-style: none; margin: 0 0 var(--sp-6); padding: 0; display: grid; gap: 4px; }
.mobile-nav a { display: block; padding: .9rem 1rem; border-radius: var(--r-md); font-size: 1.1rem; font-weight: var(--fw-semibold); color: var(--text); }
.mobile-nav a[aria-current="page"] { background: rgba(var(--brand-primary-rgb), .1); color: var(--brand-primary); }

/* ---------- Footer ---------- */
.site-footer { padding: var(--sp-16) 0 var(--sp-8); border-top: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--sp-8); }
.site-footer h4 { font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--text-3); margin-bottom: var(--sp-4); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: var(--fs-small); }
.site-footer ul a { color: var(--text-2); }
.site-footer .placeholder { color: var(--text-3); font-style: italic; }
.socials { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.socials a, .socials span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); color: var(--text-2); }
.socials svg { width: 17px; height: 17px; }
.footer-bottom { display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-top: var(--sp-12); padding-top: var(--sp-6); border-top: 1px solid var(--border); font-size: var(--fs-caption); color: var(--text-3); }
.footer-bottom p { margin: 0; color: inherit; }

/* ---------- Notice banner ---------- */
.notice {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--warning-bg);
  color: var(--text);
  font-size: var(--fs-small);
  border: 1px solid rgba(245, 158, 11, .35);
}
.notice svg { width: 20px; height: 20px; flex: none; color: var(--warning); }
.notice.info { background: var(--info-bg); border-color: rgba(2,132,199,.3); }
.notice.info svg { color: var(--info); }

/* ---------- Key/value list ---------- */
.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: .55rem var(--sp-4); margin: 0; font-size: var(--fs-small); }
.kv dt { color: var(--text-3); font-weight: var(--fw-medium); }
.kv dd { margin: 0; color: var(--text); word-break: break-word; }

/* ---------- Progress ---------- */
.progress { height: 8px; border-radius: var(--r-pill); background: var(--surface-muted); overflow: hidden; min-width: 80px; }
.progress span { display: block; height: 100%; background: var(--gradient-brand); border-radius: inherit; }
