/* PWA.live: a calm, technical reference. Cool paper, ink indigo, PWA violet, signal teal for "works", amber for "partial". */
:root {
  --bg: #F4F6FB; --surface: #FFFFFF; --surface-2: #ECEFF8; --surface-3: #E2E6F3;
  --ink: #161A3A; --ink-2: #3A3F6E; --ink-3: #5B618E; --line: rgba(22, 26, 58, .12); --line-2: rgba(22, 26, 58, .22);
  --violet: #5A0FC8; --violet-2: #7B3FE4; --tint: #ECE6FB; --teal: #0B8A7F; --teal-fill: #12B5A6; --amber: #B97800; --amber-fill: #F4A100; --rose: #C42B5F;
  --link: #5A0FC8; --focus: #12B5A6; --ok-bg: #DDF5F1; --warn-bg: #FDF0D5; --bad-bg: #FBE3EA;
  --art-ink: #161A3A; --art-v: #5A0FC8; --art-t: #0E9C8F;
  --radius-s: 8px; --radius: 14px; --radius-l: 22px;
  --wrap: 1200px; --measure: 70ch;
  --shadow: 0 1px 2px rgba(22, 26, 58, .06), 0 12px 32px -16px rgba(22, 26, 58, .25);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
[data-theme="night"] {
  --bg: #0F1230; --surface: #171B42; --surface-2: #1F2452; --surface-3: #282E63;
  --ink: #ECEEFB; --ink-2: #C4C8E8; --ink-3: #979DC8; --line: rgba(236, 238, 251, .12); --line-2: rgba(236, 238, 251, .24);
  --violet: #B49BFF; --violet-2: #C9B6FF; --tint: #2A2463; --teal: #3DD9C8; --teal-fill: #2BC4B4; --amber: #FFC04D; --amber-fill: #F4A100; --rose: #FF7FA8;
  --link: #C2ADFF; --focus: #3DD9C8; --ok-bg: rgba(61, 217, 200, .14); --warn-bg: rgba(255, 192, 77, .14); --bad-bg: rgba(255, 127, 168, .14);
  --art-ink: #DADDF5; --art-v: #B49BFF; --art-t: #3DD9C8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 36px -18px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.65 var(--font-body); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.015em; color: var(--ink); margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.3rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); font-weight: 700; }
h3 { font-size: 1.18rem; font-weight: 700; }
p { margin: 0 0 1em; }
code, kbd, pre, .mono { font-family: var(--font-mono); font-size: .9em; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: .08em .34em; overflow-wrap: anywhere; }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; }
.skip:focus { top: 12px; }
.muted { color: var(--ink-3); }
.hp { position: absolute; left: -9999px; }
main { display: block; min-height: 60vh; }
.test-ribbon { position: fixed; z-index: 90; top: 14px; right: -38px; transform: rotate(45deg); background: var(--rose); color: #fff; font: 700 .72rem/1 var(--font-mono); padding: 6px 44px; letter-spacing: .12em; pointer-events: none; }

/* ---------- Art (inline SVG, themed) ---------- */
.art { display: inline-block; line-height: 0; }
.art svg { width: 100%; height: 100%; display: block; overflow: visible; }
.art .l { fill: none; stroke: var(--art-ink); stroke-linecap: round; stroke-linejoin: round; }
.art .lv { fill: none; stroke: var(--art-v); stroke-linecap: round; stroke-linejoin: round; }
.art .lt { fill: none; stroke: var(--art-t); stroke-linecap: round; stroke-linejoin: round; }
.art .lw { fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; }
.art .lnet { fill: none; stroke: var(--line-2); }
.art .v { fill: var(--art-v); } .art .t { fill: var(--teal-fill); } .art .m { fill: var(--amber-fill); } .art .s { fill: var(--tint); } .art .p { fill: var(--surface); }
.art .tx { fill: var(--art-ink); } .art .txv { fill: var(--art-v); } .art .txt { fill: var(--art-t); } .art .txw { fill: #fff; }
[data-theme="night"] .art .v { fill: #7B3FE4; }

/* ---------- Buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1.5px solid var(--violet); background: var(--violet); color: #fff; font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
[data-theme="night"] .btn { background: #7B3FE4; border-color: #7B3FE4; }
.btn:hover { background: var(--violet-2); border-color: var(--violet-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-ghost, [data-theme="night"] .btn-ghost { background: transparent; color: var(--violet); }
.btn-ghost:hover, [data-theme="night"] .btn-ghost:hover { background: var(--tint); color: var(--violet); }
.btn-small { min-height: 36px; padding: 6px 14px; font-size: .92rem; }
.link-btn { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 1.2em 0 0; }
.chip { display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 999px; background: var(--tint); color: var(--violet); font-size: .88rem; font-weight: 600; text-decoration: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.chips button { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 6px 14px; font: 500 .92rem/1.2 var(--font-body); cursor: pointer; min-height: 36px; }
.chips button:hover { border-color: var(--violet); color: var(--violet); }
.chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chips-small button { padding: 4px 12px; min-height: 32px; font-size: .86rem; }
.lvl { display: inline-block; font-size: .8rem; font-weight: 600; padding: 1px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.lvl-beginner { background: var(--ok-bg); color: var(--teal); }
.lvl-intermediate { background: var(--tint); color: var(--violet); }
.lvl-advanced { background: var(--warn-bg); color: var(--amber); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.bar { width: min(1320px, 100% - 28px); margin: 0 auto; height: 66px; display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand-mark { width: 34px; height: 34px; display: block; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-mark .v { fill: #5A0FC8; } .brand-mark .t { fill: #12B5A6; } .brand-mark .lw { fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; }
.brand-word { font: 800 1.32rem/1 var(--font-display); letter-spacing: -.02em; }
.brand-word span { color: var(--violet); }
.main-nav { flex: 1; }
.main-nav > ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; justify-content: center; }
.nav-group { position: relative; }
.nav-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 10px; border: 0; background: none; color: var(--ink); font: 500 1rem/1 var(--font-body); text-decoration: none; cursor: pointer; }
.nav-btn svg { width: 11px; transition: transform .2s; }
.nav-btn:hover, .nav-group.open > .nav-btn { background: var(--surface-2); text-decoration: none; }
.nav-group.open > .nav-btn svg { transform: rotate(180deg); }
.nav-panel { position: absolute; top: calc(100% + 8px); left: 50%; translate: -50% 0; min-width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .16s var(--ease); }
.nav-group.open .nav-panel { opacity: 1; visibility: visible; transform: none; }
.nav-panel ul { list-style: none; margin: 0; padding: 0; }
.nav-panel a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .97rem; }
.nav-panel a:hover { background: var(--tint); color: var(--violet); }
.nav-lead { font-weight: 700; border-bottom: 1px solid var(--line); margin-bottom: 4px; border-radius: 8px 8px 0 0 !important; }
.tools { display: flex; align-items: center; gap: 4px; flex: none; }
.tool { display: inline-flex; align-items: center; gap: 6px; height: 40px; min-width: 40px; justify-content: center; padding: 0 9px; border-radius: 10px; border: 0; background: none; color: var(--ink); cursor: pointer; font: 500 .92rem/1 var(--font-body); }
.tool svg { width: 21px; height: 21px; }
.tool:hover { background: var(--surface-2); }
.music-btn[aria-pressed="true"] { color: var(--violet); background: var(--tint); }
.install-btn { background: var(--tint); color: var(--violet); font-weight: 600; }
.install-btn:hover { background: var(--violet); color: #fff; }
.install-btn[hidden], .is-standalone .install-btn { display: none; }
.menu-btn { display: none; }
.lang-panel { width: min(1320px, 100% - 28px); margin: 0 auto 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.lang-panel[hidden] { display: none; }
.lang-title { margin: 0 0 10px; font-weight: 600; }
.lang-panel ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.lang-panel a { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.lang-panel a b { font-size: 1.1rem; font-weight: 600; }
.lang-panel a span { font-size: .8rem; color: var(--ink-3); }
.lang-panel a:hover { border-color: var(--line); background: var(--surface-2); }
.lang-panel a[aria-current] { border-color: var(--violet); }
.notice-translate { width: min(var(--wrap), 100% - 40px); margin: 16px auto 0; padding: 10px 14px; border-radius: var(--radius-s); background: var(--warn-bg); color: var(--ink); font-size: .95rem; }

/* ---------- Home hero ---------- */
.p-hero { padding: clamp(32px, 6vw, 72px) 0 clamp(28px, 5vw, 56px); background:
  linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 32px 32px; background-color: var(--bg); position: relative; }
.p-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, var(--bg)); pointer-events: none; }
.p-hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.p-title { font-size: clamp(2.2rem, 1.2rem + 3.6vw, 3.9rem); line-height: 1.04; letter-spacing: -.03em; margin-bottom: .45em; }
.p-line { font-size: 1.15rem; color: var(--ink-2); max-width: 56ch; }
.p-search { display: flex; align-items: center; gap: 8px; margin-top: 22px; background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 999px; padding: 5px 5px 5px 16px; max-width: 560px; box-shadow: var(--shadow); }
.p-search:focus-within { border-color: var(--violet); }
.p-search svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.p-search input[type="search"] { flex: 1; min-width: 0; min-height: 0; border: 0; background: none; font: inherit; color: var(--ink); padding: 8px 0; outline: none; box-shadow: none; }
.p-search .btn { min-height: 40px; }

/* Live service worker diagram */
.sw-demo { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow); padding: 18px 18px 14px; }
.sw-demo figcaption b { display: block; font: 700 1.05rem/1.3 var(--font-display); }
.sw-demo figcaption span { display: block; color: var(--ink-3); font-size: .92rem; margin-top: 4px; }
.swd-svg { width: 100%; height: auto; display: block; margin: 8px 0 4px; font-family: var(--font-body); }
.swd-wire { fill: none; stroke: var(--line-2); stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; }
.swd-node rect { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1.5; }
.swd-node text { fill: var(--ink-2); font-size: 15px; font-weight: 600; }
.swd-svg .swd-sw rect { fill: var(--tint); stroke: var(--violet); }
.swd-gear { fill: none; stroke: var(--violet); stroke-width: 3; stroke-linejoin: round; }
.swd-hub { fill: var(--violet); }
.swd-in { fill: var(--violet); stroke: var(--violet); opacity: .75; }
.swd-in2 { fill: var(--surface-3); }
.swd-cache .swd-in { fill: var(--teal-fill); stroke: none; opacity: 1; }
.swd-cache .swd-in2 { fill: color-mix(in srgb, var(--teal-fill) 35%, var(--surface)); }
.swd-net .swd-in { stroke: var(--ink-3); fill: none; opacity: 1; }
.swd-off { opacity: 0; transition: opacity .25s; }
.swd-off rect { fill: var(--amber-fill); stroke: none; }
.swd-off text { fill: #2a1d00; font-size: 13px; font-weight: 700; }
.sw-demo.is-off .swd-off { opacity: 1; }
.sw-demo.is-off .swd-net { opacity: .45; }
.sw-demo.is-off .swd-net-wire { stroke: color-mix(in srgb, var(--amber-fill) 60%, transparent); stroke-dasharray: 3 10; }
.swd-sw.pulse rect { animation: swpulse .5s var(--ease); }
@keyframes swpulse { 50% { stroke-width: 4; } }
.pk { r: 7; }
.pk-req { fill: var(--violet); }
.pk-cache { fill: var(--teal-fill); }
.pk-net { fill: var(--ink-3); }
.swd-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; }
.swd-log { margin: 0; font: 500 .86rem/1.3 var(--font-mono); color: var(--ink-2); min-height: 1.3em; overflow-wrap: anywhere; }
.swd-stats { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.swd-stats li { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.swd-stats span { display: block; font-size: .76rem; color: var(--ink-3); }
.swd-stats b { font: 600 .95rem/1.3 var(--font-body); overflow-wrap: anywhere; }
.swd-stats .swd-install { grid-column: 1 / -1; background: none; padding: 0; }
.swd-stats .swd-install[hidden] { display: none; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: .95rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background .2s; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s var(--ease); }
.switch input:checked + .switch-ui { background: var(--amber-fill); border-color: var(--amber-fill); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Sections ---------- */
.section { padding: clamp(30px, 5vw, 56px) 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-sub { color: var(--ink-3); margin: -4px 0 18px; max-width: 70ch; }
.more { font-weight: 600; white-space: nowrap; }
.band { background: var(--surface); border-block: 1px solid var(--line); }

/* Learning path (a real sequence) */
.path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; counter-reset: p; }
.path a { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: start; height: 100%; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); position: relative; transition: border-color .15s, transform .15s; }
.path a:hover { border-color: var(--violet); transform: translateY(-2px); }
.path-n { position: absolute; top: 12px; right: 14px; font: 700 .85rem/1 var(--font-mono); color: var(--ink-3); }
.path-art { grid-row: span 2; width: 52px; height: 52px; }
.path-art .art { width: 52px; height: 52px; }
.path-t { font: 700 1.05rem/1.3 var(--font-display); padding-right: 22px; }
.path-s { color: var(--ink-3); font-size: .92rem; }

.topics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.topic { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .15s; }
.topic:hover { border-color: var(--violet); }
.topic .art { width: 44px; height: 44px; margin-bottom: 6px; }
.topic b { font: 700 1rem/1.25 var(--font-display); }
.topic span { font-size: .86rem; color: var(--ink-3); }

.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tool-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s, background .15s; }
.hub-sec .tool-card { background: var(--surface); }
.tool-card:hover { border-color: var(--violet); }
.tool-card .art { width: 42px; height: 42px; margin-bottom: 6px; }
.tool-card b { font: 700 1rem/1.3 var(--font-display); }
.tool-card span { color: var(--ink-3); font-size: .9rem; }
.tool-card small { margin-top: auto; padding-top: 8px; font-size: .78rem; color: var(--teal); font-weight: 600; }

.repo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.repo { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; min-width: 0; transition: border-color .15s; }
.repo:hover { border-color: var(--violet); }
.repo b { font: 700 1.02rem/1.3 var(--font-display); }
.repo .mono { color: var(--ink-3); font-size: .8rem; overflow-wrap: anywhere; }
.repo-cat { font-size: .76rem; font-weight: 600; color: var(--teal); }
.repo-cat i { color: var(--amber); font-style: normal; }
.repo-what { font-size: .9rem; color: var(--ink-2); margin-top: 4px; }
.repo small { margin-top: auto; padding-top: 8px; color: var(--ink-3); font-size: .8rem; }
.repo.is-pick { border-color: color-mix(in srgb, var(--amber-fill) 55%, var(--line)); }
.repo-grid-full { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.az { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 18px; }
.az a, .az span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; font: 600 .95rem/1 var(--font-mono); text-decoration: none; }
.az a { background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); }
.az a:hover { background: var(--violet); color: #fff; border-color: var(--violet); }
.az span { color: var(--ink-3); opacity: .45; }
.az-sticky { position: sticky; top: 70px; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); padding: 8px 0; margin: 0; backdrop-filter: blur(6px); }
.dir-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.mono-card { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.related .mono-card { background: var(--surface); }
.mono-card:hover { border-color: var(--violet); }
.mono-card b { font: 700 1rem/1.25 var(--font-display); }
.mono-card span:last-child { grid-column: 2; font-size: .84rem; color: var(--ink-3); }
.mono-card .mono-tile { grid-row: span 2; }
.mono-tile { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font: 800 1.3rem/1 var(--font-display); color: #fff; background: var(--violet); flex: none; }
.mono-xl { width: clamp(110px, 18vw, 170px); height: clamp(110px, 18vw, 170px); border-radius: 26%; font-size: clamp(3rem, 7vw, 5rem); box-shadow: var(--shadow); }
.tile-social { background: #5A0FC8; } .tile-shopping { background: #C42B5F; } .tile-travel { background: #0B7F95; } .tile-media { background: #B3480C; }
.tile-news { background: #2B3A8C; } .tile-productivity { background: #0B8A7F; } .tile-communication { background: #3559C7; } .tile-creative { background: #9C2FB0; }
.tile-food { background: #7A5200; } .tile-transport { background: #3E4A61; } .tile-dev { background: #1F2452; } .tile-reference { background: #5B6B1F; }

/* ---------- Page head ---------- */
.page-head { padding: clamp(22px, 4vw, 44px) 0 clamp(14px, 3vw, 26px); border-bottom: 1px solid var(--line); background: var(--surface); }
.page-head-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; }
.page-head h1 { margin-bottom: .3em; }
.page-summary { font-size: 1.15rem; color: var(--ink-2); margin: 0; max-width: 62ch; }
.page-head-art { width: clamp(84px, 14vw, 150px); height: clamp(84px, 14vw, 150px); }
.page-head-art .art { width: 100%; height: 100%; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .9rem; margin-bottom: 10px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--violet); }
.crumbs a + a::before { content: "/"; margin-right: 6px; color: var(--line-2); }
.byline { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-3); font-size: .92rem; margin-top: 12px; }
.read-progress { position: sticky; top: 66px; height: 3px; z-index: 40; }
.read-progress i { display: block; height: 100%; width: 0; background: var(--violet); }
.guide-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-top: 16px; font-size: .9rem; color: var(--ink-3); }
.save-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 14px; font: 600 .9rem/1.2 var(--font-body); cursor: pointer; min-height: 36px; }
.save-btn svg { width: 16px; height: 16px; }
.save-btn:hover { border-color: var(--violet); color: var(--violet); }
.save-btn.is-saved { background: var(--ok-bg); border-color: var(--teal); color: var(--teal); }
.save-btn.is-saved svg path { fill: currentColor; }
.save-btn[hidden] { display: none; }

/* ---------- Body and prose ---------- */
.page-body { padding: clamp(20px, 3.5vw, 40px) 0 20px; }
.page-body.has-aside { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(24px, 4vw, 56px); align-items: start; }
.prose { max-width: var(--measure); min-width: 0; }
.prose h2 { margin-top: 1.8em; padding-top: .2em; }
.prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--violet); }
.prose blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 4px solid var(--violet); background: var(--tint); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.prose blockquote p:last-child { margin: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.prose img { height: auto; border-radius: var(--radius); }
.prose strong { font-weight: 600; }
pre.code { position: relative; margin: 1.2em 0; padding: 16px 18px; background: #12153A; color: #E6E8FA; border-radius: var(--radius); overflow-x: auto; font: 400 .86rem/1.6 var(--font-mono); tab-size: 2; border: 1px solid rgba(255, 255, 255, .06); }
[data-theme="night"] pre.code { background: #0A0C22; }
pre.code code { font: inherit; background: none; border: 0; padding: 0; color: inherit; }
pre.code[data-lang]::before { content: attr(data-lang); position: absolute; top: 8px; right: 12px; font-size: .72rem; color: #9AA0D0; text-transform: lowercase; pointer-events: none; }
pre.code .cp { position: absolute; top: 6px; right: 6px; opacity: 0; background: #2A2F66; color: #fff; border: 0; border-radius: 6px; padding: 4px 10px; font: 600 .78rem/1.3 var(--font-body); cursor: pointer; transition: opacity .15s; }
pre.code:hover .cp, pre.code .cp:focus-visible { opacity: 1; }
pre.code[data-lang]:hover::before { opacity: 0; }
.tk-k { color: #C9A6FF; } .tk-s { color: #8FE3D2; } .tk-c { color: #8086B8; font-style: italic; } .tk-n { color: #FFC872; }
.callout { padding: 12px 16px; border-radius: var(--radius-s); background: var(--tint); border-left: 4px solid var(--violet); }
.callout-warn { background: var(--warn-bg); border-left-color: var(--amber-fill); }
.pick-badge { display: inline-block; background: var(--warn-bg); color: var(--amber); font-weight: 600; padding: 4px 12px; border-radius: 999px; font-size: .9rem; }

.aside { position: sticky; top: 86px; display: grid; gap: 14px; min-width: 0; }
.facts-box, .keys-box, .toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.facts-box h2, .keys-box h2, .toc h2 { font-size: 1rem; margin-bottom: 10px; }
.facts-box dl { margin: 0; display: grid; gap: 2px; }
.facts-box dt { font-size: .8rem; color: var(--ink-3); margin-top: 8px; }
.facts-box dt:first-child { margin-top: 0; }
.facts-box dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.facts-box p { margin: 14px 0 0; }
.keys-box { background: var(--tint); border-color: transparent; }
.keys-box ul { margin: 0; padding-left: 1.1em; font-size: .94rem; }
.keys-box li { margin: .35em 0; }
.keys-box li::marker { color: var(--violet); }
.toc ol { margin: 0; padding-left: 1.2em; font-size: .93rem; }
.toc li { margin: .3em 0; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--violet); }
.page-support { margin-top: 2em; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px auto 20px; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); }
.pager a:hover { border-color: var(--violet); }
.pager small { color: var(--ink-3); }
.pager b { font-family: var(--font-display); }
.pager-next { text-align: right; grid-column: 2; }
.page-faq { margin-top: 2em; }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s; min-width: 0; }
.card:hover { border-color: var(--violet); }
.card-media { width: 56px; height: 56px; }
.card-media .art, .card-art { width: 56px; height: 56px; }
.card-media img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-title { font: 700 1.03rem/1.3 var(--font-display); }
.card-text { color: var(--ink-3); font-size: .92rem; }
.card-meta { color: var(--ink-3); font-size: .8rem; font-weight: 500; overflow-wrap: anywhere; }
.related { margin: 26px 0 10px; }
.children { margin: 10px auto 20px; }

/* ---------- Hubs ---------- */
.intro-prose { padding: 22px 0 6px; }
.hub-tools { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; margin-bottom: 10px; }
.filter { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 20px; }
.hub-tools .filter { margin: 0; }
.filter input[type="search"] { width: 100%; }
.filter-count { margin: 10px 0 0; color: var(--ink-3); font-size: .9rem; }
.save-all { background: var(--tint); border-radius: var(--radius); padding: 14px 16px; }
.save-all .btn { width: 100%; }
.save-all p { margin: 8px 0 0; font-size: .86rem; }
.hub-sec { padding: 18px 0 8px; }
.hub-sec:not(:has([data-fi]:not([hidden]))):has([data-fi]) { display: none; }
.hub-sec h2 { display: flex; align-items: center; gap: 10px; }
.hub-ico { width: 38px; height: 38px; display: inline-block; }
.hub-ico .art { width: 38px; height: 38px; }
.g-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.g-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.g-card:hover { border-color: var(--violet); }
.g-card b { font: 700 1rem/1.3 var(--font-display); }
.g-card > span { color: var(--ink-3); font-size: .9rem; }
.g-card small { margin-top: auto; padding-top: 6px; color: var(--ink-3); font-size: .82rem; display: flex; gap: 8px; align-items: center; }
.g-card[hidden], .repo[hidden], .dir-item[hidden] { display: none; }
.empty { text-align: center; color: var(--ink-3); padding: 30px 0; }
.az-sec { padding: 10px 0; }
.az-sec:not(:has(.dir-item:not([hidden]))) { display: none; }
.az-h { font: 800 1.6rem/1 var(--font-mono); color: var(--violet); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.dir-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dir-item { display: flex; gap: 14px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; min-width: 0; }
.dir-item:hover { border-color: var(--violet); }
.dir-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dir-body b { font: 700 1.05rem/1.25 var(--font-display); }
.dir-meta { font-size: .8rem; color: var(--ink-3); }
.dir-what { font-size: .92rem; color: var(--ink-2); }
.dir-res { font-size: .86rem; color: var(--teal); font-weight: 600; }
.sc-head .page-head-art { width: auto; height: auto; }

/* ---------- Support table ---------- */
.sup-wrap { margin: 1em 0; }
.sup-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: .88rem; color: var(--ink-2); }
.sup-key { display: inline-flex; align-items: center; gap: 6px; }
.sup-date { margin-left: auto; color: var(--ink-3); }
.sup-scroll { overflow-x: auto; contain: paint; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.sup { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 760px; font-size: .9rem; }
.sup th, .sup td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.sup thead th { position: sticky; top: 0; background: var(--surface-2); font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.sup tbody th { font-weight: 500; min-width: 190px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.sup tbody th a { color: var(--ink); text-decoration: none; }
.sup tbody th a:hover { color: var(--violet); text-decoration: underline; }
.sup-b span { display: block; max-width: 110px; }
.sup-g th { background: var(--tint) !important; color: var(--violet); font: 700 .9rem/1.2 var(--font-display); position: static !important; }
.sup-c { min-width: 92px; }
.sup-c small { display: block; color: var(--ink-3); font-size: .74rem; line-height: 1.35; margin-top: 3px; }
.sup-l { font-weight: 500; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.dot-y { background: var(--teal-fill); }
.dot-p { background: var(--amber-fill); }
.dot-n { background: transparent; border: 2px solid var(--rose); width: 10px; height: 10px; }
.dot-u { background: repeating-linear-gradient(45deg, var(--ink-3) 0 2px, transparent 2px 4px); border: 1px solid var(--ink-3); }
.sup-compact .sup { min-width: 680px; font-size: .86rem; }
.sup-compact .sup-l { display: none; }
.sup-compact .sup-c { min-width: 0; text-align: center; }
.sup-compact .dot { width: 14px; height: 14px; margin: 0; }

/* ---------- Tools ---------- */
.tool-wrap { padding-top: 20px; }
.tool-runs { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--teal); background: var(--ok-bg); padding: 6px 14px; border-radius: 999px; margin: 0 0 14px; }
.tool-runs.is-server { color: var(--violet); background: var(--tint); }
.tool-runs svg { width: 18px; height: 18px; flex: none; }
.tool-ui { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: clamp(16px, 3vw, 28px); box-shadow: var(--shadow); }
.tool-ui h3 { font-size: 1rem; margin: 18px 0 8px; }
.tool-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: .93rem; margin-bottom: 10px; min-width: 0; }
.tool-form label small { font-weight: 400; color: var(--ink-3); }
.tool-form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.tool-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 4px; margin: 0; min-width: 0; }
.tool-form legend { font: 700 .95rem/1 var(--font-display); padding: 0 6px; }
input[type="text"], input[type="url"], input[type="email"], input[type="search"], input[type="number"], input:not([type]), select, textarea {
  width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--bg); color: var(--ink); font: inherit; font-size: 1rem; }
input:focus, select:focus, textarea:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 20%, transparent); }
textarea { resize: vertical; line-height: 1.5; }
.code-in { font: 400 .88rem/1.55 var(--font-mono); }
input[type="color"] { width: 46px; height: 40px; padding: 2px; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; flex: none; }
input[type="range"] { accent-color: var(--violet); width: 100%; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--violet); width: 18px; height: 18px; flex: none; }
.color-pair { display: flex; gap: 8px; align-items: center; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.gen-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.row-input { display: flex; gap: 8px; }
.row-input input { flex: 1; min-width: 0; }
.hint { font-size: .86rem; color: var(--ink-3); margin: 4px 0 0; }
.out-wrap { margin-top: 10px; }
.out-wrap pre.code { max-height: 460px; }
pre.out { white-space: pre; }
.out-bar { display: flex; gap: 8px; margin: -6px 0 14px; }
.file-drop { position: relative; display: grid !important; place-items: center; text-align: center; min-height: 110px; border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 14px; cursor: pointer; color: var(--ink-2); background: var(--bg); }
.file-drop.small { min-height: 64px; }
.file-drop:hover, .file-drop.drag { border-color: var(--violet); color: var(--violet); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.label { font-weight: 600; margin: 0; }
.form-msg { min-height: 1.4em; font-weight: 500; margin: 8px 0 0; }
.form-msg.ok { color: var(--teal); } .form-msg.err { color: var(--rose); }
.preview-frame { width: 100%; height: 360px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
/* checker */
.ck-out { margin-top: 18px; }
.ck-summary { display: flex; gap: 18px; align-items: center; padding: 14px; background: var(--bg); border-radius: var(--radius); }
.ck-ring { width: 96px; height: 96px; transform: rotate(-90deg); flex: none; }
.ring-bg, .ring-fg { fill: none; stroke-width: 10; }
.ring-bg { stroke: var(--surface-3); }
.ring-fg { stroke: var(--teal-fill); stroke-linecap: round; stroke-dasharray: 0 100; transition: stroke-dasharray .8s var(--ease); }
.ck-score { font: 800 2rem/1 var(--font-display); }
.ck-summary p { margin: 4px 0 0; }
.ck-groups { display: grid; gap: 14px; margin-top: 16px; }
.ck-group h3 { margin: 0 0 6px; }
.ck-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ck-list li { display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: .94rem; }
.ck-list li:first-child { border-top: 0; }
.ck-list p { margin: 0; overflow-wrap: anywhere; }
.ck-list .fix { color: var(--ink-3); font-size: .88rem; margin-top: 2px; }
.st { font-size: .76rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; text-align: center; align-self: start; }
.st-pass { background: var(--ok-bg); color: var(--teal); } .st-warn { background: var(--warn-bg); color: var(--amber); } .st-fail { background: var(--bad-bg); color: var(--rose); } .st-info { background: var(--surface-2); color: var(--ink-3); }
.va-out { margin-top: 14px; }
/* icons and maskable */
.icon-previews { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin: 16px 0; }
.icon-previews figure { margin: 0; text-align: center; font-size: .78rem; color: var(--ink-3); }
.icon-previews canvas { display: block; margin: 0 auto 6px; border-radius: 8px; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; max-width: 128px; height: auto; }
.icon-previews .masked canvas { border-radius: 50%; }
.mask-tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 22px; align-items: start; }
.mask-stage { display: grid; gap: 14px; justify-items: center; }
.mask-frame { position: relative; width: min(320px, 100%); aspect-ratio: 1; overflow: hidden; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 20px 20px; transition: border-radius .3s var(--ease), clip-path .3s; }
.mask-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mask-frame .safe { position: absolute; inset: 10%; border-radius: 50%; border: 2px dashed #12B5A6; box-shadow: 0 0 0 999px rgba(196, 43, 95, .16); pointer-events: none; }
.mask-tool:not(.show-safe) .safe { display: none; }
.shape-circle { border-radius: 50%; } .shape-squircle { border-radius: 30%; } .shape-rounded { border-radius: 16%; } .shape-leaf { border-radius: 50% 50% 50% 12%; } .shape-none { border-radius: 0; }
.mask-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.mask-row span { width: 64px; height: 64px; overflow: hidden; display: block; }
.mask-row img { width: 100%; height: 100%; object-fit: cover; }
/* strategy */
.strat-q { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.strat-out { margin-top: 16px; }
.strat-name { font: 800 1.5rem/1.2 var(--font-display); color: var(--violet); margin: 0 0 6px; }
.tabs { display: flex; gap: 4px; margin: 12px 0 8px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); padding: 6px 12px; border-radius: 8px; font: 500 .9rem/1.2 var(--font-body); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
/* theme preview */
.theme-previews { display: flex; flex-wrap: wrap; gap: 18px; margin: 18px 0; align-items: flex-start; }
.phone-mock, .win-mock { margin: 0; text-align: center; font-size: .82rem; color: var(--ink-3); }
.phone-mock > div:first-child, .phone-mock { position: relative; }
.phone-mock { width: 170px; }
.phone-mock .pm-status, .phone-mock .pm-splash, .phone-mock .pm-bar, .phone-mock .pm-body { width: 170px; }
.pm-status { display: flex; justify-content: space-between; padding: 5px 12px; font: 600 .66rem/1 var(--font-body); color: #fff; border-radius: 22px 22px 0 0; }
.pm-splash { height: 280px; display: grid; place-content: center; gap: 12px; justify-items: center; border-radius: 0 0 22px 22px; border: 1px solid var(--line); border-top: 0; }
.pm-splash img { width: 64px; height: 64px; }
.pm-splash b, .pm-bar b { font: 700 .95rem/1.2 var(--font-body); }
.pm-bar { padding: 12px; text-align: left; color: #fff; }
.pm-body { height: 226px; background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 22px 22px; padding: 12px; display: grid; gap: 8px; align-content: start; }
.pm-body i, .wm-body i { display: block; height: 12px; border-radius: 6px; background: var(--surface-3); }
.pm-body i:nth-child(2), .wm-body i:nth-child(2) { width: 70%; }
.phone-mock figcaption, .win-mock figcaption { margin-top: 8px; }
.win-mock { width: min(360px, 100%); }
.wm-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px 10px 0 0; color: #fff; }
.wm-bar img { width: 18px; height: 18px; }
.wm-bar b { font: 600 .85rem/1 var(--font-body); flex: 1; text-align: left; }
.wm-ctl { font-size: .75rem; letter-spacing: 6px; }
.wm-body { height: 150px; background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; padding: 14px; display: grid; gap: 10px; align-content: start; }
.contrast { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.contrast li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
/* feature detector, storage, notify */
.fd-summary { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.fd-summary li { background: var(--bg); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.fd-summary span { display: block; font-size: .78rem; color: var(--ink-3); }
.fd-summary b { overflow-wrap: anywhere; }
.fd-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.fd-table th, .fd-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.fd-table thead th { background: var(--surface-2); font-size: .82rem; }
.fd-table td:nth-child(3) { color: var(--ink-3); font-size: .86rem; }
.st-meter { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.st-bar { flex: 1; height: 14px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.st-bar i { display: block; height: 100%; width: 0; background: var(--teal-fill); border-radius: 999px; transition: width .6s var(--ease); }
.st-meter p { margin: 0; white-space: nowrap; }
.keys textarea { margin-bottom: 0; }

/* ---------- Forms (newsletter, contact) ---------- */
.field-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.field-row input { flex: 1; min-width: 0; }
.captcha-row { align-items: center; }
.captcha-row label { font-size: .92rem; color: var(--ink-2); }
.captcha-row input { flex: 0 0 80px; }
.form-fine { font-size: .82rem; color: var(--ink-3); margin-top: 8px; }
.form-title { font-weight: 700; margin: 0 0 8px; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 20px; }
.contact-form label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-weight: 500; }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: start; }
.letter-band { background: var(--ink); color: var(--bg); padding: clamp(30px, 5vw, 54px) 0; }
[data-theme="night"] .letter-band { background: var(--surface); color: var(--ink); }
.letter-inner { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 28px; align-items: center; }
.letter-art .art { width: 110px; height: 110px; }
.letter-band .art .l { stroke: #DADDF5; } .letter-band .art .s { fill: #2A2463; }
.letter-band .newsletter-form { max-width: 620px; }
.letter-band h2 { color: inherit; }
.letter-band p { color: #C4C8E8; max-width: 62ch; }
[data-theme="night"] .letter-band p { color: var(--ink-2); }
.letter-band input { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .25); color: #fff; }
[data-theme="night"] .letter-band input { background: var(--bg); color: var(--ink); border-color: var(--line-2); }
.letter-band .form-fine, .letter-band .captcha-row label { color: #C4C8E8; }
.newsletter-form .form-msg.ok { color: #3DD9C8; }

/* ---------- FAQ, gallery, sitemap, share, blog ---------- */
.faq-list { display: grid; gap: 8px; }
.faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.faq summary { cursor: pointer; list-style: none; padding: 14px 44px 14px 16px; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 10px; font: 400 1.5rem/1 var(--font-mono); color: var(--violet); }
.faq[open] summary::after { content: "–"; }
.faq-a { padding: 0 16px 6px; color: var(--ink-2); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 18px 0 30px; }
.g-item { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.g-l { grid-column: span 2; }
.g-media { display: grid; place-items: center; aspect-ratio: 16 / 10; background: var(--bg); border-radius: var(--radius-s); padding: 16px; }
.g-media svg { width: 100%; height: 100%; max-height: 160px; }
.g-item figcaption b { display: block; font-family: var(--font-display); }
.g-item figcaption span { font-size: .9rem; color: var(--ink-3); }
.g-media .l { fill: none; stroke: var(--art-ink); stroke-linecap: round; stroke-linejoin: round; } .g-media .lv { fill: none; stroke: var(--art-v); stroke-linecap: round; stroke-linejoin: round; }
.g-media .lt { fill: none; stroke: var(--art-t); stroke-linecap: round; stroke-linejoin: round; } .g-media .lw { fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; }
.g-media .v { fill: #5A0FC8; } .g-media .t { fill: #12B5A6; } .g-media .m { fill: #F4A100; } .g-media .s { fill: var(--tint); } .g-media .p { fill: var(--surface); }
.g-media .tx { fill: var(--art-ink); } .g-media .txv { fill: var(--art-v); } .g-media .txt { fill: var(--art-t); } .g-media .txw { fill: #fff; } .g-media .lnet { fill: none; stroke: var(--line-2); }
.sitemap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; padding: 26px 0; }
.sitemap-grid ul { padding-left: 1.1em; margin: 0; font-size: .94rem; }
.sitemap-grid li { margin: .25em 0; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 22px 0 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .92rem; color: var(--ink-3); }
.share-btn { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface); text-decoration: none; font: 500 .88rem/1.2 var(--font-body); cursor: pointer; }
.share-btn:hover { border-color: var(--violet); color: var(--violet); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.blog-lead { margin-bottom: 18px; }
.search-form { display: flex; gap: 8px; max-width: 620px; margin: 0 0 18px; }
.search-form input { flex: 1; min-width: 0; }
.lightbox { border: 0; border-radius: var(--radius); padding: 0; max-width: min(900px, 94vw); background: var(--surface); color: var(--ink); }
.lightbox::backdrop { background: rgba(10, 12, 34, .75); }
.lb-close { position: absolute; right: 8px; top: 8px; border: 0; background: var(--surface); border-radius: 50%; width: 36px; height: 36px; font-size: 1.4rem; cursor: pointer; color: var(--ink); }

/* ---------- 404 and offline ---------- */
.not-found { text-align: center; padding: clamp(30px, 6vw, 70px) 0; }
.nf-art { display: block; width: min(320px, 80%); margin: 0 auto 18px; }
.nf-art svg { width: 100%; height: auto; }
.nf-art .l { fill: none; stroke: var(--art-ink); stroke-linecap: round; stroke-linejoin: round; } .nf-art .lt { fill: none; stroke: var(--art-t); stroke-linecap: round; } .nf-art .lv { fill: none; stroke: var(--art-v); stroke-linecap: round; }
.nf-art .v { fill: #5A0FC8; } .nf-art .s { fill: var(--tint); } .nf-art .p { fill: var(--surface); } .nf-art .txv { fill: var(--art-v); }
.not-found .search-form { margin: 18px auto; }
.offline-page { text-align: left; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 32px; align-items: center; }
.offline-list { columns: 2 220px; padding-left: 1.1em; }
.offline-list li { margin: .3em 0; break-inside: avoid; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 30px; background: var(--surface); border-top: 1px solid var(--line); }
.footer-toran { line-height: 0; overflow: hidden; }
.footer-toran svg { width: 100%; height: 56px; display: block; }
.footer-toran .lnet { fill: none; stroke: var(--line-2); }
.footer-toran .v { fill: #7B3FE4; } .footer-toran .t { fill: var(--teal-fill); } .footer-toran .m { fill: var(--amber-fill); } .footer-toran .p { fill: var(--surface-3); }
.footer-grid { width: min(var(--wrap), 100% - 40px); margin: 0 auto; display: grid; grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr)); gap: 28px; padding: 26px 0 30px; }
.footer-about p { color: var(--ink-3); font-size: .94rem; }
.brand-foot { margin-bottom: 12px; }
.footer-col h2 { font: 700 .95rem/1.2 var(--font-display); margin-bottom: 10px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin: 6px 0; }
.footer-col a { color: var(--ink-2); text-decoration: none; font-size: .93rem; }
.footer-col a:hover { color: var(--violet); text-decoration: underline; }
.footer-about .newsletter-form { margin-top: 12px; }
.footer-notice { width: min(var(--wrap), 100% - 40px); margin: 0 auto 14px; color: var(--ink-3); font-size: .88rem; }
.footer-langs { width: min(var(--wrap), 100% - 40px); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.footer-langs a { color: var(--ink-2); text-decoration: none; font-size: .93rem; }
.footer-base { width: min(var(--wrap), 100% - 40px); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 14px 0 30px; border-top: 1px solid var(--line); font-size: .86rem; color: var(--ink-3); }
.footer-base p { margin: 0; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.footer-legal a { color: var(--ink-3); }

/* ---------- Overlays: consent, toast, top, fx ---------- */
.consent { position: fixed; z-index: 80; left: 16px; right: 16px; bottom: 16px; max-width: 520px; margin-inline: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.consent[hidden] { display: none; }
.consent p { margin: 0 0 12px; font-size: .94rem; }
.consent-actions { display: flex; gap: 8px; justify-content: flex-end; }
.sw-toast { position: fixed; z-index: 85; left: 50%; bottom: 18px; translate: -50% 16px; opacity: 0; display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--bg); padding: 10px 10px 10px 18px; border-radius: 999px; box-shadow: var(--shadow); max-width: calc(100% - 24px); transition: opacity .25s, translate .3s var(--ease); }
[data-theme="night"] .sw-toast { background: #ECEEFB; color: #161A3A; }
.sw-toast.show { opacity: 1; translate: -50% 0; }
.sw-toast[hidden] { display: none; }
.sw-toast-text { margin: 0; font-size: .94rem; }
.sw-toast-btn { min-height: 34px; padding: 5px 14px; background: var(--teal-fill) !important; border-color: var(--teal-fill) !important; color: #06201d !important; }
.sw-toast-btn[hidden] { display: none; }
.sw-toast-x { border: 0; background: none; color: inherit; font-size: 1.3rem; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; opacity: .7; }
.to-top { position: fixed; right: 16px; bottom: 16px; z-index: 30; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s; }
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top svg { width: 20px; }
canvas.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }
.is-standalone .site-header { padding-top: env(safe-area-inset-top); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .topics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tool-grid, .repo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .menu-btn { display: inline-flex; }
  .main-nav { position: fixed; inset: 66px 0 0 0; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; padding: 14px 20px 40px; opacity: 0; transform: translateY(-10px); visibility: hidden; pointer-events: none; transition: opacity .25s var(--ease), transform .3s var(--ease), visibility 0s linear .3s; }
  .main-nav.open { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity .25s var(--ease), transform .3s var(--ease), visibility 0s; }
  .main-nav > ul { flex-direction: column; gap: 0; }
  .nav-btn { width: 100%; justify-content: space-between; padding: 14px 8px; font-size: 1.1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav-panel { position: static; translate: none; opacity: 1; visibility: visible; transform: none; display: none; box-shadow: none; border: 0; background: none; padding: 4px 0 10px 10px; }
  .nav-group.open .nav-panel { display: block; }
  .tools { margin-left: auto; }
  .p-hero-inner { grid-template-columns: minmax(0, 1fr); }
  .path { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-grid, .repo-grid, .repo-grid-full, .g-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-body.has-aside, .hub-tools { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
  .dir-list { grid-template-columns: minmax(0, 1fr); }
  .contact-layout, .mask-tool, .offline-page { grid-template-columns: minmax(0, 1fr); }
  .g-l { grid-column: auto; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .bar { height: 60px; gap: 8px; }
  .main-nav { inset: 60px 0 0 0; }
  .brand-word { font-size: 1.18rem; }
  .brand-mark { width: 30px; height: 30px; }
  .lang-btn span, .install-label { display: none; }
  .tool { padding: 0 6px; min-width: 38px; }
  .path, .topics, .tool-grid, .repo-grid, .repo-grid-full, .g-list { grid-template-columns: minmax(0, 1fr); }
  .topics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .swd-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .page-head-inner { grid-template-columns: minmax(0, 1fr); }
  .page-head-art { display: none; }
  .sc-head .page-head-art { display: block; }
  .mono-xl { width: 90px; height: 90px; font-size: 2.6rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .letter-inner { grid-template-columns: minmax(0, 1fr); }
  .letter-art { display: none; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager-next { grid-column: 1; }
  .row-input { flex-direction: column; }
  .ck-list li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .st { justify-self: start; }
  .save-btn { margin-left: 0; }
  .sw-toast { border-radius: 16px; left: 12px; right: 12px; translate: 0 16px; max-width: none; }
  .sw-toast.show { translate: 0 0; }
  .pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
  .topics { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .swd-stats { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .share, .consent, .to-top, .sw-toast, .save-btn, .letter-band, canvas.fx, .aside { display: none !important; }
  .page-body.has-aside { display: block; }
  pre.code { white-space: pre-wrap; background: #fff; color: #000; border: 1px solid #ccc; }
}
.prose { overflow-wrap: break-word; }
.prose p, .prose li { overflow-wrap: anywhere; }
.fd-table { table-layout: fixed; }
.fd-table th:first-child, .fd-table td:first-child { width: 44%; }
.fd-table th:nth-child(2), .fd-table td:nth-child(2) { width: 22%; }
.fd-table td { overflow-wrap: anywhere; }
