/* The site of the Shtukbase Standard: layout on top of kit-style (kit.css + skins). Colors, shadows,
 * radii and fonts come only from the skin variables, so both skins and both themes work everywhere. */

html { scroll-padding-top: 72px; }
html, body { height: auto; }
body { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
code, pre, kbd { font-family: var(--mono); }
img { max-width: 100%; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1200px; margin: 0 auto; height: 56px; padding: 0 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); flex: none; }
.brand .b1 { font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand .b2 { color: var(--muted); font-size: 15px; }
.brand svg rect { fill: var(--ink); } .brand svg rect.accent { fill: var(--accent); }
.nav { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-a { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 6px; text-decoration: none; color: var(--muted); font-size: 14px; white-space: nowrap; }
.nav-a:hover { background: var(--wash); color: var(--ink); }
.nav-a.on { color: var(--ink); background: var(--wash); font-weight: 500; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 2px; flex: none; }
.tools a.lx-btn { text-decoration: none; }
.i-light { display: none; } :root[data-theme="dark"] .i-light { display: inline-flex; } :root[data-theme="dark"] .i-dark { display: none; }

/* ---------- page ---------- */
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px 20px 64px; flex: 1 0 auto; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); text-decoration: none; padding: 2px 4px; border-radius: 4px; margin: 0 -4px; }
.crumbs a:hover { color: var(--ink); background: var(--wash); }
.crumbs .sep { color: var(--faint); }
.foot { border-top: 1px solid var(--line); background: var(--bg2); color: var(--muted); font-size: 13px; }
.foot-in { max-width: 1200px; margin: 0 auto; padding: 22px 20px 28px; display: grid; gap: 8px; }
.foot b { color: var(--ink); font-weight: 600; }
.foot-l { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-l a { color: var(--muted); } .foot-l a:hover { color: var(--ink); }
.foot-m { color: var(--faint); }

h1.title { font-size: 32px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 8px; font-weight: 700; }
.lead { font-size: 16px; line-height: 1.6; color: var(--muted); margin: 0 0 20px; max-width: 760px; text-wrap: pretty; }
.sec { margin: 44px 0 0; }
.sec > h2, h2.sec-t { font-size: 22px; letter-spacing: -.01em; margin: 0 0 6px; font-weight: 650; }
.sec > .sub { color: var(--muted); margin: 0 0 18px; max-width: 760px; font-size: 14.5px; line-height: 1.55; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; }
.chips > .mono { overflow-wrap: anywhere; min-width: 0; }
.ph { color: var(--accent); }
.note { border-radius: var(--radius); background: var(--bg2); box-shadow: inset 0 0 0 1px var(--line); padding: 12px 14px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.note b, .note strong { color: var(--ink); }
.note.warn { background: var(--ct-yellow); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-yellow) 35%, transparent); color: var(--cf-yellow); }
:root[data-theme="dark"] .note.warn { background: color-mix(in srgb, var(--c-yellow) 12%, var(--bg)); color: var(--ink); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 8px; text-decoration: none; font-size: 14px; font-weight: 550;
  border: 0; cursor: pointer; background: var(--card); color: var(--ink); box-shadow: var(--shadow); transition: transform .08s, box-shadow .12s; }
.btn:hover { box-shadow: var(--shadow-lift); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--bg); box-shadow: none; }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 88%, var(--bg)); }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- command box ---------- */
.cmd { margin: 8px 0; }
.cmd-l { font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.cmd-b { display: flex; align-items: flex-start; gap: 8px; background: var(--bg2); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); padding: 8px 8px 8px 12px; }
.cmd-b code { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.55; padding: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.cmd-b code::before { content: "$ "; color: var(--faint); }
.cmd-b .copy { flex: none; font-size: 12px; height: 26px; background: var(--card); box-shadow: var(--shadow); color: var(--muted); }
.cmd-b .copy.done { color: var(--c-green); }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 40px; align-items: center; padding: 28px 0 8px; }
.hero h1 { font-size: 46px; line-height: 1.06; letter-spacing: -.03em; margin: 0 0 16px; font-weight: 750; text-wrap: balance; }
.hero h1 .accent { color: var(--accent); }
.hero .lead { font-size: 17px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); background: var(--bg2); box-shadow: inset 0 0 0 1px var(--line);
  border-radius: 20px; padding: 3px 10px 3px 8px; margin-bottom: 16px; text-decoration: none; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c-green); }
.stats { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 22px; }
.stat b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.stat span { font-size: 12.5px; color: var(--muted); }
.mosaic { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; padding: 18px; border-radius: 18px; background: var(--bg2); box-shadow: inset 0 0 0 1px var(--line); }
.mosaic a { aspect-ratio: 1; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center;
  transition: transform .12s, box-shadow .12s; position: relative; }
.mosaic a:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); z-index: 1; }
.mosaic img { width: 64%; height: 64%; }
.mosaic a.core { box-shadow: 0 0 0 2px var(--c-red), var(--shadow); }
.mosaic a.basic { box-shadow: 0 0 0 2px var(--c-blue), var(--shadow); }
.mosaic-cap { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
.mosaic-cap i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tile { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px 18px 16px; }
.tile .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-bottom: 6px; }
.tile h3 { margin: 0 0 6px; font-size: 16px; font-weight: 650; }
.tile p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; text-wrap: pretty; }
.tile .art { width: 56px; height: 56px; margin-bottom: 10px; }
.four { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.draft { font-size: 11px; color: var(--cf-yellow); background: var(--cb-yellow); border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: 2px; font-weight: 500; }

.steps { counter-reset: step; display: grid; gap: 12px; }
.step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 16px; }
.step::before { counter-increment: step; content: counter(step); width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.step h3 { margin: 4px 0 4px; font-size: 15px; font-weight: 650; }
.step p { margin: 0 0 6px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }

.basic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.now { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.now ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink); line-height: 1.6; font-size: 14px; }
.now li { margin: 3px 0; }
.now li span { color: var(--muted); }

/* ---------- package refs ---------- */
.pref { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--ink); padding: 5px 8px 5px 6px; border-radius: 8px; background: var(--card); box-shadow: var(--shadow); min-width: 0; max-width: 100%; }
.pref:hover { box-shadow: var(--shadow-lift); }
.pref img { flex: none; }
.pref .t { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pref .id { font-family: var(--mono); font-size: 11px; color: var(--faint); white-space: nowrap; }
.pref .rng, .lx-ref .rng { font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--wash); border-radius: 4px; padding: 0 4px; white-space: nowrap; }
.prefs { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- catalog ---------- */
.bar { position: sticky; top: 56px; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  margin: 0 -20px 18px; padding: 10px 20px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.bar-r { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; background: var(--wash); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 10px; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 13px; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.search { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line2); flex: 1 1 240px; max-width: 380px; color: var(--faint); }
.search:focus-within { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-soft); }
.search input { border: 0; outline: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); width: 100%; }
.filt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; height: 28px; padding: 0 8px; border-radius: 6px; }
.filt:hover { background: var(--wash); color: var(--ink); }
.filt input { margin: 0; accent-color: var(--accent); }
select.sel { height: 28px; border-radius: 6px; border: 0; background: var(--wash); color: var(--ink); font: inherit; font-size: 13px; padding: 0 6px; }
.gchip { cursor: pointer; border: 0; font: inherit; }
.gchip.off { opacity: .38; }
.count { font-size: 13px; color: var(--muted); margin-left: auto; }
.view[hidden] { display: none !important; }
.empty { padding: 40px 0; text-align: center; color: var(--muted); }

.grp { margin: 0 0 30px; }
.grp-h { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; flex-wrap: wrap; }
.grp-h h2 { margin: 0; font-size: 17px; font-weight: 650; display: inline-flex; align-items: center; gap: 8px; }
.grp-h h2::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--gc, var(--c-gray)); }
.grp-h .hint { color: var(--muted); font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.pcard { display: flex; gap: 12px; text-decoration: none; color: var(--ink); background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 14px; transition: box-shadow .12s, transform .12s; min-width: 0; }
.pcard:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.pcard > img { flex: none; width: 44px; height: 44px; }
.pcard .bd { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.pcard .ttl { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.pcard .idv { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.pcard .ds { color: var(--muted); font-size: 12.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .chips { margin-top: 4px; }

.tbl { overflow-x: auto; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 500; color: var(--muted); background: var(--bg2); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; position: relative; }
table.t th[data-sort] { cursor: pointer; user-select: none; }
table.t th[data-sort]:hover { color: var(--ink); }
table.t th.asc::after { content: " ↑"; } table.t th.desc::after { content: " ↓"; }
table.t td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: var(--wash); }
table.t td.n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
table.t td.n.z { color: var(--faint); }
.tp { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); min-width: 220px; }
.tp img { flex: none; }
.tp b { font-weight: 550; } .tp .mono { color: var(--faint); font-size: 11px; display: block; }
.req { color: var(--muted); font-size: 12.5px; max-width: 420px; }

.tree { font-size: 14px; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 1px dashed var(--line2); margin-left: 9px; }
.tree > ul { border: 0; padding: 0; margin: 0; }
.tree li { margin: 3px 0; }
.tree summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before { content: "▸"; color: var(--faint); width: 12px; display: inline-block; transition: transform .1s; }
.tree details[open] > summary::before { transform: rotate(90deg); }
.tree .leaf { display: inline-flex; align-items: center; gap: 6px; padding-left: 18px; }
.tree a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); padding: 2px 6px; border-radius: 6px; }
.tree a:hover { background: var(--wash); }
.tree .rel { font-size: 11.5px; color: var(--faint); }
.tree .again { color: var(--faint); font-size: 12px; }
.levels { display: grid; gap: 10px; margin-bottom: 26px; }
.lvl { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: start; }
.lvl-h { font-size: 12px; color: var(--muted); padding-top: 8px; }
.lvl .prefs { gap: 6px; }
.deps-svg { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.deps-wrap { position: relative; }
.deps-wrap .pref.hl { box-shadow: 0 0 0 2px var(--accent), var(--shadow-lift); }
.deps-wrap .pref.dim { opacity: .35; }
.deps-svg path { fill: none; stroke: var(--accent); stroke-width: 1.4; opacity: .7; }

/* ---------- package page ---------- */
.ph-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 8px; }
.ph-head > img { width: 72px; height: 72px; flex: none; }
.ph-head h1 { margin: 2px 0 6px; font-size: 30px; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
.ph-head .idv { font-family: var(--mono); color: var(--muted); font-size: 13px; }
.ph-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; margin-top: 18px; }
.ph-side { position: sticky; top: 76px; display: grid; gap: 14px; }
.box { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 14px; }
.box h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.box .cmd-b { background: var(--bg2); }
dl.facts { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; font-size: 13px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.blk { margin: 0 0 30px; }
.blk > h2 { font-size: 18px; font-weight: 650; margin: 0 0 10px; display: flex; align-items: baseline; gap: 8px; }
.blk > h2 .n { font-size: 13px; color: var(--faint); font-weight: 400; }
.pages { list-style: none; margin: 0; padding: 0; columns: 2 260px; column-gap: 24px; }
.pages li { break-inside: avoid; padding: 3px 0; font-size: 13.5px; display: flex; gap: 6px; align-items: baseline; }
.pages li a { text-decoration: none; } .pages li a:hover { text-decoration: underline; }
.pages .p { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.pages .ty { font-size: 11px; color: var(--muted); white-space: nowrap; }
.dir { font-size: 12px; color: var(--muted); font-family: var(--mono); padding: 8px 0 2px; break-after: avoid; }
.files { font-family: var(--mono); font-size: 12px; color: var(--muted); line-height: 1.7; columns: 2 260px; }
.files a { color: var(--muted); text-decoration: none; } .files a:hover { color: var(--ink); text-decoration: underline; }
.lvl-chip { font-family: var(--mono); font-size: 11px; font-weight: 600; }
.enf { font-family: var(--mono); font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.enf a { color: var(--muted); }
.nrm-t a { font-weight: 500; text-decoration: none; } .nrm-t a:hover { text-decoration: underline; }
.nrm-r { color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.45; }

/* ---------- page view & docs ---------- */
.doc { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; align-items: start; }
.doc-nav { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; font-size: 13px; padding-right: 6px; }
.doc-nav .h { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin: 0 0 6px; }
.doc-nav a { display: block; padding: 4px 8px; border-radius: 6px; text-decoration: none; color: var(--muted); line-height: 1.35; }
.doc-nav a:hover { background: var(--wash); color: var(--ink); }
.doc-nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.doc-nav .d { font-family: var(--mono); font-size: 11px; color: var(--faint); padding: 8px 8px 2px; }
.doc-nav details summary { cursor: pointer; color: var(--muted); padding: 4px 8px; }
.doc-body { min-width: 0; max-width: 820px; }
.doc-body .lx-md { font-size: 15px; line-height: 1.65; }
.lx-md .tbl table { margin: 0; }
.lx-md .tbl { margin: 1em 0; overflow-x: auto; box-shadow: none; }
.lx-md pre { overflow-x: auto; }
.lx-md .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.pg-meta { margin: 0 0 18px; }
.pg-meta summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.pg-meta table { margin-top: 8px; }
.pg-meta td:first-child { color: var(--muted); white-space: nowrap; font-family: var(--mono); font-size: 12px; }
.pg-meta td { font-size: 12.5px; overflow-wrap: anywhere; }
.normcard { background: var(--card); box-shadow: var(--shadow); border-radius: var(--radius-lg); padding: 14px 16px; margin: 0 0 22px; display: grid; gap: 8px; }
.normcard .req { font-size: 15px; color: var(--ink); max-width: none; line-height: 1.5; }
.toc { font-size: 13px; }
.toc a { display: block; text-decoration: none; color: var(--muted); padding: 2px 8px; }
.toc a:hover { color: var(--ink); }
.toc .l3 { padding-left: 20px; }
.src { font-size: 12.5px; color: var(--muted); margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; gap: 14px; flex-wrap: wrap; }
.src a { color: var(--muted); } .src a:hover { color: var(--ink); }
.en-note { margin-bottom: 18px; }

/* ---------- download & blueprints ---------- */
.dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.dl .box h2 { font-size: 16px; margin: 0 0 6px; font-weight: 650; }
.dl .box p { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0 0 10px; }
.sha { font-family: var(--mono); font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.bp { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; margin-bottom: 18px; }
.bp > img { width: 64px; height: 64px; }
.bp h2 { margin: 0 0 4px; font-size: 19px; }
.bp h2 a { text-decoration: none; } .bp h2 a:hover { text-decoration: underline; }
.q-opt { display: inline-flex; flex-wrap: wrap; gap: 4px; }

/* ---------- narrow screens ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .ph-grid { grid-template-columns: minmax(0, 1fr); }
  .ph-side { position: static; order: -1; }
  .doc { grid-template-columns: minmax(0, 1fr); }
  .doc-nav { position: static; max-height: none; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .top-in { height: auto; flex-wrap: wrap; padding: 8px 12px 6px; gap: 6px 10px; }
  .nav { order: 3; width: 100%; margin: 0 -4px; }
  .nav-a { height: 28px; padding: 0 8px; font-size: 13.5px; }
  .bar { top: 0; position: static; margin: 0 -14px 16px; padding: 10px 14px; }
  .mosaic a:nth-child(n+16) { display: none; }
  .hero { padding-top: 4px; }
  .wrap { padding: 20px 14px 48px; }
  .hero h1 { font-size: 34px; }
  .three, .four, .now, .dl { grid-template-columns: 1fr; }
  .mosaic { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; padding: 12px; }
  .ph-head > img { width: 52px; height: 52px; }
  .ph-head h1 { font-size: 24px; }
  h1.title { font-size: 26px; }
  .lvl { grid-template-columns: 1fr; gap: 4px; }
  .lvl-h { padding: 0; }
  .count { margin-left: 0; width: 100%; }
  .tp { min-width: 180px; }
}

/* ---------- source view ---------- */
.code { background: var(--bg2); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); overflow-x: auto; margin-top: 14px; }
.code ol { margin: 0; padding: 10px 0; list-style: none; counter-reset: ln; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; min-width: max-content; }
.code li { counter-increment: ln; white-space: pre; padding: 0 16px 0 0; }
.code li::before { content: counter(ln); display: inline-block; width: 46px; padding-right: 14px; margin-right: 12px; text-align: right; color: var(--faint); border-right: 1px solid var(--line); user-select: none; }
.code li:hover { background: var(--wash); }

.incl { display: inline-flex; flex-direction: column; gap: 2px; min-width: 0; max-width: 100%; }
.incl .when { font-size: 11px; color: var(--muted); padding-left: 6px; font-family: var(--mono); overflow-wrap: anywhere; }
td .enf { min-width: 190px; }
dl.facts .pref .id { display: none; }
dl.facts .pref { max-width: 100%; }

/* ---------- languages: a compact menu in the header ---------- */
.langs { position: relative; margin-right: 4px; }
.langs > summary { list-style: none; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 8px 0 9px; border-radius: 7px;
  box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; font-weight: 500; letter-spacing: .03em; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.langs > summary::-webkit-details-marker { display: none; }
.langs > summary::after { content: ""; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); opacity: .7; }
.langs > summary:hover, .langs[open] > summary { color: var(--ink); background: var(--wash); }
.langs > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.langs-m { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 150px; padding: 4px; display: flex; flex-direction: column; gap: 1px;
  background: var(--bg); border-radius: 9px; box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgba(0, 0, 0, .14); }
.langs-m a { display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 10px; border-radius: 6px; font-size: 13px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.langs-m a b { min-width: 30px; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; color: var(--muted); }
.langs-m a:hover { background: var(--wash); }
.langs-m a.on { background: var(--wash); font-weight: 500; }
.langs-m a.on b { color: var(--accent); }

/* ---------- Chinese: CJK system fonts, no negative tracking, CJK line breaking ---------- */
html:lang(zh) { font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; }
html:lang(zh) body { line-break: strict; word-break: normal; overflow-wrap: break-word; }
html:lang(zh) h1, html:lang(zh) h2, html:lang(zh) h3, html:lang(zh) .brand .b1 { letter-spacing: 0; }
html:lang(zh) .hero h1 { line-height: 1.2; }
html:lang(zh) .lx-md, html:lang(zh) .lead, html:lang(zh) .sub, html:lang(zh) p { line-height: 1.75; }
html:lang(zh) .lx-md :lang(en), html:lang(zh) [lang="en"] { line-height: 1.6; }
/* text of a package shown in English on a translated page until it has a fresh translation */
.nt { position: relative; border-left: 3px solid var(--line); padding-left: 14px; }
.nt-note { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); font-style: italic; }
.nt-i { text-decoration: underline dotted var(--faint); text-underline-offset: 3px; }
.nt-src { font-size: 12.5px; margin: 6px 0 0; }
