/* ModAstera Journals — "a scientific journal for what-ifs", set like a technology magazine: black on white, heavy sans headlines,
   monospaced labels, hard rules and square corners. The generative covers carry the color; the page around them stays
   monochrome, with one signal color taken from the red dot in the logo. */

:root {
  --paper: #ffffff;
  --paper-2: #f2f2f2;
  --surface: #ffffff;
  --ink: #000000;
  --ink-2: #262626;
  --muted: #6b6b6b;
  --rule: #e0e0e0;
  --rule-strong: #000000;
  --field: #8c8c8c;
  --accent: #e0301e;
  --accent-ink: #ffffff;
  --accent-soft: #fdebe8;
  --crazy: #ec4d2c;
  --romance: #b33ad1;
  --like: #2f3fd8;
  --warn-bg: #fff3cd;
  --warn-ink: #6b4500;
  --note-bg: #f2f2f2;
  --note-ink: #262626;
  --ok: #12804a;
  --footer-bg: #000000;
  --shadow: 0 18px 40px -18px rgb(0 0 0 / .35);
  --radius: 0;
  --display: "Inter", "Noto Sans JP", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
  --sans: "Inter", "Noto Sans JP", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  --serif: "Newsreader", "Noto Sans JP", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", "Noto Sans JP", ui-monospace, "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}
/* Reading text: a serif for English, gothic for Japanese. Set on each element by its own language, so a Japanese column
   next to an English one gets its own face. */
:root, :lang(en) { --text: var(--serif); }
:lang(ja) { --text: var(--sans); }

/* Dark theme: follows the OS setting unless the reader picks one with the header button (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #000000; --paper-2: #151515; --surface: #0b0b0b; --ink: #ffffff; --ink-2: #e6e6e6; --muted: #9c9c9c;
    --rule: #2c2c2c; --rule-strong: #ffffff; --field: #6e6e6e; --accent: #ff5a3c; --accent-ink: #000000; --accent-soft: #3b140d;
    --crazy: #ff7a5c; --romance: #d57bff; --like: #8f9bff;
    --warn-bg: #3a2a0c; --warn-ink: #ffd18a; --note-bg: #151515; --note-ink: #e6e6e6; --ok: #4cd18c; --footer-bg: #0b0b0b;
    --shadow: 0 18px 40px -18px rgb(0 0 0 / .8);
    color-scheme: dark;
  }
  /* category inks are tuned for white; lift them on black */
  :root:not([data-theme="light"]) .kicker::before { background: color-mix(in srgb, var(--cat, var(--accent)) 60%, white); }
  :root:not([data-theme="light"]) .paper-section .num { border-top-color: color-mix(in srgb, var(--cat, var(--ink)) 60%, white); }
}
:root[data-theme="dark"] {
    --paper: #000000; --paper-2: #151515; --surface: #0b0b0b; --ink: #ffffff; --ink-2: #e6e6e6; --muted: #9c9c9c;
    --rule: #2c2c2c; --rule-strong: #ffffff; --field: #6e6e6e; --accent: #ff5a3c; --accent-ink: #000000; --accent-soft: #3b140d;
    --crazy: #ff7a5c; --romance: #d57bff; --like: #8f9bff;
    --warn-bg: #3a2a0c; --warn-ink: #ffd18a; --note-bg: #151515; --note-ink: #e6e6e6; --ok: #4cd18c; --footer-bg: #0b0b0b;
    --shadow: 0 18px 40px -18px rgb(0 0 0 / .8);
    color-scheme: dark;
}
:root[data-theme="dark"] .kicker::before { background: color-mix(in srgb, var(--cat, var(--accent)) 60%, white); }
:root[data-theme="dark"] .paper-section .num { border-top-color: color-mix(in srgb, var(--cat, var(--ink)) 60%, white); }

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* the hidden attribute always wins over component display rules */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:where(.text, .legal, .help, .notice, .ai-notes, .footnote, .lede) a:hover { color: var(--accent); }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 clamp(16px, 2.5vw, 40px); }
.narrow { max-width: 760px; margin: 0 auto; }
.mono { font-family: var(--mono); font-size: .85em; letter-spacing: .02em; }
/* Japanese headings break between phrases, not mid-word, and set their kana proportionally */
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3 { word-break: auto-phrase; }
h1:lang(ja), h2:lang(ja), h3:lang(ja), b:lang(ja) { font-feature-settings: "palt"; }

/* ---------- masthead ---------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--rule-strong); position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; flex-wrap: wrap; padding-block: 10px; }
.brand { text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { display: inline-flex; align-items: center; gap: 9px; background: var(--ink); color: var(--paper); padding: 7px 12px 7px 8px; font: 800 21px/1 var(--display); letter-spacing: .02em; white-space: nowrap; transition: background .15s; }
.brand:hover .brand-mark { background: var(--accent); }
.brand-logo { width: 24px; height: 24px; flex: none; }
.brand-sub { font: 500 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.brand-sub:lang(ja) { font-weight: 700; letter-spacing: .08em; }
.nav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.nav a:not(.btn) { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.nav a:not(.btn):hover { color: var(--accent); }
.nav .linkish { font: 600 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; color: var(--ink); }
.nav .linkish:hover { color: var(--accent); }
.me { display: inline-flex; align-items: center; gap: 8px; }
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; display: inline-block; box-shadow: 0 0 0 1px var(--rule-strong); }
.avatar-sm svg { display: block; width: 100%; height: 100%; }
.lang-switch { display: inline-flex; border: 1px solid var(--rule-strong); }
.lang-switch button { border: 0; background: none; padding: 6px 9px; font: 600 11px/1 var(--mono); letter-spacing: .08em; cursor: pointer; color: var(--ink); }
.lang-switch button + button { border-left: 1px solid var(--rule-strong); }
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.theme-btn { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--rule-strong); background: none; color: var(--ink); cursor: pointer; padding: 0; }
.theme-btn:hover { background: var(--ink); color: var(--paper); }
.theme-btn svg { width: 15px; height: 15px; }

main { padding-block: 28px 64px; min-height: 60vh; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--rule-strong); background: var(--paper); padding: 10px 18px; cursor: pointer; text-decoration: none; color: var(--ink); font: 700 13px/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; transition: background .15s, color .15s, border-color .15s; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.accent:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.small { padding: 7px 12px; font-size: 12px; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: none; color: var(--ink); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; pointer-events: none; }
.linkish { background: none; border: 0; color: var(--ink); cursor: pointer; padding: 0; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; font-size: inherit; }
.linkish:hover { color: var(--accent); }

/* ---------- kickers, badges, meta ---------- */
/* Kicker: the field, in monospaced capitals after a square of the field's color. */
.kicker { display: inline-flex; align-items: center; gap: 7px; font: 500 11px/1.25 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.kicker::before { content: ""; width: 8px; height: 8px; flex: none; background: var(--cat, var(--accent)); }
.kicker:lang(ja) { font-weight: 700; letter-spacing: .06em; }
.badge { display: inline-flex; align-items: center; gap: 6px; font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 5px 8px 4px; border: 1px solid currentColor; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; background: currentColor; }
.badge:lang(ja) { font-weight: 700; letter-spacing: .04em; }
.badge.ai { color: var(--ok); }
.badge.ai_edited { color: var(--like); }
.badge.raw { color: var(--warn-ink); background: var(--warn-bg); border-color: transparent; }
.badge.plain::before { display: none; }
.badge.plain { color: var(--muted); border-color: var(--rule); }
.byline { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font: 500 11px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.byline .sep { color: var(--rule); }
.byline a { color: var(--ink); text-decoration: none; font-weight: 600; }
.byline a:hover { color: var(--accent); }

/* ---------- lists of papers ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 18px; padding-top: 10px; border-top: 3px solid var(--rule-strong); }
.section-head h2 { font: 600 12px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; margin: 0; }
.section-head h2:lang(ja) { font-weight: 700; letter-spacing: .08em; font-size: 13px; }
.tabs { display: inline-flex; gap: 18px; overflow-x: auto; max-width: 100%; border-bottom: 1px solid var(--rule); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 8px 0 6px; cursor: pointer; color: var(--muted); white-space: nowrap; font: 600 11.5px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button:lang(ja) { font-weight: 700; letter-spacing: .04em; font-size: 12.5px; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 36px; }
.card { display: grid; grid-template-columns: 132px 1fr; gap: 18px; text-decoration: none; color: var(--ink); padding: 18px 0; border-bottom: 1px solid var(--rule); }
.card .cover { aspect-ratio: 1; height: auto; align-self: start; }
.card .body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card h3, .tile h3, .row-body b, .rank-body b { overflow-wrap: anywhere; } /* a long URL in a title must not run into the next column */
.card h3 { font: 800 19px/1.25 var(--display); letter-spacing: -.015em; margin: 0; }
.card h3:lang(ja) { font-weight: 700; font-size: 17px; line-height: 1.5; letter-spacing: .01em; }
.card:hover h3, .tile:hover h3, .row-card:hover b, .rank-list a:hover b { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cover { display: block; width: 100%; height: 100%; overflow: hidden; background: var(--paper-2); }
.cover svg { display: block; width: 100%; height: 100%; }

/* reaction meters (pop accent) */
.meters { display: flex; gap: 10px; align-items: center; font: 600 11.5px/1 var(--mono); }
.meter { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.meter i { font-style: normal; font-size: 12px; }
.meter.like i { color: var(--like); } .meter.crazy i { color: var(--crazy); } .meter.romance i { color: var(--romance); }

/* ---------- paper page ---------- */
/* The cover runs edge to edge under the masthead, like a feature's opening spread. */
.post-hero { width: auto; height: clamp(180px, 30vw, 380px); margin: -28px calc(-1 * clamp(16px, 2.5vw, 40px)) 34px; }
.post-head { max-width: 760px; margin: 0 auto; }
.post-head .kicker { background: var(--cat, var(--ink)); color: #fff; padding: 6px 9px 5px; }
.post-head .kicker::before { display: none; }
.post-head h1 { font: 800 clamp(34px, 5vw, 58px)/1.06 var(--display); letter-spacing: -.03em; margin: 18px 0 16px; }
.post-head h1:lang(ja) { font-weight: 900; font-size: clamp(28px, 4.2vw, 46px); line-height: 1.32; letter-spacing: .01em; }
.post-head h1 .title-sub { display: block; margin-top: .4em; font-size: .5em; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; color: var(--ink-2); }
.post-head h1:lang(ja) .title-sub { font-size: .56em; line-height: 1.55; letter-spacing: .02em; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.post-head .lede { font: 400 clamp(18px, 2.2vw, 22px)/1.5 var(--text); color: var(--ink-2); margin: 0; }
.meta-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule); padding: 14px 0; margin: 26px 0 18px; }
.meta-grid dt { font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.meta-grid dt:lang(ja) { font-weight: 700; letter-spacing: .06em; font-size: 10.5px; }
.meta-grid dd { margin: 0; font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.meta-grid dd a { color: var(--ink); text-decoration: none; }
.meta-grid dd a:hover { color: var(--accent); }
.post-body { max-width: 760px; margin: 0 auto; }
/* Segmented switches: the 1px gaps over a dark background draw the rules, also between wrapped rows. */
.view-toggle { display: inline-flex; gap: 1px; background: var(--rule-strong); border: 1px solid var(--rule-strong); max-width: 100%; overflow-x: auto; }
.mode-toggle { margin: 4px 0 12px; flex-wrap: wrap; }
.mode-toggle button { flex: 1 1 auto; }
.quick-q { min-height: 110px; font-size: 16px; }
.quick-memo { font-size: 15px; }
#stage[data-compose="quick"] #do-skip, #stage[data-compose="quick"] .still-post, #stage:not([data-compose="quick"]) .quick-no-ai { display: none; }
.view-toggle button { border: 0; background: var(--paper); padding: 8px 14px; cursor: pointer; font: 600 11.5px/1.2 var(--mono); letter-spacing: .06em; color: var(--ink); white-space: nowrap; }
.view-toggle button:lang(ja) { font-weight: 700; letter-spacing: .02em; font-size: 12.5px; }
.view-toggle button:hover { background: var(--paper-2); }
.view-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.notice { padding: 11px 14px; font-size: 13.5px; margin-top: 12px; line-height: 1.6; border-left: 3px solid currentColor; }
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); }
.notice.info { background: var(--note-bg); color: var(--note-ink); border-left-color: var(--ink); }
/* The abstract reads as the dek: larger text under a heavy rule. */
.abstract { margin: 22px 0 4px; padding-top: 14px; border-top: 3px solid var(--rule-strong); }
.abstract h2 { font: 600 11px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.abstract h2:lang(ja) { font-weight: 700; letter-spacing: .08em; }
.abstract .text { font: 400 20px/1.6 var(--text); color: var(--ink-2); }
.abstract .text:lang(ja) { font-size: 17px; line-height: 1.9; font-weight: 500; }
.abstract .text p, .paper-section .text p { margin: 0 0 .9em; }
.abstract .text p:last-child, .paper-section .text p:last-child { margin-bottom: 0; }
.paper-section { display: grid; grid-template-columns: 48px 1fr; gap: 6px 20px; margin-top: 44px; }
.paper-section .num { align-self: start; padding-top: 8px; border-top: 3px solid var(--cat, var(--ink)); font: 600 12px/1 var(--mono); letter-spacing: .08em; color: var(--ink); }
.paper-section h2 { font: 800 23px/1.25 var(--display); letter-spacing: -.02em; color: var(--ink); margin: 0 0 14px; }
.paper-section h2:lang(ja) { font-weight: 700; font-size: 20px; line-height: 1.45; letter-spacing: .02em; }
.paper-section .text { font: 400 19px/1.72 var(--text); white-space: pre-line; overflow-wrap: anywhere; color: var(--ink); }
.paper-section .text:lang(ja) { font-size: 17px; line-height: 1.95; letter-spacing: .02em; }
.paper-section.first .text::first-letter { float: left; font: 800 3.5em/.8 var(--display); margin: .06em .1em 0 0; color: var(--ink); }
.paper-section.first .text:lang(ja)::first-letter { float: none; font: inherit; margin: 0; color: inherit; }

/* Side by side: the translation next to the original */
.bilingual .post-head, .bilingual .post-body { max-width: 1280px; }
.title-alt { font: 500 clamp(18px, 2.4vw, 24px)/1.4 var(--display); color: var(--muted); margin: -4px 0 14px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.cols .col + .col { border-left: 1px solid var(--rule); padding-left: 28px; }
.col-tag { font: 600 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.bilingual .paper-section .text { font-size: 17px; line-height: 1.72; }
.bilingual .paper-section .text:lang(ja) { font-size: 16px; line-height: 1.9; }
.bilingual .abstract .text { font-size: 17px; }
@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; gap: 14px; }
  .cols .col + .col { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 14px; }
}

/* Reactions: three cells joined by rules; a pressed one fills with its color. */
.reactions { display: grid; grid-template-columns: repeat(3, 1fr); margin: 44px 0 16px; border: 1px solid var(--rule-strong); }
.react { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 16px; border: 0; background: none; cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.react + .react { border-left: 1px solid var(--rule-strong); }
.react:hover { background: var(--paper-2); }
.react .ico { font-size: 18px; line-height: 1; color: var(--c); }
.react b { font: 800 30px/1 var(--display); letter-spacing: -.02em; }
.react span { font: 600 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.react[data-kind="like"] { --c: var(--like); }
.react[data-kind="crazy"] { --c: var(--crazy); }
.react[data-kind="romance"] { --c: var(--romance); }
.react[aria-pressed="true"] { background: var(--c); color: #fff; }
.react[aria-pressed="true"] .ico, .react[aria-pressed="true"] span { color: rgb(255 255 255 / .9); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.spacer { flex: 1; }
.footnote { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--rule); margin-top: 30px; padding-top: 14px; line-height: 1.6; }
.footnote sup { color: var(--accent); font-weight: 700; margin-right: 4px; }

.media { max-width: 760px; margin: 40px auto 0; }
.media h2 { font: 600 12px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 14px; padding-top: 10px; border-top: 3px solid var(--rule-strong); }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.img-item figure { margin: 0; }
.img-item img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); }
.img-item figcaption { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-top: 6px; gap: 6px; color: var(--muted); }
.video-frame { aspect-ratio: 16/9; width: 100%; border: 0; margin-top: 12px; }
.video-missing { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--rule); margin-top: 12px; }

/* ---------- forms ---------- */
.page-title { font: 800 clamp(32px, 4.6vw, 52px)/1.06 var(--display); letter-spacing: -.03em; margin: 6px 0 10px; }
.page-title:lang(ja) { font-weight: 900; line-height: 1.3; letter-spacing: .01em; font-size: clamp(28px, 4vw, 44px); }
.page-sub { color: var(--muted); margin: 0 0 24px; }
.form-section { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--rule-strong); padding: 22px; margin-bottom: 18px; }
.form-section h2 { display: flex; align-items: center; gap: 10px; font: 800 19px/1.3 var(--display); letter-spacing: -.01em; margin: 0 0 6px; }
.form-section h2:lang(ja) { font-weight: 700; letter-spacing: .02em; }
.form-section h2 .n { width: 28px; height: 28px; display: inline-grid; place-items: center; font: 600 13px/1 var(--mono); color: var(--paper); background: var(--ink); flex: none; }
.help { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; }
label.field { display: block; margin-top: 14px; font-weight: 700; font-size: 13.5px; }
label.field input, label.field textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 13px; border: 1px solid var(--field); border-radius: 0; background: var(--paper); font-weight: 400; font-size: 15px; transition: border-color .15s; }
label.field input:focus, label.field textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }
label.field textarea { min-height: 96px; resize: vertical; line-height: 1.7; font-family: var(--text); font-size: 16.5px; }
label.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; font-size: 14px; }
label.check input { margin-top: 4px; accent-color: var(--ink); width: 16px; height: 16px; }
.status { font-size: 13.5px; margin-top: 10px; }
.status.err { color: var(--accent); }
.status.ok { color: var(--ok); }
details.orig { margin-top: 12px; font-size: 14px; }
details.orig summary { cursor: pointer; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
details.orig pre { white-space: pre-wrap; font: 13.5px/1.65 var(--sans); background: var(--paper-2); padding: 12px; border: 1px solid var(--rule); }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.thumbs figure { margin: 0; width: 120px; font-size: 11px; }
.thumbs img { width: 120px; height: 86px; object-fit: cover; border: 1px solid var(--rule); }

/* ---------- profile ---------- */
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; padding-bottom: 22px; border-bottom: 3px solid var(--rule-strong); }
.avatar { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; flex: none; box-shadow: 0 0 0 1px var(--rule-strong); }

/* ---------- dialog ---------- */
dialog { border: 2px solid var(--rule-strong); background: var(--surface); color: var(--ink); padding: 24px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 80px -20px rgb(0 0 0 / .5); }
dialog::backdrop { background: rgb(0 0 0 / .6); }
dialog h2 { margin-top: 0; font: 800 21px/1.3 var(--display); letter-spacing: -.01em; }
dialog h2:lang(ja) { font-weight: 700; letter-spacing: .02em; }
#card-canvas { width: 100%; height: auto; display: block; border: 1px solid var(--rule); }

/* ---------- footer ---------- */
.site-footer { background: var(--footer-bg); color: #fff; border-top: 1px solid var(--rule-strong); padding: 32px 0 44px; margin-top: 40px; }
.site-footer .ad-slot { background: #141414; border-color: #2c2c2c; color: #8a8a8a; }
.footer-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-top: 30px; padding-bottom: 18px; border-bottom: 1px solid #333; }
.footer-mark { font: 800 clamp(30px, 6vw, 64px)/1 var(--display); letter-spacing: .01em; color: #fff; text-decoration: none; }
.footer-mark:hover { color: var(--accent); }
.footer-top .colophon { font: 700 clamp(17px, 2vw, 22px)/1.35 var(--display); color: #fff; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-top: 16px; }
.footer-sub { font: 500 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #8a8a8a; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #b3b3b3; text-decoration: none; }
.footer-links a:hover { color: #fff; }
.ad-slot { background: var(--paper-2); border: 1px solid var(--rule); height: 90px; display: grid; place-items: center; color: var(--muted); font: 500 10px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; }

/* ---------- admin ---------- */
.queue-item { background: var(--surface); border: 1px solid var(--rule); padding: 12px 14px; margin-bottom: 10px; }
.queue-item.p1 { border-left: 4px solid var(--crazy); }
.queue-item.p2 { border-left: 4px solid #f59e0b; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }


/* ---------- sign-in, sharing, drafts, legal, metrics ---------- */
.btn.google { width: 100%; padding: 12px 16px; font: 600 14px/1.2 var(--sans); letter-spacing: 0; text-transform: none; gap: 10px; background: #fff; color: #1f1f1f; border-color: #dadce0; border-radius: 4px; }
.btn.google:hover { background: #fff; color: #1f1f1f; border-color: #9aa0a6; }
details.dev-login { margin-top: 16px; border-top: 1px dashed var(--rule); padding-top: 10px; font-size: 13.5px; }
details.dev-login summary { cursor: pointer; color: var(--muted); }
.share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 14px; }
.share-grid .btn { width: 100%; }
.btn.share-x { background: #0f1419; border-color: #0f1419; color: #fff; }
.btn.share-line { background: #06c755; border-color: #06c755; color: #fff; }
.btn.share-x:hover, .btn.share-line:hover { opacity: .85; }
.draft-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 0; }
.draft-list li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.draft-list a { font: 700 16px/1.4 var(--display); color: var(--ink); text-decoration: none; }
.draft-list a:hover { color: var(--accent); }
.legal h2 { font: 800 20px/1.35 var(--display); letter-spacing: -.01em; margin: 32px 0 8px; }
.legal h2:lang(ja) { font-weight: 700; letter-spacing: .02em; }
.legal p, .legal li { font: 400 16.5px/1.8 var(--text); color: var(--ink-2); }
.legal ul { padding-left: 1.2em; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 22px; }
.kpi { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--rule-strong); padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.kpi b { font: 800 30px/1 var(--display); letter-spacing: -.02em; }
.kpi span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.stats-grid section { background: var(--surface); border: 1px solid var(--rule); padding: 14px; }
.stats-grid h3 { font: 600 11.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
table.stats { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.stats td { padding: 6px 4px; border-bottom: 1px solid var(--rule); }
table.stats td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.ad-slot[data-ads] { border: 0; background: none; height: auto; min-height: 90px; display: block; }

/* ---------- user menu ---------- */
.user-menu { position: relative; }
button.me { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--ink); font: inherit; font-size: 13.5px; }
button.me:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.me-name { font: 600 12px/1 var(--mono); letter-spacing: .04em; }
.me .caret { font-size: 10px; color: var(--muted); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 10px); width: min(300px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--rule-strong); box-shadow: var(--shadow); z-index: 30; overflow: hidden; }
.menu-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.menu-status { display: grid; gap: 4px; padding: 0 16px 12px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--rule); }
.menu-status .ok { color: var(--ok); font-weight: 600; }
.menu-status .wait { color: var(--warn-ink); font-weight: 600; }
.menu-panel nav { display: grid; padding: 6px; }
.menu-panel nav a, .menu-panel nav button { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; color: var(--ink); text-decoration: none; font: inherit; font-size: 14px; background: none; border: 0; cursor: pointer; text-align: left; }
.menu-panel nav a:hover, .menu-panel nav button:hover, .menu-panel nav a:focus-visible, .menu-panel nav button:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
.menu-panel nav button { color: var(--muted); border-top: 1px solid var(--rule); margin-top: 4px; }
.menu-panel .count { font: 600 11px/1 var(--mono); color: var(--ink); background: var(--paper-2); padding: 3px 7px; }

/* ---------- account pages ---------- */
.private-note { color: var(--muted); margin: -6px 0 18px; }
.my-rating { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; font-size: 12px; }
.settings { display: grid; gap: 16px; }
.settings .form-section h2 { margin-top: 0; }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0; font-size: 14.5px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.form-section.danger { border-color: color-mix(in srgb, var(--crazy) 45%, var(--rule)); border-top-color: var(--crazy); }
.btn.danger { background: var(--crazy); border-color: var(--crazy); color: #fff; }
.btn.danger:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- site banner, topics, notices ---------- */
.site-banner { font-size: 13.5px; text-align: center; padding: 8px 16px; line-height: 1.5; }
.site-banner.info { background: var(--ink); color: var(--paper); }
.site-banner.warn { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
/* A topic (a prompt for papers) is the one block printed in reverse. */
.topic-banner { display: grid; gap: 6px; padding: 18px 22px; margin: 0 0 24px; text-decoration: none; color: var(--paper); background: var(--ink); }
.topic-banner .kicker, .topic-head .kicker { justify-self: start; }
.topic-banner .kicker { color: var(--paper); }
.topic-banner .kicker::before { background: var(--accent); }
.topic-banner b { font: 800 clamp(20px, 2.6vw, 28px)/1.25 var(--display); letter-spacing: -.015em; }
.topic-banner b:lang(ja) { font-weight: 700; letter-spacing: .02em; line-height: 1.45; }
.topic-banner .byline { color: color-mix(in srgb, var(--paper) 65%, transparent); }
.topic-banner:hover b { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.topic-head { display: grid; gap: 10px; justify-items: start; padding-bottom: 22px; margin-bottom: 26px; border-bottom: 3px solid var(--rule-strong); max-width: 760px; }
.topic-head .lede { font: 400 18px/1.7 var(--text); color: var(--ink-2); }
.topic-head .lede p { margin: 0 0 .7em; }
.notice-item { background: var(--surface); border: 1px solid var(--rule); padding: 14px 18px; margin-bottom: 12px; display: grid; gap: 6px; }
.notice-item.unread { border-left: 4px solid var(--accent); }
.notice-item p { margin: 0; }
.notice-post { font: 700 17px/1.4 var(--display); }
.muted { color: var(--muted); }
.menu-panel .count.alert { background: var(--accent); color: var(--accent-ink); }
button.me.has-unread .avatar-sm { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent); }

/* ---------- admin frame (spec 5.2): a thin admin bar instead of the reader header, a grouped menu beside the screen ---------- */
html.admin-mode .site-header, html.admin-mode .site-footer, html.admin-mode #site-banner { display: none !important; }
html.admin-mode main#app { max-width: none; padding: 0; min-height: 100vh; }
.admin-shell { --bar-h: 48px; --nav-w: 220px; }
.admin-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: var(--bar-h); padding: 0 16px; background: var(--ink); color: var(--paper); }
.admin-bar svg, .admin-nav svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.admin-brand { display: inline-flex; align-items: baseline; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.admin-brand b { font: 800 15px/1 var(--display); letter-spacing: .16em; }
.admin-brand span { font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; opacity: .75; }
.admin-brand span:lang(ja) { font-weight: 700; letter-spacing: .06em; }
.admin-brand:hover b { color: var(--accent); }
.adm-who { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-width: 0; font: 500 12px/1 var(--mono); opacity: .85; }
.adm-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-who svg { width: 15px; height: 15px; }
.adm-site { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 10px; border: 1px solid color-mix(in srgb, var(--paper) 45%, transparent); color: inherit; text-decoration: none; font: 700 12px/1 var(--sans); white-space: nowrap; }
.adm-site svg { width: 14px; height: 14px; }
.adm-site:hover { background: var(--paper); color: var(--ink); }
.adm-burger { display: none; place-items: center; width: 36px; height: 36px; margin-left: -8px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.adm-burger svg { width: 22px; height: 22px; }
.admin-frame { display: flex; align-items: stretch; }
.admin-nav { position: sticky; top: var(--bar-h); flex: none; display: flex; flex-direction: column; width: var(--nav-w); height: calc(100vh - var(--bar-h)); overflow-y: auto; padding: 8px; background: var(--paper-2); border-right: 1px solid var(--rule); }
.nav-group { display: grid; gap: 1px; padding: 6px 0; }
.nav-group + .nav-group { border-top: 1px solid var(--rule); }
.nav-g { padding: 4px 10px; font: 600 10.5px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.nav-g:lang(ja) { font-weight: 700; letter-spacing: .06em; }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--ink-2); text-decoration: none; font: 600 14px/1.3 var(--sans); }
.nav-item:hover { background: var(--surface); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--ink); color: var(--paper); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-n { display: inline-flex; gap: 4px; }
.nav-n span { min-width: 22px; padding: 3px 6px; text-align: center; font: 600 11px/1 var(--mono); background: var(--surface); color: var(--ink); border: 1px solid var(--rule); }
.nav-n span.alert { background: var(--crazy); border-color: var(--crazy); color: #fff; }
.nav-item[aria-current="page"] .nav-n span:not(.alert) { background: var(--paper); border-color: var(--paper); }
.nav-fold { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 8px 10px; border: 0; border-top: 1px solid var(--rule); background: none; color: var(--muted); font: 600 12.5px/1.3 var(--sans); text-align: left; cursor: pointer; }
.nav-fold span:first-child { width: 18px; text-align: center; font-size: 15px; }
.nav-fold:hover { color: var(--ink); }
.adm-scrim { display: none; }
.admin-main { flex: 1; min-width: 0; padding: 20px clamp(16px, 2.5vw, 32px) 64px; }
.adm-h1 { margin: 0 0 14px; font: 800 22px/1.25 var(--display); letter-spacing: -.01em; }
.adm-h1:lang(ja) { font-weight: 700; letter-spacing: .02em; }
.admin-shell.locked .admin-nav, .admin-shell.locked .adm-burger { display: none; }
/* Folded to icons (wide screens only); a dot stands for the counts, red when something is urgent. */
@media (min-width: 761px) {
  .admin-shell.folded .admin-nav { width: 56px; padding-inline: 6px; }
  .admin-shell.folded .nav-label, .admin-shell.folded .nav-g { display: none; }
  .admin-shell.folded .nav-item, .admin-shell.folded .nav-fold { justify-content: center; padding-inline: 0; }
  .admin-shell.folded .nav-n { position: absolute; top: 4px; right: 6px; }
  .admin-shell.folded .nav-n span { min-width: 0; width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; font-size: 0; background: var(--ink); }
  .admin-shell.folded .nav-n span.alert { background: var(--crazy); }
  .admin-shell.folded .nav-item[aria-current="page"] .nav-n span:not(.alert) { background: var(--paper); }
  .admin-shell.folded .nav-n span + span { display: none; }
}
/* Phones: the menu is a drawer opened with ☰. */
@media (max-width: 760px) {
  .adm-burger { display: grid; }
  .admin-brand span, .adm-site span { display: none; }
  .admin-nav { position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(280px, 85vw); height: auto; box-shadow: var(--shadow); transform: translateX(-100%); visibility: hidden; transition: transform .2s, visibility .2s; }
  .admin-shell.drawer-open .admin-nav { transform: none; visibility: visible; }
  .admin-shell.drawer-open .adm-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgb(0 0 0 / .45); }
  .nav-fold { display: none; }
  .admin-main { padding-top: 16px; }
}
@media (prefers-reduced-motion: reduce) { .admin-nav { transition: none; } }

/* Dashboard (spec 4.2–4.4, phase 1): the alert band across the top, then "to do" and the latest actions side by side. */
.dash { display: grid; gap: 16px; max-width: 1180px; }
.dash-alerts { display: grid; gap: 6px; }
.dash-alert { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border: 1px solid var(--rule); border-left-width: 4px; background: var(--surface); font-size: 14.5px; font-weight: 600; }
.dash-alert .msg { flex: 1 1 240px; min-width: 0; }
.dash-alert .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.dash-alert.red { border-color: var(--crazy); background: color-mix(in srgb, var(--crazy) 10%, var(--surface)); }
.dash-alert.red .dot { background: var(--crazy); }
.dash-alert.yellow { border-color: #d97706; background: var(--warn-bg); color: var(--warn-ink); }
.dash-alert.yellow .dot { background: #d97706; }
.dash-alert.yellow .btn { color: var(--ink); }
.dash-alert.ok { border-color: var(--ok); color: var(--ok); }
.dash-alert.ok .dot { background: var(--ok); }
.dash-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.dash-box { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--rule-strong); padding: 12px 16px 14px; }
.dash-box h2 { margin: 0 0 6px; font: 600 12px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.dash-box h2:lang(ja) { font-weight: 700; letter-spacing: .08em; font-size: 13px; }
.todo { list-style: none; margin: 0; padding: 0; }
.todo a { display: flex; align-items: center; gap: 14px; padding: 10px 6px; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.todo li:last-child a { border-bottom: 0; }
.todo a:hover { background: var(--paper-2); }
.todo b { min-width: 2.4ch; text-align: right; font: 800 26px/1 var(--display); font-variant-numeric: tabular-nums; }
.todo a.urgent b { color: var(--crazy); }
.todo .what { flex: 1; min-width: 0; font-weight: 600; }
.todo .go { color: var(--muted); }
.dash-log { list-style: none; margin: 0 0 10px; padding: 0; font-size: 13px; }
.dash-log li { padding: 7px 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.dash-log .mono { display: block; color: var(--muted); font-size: 11.5px; }
@media (max-width: 1000px) { .dash-cols { grid-template-columns: minmax(0, 1fr); } }

/* ---------- admin screens ---------- */
.tabs.small { margin-bottom: 12px; }
.admin .bad { color: var(--crazy); }
.admin .good { color: var(--ok); }
.admin .big { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.adm-title { margin: 6px 0 2px; font: 700 17px/1.4 var(--display); }
.adm-title a { color: var(--ink); }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pre { white-space: pre-wrap; }
/* Toasts after an admin change: solid colours so they stand out in both themes (white text, contrast 4.5:1 or more). */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; display: flex; align-items: flex-start; gap: 10px; width: max-content; max-width: min(560px, calc(100vw - 32px));
  padding: 12px 18px; border-radius: 8px; color: #fff; font-size: 15px; font-weight: 600; line-height: 1.5; box-shadow: 0 8px 24px rgb(0 0 0 / .3);
  opacity: 0; transform: translate(-50%, 12px); transition: opacity 0.2s, transform 0.2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: #12804a; }
.toast.warn { background: #b45309; }
.toast.err { background: #c62828; }
.toast-icon { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgb(255 255 255 / .25); font-size: 13px; font-weight: 800; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
.reason-form[hidden] { display: none; }
.reason-form { margin-top: 10px; padding: 12px; background: var(--paper-2); display: grid; gap: 8px; }
.reason-form .field { margin: 0; }
.adm-search { display: flex; gap: 8px; margin-bottom: 16px; }
.adm-search input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); font: inherit; }
.adm-users { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.adm-notices { font-size: 13px; color: var(--muted); padding-left: 1.2em; }
.rep-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.rep-edit input[data-res] { flex: 1 1 220px; min-width: 0; padding: 7px 10px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; }
.rep-edit select, .admin select { padding: 7px 10px; border: 1px solid var(--field); border-radius: 0; background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; }
.ops { display: grid; gap: 16px; }
.meter-row { display: flex; align-items: center; gap: 10px; }
.meter-bar { flex: 1; max-width: 260px; height: 8px; background: var(--rule); overflow: hidden; }
.meter-bar span { display: block; height: 100%; background: var(--ink); }
.switch { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 14.5px; border-bottom: 1px solid var(--rule); }
.switch:last-child { border-bottom: 0; }
.switch input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.limits { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.limits .field { margin: 0; flex: 1 1 160px; }
.export { align-items: center; margin-bottom: 8px; }
.table-wrap { overflow-x: auto; }
table.stats.log td { font-size: 12.5px; vertical-align: top; }
@media (max-width: 600px) { .two-col { grid-template-columns: 1fr; } }

/* Production board: eight columns side by side, scrolled sideways; on a phone, one column (or "your turn") at a time. */
.board-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.board-head .check { margin: 0; }
.board-head .btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.board-col { background: var(--paper-2); padding: 8px; min-height: 120px; display: grid; gap: 8px; align-content: start; }
.board-col h3 { display: flex; justify-content: space-between; margin: 2px 2px 4px; font: 700 12.5px/1.3 var(--sans); }
.board-col h3 .n { font: 600 12px/1 var(--mono); color: var(--muted); }
.board .mine-col, .board-tabs { display: none; }
.card-tile { display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--rule-strong); padding: 10px; color: var(--ink); text-decoration: none; }
.card-tile:hover { border-color: var(--ink); }
.card-tile.flagged, .card-head.flagged { border-left-color: var(--crazy); background: color-mix(in srgb, var(--crazy) 8%, var(--surface)); }
.card-tile.hold { opacity: .65; }
.card-tile.done, .card-tile.cancelled { border-left-color: var(--rule); }
.card-title { font: 700 14px/1.45 var(--display); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-tile .next, .card-head .next { font-size: 12.5px; color: var(--ink-2); }
.card-head .next { font-size: 14px; margin: 4px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 11.5px; }
.chips b { font-weight: 700; margin-right: 2px; }
.chip { display: inline-block; padding: 2px 6px; border: 1px solid var(--rule); font-size: 11.5px; white-space: nowrap; }
.chip.posted { border-color: var(--ok); color: var(--ok); }
.chip.manual { border-style: dashed; }
.chip.stopped, .chip.needs_removal { border-color: var(--crazy); color: var(--crazy); font-weight: 700; }
.chip.skipped, .chip.removed { color: var(--muted); }
.board-closed { margin-top: 18px; }
.board-closed summary { cursor: pointer; font-weight: 700; font-size: 13.5px; }
.closed-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 10px; }
.card-page { max-width: 860px; }
.card-head { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--rule-strong); padding: 14px 16px; margin-bottom: 16px; }
.card-head .card-title { font-size: 20px; -webkit-line-clamp: unset; margin: 6px 0 0; }
.paper-view details { border-top: 1px solid var(--rule); padding: 8px 0; }
.paper-view summary { cursor: pointer; font-weight: 700; }
.paper-view h3 { font: 700 18px/1.4 var(--display); margin: 10px 0; }
.paper-view h4 { font-size: 12.5px; color: var(--muted); margin: 14px 0 4px; }
.paper-view p { margin: 0; font-family: var(--text); line-height: 1.75; }
fieldset.checks { border: 1px solid var(--rule); padding: 8px 14px 12px; margin: 16px 0 0; }
fieldset.checks legend { font-weight: 700; font-size: 13.5px; padding: 0 6px; }
.post-row { border-top: 1px solid var(--rule); padding: 10px 0; }
.post-row .actions { margin-top: 8px; }
.post-row input[type="url"], .post-row input[type="number"] { flex: 1 1 200px; min-width: 0; padding: 7px 10px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; }
.post-row input[type="number"] { flex: 0 1 96px; }
.stats-form summary { cursor: pointer; font-size: 13px; margin-top: 6px; }
video.vertical { display: block; max-width: 100%; max-height: 70vh; background: #000; margin: 8px 0; }
label.field.inline { display: flex; align-items: center; gap: 8px; margin: 0; }
@media (max-width: 760px) {
  .board-tabs { display: inline-flex; }
  .board { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; }
  .board-col { display: none; }
  .board .board-col.on { display: grid; }
  .board-col h3 { display: none; }
}

/* ---------- AI editorial notes, keywords, citation ---------- */
.keywords { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.keywords b { font: 600 10.5px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.keywords span, .keywords a { border: 1px solid var(--rule-strong); padding: 2px 9px; color: var(--ink); text-decoration: none; font-size: 12.5px; }
.keywords a:hover { background: var(--ink); color: var(--paper); }
/* The AI editor's box: a gray panel under a heavy rule, clearly apart from the paper. */
.history { margin: 36px 0 8px; padding-top: 14px; border-top: 1px solid var(--rule-strong); }
.history h2 { font: 600 12.5px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 10px; }
.history h2:lang(ja) { font-weight: 700; letter-spacing: .08em; font-size: 13px; }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.history-list li:last-child { border-bottom: 0; }
.history-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.history-head time { font: 500 12.5px/1.4 var(--mono); color: var(--muted); }
.history-list p { margin: 4px 0 0; font-size: 15px; line-height: 1.6; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-ink); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; }
.revision h2 { margin: 12px 0 8px; }
.revision h3 { font: 700 15px/1.5 var(--display); margin: 16px 0 4px; }
.ai-notes { margin: 44px 0 8px; padding: 18px 22px 14px; border-top: 3px solid var(--rule-strong); background: var(--paper-2); }
.ai-notes-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 6px; }
.ai-notes-head h2 { font: 600 12.5px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; margin: 0; }
.ai-notes-head h2:lang(ja) { font-weight: 700; letter-spacing: .08em; font-size: 13px; }
.ai-notes-head .badge { color: var(--ink); }
.ai-notes h3 { font: 600 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; margin: 20px 0 8px; color: var(--muted); }
.ai-notes h3:lang(ja) { font-weight: 700; letter-spacing: .06em; }
.ai-notes ol, .ai-notes ul { margin: 0; padding-left: 1.4em; }
.ai-notes li { margin: 4px 0; line-height: 1.7; color: var(--ink-2); }
.ai-notes .concepts { margin: 0; display: grid; gap: 10px; }
.ai-notes .concepts dt { font-weight: 700; color: var(--ink); }
.ai-notes .concepts dd { margin: 2px 0 0; color: var(--ink-2); line-height: 1.65; }
.ai-notes .refs a { overflow-wrap: anywhere; }
.ai-notes .refs .byline { display: inline; margin-left: 4px; font-size: 10.5px; }
.ai-notes .review ol { list-style: none; padding: 0; display: grid; gap: 8px; }
.ai-notes .review li { position: relative; padding: 10px 14px 10px 42px; background: var(--paper); border: 1px solid var(--rule); margin: 0; }
.ai-notes .review li::before { content: "?"; position: absolute; left: 12px; top: 10px; width: 20px; height: 20px; display: grid; place-items: center; font: 700 12px/1 var(--mono); background: var(--ink); color: var(--paper); }
.form-section .ai-notes { margin: 8px 0 20px; }
.cite { margin: 30px 0 0; padding-top: 12px; border-top: 1px solid var(--rule-strong); }
.cite h2 { font: 600 11px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.cite h2:lang(ja) { font-weight: 700; letter-spacing: .06em; }
.cite-row { display: flex; gap: 10px; align-items: flex-start; }
.cite-row code { flex: 1; min-width: 0; font: 400 12.5px/1.6 var(--mono); overflow-wrap: anywhere; background: var(--paper-2); border: 1px solid var(--rule); padding: 8px 12px; }
.ai-steps { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 4px; }
.ai-steps li { color: var(--muted); padding-left: 24px; position: relative; }
.ai-steps li::before { content: "○"; position: absolute; left: 4px; }
.ai-steps li.done { color: var(--ink-2); }
.ai-steps li.done::before { content: "✓"; color: var(--ok); }
.ai-steps li.now { color: var(--ink); font-weight: 700; }
.ai-steps li.now::before { content: "●"; color: var(--accent); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .3; } to { opacity: 1; } }
@media (max-width: 640px) {
  .ai-notes { padding: 14px 14px 10px; }
  .cite-row { flex-direction: column; }
}

/* ---------- print / PDF: the paper only ---------- */
@media print {
  :root, :root[data-theme], :root:not([data-theme="light"]) { --paper: #fff; --paper-2: #fff; --surface: #fff; --ink: #111; --ink-2: #222; --muted: #555; --rule: #bbb; --rule-strong: #333; }
  body { background: #fff !important; color: #111; }
  .site-header, .site-footer, #site-banner, .post-hero, #views, .reactions, .actions, .media, #cite-copy, .theme-btn { display: none !important; }
  .post-head, .post-body { max-width: none; }
  .paper-section, .ai-notes, .abstract { break-inside: avoid; }
  .ai-notes { border: 1px solid #bbb; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- the author's notes before the AI (readers; closed by default) ---------- */
.memo { margin: 24px 0 8px; border: 1px solid var(--rule-strong); padding: 0 20px; }
.memo summary { cursor: pointer; padding: 14px 0; font: 600 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.memo summary:lang(ja) { font-weight: 700; letter-spacing: .04em; font-size: 13px; }
.memo[open] { padding-bottom: 14px; }
.memo h3 { font: 700 17px/1.5 var(--display); margin: 6px 0 4px; }
.memo h4 { font: 600 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px; }
.memo .text p { margin: 0 0 6px; line-height: 1.75; color: var(--ink-2); font-family: var(--text); }
@media print { .memo:not([open]) { display: none; } }
/* A paper that cannot be edited by hand is shown as text; under the memo the AI rewrites from, "post without AI" hints don't apply. */
.paper-view { padding: 4px 20px 14px; }
.memo-editor .still-post, .memo-editor .quick-no-ai { display: none; }

/* ---------- news-style layout ---------- */
/* second header row: date, sections, search */
.section-nav { border-top: 1px solid var(--rule); background: var(--paper); }
.section-row { display: flex; align-items: center; gap: 16px; min-height: 42px; }
.dateline { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
/* the sections scroll sideways when they don't fit; the right edge fades out to say so */
.sections { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
.sections::-webkit-scrollbar { display: none; }
.sections a { padding: 13px 10px 10px; font: 600 11.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
.sections a:lang(ja) { font-weight: 700; letter-spacing: .04em; font-size: 12.5px; }
.sections a:hover { color: var(--accent); }
.sections a[aria-current="page"] { border-bottom-color: var(--accent); }
.search-box { display: flex; align-items: center; border: 1px solid var(--rule-strong); background: var(--paper); padding: 0 2px 0 10px; }
.search-box input { border: 0; background: none; color: var(--ink); font: inherit; font-size: 13px; width: 150px; padding: 6px 0; outline: none; }
.search-box button { border: 0; background: none; color: var(--ink); cursor: pointer; font-size: 17px; padding: 2px 6px; }
.search-box:focus-within { outline: 2px solid var(--ink); outline-offset: -1px; }
/* home */
.intro-band { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; margin: 0 0 24px; border-bottom: 1px solid var(--rule); }
.intro-band p { margin: 0; font-size: 14px; color: var(--ink-2); }
.intro-band b { font: 800 18px/1.3 var(--display); letter-spacing: -.01em; color: var(--ink); margin-right: 8px; }
.intro-band b:lang(ja) { font-weight: 900; letter-spacing: .02em; }
.intro-band .btn { flex-shrink: 0; white-space: nowrap; }
.label-line, .box-head h2 { font: 600 12px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); padding-top: 10px; margin: 0 0 14px; border-top: 3px solid var(--rule-strong); }
.label-line:lang(ja), .box-head h2:lang(ja) { font-weight: 700; letter-spacing: .08em; font-size: 13px; }
/* Front page: lead story, editors' picks and the ranking, in columns divided by hairlines. */
.front { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, .95fr); gap: 28px; padding-bottom: 32px; border-bottom: 1px solid var(--rule-strong); margin-bottom: 32px; }
.front > * + * { border-left: 1px solid var(--rule); padding-left: 28px; }
.front-picks { display: grid; align-content: start; }
.box .help { margin: 0 0 10px; }
.tabs.small { margin-bottom: 6px; }
.tabs.small button { font-size: 11px; }
.tabs.small button:lang(ja) { font-size: 12px; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li + li { border-top: 1px solid var(--rule); }
.rank-list a { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 12px 0; text-decoration: none; color: var(--ink); }
.rank-n { font: 800 26px/1 var(--display); letter-spacing: -.03em; color: var(--ink); }
.rank-list li:nth-child(1) .rank-n { color: var(--accent); }
.rank-body b { display: block; font: 700 15px/1.4 var(--display); letter-spacing: -.005em; }
.rank-body b:lang(ja) { font-size: 14.5px; line-height: 1.5; }
.rank-body .byline { font-size: 10.5px; margin-top: 4px; }
.tile { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); min-width: 0; }
.tile .cover { aspect-ratio: 16 / 9; height: auto; overflow: hidden; display: block; margin-bottom: 4px; flex: none; }
/* Cards in a row line up part by part: every cover keeps its 16:9 shape, and the title and subtitle lines take the height of the
   longest in the row, so a short title leaves room under it instead of stretching its cover (a card without a subtitle keeps an
   empty one). */
@supports (grid-template-rows: subgrid) {
  .tiles > .tile { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 8px; align-content: start; }
  .tiles > .tile .cover { align-self: start; }
}
.tile .cover svg { width: 100%; height: auto; aspect-ratio: 16 / 9; display: block; }
.tile h3 { font: 800 18px/1.28 var(--display); letter-spacing: -.015em; margin: 0; }
.tile h3:lang(ja) { font-weight: 700; font-size: 17px; line-height: 1.5; letter-spacing: .01em; }
.tile p { margin: 0; color: var(--ink-2); font: 400 16px/1.6 var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile p:lang(ja) { font-size: 14.5px; line-height: 1.85; }
.tile .byline { font-size: 10.5px; }
.tile.big h3 { font-size: clamp(28px, 3.1vw, 44px); line-height: 1.08; letter-spacing: -.03em; }
.tile.big h3:lang(ja) { font-weight: 900; font-size: clamp(24px, 2.5vw, 34px); line-height: 1.38; letter-spacing: .01em; }
/* the lead's dek opens with a short heavy rule */
.tile.big p { padding-top: 14px; margin-top: 4px; background: linear-gradient(var(--ink), var(--ink)) 0 0 / 44px 3px no-repeat; }
.tile .subtitle { font: 500 13.5px/1.5 var(--sans); color: var(--muted); margin-top: -3px; }
.tile.big .subtitle { font-size: 16px; }
.row-card { display: grid; grid-template-columns: 76px 1fr; gap: 14px; padding: 12px 0; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--rule); }
.row-card .cover { aspect-ratio: 1; overflow: hidden; display: block; }
.row-card .cover svg { width: 100%; height: 100%; display: block; }
.row-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.row-body b { font: 700 15px/1.38 var(--display); letter-spacing: -.005em; }
.row-body b:lang(ja) { font-size: 14.5px; line-height: 1.5; }
.row-body .byline { font-size: 10.5px; }
.front-2 { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; margin-bottom: 36px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 22px; }
.tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.side { display: grid; gap: 30px; align-content: start; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list a { display: flex; justify-content: space-between; padding: 9px 0; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 700; border-bottom: 1px solid var(--rule); }
.cat-list a:hover { color: var(--accent); }
.cat-list .n { font: 500 12px/1.6 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
/* The call to write: printed in reverse. */
.write-box { display: grid; gap: 10px; justify-items: start; background: var(--ink); color: var(--paper); padding: 20px; }
.write-box b { font: 800 20px/1.3 var(--display); letter-spacing: -.01em; }
.write-box b:lang(ja) { font-weight: 900; letter-spacing: .02em; line-height: 1.45; }
.write-box .help { color: color-mix(in srgb, var(--paper) 72%, transparent); margin: 0; }
.write-box .btn.primary { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.write-box .btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ad-side, .side-ad { height: 250px; }
.ad-banner { margin: 0 0 32px; }
.post-body + .ad-banner, .lineage + .ad-banner { max-width: 760px; margin: 32px auto 0; }
.ad-article { height: 250px; margin: 8px 0 28px; }
.ad-infeed { grid-column: 1 / -1; height: 100px; margin: 18px 0; }
.ad-slot[data-ads].ad-side, .ad-slot[data-ads].ad-article { min-height: 250px; }
@media print { .ad-slot { display: none !important; } }
.see-all { font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); text-decoration: none; white-space: nowrap; }
.see-all:lang(ja) { font-weight: 700; letter-spacing: .04em; font-size: 12px; }
.see-all:hover { color: var(--accent); }
/* Each field's row on the front page: the field's name set large under the rule, with its color square. */
.cat-section { margin-bottom: 40px; }
.cat-section .section-head h2 { display: flex; align-items: center; gap: 10px; font: 800 26px/1.2 var(--display); letter-spacing: -.02em; text-transform: none; }
.cat-section .section-head h2:lang(ja) { font-weight: 900; font-size: 24px; letter-spacing: .02em; }
.cat-section .section-head h2::before { content: ""; width: 12px; height: 12px; background: var(--cat, var(--accent)); flex: none; }
.cat-section .section-head h2 a { color: var(--ink); text-decoration: none; }
.cat-section .section-head h2 a:hover { color: var(--accent); }
.list-head { margin: 8px 0 18px; }
.cat-head { display: grid; gap: 10px; }
.cat-head .cover { overflow: hidden; height: 140px; display: block; margin-bottom: 8px; }
.cat-head .cover svg { width: 100%; height: 100%; display: block; }
.derived-badge { font: 600 11px/1 var(--mono); color: var(--accent); margin-left: 6px; }
.tag { display: inline-block; font: 600 10px/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 0 6px; background: var(--ink); color: var(--paper); vertical-align: middle; }
.tag:lang(ja) { font-weight: 700; letter-spacing: .02em; }
/* paper page */
.lineage-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: stretch; margin-top: 14px; }
.builds-on { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; flex: 1 1 320px; min-width: 0; padding: 9px 12px; border: 1px solid var(--rule); border-left: 4px solid var(--ink); color: var(--ink-2); text-decoration: none; font-size: 14px; }
.builds-on .ln-k { font: 600 10.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.builds-on .ln-t { font-weight: 700; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.builds-on .byline { font-size: 10.5px; }
.builds-on:hover .ln-t { color: var(--accent); }
.lineage-jump { align-self: center; font: 600 11.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 9px 14px; border: 1px solid var(--ink); background: none; color: var(--ink); cursor: pointer; }
.lineage-jump:hover { background: var(--ink); color: var(--paper); }
/* lineage tree under the paper */
.lineage { max-width: 760px; margin: 40px auto 0; scroll-margin-top: 120px; }
.ln-tree { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; }
.ln-tree::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 1px; background: var(--rule-strong); }
.ln { position: relative; padding: 4px 0; text-align: left; }
.ln::before { content: ""; position: absolute; left: -18px; top: 9px; width: 11px; height: 11px; background: var(--paper); border: 1px solid var(--rule-strong); box-sizing: border-box; }
.ln-label { display: block; font: 600 10.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 6px 0 2px; }
.ln .row-card { border-bottom: 0; padding: 6px 0; }
.ln.children .row-card { border-bottom: 1px solid var(--rule); }
.ln.children .row-card:last-child { border-bottom: 0; }
.ln.anc .row-card { opacity: .85; }
.ln.self::before { background: var(--accent); border-color: var(--accent); width: 13px; height: 13px; left: -19px; }
.ln.self .ln-label { color: var(--accent); }
.ln-self { padding: 10px 12px; background: var(--paper-2); border-left: 3px solid var(--accent); display: grid; gap: 2px; }
.ln-self b { color: var(--ink); font-family: var(--display); }
.ln.children.empty .help { margin: 4px 0; }
.ln-edge { position: relative; padding: 2px 0 2px 2px; font-size: 12px; color: var(--muted); }
.ln-edge::before { content: "↓"; position: absolute; left: -17px; top: 1px; font-size: 12px; color: var(--muted); background: var(--paper); line-height: 1.2; }
.ai-notes .review .challenge { display: inline-block; margin-left: 4px; font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); white-space: nowrap; }
.post-more { max-width: 1280px; margin: 48px auto 0; display: grid; gap: 28px; }
.derived-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-top: 14px; }
.derived-cta .help { margin: 0; flex: 1; min-width: 220px; }
.post-more-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; }
/* posting: building on a paper */
.parent-box { border-left: 4px solid var(--ink); }
.parent-title { display: inline-block; font: 700 18px/1.4 var(--display); color: var(--ink); margin: 4px 0; }
.parent-q { background: var(--paper-2); border: 1px solid var(--rule); padding: 8px 12px; }
.rel-pick { border: 0; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.rel-pick legend { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.lineup { padding-left: 1.2em; }
.lineup li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.lineup .actions { margin: 0 0 0 auto; }

/* ---------- responsive ---------- */
/* Wide screens use the width: more columns of papers (the paper text itself keeps a reading width). */
@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tiles.two { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .front-2, .post-more-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1279px) {
  .tiles.three > :nth-child(n+4) { display: none; }
}
@media (max-width: 1200px) {
  /* room for all the sections: the date goes, the search box narrows */
  .dateline { display: none; }
  .search-box input { width: 120px; }
  .sections { gap: 0; }
  .sections a { padding-inline: 8px; }
}
@media (max-width: 1080px) {
  .front { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .front-rank { grid-column: 1 / -1; border-left: 0 !important; padding-left: 0 !important; }
}
@media (max-width: 860px) {
  .front, .front-2, .post-more-grid { grid-template-columns: 1fr; }
  .front > * + * { border-left: 0; padding-left: 0; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dateline { display: none; }
  .search-box input { width: 110px; }
}
@media (max-width: 600px) {
  .site-header { position: static; }
  .brand-sub { display: none; }
  .header-row > .nav { width: 100%; justify-content: space-between; }
  .me-name { display: none; }
  main { padding-top: 18px; }
  .post-hero { margin-top: -18px; }
  .card { grid-template-columns: 92px 1fr; gap: 14px; padding: 14px 0; }
  .paper-section { grid-template-columns: 1fr; margin-top: 34px; }
  .paper-section .num { width: 36px; }
  .paper-section .text { font-size: 17.5px; }
  .paper-section .text:lang(ja) { font-size: 16px; }
  .react { padding: 12px; }
  .react b { font-size: 24px; }
  .form-section { padding: 16px; }
  .section-head { gap: 10px; }
}
@media (max-width: 560px) {
  .tiles, .tiles.two { grid-template-columns: 1fr; }
  .intro-band { flex-direction: column; align-items: flex-start; }
  .section-row { flex-wrap: wrap; gap: 0 10px; padding-bottom: 6px; }
  .sections { order: 2; flex-basis: 100%; }
  .search-box { margin-left: auto; margin-top: 6px; }
  .ad-side, .side-ad { height: 120px; }
}
@media print { .section-nav, .post-more, .lineage, .lineage-jump { display: none !important; } }
