/* ─── Design tokens ───────────────────────────────────────────── */
:root {
  --color-bg:            #f8f9fa;
  --color-surface:       #ffffff;
  --color-surface-alt:   #f1f3f5;
  --color-border:        #dee2e6;
  --color-text:          #212529;
  --color-text-muted:    #6c757d;
  --color-accent:        #0066cc;
  --color-accent-hover:  #0052a3;
  --color-error-bg:      #fff0f0;
  --color-error-border:  #dc3545;
  --color-error-text:    #842029;
  --color-error-tint:    rgba(0,0,0,0.04);   /* faint inset behind error excerpts */
  --color-error-tint-2:  rgba(0,0,0,0.06);   /* faint inset behind suggestion code */
  --color-error-mark-bg: rgba(220, 53, 69, 0.25);
  --color-error-mark-outline: rgba(220, 53, 69, 0.55);
  --color-focus-ring:    rgba(0, 102, 204, 0.45);
  --color-success:       #198754;
  --color-privacy-bg:    #d1e7dd;
  --color-privacy-text:  #0f5132;
  --font-mono:           'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --font-sans:           system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius:              6px;
  --radius-lg:           10px;
  --shadow:              0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg:           0 4px 12px rgba(0,0,0,0.10);
}

[data-theme="dark"] {
  --color-bg:            #0d1117;
  --color-surface:       #161b22;
  --color-surface-alt:   #1c2128;
  --color-border:        #30363d;
  --color-text:          #e6edf3;
  --color-text-muted:    #8b949e;
  --color-accent:        #58a6ff;
  --color-accent-hover:  #79b8ff;
  --color-error-bg:      #2c1215;
  --color-error-border:  #f85149;
  --color-error-text:    #ff7b72;
  --color-error-tint:    rgba(0,0,0,0.25);
  --color-error-tint-2:  rgba(255,255,255,0.06);
  --color-error-mark-bg: rgba(248, 81, 73, 0.25);
  --color-error-mark-outline: rgba(248, 81, 73, 0.60);
  --color-focus-ring:    rgba(88, 166, 255, 0.55);
  --color-success:       #3fb950;
  --color-privacy-bg:    #0d2818;
  --color-privacy-text:  #3fb950;
}

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

/* ─── Base ────────────────────────────────────────────────────── */
html {
  font-size: 16px;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ─── Privacy banner ──────────────────────────────────────────── */
.privacy-banner {
  background: var(--color-privacy-bg);
  color: var(--color-privacy-text);
  text-align: center;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.privacy-banner a {
  color: inherit;
  text-decoration: underline;
}

/* ─── Ad slots ────────────────────────────────────────────────── */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}

.ad-slot--leaderboard {
  min-height: 90px;
  padding: 8px 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.ad-slot--mobile-banner {
  display: none;
  min-height: 60px;
  padding: 4px 0;
}

.ad-slot--rectangle {
  min-height: 250px;
  border: none;
  background: none;
  display: block;
  margin-top: 12px;
}

/* ─── Header ──────────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.site-logo svg {
  width: 28px;
  height: 28px;
  color: var(--color-accent);
  flex-shrink: 0;
}

.site-logo-text {
  display: flex;
  flex-direction: column;
}

.site-name {
  /* Promoted to <h1> for SEO/a11y but styled to match the logo line */
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin: 0;
}

.site-tagline {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  line-height: 1.2;
}

/* ─── Theme toggle ────────────────────────────────────────────── */
.theme-toggle {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 7px 10px;
  cursor: pointer;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

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

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

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

/* ─── Main layout ─────────────────────────────────────────────── */
.layout-wrapper {
  flex: 1;
  padding: 16px 16px 0;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr minmax(260px, 320px);
  gap: 14px;
  /* Each grid row is sized to the viewport (not the tallest item), so the
     sidebar's ads don't force the input/output panels to be enormous. */
  align-items: start;
}

/* ─── Panels ──────────────────────────────────────────────────── */
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  /* Auto-size: panels stretch to viewport height (minus header/ads/footer),
     never shrink below ~420px so the editor area stays usable on laptops. */
  height: max(420px, calc(100dvh - 220px));
  /* Clip overflow at the panel boundary. Without this, very long minified
     output (one extremely-wide line) could push the parent grid row taller
     even though `height` is set, because flex children inherit
     `min-height: auto`. */
  overflow: hidden;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  gap: 8px;
  flex-wrap: nowrap;
  /* Lock the header to a single row so toggling button labels
     (e.g. Minify ↔ Beautify) or showing/hiding the Undo-fix button
     never resizes the panel body. */
  min-height: 50px;
  transition: border-color 0.2s ease;
}

.panel-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.panel-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  /* Hide scrollbar visually while keeping scroll behaviour (rare overflow). */
  scrollbar-width: thin;
}

.panel-toolbar::-webkit-scrollbar { height: 4px; }
.panel-toolbar::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

.panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  position: relative;
  /* Allow flex item to shrink below its content's intrinsic size — without
     this, a wide minified line keeps panel-body from honouring panel height. */
  min-height: 0;
  min-width: 0;
}

.panel-footer {
  padding: 6px 14px;
  border-top: 1px solid var(--color-border);
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  transition: border-color 0.2s ease;
}

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 5px 11px;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.btn:hover {
  background: var(--color-border);
}

.btn--primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Buttons whose labels swap at runtime — fixed min-width prevents layout
   jumps when the text changes width (e.g. Minify ↔ Beautify). */
#btn-minify { min-width: 96px; justify-content: center; }
#btn-undo-fix { min-width: 96px; justify-content: center; }

/* ─── Select ──────────────────────────────────────────────────── */
.select {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 5px 8px;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  background: var(--color-surface-alt);
  color: var(--color-text);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.select:hover {
  background: var(--color-border);
}

/* ─── Input body (line numbers + textarea) ────────────────────── */
.input-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.line-numbers {
  padding: 14px 8px 14px 10px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  background: var(--color-surface-alt);
  border-right: 1px solid var(--color-border);
  text-align: right;
  user-select: none;
  pointer-events: none;
  overflow: hidden;
  white-space: pre;
  flex-shrink: 0;
  min-width: 42px;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* ─── Textarea ────────────────────────────────────────────────── */
#json-input {
  flex: 1;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  background: var(--color-surface);
  color: var(--color-text);
  border: none;
  outline: none;
  resize: none;
  min-height: 0;
  border-radius: 0;
  transition: background-color 0.2s ease, color 0.2s ease;
}

#json-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

/* ─── Output pre/code ─────────────────────────────────────────── */
.output-wrapper {
  flex: 1;
  overflow: auto;
  position: relative;
  /* Flexbox shrink fix — let the wrapper stay inside its parent regardless
     of how wide/tall the inner <pre> wants to be. */
  min-height: 0;
  min-width: 0;
}

#json-output-pre {
  margin: 0;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  background: transparent !important;
  border: none;
  min-height: 0;
  /* Wrap long lines (minified JSON, very wide values) instead of forcing
     a horizontal scrollbar on .output-wrapper. `pre-wrap` keeps existing
     newlines and indentation; `overflow-wrap: anywhere` breaks otherwise
     unbreakable tokens (e.g. long base64 strings) at the panel edge. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: visible;
}

#json-output-pre code {
  font-family: inherit;
  font-size: inherit;
  background: transparent !important;
  padding: 0 !important;
  /* Inherit wrap behaviour from <pre> — Prism's <code> child needs the same
     properties so highlighted tokens also wrap. */
  white-space: inherit;
  overflow-wrap: inherit;
  word-break: inherit;
}

.output-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 20px;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.output-empty[hidden] { display: none; }

.output-empty svg {
  width: 40px;
  height: 40px;
  opacity: 0.3;
}

/* ─── Error box ───────────────────────────────────────────────── */
#error-box {
  margin: 12px 14px;
  padding: 12px 14px;
  border-left: 4px solid var(--color-error-border);
  background: var(--color-error-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--color-error-text);
  font-size: 0.82rem;
  line-height: 1.5;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

#error-box[hidden] { display: none; }

.error-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  margin-bottom: 5px;
  font-size: 0.85rem;
}

.error-header svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.error-location {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.8;
  margin-bottom: 4px;
}

#error-message {
  margin-bottom: 8px;
}

/* ─── Auto-fix button ─────────────────────────────────────────── */
.btn-autofix {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--color-error-border);
  color: #fff;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-autofix:hover { opacity: 0.85; }

.btn-autofix[hidden] { display: none; }

.btn-autofix svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ─── Error excerpt ───────────────────────────────────────────── */
.error-excerpt {
  margin: 8px 0;
  background: var(--color-error-tint);
  border-radius: var(--radius);
  padding: 6px 4px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

.error-excerpt[hidden] { display: none; }

.excerpt-line {
  display: block;
}

.excerpt-gutter {
  user-select: none;
  color: var(--color-text-muted);
  opacity: 0.6;
}

.excerpt-context {
  opacity: 0.55;
}

.excerpt-error-line {
  opacity: 1;
}

.excerpt-caret {
  color: var(--color-error-border);
  opacity: 0.85;
}

.error-mark {
  background: var(--color-error-mark-bg);
  color: inherit;
  border-radius: 2px;
  outline: 1.5px solid var(--color-error-mark-outline);
  outline-offset: 0;
  padding: 0 1px;
}

.error-fix-label {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
  margin-bottom: 2px;
}

#error-suggestion {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--color-error-tint-2);
  padding: 6px 8px;
  border-radius: var(--radius);
}

/* ─── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 12px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.sidebar-card-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

/* Carbon Ads */
#carbonads-container {
  min-height: 130px;
}

.carbon-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
  line-height: 1.4;
}

.carbon-img img {
  max-width: 100%;
  border-radius: var(--radius);
}

.carbon-text {
  color: var(--color-text);
  text-decoration: none;
  display: block;
}

.carbon-text:hover {
  color: var(--color-accent);
}

.carbon-poweredby {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  text-decoration: none;
}

/* Cheatsheet sidebar card */
.cheatsheet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cheatsheet-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.75rem;
}

.cheatsheet-list .rule {
  color: var(--color-text);
  flex: 1;
}

.cheatsheet-list code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--color-surface-alt);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--color-accent);
  white-space: nowrap;
}

/* ─── No-JS fallback ─────────────────────────────────────────── */
.noscript-banner {
  background: var(--color-error-bg);
  color: var(--color-error-text);
  border: 1px solid var(--color-error-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}

/* ─── SEO content section ────────────────────────────────────── */
.content-section {
  max-width: 880px;
  margin: 40px auto 8px;
  padding: 0 20px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text);
}

.content-section .content-title {
  font-size: 1.6rem;
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--color-text);
}

.content-section .content-lede {
  font-size: 1.02rem;
  color: var(--color-text-muted);
  margin: 0 0 24px;
}

.content-section section {
  margin: 32px 0;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.content-section section:first-of-type {
  padding-top: 0;
  border-top: none;
}

.content-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--color-text);
  line-height: 1.3;
}

.content-section h3 {
  font-size: 0.98rem;
  font-weight: 600;
  margin: 18px 0 6px;
  color: var(--color-text);
}

.content-section p {
  margin: 0 0 12px;
}

.content-section ul,
.content-section ol {
  margin: 0 0 16px 1.4em;
  padding: 0;
}

.content-section li {
  margin: 4px 0;
}

.content-section code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--color-accent);
}

.content-section kbd {
  font-family: var(--font-mono);
  font-size: 0.78em;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--color-text);
}

.content-section details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 8px 0;
  background: var(--color-surface);
  transition: background-color 0.15s, border-color 0.15s;
}

.content-section details[open] {
  background: var(--color-surface-alt);
}

.content-section summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 26px;
  color: var(--color-text);
}

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

.content-section summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 400;
  font-size: 1.2em;
  color: var(--color-text-muted);
  transition: transform 0.2s;
}

.content-section details[open] summary::after {
  content: '−';
}

.content-section details p {
  margin: 10px 0 2px;
  color: var(--color-text-muted);
}

/* Table of contents */
.content-toc {
  margin: 24px 0 32px;
  padding: 14px 18px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.content-toc .toc-heading {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
  color: var(--color-text-muted);
  font-weight: 700;
}

.content-toc ol {
  margin: 0 0 0 1.25em;
  padding: 0;
}

.content-toc li {
  margin: 3px 0;
  font-size: 0.92rem;
}

.content-toc a {
  color: var(--color-accent);
  text-decoration: none;
}

.content-toc a:hover { text-decoration: underline; }

/* Before / after example blocks */
.content-section .example-block {
  margin: 6px 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  background: var(--color-surface-alt);
}

.content-section .example-block code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.content-section .example-before {
  border-left: 3px solid var(--color-error-border);
}

.content-section .example-after {
  border-left: 3px solid var(--color-success);
}

/* Anchored-section offset: when jumping from TOC, don't hide heading under
   sticky banner-like elements (none currently, but future-proof). */
.content-section section[id] {
  scroll-margin-top: 80px;
}

@media (max-width: 600px) {
  .content-section { padding: 0 14px; }
  .content-section .content-title { font-size: 1.35rem; }
  .content-section h2 { font-size: 1.1rem; }
}

/* ─── Footer ──────────────────────────────────────────────────── */
.site-footer {
  margin-top: 20px;
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: var(--color-surface);
  transition: background-color 0.2s ease, border-color 0.2s ease;
  line-height: 1.6;
}

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

.site-footer a:hover {
  text-decoration: underline;
}

/* ─── Prism overrides ─────────────────────────────────────────── */
/* Ensure Prism backgrounds don't clash with our surface color */
.token.comment { font-style: italic; }

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .layout-wrapper {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }

  .sidebar {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-card {
    flex: 1;
    min-width: 200px;
  }
}

@media (max-width: 768px) {
  .layout-wrapper {
    grid-template-columns: 1fr;
    padding: 10px 10px 0;
  }

  .ad-slot--leaderboard { display: none; }
  .ad-slot--mobile-banner { display: flex; }

  .panel { min-height: 340px; }
  #json-input { min-height: 280px; }
  #json-output-pre { min-height: 280px; }
  .output-empty { min-height: 280px; }

  .sidebar { flex-direction: column; }

  .site-tagline { display: none; }
}

@media (max-width: 400px) {
  .panel-toolbar { gap: 4px; }
  .btn { padding: 4px 8px; font-size: 0.72rem; }
  .select { padding: 4px 6px; font-size: 0.72rem; }
}

/* ─── Focus-visible (keyboard navigation) ────────────────────── */
.btn:focus-visible,
.btn--primary:focus-visible,
.btn-autofix:focus-visible,
.select:focus-visible,
.theme-toggle:focus-visible,
.site-logo:focus-visible,
#json-input:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

#json-input:focus-visible {
  outline-offset: -2px;
}

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

/* ─── Print ──────────────────────────────────────────────────── */
@media print {
  .ad-slot,
  .privacy-banner,
  .sidebar,
  .theme-toggle,
  .panel-toolbar,
  #btn-autofix,
  .site-footer {
    display: none !important;
  }
  body { background: #fff; color: #000; }
  .panel {
    height: auto;
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
  .layout-wrapper {
    display: block;
    padding: 0;
  }
  #json-output-pre { white-space: pre-wrap; }
}
