/* Portalforge — component layer on top of styles.css (the Venture token system).
   Every colour, size, space, radius and shadow is a token from /tokens; the two themes only re-point the
   semantic aliases. Corporate trust: dark navy and charcoal by default, a light theme on toggle. */

:root {
  /* status tokens (light) */
  --status-ok: #1B7F4E;
  --status-warn: #9A5B00;
  --status-bad: #B42318;
  --status-info: var(--blue-700);
  --text-muted: #5B6779; /* darker than the system's slate-500 so 13px captions clear 4.5:1 on sunken surfaces */
  --surface-raised: var(--white);
  --surface-sunken: var(--slate-100);
  --surface-nav: var(--blue-900);
  --text-on-brand: var(--white);
  --border-strong: var(--slate-400);
  --action-primary-solid: var(--blue-800);
  --action-primary-hover: var(--blue-700);
  --action-accent-solid: var(--violet-600);
  --skeleton: var(--slate-200);
  --overlay: rgba(4, 38, 74, 0.55);
  --hero-overlay: linear-gradient(100deg, rgba(4, 38, 74, 0.94) 0%, rgba(6, 56, 110, 0.82) 55%, rgba(16, 24, 40, 0.55) 100%);
  --nav-height: 68px;
}

[data-theme="dark"] {
  --surface-page: var(--slate-900);
  --surface-section-light: #0B1526;
  --surface-card: #172033;
  --surface-raised: #1B2740;
  --surface-sunken: #0B1526;
  --surface-badge: rgba(123, 92, 250, 0.16);
  --surface-nav: #060E1C;
  --border-card: #2A364F;
  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-strong: #4A5872;
  --text-heading: var(--white);
  --text-body: #D6DCE8;
  --text-muted: #A9B4C8;
  --text-brand: var(--blue-300);
  --text-accent: #C2ADFF;
  --text-link: var(--blue-300);
  --text-link-hover: var(--blue-100);
  --action-primary-solid: var(--blue-300);
  --action-primary-hover: var(--blue-100);
  --action-primary-text: var(--slate-900);
  --action-accent-solid: #C2ADFF;
  --status-ok: #5CD69A;
  --status-warn: #F5B84B;
  --status-bad: #FF8A80;
  --status-info: var(--blue-300);
  --skeleton: #243046;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 8px 28px rgba(0, 0, 0, 0.5);
  --focus-ring: 0 0 0 3px rgba(111, 163, 227, 0.55);
}
[data-theme="dark"] .btn-primary { color: var(--slate-900); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--surface-page); color: var(--text-body);
  font-family: var(--font-body); font-size: var(--text-body-md); line-height: var(--line-height-normal);
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text-heading); line-height: var(--line-height-tight); letter-spacing: var(--letter-spacing-tight); margin: 0 0 var(--space-4); }
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); font-weight: var(--font-weight-extrabold); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.75rem); font-weight: var(--font-weight-bold); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: var(--font-weight-semibold); }
h4 { font-size: var(--text-body-md); font-weight: var(--font-weight-semibold); margin-bottom: var(--space-2); }
p { margin: 0 0 var(--space-4); }
a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--text-link-hover); text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-muted); }
.small { font-size: var(--text-body-sm); }
.caption { font-size: var(--text-caption); color: var(--text-muted); }
.money { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: var(--font-weight-bold); color: var(--text-heading); }
.money-lg { font-size: var(--text-display-3); font-family: var(--font-display); }
.money-per { font-size: var(--text-body-sm); color: var(--text-muted); font-weight: var(--font-weight-regular); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; flex: none; }
.icon-lg { width: 28px; height: 28px; }

.container { width: 100%; max-width: var(--content-max-width); margin: 0 auto; padding: 0 var(--space-5); }
@media (min-width: 900px) { .container { padding: 0 var(--section-padding-x); } }
.section { padding: var(--space-16) 0; }
@media (min-width: 900px) { .section { padding: var(--space-20) 0; } }
.section-alt { background: var(--surface-section-light); }
.section-head { margin-bottom: var(--space-8); }
.section-head p { max-width: 62ch; color: var(--text-muted); font-size: var(--text-body-lg); }
.eyebrow { display: inline-block; font-size: var(--text-caption); font-weight: var(--font-weight-semibold); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-brand); margin-bottom: var(--space-3); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-5); border-radius: var(--radius-pill); border: 1px solid transparent;
  font: inherit; font-size: var(--text-body-sm); font-weight: var(--font-weight-semibold); cursor: pointer;
  text-decoration: none; transition: transform var(--duration-fast) var(--ease-standard), background var(--duration-fast), box-shadow var(--duration-fast);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: var(--hover-lift); }
.btn:active { transform: var(--press-scale); }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--action-primary-solid); color: var(--action-primary-text); box-shadow: var(--shadow-button); }
.btn-primary:hover { background: var(--action-primary-hover); color: var(--action-primary-text); }
.btn-secondary { background: transparent; color: var(--text-heading); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-sunken); color: var(--text-heading); }
.btn-ghost { background: transparent; color: var(--text-link); padding: 0 var(--space-3); }
.btn-ghost:hover { background: var(--surface-sunken); }
.btn-danger { background: transparent; color: var(--status-bad); border-color: var(--status-bad); }
.btn-sm { min-height: 36px; padding: 0 var(--space-4); font-size: var(--text-caption); }
.btn-lg { min-height: 52px; padding: 0 var(--space-8); font-size: var(--text-body-md); }
.btn-block { width: 100%; }
.btn-icon { min-width: 44px; padding: 0; border-radius: var(--radius-md); }

/* ── Header / nav ── */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface-nav); color: var(--text-on-dark); box-shadow: 0 1px 0 var(--border-hairline); }
.site-header .container { display: flex; align-items: center; gap: var(--space-4); min-height: var(--nav-height); }
.brand { display: flex; align-items: center; gap: var(--space-3); color: var(--text-on-dark); font-family: var(--font-display); font-weight: var(--font-weight-bold); text-decoration: none; }
.brand img { height: 36px; width: auto; display: block; }
.brand span { font-size: var(--text-body-lg); }
.brand-sub { display: none; font-size: var(--text-caption); color: var(--text-on-dark-muted); font-weight: var(--font-weight-regular); margin-left: var(--space-2); }
@media (min-width: 700px) { .brand-sub { display: inline; } }
.nav { display: none; align-items: center; gap: var(--space-1); margin-left: auto; }
.nav a { color: var(--text-on-dark); font-size: var(--text-body-sm); font-weight: var(--font-weight-medium); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover, .nav a.active { background: rgba(255, 255, 255, 0.12); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
@media (min-width: 900px) { .nav { display: flex; } .nav-actions { margin-left: 0; } }
.nav-toggle { display: inline-flex; background: transparent; border: 1px solid rgba(255, 255, 255, 0.3); color: var(--text-on-dark); }
@media (min-width: 900px) { .nav-toggle { display: none; } }
.theme-toggle { background: transparent; border: 1px solid rgba(255, 255, 255, 0.3); color: var(--text-on-dark); }
.mobile-nav { display: none; background: var(--surface-nav); border-top: 1px solid rgba(255, 255, 255, 0.1); padding: var(--space-3) var(--space-5) var(--space-5); }
.mobile-nav.open { display: grid; gap: var(--space-1); }
.mobile-nav a { color: var(--text-on-dark); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); min-height: 44px; display: flex; align-items: center; font-weight: var(--font-weight-medium); }
.mobile-nav a:hover, .mobile-nav a.active { background: rgba(255, 255, 255, 0.12); text-decoration: none; }
.header-cta { background: var(--white); color: var(--blue-900); display: none; }
.header-cta:hover { background: var(--blue-100); color: var(--blue-900); }
@media (min-width: 600px) { .header-cta { display: inline-flex; } }
.choice:focus-within { box-shadow: var(--focus-ring); }

/* ── Hero ── */
.hero {
  position: relative; color: var(--text-on-dark); min-height: 560px; display: flex; align-items: center;
  background-image: var(--hero-overlay), url('/assets/hero-generated.webp'); background-size: cover; background-position: center;
}
.hero .container { padding-top: var(--space-16); padding-bottom: var(--space-16); }
.hero h1 { color: var(--text-on-dark); max-width: 18ch; font-size: clamp(3rem, 6vw, 4.5rem); }
.hero p.lead { color: var(--text-on-dark); opacity: 0.92; font-size: var(--text-body-lg); max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.hero .btn-primary { background: var(--white); color: var(--blue-900); }
.hero .btn-primary:hover { background: var(--blue-100); color: var(--blue-900); }
.hero .btn-secondary { color: var(--text-on-dark); border-color: rgba(255, 255, 255, 0.6); }
.hero .btn-secondary:hover { background: rgba(255, 255, 255, 0.12); color: var(--text-on-dark); }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-10); max-width: 620px; }
.hero-stat { border-left: 2px solid rgba(255, 255, 255, 0.4); padding-left: var(--space-4); }
.hero-stat strong { display: block; font-family: var(--font-display); font-size: var(--text-display-3); line-height: 1; }
.hero-stat span { font-size: var(--text-caption); opacity: 0.85; }

/* ── Cards & grids ── */
.grid { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-2 { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.card { background: var(--surface-card); border: 1px solid var(--border-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.card-link { transition: transform var(--duration-normal) var(--ease-standard), box-shadow var(--duration-normal); }
.card-link:hover { transform: var(--hover-lift); box-shadow: var(--shadow-card-hover); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.card-head h3 { margin: 0; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; padding-top: var(--space-3); border-top: 1px solid var(--border-hairline); }
.price-row { display: flex; flex-direction: column; gap: 0; align-items: flex-start; }
.card-media { aspect-ratio: 16 / 10; border-radius: var(--radius-md); overflow: hidden; background: var(--surface-sunken); border: 1px solid var(--border-hairline); display: flex; align-items: center; justify-content: center; }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.swatch { width: 42px; height: 42px; border-radius: var(--radius-md); flex: none; }
.tag-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip { display: inline-flex; align-items: center; gap: var(--space-1); padding: 4px 10px; border-radius: var(--radius-pill); font-size: var(--text-caption); font-weight: var(--font-weight-semibold); background: var(--surface-badge); color: var(--text-accent); border: 1px solid var(--border-hairline); white-space: nowrap; }
.chip-blue { background: var(--surface-sunken); color: var(--text-brand); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: var(--text-caption); font-weight: var(--font-weight-semibold); border: 1px solid currentColor; white-space: nowrap; }
.badge-ok { color: var(--status-ok); } .badge-warn { color: var(--status-warn); } .badge-bad { color: var(--status-bad); } .badge-info { color: var(--status-info); } .badge-muted { color: var(--text-muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.check-list li { display: flex; gap: var(--space-2); align-items: flex-start; }
.check-list .icon { color: var(--status-ok); margin-top: 2px; }

/* ── Filters / segmented ── */
.segmented { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); background: var(--surface-sunken); padding: var(--space-1); border-radius: var(--radius-pill); }
.segmented button { min-height: 40px; padding: 0 var(--space-4); border-radius: var(--radius-pill); border: 0; background: transparent; color: var(--text-body); font: inherit; font-size: var(--text-body-sm); font-weight: var(--font-weight-medium); cursor: pointer; }
.segmented button.active { background: var(--action-primary-solid); color: var(--action-primary-text); }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; margin-bottom: var(--space-6); }

/* ── Forms ── */
.form { display: grid; gap: var(--space-5); }
.form-row { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.field { display: grid; gap: var(--space-2); min-width: 0; }
.field label, .field .label { font-size: var(--text-body-sm); font-weight: var(--font-weight-semibold); color: var(--text-heading); }
.field .hint { font-size: var(--text-caption); color: var(--text-muted); }
.field .error { font-size: var(--text-caption); color: var(--status-bad); font-weight: var(--font-weight-medium); }
input, select, textarea {
  width: 100%; min-height: 44px; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--border-strong);
  background: var(--surface-card); color: var(--text-heading); font: inherit; font-size: var(--text-body-sm);
}
textarea { min-height: 96px; resize: vertical; }
input[type="color"] { padding: 4px; width: 64px; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--blue-500); margin: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-500); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--status-bad); }
.check { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; cursor: pointer; font-size: var(--text-body-sm); }
.choice-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.choice { position: relative; display: flex; gap: var(--space-3); padding: var(--space-4); border: 2px solid var(--border-card); border-radius: var(--radius-lg); background: var(--surface-card); cursor: pointer; transition: border-color var(--duration-fast); align-items: flex-start; }
.choice:hover { border-color: var(--blue-400); }
.choice.selected { border-color: var(--blue-500); box-shadow: var(--focus-ring); }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-body { display: grid; gap: 4px; min-width: 0; flex: 1; }
.choice-body strong { color: var(--text-heading); }
.choice-body .money { font-size: var(--text-body-sm); }
.error-summary { border: 1px solid var(--status-bad); color: var(--status-bad); background: var(--surface-card); border-radius: var(--radius-md); padding: var(--space-4); }
.error-summary ul { margin: var(--space-2) 0 0; padding-left: var(--space-5); }

/* ── Wizard ── */
.steps { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-6); }
.step { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-pill); font-size: var(--text-caption); font-weight: var(--font-weight-semibold); color: var(--text-muted); background: var(--surface-sunken); }
.step.active { background: var(--action-primary-solid); color: var(--action-primary-text); }
.step.done { color: var(--status-ok); }
.step b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: currentColor; color: var(--surface-card); font-size: 12px; }
.step.active b { color: var(--action-primary-solid); background: var(--action-primary-text); }
.wizard-layout { display: grid; gap: var(--space-6); grid-template-columns: 1fr; }
@media (min-width: 1000px) { .wizard-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .summary-card { position: sticky; top: calc(var(--nav-height) + var(--space-4)); } }
.summary-line { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--text-body-sm); padding: var(--space-2) 0; border-bottom: 1px solid var(--border-hairline); }
.summary-line span:first-child { color: var(--text-muted); min-width: 0; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: var(--space-3); }
.wizard-actions { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-6); }

/* ── Gallery ── */
.gallery { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.gallery figure { margin: 0; background: var(--surface-card); border: 1px solid var(--border-card); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.gallery figure.mobile img { object-fit: contain; background: var(--surface-sunken); }
.gallery img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: var(--surface-sunken); cursor: zoom-in; }
.gallery figcaption { padding: var(--space-4); display: grid; gap: 4px; }
.gallery figcaption strong { color: var(--text-heading); }
.lightbox { position: fixed; inset: 0; background: var(--overlay); display: none; align-items: center; justify-content: center; padding: var(--space-4); z-index: 100; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: var(--radius-md); background: var(--white); }
.lightbox button { position: absolute; top: var(--space-4); right: var(--space-4); }

/* ── Preview studio & device frames ── */
.studio { display: grid; gap: var(--space-4); }
.studio-controls { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.studio-controls .segmented button { display: inline-flex; align-items: center; gap: var(--space-2); }
.studio-brand { padding: var(--space-4); border: 1px solid var(--border-card); border-radius: var(--radius-lg); background: var(--surface-card); }
.studio-stage { display: flex; justify-content: center; padding: var(--space-5) var(--space-3); background: var(--surface-sunken); border-radius: var(--radius-xl); border: 1px solid var(--border-hairline); overflow: hidden; }
.device { position: relative; background: var(--slate-900); box-shadow: var(--shadow-card-hover); }
.device-desktop { width: 100%; max-width: 960px; border-radius: var(--radius-lg); padding: 14px 10px 10px; }
.device-desktop::before { content: ''; position: absolute; top: 5px; left: 12px; width: 32px; height: 4px; border-radius: 2px; background: var(--slate-500); }
.device-phone { width: min(100%, 300px); border-radius: 36px; padding: 14px 10px; }
.device-phone::before { content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 80px; height: 5px; border-radius: 3px; background: var(--slate-500); }
.device-screen { position: relative; overflow: hidden; border-radius: var(--radius-md); background: var(--white); }
.device-phone .device-screen { border-radius: 26px; }
.device-screen img:first-child { display: block; width: 100%; height: auto; }
.device-screen iframe { display: block; width: 100%; height: 600px; border: 0; background: var(--white); }
.device-phone .device-screen iframe { height: 620px; }
.device-screen iframe.no-pointer { pointer-events: none; }
.studio-foot { justify-content: space-between; }
.studio-foot a { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 44px; }
.sandbox-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-sunken); border-radius: var(--radius-sm); }
.sandbox-thumb iframe { display: block; width: 100%; height: 100%; border: 0; pointer-events: none; background: var(--white); }
.sandbox-thumb::after { content: ''; position: absolute; inset: 0; }
.gallery .live { display: grid; gap: var(--space-3); padding: var(--space-4); }
.gallery .live .device { margin: 0 auto; }
.gallery .live .device-desktop { padding: 10px 6px 6px; }
.gallery .live .device-screen iframe { height: 420px; }
.gallery .live .device-phone .device-screen iframe { height: 560px; }
.live-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.live-foot a { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 44px; }
.device-logo { position: absolute; top: 2.2%; left: 2.5%; height: 3.6%; max-width: 30%; width: auto; object-fit: contain; object-position: left center; background: transparent; }
.device-phone .device-logo { top: 1.2%; left: 4%; height: 3.4%; max-width: 45%; }
.studio-note { margin: 0; text-align: center; }
.logo-thumb { max-height: 40px; max-width: 160px; object-fit: contain; background: var(--surface-card); border: 1px solid var(--border-hairline); border-radius: var(--radius-sm); padding: 4px; }
.swatch-pair { display: inline-flex; gap: 4px; vertical-align: middle; }
.swatch-pair span { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border-strong); }
.version-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.version-list li { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-4); border: 1px solid var(--border-card); border-radius: var(--radius-md); background: var(--surface-card); font-size: var(--text-body-sm); }
.live-card { border: 2px solid var(--status-ok); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-card); border-radius: var(--radius-lg); background: var(--surface-card); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-body-sm); min-width: 560px; }
th, td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-hairline); vertical-align: top; }
th { position: sticky; top: 0; background: var(--surface-raised); color: var(--text-heading); font-weight: var(--font-weight-semibold); white-space: nowrap; z-index: 1; }
th button { background: none; border: 0; color: inherit; font: inherit; font-weight: inherit; cursor: pointer; padding: 0; min-height: 32px; display: inline-flex; align-items: center; gap: 4px; }
tbody tr:hover { background: var(--surface-sunken); }
td.num, th.num { text-align: right; }
.table-tools { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-hairline); }
.table-tools input { max-width: 320px; min-height: 40px; }
.pager { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); font-size: var(--text-caption); color: var(--text-muted); justify-content: flex-end; }

/* ── States ── */
.skeleton { display: grid; gap: var(--space-3); }
.skeleton span { display: block; height: 18px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--skeleton) 25%, var(--surface-card) 50%, var(--skeleton) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty, .state-error { text-align: center; padding: var(--space-10) var(--space-5); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-muted); display: grid; gap: var(--space-4); justify-items: center; }
.state-error { border-style: solid; border-color: var(--status-bad); color: var(--status-bad); }

/* ── Toasts & dialogs ── */
.toast-host { position: fixed; bottom: var(--space-5); left: 50%; transform: translateX(-50%); display: grid; gap: var(--space-2); z-index: 200; width: min(92vw, 420px); }
.toast { background: var(--slate-900); color: var(--white); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); box-shadow: var(--shadow-card-hover); display: flex; gap: var(--space-3); align-items: center; font-size: var(--text-body-sm); border-left: 4px solid var(--blue-400); }
.toast-ok { border-left-color: var(--status-ok); } .toast-bad { border-left-color: var(--status-bad); }
dialog.dialog { border: 1px solid var(--border-card); border-radius: var(--radius-xl); padding: 0; background: var(--surface-card); color: var(--text-body); width: min(92vw, 560px); box-shadow: var(--shadow-card-hover); }
dialog.dialog::backdrop { background: var(--overlay); }
dialog.dialog .dialog-body { padding: var(--space-6); display: grid; gap: var(--space-4); }
dialog.dialog h3 { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-3); flex-wrap: wrap; }

/* ── Footer ── */
.site-footer { background: var(--surface-nav); color: var(--text-on-dark); padding: var(--space-12) 0 var(--space-8); margin-top: var(--space-16); }
.site-footer .container { display: grid; gap: var(--space-8); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.site-footer h4 { color: var(--text-on-dark); }
.site-footer a { color: var(--text-on-dark); opacity: 0.85; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); font-size: var(--text-body-sm); }
.footer-trust { display: grid; gap: var(--space-3); font-size: var(--text-body-sm); }
.footer-trust li { display: flex; gap: var(--space-2); align-items: flex-start; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.15); margin-top: var(--space-8); padding-top: var(--space-5); font-size: var(--text-caption); color: var(--text-on-dark-muted); }

/* ── Detail / status timeline ── */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: var(--space-3); font-size: var(--text-body-sm); }
.timeline li::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--blue-400); margin-top: 6px; }
.timeline time { display: block; color: var(--text-muted); font-size: var(--text-caption); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); font-size: var(--text-body-sm); }
.kv dt { color: var(--text-muted); } .kv dd { margin: 0; color: var(--text-heading); word-break: break-word; }
.stack { display: grid; gap: var(--space-4); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--text-caption); background: var(--surface-sunken); padding: var(--space-3); border-radius: var(--radius-md); overflow-x: auto; white-space: pre-wrap; word-break: break-word; color: var(--text-heading); }
.note { border-left: 3px solid var(--blue-400); padding: var(--space-3) var(--space-4); background: var(--surface-sunken); border-radius: 0 var(--radius-md) var(--radius-md) 0; font-size: var(--text-body-sm); }
.note-warn { border-left-color: var(--status-warn); }

/* ── Feature strip ── */
.feature { display: flex; gap: var(--space-4); align-items: flex-start; }
.feature .icon-wrap { width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--surface-icon-badge); color: var(--white); display: grid; place-items: center; flex: none; }
.feature h3 { font-size: var(--text-body-md); margin-bottom: var(--space-1); }
.feature p { color: var(--text-muted); font-size: var(--text-body-sm); margin: 0; }
