* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--type-body);
  color: var(--text);
  background: var(--hero-glow), var(--bg);
  line-height: 1.7;
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 8px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-1);
  transform: translateY(-120%);
  transition: transform 180ms ease;
  z-index: 100;
}

.skip-link:focus-visible {
  transform: translateY(0);
  box-shadow: var(--focus-ring);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.1;
  margin: 0 0 var(--space-4);
  color: var(--text);
}

h1 {
  font-size: var(--type-h1);
  font-weight: 700;
}

h2 {
  font-size: var(--type-h2);
  font-weight: 600;
}

h3 {
  font-size: var(--type-h3);
  font-weight: 600;
}

p {
  margin: 0 0 var(--space-4);
  color: var(--text-muted);
}

small {
  font-size: var(--type-small);
  color: var(--text-3);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.section {
  padding: calc(var(--section-pad) + var(--space-3)) 0;
}

.section--hero {
  background:
    radial-gradient(circle at 15% 10%, var(--page-accent-glow), transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, var(--page-accent-soft) 70%, transparent), transparent 65%),
    var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.section--hero::after {
  content: '';
  position: absolute;
  right: clamp(16px, 8vw, 120px);
  top: clamp(24px, 6vw, 80px);
  width: clamp(140px, 20vw, 200px);
  height: clamp(140px, 20vw, 200px);
  background: url('/assets/brand/VyraLogoBadge.png') no-repeat center / contain;
  opacity: 0.08;
  pointer-events: none;
}

.section--alt {
  background: var(--surface-2);
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}

.section--soft {
  background: var(--bg-2);
}

.section--tight {
  padding-bottom: var(--section-pad-tight);
}

.section--flush {
  padding-top: 0;
}

.section-header {
  max-width: 720px;
  margin-bottom: var(--space-8);
}

.section-header h1,
.section-header h2,
.section-header h3 {
  font-weight: 700;
}

.section-header--glow {
  position: relative;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--page-accent-glow) 85%, transparent 15%), transparent 70%);
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  position: relative;
  z-index: 1;
}

.hero-content h1 {
  max-width: 720px;
  margin-bottom: var(--space-2);
}

.hero-content .hero-subcopy {
  max-width: 620px;
}

.hero-logo,
.hero-mark {
  width: auto;
  height: auto;
  max-height: var(--logo-hero-max-height);
  max-width: 240px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  background: color-mix(in srgb, var(--glass) 75%, transparent 25%);
  border: 1px solid color-mix(in srgb, var(--border) 65%, transparent 35%);
  padding: var(--space-2);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--glass) 70%, transparent 30%);
  box-shadow: var(--shadow-1);
}

.hero-badge-logo {
  height: 24px;
  width: auto;
  display: block;
  background: transparent;
}

.hero-watermark {
  position: absolute;
  right: clamp(20px, 8vw, 120px);
  top: clamp(24px, 6vw, 80px);
  width: clamp(120px, 18vw, 180px);
  opacity: 0.08;
  pointer-events: none;
}

.game-card {
  display: grid;
  gap: var(--space-3);
}

.game-thumb {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: color-mix(in srgb, var(--glass) 70%, transparent 30%);
  border: 1px solid color-mix(in srgb, var(--border) 65%, transparent 35%);
  box-shadow: var(--shadow-1);
}

.label-cover {
  height: 140px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.22), transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, var(--lav-soft) 70%, transparent 30%), color-mix(in srgb, var(--aqua-soft) 70%, transparent 30%));
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent 30%);
  position: relative;
  overflow: hidden;
}

.label-cover::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--sun);
  opacity: 0.4;
}

.feature-grid {
  align-items: stretch;
}

.feature-item {
  display: grid;
  gap: var(--space-3);
}

.feature-icon {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 6px 12px rgba(15, 23, 42, 0.2));
}

.cta-band {
  background: color-mix(in srgb, var(--glass) 65%, transparent 35%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(var(--blur-1));
}

.cta-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
}

.demo-shell {
  padding: var(--space-7) 0 var(--space-5);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-1);
}

.demo-topbar {
  background: color-mix(in srgb, var(--glass) 70%, transparent 30%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(var(--blur-1));
}

.demo-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  flex-wrap: wrap;
}

.demo-topbar-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 600;
  color: var(--text-1);
}

.badge--solid {
  background: var(--lav-soft);
  color: var(--text);
  border-color: rgba(139, 124, 255, 0.35);
}

.demo-shell-content {
  margin-top: var(--space-6);
  display: grid;
  gap: var(--space-5);
}

.demo-shell-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.demo-shell-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-2);
  display: grid;
  gap: var(--space-2);
}

.demo-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--glass) 70%, transparent 30%);
  box-shadow: var(--shadow-1);
}

.demo-action-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.demo-disclaimer {
  color: var(--text-3);
  font-size: var(--text-sm);
}

.demo-shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.demo-shell-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.demo-shell-title {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.demo-shell-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.demo-callout {
  background: color-mix(in srgb, var(--surface-2) 80%, transparent 20%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--type-small);
  color: var(--text-muted);
}

.demo-empty {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
  background: var(--surface-2);
  font-size: var(--type-small);
}

.demo-panel {
  min-height: 180px;
}

.demo-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 20, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  backdrop-filter: blur(var(--blur-1));
  z-index: 60;
  opacity: 0;
  transition: opacity 180ms ease;
}

.demo-modal-backdrop.is-visible {
  display: flex;
  opacity: 1;
}

.demo-modal {
  width: min(420px, 90vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-2);
}

.help-tooltip {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-3);
}

.help-button {
  border: 1px solid var(--border);
  background: rgba(13, 16, 30, 0.85);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.help-button:hover {
  border-color: var(--page-accent);
  background: var(--lav-soft);
}

.help-card {
  width: min(320px, 85vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-2);
  display: none;
  opacity: 0;
  pointer-events: none;
}

.help-tooltip.is-open .help-card {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.help-card h4 {
  margin: 0 0 var(--space-2);
}

.help-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-2);
}

.media-frame {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: var(--space-3);
  box-shadow: var(--shadow-2);
}

.media-embed {
  position: relative;
  padding-top: 56.25%;
  border-radius: var(--radius-2);
  overflow: hidden;
  background: #0b1220;
}

.media-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.skeleton {
  border-radius: var(--radius-2);
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.08) 0%, rgba(148, 163, 184, 0.2) 50%, rgba(148, 163, 184, 0.08) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton-line {
  height: 12px;
  margin-bottom: var(--space-2);
}

.skeleton-card {
  height: 72px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.toast-container {
  position: fixed;
  right: 24px;
  top: 90px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: var(--shadow-2);
  font-size: var(--text-sm);
  color: var(--text-1);
  opacity: 0;
  transform: translateY(-6px);
  animation: toast-in 180ms ease forwards;
}

@keyframes toast-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.demo-badge {
  position: fixed;
  top: 16px;
  right: 16px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.9);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: var(--shadow-2);
  z-index: 80;
}

.demo-mode .btn-primary {
  box-shadow: var(--shadow-glow);
  position: relative;
}

.demo-mode .btn-primary::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, 0.45);
  opacity: 0.7;
}

.demo-mode [data-demo-hide] {
  display: none !important;
}

.kpi-grid {
  align-items: stretch;
}

.kpi-card {
  display: grid;
  gap: var(--space-2);
}

.kpi-value {
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  font-weight: 600;
  color: var(--text-1);
}

.kpi-trend {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-success);
}

.chip-group {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.chip.is-active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 28px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent 30%);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.logo-grid {
  align-items: stretch;
}

.logo-card {
  display: grid;
  gap: var(--space-3);
}

.logo-mark {
  width: auto;
  height: 32px;
  opacity: 0.9;
  filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.2));
}

.logo-card .logo-mark {
  max-width: 140px;
}

[data-theme='light'] .logo-mark {
  filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.12));
}

[data-theme='dark'] .logo-card .logo-mark {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--glass) 70%, transparent 30%);
  border: 1px solid color-mix(in srgb, var(--border) 65%, transparent 35%);
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

.feature-icon {
  width: 32px;
  height: 32px;
  opacity: 0.75;
}

.section-title {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pillars {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.pillar {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.pillar-icon {
  width: 28px;
  height: 28px;
  opacity: 0.75;
}

.section-note {
  color: var(--text-3);
  font-size: var(--type-small);
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--card-pad);
  box-shadow: var(--card-shadow);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card--narrow {
  max-width: 520px;
}

.card--fit {
  height: fit-content;
}

.card--interactive:hover,
.card--interactive:focus-within {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
  border-color: var(--border-strong);
}

.card:hover {
  transform: translateY(-2px);
}

.card + .card {
  margin-top: var(--space-4);
}

.scenario-card .stack {
  gap: var(--space-2);
}

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.stack-lg {
  gap: var(--space-6);
}

.inline {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
}

.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.centered {
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
  background: transparent;
  color: var(--text-1);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: var(--shadow-2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border-subtle);
  color: var(--text-1);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.btn-secondary:hover {
  background: var(--surface-elevated);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  color: var(--text-1);
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.2);
}

.btn-muted {
  background: rgba(148, 163, 184, 0.16);
  color: var(--text-2);
  border-color: rgba(148, 163, 184, 0.25);
}

.btn-icon {
  padding: 10px 14px;
  border-radius: var(--radius-pill);
}

.input,
select,
textarea {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  background: var(--surface-2);
  color: var(--text-1);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.input::placeholder,
textarea::placeholder {
  color: var(--text-3);
}

.input:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--accent);
}

.label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: var(--space-2);
  display: block;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-1);
}

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

.table thead {
  background: var(--surface-elevated);
  color: var(--text-1);
}

.table tbody tr:hover {
  background: rgba(99, 102, 241, 0.08);
}

.table tbody tr.is-selected {
  background: rgba(99, 102, 241, 0.14);
}

.header {
  background: var(--header-bg);
  border-bottom: 1px solid rgba(139, 124, 255, 0.18);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(var(--blur-1));
  transition: background 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.header.header-scrolled {
  background: var(--header-bg-scrolled);
  box-shadow: 0 12px 30px rgba(8, 10, 24, 0.35);
  border-color: rgba(139, 124, 255, 0.28);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-3) 0;
}

.header-main {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: 64px;
  flex: 1;
}

.footer .logo img {
  height: 32px;
}

.brand,
.logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.brand-badge,
.brand-wordmark,
.brand-logo,
.logo-mark {
  display: block;
  width: auto;
  height: auto;
  background: transparent;
  object-fit: contain;
}

.brand-fallback {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: none;
}

.header .brand-logo {
  height: var(--logo-header-height);
}

.nav-panel-header .brand-logo {
  height: var(--logo-header-mobile-height);
}

.footer .brand-badge {
  height: var(--logo-footer-badge-height);
}

.footer .brand-wordmark {
  height: var(--logo-footer-wordmark-height);
}

.nav-group {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-group--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.nav-group--stack .nav-group-label {
  margin-right: 0;
}

.nav-group-label {
  font-size: var(--type-caption);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin-right: var(--space-2);
}

.nav {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.nav-links {
  align-items: center;
}

.nav a,
.nav button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  border: 1px solid transparent;
  background: transparent;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.nav a img,
.nav button img {
  margin-right: 0;
}

.nav a .badge {
  margin-left: var(--space-2);
  font-size: 0.65rem;
  padding: 2px 8px;
}

.nav a.active,
.nav button.active {
  background: color-mix(in srgb, var(--page-accent-soft) 65%, transparent 35%);
  color: var(--text);
  font-weight: 600;
  border-color: rgba(139, 124, 255, 0.3);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--page-accent) 55%, transparent);
}

.nav a:hover,
.nav button:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-actions .btn {
  min-height: 40px;
  padding: 8px 16px;
}

.menu {
  position: relative;
}

.menu summary {
  list-style: none;
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: color-mix(in srgb, var(--surface) 90%, transparent 10%);
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  padding: var(--space-3);
  box-shadow: var(--shadow-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 30;
}

.menu:not([open]) .menu-panel {
  display: none;
}

.menu-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--type-caption);
  color: var(--text-3);
  margin-bottom: var(--space-1);
}

.menu-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.menu-item:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: color-mix(in srgb, var(--surface-2) 75%, transparent 25%);
}

.header-cta {
  display: none;
}

.nav-toggle,
.nav-close {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--glass) 75%, transparent 25%);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.nav-toggle:hover,
.nav-close:hover {
  border-color: var(--page-accent);
  background: var(--lav-soft);
}

.nav-toggle {
  display: none;
}

.nav-panel {
  position: fixed;
  top: 16px;
  right: 16px;
  width: min(360px, 92vw);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-3);
  transform: translateY(-10px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 60;
}

.nav-panel[aria-hidden='true'] {
  display: none;
}

.nav-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.nav-panel-links {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
}

.nav-panel-links a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-2) 80%, transparent 20%);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 22, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 55;
}

.nav-open .nav-panel,
.nav-open .nav-overlay {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.theme-toggle {
  white-space: nowrap;
}

.theme-toggle--mobile {
  width: 100%;
  margin-top: var(--space-4);
}

[data-theme='light'] .header.header-scrolled {
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.footer {
  padding: var(--space-9) 0 var(--space-6);
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent 8%);
}

.footer-grid {
  display: grid;
  gap: var(--space-6);
  align-items: start;
}

.footer-brand {
  display: grid;
  gap: var(--space-2);
}

.footer-brand p {
  color: var(--text-muted);
}

.footer-links {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.footer-group {
  display: grid;
  gap: var(--space-2);
  font-size: 0.95rem;
}

.footer-group h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.footer-group a {
  color: var(--text);
  text-decoration: none;
}

.footer-group a:hover,
.footer-group a:focus-visible {
  color: var(--page-accent);
}

.footer-bottom {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  text-align: center;
  font-size: 0.9rem;
}

.internal-banner {
  margin: var(--space-6) 0 var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: var(--text-1);
  font-weight: 600;
}

@media (min-width: 900px) {
  .footer-grid {
    grid-template-columns: minmax(220px, 1.2fr) minmax(0, 3fr);
  }

  .footer-bottom {
    text-align: left;
  }
}

@media (max-width: 720px) {
  .header .brand-logo {
    height: 40px;
  }
}

.preview-frame {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  padding: var(--space-6);
  box-shadow: var(--shadow-2);
}

.sidebar {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-1);
}

.sidebar .nav-item {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  display: flex;
  gap: var(--space-2);
  align-items: center;
  color: var(--text-2);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  width: 100%;
}

.sidebar .nav-item.active,
.sidebar .nav-item:hover {
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-1);
}

.notice {
  background: rgba(99, 102, 241, 0.14);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--text-2);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 380px;
  background: var(--surface-1);
  border-left: 1px solid var(--border-subtle);
  padding: var(--space-6);
  display: none;
  z-index: 40;
  box-shadow: var(--shadow-2);
  transform: translateX(24px);
  opacity: 0;
  transition: transform 200ms ease, opacity 200ms ease;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 22, 0.6);
  display: none;
  z-index: 35;
  opacity: 0;
  transition: opacity 180ms ease;
}

.drawer.is-visible,
.overlay.is-visible {
  display: block;
}

.drawer.is-visible {
  transform: translateX(0);
  opacity: 1;
}

.overlay.is-visible {
  opacity: 1;
}

.layout-split {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-6);
  min-height: 70vh;
}

.layout-triple {
  display: grid;
  grid-template-columns: 240px 1fr 300px;
  gap: var(--space-6);
}

.layout-dual {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-6);
}

.pill {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.pill--policy {
  background: rgba(34, 197, 94, 0.15);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.3);
}

.pill--ops {
  background: rgba(59, 130, 246, 0.15);
  color: #bfdbfe;
  border-color: rgba(59, 130, 246, 0.3);
}

.pill--tech {
  background: rgba(239, 68, 68, 0.15);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.3);
}

.pill--creative {
  background: rgba(168, 85, 247, 0.15);
  color: #e9d5ff;
  border-color: rgba(168, 85, 247, 0.3);
}

[data-theme='light'] .pill--policy {
  color: #166534;
}

[data-theme='light'] .pill--ops {
  color: #1e3a8a;
}

[data-theme='light'] .pill--tech {
  color: #991b1b;
}

[data-theme='light'] .pill--creative {
  color: #5b21b6;
}

.history-item {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: var(--space-3);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.history-item:last-child {
  margin-bottom: 0;
}

.history-item:hover,
.history-item:focus-visible {
  border-color: var(--border-strong);
  background: rgba(99, 102, 241, 0.12);
}

.history-item.is-active {
  border-color: var(--border-strong);
  background: rgba(99, 102, 241, 0.18);
}

.option-row {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.block-body {
  margin-top: var(--space-3);
}

.block-actions button {
  margin-left: var(--space-2);
}

.tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.tab {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.1);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
  color: var(--color-text-2);
  border: none;
  font-family: inherit;
}

.tab.active,
.tab:hover {
  background: var(--accent);
  color: #fff;
}

.divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-4) 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 22, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  backdrop-filter: blur(var(--blur-1));
  z-index: 50;
  opacity: 0;
  transition: opacity 180ms ease;
}

.modal-backdrop.active,
.modal-backdrop.is-visible {
  display: flex;
  opacity: 1;
}

.modal {
  background: var(--surface-1);
  border-radius: var(--radius-xl);
  padding: var(--space-7);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-3);
  border: 1px solid var(--border-subtle);
  transform: translateY(8px);
  transition: transform 180ms ease;
}

.modal-backdrop.is-visible .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.modal-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.accordion {
  display: grid;
  gap: var(--space-3);
}

.accordion-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2);
  background: var(--color-surface-1);
  overflow: hidden;
}

.accordion-toggle {
  width: 100%;
  padding: var(--space-4);
  background: transparent;
  border: none;
  color: var(--color-text-1);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  font-weight: 600;
  cursor: pointer;
}

.accordion-content {
  padding: 0 var(--space-4) var(--space-4);
  color: var(--color-text-2);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 200ms ease, opacity 200ms ease;
}

.accordion-toggle[aria-expanded='true'] + .accordion-content {
  max-height: 480px;
  opacity: 1;
}

.admin-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-6) var(--space-11);
}

.floating-action {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: rgba(15, 23, 42, 0.8);
  color: var(--color-text-2);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
  backdrop-filter: blur(var(--blur-1));
}

.floating-action:hover {
  color: var(--color-text-1);
  border-color: var(--accent);
}

.hidden {
  display: none;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.mt-3 {
  margin-top: var(--space-3);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-6 {
  margin-bottom: var(--space-6);
}

.error {
  color: var(--color-danger);
  font-size: var(--text-sm);
  min-height: 20px;
}

.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@media (max-width: 900px) {
  .layout-split {
    grid-template-columns: 1fr;
  }

  .layout-triple {
    grid-template-columns: 1fr;
  }

  .layout-dual {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: var(--space-4) 0;
  }

  .header-main {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .nav {
    gap: var(--space-2);
  }
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-group-label {
    display: block;
    margin: var(--space-4) 0 var(--space-2);
  }

  .theme-toggle--desktop {
    display: none;
  }
}

@media (min-width: 901px) {
  .header-cta {
    display: inline-flex;
  }

  .nav-group-label {
    display: none;
  }
}

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