/* =================================================================
   ToolDuck palette — shared with the rest of the site.

   Light is the default, matching toolduck.in, so a visitor moving
   between this toolkit and the main site is not handed a different
   product. These are the same values as assets/css/main.css; the two
   are kept in step deliberately rather than by importing a file,
   because this app is deployed as a self-contained bundle.

   The code editor stays dark in both themes by design, so the
   --syntax-* and --editor-* tokens are declared once here and are
   intentionally NOT overridden by the dark theme.
   ================================================================= */
:root {
  color-scheme: light;

  /* Surfaces */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --code-bg: #050505;
  --code-panel: #101010;

  /* Text */
  --text: #111827;
  --muted: #6b7280;
  --faint: #9ca3af;

  /* Lines */
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  /* Accent — the ToolDuck blue, not the old monochrome black. */
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-text: #ffffff;

  /* Status */
  --success: #047857;
  --success-bg: #ecfdf5;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --warning: #92400e;

  --shadow: 0 18px 40px -18px rgba(16, 24, 40, .22);
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Syntax highlighting — always rendered on the dark editor */
  --syntax-key: #e4e4e7;
  --syntax-string: #86efac;
  --syntax-number: #fcd34d;
  --syntax-boolean: #c4b5fd;
  --syntax-null: #f9a8d4;
  --syntax-punct: #8a8a93;
  --syntax-bracket: #fafafa;
  --syntax-highlight: #fcd34d;

  /* Editor decoration on the dark canvas */
  --editor-text: #f4f4f5;
  --editor-gutter: #8a8a93;
  --editor-line: rgba(255, 255, 255, .055);
  --editor-selection: rgba(228, 228, 231, .26);
  --editor-error-bg: rgba(248, 113, 113, .16);
  --editor-error-line: #f87171;

  /* Data-tree values rendered on the page surface. These sit on white
     here, so they need the darker end of the same accent family. */
  --tree-string: #047857;
  --tree-number: #92400e;
  --tree-boolean: #6d28d9;
  --tree-null: #be185d;
}

html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0a0a0a;
  --surface: #131313;
  --surface-muted: #1c1c1c;

  --text: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #8a8a93;

  --border: #262626;
  --border-strong: #3f3f46;

  --primary: #93c5fd;
  --primary-hover: #bfdbfe;
  --primary-text: #0a0a0a;

  --success: #4ade80;
  --success-bg: #0b2c1c;
  --danger: #f87171;
  --danger-bg: #3b1414;
  --warning: #fbbf24;

  --shadow: 0 18px 44px -18px rgba(0, 0, 0, .85);

  /* Tree values sit on a dark surface here, so they use the lighter
     end of the same accent family. */
  --tree-string: #86efac;
  --tree-number: #fcd34d;
  --tree-boolean: #c4b5fd;
  --tree-null: #f9a8d4;
}

/* ---------------------------------------------------------------
   Ambient light field
   ---------------------------------------------------------------
   The same soft colour field that runs behind every other ToolDuck
   page, so this standalone toolkit does not read as a different
   product. Decorative: fixed, non-interactive, and hidden from
   assistive technology. The panels above it are opaque, so contrast
   inside the workbench is unaffected.
   --------------------------------------------------------------- */
.glow { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; contain: strict; }
.glow__blob { position: absolute; display: block; border-radius: 50%; opacity: .85; will-change: transform; }

.glow__blob--a {
  top: -18vmax; left: -12vmax;
  width: 62vmax; height: 62vmax;
  background: radial-gradient(circle at center, rgba(59,130,246,.22) 0%, rgba(59,130,246,.12) 38%, rgba(59,130,246,0) 70%);
  animation: glowDrift 34s ease-in-out infinite alternate;
}
.glow__blob--b {
  top: -22vmax; right: -16vmax;
  width: 58vmax; height: 58vmax;
  background: radial-gradient(circle at center, rgba(139,92,246,.20) 0%, rgba(139,92,246,.10) 40%, rgba(139,92,246,0) 72%);
  animation: glowDrift 44s ease-in-out infinite alternate-reverse;
}
.glow__blob--c {
  top: 26vmax; left: 24vmax;
  width: 52vmax; height: 52vmax;
  background: radial-gradient(circle at center, rgba(34,211,238,.16) 0%, rgba(34,211,238,.07) 42%, rgba(34,211,238,0) 74%);
  animation: glowDrift 52s ease-in-out infinite alternate;
}

html[data-theme="dark"] .glow__blob { opacity: .75; }
html[data-theme="dark"] .glow__blob--a {
  background: radial-gradient(circle at center, rgba(37,99,235,.30) 0%, rgba(37,99,235,.12) 40%, rgba(37,99,235,0) 72%);
}
html[data-theme="dark"] .glow__blob--b {
  background: radial-gradient(circle at center, rgba(124,58,237,.30) 0%, rgba(124,58,237,.12) 42%, rgba(124,58,237,0) 74%);
}
html[data-theme="dark"] .glow__blob--c {
  background: radial-gradient(circle at center, rgba(14,116,144,.26) 0%, rgba(14,116,144,.10) 42%, rgba(14,116,144,0) 74%);
}

@keyframes glowDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(3vw, 4vh, 0) scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  .glow__blob { animation: none; }
}

@media print {
  .glow { display: none !important; }
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.45; }
/* Sits above the ambient light field, which is fixed at z-index 0. */
.ads-layout { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: center; gap: 18px; width: 100%; }
.ads-layout .site-shell { width: min(1500px, 100%); }
.ad-sidebar { width: 160px; flex: 0 0 160px; }
.ad-sidebar-left { padding-right: 8px; }
.ad-sidebar-right { padding-left: 8px; }
.ad-slot { display: flex; justify-content: center; width: 100%; margin: 0 auto 18px; }
.adsense-ad { display: flex; align-items: center; justify-content: center; min-height: 90px; width: 100%; }
.adsense-ad .adsbygoogle { display: block; width: 100%; min-height: 90px; }
.ad-sidebar-unit { width: 100%; min-height: 300px; }
.ad-top-unit, .ad-bottom-unit { max-width: 970px; min-height: 90px; }
button, select, input, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, input:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex="0"]:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 48%, transparent); outline-offset: 2px; }
.site-shell { max-width: 1500px; padding: 28px 28px 40px; margin: 0 auto; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 4px 0 24px; }
.brand-block, .header-actions, .panel-heading, .command-bar, .tree-toolbar, .path-bar, .diff-intro, .search-controls, .tree-actions, .input-stats, .output-actions { display: flex; align-items: center; }
.brand-block { gap: 14px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; color: var(--primary-text); background: var(--primary); font: 700 14px/1 var(--mono); box-shadow: 0 7px 16px color-mix(in srgb, var(--primary) 25%, transparent); }
.eyebrow, .panel-kicker { margin: 0 0 3px; color: var(--primary); font-size: .69rem; font-weight: 760; letter-spacing: .085em; line-height: 1.2; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 2px; font-size: 1.36rem; letter-spacing: -.026em; line-height: 1.18; }
h2 { margin-bottom: 0; font-size: .94rem; letter-spacing: -.012em; }
.subtitle { margin: 0; color: var(--muted); font-size: .91rem; }
.header-actions { align-items: flex-start; gap: 14px; }
.privacy-note { max-width: min(430px, 42vw); margin: 1px 0 0; color: var(--muted); font-size: .79rem; line-height: 1.35; text-align: right; }
.privacy-note span { color: var(--success); font-weight: 800; }
.icon-button, .small-button, .button { border: 1px solid var(--border-strong); color: var(--text); background: var(--surface); border-radius: 8px; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.icon-button:hover, .small-button:hover:not(:disabled), .button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.icon-button:active, .small-button:active:not(:disabled), .button:active:not(:disabled) { transform: translateY(1px); }
.icon-button { width: 36px; height: 36px; font-size: 1.13rem; }
.panel-card { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.workbench .panel-card { min-width: 0; border: 0; border-radius: 0; box-shadow: none; }
.editor-card { border-right: 1px solid var(--border) !important; }
.panel-heading { justify-content: space-between; min-height: 67px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.input-stats { gap: 7px; color: var(--muted); font: 600 .72rem/1 var(--mono); white-space: nowrap; }
.code-editor { display: grid; grid-template-columns: 48px minmax(0, 1fr); height: clamp(370px, calc(49vh + 40px), 610px); overflow: hidden; background: var(--code-bg); }
.line-numbers { overflow: hidden; margin: 0; padding: 18px 9px 18px 0; border-right: 1px solid var(--border); color: var(--editor-gutter); background: var(--code-panel); font: 14px/1.55 var(--mono); text-align: right; user-select: none; }
#json-input, .diff-input { width: 100%; min-width: 0; padding: 18px; resize: none; border: 0; outline: 0; color: var(--editor-text); background: var(--code-bg); caret-color: var(--editor-text); font: 14px/1.55 var(--mono); tab-size: 2; }
#json-input::placeholder, .diff-input::placeholder { color: var(--faint); }
.editor-help { display: flex; align-items: center; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; margin: 0; padding: 9px 18px; border-top: 1px solid var(--border); color: var(--muted); background: var(--surface-muted); font-size: .72rem; }
.editor-hints { flex: 0 1 auto; min-width: 0; }
.file-meta { min-width: 0; overflow: hidden; color: var(--muted); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
kbd { padding: 1px 4px; border: 1px solid var(--border-strong); border-radius: 3px; color: var(--text); background: var(--surface); font: 600 .67rem/1.4 var(--mono); }
.output-actions { gap: 7px; }
.small-button { min-height: 29px; padding: 5px 9px; font-size: .75rem; font-weight: 650; white-space: nowrap; }
.output-wrap { height: clamp(370px, 53vh, 610px); overflow: auto; background: var(--code-bg); }
.json-output { min-width: max-content; min-height: 100%; margin: 0; padding: 18px; color: var(--editor-text); font: 14px/1.55 var(--mono); white-space: pre; tab-size: 2; }
.command-bar { justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--border); }
.command-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.button { min-height: 35px; padding: 7px 12px; font-size: .78rem; font-weight: 700; }
.button-primary { border-color: var(--primary); color: var(--primary-text); background: var(--primary); }
.button-primary:hover:not(:disabled) { border-color: var(--primary-hover); color: var(--primary-text); background: var(--primary-hover); }
.button-quiet { background: transparent; }
.indent-label { display: flex; align-items: center; gap: 6px; margin-left: 4px; color: var(--muted); font-size: .75rem; font-weight: 600; }
#indent-select { min-height: 32px; max-width: 102px; padding: 4px 25px 4px 7px; border: 1px solid var(--border-strong); border-radius: 7px; color: var(--text); background: var(--surface); font-size: .75rem; }
.status-message { min-height: 40px; margin: 12px 0 20px; padding: 10px 12px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: var(--surface-muted); font-size: .82rem; }
.status-message.success { border-color: color-mix(in srgb, var(--success) 35%, transparent); color: var(--success); background: var(--success-bg); }
.status-message.error { border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); background: var(--danger-bg); }
.status-message.warning { color: var(--warning); }
.inspector { overflow: hidden; }
.tabs { display: flex; gap: 2px; padding: 0 15px; border-bottom: 1px solid var(--border); background: var(--surface-muted); }
.tab { position: relative; padding: 14px 14px 12px; border: 0; color: var(--muted); background: transparent; font-size: .82rem; font-weight: 720; }
.tab::after { position: absolute; right: 14px; bottom: -1px; left: 14px; height: 2px; background: transparent; content: ""; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--primary); }
.tab.is-active::after { background: var(--primary); }
.tab-panel { min-height: 395px; }
.tree-toolbar { justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.tree-actions { gap: 7px; }
.search-field { display: flex; align-items: center; gap: 7px; width: min(42%, 400px); min-width: 180px; min-height: 31px; padding: 0 9px; border: 1px solid var(--border-strong); border-radius: 7px; color: var(--faint); background: var(--surface-muted); }
.search-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: .76rem; }
.search-controls { gap: 7px; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.icon-text { min-width: 29px; padding-right: 5px; padding-left: 5px; }
.path-bar { gap: 9px; min-height: 48px; padding: 9px 16px; border-bottom: 1px solid var(--border); background: var(--surface-muted); overflow-x: auto; }
.path-label { flex: 0 0 auto; color: var(--muted); font-size: .71rem; font-weight: 700; text-transform: uppercase; letter-spacing: .055em; }
.path-bar code { flex: 1 1 auto; min-width: 100px; color: var(--primary); font: .77rem var(--mono); white-space: nowrap; }
.tree-view { max-height: 570px; min-height: 295px; overflow: auto; padding: 13px 16px 17px; background: var(--surface); font: 13px/1.5 var(--mono); }
.tree-list { margin: 0; padding: 0; list-style: none; }
.tree-children { margin: 0; padding: 0 0 0 22px; list-style: none; }
.tree-row { display: flex; align-items: baseline; min-height: 26px; border-radius: 5px; white-space: nowrap; }
.tree-row:hover { background: var(--surface-muted); }
.tree-row.is-selected { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.tree-row.is-current-match { outline: 1px solid var(--primary); outline-offset: -1px; }
.tree-toggle { display: inline-grid; width: 21px; height: 26px; place-items: center; flex: 0 0 auto; padding: 0; border: 0; color: var(--faint); background: transparent; font-size: .75rem; }
.tree-toggle:not(:disabled):hover { color: var(--primary); }
.tree-toggle:disabled { opacity: .26; }
.tree-content { display: flex; gap: 7px; min-width: 0; align-items: baseline; width: 100%; padding: 2px 6px 2px 0; border: 0; color: inherit; background: transparent; text-align: left; font: inherit; cursor: pointer; }
.tree-key { color: var(--text); font-weight: 680; }
.tree-separator { color: var(--faint); }
.tree-value { overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
.tree-value.string { color: var(--tree-string); }.tree-value.number { color: var(--tree-number); }.tree-value.boolean { color: var(--tree-boolean); }.tree-value.null { color: var(--tree-null); }.tree-value.container { color: var(--faint); font-style: italic; }
.tree-match { background: color-mix(in srgb, var(--syntax-highlight) 45%, transparent); color: inherit; border-radius: 2px; }
.tree-omitted { padding: 6px 0 5px 21px; color: var(--warning); font: .74rem/1.4 var(--mono); }
.tree-footnote { margin: 0; padding: 9px 16px; border-top: 1px solid var(--border); color: var(--muted); background: var(--surface-muted); font-size: .72rem; }
.empty-panel { margin: 0; padding: 36px 18px; color: var(--muted); font-size: .84rem; text-align: center; }
.analysis-view { padding: 20px; }
.analysis-heading { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.analysis-heading h2 { font-size: 1rem; }.analysis-heading p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.analysis-grid { display: grid; grid-template-columns: repeat(5, minmax(105px, 1fr)); gap: 9px; margin-bottom: 18px; }
.metric { padding: 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-muted); }.metric dt { color: var(--muted); font-size: .7rem; font-weight: 650; }.metric dd { margin: 3px 0 0; font: 700 1.05rem/1.15 var(--mono); }
.structure-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }.structure-card { min-width: 0; padding: 13px; border: 1px solid var(--border); border-radius: 10px; }.structure-card h3 { margin: 0 0 9px; font-size: .78rem; }.structure-card ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }.structure-card li { overflow: hidden; color: var(--muted); font: .72rem/1.35 var(--mono); text-overflow: ellipsis; white-space: nowrap; }.structure-card code { color: var(--primary); }.analysis-notice { margin: 0 0 14px; color: var(--warning); font-size: .76rem; }
.diff-intro { justify-content: space-between; gap: 18px; padding: 19px 18px 14px; }.diff-intro h2 { font-size: 1rem; }.diff-intro p:not(.panel-kicker) { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.diff-editors { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding: 0 18px 16px; }.diff-editors label { display: block; margin-bottom: 6px; color: var(--muted); font-size: .74rem; font-weight: 700; }.diff-input { display: block; height: 190px; border: 1px solid var(--border-strong); border-radius: 8px; font-size: .78rem; }.diff-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.diff-status { margin: 0 18px; padding: 10px 11px; border-radius: 7px; color: var(--muted); background: var(--surface-muted); font-size: .77rem; }.diff-status.error { color: var(--danger); background: var(--danger-bg); }.diff-status.success { color: var(--success); background: var(--success-bg); }
.diff-results { max-height: 350px; overflow: auto; margin-top: 13px; padding: 0 18px 18px; }.diff-empty { padding: 14px; border: 1px solid color-mix(in srgb, var(--success) 25%, transparent); border-radius: 8px; color: var(--success); background: var(--success-bg); font-size: .8rem; }.diff-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 7px 9px; border-bottom: 1px solid var(--border); font: .74rem/1.3 var(--mono); }.diff-kind { font-weight: 900; }.diff-add .diff-kind { color: var(--success); }.diff-remove .diff-kind { color: var(--danger); }.diff-change .diff-kind { color: var(--warning); }.diff-path { overflow: hidden; color: var(--primary); text-overflow: ellipsis; white-space: nowrap; }.diff-detail { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.toast { position: fixed; bottom: 24px; left: 50%; z-index: 20; padding: 9px 13px; border-radius: 8px; color: var(--primary-text); background: var(--primary); box-shadow: 0 8px 20px rgba(0,0,0,.45); font-size: .78rem; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: opacity .2s, transform .2s; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
.noscript { max-width: 650px; margin: 12px auto; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); border-radius: 8px; color: var(--danger); background: var(--danger-bg); font-size: .84rem; }
.skip-link { position: fixed; top: 7px; left: 7px; z-index: 50; padding: 7px 10px; border-radius: 6px; color: var(--primary-text); background: var(--primary); transform: translateY(-160%); }.skip-link:focus { transform: translateY(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; }
@media (max-width: 920px) { .site-shell { padding: 20px 18px 30px; }.topbar { align-items: flex-start; flex-direction: column; }.header-actions { width: 100%; justify-content: space-between; }.privacy-note { text-align: left; }.workbench { grid-template-columns: 1fr; }.editor-card { border-right: 0 !important; border-bottom: 1px solid var(--border) !important; }.code-editor { height: 360px; }.output-wrap { height: 340px; }.analysis-grid { grid-template-columns: repeat(3, 1fr); }.structure-grid { grid-template-columns: 1fr 1fr; }.structure-card:last-child { grid-column: span 2; } }
@media (max-width: 640px) { .site-shell { padding: 14px 12px 25px; }.topbar { gap: 13px; margin-bottom: 15px; }.brand-mark { width: 39px; height: 39px; }.subtitle { font-size: .82rem; }.privacy-note { max-width: calc(100% - 46px); font-size: .72rem; }.panel-heading { padding: 12px 13px; }.code-editor { grid-template-columns: 37px minmax(0, 1fr); height: 370px; }.line-numbers { padding-left: 3px; font-size: 12px; } #json-input, .json-output { padding: 13px; font-size: 12px; }.output-wrap { height: 315px; }.command-bar { align-items: stretch; gap: 9px; }.command-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 7px; }.secondary-commands { grid-template-columns: 1fr 1fr; }.button { padding: 7px 8px; font-size: .72rem; }.indent-label { justify-content: space-between; margin: 0; }.tree-toolbar { align-items: stretch; flex-wrap: wrap; padding: 11px 12px; }.tree-actions { order: 2; }.search-field { order: 1; width: 100%; }.search-controls { order: 3; margin-left: auto; }.path-bar { padding: 9px 12px; flex-wrap: wrap; }.path-bar code { flex-basis: 100%; order: 2; }.path-bar .small-button { order: 3; }.tree-view { padding: 11px 10px; font-size: 12px; }.tree-children { padding-left: 15px; }.analysis-view { padding: 14px; }.analysis-grid { grid-template-columns: repeat(2, 1fr); }.structure-grid { grid-template-columns: 1fr; }.structure-card:last-child { grid-column: auto; }.diff-intro { align-items: flex-start; flex-direction: column; padding: 15px 13px 12px; }.diff-editors { grid-template-columns: 1fr; padding: 0 13px 13px; }.diff-input { height: 150px; }.diff-status { margin: 0 13px; }.diff-results { padding: 0 13px 13px; }.diff-row { grid-template-columns: 16px minmax(0, 1fr); }.diff-detail { grid-column: 2; }.toast { bottom: 15px; } }

/* Editor enhancements */
.supporting-copy { margin: 4px 0 0; color: var(--faint); font-size: .73rem; }
.example-label { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .74rem; font-weight: 700; white-space: nowrap; }
.theme-toggle { display: inline-grid; width: 38px; height: 38px; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid var(--border-strong); border-radius: 10px; color: var(--primary); background: var(--surface); cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.theme-toggle:active { transform: translateY(1px); }
.theme-icon { display: inline-grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; color: inherit; background: transparent; }
.theme-icon::before { content: "☾"; font-size: 1.02rem; line-height: 1; }
html[data-theme="dark"] .theme-icon::before { content: "☀"; }
.example-label select { min-height: 34px; padding: 5px 26px 5px 8px; border: 1px solid var(--border-strong); border-radius: 7px; color: var(--text); background: var(--surface); font-size: .75rem; }
.panel-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-button { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; min-height: 27px; padding: 4px 9px; font-size: .72rem; }
.button-icon { flex: 0 0 auto; }
.code-editor { --editor-line-height: 21.7px; grid-template-columns: 48px minmax(0, 1fr); }
.editor-stack { position: relative; overflow: hidden; min-width: 0; background: var(--code-bg); }
.editor-current-line { position: absolute; top: 18px; right: 0; left: 0; z-index: 1; height: var(--editor-line-height); background: var(--editor-line); pointer-events: none; transform: translateY(0); }.editor-current-line.is-error { background: var(--editor-error-bg); box-shadow: inset 3px 0 0 var(--editor-error-line); }
.editor-highlight { position: absolute; top: 0; left: 0; z-index: 2; min-width: max-content; min-height: 100%; margin: 0; padding: 18px; color: var(--editor-text); background: transparent; font: 14px/1.55 var(--mono); pointer-events: none; tab-size: 2; white-space: pre; transform: translate(0, 0); }
#json-input { position: absolute; inset: 0; z-index: 3; min-width: max-content; padding: 18px; color: transparent; background: transparent; caret-color: var(--editor-text); -webkit-text-fill-color: transparent; }
#json-input::selection { color: transparent; background: var(--editor-selection); -webkit-text-fill-color: transparent; }
#json-input::placeholder { color: var(--faint); -webkit-text-fill-color: var(--faint); }
.line-numbers { padding-top: 18px; line-height: 1.55; }.line-numbers span { display: block; min-height: var(--editor-line-height); }.line-numbers .is-current { color: var(--editor-text); background: var(--editor-line); }.line-numbers .is-error { color: var(--editor-error-line); background: var(--editor-error-bg); }
.code-editor.is-dragover { outline: 3px solid var(--primary); outline-offset: -3px; }.code-editor.is-dragover::after { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; color: var(--editor-text); background: rgba(0, 0, 0, .88); content: "Drop JSON file to open locally"; font-size: .83rem; font-weight: 750; pointer-events: none; }
.syntax-key { color: var(--syntax-key); }.syntax-string { color: var(--syntax-string); }.syntax-number { color: var(--syntax-number); }.syntax-boolean { color: var(--syntax-boolean); }.syntax-null { color: var(--syntax-null); }.syntax-punctuation { color: var(--syntax-punct); }.syntax-bracket { color: var(--syntax-bracket); font-weight: 700; }.syntax-bracket-match { color: #0a0a0a; background: var(--syntax-highlight); border-radius: 2px; }
.validation-details { margin: -10px 0 20px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); border-radius: 8px; color: var(--danger); background: var(--danger-bg); font-size: .76rem; }.validation-details strong { color: var(--text); }.validation-context { display: block; overflow: auto; margin-top: 6px; padding: 7px 9px; border-radius: 5px; color: var(--text); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); font: .72rem/1.4 var(--mono); white-space: pre; }

/* Tree, inspector, analysis, and diff improvements */
.tree-actions { flex-wrap: wrap; }.tree-type { flex: 0 0 auto; padding: 1px 5px; border: 1px solid var(--border); border-radius: 999px; color: var(--faint); font: 650 .59rem/1.35 var(--mono); text-transform: uppercase; }.tree-type.string { color: var(--tree-string); }.tree-type.number { color: var(--tree-number); }.tree-type.boolean { color: var(--tree-boolean); }.tree-type.null { color: var(--tree-null); }.tree-type.array, .tree-type.object { color: var(--primary); }.tree-row { align-items: center; }.tree-content { gap: 6px; align-items: center; }
.node-inspector { display: grid; grid-template-columns: minmax(185px, .7fr) minmax(0, 1.3fr); gap: 12px 22px; padding: 16px; border-top: 1px solid var(--border); background: var(--surface-muted); }.node-inspector h3 { margin: 0; font-size: .92rem; }.node-inspector p { margin: 4px 0 0; color: var(--muted); font-size: .76rem; }.inspector-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }.inspector-facts div { min-width: 0; padding: 8px 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }.inspector-facts dt { color: var(--muted); font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }.inspector-facts dd { overflow: hidden; margin: 3px 0 0; color: var(--text); font: .72rem/1.35 var(--mono); text-overflow: ellipsis; white-space: nowrap; }.inspector-actions { display: flex; gap: 7px; margin-top: 9px; }
.analysis-issues { margin: 0 0 16px; padding: 12px; border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent); border-radius: 9px; background: color-mix(in srgb, var(--warning) 8%, var(--surface)); }.analysis-issues h3 { margin: 0 0 6px; font-size: .8rem; }.analysis-issues ul { display: grid; gap: 3px; margin: 0; padding-left: 18px; color: var(--muted); font-size: .74rem; }
.diff-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 18px 14px; }.diff-controls > div { display: flex; flex-wrap: wrap; gap: 7px; }.check-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .74rem; font-weight: 650; }.check-label input { accent-color: var(--primary); }.diff-row { grid-template-columns: 22px minmax(120px, .7fr) minmax(0, 1.3fr); align-items: start; }.diff-detail { white-space: normal; }.diff-detail strong { display: block; margin-bottom: 2px; color: var(--text); font: 650 .66rem/1.3 ui-sans-serif, system-ui, sans-serif; text-transform: uppercase; letter-spacing: .04em; }

/* Generator panels */
.generator-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 19px 18px 14px; }.generator-heading h2 { font-size: 1rem; }.generator-heading p:not(.panel-kicker) { max-width: 740px; margin: 4px 0 0; color: var(--muted); font-size: .78rem; }.language-tabs { display: flex; gap: 6px; padding: 0 18px 13px; border-bottom: 1px solid var(--border); }.language-tab { padding: 6px 9px; border: 1px solid var(--border-strong); border-radius: 7px; color: var(--muted); background: var(--surface); font-size: .74rem; font-weight: 700; }.language-tab.is-active { border-color: var(--primary); color: var(--primary-text); background: var(--primary); }.generated-code { max-height: 475px; min-height: 280px; overflow: auto; margin: 0; padding: 18px; color: var(--editor-text); background: var(--code-bg); font: 13px/1.55 var(--mono); white-space: pre; tab-size: 2; }.csv-status { margin: 0 18px 13px; padding: 9px 11px; border-radius: 7px; color: var(--muted); background: var(--surface-muted); font-size: .76rem; }.csv-status.success { color: var(--success); background: var(--success-bg); }.csv-status.error { color: var(--danger); background: var(--danger-bg); }.csv-output { min-height: 230px; }

/* Modals and command palette */
.modal-backdrop[hidden] { display: none; }.modal-backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 22px; background: rgba(0, 0, 0, .72); }.modal-card { width: min(690px, 100%); max-height: min(760px, calc(100vh - 44px)); overflow: auto; border: 1px solid var(--border-strong); border-radius: 14px; color: var(--text); background: var(--surface); box-shadow: 0 22px 64px rgba(0,0,0,.55); }.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 18px 18px 12px; border-bottom: 1px solid var(--border); }.modal-heading h2 { margin: 0; font-size: 1rem; }.modal-heading .icon-button { flex: 0 0 auto; }.repair-summary { margin: 14px 18px 8px; color: var(--muted); font-size: .8rem; }.repair-detections { display: grid; gap: 5px; margin: 0 18px 12px; padding: 0; list-style: none; }.repair-detections li { padding: 7px 9px; border-radius: 6px; color: var(--warning); background: color-mix(in srgb, var(--warning) 9%, var(--surface-muted)); font-size: .76rem; }.repair-preview { max-height: 300px; overflow: auto; margin: 0 18px; padding: 13px; border-radius: 8px; color: var(--editor-text); background: var(--code-bg); font: .76rem/1.5 var(--mono); white-space: pre; }.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 18px 18px; }.command-card { width: min(560px, 100%); }.command-search { width: calc(100% - 36px); min-height: 40px; margin: 15px 18px 9px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 8px; color: var(--text); background: var(--surface-muted); }.command-results { display: grid; gap: 3px; max-height: 380px; overflow: auto; padding: 0 12px 10px; }.command-option { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 10px 9px; border: 0; border-radius: 7px; color: var(--text); background: transparent; text-align: left; }.command-option:hover, .command-option.is-active { color: var(--primary-text); background: var(--primary); }.command-option small { color: inherit; opacity: .76; }.command-help { margin: 0; padding: 10px 18px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: .7rem; }

@media (max-width: 920px) { .node-inspector { grid-template-columns: 1fr; }.node-inspector > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }.node-inspector > div:first-child p { text-align: right; }.generator-heading { align-items: flex-start; flex-direction: column; }.diff-controls { align-items: flex-start; flex-direction: column; } }
@media (max-width: 640px) { .supporting-copy { display: none; }.header-actions { align-items: flex-start; }.theme-toggle { flex: 0 0 auto; }.panel-title { gap: 9px; }.code-editor { --editor-line-height: 18.6px; }.editor-highlight, #json-input { padding: 13px; font-size: 12px; }.editor-current-line { top: 13px; }.line-numbers span { min-height: var(--editor-line-height); }.example-label { grid-column: span 2; justify-content: space-between; }.tree-actions { gap: 5px; }.node-inspector { padding: 12px; }.inspector-facts { grid-template-columns: 1fr; }.diff-controls { padding: 0 13px 13px; }.generator-heading { padding: 15px 13px 12px; }.language-tabs { overflow-x: auto; padding: 0 13px 11px; }.generated-code { padding: 13px; font-size: 12px; }.csv-status { margin: 0 13px 12px; }.modal-backdrop { padding: 12px; }.modal-heading { padding: 14px 14px 10px; }.repair-summary, .repair-detections, .repair-preview { margin-right: 14px; margin-left: 14px; }.modal-actions { padding: 13px 14px 14px; } }

/* Developer toolkit: tool switcher tabs */
.tool-switcher { margin: 0 0 20px; }
.tool-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; padding: 9px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.tool-tab { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; color: var(--text); background: var(--surface-muted); text-align: left; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.tool-tab:hover { border-color: color-mix(in srgb, var(--primary) 42%, transparent); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.tool-tab:active { transform: translateY(1px); }
.tool-tab.is-active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--surface)); }
.tool-tab-icon { display: grid; place-items: center; width: 36px; height: 34px; flex: 0 0 auto; border: 1px solid var(--border-strong); border-radius: 9px; color: var(--primary); background: var(--surface); font: 700 12px/1 var(--mono); letter-spacing: -.03em; }
.tool-tab.is-active .tool-tab-icon { border-color: var(--primary); color: var(--primary-text); background: var(--primary); }
.tool-tab-text { display: grid; gap: 1px; min-width: 0; }
.tool-tab-text strong { overflow: hidden; font-size: .81rem; letter-spacing: -.012em; text-overflow: ellipsis; white-space: nowrap; }
.tool-tab-text small { overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.tool-panel[hidden] { display: none; }

/* Developer toolkit: shared tool layout */
.tool-shell { overflow: hidden; }
.tool-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 19px 18px 14px; }
.tool-heading h2 { font-size: 1rem; }
.tool-heading h3 { margin: 0; font-size: .92rem; }
.tool-heading p:not(.panel-kicker) { max-width: 780px; margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.tool-subheading { border-top: 1px solid var(--border); background: var(--surface-muted); }
.tool-controls { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 13px; padding: 13px 18px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-muted); }
.tool-controls-actions { align-items: center; }
.tool-field { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: .7rem; font-weight: 720; letter-spacing: .045em; text-transform: uppercase; }
.tool-field.is-muted { opacity: .58; }
.tool-field-wide { flex: 1 1 300px; }
.tool-field-grow { flex: 1 1 100%; }
.tool-field select { min-height: 34px; padding: 5px 26px 5px 9px; border: 1px solid var(--border-strong); border-radius: 7px; color: var(--text); background: var(--surface); font-size: .76rem; font-weight: 500; text-transform: none; }
.tool-field input[type="range"] { width: 100%; max-width: 220px; accent-color: var(--primary); }
.tool-field output { color: var(--text); font: 700 .78rem var(--mono); letter-spacing: 0; }
.key-row { display: flex; gap: 7px; align-items: stretch; }
.key-row .tool-input { flex: 1 1 auto; }
.tool-textarea, .tool-input { width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--border-strong); border-radius: 8px; color: var(--editor-text); background: var(--code-bg); font: .78rem/1.55 var(--mono); text-transform: none; }
.tool-textarea { min-height: 186px; resize: vertical; }
.tool-textarea-compact { min-height: 96px; }
.tool-input { min-height: 36px; }
.tool-input-multiline { min-height: 78px; resize: vertical; }
.tool-textarea:focus, .tool-input:focus, .tool-field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); outline: 0; }
.tool-textarea::placeholder, .tool-input::placeholder { color: var(--faint); }
.tool-io { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; padding: 16px 18px; }
.tool-io > div { display: grid; gap: 6px; min-width: 0; }
.tool-io label { color: var(--muted); font-size: .68rem; font-weight: 720; letter-spacing: .055em; text-transform: uppercase; }
.tool-io-single { grid-template-columns: minmax(0, 1fr); }
.tool-status { margin: 0; padding: 11px 18px; border-top: 1px solid var(--border); color: var(--muted); background: var(--surface-muted); font-size: .78rem; }
.tool-status.success { color: var(--success); background: var(--success-bg); }
.tool-status.error { color: var(--danger); background: var(--danger-bg); }
.tool-status.warning { color: var(--warning); }
.tool-hint { margin: 0; color: var(--muted); font-size: .72rem; }
.tool-hint code { color: var(--primary); font: .72rem var(--mono); }

/* JWT parser */
.jwt-results { padding: 0 18px 18px; }
.jwt-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.jwt-block { min-width: 0; margin-bottom: 14px; }
.jwt-block:last-child { margin-bottom: 0; }
.jwt-block h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: .8rem; }
.jwt-code { max-height: 260px; min-height: 132px; border-radius: 8px; font-size: .76rem; }
.jwt-chip { display: inline-block; padding: 2px 7px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--muted); background: var(--surface-muted); font: 650 .62rem/1.6 var(--mono); letter-spacing: .045em; text-transform: uppercase; }
.jwt-chip.success { border-color: color-mix(in srgb, var(--success) 38%, transparent); color: var(--success); background: var(--success-bg); }
.jwt-chip.error { border-color: color-mix(in srgb, var(--danger) 38%, transparent); color: var(--danger); background: var(--danger-bg); }
.jwt-chip.warning { border-color: color-mix(in srgb, var(--warning) 40%, transparent); color: var(--warning); background: color-mix(in srgb, var(--warning) 10%, var(--surface)); }
.jwt-badge { padding: 5px 11px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: .72rem; font-weight: 720; white-space: nowrap; }
.jwt-badge.success { border-color: color-mix(in srgb, var(--success) 40%, transparent); color: var(--success); background: var(--success-bg); }
.jwt-badge.error { border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); background: var(--danger-bg); }
.jwt-claims { display: grid; gap: 7px; }
.jwt-note { margin: 0; color: var(--muted); font-size: .78rem; }
.jwt-claim-list { display: grid; gap: 7px; margin: 0; }
.jwt-claim { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(0, 1.2fr); gap: 4px 14px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-muted); }
.jwt-claim dt { display: grid; gap: 2px; margin: 0; }
.jwt-claim dt code { color: var(--primary); font: 700 .76rem var(--mono); }
.jwt-claim dt small { color: var(--muted); font-size: .68rem; font-weight: 500; line-height: 1.35; }
.jwt-claim dd { margin: 0; overflow-wrap: anywhere; color: var(--text); font: .76rem/1.5 var(--mono); }
.jwt-findings { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.jwt-signature { margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: var(--code-bg); font: .74rem/1.65 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 1100px) { .tool-tab-text small { display: none; } }
@media (max-width: 920px) { .tool-tabs { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }.tool-io { grid-template-columns: minmax(0, 1fr); }.jwt-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .tool-tabs { grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 8px; }.tool-tab { padding: 9px 11px; }.tool-tab-text small { display: block; }.tool-heading { align-items: flex-start; flex-direction: column; padding: 15px 13px 12px; }.tool-controls { padding: 11px 13px; }.tool-io { padding: 13px; }.tool-status { padding: 10px 13px; }.tool-textarea { min-height: 150px; }.jwt-results { padding: 0 13px 14px; }.jwt-claim { grid-template-columns: minmax(0, 1fr); }.jwt-badge { margin-left: 0; } }

/* Crawlable content and footer */
.content-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 26px; }
.content-card { min-width: 0; padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.content-card h2 { margin-bottom: 10px; font-size: 1rem; }
.content-card h3 { margin: 16px 0 8px; color: var(--muted); font-size: .74rem; font-weight: 760; letter-spacing: .06em; text-transform: uppercase; }
.content-card p { margin: 0 0 10px; color: var(--muted); font-size: .84rem; line-height: 1.62; }
.content-card p:last-child { margin-bottom: 0; }
.content-list { display: grid; gap: 7px; margin: 0; padding-left: 20px; color: var(--muted); font-size: .83rem; line-height: 1.55; }
.content-list li::marker { color: var(--primary); }
.content-note { margin-top: 12px !important; padding-top: 12px; border-top: 1px solid var(--border); color: var(--faint) !important; font-size: .78rem !important; }
.faq-list { margin: 0; }
.faq-list dt { margin-top: 14px; color: var(--text); font-size: .84rem; font-weight: 700; }
.faq-list dt:first-child { margin-top: 0; }
.faq-list dd { margin: 5px 0 0; color: var(--muted); font-size: .83rem; line-height: 1.6; }
.tool-link-list { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.tool-link-list li { display: grid; gap: 2px; }
.tool-link-list a { color: var(--primary); font-size: .86rem; font-weight: 700; text-decoration: none; }
.tool-link-list a:hover { text-decoration: underline; }
.tool-link-list span { color: var(--muted); font-size: .79rem; line-height: 1.5; }
.site-footer { margin-top: 24px; padding: 18px 0 4px; border-top: 1px solid var(--border); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 10px; }
.footer-links a { color: var(--muted); font-size: .78rem; font-weight: 650; text-decoration: none; }
.footer-links a:hover, .footer-links a[aria-current="page"] { color: var(--primary); }
.site-footer p { margin: 0; color: var(--faint); font-size: .75rem; }

@media (max-width: 920px) { .content-section { grid-template-columns: minmax(0, 1fr); }.content-card { padding: 17px 16px; } }
@media (max-width: 640px) { .content-section { gap: 13px; margin-top: 18px; }.content-card h2 { font-size: .94rem; }.site-footer { margin-top: 18px; } }

/* ===============================================================
   Smart Structured Data Inspector
   ---------------------------------------------------------------
   Only shown when normal JSON parsing fails. Reuses the existing
   card, badge, button and code-block tokens rather than introducing
   a parallel visual language.
   =============================================================== */
.smart-report { margin: -8px 0 20px; padding: 18px; }
.smart-report-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 18px; }
.smart-report-head h2 { margin: 0; font-size: 1.02rem; line-height: 1.35; }
.smart-report-note { margin: 6px 0 0; color: var(--muted); font-size: .76rem; }
.smart-report-badge { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--muted); background: var(--surface-muted); font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.smart-report-badge[data-confidence="high"] { border-color: color-mix(in srgb, var(--success) 35%, transparent); color: var(--success); background: var(--success-bg); }
.smart-report-badge[data-confidence="low"] { border-color: color-mix(in srgb, var(--warning) 35%, transparent); color: var(--warning); }
.smart-reasons { margin: 12px 0 0; padding: 0 0 0 17px; color: var(--muted); font-size: .76rem; }
.smart-reasons li { margin: 3px 0; }
.smart-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 15px 0 0; }
.smart-views { display: flex; flex-wrap: wrap; gap: 6px; margin: 17px 0 11px; }
.smart-views .small-button[aria-pressed="true"] { border-color: var(--primary); color: var(--primary-text); background: var(--primary); }
.smart-views .small-button[aria-pressed="true"]:hover { color: var(--primary-text); }
.smart-view-panel[hidden] { display: none !important; }
.smart-raw { max-height: 320px; margin: 0; padding: 12px; overflow: auto; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: var(--surface-muted); font: .74rem/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; }
.smart-raw:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.smart-caveat { margin: 11px 0 0; padding: 9px 11px; border-left: 3px solid var(--border-strong); border-radius: 0 7px 7px 0; color: var(--muted); background: var(--surface-muted); font-size: .74rem; }
.smart-caveat[hidden] { display: none !important; }
.smart-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

@media (max-width: 920px) { .smart-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .smart-report { padding: 15px 13px; }.smart-actions .small-button { flex: 1 1 auto; } }
