:root {
  color-scheme: dark;
  --bg: #0b0e14;
  --elev: #111622;
  --panel: #0e131e;
  --text: #f1f5f9;
  --muted: #a5b2c5;
  --border: #2a3445;
  --cyan: #38bdf8;
  --indigo: #818cf8;
  --emerald: #10b981;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.55 var(--font); }
button, input, textarea { font: inherit; color: inherit; }
button, .button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: var(--cyan); text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
code, textarea { font-family: var(--mono); }
fieldset, figure, dl, dd, ul { margin: 0; }
fieldset { min-inline-size: 0; }
h1, h2, p { margin: 0; }
h1, h2 { line-height: 1.12; letter-spacing: -.035em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; top: .75rem; left: .75rem; z-index: 2; padding: .6rem .9rem; background: var(--elev); transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.shell { width: min(100% - 3rem, 71rem); margin-inline: auto; }
.site-header, .site-footer { background: #0d1119; }
.site-header { border-bottom: 1px solid var(--border); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.125rem; flex-wrap: wrap; }
.brand { display: inline-flex; gap: .55rem; align-items: center; color: var(--text); font-size: 1.05rem; font-weight: 750; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid #275467; border-radius: .5rem; background: #102735; color: var(--cyan); }
.header-inner nav { display: flex; flex-wrap: wrap; gap: clamp(.65rem, 3vw, 1.75rem); }
.header-inner nav a { color: var(--muted); font-size: .85rem; text-decoration: none; }
.header-inner nav a:hover, .brand:hover { color: var(--cyan); }
.hero { position: relative; padding: clamp(2rem, 6vw, 4.4rem) 0 clamp(1.6rem, 4vw, 2.9rem); }
.hero::after { content: ""; position: absolute; z-index: -1; inset: 0; background: radial-gradient(ellipse at 70% 5%, #142036 0, transparent 65%); pointer-events: none; }
.eyebrow { display: flex; align-items: center; gap: .55rem; color: var(--muted); font: 600 .72rem/1.45 var(--mono); letter-spacing: .075em; text-transform: uppercase; }
.dot { flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 12px #10b98160; }
.slash { color: var(--indigo); }
.index { color: #9cacf9; margin-bottom: .4rem; }
.hero h1 { margin-block: .65rem; font-size: clamp(2.12rem, 5.25vw, 4.05rem); }
.hero > p:last-child { color: var(--muted); max-width: 65ch; }
.workbench, .cta { border: 1px solid var(--border); border-radius: 1rem; background: var(--elev); margin-bottom: 1.4rem; }
.section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .85rem; padding: clamp(.9rem, 2.2vw, 1.5rem); border-bottom: 1px solid var(--border); }
.section-heading h2, .cta h2, .faq h2 { font-size: clamp(1.33rem, 2.5vw, 1.84rem); }
.tool-body { padding: clamp(.8rem, 2.2vw, 1.5rem); }
button, .button { border: 1px solid var(--border); border-radius: .45rem; padding: .45rem .7rem; background: #192131; font-size: .84rem; font-weight: 650; line-height: 1.25; }
button:hover:not(:disabled), .button:hover { border-color: var(--cyan); }
.version { padding: .2rem; display: flex; gap: .18rem; border: 1px solid var(--border); border-radius: .55rem; background: var(--bg); }
.version label { position: relative; cursor: pointer; }
.version input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.version span { display: block; padding: .38rem .56rem; border-radius: .32rem; color: var(--muted); font-size: .8rem; font-weight: 650; }
.version input:checked + span { background: #193143; color: #a3e5ff; }
.version input:focus-visible + span { outline: 2px solid var(--cyan); }
.presets { display: flex; gap: .42rem; flex-wrap: wrap; align-items: center; margin-bottom: .85rem; }
.presets > span { font-size: .8rem; color: var(--muted); margin-right: .19rem; }
.presets button { font-weight: 550; }
.presets button[aria-pressed="true"] { background: #142c3c; border-color: #34647c; color: #addef2; }
.editor-grid, .paint-grid, .contrast-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .8rem; }
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 19.75rem; background: var(--panel); border: 1px solid var(--border); border-radius: .65rem; }
.pane-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .3rem .55rem; min-height: 2.75rem; padding: .35rem .7rem; border-bottom: 1px solid var(--border); background: #141b29; border-radius: .6rem .6rem 0 0; }
.pane-bar label { font-size: .84rem; font-weight: 700; }
.pane-bar > span { color: var(--muted); font-size: .76rem; }
.tabs { display: flex; flex-wrap: wrap; min-width: 0; gap: .15rem; }
.tabs button { border-color: transparent; background: transparent; color: var(--muted); padding: .43rem .43rem; font-size: .77rem; }
.tabs button[aria-selected="true"] { background: #1c2d41; color: #b0e9ff; border-color: #304d63; }
.copy { background: #101724; padding: .32rem .48rem; }
#css-input, .code-out { display: block; width: 100%; min-width: 0; min-height: 13rem; flex: 1; padding: .8rem .86rem; border: 0; border-radius: 0 0 .6rem .6rem; background: transparent; font-size: .83rem; line-height: 1.65; resize: vertical; tab-size: 2; }
#css-input { min-height: 16.6rem; }
.code-out { height: 100%; color: #b5e7fb; overflow-wrap: anywhere; }
#css-input:focus-visible, .code-out:focus-visible { outline-offset: -2px; }
.tab-panel { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.tag-field, .theme-hint { padding: .5rem .85rem; border-bottom: 1px solid var(--border); font-size: .78rem; color: var(--muted); }
.tag-field { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.tag-field input, .paint-input input[type="text"] { border: 1px solid var(--border); background: #0d1119; border-radius: .4rem; min-width: 0; padding: .38rem .55rem; font: .85rem/1.4 var(--mono); }
.tag-field input { width: 7rem; }
input[aria-invalid="true"] { border-color: #fb7185 !important; }
#tag-status, .field-error { color: #ffadb9; }
.diagnostics { display: flex; flex-wrap: wrap; align-items: center; gap: .38rem; margin: .75rem 0 .34rem; }
.badge { border-radius: .4rem; padding: .24rem .5rem; background: #1a2433; border: 1px solid #34435a; font-size: .75rem; color: #cbd5e1; }
.badge.pass { background: #122c26; color: #8ce7be; border-color: #295446; }
.badge.fail { background: #321e2b; color: #ffb7c0; border-color: #633341; }
.status, .hint, .notice, .field-error { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.status { color: #ace4fc; }
.notice { margin-top: .55rem; max-height: 6rem; overflow: auto; color: #f9ce88; }
.color-body { display: grid; gap: .82rem; }
.paint { padding: .55rem .75rem .65rem; background: var(--panel); border: 1px solid var(--border); border-radius: .62rem; }
.paint legend { padding-inline: .35rem; font-weight: 700; font-size: .88rem; }
.paint-input { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: .5rem; }
.paint-input input[type="color"] { width: 100%; height: 2.24rem; background: #0d1119; border: 1px solid var(--border); border-radius: .4rem; padding: .2rem; cursor: pointer; }
.field-error { margin-top: .3rem; color: #ffadb9; }
.formats { margin-top: .48rem; }
.formats > div { display: grid; grid-template-columns: 2.9rem minmax(0, 1fr); gap: .25rem; align-items: center; padding: .31rem 0; border-bottom: 1px solid var(--border); }
.formats > div:last-child { border: 0; }
.formats dd { display: flex; justify-content: space-between; align-items: center; gap: .4rem; min-width: 0; }
.formats dt { font-size: .72rem; font-weight: 750; color: var(--muted); }
.formats code { font-size: .77rem; overflow-wrap: anywhere; }
.formats .copy { flex: none; }
.contrast-grid { align-items: start; }
.contrast-summary { min-width: 0; }
.ratio { display: block; font: 700 clamp(1.9rem, 4vw, 2.7rem)/1.03 var(--mono); letter-spacing: -.07em; margin: .25rem 0 .55rem; }
.thresholds { list-style: none; padding: 0; display: grid; gap: .3rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.thresholds li { display: flex; gap: .12rem .5rem; justify-content: space-between; flex-wrap: wrap; }
.thresholds small { font-size: .73rem; white-space: nowrap; }
.preview { min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: .65rem; overflow: hidden; }
.preview figcaption { padding: .42rem .75rem; background: #141b29; font-size: .8rem; color: var(--muted); }
.preview svg { display: block; }
.preview-large { font-size: 24px; font-weight: 650; }
.preview-bold { font-size: 19px; font-weight: 700; }
.preview-small { font-size: 14px; }
.fix-controls, .cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.secondary { background: #192131; }
.fix { background: #142536; border-color: #345169; color: #bbebff; }
#color-status { min-height: 1.2em; }
.clipboard-fallback { max-width: 100%; min-width: 7rem; border: 1px solid var(--border); border-radius: .35rem; background: var(--bg); padding: .3rem .45rem; }
.cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: clamp(1rem, 2.3vw, 1.6rem); border-color: #34405d; background: linear-gradient(115deg, #131b2a, #111622 62%); }
.cta p:not(.eyebrow) { margin-top: .5rem; color: var(--muted); max-width: 66ch; }
.cta .plan-note { font-size: .8rem; }
.cta-actions { align-items: stretch; flex-direction: column; }
.button { display: inline-flex; justify-content: center; align-items: center; text-decoration: none; color: var(--text); min-height: 2.35rem; }
.primary { color: #071822; background: var(--cyan); border-color: var(--cyan); }
.primary:hover { background: #7dd3fc; }
.faq { margin: 1.9rem 0 2.6rem; }
.faq h2 { margin-bottom: .65rem; }
.faq details { border-bottom: 1px solid var(--border); padding: .55rem 0; }
.faq summary { cursor: pointer; font-weight: 650; }
.faq p { color: var(--muted); margin: .4rem 0 .3rem 1.15rem; max-width: 78ch; }
.site-footer { border-top: 1px solid var(--border); }
.footer-inner { justify-content: flex-start; color: var(--muted); font-size: .83rem; }
.footer-inner a:last-child { margin-left: auto; }
@media (max-width: 720px) {
  .shell { width: calc(100% - 1.5rem); }
  .editor-grid, .paint-grid, .contrast-grid, .cta { grid-template-columns: minmax(0, 1fr); }
  .output-pane { min-height: 13.6rem; }
  .code-out { min-height: 9.5rem; }
  .cta-actions { flex-direction: row; }
}
@media (max-width: 390px) {
  .header-inner { padding-block: .55rem; gap: .4rem .75rem; }
  .output-bar { align-items: flex-start; }
  .tabs button { font-size: .72rem; padding-inline: .25rem; }
}
