:root {
  --bg: #08090a;
  --bg-raised: #0e1012;
  --bg-card: #121417;
  --bg-card-hover: #181b20;
  --border: #1c1f26;
  --border-hover: #2a2e38;
  --text: #bcc3cf;
  --text-strong: #e2e6ed;
  --text-muted: #525b6b;
  --accent: #e55e5e;
  --accent-dim: #a03d3d;
  --accent-bright: #ff7b7b;
  --accent-glow: rgba(229, 94, 94, 0.07);
  --accent-glow-strong: rgba(229, 94, 94, 0.14);
  --link: #ef6a6a;
  --link-hover: #ffa3a3;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
  --radius: 8px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.15);
  --shadow-card-hover: 0 4px 20px rgba(0,0,0,0.4), 0 0 40px rgba(229, 94, 94, 0.08);
  --nav-bg: rgba(8, 9, 10, 0.82);
  --glow-subtle: rgba(229, 94, 94, 0.04);
  --glow-faint: rgba(229, 94, 94, 0.03);
  --watermark-opacity: 0.025;
}

/* Light theme */
[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-raised: #eaecef;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f1f4;
  --border: #d4d8e0;
  --border-hover: #b8bec9;
  --text: #3b4151;
  --text-strong: #1a1e28;
  --text-muted: #7a8296;
  --accent: #c94040;
  --accent-dim: #983232;
  --accent-bright: #e55e5e;
  --accent-glow: rgba(201, 64, 64, 0.07);
  --accent-glow-strong: rgba(201, 64, 64, 0.14);
  --link: #b93a3a;
  --link-hover: #8c2a2a;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 4px 20px rgba(0,0,0,0.1), 0 0 40px rgba(201, 64, 64, 0.06);
  --nav-bg: rgba(244, 245, 247, 0.85);
  --glow-subtle: rgba(201, 64, 64, 0.03);
  --glow-faint: rgba(201, 64, 64, 0.02);
  --watermark-opacity: 0.04;
}

/* Auto-detect system preference when no explicit theme set */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f4f5f7;
    --bg-raised: #eaecef;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f1f4;
    --border: #d4d8e0;
    --border-hover: #b8bec9;
    --text: #3b4151;
    --text-strong: #1a1e28;
    --text-muted: #7a8296;
    --accent: #c94040;
    --accent-dim: #983232;
    --accent-bright: #e55e5e;
    --accent-glow: rgba(201, 64, 64, 0.07);
    --accent-glow-strong: rgba(201, 64, 64, 0.14);
    --link: #b93a3a;
    --link-hover: #8c2a2a;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-card-hover: 0 4px 20px rgba(0,0,0,0.1), 0 0 40px rgba(201, 64, 64, 0.06);
    --nav-bg: rgba(244, 245, 247, 0.85);
    --glow-subtle: rgba(201, 64, 64, 0.03);
    --glow-faint: rgba(201, 64, 64, 0.02);
    --watermark-opacity: 0.04;
  }
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Accessibility ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: 0 0 6px 6px;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 200;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Page Transitions ── */
.page-enter {
  animation: page-fade-in 0.35s ease-out both;
}

@keyframes page-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ── Ambient background glow ── */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: 50%;
  width: 800px;
  height: 800px;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--glow-subtle) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -30%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--glow-faint) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Keyframes ── */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scan-line {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Nav ── */
nav#nav {
  position: sticky;
  top: 0;
  z-index: 100;
  isolation: isolate;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

nav#nav::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.35;
  animation: pulse-glow 4s ease-in-out infinite;
}

.nav-inner {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text-strong);
}

.nav-logo {
  width: 30px;
  height: 30px;
  opacity: 0.9;
  transition: opacity 0.3s, filter 0.3s, transform 0.3s;
}

.nav-brand:hover .nav-logo {
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(229, 94, 94, 0.5));
  transform: scale(1.05);
}

.nav-name {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.14em;
  color: var(--text-strong);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 6px;
  transition: border-color 0.2s;
}

.nav-toggle:hover {
  border-color: var(--border);
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-muted);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s, background 0.2s;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
  background: var(--accent);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
  background: var(--accent);
}

.nav-links {
  display: flex;
  gap: 0.3rem;
}

.nav-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s, text-shadow 0.3s;
  position: relative;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-card);
  text-shadow: 0 0 12px rgba(229, 94, 94, 0.15);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-glow);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 25%;
  right: 25%;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  box-shadow: 0 0 12px var(--accent-dim), 0 0 4px var(--accent);
}

/* ── Main ── */
main#app {
  flex: 1;
  max-width: 1020px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  width: 100%;
  position: relative;
}

main#app::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  transform: translate(-50%, -50%);
  background: url('/static/img/logo.png') center / contain no-repeat;
  opacity: var(--watermark-opacity);
  pointer-events: none;
  z-index: 0;
}

.page {
  display: block;
}

/* ── Unit Header (Hero) ── */
.unit-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  padding: 2rem 2.25rem;
  background: linear-gradient(135deg, var(--bg-raised) 0%, rgba(229, 94, 94, 0.05) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  animation: fade-in-up 0.6s ease-out;
}

.unit-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, var(--accent) 50%, transparent 95%);
  opacity: 0.6;
}

.unit-header::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(229, 94, 94, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.unit-logo {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 16px rgba(229, 94, 94, 0.25));
  transition: filter 0.4s, transform 0.4s;
}

.unit-header:hover .unit-logo {
  filter: drop-shadow(0 0 24px rgba(229, 94, 94, 0.4));
  transform: scale(1.04);
}

.unit-title h1 {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: 0.03em;
}

.unit-subtitle {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── Content Grid ── */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  position: relative;
  overflow: hidden;
  animation: fade-in-up 0.6s ease-out both;
}

.content-grid .card:nth-child(1) { animation-delay: 0.05s; }
.content-grid .card:nth-child(2) { animation-delay: 0.1s; }
.content-grid .card:nth-child(3) { animation-delay: 0.15s; }
.content-grid .card:nth-child(4) { animation-delay: 0.2s; }
.content-grid .card:nth-child(5) { animation-delay: 0.25s; }
.content-grid .card:nth-child(6) { animation-delay: 0.3s; }

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-bright), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}

.card:hover::before {
  opacity: 0.6;
}

.card:hover::after {
  opacity: 0.8;
  animation: scan-line 1.5s ease-in-out;
}

.card-wide {
  grid-column: 1 / -1;
}

.tagline {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  font-style: italic;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  text-shadow: 0 0 24px rgba(229, 94, 94, 0.25);
  background: linear-gradient(90deg, var(--accent), var(--accent-bright), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 6s linear infinite;
}

.card h2 {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card h2::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 12px;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent-dim));
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(229, 94, 94, 0.3);
}

.card p {
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 0.65rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.hint {
  margin-top: 0.75rem;
  font-style: italic;
}

/* ── Info rows ── */
.info-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.5rem;
  border-radius: 6px;
  transition: background 0.2s, box-shadow 0.2s;
}

.info-row:not(:last-of-type) {
  border-bottom: 1px solid var(--border);
}

.info-row:hover {
  background: var(--accent-glow);
  box-shadow: inset 0 0 20px rgba(229, 94, 94, 0.03);
}

.label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 85px;
  flex-shrink: 0;
}

.value {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text);
}

a.value.link {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}

a.value.link:hover {
  color: var(--link-hover);
  text-shadow: 0 0 12px rgba(229, 94, 94, 0.3);
}

/* ── Server status ── */
.server-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.5rem;
  border-radius: 6px;
  transition: background 0.2s, box-shadow 0.2s;
}

.server-row:not(:last-of-type) {
  border-bottom: 1px solid var(--border);
}

.server-row:hover {
  background: var(--accent-glow);
  box-shadow: inset 0 0 20px rgba(229, 94, 94, 0.03);
}

.server-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
  transition: background 0.3s, box-shadow 0.3s;
}

.server-status-dot.online {
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
  animation: status-pulse 2s ease-in-out infinite;
}

.server-status-dot.offline {
  background: var(--text-muted);
  opacity: 0.5;
}

@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(74, 222, 128, 0.4); }
  50% { box-shadow: 0 0 14px rgba(74, 222, 128, 0.7); }
}

.server-detail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  margin-right: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.server-map {
  color: var(--text-muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-players {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

.server-offline-text {
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.6;
}

.server-row .value {
  display: none;
}

.server-row .btn-copy {
  display: none;
}

@media (min-width: 720px) {
  .server-row .value {
    display: inline;
    font-size: 0.75rem;
  }
  .server-row .btn-copy {
    display: inline;
  }
}

.btn-copy {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  cursor: pointer;
  margin-left: auto;
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
}

.btn-copy:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--accent-glow);
  box-shadow: 0 0 12px rgba(229, 94, 94, 0.15);
  transform: scale(1.05);
}

/* ── Link list ── */
.link-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, transform 0.2s, border-color 0.2s, box-shadow 0.3s;
}

.link-item:hover {
  background: var(--accent-glow);
  color: var(--text-strong);
  transform: translateX(4px);
  border-color: var(--border);
  box-shadow: 0 0 16px rgba(229, 94, 94, 0.06);
}

.link-icon {
  color: var(--accent-dim);
  font-size: 0.55rem;
  transition: color 0.2s, text-shadow 0.2s, transform 0.3s;
}

.link-item:hover .link-icon {
  color: var(--accent-bright);
  text-shadow: 0 0 8px var(--accent);
  transform: scale(1.3);
}

/* ── YouTube Embed ── */
.yt-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}

.yt-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.yt-facade {
  cursor: pointer;
}

.yt-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  transition: filter 0.3s;
}

.yt-facade:hover .yt-thumb {
  filter: brightness(0.7);
}

.yt-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 14px;
  transition: background 0.2s;
}

.yt-play-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 55%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent #fff;
}

.yt-facade:hover .yt-play-btn {
  background: var(--accent);
}

/* ── Docs ── */
.docs-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 2rem;
  min-height: 60vh;
}

.docs-sidebar {
  position: sticky;
  top: 72px;
  align-self: start;
}

.docs-sidebar h3 {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.85rem;
}

.docs-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.docs-nav-link {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.docs-nav-link:hover {
  color: var(--text);
  background: var(--bg-card);
}

.docs-nav-link.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-left-color: var(--accent);
  box-shadow: inset 3px 0 8px -3px rgba(229, 94, 94, 0.15);
}

.docs-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  font-size: 0.9rem;
  line-height: 1.7;
  box-shadow: var(--shadow-card);
  min-width: 0;
  overflow-x: auto;
}

.docs-content h1,
.docs-content h2,
.docs-content h3,
.docs-content h4 {
  font-family: var(--mono);
  color: var(--text-strong);
  margin: 1.75rem 0 0.6rem;
}

.docs-content h1 { font-size: 1.35rem; }
.docs-content h2 {
  font-size: 1.05rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.docs-content h3 { font-size: 0.92rem; }

.docs-content h1:first-child,
.docs-content h2:first-child {
  margin-top: 0;
}

.docs-content p {
  margin-bottom: 0.8rem;
}

.docs-content code {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--accent);
}

.docs-content pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  margin: 1rem 0;
  max-width: 100%;
}

.docs-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
}

.docs-content ul, .docs-content ol {
  padding-left: 1.25rem;
  margin-bottom: 0.8rem;
}

.docs-content li {
  margin-bottom: 0.35rem;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  display: block;
  overflow-x: auto;
}

.docs-content th,
.docs-content td {
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.55rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.docs-content th {
  color: var(--accent-dim);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.docs-content a {
  color: var(--link);
  transition: color 0.2s;
}

.docs-content a:hover {
  color: var(--link-hover);
}

.docs-content blockquote {
  border-left: 3px solid var(--accent-dim);
  color: var(--text-muted);
  margin: 1rem 0;
  background: var(--accent-glow);
  padding: 0.75rem 1.1rem;
  border-radius: 0 6px 6px 0;
}

/* ── 404 ── */
.error-page {
  text-align: center;
  padding: 6rem 2rem;
  animation: fade-in-up 0.6s ease-out;
}

.error-page h1 {
  font-family: var(--mono);
  font-size: 5rem;
  font-weight: 600;
  color: var(--accent-dim);
  line-height: 1;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 40px rgba(229, 94, 94, 0.15);
}

.error-page p {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.error-link {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  transition: background 0.2s, box-shadow 0.2s;
}

.error-link:hover {
  background: var(--accent-glow);
  box-shadow: 0 0 16px rgba(229, 94, 94, 0.1);
}

/* ── Theme Toggle ── */
.theme-toggle {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 1rem;
  transition: color 0.2s, border-color 0.2s;
  padding: 0;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--border);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

/* Show moon in dark mode (click to go light), sun in light mode (click to go dark) */
.theme-toggle .icon-moon { display: inline; }
.theme-toggle .icon-sun { display: none; }

[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: inline; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme]) .theme-toggle .icon-sun { display: inline; }
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  background: var(--bg-raised);
  position: relative;
  min-width: 100%;
}

footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
  opacity: 0.15;
}

footer p {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 720px) {
  .nav-inner {
    padding: 0 1.25rem;
    flex-wrap: nowrap;
    position: relative;
    height: 56px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    padding: 0.55rem 0.6rem 0.7rem;
    gap: 0.15rem;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-top: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 140;
  }

  .nav-links.open {
    display: flex;
  }

  nav#nav:has(.nav-links.open)::after {
    opacity: 0;
  }

  .nav-link {
    padding: 0.55rem 0.85rem;
  }

  .nav-link.active::after {
    display: none;
  }

  main#app {
    padding: 1.5rem 1.25rem;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

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

  .docs-sidebar {
    position: static;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
  }

  .unit-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
  }

  .docs-content {
    padding: 1.25rem 1.5rem;
  }
}
