/* HIITECH TOOLKIT v6 — clean modern UI */
:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --surface: #12151c;
  --surface-2: #181c25;
  --surface-3: #1f2430;
  --header-bg: rgba(11, 13, 18, .82);
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #f3f5f9;
  --soft: #c4cad6;
  --muted: #8b93a3;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-soft: rgba(99, 102, 241, .14);
  --accent-line: rgba(129, 140, 248, .4);
  --mint: #34d399;
  --mint-bg: rgba(52, 211, 153, .12);
  --mint-border: rgba(52, 211, 153, .35);
  --sky: #38bdf8;
  --amber: #fbbf24;
  --amber-bg: rgba(251, 191, 36, .12);
  --amber-border: rgba(251, 191, 36, .32);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, .12);
  --grad: linear-gradient(120deg, #818cf8 0%, #c084fc 55%, #f0abfc 100%);
  --shadow: 0 24px 60px rgba(0, 0, 0, .5);
  --card-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .2);
  --radius: 14px;
  --content: 1180px;
  --font: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f3f4f7;
  --surface-3: #e9ebf0;
  --header-bg: rgba(246, 247, 249, .86);
  --line: rgba(15, 23, 42, .09);
  --line-strong: rgba(15, 23, 42, .18);
  --text: #0f172a;
  --soft: #334155;
  --muted: #64748b;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-soft: rgba(79, 70, 229, .09);
  --accent-line: rgba(79, 70, 229, .4);
  --mint: #059669;
  --mint-bg: rgba(5, 150, 105, .1);
  --mint-border: rgba(5, 150, 105, .35);
  --sky: #0284c7;
  --amber: #b45309;
  --amber-bg: rgba(217, 119, 6, .1);
  --amber-border: rgba(217, 119, 6, .35);
  --red: #dc2626;
  --red-bg: rgba(220, 38, 38, .08);
  --grad: linear-gradient(120deg, #4f46e5 0%, #7c3aed 60%, #c026d3 100%);
  --shadow: 0 24px 60px rgba(15, 23, 42, .18);
  --card-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 18px rgba(15, 23, 42, .05);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 130px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); font-size: 15px; line-height: 1.55;
  color: var(--text); background: var(--bg);
  background-image: radial-gradient(900px 420px at 80% -8%, var(--accent-soft), transparent 70%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-3); padding: 2px 6px; border-radius: 6px; }
.ic { flex: none; display: block; }
[data-i] { display: inline-flex; align-items: center; }
.container { width: min(100% - 32px, var(--content)); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--header-bg); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 800; font-size: 15px; box-shadow: 0 4px 14px var(--accent-soft); }
.brand-name { font-size: 15px; letter-spacing: .02em; }
.brand-name span { color: var(--muted); font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link { padding: 8px 13px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: .15s; display: inline-flex; align-items: center; gap: 6px; }
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--text); background: var(--surface-3); }
.nav-badge { font-size: 9.5px; font-weight: 800; letter-spacing: .06em; padding: 2px 6px; border-radius: 99px; background: var(--mint-bg); color: var(--mint); border: 1px solid var(--mint-border); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.theme-toggle, .menu-toggle { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--soft); transition: .15s; }
.theme-toggle:hover, .menu-toggle:hover { background: var(--surface-3); color: var(--text); }
.menu-toggle { display: none; }

/* ---------- Buttons / tags ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 11px; font-weight: 650; font-size: 14px; border: 1px solid transparent; transition: .15s; white-space: nowrap; }
.button-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px var(--accent-soft); }
.button-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.button-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.button-secondary:hover { background: var(--surface-3); }
.full-button { width: 100%; margin-top: 14px; }
.small-button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--soft); transition: .15s; }
.small-button:hover:not(:disabled) { background: var(--surface-3); color: var(--text); border-color: var(--accent-line); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--soft); transition: .15s; flex: none; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--accent-line); }
.tag, .shell-tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 650; padding: 3px 8px; border-radius: 7px; background: var(--surface-3); color: var(--soft); }
.tag-direct { background: var(--mint-bg); color: var(--mint); }
.admin-tag { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; padding: 3px 7px; border-radius: 7px; background: var(--red-bg); color: var(--red); }
.caution-tag { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; padding: 3px 7px; border-radius: 7px; background: var(--amber-bg); color: var(--amber); }
.popular-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; padding: 3px 8px; border-radius: 99px; background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.pill-count { font-size: 12.5px; font-weight: 650; color: var(--soft); background: var(--surface-2); border: 1px solid var(--line); padding: 6px 12px; border-radius: 99px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-link { color: var(--accent); font-weight: 650; font-size: 13.5px; }
:root[data-theme="dark"] .text-link { color: #a5b4fc; }
.text-link:hover { text-decoration: underline; }
.notice { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: 13px; color: var(--soft); background: var(--amber-bg); border: 1px solid var(--amber-border); }
.notice strong { color: var(--amber); }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 36px; align-items: center; padding: 64px 0 36px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); padding: 5px 12px; border-radius: 99px; margin-bottom: 18px; }
:root[data-theme="dark"] .eyebrow { color: #c7d2fe; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
h1 { font-size: clamp(36px, 6vw, 62px); line-height: 1.04; letter-spacing: -.035em; font-weight: 800; }
.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy { margin-top: 18px; max-width: 58ch; font-size: 16.5px; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-aside { position: relative; overflow: hidden; padding: 24px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-shadow); }
.hero-aside::after { content: ""; position: absolute; inset: auto -40% -60% auto; width: 300px; height: 300px; background: radial-gradient(circle, var(--accent-soft), transparent 70%); pointer-events: none; }
.aside-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.aside-label { font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--muted); }
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; color: var(--mint); background: var(--mint-bg); border: 1px solid var(--mint-border); padding: 3px 9px; border-radius: 99px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.aside-title { margin-top: 18px; font-size: 27px; line-height: 1.15; font-weight: 800; letter-spacing: -.025em; }
.aside-copy { margin-top: 10px; color: var(--muted); font-size: 13.5px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 20px; position: relative; z-index: 1; }
.stat { padding: 11px 8px; text-align: center; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.stat strong { display: block; font-size: 19px; font-weight: 800; }
.stat span { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ---------- Sections ---------- */
.section { padding: 40px 0 8px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.section-kicker { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; color: var(--accent); margin-bottom: 6px; }
:root[data-theme="dark"] .section-kicker { color: #a5b4fc; }
.section-heading h2 { font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -.025em; font-weight: 800; }
.section-heading p { color: var(--muted); margin-top: 6px; max-width: 64ch; font-size: 14.5px; }

/* ---------- Search / filters ---------- */
.search-bar, .command-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.search-box { flex: 1 1 280px; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-strong); transition: .15s; }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box input { flex: 1; min-width: 0; border: 0; background: transparent; outline: 0; font-size: 14.5px; height: 100%; }
.search-box input::placeholder { color: var(--muted); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-icon { color: var(--muted); display: inline-flex; }
.clear-search { display: none; width: 26px; height: 26px; border: 0; border-radius: 8px; background: var(--surface-3); color: var(--soft); align-items: center; justify-content: center; }
.clear-search.visible { display: inline-flex; }
.search-hint { font-size: 12px; color: var(--muted); }
.search-hint kbd { font-family: var(--mono); font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--line-strong); }
.sort-select, .shell-select, .field select, .field input { height: 44px; padding: 0 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-strong); outline: 0; font-size: 14px; transition: .15s; }
.field input { width: 100%; }
.sort-select:focus, .shell-select:focus, .field select:focus, .field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filter-chip, .admin-toggle-chip { padding: 7px 14px; font-size: 12.5px; font-weight: 650; border-radius: 99px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--soft); transition: .15s; }
.filter-chip:hover, .admin-toggle-chip:hover { background: var(--surface-3); color: var(--text); }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.admin-toggle-chip { height: 44px; }
.admin-toggle-chip.active { background: var(--red-bg); border-color: var(--red); color: var(--red); }

/* ---------- Tool cards ---------- */
.tool-grid, .feature-grid, .command-grid { display: grid; gap: 14px; }
.tool-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.feature-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.command-grid { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.tool-card, .feature-card, .surface-card, .command-card, .test-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--card-shadow); transition: border-color .15s, transform .15s; }
.tool-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.tool-card:hover, .feature-card:hover, .command-card:hover { border-color: var(--accent-line); }
.tool-card:hover { transform: translateY(-2px); }
.tool-top { display: flex; align-items: center; gap: 12px; }
.tool-icon, .feature-icon, .modal-icon { display: grid; place-items: center; flex: none; border-radius: 12px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
:root[data-theme="dark"] .tool-icon, :root[data-theme="dark"] .feature-icon, :root[data-theme="dark"] .modal-icon { color: #a5b4fc; }
.tool-icon { width: 42px; height: 42px; }
.tool-title { flex: 1; min-width: 0; }
.tool-title h3 { font-size: 15px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.popular-badge.is-compact { padding: 5px; }
.popular-badge.is-compact .ic { fill: currentColor; }
.text-link [data-i], .button [data-i] { vertical-align: -3px; margin-left: 4px; }
.tool-title span { font-size: 12px; color: var(--muted); }
.tool-info { padding: 4px 10px; font-size: 12px; font-weight: 600; border-radius: 8px; border: 1px solid var(--line-strong); background: transparent; color: var(--soft); }
.tool-info:hover { background: var(--surface-3); color: var(--text); }
.tool-description { font-size: 13.5px; color: var(--muted); flex: 1; }
.tool-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-actions { display: flex; gap: 8px; }
.download-link { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 10px; font-size: 13px; font-weight: 650; background: var(--accent); color: #fff; transition: .15s; }
.download-link:hover { filter: brightness(1.12); }
.download-link.is-official { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong); }
.download-link.is-official:hover { background: var(--surface-3); filter: none; }
.empty-state { display: none; text-align: center; padding: 48px 16px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); margin-top: 14px; }
.empty-state strong { display: block; color: var(--text); font-size: 16px; margin: 8px 0 2px; }
.empty-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--surface-2); }

/* ---------- Feature / support / guides ---------- */
.feature-card { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.feature-icon { width: 46px; height: 46px; }
.feature-card h3 { font-size: 16.5px; }
.feature-card p { font-size: 13.5px; color: var(--muted); flex: 1; }
.support-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.surface-card { padding: 24px; }
.surface-card h3 { font-size: 18px; letter-spacing: -.01em; }
.surface-card > p { margin: 6px 0 16px; color: var(--muted); font-size: 14px; }
.field-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.field label { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.field select { width: 100%; }
.result-note { display: none; margin-top: 12px; padding: 10px 12px; font-size: 13px; border-radius: 10px; background: var(--mint-bg); border: 1px solid var(--mint-border); color: var(--soft); }
.vendor-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.vendor-list a { padding: 5px 11px; font-size: 12px; font-weight: 600; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--soft); }
.vendor-list a:hover { border-color: var(--accent-line); color: var(--text); }
.guide-list { display: grid; gap: 10px; }
.guide-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.guide-toggle { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 0; background: transparent; text-align: left; }
.guide-toggle:hover { background: var(--surface-2); }
.guide-number { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 12.5px; font-family: var(--mono); }
:root[data-theme="dark"] .guide-number { color: #a5b4fc; }
.guide-title { flex: 1; min-width: 0; }
.guide-title strong { display: block; font-size: 15px; }
.guide-title small { color: var(--muted); font-size: 12.5px; }
.guide-chevron { color: var(--muted); transition: transform .2s; display: inline-flex; }
.guide-item.open .guide-chevron { transform: rotate(180deg); }
.guide-body { display: none; padding: 4px 20px 20px 66px; }
.guide-item.open .guide-body { display: block; }
.guide-body ol { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.guide-body li { color: var(--soft); font-size: 14px; }
.guide-body li::marker { color: var(--accent); font-weight: 700; }
.guide-body a { color: var(--accent); font-weight: 600; text-decoration: underline; }
.guide-body code { cursor: pointer; }
.guide-body code:hover { background: var(--accent-soft); }

/* ---------- Commands ---------- */
.command-card { padding: 14px 16px; display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.command-card > div:first-child { min-width: 0; flex: 1; }
.command-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.command-category { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.command-card code { display: block; padding: 8px 10px; margin: 0; font-size: 13px; overflow-x: auto; white-space: pre; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; color: var(--text); }
.command-description { margin-top: 8px; font-size: 13px; color: var(--muted); }
.command-actions { display: flex; flex-direction: column; gap: 6px; }

/* ---------- Footer / modal / toast ---------- */
.site-footer { margin-top: 72px; padding: 32px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-brand { font-weight: 800; color: var(--text); margin-bottom: 4px; letter-spacing: .03em; }
.footer-credit a { color: var(--accent); font-weight: 600; }
.footer-credit strong { color: var(--text); }
.footer-note { margin-top: 16px; font-size: 12px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 7, 12, .66); backdrop-filter: blur(6px); }
.modal-backdrop.open { display: flex; }
.modal { width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow); animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 20px 14px; }
.modal-icon { width: 44px; height: 44px; }
.modal-title-wrap { flex: 1; min-width: 0; }
.modal-title-wrap h3 { font-size: 17px; word-break: break-word; }
.modal-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.modal-close { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--soft); }
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-content { padding: 4px 20px 6px; overflow: auto; }
.modal-content h4 { margin: 14px 0 4px; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.modal-content h4:first-child { margin-top: 0; }
.modal-content p { font-size: 14px; color: var(--soft); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 20px 20px; }
.modal-actions a, .modal-actions button { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 0; background: var(--accent); color: #fff; font-size: 13.5px; font-weight: 650; }
.modal-actions .secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong); }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 200; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 18px; border-radius: 99px; font-size: 13.5px; font-weight: 600; background: var(--text); color: var(--bg); box-shadow: var(--shadow); transition: .22s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Online tests ---------- */
.test-nav-bar { position: sticky; top: 62px; z-index: 40; background: var(--header-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.test-pills { display: flex; gap: 6px; padding: 10px 0; overflow-x: auto; scrollbar-width: none; }
.test-pills::-webkit-scrollbar { display: none; }
.test-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; font-size: 13px; font-weight: 600; white-space: nowrap; border-radius: 99px; color: var(--muted); border: 1px solid transparent; transition: .15s; }
.test-pill:hover { color: var(--text); background: var(--surface-2); }
.test-pill.active { color: var(--text); background: var(--surface-3); border-color: var(--line-strong); }
.test-panel { padding: 22px; margin-bottom: 16px; scroll-margin-top: 130px; }
.test-panel-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.test-panel-head h2 { font-size: 21px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.test-panel-head h2 .ic { color: var(--accent); }
:root[data-theme="dark"] .test-panel-head h2 .ic { color: #a5b4fc; }
.test-panel-head p { margin-top: 6px; color: var(--muted); font-size: 13.5px; max-width: 60ch; }
.test-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.test-controls label.small-button { cursor: pointer; user-select: none; }
.two-col-tests { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.two-col-tests .test-panel { margin-bottom: 0; }
.telemetry-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.telemetry-box { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.telemetry-box span { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.telemetry-box strong { display: block; font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.progress-track { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-bottom: 16px; }
.progress-fill { height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width .2s; }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { padding: 6px 13px; border: 0; border-radius: 8px; background: transparent; font-size: 12.5px; font-weight: 650; color: var(--muted); transition: .15s; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--accent); color: #fff; }

/* Keyboard */
.kb-wrap { overflow-x: auto; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.kb-board { --u: 48px; display: flex; gap: calc(var(--u) * .5); width: max-content; margin-inline: auto; user-select: none; -webkit-user-select: none; }
.kb-block { display: grid; grid-auto-rows: var(--u); }
.kb-key { position: relative; margin: 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; border-radius: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-bottom-width: 3px; color: var(--soft); font-size: calc(var(--u) * .27); font-weight: 650; line-height: 1.1; text-align: center; cursor: pointer; transition: background .08s, transform .08s, border-color .08s; }
.kb-key small { font-size: .78em; opacity: .65; }
.kb-key.sm { font-size: calc(var(--u) * .21); }
.kb-key.tested { background: var(--mint-bg); border-color: var(--mint-border); color: var(--mint); }
.kb-key.active { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(2px); border-bottom-width: 1px; box-shadow: 0 0 18px var(--accent-soft); }
.kb-key.manual::after { content: ""; position: absolute; top: 4px; right: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); }
.kb-hint { margin-top: 12px; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 18px; }
.kb-legend { display: inline-flex; align-items: center; gap: 6px; }
.kb-legend i { width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--line-strong); background: var(--surface); }
.kb-legend i.t { background: var(--mint-bg); border-color: var(--mint-border); }
.kb-legend i.a { background: var(--accent); border-color: var(--accent); }
.kb-extra { margin-top: 16px; }
.kb-extra h4 { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.kb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kb-chip { padding: 5px 11px; border-radius: 8px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--muted); }
.kb-chip.tested { background: var(--mint-bg); border-color: var(--mint-border); color: var(--mint); }
.kb-missing { margin-top: 14px; padding: 12px 14px; font-size: 12.5px; color: var(--soft); border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.kb-missing strong { color: var(--text); }
.kb-history { display: flex; flex-wrap: wrap; gap: 5px; min-height: 28px; }
.kb-history span { font-family: var(--mono); font-size: 11.5px; padding: 3px 8px; border-radius: 7px; background: var(--surface-3); color: var(--soft); }

/* Audio / mic */
.channel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.channel-btn { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-strong); font-size: 13px; font-weight: 650; text-align: left; transition: .15s; }
.channel-btn span:last-child { font-size: 11px; color: var(--muted); font-weight: 700; }
.channel-btn:hover { border-color: var(--accent-line); background: var(--surface-3); }
.channel-btn.playing { background: var(--accent-soft); border-color: var(--accent); }
.slider-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.slider-row label { width: 104px; flex: none; font-size: 12.5px; font-weight: 650; color: var(--soft); }
.slider-row span { width: 64px; text-align: right; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.mic-meter-wrap { padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 14px; }
.mic-bar-bg { height: 8px; border-radius: 99px; background: var(--surface-3); margin: 10px 0; overflow: hidden; }
.mic-bar-fill { height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width .06s linear; }
#micCanvas { width: 100%; height: 64px; display: block; }

/* Display */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.swatch-btn { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-strong); font-size: 13px; font-weight: 650; transition: .15s; text-align: left; }
.swatch-btn:hover { border-color: var(--accent-line); background: var(--surface-3); }
.swatch-dot { width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--line-strong); flex: none; }
.pixel-overlay { position: fixed; inset: 0; z-index: 300; display: none; cursor: pointer; }
.pixel-overlay.open { display: block; }
.pixel-hud { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 16px; border-radius: 99px; background: rgba(0, 0, 0, .78); color: #fff; font-size: 13px; font-weight: 600; transition: opacity .3s; max-width: calc(100% - 24px); }
.pixel-hud button { padding: 6px 14px; border: 0; border-radius: 99px; background: #fff; color: #000; font-weight: 700; font-size: 12.5px; }

/* Webcam / mouse */
.webcam-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #05070b; border: 1px solid var(--line); margin-bottom: 14px; display: grid; place-items: center; }
.webcam-stage video { display: none; width: 100%; height: 100%; object-fit: cover; }
.webcam-stage video.mirrored { transform: scaleX(-1); }
.webcam-placeholder { padding: 20px; text-align: center; color: #94a3b8; font-size: 13.5px; }
.webcam-placeholder small { display: block; margin-top: 6px; opacity: .7; }
.mouse-pad { min-height: 190px; padding: 20px; margin-bottom: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border-radius: 14px; border: 2px dashed var(--line-strong); background: var(--surface-2); cursor: crosshair; user-select: none; touch-action: none; transition: background .1s, border-color .1s; }
.mouse-pad.flash { background: var(--accent-soft); border-color: var(--accent); }
.mouse-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.mouse-badge { padding: 5px 11px; font-size: 12px; font-weight: 650; border-radius: 99px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted); }
.mouse-badge.hit { background: var(--mint-bg); border-color: var(--mint-border); color: var(--mint); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 26px; }
  .support-grid, .two-col-tests { grid-template-columns: 1fr; }
  .command-grid { grid-template-columns: 1fr; }
  .menu-toggle { display: grid; }
  .nav-links { position: absolute; top: 62px; left: 0; right: 0; display: none; flex-direction: column; align-items: stretch; padding: 10px 16px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .nav-links.open { display: flex; }
  .nav-link { padding: 12px; }
  .test-nav-bar { top: 62px; }
}
@media (max-width: 560px) {
  .field-grid, .channel-grid { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .guide-body { padding-left: 20px; }
  .search-hint { display: none; }
  .test-panel { padding: 16px; }
  .command-card { flex-direction: column; }
  .command-actions { flex-direction: row; }
  .slider-row label { width: 80px; }
}
