/* CPE Study — 1950年のドット（網点）。LeetCode の2画面 × 新聞用紙 × コミックの太い黒線。
 * 色は新聞用紙の地に、シアン・マゼンタ・黄と黒だけ。 */
:root {
  color-scheme: light;
  --b-ink: #14110f; --b-yellow: #ffd83a; --b-mag: #ff2e88; --b-cyan: #12b5e5;
  --bg: #f7f0dc; --panel: #fffdf4; --panel-2: #fff0b8; --line: #14110f; --line-strong: #14110f;
  --ink: #14110f; --muted: #4a433b; --faint: #7a7165;
  --link: #0b6fc0; --link-soft: #d9f1fb;
  --easy: #0b8f6b; --med: #b76e00; --hard: #d6174f;
  --code-bg: #fff8dc;
  --tk-kw: #d6174f; --tk-ty: #0b6fc0; --tk-cm: #7a7165; --tk-st: #0b8f6b; --tk-nu: #b76e00; --tk-pp: #7a3fb0;
  --head: "Bangers", "Dela Gothic One", "Zen Maru Gothic", sans-serif;
  --serif: "Zen Maru Gothic", "Zen Kaku Gothic New", "PingFang TC", "Noto Sans TC", sans-serif;
  --sans: "Zen Maru Gothic", "Zen Kaku Gothic New", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --bar-h: 50px; --r: 8px;
}

* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: var(--panel); padding: 8px 12px; border-radius: 6px; }
.skip:focus { top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { padding: 40px; color: var(--muted); }
.mono { font-family: var(--mono); }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* 3言語ラベル: 英語が主、日本語が副、中国語が最後 */
.t3 .ja, .t3 .zh { font-size: .82em; font-weight: 400; color: var(--muted); }
.t3 .ja::before, .t3 .zh::before { content: " / "; color: var(--faint); }
.t3.c .zh { display: none; }
.t3.en-only .ja, .t3.en-only .zh { display: none; }
/* 見出しでは英語を1行目、日本語 / 中国語を小さく2行目に */
.col h2 .t3 .en, .article h1 .t3 .en, .article h2 .t3 .en, .toc h2 .t3 .en { display: block; }
.col h2 .t3 .ja, .col h2 .t3 .zh, .article h1 .t3 .ja, .article h1 .t3 .zh, .article h2 .t3 .ja, .article h2 .t3 .zh, .toc h2 .t3 .ja, .toc h2 .t3 .zh { font-size: .56em; font-family: var(--sans); }
.col h2 .t3 .ja::before, .article h1 .t3 .ja::before, .article h2 .t3 .ja::before, .toc h2 .t3 .ja::before { content: none; }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--panel-2); }
.btn.solid { background: var(--ink); color: var(--panel); border-color: var(--ink); font-weight: 700; }
.btn.solid:hover { background: var(--ink); opacity: .88; }
.btn.solid .t3 .ja, .btn.solid .t3 .zh { color: inherit; opacity: .72; }
.btn.icon { padding: 6px; min-width: 36px; }
.btn[disabled] { opacity: .35; cursor: not-allowed; }
.btn[aria-pressed="true"].solve { border-color: var(--easy); color: var(--easy); font-weight: 700; }

/* ───────── 問題画面（LeetCode の2画面） ───────── */
.ws { height: 100dvh; display: grid; grid-template-rows: var(--bar-h) minmax(0, 1fr); }
.wbar { display: flex; align-items: center; gap: 6px; padding: 0 12px; min-width: 0; }
.wlogo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-family: var(--head); font-weight: 700; font-size: 1.1rem; margin-right: 6px; }
.wbar .grow { flex: 1; }
.wprog { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); padding: 0 6px; }
.wmain { --split: 46%; --hsplit: 66%; min-height: 0; display: grid; grid-template-columns: var(--split) 8px minmax(0, 1fr); padding: 0 8px 8px; }
.pane { background: var(--panel); border-radius: var(--r); min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.pane-bar { display: flex; align-items: center; gap: 2px; padding: 0 8px; min-height: 42px; border-bottom: 1px solid var(--line); background: var(--panel-2); flex: none; overflow-x: auto; scrollbar-width: none; }
.pane-bar::-webkit-scrollbar { display: none; }
.tab { border: 0; background: transparent; padding: 10px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; min-height: 42px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }
.pane-body { flex: 1; min-height: 0; overflow: auto; }
.vsep, .hsep { position: relative; background: transparent; }
.vsep { cursor: col-resize; }
.hsep { cursor: row-resize; height: 8px; }
.vsep::after, .hsep::after { content: ""; position: absolute; border-radius: 2px; background: var(--line-strong); opacity: 0; transition: opacity .12s; }
.vsep::after { left: 3px; top: calc(50% - 22px); width: 2px; height: 44px; }
.hsep::after { top: 3px; left: calc(50% - 22px); height: 2px; width: 44px; }
.vsep:hover::after, .hsep:hover::after, .vsep:focus-visible::after, .hsep:focus-visible::after, .dragging::after { opacity: 1; }
.right { display: grid; grid-template-rows: var(--hsplit) 8px minmax(0, 1fr); min-width: 0; min-height: 0; }

/* 問題文（読み物なので明朝系） */
.desc { padding: 22px 28px 40px; max-width: 74ch; }
.ptitle { font-family: var(--head); font-weight: 700; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.2; letter-spacing: -.005em; display: flex; align-items: flex-start; gap: 10px; }
.ptitle .no { color: var(--faint); font-weight: 500; }
.ptitle .hanko { margin-left: auto; width: 40px; height: 40px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 11px; border-radius: 99px; font-size: .8rem; background: var(--panel-2); color: var(--muted); border: 1px solid transparent; min-height: 26px; }
.chip.lvl { font-weight: 700; }
.chip.lvl[data-l="1"], .chip.lvl[data-l="2"] { color: var(--easy); }
.chip.lvl[data-l="3"] { color: var(--med); }
.chip.lvl[data-l="4"] { color: var(--hard); }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.langsw { display: inline-flex; margin: 14px 0 2px; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.langsw button { border: 0; background: transparent; padding: 3px 14px; min-height: 30px; color: var(--muted); font-size: .84rem; }
.langsw button[aria-pressed="true"] { background: var(--ink); color: var(--panel); font-weight: 700; }
.prose { font-family: var(--serif); font-size: 1.06rem; line-height: 1.78; }
.prose h3 { font-family: var(--head); font-size: 1.04rem; font-weight: 700; margin: 24px 0 4px; display: flex; align-items: baseline; gap: 8px; }
.prose h3 .t3 .ja, .prose h3 .t3 .zh { font-weight: 400; }
.prose p { margin: .55em 0; }
.prose[lang="ja"] { font-size: 1.02rem; line-height: 1.9; }
.vw { text-decoration: underline dotted var(--link); text-underline-offset: 4px; text-decoration-thickness: 1.5px; cursor: help; }
.note { margin: 16px 0; padding: 10px 14px; border-left: 3px solid var(--link); background: var(--link-soft); border-radius: 0 8px 8px 0; font-size: .92rem; font-family: var(--sans); }
.sheet { margin: 10px 0; display: grid; gap: 8px; }
.sheet img { width: 100%; height: auto; display: block; background: #fff; border-radius: 6px; border: 1px solid var(--line); }
.vidwrap { margin: 14px 0 8px; display: flex; justify-content: center; }
.vid { height: clamp(300px, calc(100vh - 400px), 620px); width: auto; max-width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: 10px; border: 1px solid var(--line-strong); display: block; }
.vidnote { margin: 4px 0 0; text-align: center; font-size: .85rem; color: var(--muted); }
.vidchip .ic { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.hasvid { display: inline-flex; margin-left: 6px; vertical-align: -1px; color: var(--muted); }
.hasvid .ic { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.openpdf { margin: 10px 0 4px; }
.vtbl { margin: 14px 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.vtbl table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.vtbl td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.vtbl tr:last-child td { border-bottom: 0; }
.vtbl td:first-child { font-family: var(--serif); font-weight: 700; white-space: nowrap; color: var(--link); }
.vtbl .vnote { font-size: .8rem; color: var(--muted); }
.idea { font-family: var(--serif); font-size: 1.15rem; line-height: 1.8; margin: 16px 0; padding-left: 16px; border-left: 3px solid var(--ink); }
.patt { margin: 18px 0; }
.patt h4 { font-family: var(--serif); font-size: 1.02rem; display: flex; gap: 8px; align-items: baseline; }
.patt h4::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--pc); flex: none; transform: translateY(1px); }
.patt p { font-family: var(--serif); color: var(--muted); margin: 2px 0 0 18px; }
.patt code { display: inline-block; margin: 6px 0 0 18px; font: .8rem var(--mono); background: var(--code-bg); padding: 3px 8px; border-radius: 6px; }

/* コード欄 */
.code-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; padding-left: 8px; }
.lang { font-size: .78rem; padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--muted); font-family: var(--mono); }
.paneh { display: inline-flex; align-items: center; gap: 7px; padding: 0 8px; font-weight: 700; white-space: nowrap; }
.src { margin: 0; padding: 10px 0 24px; font: .86rem/1.7 var(--mono); tab-size: 4; background: var(--panel); counter-reset: ln; min-width: max-content; }
.src .l { display: block; padding-right: 20px; white-space: pre; }
.src .l::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 3.4em; padding-right: 1.1em; text-align: right; color: var(--faint); user-select: none; position: sticky; left: 0; background: var(--panel); }
.tk-kw { color: var(--tk-kw); } .tk-ty { color: var(--tk-ty); } .tk-cm { color: var(--tk-cm); } .tk-st { color: var(--tk-st); } .tk-nu { color: var(--tk-nu); } .tk-pp { color: var(--tk-pp); }

/* サンプル欄 */
.sample { padding: 14px 16px 20px; display: grid; gap: 14px; align-content: start; }
.field > .lab { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-bottom: 5px; }
.field pre { margin: 0; padding: 10px 14px; background: var(--panel-2); border-radius: 8px; font: .86rem/1.6 var(--mono); overflow: auto; max-height: 220px; }
.copy { border: 0; background: transparent; color: var(--muted); padding: 2px 8px; border-radius: 6px; font-size: .78rem; display: inline-flex; gap: 5px; align-items: center; min-height: 26px; }
.copy:hover { background: var(--panel-2); color: var(--ink); }
.cmd { font: .82rem/1.6 var(--mono); padding: 10px 14px; background: var(--panel-2); border-radius: 8px; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.hint { font-size: .8rem; color: var(--muted); }

/* 引き出し: Problem List */
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / 42%); z-index: 60; animation: fade .16s ease-out; }
.drawer { position: fixed; z-index: 61; left: 0; top: 0; bottom: 0; width: min(420px, 94vw); background: var(--panel); display: flex; flex-direction: column; box-shadow: 8px 0 32px rgb(0 0 0 / 28%); animation: slide .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide { from { transform: translateX(-24px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
.dh { display: flex; align-items: center; gap: 12px; padding: 16px 18px 10px; }
.dh h2 { font-family: var(--head); font-size: 1.3rem; white-space: nowrap; }
.dh .cnt { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--muted); white-space: nowrap; }
.dctl { padding: 4px 16px 10px; display: grid; gap: 10px; }
.sbox { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; background: var(--panel-2); flex: 1; min-width: 0; }
.sbox input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 9px 0; outline: none; }
.sbox:focus-within { border-color: var(--link); }
.srow { display: flex; gap: 8px; }
.fpanel { display: grid; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.fpanel .grp > .lab { font-size: .76rem; color: var(--muted); margin-bottom: 5px; }
.fpanel .wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.fpanel select { width: 100%; min-height: 34px; border: 1px solid var(--line-strong); background: var(--panel); border-radius: 8px; padding: 4px 8px; }
.pill { border: 1px solid var(--line-strong); background: var(--panel); border-radius: 99px; padding: 2px 11px; font-size: .8rem; min-height: 28px; }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.dlist { flex: 1; overflow: auto; padding: 4px 10px 24px; }
.row { width: 100%; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; text-align: left; border: 0; background: transparent; padding: 11px 12px; border-radius: 9px; }
.row:nth-child(odd) { background: var(--panel-2); }
.row:hover { background: color-mix(in srgb, var(--ink) 8%, var(--panel)); }
.row[aria-current="true"] { box-shadow: inset 3px 0 0 var(--ink); font-weight: 700; }
.row .tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .no { color: var(--faint); margin-right: 4px; font-weight: 400; }
.row .ok { color: var(--easy); }
.row .lv { font-size: .8rem; }
.lv[data-l="1"], .lv[data-l="2"] { color: var(--easy); } .lv[data-l="3"] { color: var(--med); } .lv[data-l="4"] { color: var(--hard); }
.gh { padding: 14px 14px 4px; font-family: var(--head); font-weight: 700; font-size: .95rem; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ポップオーバー（メニュー） */
.pop { position: fixed; z-index: 70; min-width: 220px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; padding: 6px; box-shadow: 0 12px 32px rgb(0 0 0 / 26%); animation: fade .12s ease-out; }
.pop a, .pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: transparent; border-radius: 8px; text-align: left; text-decoration: none; color: var(--ink); }
.pop a:hover, .pop button:hover { background: var(--panel-2); }

/* ───────── 紙面（表紙・型・PDF一覧） ───────── */
.paper { max-width: 1240px; margin: 0 auto; padding: 0 28px 64px; }
.mast { padding-top: 16px; }
.mast-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding-bottom: 14px; }
.mast-date { font-size: .82rem; color: var(--muted); line-height: 1.45; }
.mast-tools { display: flex; justify-content: flex-end; gap: 8px; }
.word { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.word b { font-family: var(--head); font-weight: 800; font-size: clamp(2rem, 4.4vw, 3.2rem); line-height: 1; letter-spacing: .01em; }
.mast-rule { border: 0; border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); height: 6px; margin: 0; }
.mast-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 22px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mast-nav a { color: var(--muted); text-decoration: none; padding: 4px 2px; border-bottom: 2px solid transparent; }
.mast-nav a:hover { color: var(--ink); }
.mast-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }

.lead { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 36px; padding: 32px 0 34px; border-bottom: 1px solid var(--ink); }
.lead-kick { color: var(--muted); font-size: .92rem; margin-bottom: 10px; }
.lead h1 { font-family: var(--head); font-weight: 700; font-size: clamp(2.3rem, 4.6vw, 4rem); line-height: 1.04; letter-spacing: -.012em; }
.lead .dek { font-family: var(--serif); font-style: italic; font-size: 1.28rem; line-height: 1.55; color: var(--muted); margin-top: 16px; max-width: 30em; }
.lead .dek[lang="ja"] { font-style: normal; font-size: 1.02rem; }
.lead .cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.lead .chips { margin-top: 18px; }
.art { position: relative; min-height: 380px; overflow: hidden; }
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.col { padding: 26px 26px 10px; border-left: 1px solid var(--line); }
.col:first-child { padding-left: 0; border-left: 0; }
.col:last-child { padding-right: 0; }
.col h2 { font-family: var(--head); font-size: 1.35rem; padding-top: 8px; border-top: 3px solid var(--ink); margin-bottom: 14px; }
.sethead { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.sethead .big { font-family: var(--head); font-size: 2.2rem; font-weight: 700; line-height: 1; }
.sethead .small { color: var(--muted); font-size: .86rem; }
.catlist { list-style: none; padding: 0; margin: 0; }
.catlist li a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.catlist li a:hover { color: var(--link); }
.catlist .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.resume h3 { font-family: var(--head); font-size: 1.5rem; line-height: 1.2; margin: 4px 0 6px; }
.resume p { color: var(--muted); font-family: var(--serif); }
.foot { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* 型の記事ページ・PDF一覧 */
.article { max-width: 820px; margin: 0 auto; padding: 34px 0 20px; }
.article h1 { font-family: var(--head); font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; }
.article .dek { font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--muted); margin: 12px 0 8px; }
.article h2 { font-family: var(--head); font-size: 1.5rem; margin: 40px 0 10px; padding-top: 8px; border-top: 3px solid var(--ink); }
.qlist { list-style: none; counter-reset: q; padding: 0; margin: 0; display: grid; gap: 18px; }
.qlist > li { counter-increment: q; display: grid; grid-template-columns: 38px 1fr; gap: 12px; }
.qlist > li::before { content: counter(q); font-family: var(--serif); font-weight: 800; font-size: 2rem; line-height: 1; color: var(--faint); }
.qlist .q { font-family: var(--head); font-weight: 700; font-size: 1.12rem; }
.qlist p { color: var(--muted); font-family: var(--serif); margin-top: 2px; }
.tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .9rem; }
.tbl th, .tbl td { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 400; font-size: .8rem; }
.tbl .mono, .tbl a { white-space: nowrap; }
.pgrid { display: grid; gap: 22px; margin-top: 8px; }
.pitem { --pc: var(--link); display: grid; gap: 6px; padding-left: 16px; border-left: 4px solid var(--pc); }
.pitem h3 { font-family: var(--head); font-size: 1.15rem; }
.pitem .one { font-family: var(--serif); font-size: 1.04rem; }
.pitem .meta { color: var(--muted); font-size: .9rem; font-family: var(--serif); }
.pitem code { font: .82rem var(--mono); background: var(--code-bg); padding: 4px 9px; border-radius: 6px; display: inline-block; width: fit-content; max-width: 100%; overflow-x: auto; }
.nums { display: flex; flex-wrap: wrap; gap: 5px; }
.nums button { border: 1px solid var(--line-strong); background: transparent; border-radius: 6px; padding: 1px 8px; min-height: 28px; font: .76rem var(--mono); }
.nums button:hover { border-color: var(--pc); }
.tier { margin-top: 16px; }
.tier h3 { font-family: var(--head); font-size: 1.1rem; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tier h3 .st { color: var(--med); letter-spacing: 1px; }
.tier .why { color: var(--muted); font-size: .9rem; font-family: var(--serif); }
.toc-row { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; }
.toc-row .lead-dots { flex: 1; border-bottom: 1px dotted var(--line-strong); transform: translateY(-4px); min-width: 20px; }
.toc-row .id { color: var(--muted); font: .78rem var(--mono); min-width: 6.2em; }
.toc-row .ttl { font-family: var(--serif); font-size: 1.06rem; color: var(--ink); text-decoration: none; }
.toc-row .ttl:hover { color: var(--link); }
.toc-row .uva { color: var(--muted); font-size: .84rem; }
.toc-row a.pdf { font-size: .84rem; }
.toc h2 { margin-top: 30px; display: flex; justify-content: space-between; align-items: baseline; }
.toc h2 .gc { font: .8rem var(--mono); color: var(--muted); }
.toc-wrap { max-width: 900px; margin: 0 auto; }
.finder { display: flex; gap: 10px; margin: 20px 0 6px; align-items: center; }

/* ───────── 1950年のドット（コミックの太線・網点・吹き出し） ───────── */
body { background-image: radial-gradient(rgba(18, 181, 229, .26) 1.3px, transparent 1.8px); background-size: 14px 14px; }
.pane, .drawer, .pop, .fpanel, .vtbl, .field pre, .cmd, .note, .sbox { border: 3px solid var(--b-ink); }
.pane { box-shadow: 5px 5px 0 var(--b-ink); }
.drawer { box-shadow: 8px 0 0 var(--b-ink); }
.pane-bar { background: var(--b-yellow); border-bottom: 3px solid var(--b-ink); }
.tab { font-weight: 700; }
.tab[aria-selected="true"] { background: var(--b-ink); color: var(--b-yellow); border-bottom-color: transparent; }
.btn { border: 3px solid var(--b-ink); box-shadow: 3px 3px 0 var(--b-ink); background: #fff; font-weight: 700; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--b-ink); background: var(--b-yellow); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--b-ink); }
.btn.solid { background: var(--b-mag); color: #fff; border-color: var(--b-ink); }
.btn.solid:hover { background: var(--b-mag); opacity: 1; filter: brightness(1.06); }
.btn[aria-pressed="true"].solve { background: var(--b-yellow); color: var(--b-ink); border-color: var(--b-ink); }
.chip, .pill { border: 2px solid var(--b-ink); background: #fff; color: var(--b-ink); font-weight: 700; }
.pill[aria-pressed="true"] { background: var(--b-cyan); color: var(--b-ink); }
.chip.lvl { background: var(--b-yellow); }
.langsw { border: 3px solid var(--b-ink); border-radius: 8px; }
.langsw button[aria-pressed="true"] { background: var(--b-mag); color: #fff; }
.ptitle { font-size: clamp(2.2rem, 3.4vw, 3.2rem); letter-spacing: .03em; text-shadow: 3px 3px 0 var(--b-yellow); font-weight: 400; line-height: 1.05; }
.ptitle .no { color: var(--b-mag); }
.word b { font-weight: 400; letter-spacing: .04em; font-size: clamp(2.6rem, 6vw, 4.8rem); text-shadow: 4px 4px 0 var(--b-yellow); }
.mast-rule { border: 0; border-top: 5px solid var(--b-ink); border-bottom: 2px solid var(--b-ink); height: 8px; }
.mast-nav { border-bottom: 3px solid var(--b-ink); }
.mast-nav a[aria-current="page"] { background: var(--b-ink); color: var(--b-yellow); padding: 4px 10px; border-bottom-color: transparent; border-radius: 6px; }
.lead { border-bottom: 3px solid var(--b-ink); }
.lead h1 { font-weight: 400; font-size: clamp(3rem, 7.4vw, 6.4rem); line-height: .96; letter-spacing: .02em; text-shadow: 4px 4px 0 var(--b-yellow), 7px 7px 0 var(--b-ink); }
.lead .dek { font-style: normal; font-family: var(--sans); font-size: 1.05rem; color: var(--b-ink); }
.col h2, .article h2 { border-top: 5px solid var(--b-ink); font-weight: 400; letter-spacing: .03em; font-size: 1.7rem; }
.col { border-left: 3px solid var(--b-ink); }
.col:first-child { border-left: 0; }
.article h1 { font-weight: 400; font-size: clamp(3rem, 7vw, 5.4rem); letter-spacing: .03em; text-shadow: 4px 4px 0 var(--b-yellow); }
.row:nth-child(odd) { background: var(--panel-2); }
.row[aria-current="true"] { background: var(--b-cyan); box-shadow: none; }
.vw { text-decoration-color: var(--b-mag); }
.art { border: 4px solid var(--b-ink); border-radius: 6px; box-shadow: 8px 8px 0 var(--b-ink); background: var(--b-yellow); }
.b-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.b-mag { animation: misreg 6s ease-in-out infinite alternate; }
@keyframes misreg { from { transform: translate(0, 0); } to { transform: translate(5px, -4px); } }
.b-bubble { position: absolute; left: 7%; top: 9%; background: #fff; border: 4px solid var(--b-ink); border-radius: 50% / 62%; padding: 10px 28px 6px; font: 400 clamp(2rem, 5vw, 3.4rem)/1 Bangers, 'Dela Gothic One', sans-serif; transform: rotate(-6deg); animation: bpop .6s cubic-bezier(.2, 1.5, .4, 1) .3s both; letter-spacing: .04em; }
.b-bubble::after { content: ""; position: absolute; left: 62%; bottom: -22px; width: 26px; height: 26px; background: #fff; border-right: 4px solid var(--b-ink); border-bottom: 4px solid var(--b-ink); transform: skewX(-20deg) rotate(35deg); }
.b-pow { position: absolute; right: 5%; bottom: 8%; background: var(--b-mag); color: #fff; border: 4px solid var(--b-ink); padding: 4px 16px 2px; font: 400 1.6rem/1.1 Bangers, sans-serif; letter-spacing: .06em; transform: rotate(4deg); box-shadow: 4px 4px 0 var(--b-ink); animation: bpop .6s cubic-bezier(.2, 1.5, .4, 1) .55s both; }
@keyframes bpop { from { transform: scale(.2) rotate(-20deg); opacity: 0; } }
.m-b { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; width: 160px; }
.m-b i { aspect-ratio: 1; border: 2px solid var(--b-ink); border-radius: 50%; background: #fff; display: block; }
.m-b i.on { background: var(--b-mag); box-shadow: inset -2px -2px 0 rgb(0 0 0 / 18%); }
.m-b.sm { width: 92px; gap: 2px; } .m-b.sm i { border-width: 1.5px; }
.badge-b { width: 74px; height: 74px; flex: none; transform: rotate(-8deg); margin-left: 6px; }
.badge-b.stamp-in { animation: bstamp .5s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes bstamp { from { transform: scale(2.2) rotate(-30deg); opacity: 0; } to { transform: scale(1) rotate(-8deg); } }
.mark-b { width: 34px; height: 34px; }


.tab[aria-selected="true"] .t3 span, .pill[aria-pressed="true"] .t3 span { color: inherit; }

/* ───────── 狭い画面 ───────── */
.mseg { display: none; }
@media (max-width: 900px) {
  :root { --bar-h: 48px; }
  .ws { grid-template-rows: var(--bar-h) auto minmax(0, 1fr); }
  .wbar { gap: 2px; padding: 0 6px; overflow-x: auto; scrollbar-width: none; }
  .wbar .lbl { display: none; }
  .wlogo span { display: none; }
  .wprog .txt { display: none; }
  .mseg { display: flex; margin: 0 8px 8px; padding: 3px; gap: 3px; background: var(--panel-2); border-radius: 10px; }
  .mseg button { flex: 1; border: 0; background: transparent; padding: 7px; border-radius: 8px; min-height: 36px; color: var(--muted); }
  .mseg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgb(0 0 0 / 14%); }
  .wmain { grid-template-columns: minmax(0, 1fr); }
  .vsep { display: none; }
  .ws[data-mpane="code"] .left { display: none; }
  .ws[data-mpane="problem"] .right { display: none; }
  .right { grid-template-rows: minmax(0, 1fr) 8px auto; }
  .desc { padding: 18px 16px 40px; }
  .mast-top { grid-template-columns: 1fr; justify-items: center; }
  .mast-date { display: none; }
  .mast-tools { justify-content: center; }
  .paper { padding: 0 16px 48px; }
  .lead { grid-template-columns: minmax(0, 1fr); gap: 22px; padding-top: 22px; }
  .art { position: relative; min-height: 380px; overflow: hidden; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .col { padding: 22px 0 6px; border-left: 0; }
  }
@media (max-width: 560px) { #pos, .wprog, .wbar [data-act="random"] { display: none; } .wbar .btn { padding: 6px 9px; } }
@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 { .wbar, .drawer, .scrim, .mseg, .vsep, .hsep { display: none !important; } .ws { height: auto; display: block; } .wmain { display: block; } }
.row[aria-current="true"] .no, .row[aria-current="true"] .lv { color: var(--b-ink); }
