*{box-sizing:border-box;margin:0;padding:0}
:root{--bg:#fff;--text:#1a1a1a;--muted:#5b6470;--border:#e3e6ea;--surface:#f7f8fa;--accent:#2563eb;--accent2:#7c3aed;--radius:12px;--shadow:0 1px 3px rgba(0,0,0,.08)}
html[data-theme=dark]{--bg:#121417;--text:#e8eaed;--muted:#9aa3ad;--border:#2a2f36;--surface:#1c2025;--accent:#60a5fa;--accent2:#a78bfa;--shadow:0 1px 3px rgba(0,0,0,.4)}
body{font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--text);line-height:1.6;font-size:16px}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
header.site{border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--bg);z-index:50}
.nav{max-width:1080px;margin:0 auto;display:flex;align-items:center;gap:14px;padding:10px 16px;flex-wrap:wrap}
.logo{font-weight:800;font-size:18px;color:var(--text);display:flex;align-items:center;gap:8px;white-space:nowrap}
.logo .dot{width:22px;height:22px;border-radius:50%;background:conic-gradient(#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00);display:inline-block;flex:none}
.logo:hover{text-decoration:none}
.nav-links{display:flex;gap:4px;flex-wrap:wrap;margin-left:auto}
.nav-links a{color:var(--text);padding:8px 10px;border-radius:8px;font-size:14px}
.nav-links a:hover{background:var(--surface);text-decoration:none}
.theme-btn{border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:8px;padding:8px 10px;cursor:pointer;font-size:14px;min-height:44px}
main{max-width:1080px;margin:0 auto;padding:24px 16px 48px}
h1{font-size:30px;line-height:1.25;margin:6px 0 10px}
h2{font-size:22px;margin:28px 0 10px}
h3{font-size:17px;margin:20px 0 8px}
p{margin:0 0 12px}
.lede{font-size:18px;color:var(--muted);max-width:760px}
.answer{background:var(--surface);border:1px solid var(--border);border-left:4px solid var(--accent);border-radius:10px;padding:14px 16px;margin:16px 0}
.answer p:last-child{margin-bottom:0}
.tool{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:20px;margin:18px 0}
.btn{display:inline-block;border:0;border-radius:9px;background:var(--accent);color:#fff;padding:11px 18px;font-size:15px;font-weight:600;cursor:pointer;min-height:44px}
.btn:hover{filter:brightness(1.08)}
.btn.ghost{background:var(--bg);color:var(--text);border:1px solid var(--border)}
.btn.small{padding:7px 12px;min-height:36px;font-size:14px}
input[type=text],input[type=number],select,textarea{font:inherit;color:var(--text);background:var(--bg);border:1px solid var(--border);border-radius:8px;padding:10px 12px;min-height:44px;width:100%}
input[type=range]{width:100%;min-height:44px;accent-color:var(--accent)}
input[type=color]{width:64px;height:44px;padding:2px;border:1px solid var(--border);border-radius:8px;background:var(--bg);cursor:pointer}
label{font-weight:600;font-size:14px;display:block;margin:0 0 4px}
.field{margin-bottom:14px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
@media(max-width:640px){.grid2,.grid3{grid-template-columns:1fr}h1{font-size:25px}}
/* picker */
.sv-panel{position:relative;width:100%;height:260px;border-radius:var(--radius);cursor:crosshair;touch-action:none;background:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,transparent),#f00}
.sv-thumb{position:absolute;width:22px;height:22px;border:3px solid #fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,.5),0 1px 4px rgba(0,0,0,.4);transform:translate(-50%,-50%);pointer-events:none}
.hue-slider{appearance:none;-webkit-appearance:none;width:100%;height:16px;border-radius:8px;background:linear-gradient(to right,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00);outline:none;margin:12px 0}
.hue-slider::-webkit-slider-thumb{-webkit-appearance:none;width:26px;height:26px;border-radius:50%;background:#fff;border:2px solid #888;cursor:pointer}
.hue-slider::-moz-range-thumb{width:24px;height:24px;border-radius:50%;background:#fff;border:2px solid #888;cursor:pointer}
.preview-big{height:120px;border-radius:var(--radius);border:1px solid var(--border);display:flex;align-items:flex-end;padding:10px}
.preview-big span{background:rgba(0,0,0,.55);color:#fff;padding:4px 10px;border-radius:6px;font-weight:700;font-size:15px}
.fmt-row{display:flex;align-items:center;gap:8px;padding:9px 0;border-bottom:1px solid var(--border)}
.fmt-row:last-child{border-bottom:0}
.fmt-row .k{width:64px;font-weight:700;font-size:14px;flex:none}
.fmt-row code{flex:1;font-size:15px;word-break:break-all}
.copy-btn{flex:none;border:1px solid var(--border);background:var(--bg);color:var(--text);border-radius:7px;padding:7px 12px;cursor:pointer;font-size:13px;font-weight:600;min-height:36px}
.copy-btn:hover{border-color:var(--accent);color:var(--accent)}
.swatches{display:flex;flex-wrap:wrap;gap:6px}
.swatch{width:100%;height:44px;border-radius:8px;border:1px solid rgba(0,0,0,.12);cursor:pointer;position:relative}
.swatch-grid{display:grid;grid-template-columns:repeat(10,1fr);gap:6px}
@media(max-width:640px){.swatch-grid{grid-template-columns:repeat(5,1fr)}}
.strip-label{font-size:13px;font-weight:700;color:var(--muted);margin:14px 0 6px;text-transform:uppercase;letter-spacing:.04em}
.strip{display:flex;flex-wrap:wrap;gap:6px}
.strip button{flex:1 1 0;min-width:44px;height:44px;border:0;border-radius:8px;cursor:pointer;border:1px solid rgba(0,0,0,.12)}
.pal-row{display:flex;gap:0;border-radius:10px;overflow:hidden;border:1px solid var(--border);margin:8px 0}
.pal-row .cell{flex:1;height:84px;cursor:pointer;display:flex;align-items:flex-end;justify-content:center;padding-bottom:6px}
.pal-row .cell span{background:rgba(0,0,0,.5);color:#fff;font-size:12px;font-weight:700;padding:2px 7px;border-radius:5px}
.pal-row .cell span.light{background:rgba(255,255,255,.75);color:#111}
table{width:100%;border-collapse:collapse;font-size:14px;margin:12px 0;display:block;overflow-x:auto;max-width:100%}
th,td{border:1px solid var(--border);padding:8px 10px;text-align:left}
th{background:var(--surface);font-weight:700}
td code{font-size:13px}
.color-cell{display:flex;align-items:center;gap:8px}
.color-dot{width:26px;height:26px;border-radius:6px;border:1px solid rgba(0,0,0,.15);flex:none}
.badge{display:inline-block;padding:3px 9px;border-radius:20px;font-size:12px;font-weight:700}
.badge.pass{background:#dcfce7;color:#166534}
.badge.fail{background:#fee2e2;color:#991b1b}
html[data-theme=dark] .badge.pass{background:#14532d;color:#bbf7d0}
html[data-theme=dark] .badge.fail{background:#450a0a;color:#fecaca}
.ratio-big{font-size:44px;font-weight:800;line-height:1.1}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%) translateY(80px);background:#111;color:#fff;padding:12px 20px;border-radius:10px;font-weight:600;font-size:15px;opacity:0;transition:all .25s;z-index:100;pointer-events:none;box-shadow:0 4px 16px rgba(0,0,0,.3);max-width:90vw;text-align:center}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
html[data-theme=dark] .toast{background:#f1f1f1;color:#111}
footer.site{border-top:1px solid var(--border);background:var(--surface)}
.foot{max-width:1080px;margin:0 auto;padding:28px 16px;font-size:14px;color:var(--muted)}
.foot a{color:var(--muted)}
.foot h4{color:var(--text);margin:0 0 8px;font-size:14px}
.foot-cols{display:flex;flex-wrap:wrap;gap:32px}
.foot-cols div{min-width:180px}
.foot ul{list-style:none}
.foot li{margin:4px 0}
.ad-slot{border:1px dashed var(--border);border-radius:10px;color:var(--muted);text-align:center;padding:18px;font-size:13px;margin:24px 0}
.faq details{border:1px solid var(--border);border-radius:10px;padding:12px 16px;margin:8px 0;background:var(--surface)}
.faq summary{font-weight:700;cursor:pointer;min-height:28px}
.faq p{margin:8px 0 0}
.breadcrumb{font-size:13px;color:var(--muted);margin-bottom:4px}
.breadcrumb a{color:var(--muted)}
.hero-swatch{height:150px;border-radius:var(--radius);border:1px solid var(--border);margin:14px 0}
.wheel{width:100%;max-width:420px;display:block;margin:0 auto;cursor:crosshair;touch-action:none}
.lock-btn{position:absolute;top:6px;right:6px;background:rgba(0,0,0,.45);color:#fff;border:0;border-radius:6px;width:30px;height:30px;cursor:pointer;font-size:14px}
.pal-cell{position:relative;flex:1;min-height:110px;cursor:pointer;display:flex;align-items:flex-end;justify-content:center;padding-bottom:8px}
.pal-cell span{font-size:12px;font-weight:700;padding:2px 8px;border-radius:5px;background:rgba(0,0,0,.5);color:#fff}
.pal-cell span.light{background:rgba(255,255,255,.8);color:#111}
.viz{border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;margin:12px 0}
.viz-head{padding:14px 18px;font-weight:800}
.viz-hero{padding:28px 18px}
.viz-hero h4{font-size:20px;margin-bottom:6px}
.viz-cards{display:flex;gap:10px;padding:14px 18px;flex-wrap:wrap}
.viz-card{flex:1;min-width:140px;border:1px solid var(--border);border-radius:10px;padding:12px;background:var(--bg)}
canvas.picker-canvas{max-width:100%;border:1px solid var(--border);border-radius:10px;cursor:crosshair;display:block}
.grad-preview{height:160px;border-radius:var(--radius);border:1px solid var(--border)}
.stop-row{display:flex;gap:8px;align-items:center;margin:6px 0}
.stop-row input[type=color]{width:52px}
.stop-row input[type=range]{flex:1}
.kbd{background:var(--surface);border:1px solid var(--border);border-bottom-width:2px;border-radius:5px;padding:1px 7px;font-family:inherit;font-size:13px}
.err{color:#b91c1c;font-weight:600;font-size:14px;min-height:20px}
html[data-theme=dark] .err{color:#fca5a5}
.muted{color:var(--muted);font-size:14px}
.chip{display:inline-block;background:var(--surface);border:1px solid var(--border);border-radius:20px;padding:5px 12px;font-size:13px;margin:0 6px 6px 0}
.sticky-copy{position:sticky;bottom:0;background:var(--bg);border-top:1px solid var(--border);padding:10px 0;display:flex;gap:8px;flex-wrap:wrap;align-items:center}
textarea.code{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:13px;min-height:110px}
pre.code{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:14px;overflow-x:auto;font-size:13px}
