/* ==========================================================================
   Devntric Unit Converter: Core Stylesheet
   Design system derived from the Devntric mark: a magenta→violet ridge
   swirl resolving into an orange-red crescent. Dark instrument-panel theme.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ---- Color tokens (derived from logo) ---- */
  --void:            #07070a;
  --surface-0:       #0c0c10;
  --surface-1:       #131318;
  --surface-2:       #1a1a21;
  --border-soft:     rgba(255, 255, 255, 0.08);
  --border-strong:   rgba(255, 255, 255, 0.16);

  --ink:             #f4f3f8;
  --ink-dim:         #9997a3;
  --ink-faint:       #67656f;

  --magenta:         #ec1791;
  --violet:          #a821d8;
  --orange:          #ff6a3d;
  --red-orange:      #ff3d63;

  --grad-signature:  linear-gradient(120deg, var(--violet) 0%, var(--magenta) 48%, var(--orange) 100%);
  --grad-signature-soft: linear-gradient(120deg, rgba(168,33,216,.35) 0%, rgba(236,23,145,.35) 48%, rgba(255,106,61,.35) 100%);
  --grad-radial-glow: radial-gradient(circle at 30% 20%, rgba(168,33,216,.25), transparent 60%),
                       radial-gradient(circle at 75% 60%, rgba(255,106,61,.18), transparent 55%);

  --success: #2fd88f;
  --danger:  #ff5470;

  /* ---- Type ---- */
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* ---- Scale ---- */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  --shadow-soft: 0 8px 30px rgba(0,0,0,.35);
  --shadow-glow: 0 0 0 1px rgba(255,255,255,.04), 0 20px 60px rgba(168,33,216,.12);

  --ease-out: cubic-bezier(.16,.8,.32,1);
  --nav-h: 72px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); overflow-x: hidden; width: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; margin: 0; padding: 0; }
img, picture { max-width: 100%; display: block; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

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

body {
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* subtle grain + glow backdrop, fixed, low cost */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--grad-radial-glow);
  pointer-events: none;
  z-index: 0;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--space-5);
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); line-height: 1.15; }
h3 { font-size: 1.2rem; }
p.lede { color: var(--ink-dim); font-size: 1.05rem; max-width: 56ch; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 6px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.02);
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--grad-signature);
  box-shadow: 0 0 10px var(--magenta);
}

/* focus states, accessible, visible, on brand */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--magenta);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--magenta);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 8px 0;
  z-index: 999;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid var(--border-soft);
  background: var(--surface-1);
  color: var(--ink);
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform .2s var(--ease-out), border-color .2s, background .2s;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  border: none;
  background: var(--grad-signature);
  color: #fff;
  box-shadow: 0 10px 30px rgba(236,23,145,.25);
}
.btn-primary:hover { box-shadow: 0 14px 36px rgba(236,23,145,.35); }

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

.btn-icon {
  width: 44px; height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--surface-1);
}

.btn-sm { padding: 8px 14px; font-size: 0.82rem; }

/* ripple */
.ripple { position: relative; overflow: hidden; }
.ripple-dot {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255,255,255,.5);
  animation: ripple-anim .6s var(--ease-out);
  pointer-events: none;
}

/* ---- Glass card ---- */
.glass {
  background: rgba(19, 19, 24, 0.6);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-soft);
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(7,7,10,0.55);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand img { height: 34px; width: 34px; object-fit: contain; }
.brand span { color: var(--ink); }
.brand span em {
  font-style: normal;
  background: var(--grad-signature);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav-links a {
  color: var(--ink-dim);
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
  padding: 6px 2px;
  transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--grad-signature);
  transition: right .25s var(--ease-out);
  border-radius: 2px;
}
.nav-links a:hover::after, .nav-links a.active::after { right: 0; }

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

.hamburger {
  display: none;
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  width: 18px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .25s var(--ease-out), opacity .2s;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-panel {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background: rgba(7,7,10,0.98);
  backdrop-filter: blur(20px);
  z-index: 99;
  display: flex;
  flex-direction: column;
  padding: var(--space-6) var(--space-5);
  gap: var(--space-5);
  transform: translateX(100%);
  transition: transform .35s var(--ease-out);
}
.mobile-panel.open { transform: translateX(0); }
.mobile-panel a {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-soft);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-8) 0 var(--space-7);
}
.hero-arcs {
  position: absolute;
  top: -120px; right: -160px;
  width: 620px; height: 620px;
  pointer-events: none;
  opacity: 0.55;
  z-index: 0;
}
.hero-head {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin-bottom: var(--space-7);
}
.hero-head .eyebrow { margin-bottom: var(--space-4); }
.hero-head h1 { margin-bottom: var(--space-4); }
.hero-head h1 .grad {
  background: var(--grad-signature);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-stats {
  display: flex;
  gap: var(--space-6);
  margin-top: var(--space-6);
  flex-wrap: wrap;
}
.hero-stats div { display: flex; flex-direction: column; gap: 2px; }
.hero-stats .num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
}
.hero-stats .label { font-size: 0.78rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .08em; }

/* ==========================================================================
   Converter: the signature instrument
   ========================================================================== */
.converter {
  position: relative;
  z-index: 2;
  padding: var(--space-6);
}

.category-search {
  position: relative;
  margin-bottom: var(--space-5);
}
.category-search input {
  width: 100%;
  background: var(--surface-0);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  padding: 14px 20px 14px 46px;
  color: var(--ink);
  font-size: 0.95rem;
  transition: border-color .2s, box-shadow .2s;
}
.category-search input::placeholder { color: var(--ink-faint); }
.category-search input:focus { border-color: var(--magenta); box-shadow: 0 0 0 4px rgba(236,23,145,.12); outline: none; }
.category-search svg {
  position: absolute;
  left: 18px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--ink-faint);
}
.search-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  z-index: 20;
  box-shadow: var(--shadow-soft);
  display: none;
}
.search-suggest.open { display: block; }
.search-suggest button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 16px;
  background: transparent;
  border: none;
  text-align: left;
  color: var(--ink);
  border-bottom: 1px solid var(--border-soft);
}
.search-suggest button:last-child { border-bottom: none; }
.search-suggest button:hover, .search-suggest button.active-option { background: var(--surface-2); }
.search-suggest .tag { margin-left: auto; font-size: .72rem; color: var(--ink-faint); font-family: var(--font-mono); }

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  background: var(--surface-0);
  color: var(--ink-dim);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all .2s;
  white-space: nowrap;
}
.chip:hover { color: var(--ink); border-color: var(--border-strong); }
.chip.active {
  color: #fff;
  border-color: transparent;
  background: var(--grad-signature);
  box-shadow: 0 6px 20px rgba(236,23,145,.3);
}
.chip-scroll {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.chip-scroll::-webkit-scrollbar { display: none; }

.convert-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-4);
  align-items: end;
}
.convert-field label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
}
.field-box {
  background: var(--surface-0);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: border-color .2s, box-shadow .2s;
}
.field-box:focus-within { border-color: var(--magenta); box-shadow: 0 0 0 4px rgba(236,23,145,.12); }
.field-box input[type="number"],
.field-box input[type="text"] {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: var(--space-3);
}
.field-box input[type="number"]:focus,
.field-box input[type="text"]:focus { outline: none; }
.field-box input[type="number"]::-webkit-outer-spin-button,
.field-box input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.unit-select-wrap { position: relative; }

.unit-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  color: var(--ink);
  padding: 10px 12px 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.unit-select-trigger:hover { border-color: var(--border-strong); background: var(--surface-2); }
.unit-select-trigger:focus-visible { outline: none; border-color: var(--magenta); box-shadow: 0 0 0 4px rgba(236,23,145,.14); }
.unit-select-trigger[aria-expanded="true"] { border-color: var(--magenta); box-shadow: 0 0 0 4px rgba(236,23,145,.14); }

.usel-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.usel-chevron {
  width: 16px; height: 16px;
  flex-shrink: 0;
  color: var(--ink-faint);
  transition: transform .2s ease, color .2s ease;
}
.unit-select-trigger[aria-expanded="true"] .usel-chevron { transform: rotate(180deg); color: var(--magenta); }

.unit-select-panel {
  position: absolute;
  z-index: 150;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  max-height: 292px;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.02);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(.98);
  transform-origin: top center;
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.unit-select-panel.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.unit-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: 15px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-soft);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease;
}
.unit-option:last-child { border-bottom: none; }
.unit-option:hover,
.unit-option:focus-visible { background: var(--surface-2); }
.unit-option:focus-visible { outline: none; }
.unit-option[aria-selected="true"] .usel-name { color: var(--ink); font-weight: 600; }

.usel-radio {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  position: relative;
  flex-shrink: 0;
  transition: border-color .15s ease;
}
.unit-option[aria-selected="true"] .usel-radio {
  border-color: var(--magenta);
  box-shadow: 0 0 0 3px rgba(236,23,145,.14);
}
.unit-option[aria-selected="true"] .usel-radio::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--grad-signature);
  box-shadow: 0 0 8px rgba(236,23,145,.55);
}


.swap-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--grad-signature);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(168,33,216,.35);
  transition: transform .3s var(--ease-out);
  margin-bottom: 6px;
}
.swap-btn:hover { transform: rotate(180deg); }
.swap-btn svg { width: 22px; height: 22px; }

.result-strip {
  margin-top: var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-soft);
}
.result-readout { font-family: var(--font-mono); }
.result-readout .r-line1 { font-size: 0.85rem; color: var(--ink-dim); margin-bottom: 4px; }
.result-readout .r-line2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--ink);
}
.result-readout .r-line2 .grad {
  background: var(--grad-signature);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.result-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ==========================================================================
   Sections: History
   ========================================================================== */
.list-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-0);
  border: 1px solid var(--border-soft);
  margin-bottom: var(--space-3);
  transition: border-color .2s, transform .2s;
}
.list-card:hover { border-color: var(--border-strong); transform: translateX(2px); }
.list-card .lc-main { font-family: var(--font-mono); font-size: 0.9rem; }
.list-card .lc-main .cat { color: var(--ink-faint); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: 4px; }
.list-card .lc-actions { display: flex; gap: var(--space-2); }
.list-card .lc-actions button {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-dim);
}
.list-card .lc-actions button:hover { color: var(--ink); border-color: var(--border-strong); }

.empty-state {
  text-align: center;
  padding: var(--space-7) var(--space-5);
  color: var(--ink-faint);
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto var(--space-4); color: var(--ink-faint); opacity: .6; }
.empty-state p { font-size: 0.9rem; }

/* ==========================================================================
   Generic section layout
   ========================================================================== */
.section { padding: var(--space-8) 0; position: relative; z-index: 1; }
.section-head { max-width: 620px; margin-bottom: var(--space-6); }
.section-head .eyebrow { margin-bottom: var(--space-3); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: var(--space-6) 0;
  position: relative;
  z-index: 1;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.footer-left, .footer-right { font-size: 0.85rem; color: var(--ink-faint); }
.footer-left a, .footer-right a {
  color: var(--ink);
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color .2s, color .2s;
}
.footer-left a:hover, .footer-right a:hover { border-color: var(--magenta); color: var(--magenta); }

/* ==========================================================================
   Toasts / FAB / Back-to-top / Loader
   ========================================================================== */
.toast-region {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(360px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  box-shadow: var(--shadow-soft);
}
.toast svg { width: 18px; height: 18px; color: var(--success); flex-shrink: 0; }
.toast.error svg { color: var(--danger); }

.fab-group {
  position: fixed;
  right: 20px; bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  z-index: 200;
}
.fab {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.fab.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.fab svg { width: 20px; height: 20px; }
.fab.fab-primary { background: var(--grad-signature); border: none; }

.page-loader {
  position: fixed; inset: 0;
  background: var(--void);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s var(--ease-out), visibility .5s;
}
.page-loader.hidden { opacity: 0; visibility: hidden; }
.loader-mark { width: 56px; height: 56px; position: relative; }
.loader-mark svg { width: 100%; height: 100%; }

kbd {
  font-family: var(--font-mono);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 0.78rem;
}

.shortcuts-hint { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-4); font-size: 0.8rem; color: var(--ink-faint); }
.shortcuts-hint span { display: flex; align-items: center; gap: 6px; }

.legal-content { max-width: 70ch; }
.legal-content h2 { margin-top: var(--space-6); margin-bottom: var(--space-3); font-size: 1.2rem; }
.legal-content p, .legal-content li { color: var(--ink-dim); font-size: 0.92rem; margin-bottom: var(--space-3); }
.legal-content ul { padding-left: 1.2em; list-style: disc; }

.error-page {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6);
}
.error-page .code {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 16vw, 8rem);
  font-weight: 700;
  background: var(--grad-signature);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  line-height: 1;
}
