/* ==========================================================================
   Dual Internet — Base: reset, typography, layout, components
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--sp-6));
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--text-base);
  line-height: 1.65;
  font-weight: 400;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  overflow-x: hidden;
  font-feature-settings: 'cv11' 1, 'ss01' 1;
  transition: background-color var(--dur-slow) var(--ease-smooth),
              color var(--dur-slow) var(--ease-smooth);
}

img, svg, video, canvas { display: block; max-width: 100%; height: auto; }
svg { flex: none; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; padding: 0; cursor: pointer; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }

/* ---------- Focus: always visible, never removed ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ---------- Selection ---------- */
::selection { background: var(--glow-a); color: var(--fg); }

/* ---------- Scrollbar ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-full);
  border: 3px solid var(--bg-deep);
}
::-webkit-scrollbar-thumb:hover { background: var(--fg-subtle); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 640;
  line-height: 1.12;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
h1 { font-size: var(--text-4xl); letter-spacing: -0.035em; }
h2 { font-size: var(--text-3xl); letter-spacing: -0.028em; }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); letter-spacing: -0.015em; }
h5 { font-size: var(--text-lg); letter-spacing: -0.01em; }
h6 { font-size: var(--text-base); letter-spacing: 0; }

p { text-wrap: pretty; }

code, kbd, pre, samp, .mono, .tabular {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-variant-ligatures: none;
}
.tabular { font-variant-numeric: tabular-nums; }

code:not(pre code) {
  font-size: 0.875em;
  padding: 0.15em 0.42em;
  background: var(--surface-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  color: var(--lane-a);
  /* Wrap at spaces, and break a long unbroken token rather than forcing the
     whole line past the viewport edge where it cannot be scrolled to. */
  overflow-wrap: break-word;
}

kbd {
  font-size: 0.78em;
  font-weight: 500;
  padding: 0.2em 0.48em;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  color: var(--fg);
  white-space: nowrap;
}

/* ---------- Utility text ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--lane-a);
}
.lead {
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--fg-muted);
  max-width: 62ch;
}
.muted { color: var(--fg-muted); }
.subtle { color: var(--fg-subtle); }
.small { font-size: var(--text-sm); }
.center { text-align: center; }
.center .lead, .center .section-intro { margin-inline: auto; }

.text-gradient {
  background: linear-gradient(104deg, var(--fg) 8%, var(--lane-a) 46%, var(--lane-b) 88%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-wide { max-width: var(--container-wide); }
.container-prose { max-width: var(--container-prose); }

.section { padding-block: var(--section-y); position: relative; }
.section-sm { padding-block: var(--section-y-sm); }
.section-tint { background: var(--bg-deep); }
.section-hairline { border-top: 1px solid var(--border-subtle); }

.section-head { margin-bottom: var(--sp-12); max-width: 66ch; }
.section-head.center { margin-inline: auto; }
.section-head .eyebrow { margin-bottom: var(--sp-4); }
.section-head h2 { margin-bottom: var(--sp-4); }
.section-intro { font-size: var(--text-lg); color: var(--fg-muted); line-height: 1.7; max-width: 62ch; }

.grid { display: grid; gap: var(--sp-6); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); }

.stack { display: flex; flex-direction: column; }
.stack-2 { gap: var(--sp-2); } .stack-3 { gap: var(--sp-3); }
.stack-4 { gap: var(--sp-4); } .stack-6 { gap: var(--sp-6); }
.stack-8 { gap: var(--sp-8); } .stack-12 { gap: var(--sp-12); }

.row { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.row-tight { gap: var(--sp-2); }
.row-between { justify-content: space-between; }
.row-center { justify-content: center; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
}
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: var(--z-toast);
  padding: var(--sp-3) var(--sp-5);
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--r-md);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus-visible { top: var(--sp-4); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  --btn-py: 0.72rem;
  --btn-px: 1.35rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: var(--btn-py) var(--btn-px);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.2;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  transition: background-color var(--dur-fast) var(--ease-smooth),
              border-color var(--dur-fast) var(--ease-smooth),
              color var(--dur-fast) var(--ease-smooth),
              box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-fast) var(--ease-spring);
}
.btn:active { transform: scale(0.972); }

/* Sheen sweep on hover — transform only, no reflow */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, transparent 26%, rgba(255,255,255,0.2) 50%, transparent 74%);
  transform: translateX(-102%);
  transition: transform var(--dur-slower) var(--ease-smooth);
}
.btn:hover::after { transform: translateX(102%); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 6px 20px -6px var(--glow-b);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset, 0 12px 30px -8px var(--glow-b);
  transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0) scale(0.972); }

.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--fg);
}
.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.btn-secondary:active { transform: translateY(0) scale(0.972); }

.btn-ghost { background: transparent; color: var(--fg-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--fg); }
.btn-ghost::after { display: none; }

.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--fg); }
.btn-outline:hover { border-color: var(--lane-a); color: var(--lane-a); background: color-mix(in srgb, var(--lane-a) 8%, transparent); }

.btn-lg { --btn-py: 0.95rem; --btn-px: 1.9rem; font-size: var(--text-base); min-height: 52px; border-radius: var(--r-lg); }
.btn-sm { --btn-py: 0.5rem; --btn-px: 0.9rem; font-size: var(--text-xs); min-height: 38px; }
.btn-block { width: 100%; }

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.44;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}
.btn svg { width: 18px; height: 18px; }
.btn-sm svg { width: 15px; height: 15px; }

/* Arrow nudge */
.btn .arrow { transition: transform var(--dur-base) var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }

/* Loading state */
.btn.is-loading { pointer-events: none; color: transparent !important; }
.btn.is-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px; height: 18px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: var(--accent-fg);
  animation: spin 0.62s linear infinite;
}
.btn-secondary.is-loading::before, .btn-outline.is-loading::before { color: var(--fg); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Cards & surfaces
   ========================================================================== */
.card {
  position: relative;
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: border-color var(--dur-base) var(--ease-smooth),
              transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              background-color var(--dur-base) var(--ease-smooth);
}
.card-hover:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: var(--shadow-3);
}

/* Cursor-tracking spotlight (set by JS: --mx/--my) */
.card-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%),
              var(--lane-a), transparent 62%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-smooth);
  pointer-events: none;
}
.card-glow:hover::before { opacity: 1; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.3rem 0.78rem;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  white-space: nowrap;
}
.pill-accent { background: color-mix(in srgb, var(--accent) 13%, transparent); border-color: color-mix(in srgb, var(--accent) 34%, transparent); color: var(--accent); }
.pill-a { background: color-mix(in srgb, var(--lane-a) 13%, transparent); border-color: color-mix(in srgb, var(--lane-a) 34%, transparent); color: var(--lane-a); }
.pill-warn { background: color-mix(in srgb, var(--warning) 13%, transparent); border-color: color-mix(in srgb, var(--warning) 34%, transparent); color: var(--warning); }
.pill-danger { background: color-mix(in srgb, var(--danger) 13%, transparent); border-color: color-mix(in srgb, var(--danger) 34%, transparent); color: var(--danger); }
.pill-violet { background: color-mix(in srgb, var(--violet-400) 13%, transparent); border-color: color-mix(in srgb, var(--violet-400) 34%, transparent); color: var(--violet-400); }

/* Icon tile */
.icon-tile {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--lane-a);
  flex: none;
  transition: transform var(--dur-base) var(--ease-spring),
              background-color var(--dur-base) var(--ease-smooth),
              border-color var(--dur-base) var(--ease-smooth),
              color var(--dur-base) var(--ease-smooth);
}
.icon-tile svg { width: 22px; height: 22px; }
.card-hover:hover .icon-tile,
.icon-tile-hover:hover {
  transform: scale(1.09) rotate(-4deg);
  border-color: color-mix(in srgb, var(--lane-a) 45%, transparent);
  background: color-mix(in srgb, var(--lane-a) 11%, var(--surface-2));
}
.icon-tile-b { color: var(--lane-b); }
.icon-tile-lg { width: 54px; height: 54px; border-radius: var(--r-lg); }
.icon-tile-lg svg { width: 26px; height: 26px; }

/* ==========================================================================
   Background decoration
   ========================================================================== */
.bg-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(ellipse 78% 62% at 50% 32%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 78% 62% at 50% 32%, #000 30%, transparent 100%);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}
.bg-orb-a { background: var(--glow-a); }
.bg-orb-b { background: var(--glow-b); }

.bg-noise {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Hairline divider with center glow */
.hairline {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--border-strong) 22%, var(--border-strong) 78%, transparent);
  opacity: 0.6;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.label { font-size: var(--text-sm); font-weight: 600; color: var(--fg); display: flex; align-items: center; gap: var(--sp-2); }
.label .req { color: var(--danger); font-weight: 700; }
.label .opt { color: var(--fg-subtle); font-weight: 400; font-size: var(--text-xs); }

.input, .select, .textarea {
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 0.9rem;
  font-size: var(--text-base);
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--fg);
  transition: border-color var(--dur-fast) var(--ease-smooth),
              box-shadow var(--dur-fast) var(--ease-smooth),
              background-color var(--dur-fast) var(--ease-smooth);
}
.textarea { min-height: 128px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--fg-subtle); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent);
  background: var(--surface);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 17px;
  padding-right: 2.5rem;
  cursor: pointer;
}
.helper { font-size: var(--text-xs); color: var(--fg-subtle); line-height: 1.55; }

.error-msg {
  display: none;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--danger);
  line-height: 1.5;
}
.error-msg svg { width: 14px; height: 14px; flex: none; }
.field.has-error .error-msg { display: flex; animation: shake-in var(--dur-base) var(--ease-out); }
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent);
}
@keyframes shake-in {
  0% { opacity: 0; transform: translateX(-7px); }
  55% { transform: translateX(3px); }
  100% { opacity: 1; transform: translateX(0); }
}

.checkbox-row { display: flex; align-items: flex-start; gap: var(--sp-3); cursor: pointer; }
.checkbox-row input[type="checkbox"] {
  appearance: none;
  width: 20px; height: 20px;
  flex: none;
  margin-top: 2px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-inset);
  cursor: pointer;
  position: relative;
  transition: background-color var(--dur-fast) var(--ease-smooth),
              border-color var(--dur-fast) var(--ease-smooth);
}
.checkbox-row input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.checkbox-row input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5.5px; top: 2px;
  width: 5px; height: 10px;
  border: solid var(--accent-fg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  animation: check-pop var(--dur-fast) var(--ease-spring);
}
@keyframes check-pop { from { transform: rotate(45deg) scale(0.4); opacity: 0; } to { transform: rotate(45deg) scale(1); opacity: 1; } }
.checkbox-row span { font-size: var(--text-sm); color: var(--fg-muted); line-height: 1.55; }

/* ==========================================================================
   Code blocks
   ========================================================================== */
.code-block {
  position: relative;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--fg-muted);
}
.code-dots { display: flex; gap: 6px; }
.code-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.code-dots i:nth-child(1) { background: #ff5f57; }
.code-dots i:nth-child(2) { background: #febc2e; }
.code-dots i:nth-child(3) { background: #28c840; }
.code-title { font-family: 'JetBrains Mono', monospace; letter-spacing: -0.01em; }

.code-block pre {
  margin: 0;
  padding: var(--sp-5);
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: 1.75;
  tab-size: 2;
}
.code-block code { color: var(--slate-300); background: none; border: none; padding: 0; white-space: pre; }

/* Syntax tokens */
.tok-cmd { color: var(--green-400); font-weight: 500; }
.tok-flag { color: var(--cyan-400); }
.tok-str { color: var(--amber-400); }
.tok-com { color: var(--slate-500); font-style: italic; }
.tok-kw { color: var(--violet-400); }
.tok-num { color: var(--amber-400); }
.tok-fn { color: var(--cyan-300); }
.tok-out { color: var(--slate-400); }
[data-theme="light"] .code-block code { color: #334155; }
[data-theme="light"] .tok-cmd { color: #15803d; }
[data-theme="light"] .tok-flag { color: #0e7490; }
[data-theme="light"] .tok-str { color: #b45309; }
[data-theme="light"] .tok-com { color: #64748b; }
[data-theme="light"] .tok-kw { color: #7c3aed; }
[data-theme="light"] .tok-fn { color: #0891b2; }
[data-theme="light"] .tok-num { color: #b45309; }

.copy-btn {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 32px;
  padding: 0.32rem 0.62rem;
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--fg-muted);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-smooth),
              color var(--dur-fast) var(--ease-smooth),
              border-color var(--dur-fast) var(--ease-smooth),
              transform var(--dur-fast) var(--ease-spring);
}
.code-block:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--fg); border-color: var(--border-strong); }
.copy-btn:active { transform: scale(0.93); }
.copy-btn svg { width: 13px; height: 13px; }
.copy-btn.is-copied { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.code-block.has-head .copy-btn { top: 50px; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
table.data { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 560px; }
table.data th, table.data td { padding: var(--sp-3) var(--sp-4); text-align: left; vertical-align: top; }
table.data thead th {
  position: sticky; top: 0;
  background: var(--surface-2);
  font-size: var(--text-xs);
  font-weight: 640;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  z-index: 1;
}
table.data tbody tr { border-bottom: 1px solid var(--border-subtle); transition: background-color var(--dur-fast) var(--ease-smooth); }
table.data tbody tr:last-child { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td code { font-size: 0.86em; }
table.data .cell-mono { font-family: 'JetBrains Mono', monospace; font-size: 0.86em; color: var(--lane-a); white-space: nowrap; }

/* ==========================================================================
   Toast
   ========================================================================== */
.toast-region {
  position: fixed;
  bottom: var(--sp-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: center;
  pointer-events: none;
  padding-inline: var(--sp-4);
  width: min(440px, 100%);
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--fg);
  pointer-events: auto;
  animation: toast-in var(--dur-base) var(--ease-out);
}
.toast.is-out { animation: toast-out var(--dur-fast) var(--ease-in) forwards; }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast-ok svg { color: var(--accent); }
.toast-err svg { color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(18px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(0.96); } }

/* ==========================================================================
   Misc components
   ========================================================================== */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  position: relative;
}
.status-dot::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: dot-ping 2.4s var(--ease-out) infinite;
}
@keyframes dot-ping {
  0% { opacity: 0.7; transform: scale(0.6); }
  70%, 100% { opacity: 0; transform: scale(1.5); }
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--lane-a);
  transition: gap var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-smooth);
}
.link-arrow svg { width: 15px; height: 15px; transition: transform var(--dur-base) var(--ease-out); }
.link-arrow:hover { gap: var(--sp-3); }
.link-arrow:hover svg { transform: translateX(2px); }

.link-underline { color: var(--lane-a); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--lane-a) 40%, transparent); text-underline-offset: 3px; transition: text-decoration-color var(--dur-fast) var(--ease-smooth); }
.link-underline:hover { text-decoration-color: var(--lane-a); }

/* Prose blocks (legal / guides) */
.prose { max-width: var(--container-prose); font-size: var(--text-base); line-height: 1.78; color: var(--fg-muted); }
.prose > * + * { margin-top: var(--sp-4); }
.prose h2 { font-size: var(--text-2xl); color: var(--fg); margin-top: var(--sp-12); margin-bottom: var(--sp-4); scroll-margin-top: calc(var(--nav-h) + var(--sp-6)); }
.prose h3 { font-size: var(--text-lg); color: var(--fg); margin-top: var(--sp-8); margin-bottom: var(--sp-3); scroll-margin-top: calc(var(--nav-h) + var(--sp-6)); }
.prose h4 { font-size: var(--text-base); color: var(--fg); margin-top: var(--sp-6); margin-bottom: var(--sp-2); }
.prose strong { color: var(--fg); font-weight: 620; }
.prose ul, .prose ol { padding-left: var(--sp-5); }
.prose ul li { list-style: disc; margin-top: var(--sp-2); }
.prose ol li { list-style: decimal; margin-top: var(--sp-2); }
.prose ul li::marker, .prose ol li::marker { color: var(--lane-a); }
.prose a { color: var(--lane-a); text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote {
  padding: var(--sp-4) var(--sp-5);
  border-left: 3px solid var(--lane-a);
  background: var(--surface-2);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--fg-muted);
}

/* Callout */
.callout {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-left: 3px solid var(--lane-a);
}
.callout svg { width: 20px; height: 20px; flex: none; color: var(--lane-a); margin-top: 2px; }
.callout-title { font-weight: 620; color: var(--fg); font-size: var(--text-sm); margin-bottom: var(--sp-1); }
.callout-body { font-size: var(--text-sm); color: var(--fg-muted); line-height: 1.65; }
.callout-warn { border-left-color: var(--warning); }
.callout-warn svg { color: var(--warning); }
.callout-danger { border-left-color: var(--danger); }
.callout-danger svg { color: var(--danger); }
.callout-ok { border-left-color: var(--accent); }
.callout-ok svg { color: var(--accent); }

/* Screen-reader only */
.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;
}
