/* shared headings */
.kicker { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--hl); border: 2px solid var(--ink); animation: blink 1.8s infinite; }
@keyframes blink { 50% { transform: scale(.55); } }
h1 mark, h2 mark { background: linear-gradient(transparent 12%, var(--hl) 12%, var(--hl) 88%, transparent 88%); color: var(--on-hl); padding: 0 .12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.lede { font-size: 1.12rem; max-width: 54ch; color: var(--muted); }
.sec { margin-top: 64px; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sec-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.sec-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.sec-link svg, .pick-go svg, .track-n svg, .fold-more svg, .first-sub svg, .leaf-t svg, .pg svg { width: 17px; height: 17px; }
.empty { padding: 28px 0; color: var(--muted); font-weight: 700; }
.more { display: grid; justify-items: center; gap: 12px; margin-top: 24px; }

/* ===== home: floating-card stage ===== */
.stage {
  position: relative; display: grid; padding: 10px 0 18px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 620px) minmax(0, 1fr);
  grid-template-rows: auto auto auto;
}
.sheet {
  grid-column: 2; grid-row: 1 / 4; position: relative; z-index: 1; text-align: center;
  padding: 44px 46px 34px 64px; border: 1.5px solid var(--ink); border-radius: 6px; box-shadow: var(--shadow);
  background:
    linear-gradient(90deg, transparent 40px, var(--margin-line) 40px 42px, transparent 42px),
    repeating-linear-gradient(transparent 0 31px, var(--rule) 31px 32px),
    var(--sheet);
}
.holes { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); width: 70%; height: 12px; background: radial-gradient(circle at 6px 6px, var(--paper) 4px, color-mix(in srgb, var(--ink) 40%, transparent) 4.5px 5.5px, transparent 6px) 0 0 / 34px 12px space no-repeat; }
.sheet .kicker { margin-top: 6px; }
.sheet h1 { font-size: clamp(2.4rem, 4.2vw, 3.7rem); line-height: .98; letter-spacing: -0.045em; }
.sheet .lede { margin: 18px auto 0; font-size: 1.04rem; max-width: 44ch; }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }

.note { position: relative; z-index: 2; border: 1.5px solid var(--ink); border-radius: 4px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transform: rotate(var(--r, 0deg)); transition: transform .35s var(--ease), box-shadow .35s; }
a.note:hover, .note:focus-within { transform: rotate(0deg) translateY(-3px); z-index: 3; }
.tape { position: absolute; top: -13px; left: 50%; width: 86px; height: 24px; transform: translateX(-50%) rotate(-4deg); background: var(--tape); clip-path: polygon(0 12%, 6% 0, 12% 14%, 88% 4%, 94% 16%, 100% 4%, 100% 88%, 94% 100%, 88% 86%, 12% 96%, 6% 84%, 0 100%); pointer-events: none; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 18px 20px 14px; width: 150px; }
.stat b { font: 800 2.6rem/1 var(--font-display); letter-spacing: -0.04em; }
.stat .mono { color: var(--muted); font-size: .66rem; }
.s-a { grid-column: 1; grid-row: 1; justify-self: center; align-self: center; margin-right: -10px; --r: -5deg; background: var(--clay); }
.s-b { grid-column: 3; grid-row: 1; justify-self: start; align-self: start; margin: 26px 0 0 -16px; --r: 4deg; background: var(--hl); color: var(--on-hl); }
.s-b .mono { color: color-mix(in srgb, var(--on-hl) 70%, transparent); }
.s-c { grid-column: 3; grid-row: 2; justify-self: end; align-self: center; margin: 4px 30px 0 0; --r: -3deg; background: var(--sheet); }
.s-c .tape { background: var(--tape-2); }
.first { grid-column: 3; grid-row: 3; justify-self: start; align-self: end; margin: 0 0 6px -22px; display: flex; flex-direction: column; gap: 4px; width: 236px; padding: 20px 20px 16px; --r: 2deg; background: var(--umber); color: var(--on-umber); }
.first .mono { opacity: .8; font-size: .66rem; }
.first strong { font: 800 1.45rem/1.05 var(--font-display); letter-spacing: -.02em; }
.first-sub { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; }
.first .tape { background: var(--tape-2); }
.s-lab { grid-column: 1; grid-row: 2 / 4; justify-self: end; align-self: end; margin: 16px -34px 0 0; width: 330px; --r: -1.6deg; }

/* chain lab (now a taped card) */
.lab { background: var(--lab-bg); color: var(--lab-fg); padding: 16px 16px 14px; border-radius: 6px; }
.lab .tape { background: var(--tape); }
.lab-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--hl); }
.lab-head h2 { font-size: .74rem; letter-spacing: .08em; }
.lab-chain { display: flex; flex-wrap: wrap; gap: 4px 3px; align-content: flex-start; min-height: 74px; padding: 8px; border: 1.5px dashed color-mix(in srgb, var(--lab-fg) 30%, transparent); border-radius: 10px; }
.bead { position: relative; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font: 800 .74rem var(--font-display); color: #2a1d16; animation: bead .35s var(--ease) both; animation-delay: var(--d); }
.lab-chain.big .bead { width: 18px; height: 18px; font-size: .56rem; }
.s0, .k0 { background: #c3d4ff; } .s1, .k1 { background: #e7d6c8; } .s2, .k2 { background: #f6f4f7; } .s3, .k3 { background: #d9a77a; }
@keyframes bead { from { transform: scale(0); } }
.lab-class { font: 800 1.25rem/1.1 var(--font-display); margin: 10px 0 2px; color: var(--hl); }
.lab-note { margin: 0 0 10px; color: color-mix(in srgb, var(--lab-fg) 82%, transparent); font-size: .8rem; line-height: 1.4; min-height: 2.8em; }
.lab-keys { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.key { aspect-ratio: 1; border: 0; border-radius: 8px; font: 800 .92rem var(--font-display); color: #2a1d16; transition: transform .15s; }
.key:hover { transform: translateY(-2px); } .key:active { transform: scale(.92); }
.lab-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.lab .btn { color: var(--lab-fg); border-color: color-mix(in srgb, var(--lab-fg) 45%, transparent); }
.lab :focus-visible { outline-color: var(--hl); box-shadow: 0 0 0 5px color-mix(in srgb, var(--hl) 45%, transparent); }

/* ===== home: fold-out ledger (five folded strips, one open) ===== */
.folds { margin-top: 8px; }
.fold-row { display: flex; height: 236px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--sheet); box-shadow: var(--shadow); overflow: hidden; }
.fold { display: flex; min-width: 0; flex: 0 0 52px; border-right: 1.5px solid var(--ink); transition: flex-grow .45s var(--ease); }
.fold:last-child { border-right: 0; }
.fold.open { flex: 1 1 auto; }
.fold-tab {
  flex: 0 0 52px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 0; border: 0; border-radius: 0;
  background: linear-gradient(90deg, transparent 55%, color-mix(in srgb, var(--ink) 9%, transparent)), var(--clay);
  color: var(--ink); text-align: left;
}
.fold:nth-child(2) .fold-tab { background-color: var(--lilac); } .fold:nth-child(3) .fold-tab { background-color: var(--hl); color: var(--on-hl); }
.fold:nth-child(4) .fold-tab { background-color: var(--sheet); } .fold:nth-child(5) .fold-tab { background-color: var(--clay); }
.fold-tab:hover .fold-name { text-decoration: underline; text-decoration-color: var(--umber); text-decoration-thickness: 2px; }
.fold.open .fold-tab { background: var(--umber); color: var(--on-umber); }
.fold-tab:focus-visible { outline-offset: -4px; }
.fold-l { font-size: .7rem; }
.fold-name { writing-mode: vertical-rl; transform: rotate(180deg); font: 800 1rem/1 var(--font-display); letter-spacing: -.01em; white-space: nowrap; }
.fold-body { flex: 1; min-width: 0; padding: 18px 22px; display: flex; flex-direction: column; gap: 10px; }
.fold-body.anim { animation: unfold .45s var(--ease); }
@keyframes unfold { from { opacity: .2; transform: translateX(-12px); } }

.pick { display: grid; grid-template-columns: 300px 1fr; gap: 22px; height: 100%; text-decoration: none; }
.pick img { width: 100%; height: 100%; min-height: 0; object-fit: cover; border: 1.5px solid var(--ink); transition: transform .35s var(--ease); }
.pick:hover img { transform: rotate(-1.5deg); }
.pick-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; justify-content: center; min-width: 0; }
.pick-copy strong { font: 800 clamp(1.4rem, 2.2vw, 1.9rem)/1.05 var(--font-display); letter-spacing: -.02em; }
.pick-ex { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 60ch; }
.pick-go { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; text-decoration: underline; text-decoration-color: var(--hl); text-decoration-thickness: 5px; text-underline-offset: 2px; }

.minis { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; column-gap: 22px; border-top: 2px solid var(--ink); }
.mini { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 4px 8px; border-bottom: 1px solid var(--line); text-decoration: none; min-width: 0; transition: background .2s, color .2s; }
.mini-n { color: var(--umber); }
.mini-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mini-topic { font-size: .6rem; color: var(--muted); }
.mini:hover .mini-topic { color: var(--hl); }
.mini-main strong { font: 800 1rem/1.2 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mini-t { color: var(--muted); font-size: .64rem; white-space: nowrap; }
.mini:hover { background: var(--ink); color: var(--paper); } .mini:hover .mini-n, .mini:hover .mini-t { color: var(--hl); } .mini:hover .tag { border-color: currentColor; }
.fold-more { align-self: flex-end; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .9rem; }

.tracks { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.track { display: flex; flex-direction: column; justify-content: space-between; gap: 2px; padding: 10px 14px; border: 1.5px solid var(--ink); border-radius: 10px; text-decoration: none; background: var(--panel); transition: transform .25s var(--ease); min-width: 0; }
.track:hover { transform: translateY(-3px) rotate(-.6deg); }
.track strong { font: 800 1.12rem/1.1 var(--font-display); }
.track .mono { font-size: .62rem; opacity: .75; }
.track-n { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: .82rem; }
.track.mint { background: var(--clay); } .track.lime { background: var(--hl); color: var(--on-hl); }
.track.green { background: var(--umber); color: var(--on-umber); } .track.ink { background: var(--ink); color: var(--paper); }

.myths { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.myth { position: relative; display: block; text-align: left; height: 100%; min-height: 170px; padding: 0; border: 0; background: none; perspective: 900px; border-radius: 8px; }
.myth-face { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1.5px solid var(--ink); border-radius: 8px; backface-visibility: hidden; transition: transform .6s var(--ease); overflow: hidden; }
.myth-face.front { background: var(--panel); } .myth-face.front strong { font: 800 1.08rem/1.18 var(--font-display); flex: 1; }
.myth-tap { color: var(--umber); font-size: .62rem; }
.myth-face.back { background: var(--hl); color: var(--on-hl); transform: rotateY(180deg); font-weight: 600; font-size: .8rem; line-height: 1.42; }
.myth[aria-pressed='true'] .front { transform: rotateY(-180deg); } .myth[aria-pressed='true'] .back { transform: rotateY(0); }
.myth:hover .front { background: var(--clay); }

.top5 { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); flex: 1; display: grid; grid-auto-rows: 1fr; }
.top5 a { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; height: 100%; padding: 0 8px; border-bottom: 1px solid var(--line); text-decoration: none; font: 800 1.02rem/1.2 var(--font-display); }
.top5-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.top5 a:hover { background: var(--ink); color: var(--paper); }
.top5 .mono { color: var(--umber); } .top5 a:hover .mono, .top5 a:hover em { color: var(--hl); }
.top5 em { font: 600 .7rem var(--font-mono); font-style: normal; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

/* home on narrower screens: the cards gather under the page instead of around it */
@media (max-width: 1179px) {
  .stage { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: auto; gap: 26px 14px; padding-bottom: 26px; }
  .sheet { grid-column: 1 / -1; grid-row: 1; }
  .note { margin: 0 !important; justify-self: stretch !important; align-self: stretch !important; width: auto; }
  .s-a { grid-column: 1; grid-row: 2; } .s-b { grid-column: 2; grid-row: 2; } .s-c { grid-column: 3; grid-row: 2; } .first { grid-column: 4; grid-row: 2; }
  .s-lab { grid-column: 1 / -1; grid-row: 3; justify-self: center !important; width: min(520px, 100%); }
}
@media (max-width: 760px) {
  .stage { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 10px; }
  .sheet { padding: 36px 18px 24px 30px; background: linear-gradient(90deg, transparent 16px, var(--margin-line) 16px 18px, transparent 18px), repeating-linear-gradient(transparent 0 31px, var(--rule) 31px 32px), var(--sheet); }
  .sheet h1 { font-size: clamp(2.1rem, 9.6vw, 2.8rem); }
  .sheet .lede { font-size: .98rem; }
  .hero-cta { flex-wrap: nowrap; gap: 8px; } .hero-cta .btn { padding: 9px 14px; font-size: .9rem; }
  .stat { padding: 14px 10px 10px; } .stat b { font-size: 1.9rem; } .stat .mono { font-size: .58rem; }
  .s-c { display: none !important; } .s-a { grid-column: 1; } .s-b { grid-column: 2; } .first { grid-column: 3; padding: 14px 10px 10px; }
  .first strong { font-size: 1.02rem; } .first-sub { font-size: .74rem; } .first .mono { font-size: .58rem; }
  .s-lab { grid-row: 3; }
  .fold-row { flex-direction: column; height: auto; }
  .fold { flex: none; flex-direction: column; border-right: 0; border-bottom: 1.5px solid var(--ink); }
  .fold:last-child { border-bottom: 0; }
  .fold.open { flex: none; }
  .fold-tab { flex: none; flex-direction: row; gap: 12px; padding: 12px 16px; background-image: linear-gradient(transparent 55%, color-mix(in srgb, var(--ink) 8%, transparent)); }
  .fold-name { writing-mode: horizontal-tb; transform: none; }
  .fold-body { padding: 14px; animation: none; }
  .pick { grid-template-columns: 1fr; gap: 12px; } .pick img { height: 110px; }
  .minis { grid-template-columns: 1fr; } .mini { padding: 10px 4px; }
  .tracks { grid-template-columns: 1fr 1fr; } .track { padding: 10px; }
  .myths { grid-template-columns: 1fr 1fr; } .myth { min-height: 190px; }
  .top5 a { padding: 10px 4px; grid-template-columns: 30px 1fr auto; } .top5-t { white-space: normal; }
}

/* ===== page heads ===== */
.page-head { padding-top: 22px; }
.page-head h1 { font-size: clamp(2.3rem, 5vw, 4rem); margin-bottom: 18px; letter-spacing: -0.045em; }
.page-head.narrow { max-width: 760px; }
.lib-search { margin-bottom: 16px; font: 700 clamp(1.05rem, 2vw, 1.35rem) var(--font-display); padding: 14px 18px; }
.lib-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
#lib-count { margin: 14px 0; }

/* ===== first fold (leporello path) ===== */
.leporello { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); filter: drop-shadow(0 16px 20px rgba(42, 29, 22, .18)); }
.leaf a {
  display: flex; flex-direction: column; gap: 10px; height: 100%; min-height: 330px; padding: 22px 18px; text-decoration: none;
  border: 1.5px solid var(--ink); border-left-width: 0; transition: transform .3s var(--ease);
}
.leaf:first-child a { border-left-width: 1.5px; border-radius: 6px 0 0 6px; } .leaf:last-child a { border-radius: 0 6px 6px 0; }
.leaf.l0 a { background: linear-gradient(90deg, var(--sheet), color-mix(in srgb, var(--sheet) 82%, var(--ink))); transform: skewY(1.6deg); }
.leaf.l1 a { background: linear-gradient(90deg, color-mix(in srgb, var(--clay) 80%, var(--ink)), var(--clay)); transform: skewY(-1.6deg); }
.leaf a:hover { transform: skewY(0) translateY(-6px); }
.leaf-n { font: 800 3.2rem/1 var(--font-display); color: var(--umber); letter-spacing: -.04em; }
.leaf .tag { align-self: flex-start; }
.leaf strong { font: 800 1.2rem/1.15 var(--font-display); }
.leaf-why { color: var(--muted); font-size: .9rem; flex: 1; }
.leaf-t { display: inline-flex; align-items: center; gap: 6px; }
.after-path { margin-top: 34px; display: grid; gap: 10px; }
@media (max-width: 900px) {
  .leporello { grid-template-columns: 1fr; filter: none; gap: 0; }
  .leaf a { min-height: 0; border-left-width: 1.5px; border-top-width: 0; transform: none !important; display: grid; grid-template-columns: 56px 1fr; column-gap: 12px; row-gap: 4px; padding: 16px; }
  .leaf:first-child a { border-top-width: 1.5px; border-radius: 6px 6px 0 0; } .leaf:last-child a { border-radius: 0 0 6px 6px; }
  .leaf-n { grid-row: 1 / 6; font-size: 2.2rem; }
  .leaf.l0 a { background: linear-gradient(var(--sheet), color-mix(in srgb, var(--sheet) 88%, var(--ink))); }
  .leaf.l1 a { background: linear-gradient(color-mix(in srgb, var(--clay) 86%, var(--ink)), var(--clay)); }
}

/* ===== article ===== */
.art-head { padding-top: 22px; }
.crumbs { display: flex; gap: 8px; margin-bottom: 16px; } .crumbs a { text-decoration-thickness: 2px; }
.art-head h1 { font-size: clamp(2.2rem, 5vw, 4.2rem); max-width: 20ch; letter-spacing: -0.045em; }
.art-ex { font-size: 1.22rem; max-width: 58ch; color: var(--muted); margin: 18px 0; }
.art-meta { clear: both; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 14px 0; border-block: 2px dotted var(--ink); margin-bottom: 24px; }
.share { display: inline-flex; gap: 8px; margin-left: auto; }
/* Cover is a small taped snapshot beside the title, so the text starts on the first screen. */
.art-cover { position: relative; float: right; width: 280px; margin: 6px 0 18px 36px; padding: 8px; background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 4px; transform: rotate(1.6deg); box-shadow: 4px 5px 0 color-mix(in srgb, var(--ink) 14%, transparent); }
.art-cover img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; border: 1px solid var(--line); }
.art-grid { display: grid; grid-template-columns: 250px minmax(0, 720px); gap: 54px; margin-top: 44px; justify-content: center; }
.art-grid.no-toc { grid-template-columns: minmax(0, 760px); }
.chain-toc { position: sticky; top: 24px; align-self: start; }
.chain-toc ol { --fill: 0%; list-style: none; margin: 14px 0 0; padding: 0 0 0 26px; position: relative; display: grid; gap: 14px; }
.chain-toc ol::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 3px; background: linear-gradient(var(--umber) var(--fill), var(--line) var(--fill)); }
.chain-toc a { position: relative; display: block; text-decoration: none; font-weight: 700; font-size: .92rem; line-height: 1.3; color: var(--muted); transition: color .2s; }
.chain-toc a i { position: absolute; left: -26px; top: 2px; width: 17px; height: 17px; border-radius: 50%; background: var(--paper); border: 3px solid var(--line); transition: all .25s var(--ease); }
.chain-toc a.past i { border-color: var(--umber); background: var(--umber); }
.chain-toc a.on { color: var(--ink); } .chain-toc a.on i { border-color: var(--ink); background: var(--hl); transform: scale(1.3); }
.chain-toc .mono { margin-right: 4px; color: var(--umber); }
.sources { margin-top: 2.4em; padding: 18px 22px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--sheet); font-size: .95rem; }
.sources h2 { font-size: 1.3rem; margin: 0 0 .6em; } .sources h2::before { display: none; }
.sources ol { margin: 0; padding-left: 1.3em; } .sources a { word-break: break-word; }
.art-disclaimer { margin-top: 3em; padding-top: 16px; border-top: 2px dotted var(--ink); color: var(--muted); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 54px; }
.pg { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--sheet); text-decoration: none; box-shadow: var(--shadow); transition: transform .25s var(--ease), background .2s; }
.pg .mono { display: inline-flex; align-items: center; gap: 6px; color: var(--umber); }
.pg strong { font: 800 1.2rem/1.2 var(--font-display); }
.pg.next { text-align: right; align-items: flex-end; }
.pg:hover { transform: translateY(-3px); background: var(--clay); }

/* ===== glossary ===== */
.gl-group { display: grid; grid-template-columns: 96px 1fr; gap: 18px; padding: 20px 0; border-top: 2px solid var(--ink); scroll-margin-top: 16px; }
.gl-letter { font: 800 4.2rem/.8 var(--font-display); color: var(--hl); -webkit-text-stroke: 2px var(--ink); }
.gl-group dl { margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 32px; }
.gl-item dt { font: 800 1.15rem var(--font-display); } .gl-item dd { margin: 4px 0 0; color: var(--muted); font-size: .94rem; }
#gl-letters { margin-top: 4px; }

/* ===== about ===== */
.rules { display: grid; grid-template-columns: repeat(4, 1fr); border: 1.5px solid var(--ink); border-radius: 6px; background: var(--sheet); overflow: hidden; }
.rule { padding: 22px; border-right: 1.5px solid var(--ink); } .rule:last-child { border-right: 0; }
.rule h3 { font-size: 1.4rem; margin: 10px 0; } .rule p { color: var(--muted); font-size: .94rem; margin: 0; } .rule .mono { color: var(--umber); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
.term { background: var(--ink); color: var(--paper); padding: 26px; border-radius: 8px; }
.term.alt { background: var(--clay); color: var(--ink); border: 1.5px solid var(--ink); }
.term h3 { font-size: 1.9rem; margin: 10px 0; color: var(--hl); } .term.alt h3 { color: var(--umber); }
.term .btn { border-color: currentColor; color: inherit; }
:root[data-theme='dark'] .term:not(.alt) { background: var(--panel); border: 1.5px solid var(--line); color: var(--ink); }

/* ===== misc pages ===== */
.nf { padding: 60px 0; } .nf h1 { font-size: clamp(3rem, 9vw, 6.5rem); margin-bottom: 22px; }
.auth { display: grid; place-items: center; padding: 40px 0; }
.auth-card { width: min(440px, 100%); background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 8px; padding: 30px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 2.4rem; margin-bottom: 8px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tiles div { background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 8px; padding: 16px 20px; display: flex; flex-direction: column; }
.tiles b { font: 800 2.6rem/1 var(--font-display); }
.adm { width: 100%; border-collapse: collapse; background: var(--panel); border: 1.5px solid var(--ink); margin: 0; }
.adm th, .adm td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.adm th { background: var(--ink); color: var(--paper); font: 600 .72rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.table-wrap { overflow-x: auto; }
.acts { white-space: nowrap; text-align: right !important; }
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.ed-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ed-checks { display: flex; gap: 22px; margin-top: 14px; font-weight: 700; }
.ed-count { float: right; color: var(--muted); letter-spacing: 0; text-transform: none; }
.ed-actions { display: flex; gap: 10px; margin-top: 20px; }
.ed-preview { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--panel); border: 1.5px solid var(--ink); border-radius: 8px; padding: 22px; }
.ed-preview .prose { font-size: 1rem; }

/* ===== responsive ===== */
@media (max-width: 980px) {
  .split, .editor { grid-template-columns: 1fr; }
  .rules { grid-template-columns: 1fr 1fr; } .rule:nth-child(2) { border-right: 0; } .rule:nth-child(-n+2) { border-bottom: 1.5px solid var(--ink); }
  .art-grid { grid-template-columns: minmax(0, 1fr); } .chain-toc { display: none; }
  .ed-preview { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .top-actions .lbl-text, .top-actions .kbd { display: none; }
  #open-search, #go-subscribe { width: 40px; height: 40px; padding: 0; }
  .top-actions { gap: 6px; }
  .gl-group { grid-template-columns: 1fr; } .gl-group dl { grid-template-columns: 1fr; } .gl-letter { font-size: 3rem; }
  .rules, .tiles { grid-template-columns: 1fr; } .rule { border-right: 0 !important; border-bottom: 1.5px solid var(--ink); } .rule:last-child { border-bottom: 0; }
  .sec { margin-top: 48px; } .ed-two { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; } .pg.next { text-align: left; align-items: flex-start; }
  .share { margin-left: 0; }
  .art-cover { width: 42%; margin: 4px 0 10px 16px; padding: 5px; }
  .art-cover .tape { width: 54px; height: 16px; top: -9px; }
}

/* grid children must be allowed to shrink on narrow screens */
.stage > *, .split > *, .editor > *, .art-grid > *, .pick > * { min-width: 0; }
