/* Palette from Ding design/tokens.css. Keep both themes tied to the same roles. */
:root {
  color-scheme: light dark;
  --bg: light-dark(#f7f6f2, #171c19);
  --surface: light-dark(#ffffff, #202722);
  --subtle: light-dark(#eeeee7, #29312b);
  --text: light-dark(#222b25, #f0f1e9);
  --muted: light-dark(#62695f, #acb6ab);
  --border: light-dark(#d9ddd2, #3b473c);
  --brand: light-dark(#246239, #7ee787);
  --brand-soft: light-dark(#e3f3df, #2a3c2c);
  --action: #7ee787;
  --on-action: #17251c;
  --violet: light-dark(#68538b, #c2addf);
  --violet-soft: light-dark(#ece5f3, #332c40);
  --error: light-dark(#a33c33, #f0a398);
  --error-soft: light-dark(#f9eae7, #3d2826);
  --attention: light-dark(#80530f, #ebbc74);
  --attention-soft: light-dark(#fbf1dd, #362d1e);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
::selection { background: var(--violet-soft); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
button, input, select, textarea { accent-color: var(--brand); }
button:disabled { cursor: not-allowed; opacity: .5; }
button { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
code, pre, textarea { font-family: var(--mono); }
code { font-size: .9em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
input:focus-visible, textarea:focus-visible { outline-offset: -2px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; }
h1 { font-size: clamp(46px, 5.4vw, 78px); letter-spacing: -.065em; line-height: 1.05; }
h1 span { color: var(--brand); }
h2 { font-size: 29px; letter-spacing: -.045em; line-height: 1.2; }
.wrap { width: min(1440px, calc(100% - 112px)); margin: auto; }
.site-header { min-height: 94px; display: flex; align-items: center; gap: 30px; border-bottom: 1px solid var(--border); }
.wordmark { display: inline-flex; align-items: center; gap: 11px; color: var(--text); font-weight: 650; letter-spacing: -.045em; font-size: 21px; text-decoration: none; white-space: nowrap; }
.wordmark-dot { color: var(--brand); margin-left: -11px; }
.brand-mark { display: inline-flex; align-items: baseline; justify-content: center; width: 34px; height: 31px; color: var(--on-action); background: var(--action); border-radius: 6px; font: 700 23px/31px var(--mono); letter-spacing: -.13em; padding-right: 4px; }
.brand-mark span { font-size: 21px; }
nav { display: flex; align-items: center; gap: 25px; margin-left: auto; }
nav a { color: var(--muted); font-size: 13px; text-decoration: none; font-weight: 550; }
nav a[aria-current], nav a:hover { color: var(--brand); }
.theme-label select { border: 1px solid var(--border); background: transparent; border-radius: 6px; min-height: 36px; padding: 6px 9px; font-size: 12px; }
.hero { padding: 66px 0 60px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: end; }
.eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: .13em; color: var(--brand); font-weight: 650; margin-bottom: 18px; }
.signal { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); margin-right: 6px; }
.version { font: 10px var(--mono); text-transform: none; letter-spacing: 0; margin-left: 10px; color: var(--muted); }
.hero-aside { justify-self: end; padding-bottom: 3px; max-width: 410px; }
.hero-aside > p:first-child { color: var(--muted); font-size: 17px; line-height: 1.65; margin-bottom: 24px; }
.install { display: flex; width: 100%; align-items: center; gap: 13px; padding: 12px 14px; border: 1px solid var(--border); background: var(--surface); border-radius: 7px; text-align: left; }
.install code { font-size: 12px; white-space: nowrap; }
.prompt { color: var(--brand); font: 13px var(--mono); }
.copy-label { font-size: 10px; color: var(--muted); margin-left: auto; padding-left: 16px; }
.fine-print { font-size: 11px; color: var(--muted); margin-top: 10px; }
remove-markdown-demo { display: block; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 0 25px; }
.section-heading .eyebrow { margin-bottom: 9px; }
.section-heading h2 { font-size: 25px; }
.section-note { font-size: 11px; color: var(--muted); }
.example-bar { display: flex; align-items: center; gap: 16px; }
.bar-label { color: var(--muted); font-size: 11px; white-space: nowrap; }
.example-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.example-buttons button { color: var(--muted); border: 1px solid transparent; background: transparent; border-radius: 5px; padding: 6px 10px; font-size: 11px; }
.example-buttons button:hover { background: var(--subtle); color: var(--text); }
.example-buttons button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 16%, transparent); }
.example-description { font-size: 11px; color: var(--muted); margin: 13px 0 17px; min-height: 18px; }
.editor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.editor-panel { min-width: 0; display: flex; flex-direction: column; }
.editor-panel + .editor-panel { border-left: 1px solid var(--border); }
.source-panel { background: color-mix(in srgb, var(--subtle) 32%, var(--surface)); }
.configured-panel .panel-heading { background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface)); }
.panel-heading { min-height: 49px; display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--border); gap: 8px; }
.panel-heading h3, .panel-heading label { font-size: 12px; font-weight: 600; letter-spacing: -.015em; }
.configured-panel h3 { color: var(--brand); }
.file-label { font: 10px var(--mono); color: var(--muted); }
.text-button { background: none; border: none; padding: 5px 0 5px 8px; font-size: 10px; color: var(--muted); }
.text-button:hover { color: var(--brand); }
.editor-panel textarea, .editor-panel pre { display: block; background: transparent; border: 0; margin: 0; padding: 21px 18px; height: 380px; width: 100%; font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; tab-size: 2; resize: none; }
.editor-panel textarea { color: var(--muted); }
.editor-panel textarea:focus { color: var(--text); }
.panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; font-size: 9px; color: var(--muted); border-top: 1px solid var(--border); min-height: 40px; }
.panel-footer code { font-size: 9px; }
mark { color: inherit; padding: 1px 0; border-radius: 2px; }
mark.added { background: var(--brand-soft); color: var(--brand); }
mark.removed { background: var(--violet-soft); color: var(--violet); text-decoration: line-through; }
.empty-output { color: var(--muted); font-style: italic; }
.editor-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 40px; color: var(--muted); font-size: 10px; }
.editor-status .check { font-size: 10px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 12px; line-height: 1.5; cursor: pointer; }
.check input { width: 14px; height: 14px; margin: 0; flex: 0 0 auto; }
.options-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 20px; }
.options-heading h2 { font-size: 24px; }
.options-heading p { color: var(--muted); font-size: 12px; margin-top: 6px; }
.button { border: 1px solid transparent; display: inline-flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 39px; padding: 10px 15px; font-size: 12px; font-weight: 550; border-radius: 6px; text-decoration: none; }
.button.primary { background: var(--action); color: var(--on-action); }
.button.primary:hover { background: color-mix(in srgb, var(--action), #17251c 8%); }
.button.secondary { border-color: var(--border); background: transparent; color: var(--text); }
.button.secondary:hover { background: var(--subtle); }
.options-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.option-group { border: 0; margin: 0; padding: 23px 24px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; position: relative; }
.option-group:nth-child(3n + 2), .option-group:nth-child(3n + 3) { border-left: 1px solid var(--border); }
.option-group:nth-child(n + 4) { border-top: 1px solid var(--border); }
.option-group legend { float: left; padding: 0; font-size: 14px; font-weight: 600; letter-spacing: -.015em; width: 100%; }
.option-description { color: var(--muted); font-size: 11px; margin: 5px 0 17px; }
.option-group .check { margin-bottom: 12px; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 11px; width: 100%; }
.field input, .benchmark-controls select { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 5px; min-height: 36px; padding: 7px 10px; font-family: var(--mono); font-size: 11px; }
.field input:disabled { opacity: .45; cursor: not-allowed; }
.field input:invalid { border-color: var(--error); }
.option-group small { font-size: 10px; line-height: 1.65; color: var(--muted); margin-top: 9px; }
.option-group small + .check { margin-top: 16px; }
.option-code { margin: 9px 0 0; color: var(--muted); font-size: 11px; }
.example-link { color: var(--brand); border: none; background: none; padding: 13px 0 0; font-size: 10px; font-weight: 550; margin-top: auto; }
.example-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.inline-links { display: flex; gap: 18px; flex-wrap: wrap; margin-top: auto; }
.advanced { grid-column: 1 / -1; border-top: 1px solid var(--border); padding: 16px 24px; }
.advanced summary { font-size: 12px; font-weight: 550; }
.advanced summary span { font-weight: 400; color: var(--muted); font-size: 11px; margin-left: 10px; }
.advanced .check { margin-top: 18px; }
.advanced p { font-size: 12px; color: var(--muted); max-width: 720px; margin: 12px 0 8px; }
.advanced small { color: var(--muted); font-size: 11px; }
.code-section { display: grid; grid-template-columns: 1fr 1.6fr; gap: 60px; padding: 56px 0; align-items: center; }
.code-section p:not(.eyebrow) { color: var(--muted); font-size: 13px; margin: 16px 0 22px; max-width: 300px; }
.code-preview { background: var(--subtle); border: 1px solid var(--border); border-radius: 8px; padding: 24px; font-size: 12px; line-height: 1.8; margin: 0; max-height: 340px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.code-preview code { color: var(--brand); }
.benchmark-teaser { display: grid; grid-template-columns: 1fr 1.6fr; gap: 60px; padding: 46px 0 58px; border-top: 1px solid var(--border); }
.benchmark-teaser p:not(.eyebrow) { max-width: 560px; color: var(--muted); margin-bottom: 20px; font-size: 14px; }
footer { border-top: 1px solid var(--border); padding: 25px 0 35px; display: flex; align-items: center; justify-content: space-between; gap: 24px; color: var(--muted); font-size: 11px; }
footer a { text-decoration: none; color: var(--muted); }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); width: max-content; padding: 12px 20px; background: var(--text); color: var(--bg); font-size: 12px; border-radius: 7px; box-shadow: 0 6px 28px #0002; z-index: 10; }
.notice { padding: 14px 18px; background: var(--attention-soft); color: var(--attention); border-radius: 6px; font-size: 12px; margin: 16px 0; }
.notice.error { background: var(--error-soft); color: var(--error); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; top: -100px; left: 20px; padding: 12px; background: var(--surface); z-index: 50; }
.skip-link:focus { top: 12px; }
.mobile-views { display: none; }
.benchmark-hero { padding: 64px 0 42px; max-width: 810px; }
.benchmark-hero h1 { font-size: clamp(44px, 5vw, 67px); }
.benchmark-hero > p:last-child { color: var(--muted); font-size: 16px; margin-top: 22px; max-width: 650px; }
.benchmark-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin: 25px 0; }
.benchmark-controls label { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.benchmark-controls select { width: auto; }
.benchmark-meta { font-size: 12px; color: var(--muted); }
.table-scroll { overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; white-space: nowrap; background: var(--surface); }
th { font-size: 10px; color: var(--muted); background: var(--subtle); font-weight: 550; }
th, td { padding: 14px 18px; border-bottom: 1px solid var(--border); }
tr:last-child td { border: 0; }
td small { display: block; color: var(--muted); font-size: 10px; }
.metric { font-variant-numeric: tabular-nums; text-align: right; }
.metric-bar { width: 120px; height: 4px; border-radius: 2px; background: var(--subtle); display: block; margin: 8px 0 0 auto; overflow: hidden; }
.metric-bar span { display: block; height: 100%; background: var(--brand); }
.bench-section { margin: 46px 0; }
.bench-section h2 { margin-bottom: 16px; }
.bench-section > p { font-size: 13px; color: var(--muted); max-width: 850px; margin-bottom: 20px; }
.case-comparison { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.case-comparison h3 { font-size: 12px; margin-bottom: 10px; }
.case-comparison pre { font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--subtle); padding: 18px; border-radius: 6px; min-height: 150px; max-height: 360px; overflow: auto; margin: 0; }
.case-verdict { font-size: 12px; color: var(--brand); margin-top: 16px; }
.method-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 30px; }
.method-grid article { border-top: 1px solid var(--border); padding-top: 18px; }
.method-grid h3 { font-size: 15px; margin: 0 0 9px; }
.method-grid p { color: var(--muted); font-size: 12px; }
.result-links { display: flex; flex-wrap: wrap; gap: 24px; margin: 25px 0 50px; font-size: 12px; }
@media (min-width: 1650px) { .editor-panel textarea, .editor-panel pre { height: 400px; font-size: 13px; } }
@media (max-width: 1100px) {
  .wrap { width: calc(100% - 56px); }
  .hero { gap: 30px; }
  .hero-aside > p:first-child { font-size: 15px; }
  .desktop-break { display: none; }
  .editor-panel textarea, .editor-panel pre { padding: 16px; font-size: 11px; }
  .panel-heading, .panel-footer { padding-left: 14px; padding-right: 14px; }
  .panel-footer { flex-wrap: wrap; gap: 3px; }
  .option-group { padding: 20px; }
  .code-section, .benchmark-teaser { gap: 35px; }
}
@media (max-width: 780px) {
  .wrap { width: calc(100% - 40px); }
  .site-header { flex-wrap: wrap; min-height: 90px; gap: 10px 22px; padding: 18px 0 14px; }
  .wordmark { font-size: 18px; }
  .theme-label { margin-left: auto; }
  nav { order: 3; width: 100%; margin: 3px 0 0; gap: 22px; }
  nav a { font-size: 12px; }
  .hero { grid-template-columns: 1fr; padding: 42px 0; gap: 28px; }
  .hero-aside { justify-self: stretch; max-width: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; align-items: center; }
  .hero-aside > p:first-child { margin: 0; grid-row: 1 / 3; }
  .hero-aside > .fine-print { grid-column: 2; font-size: 10px; }
  .install { gap: 6px; padding: 10px; }
  .install code { font-size: 10px; }
  .copy-label { padding-left: 4px; }
  .options-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .option-group:nth-child(n) { border-left: 0; }
  .option-group:nth-child(even) { border-left: 1px solid var(--border); }
  .option-group:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .editor-status { flex-wrap: wrap; margin-bottom: 28px; }
  .code-section, .benchmark-teaser { grid-template-columns: 1fr; gap: 24px; }
  .code-section h2 br, .benchmark-teaser h2 br { display: none; }
  .code-section p:not(.eyebrow) { max-width: 100%; }
  .case-comparison { grid-template-columns: 1fr; }
  .case-comparison pre { min-height: 80px; }
  .method-grid { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 600px) {
  h1 { font-size: 48px; }
  .hero-aside { display: block; }
  .hero-aside > p:first-child { margin-bottom: 20px; }
  .install { padding: 13px; max-width: 380px; gap: 13px; }
  .install code { font-size: 12px; }
  .section-heading { display: block; margin-bottom: 20px; }
  .section-note { margin-top: 12px; }
  .example-bar { display: block; }
  .bar-label { display: block; margin-bottom: 7px; }
  .example-buttons { gap: 4px; }
  .example-buttons button { padding: 7px 8px; }
  .example-description { min-height: 36px; }
  .mobile-views { display: flex; margin: 0 0 10px; background: var(--subtle); border-radius: 6px; padding: 4px; }
  .mobile-views button { flex: 1; border: 0; background: transparent; padding: 9px 3px; color: var(--muted); font-size: 11px; border-radius: 4px; }
  .mobile-views button[aria-pressed="true"] { background: var(--surface); color: var(--brand); }
  .editor-grid { display: block; }
  .editor-panel { display: none; border: 0 !important; }
  .editor-grid[data-view="input"] [data-panel="input"], .editor-grid[data-view="baseline"] [data-panel="baseline"], .editor-grid[data-view="output"] [data-panel="output"] { display: flex; }
  .editor-panel textarea, .editor-panel pre { height: 330px; font-size: 12px; }
  .panel-footer { flex-wrap: nowrap; }
  .options-heading { align-items: flex-start; }
  .options-heading h2 { font-size: 23px; }
  .options-heading p { font-size: 10px; }
  .options-heading .button { font-size: 10px; padding: 9px; min-height: 34px; }
  .options-grid { grid-template-columns: 1fr; }
  .option-group:nth-child(n) { border-left: 0; }
  .option-group:nth-child(n + 2) { border-top: 1px solid var(--border); }
  .option-group { padding: 20px; }
  .advanced { padding: 16px 20px; }
  .advanced .check { flex-wrap: wrap; }
  .code-section, .benchmark-teaser { padding: 36px 0; }
  footer { flex-direction: column; align-items: flex-start; gap: 8px; }
  .benchmark-hero { padding: 40px 0 25px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
