/*
 * AniMood information pages: /privacy, /rules, /delete-account, /contact.
 * The app's ink-and-paper look without depending on app.css: night background, paper
 * sheets, Georgia headings, small tracked labels, red accents and kanji. Mobile first.
 * Generic text rules sit inside :where() so every component class can override them.
 */
:root {
    color-scheme: dark;
    --ink: #121212;
    --night: #171719;
    --night-raised: #1e1e21;
    --paper: #f2eedf;
    --card: rgba(255, 253, 245, .62);
    --red: #ef4b3f;
    --red-ink: #b3302a;
    --danger: #982720;
    --ok: #2f6a3c;
    --blue: #244c78;
    --muted: #a3a097;
    --line: rgba(242, 238, 223, .2);
    --rule: #c9c2ad;
    --text: #24221e;
    --soft: #57534c;
    --serif: Georgia, "Times New Roman", serif;
    --sans: Arial, "Helvetica Neue", sans-serif;
    --kanji: "Yu Mincho", "Hiragino Mincho ProN", "MS Mincho", serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
    --gutter: 16px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--night); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.pg-body { margin: 0; min-height: 100vh; color: var(--paper); background: var(--night); font: 16px/1.5 var(--sans); }
body.pg-body::before { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .24; background-image: radial-gradient(rgba(255, 255, 255, .25) .55px, transparent .7px); background-size: 5px 5px; }
:where(.pg-body) a { color: inherit; }
:where(.pg-body) :where(button, input, select, textarea) { font: inherit; }
.pg-body [hidden] { display: none !important; }
.pg-body :focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.pg-body main:focus { outline: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.pg-skip { position: absolute; top: 8px; left: var(--gutter); z-index: 60; padding: 12px 18px; color: var(--ink) !important; background: var(--paper); font-weight: 700; text-decoration: none; transform: translateY(-160%); }
.pg-skip:focus { transform: none; }

/* ---------- Top bar: the app's, with a way back ---------- */

.pg-top { position: relative; z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 12px; max-width: 1540px; margin: 0 auto; padding: max(10px, env(safe-area-inset-top)) var(--gutter) 0; border-bottom: 1px solid var(--line); }
.pg-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; min-height: 56px; color: var(--paper); text-decoration: none; font: 800 20px/1 var(--sans); letter-spacing: -.04em; }
.pg-brand-mark { flex: none; display: grid; place-items: center; width: 42px; height: 42px; color: var(--paper); background: var(--red); font: 400 24px/1 var(--kanji); letter-spacing: 0; }
.pg-brand small { display: none; margin-top: 5px; color: #99978f; font: 500 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.pg-back { grid-row: 1; grid-column: 2; display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 14px; border: 1px solid rgba(242, 238, 223, .38); color: var(--paper); text-decoration: none; white-space: nowrap; font: 700 14px/1.2 var(--sans); transition: background-color .2s, border-color .2s; }
.pg-back-arrow { color: var(--red); font-size: 18px; line-height: 1; transition: color .2s, transform .2s; }
.pg-back:hover { border-color: var(--red); background: var(--red); }
.pg-back:hover .pg-back-arrow { color: var(--paper); }

.pg-pages { grid-row: 2; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 8px; border-top: 1px solid var(--line); }
.pg-pages a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 60px; padding: 8px 2px; color: #a3a097; text-align: center; text-decoration: none; font: 700 11px/1.15 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.pg-pages-kanji { color: #77746d; font: 400 20px/1 var(--kanji); letter-spacing: 0; transition: color .2s; }
.pg-pages-long { display: none; }
.pg-pages a:hover,
.pg-pages a[aria-current=page] { color: var(--paper); }
.pg-pages a:hover .pg-pages-kanji,
.pg-pages a[aria-current=page] .pg-pages-kanji { color: var(--red); }
.pg-pages a[aria-current=page]::after { content: ''; position: absolute; left: 24%; right: 24%; bottom: -1px; height: 2px; background: var(--red); }

/* ---------- Hero ---------- */

.pg-body main { position: relative; z-index: 1; display: block; }
.pg-hero { position: relative; max-width: 1540px; margin: 0 auto; padding: 38px var(--gutter) 40px; overflow: hidden; border-bottom: 1px solid var(--line); }
.pg-hero-copy { position: relative; z-index: 1; max-width: 900px; }
.pg-kicker { display: flex; align-items: center; gap: 14px; margin: 0; padding-right: 112px; color: var(--red); font: 800 12px/1.4 var(--sans); letter-spacing: .22em; text-transform: uppercase; }
.pg-kicker i { flex: none; display: block; width: 34px; height: 1px; background: var(--red); }
.pg-hero h1 { margin: 20px 0 0; padding-right: 84px; font: 400 clamp(40px, 11vw, 100px)/.98 var(--serif); letter-spacing: -.045em; overflow-wrap: break-word; }
.pg-hero h1 em { color: var(--red); }
.pg-lede { max-width: 62ch; margin: 22px 0 0; color: #d3cfc3; font: 18px/1.6 var(--serif); }
.pg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 22px 0 0; color: var(--muted); font: 700 11px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.pg-meta span { display: inline-flex; align-items: center; gap: 18px; }
.pg-meta span + span::before { content: ''; flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--red); }
.pg-sun { position: absolute; top: 26px; right: -30px; display: grid; place-items: center; width: 128px; height: 128px; border-radius: 50%; background: var(--red); }
.pg-sun span { color: rgba(18, 18, 18, .8); font: 400 64px/1 var(--kanji); }
.pg-reading { display: none; }

/* ---------- At a glance (privacy) and notes (contact) ---------- */

.pg-glance { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; max-width: 1240px; margin: 0 auto; padding: 24px var(--gutter) 0; }
.pg-glance-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); grid-auto-rows: auto; align-content: start; gap: 4px 16px; padding: 18px; color: var(--paper); background: var(--night-raised); border: 1px solid var(--line); text-decoration: none; transition: border-color .2s, background-color .2s; }
.pg-glance-kanji { grid-row: 1 / span 3; display: grid; place-items: center; width: 48px; height: 48px; color: var(--red); border: 1px solid rgba(239, 75, 63, .55); font: 400 26px/1 var(--kanji); }
.pg-glance-label { font: 400 22px/1.15 var(--serif); }
.pg-glance-text { color: #c9c5b9; font: 15px/1.55 var(--sans); }
.pg-glance-more { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--red); font: 800 11px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.pg-glance-more span { transition: transform .2s; }
a.pg-glance-card:hover { border-color: var(--red); background: #232327; }
.pg-glance.is-notes { gap: 10px; }
.pg-glance.is-notes .pg-glance-card { grid-template-columns: 38px minmax(0, 1fr); column-gap: 14px; padding: 14px 16px; }
.pg-glance.is-notes .pg-glance-kanji { grid-row: 1 / span 2; width: 38px; height: 38px; margin: 0; font-size: 21px; }
.pg-glance.is-notes .pg-glance-label { font-size: 19px; }
.pg-glance.is-notes .pg-glance-text { font-size: 14.5px; }
.pg-glance-card.is-alert { border-color: rgba(239, 75, 63, .7); background: #2a1816; }
.pg-glance-card.is-alert .pg-glance-kanji { color: var(--paper); background: var(--red); border-color: var(--red); }

/* ---------- Page grid and contents ---------- */

.pg-layout { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 24px var(--gutter) 64px; }
.pg-content { display: grid; gap: 20px; min-width: 0; counter-reset: pg-section; }
.pg-aside { display: grid; align-content: start; gap: 20px; min-width: 0; margin-top: 20px; }

.pg-toc { position: relative; margin: 0 0 20px; }
.pg-toc-title { margin: 0 0 8px; color: var(--muted); font: 800 11px/1.4 var(--sans); letter-spacing: .22em; text-transform: uppercase; }
.pg-toc-list { margin: 0; padding: 0; list-style: none; counter-reset: pg-toc; border-left: 1px solid var(--line); }
.pg-toc-list li { counter-increment: pg-toc; }
.pg-toc-list a { display: flex; align-items: baseline; gap: 12px; min-height: 44px; padding: 11px 8px 11px 16px; color: #b9b5aa; text-decoration: none; font: 15px/1.35 var(--sans); transition: color .2s; }
.pg-toc-list a::before { content: counter(pg-toc, decimal-leading-zero); flex: none; color: #77746d; font: 700 11px/1.4 var(--sans); letter-spacing: .08em; transition: color .2s; }
.pg-toc-list a:hover,
.pg-toc-list a[aria-current] { color: var(--paper); }
.pg-toc-list a:hover::before,
.pg-toc-list a[aria-current]::before { color: var(--red); }
.pg-toc-marker { display: none; position: absolute; top: 0; left: 0; width: 2px; height: 100px; background: var(--red); transform-origin: 0 0; pointer-events: none; }
.pg-toc-toggle { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0; border: 0; color: var(--paper); background: none; text-align: left; cursor: pointer; }
.pg-toc-kicker { flex: none; color: var(--red); font: 800 11px/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.pg-toc-current { flex: 1; min-width: 0; overflow: hidden; color: #d8d4c8; white-space: nowrap; text-overflow: ellipsis; font: 15px/1.3 var(--serif); }
.pg-toc-chevron { flex: none; width: 10px; height: 10px; margin: 0 6px 0 0; border-right: 2px solid var(--paper); border-bottom: 2px solid var(--paper); transform: translateY(-3px) rotate(45deg); transition: transform .2s; }
/* pages.js turns the contents into a sticky "On this page" bar on narrow screens. */
.pg-toc.is-collapsible { position: sticky; top: 0; z-index: 30; margin: 0 calc(-1 * var(--gutter)) 20px; padding: 0 var(--gutter); background: rgba(23, 23, 25, .97); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pg-toc.is-collapsible .pg-toc-title { display: none; }
.pg-toc.is-collapsible .pg-toc-list { display: none; position: absolute; top: 100%; left: 0; right: 0; max-height: min(70vh, 540px); overflow-y: auto; overscroll-behavior: contain; padding: 4px var(--gutter) 12px; border: 0; border-bottom: 1px solid var(--line); background: #1b1b1e; box-shadow: 0 20px 30px rgba(0, 0, 0, .5); }
.pg-toc.is-collapsible .pg-toc-list a { padding-left: 0; border-bottom: 1px solid rgba(242, 238, 223, .08); }
.pg-toc.is-open .pg-toc-list { display: block; }
.pg-toc.is-open .pg-toc-chevron { transform: translateY(3px) rotate(225deg); }

/* ---------- Paper sheets ---------- */

.pg-sheet { position: relative; min-width: 0; padding: 26px 20px 28px; color: var(--text); background-color: var(--paper); background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(18, 18, 18, .04) 28px); box-shadow: 6px 6px 0 #080808; scroll-margin-top: 72px; }
:where(.pg-sheet) :where(p, li, dd) { max-width: 68ch; margin: 0 0 14px; font: 16.5px/1.7 var(--serif); }
:where(.pg-sheet) :where(ul, ol) { margin: 0 0 16px; padding-left: 1.3em; }
/* Deliberately stronger than any one component class: nothing ends a box with a gap. */
.pg-sheet > :last-child,
.pg-sheet :is(li, div, article, section) > :last-child { margin-bottom: 0; }
:where(.pg-sheet) a { color: var(--ink); text-decoration-color: var(--red-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:where(.pg-sheet) a:hover { color: var(--red-ink); text-decoration-thickness: 2px; }
:where(.pg-sheet) :where(strong, b) { font-weight: 700; }
:where(.pg-sheet) h3 { margin: 30px 0 10px; color: var(--ink); font: 400 23px/1.2 var(--serif); letter-spacing: -.01em; scroll-margin-top: 72px; }

.pg-section { counter-increment: pg-section; }
.pg-section::before { content: counter(pg-section, decimal-leading-zero); position: absolute; top: 24px; right: 20px; color: var(--red); font: 400 26px/1 var(--serif); }
.pg-section > h2,
.pg-form-sheet > h2 { margin: 0 52px 18px 0; color: var(--ink); font: 400 clamp(27px, 7vw, 40px)/1.08 var(--serif); letter-spacing: -.03em; }
.pg-section > h2::before,
.pg-form-sheet > h2::before { content: ''; display: block; width: 36px; height: 3px; margin-bottom: 16px; background: var(--red); }
.pg-label { margin: 0 0 10px; color: var(--red-ink); font: 800 11px/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.pg-intro { color: var(--soft); font-style: italic; }

/* "In short" opens every page: a red band with 要点 and the key points. */
.pg-sheet.pg-short { display: grid; padding: 0; overflow: hidden; }
.pg-short > .pg-short-mark { margin: 0; padding: 12px 20px; color: var(--paper); background: var(--red); font: 400 22px/1 var(--kanji); letter-spacing: .3em; }
.pg-short > div { padding: 22px 20px 24px; }
.pg-short ul { margin: 0; padding: 0; list-style: none; }
.pg-short li { position: relative; padding-left: 26px; }
.pg-short li::before { content: ''; position: absolute; top: .78em; left: 0; width: 13px; height: 2px; background: var(--red); }

.pg-callout { position: relative; margin: 22px 0; padding: 16px 18px 16px 20px; border-left: 4px solid var(--red); background: rgba(222, 215, 194, .8); }
.pg-callout-label { display: block; margin-bottom: 4px; color: var(--red-ink); font: 800 11px/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.pg-callout.is-warning { border-left-color: var(--danger); background: #f2dcd2; }
.pg-callout.is-warning .pg-callout-label { color: var(--danger); }

.pg-fallback { margin-top: 24px; padding-top: 16px; border-top: 1px dashed #b5ae99; }
.pg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }

.pg-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 10px 22px; border: 1px solid var(--ink); color: var(--paper); background: var(--ink); text-align: center; text-decoration: none; font: 800 13px/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; }
.pg-button:hover { border-color: var(--red); color: var(--paper); background: var(--red); }
.pg-button.is-quiet { color: var(--ink); background: transparent; }
.pg-button.is-quiet:hover { border-color: var(--ink); color: var(--paper); background: var(--ink); }
.pg-button.is-danger { border-color: var(--danger); color: #fff; background: var(--danger); }
.pg-button.is-danger:hover { border-color: #6f1a15; background: #6f1a15; }
.pg-button:disabled { opacity: .6; cursor: progress; }

.pg-art { display: inline-block; padding: 2px 8px; color: var(--paper); background: var(--ink); white-space: nowrap; font: 700 10.5px/1.5 var(--sans); letter-spacing: .1em; text-transform: uppercase; }

/* ---------- Privacy ---------- */

.pg-facts { margin: 20px 0 0; border-top: 1px solid var(--rule); }
.pg-facts > div { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.pg-facts dt { color: var(--soft); font: 700 11px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.pg-facts dd { margin: 0; font: 16px/1.5 var(--serif); }

/* Tables are cards on phones (each cell labelled) and real tables from 760 px. */
.pg-table { width: 100%; margin: 6px 0 20px; border-collapse: collapse; }
.pg-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pg-table tbody, .pg-table tr, .pg-table tbody th, .pg-table td { display: block; }
.pg-table tr { margin: 0 0 12px; padding: 16px 16px 14px; border: 1px solid var(--rule); border-left: 3px solid var(--ink); background: var(--card); }
.pg-table tbody th { margin: 0 0 10px; color: var(--ink); text-align: left; font: 400 19px/1.3 var(--serif); }
.pg-table td { margin: 0 0 10px; color: var(--text); font: 15px/1.6 var(--sans); }
.pg-table td:last-child { margin-bottom: 0; }
.pg-table td::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--soft); font: 700 10.5px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.pg-table-keep td strong { color: var(--red-ink); }
.pg-basis { display: inline-block; margin: 0 2px 2px 0; padding: 0 7px; border: 1px solid var(--ink); color: var(--ink); font: 700 10.5px/1.7 var(--sans); letter-spacing: .1em; text-transform: uppercase; vertical-align: 1px; }
.pg-basis.is-consent { border-color: var(--red-ink); color: var(--red-ink); }
.pg-basis.is-interest { border-color: var(--blue); color: var(--blue); }

.pg-ages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.pg-ages > p { margin: 0; padding: 14px 16px; border: 1px solid var(--rule); background: var(--card); }
.pg-ages b { display: block; color: var(--red); font: 400 42px/1 var(--serif); letter-spacing: -.03em; }
.pg-ages span { display: block; margin-top: 6px; color: var(--soft); font: 14px/1.45 var(--sans); }

.pg-points { padding: 0 !important; list-style: none; }
.pg-points > li { position: relative; padding-left: 26px; }
.pg-points > li::before { content: ''; position: absolute; top: .78em; left: 0; width: 13px; height: 2px; background: var(--red); }
.pg-points.is-remove > li::before { top: .5em; width: 10px; height: 10px; background: var(--danger); }

.pg-rights { display: grid; gap: 10px; margin: 6px 0 18px; padding: 0 !important; list-style: none; }
.pg-rights > li { margin: 0; padding: 14px 16px; border: 1px solid var(--rule); background: var(--card); }
.pg-rights .pg-art { float: right; margin: 3px 0 6px 12px; }
.pg-rights p { margin: 0; font: 16px/1.55 var(--serif); }
.pg-rights strong { color: var(--red-ink); }

.pg-promises { display: grid; gap: 14px; margin: 20px 0; padding: 0 !important; list-style: none; }
.pg-promises > li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start; margin: 0; }
.pg-promise-kanji { display: grid; place-items: center; width: 44px; height: 44px; color: var(--paper); background: var(--red); font: 400 22px/1 var(--kanji); }
.pg-promises p { margin: 0; font-size: 16px; }

.pg-address { display: inline-block; margin: 4px 0 0; padding: 16px 20px; border: 1px solid var(--ink); background: var(--card); font: normal 16px/1.6 var(--serif); }
.pg-address b { display: block; margin-bottom: 2px; }

/* ---------- Rules ---------- */

.pg-rules { display: grid; gap: 14px; margin-top: 4px; }
.pg-rule { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--rule); border-top: 3px solid var(--ink); background: var(--card); }
.pg-rule-mark { display: grid; place-items: center; width: 48px; height: 48px; color: var(--paper); background: var(--ink); font: 400 26px/1 var(--kanji); }
.pg-rule h3 { margin: 0 0 8px; font-size: 22px; }
.pg-rule .pg-callout { margin: 16px 0; }
.pg-examples { display: grid; gap: 8px; margin: 14px 0 0; padding: 0 !important; list-style: none; }
.pg-examples > li { max-width: none; margin: 0; padding: 10px 14px; border-left: 3px solid; font: 15px/1.55 var(--sans); }
.pg-examples > li.is-ok { border-color: var(--ok); background: rgba(47, 106, 60, .1); }
.pg-examples > li.is-not { border-color: var(--danger); background: rgba(152, 39, 32, .08); }
.pg-examples b { font-weight: 800; }
.pg-examples .is-ok b { color: var(--ok); }
.pg-examples .is-not b { color: var(--danger); }

.pg-channels { display: grid; gap: 12px; }
.pg-channel { padding: 18px; border: 1px solid var(--rule); border-top: 3px solid var(--red); background: var(--card); }
.pg-channel p:not(.pg-label) { font-size: 15.5px; }

/* Report to appeal: a vertical thread on phones, a horizontal one on wide screens. */
.pg-flow { position: relative; display: grid; margin: 4px 0 26px; padding: 0 !important; list-style: none; }
.pg-flow > li { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 16px; max-width: none; margin: 0; padding: 0 0 18px; font: 15px/1.5 var(--sans); }
.pg-flow > li::before { content: ''; position: absolute; top: 50px; bottom: 2px; left: 23px; width: 2px; background: repeating-linear-gradient(180deg, var(--red) 0 5px, transparent 5px 9px); }
.pg-flow > li:last-child::before { display: none; }
.pg-flow-mark { position: relative; z-index: 1; grid-row: 1 / span 2; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: var(--paper); background: var(--red); font: 400 22px/1 var(--kanji); }
.pg-flow b { align-self: end; margin-top: 2px; color: var(--ink); font: 400 19px/1.25 var(--serif); }
.pg-flow > li > span:last-child { color: var(--soft); }

.pg-ladder { display: grid; gap: 8px; margin: 16px 0 20px; padding: 0 !important; list-style: none; counter-reset: pg-ladder; }
.pg-ladder > li { position: relative; counter-increment: pg-ladder; max-width: none; margin: 0; padding: 12px 14px 12px 58px; border: 1px solid var(--rule); border-left: 4px solid #d6aaa3; background: var(--card); font: 15px/1.55 var(--sans); }
.pg-ladder > li::before { content: counter(pg-ladder); position: absolute; top: 12px; left: 14px; display: grid; place-items: center; width: 30px; height: 30px; color: var(--paper); background: var(--ink); font: 700 13px/1 var(--sans); }
.pg-ladder > li:nth-child(2) { border-left-color: #e08a80; }
.pg-ladder > li:nth-child(3) { border-left-color: var(--red); }
.pg-ladder > li:nth-child(4) { border-left-color: var(--danger); }
.pg-ladder b { color: var(--ink); }

.pg-checklist { padding: 0 !important; list-style: none; }
.pg-checklist > li { position: relative; padding-left: 30px; }
.pg-checklist > li::before { content: ''; position: absolute; top: .42em; left: 1px; width: 15px; height: 15px; border: 2px solid var(--red-ink); }

.pg-dsa { display: grid; gap: 12px; margin-top: 18px; }
.pg-dsa-item { padding: 18px; border: 1px solid var(--rule); background: var(--card); }
.pg-dsa-item > .pg-art { margin-bottom: 10px; }
.pg-dsa-item h3 { margin: 0 0 8px; font-size: 20px; }

/* ---------- Delete account ---------- */

.pg-steps { display: grid; gap: 10px; margin: 0 0 18px; padding: 0 !important; list-style: none; counter-reset: pg-step; }
.pg-steps > li { position: relative; min-height: 40px; margin: 0; padding: 5px 0 4px 54px; counter-increment: pg-step; }
.pg-steps > li::before { content: counter(pg-step); position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: 50%; color: var(--ink); font: 400 18px/1 var(--serif); }

.pg-export { margin: 20px 0; padding: 18px 20px; border: 1px dashed var(--ink); background: var(--card); }
.pg-export .pg-label span { color: var(--ink); text-transform: none; letter-spacing: .02em; }
.pg-export-result:empty { display: none; }
.pg-export-result { margin-top: 14px; }
.pg-inline-error { color: var(--danger); font-weight: 700; }

.pg-columns { display: grid; gap: 14px; margin: 4px 0 20px; }
.pg-column { position: relative; padding: 20px 18px; overflow: hidden; border: 1px solid var(--rule); background: var(--card); }
.pg-column.is-gone { border-top: 4px solid var(--danger); }
.pg-column.is-kept { border-top: 4px solid var(--ink); }
.pg-column > .pg-column-mark { position: absolute; top: -10px; right: -4px; margin: 0; color: rgba(18, 18, 18, .07); font: 400 112px/1 var(--kanji); pointer-events: none; }
.pg-column h3 { position: relative; margin: 0 0 14px; font-size: 22px; }
.pg-column ul { position: relative; margin: 0; padding: 0; list-style: none; }
.pg-column li { position: relative; margin: 0 0 10px; padding-left: 26px; font: 15.5px/1.6 var(--sans); }
.pg-column.is-gone li::before { content: ''; position: absolute; top: .78em; left: 0; width: 13px; height: 2px; background: var(--danger); }
.pg-column.is-kept li::before { content: ''; position: absolute; top: .45em; left: 0; width: 11px; height: 11px; border: 2px solid var(--soft); border-radius: 50%; }

.pg-danger { border-top: 6px solid var(--danger); }
.pg-danger::before { color: var(--danger); }
.pg-danger > h2::before { background: var(--danger); }

/* ---------- Forms (delete account, contact) ---------- */

.pg-form { margin: 6px 0 0; }
.pg-field { margin: 0 0 22px; }
.pg-field > label { display: block; margin: 0 0 6px; color: var(--ink); font: 700 15px/1.4 var(--sans); }
.pg-optional { color: var(--soft); font-weight: 400; }
.pg-form :is(input:not([type=checkbox]), select, textarea) { display: block; width: 100%; min-height: 52px; padding: 12px 14px; border: 1px solid #8d8879; border-radius: 0; color: var(--ink); background: #fffdf5; font: 16px/1.5 var(--sans); box-shadow: inset 0 2px 0 rgba(18, 18, 18, .05); transition: border-color .2s, box-shadow .2s; }
.pg-form :is(input, select, textarea):focus { border-color: var(--ink); outline: 3px solid var(--red); outline-offset: 1px; }
.pg-form .pg-field select { appearance: none; padding-right: 46px; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 24px) 52%, calc(100% - 18px) 52%; background-size: 6px 6px; background-repeat: no-repeat; cursor: pointer; }
.pg-form textarea { min-height: 200px; resize: vertical; }
.pg-form [aria-invalid=true] { border-color: var(--danger); box-shadow: inset 4px 0 0 var(--danger); }
.pg-hint { max-width: 68ch; margin: 6px 0 0; color: var(--soft); font: 14px/1.5 var(--sans); }
.pg-field-error { margin: 6px 0 0; color: var(--danger); font: 700 14px/1.5 var(--sans); }
.pg-counter { margin: 4px 0 0; color: var(--soft); text-align: right; font: 13px/1.4 var(--sans); }
.pg-field > .pg-check { display: flex; align-items: flex-start; gap: 12px; margin: 0; color: var(--ink); cursor: pointer; font: 15.5px/1.5 var(--sans); }
.pg-check input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--red-ink); }
.pg-form .pg-check input[aria-invalid=true] { box-shadow: none; outline: 2px solid var(--danger); outline-offset: 2px; }
.pg-signed-in { margin: 0 0 20px; padding: 12px 14px; border-left: 3px solid var(--ink); background: var(--card); font: 15px/1.5 var(--sans); }
.pg-form > .pg-button { width: 100%; }

/* Status boxes. contact.js and delete-account.js keep their round-1 class names. */
.legal-status { margin: 22px 0 0; padding: 18px 20px; border: 1px solid #8d8879; color: var(--text); background: #fffdf5; font: 15px/1.6 var(--sans); }
.legal-status:empty { display: none; }
.legal-status h3 { margin: 0 0 10px; color: inherit; font: 400 26px/1.15 var(--serif); }
.legal-status p { max-width: 62ch; margin: 0 0 10px; font: 15.5px/1.6 var(--sans); }
.legal-status > :last-child { margin-bottom: 0; }
.legal-status.is-success { position: relative; overflow: hidden; padding: 26px 22px 24px; border: 0; border-top: 5px solid var(--ok); color: #183d22; background: #e3eddb; }
.legal-status.is-success a:not(.pg-button) { color: #183d22; }
.legal-status.is-error { border-color: var(--danger); border-left: 5px solid var(--danger); color: #6f1a15; background: #f8e4dd; }
.pg-status-mark { position: absolute; top: -8px; right: 6px; color: rgba(47, 106, 60, .14); font: 400 120px/1 var(--kanji); pointer-events: none; }
.legal-status.is-success > :not(.pg-status-mark) { position: relative; }
.legal-ticket { display: inline-block; margin: 6px 0; padding: 8px 14px; border: 1px dashed var(--ok); color: var(--ink); background: #fffdf5; font: 700 26px/1.2 var(--mono); letter-spacing: .08em; }
.legal-receipt { overflow-wrap: anywhere; font: 13px/1.5 var(--mono); }

/* ---------- Contact ---------- */

.pg-form-sheet > h2 { margin-right: 0; }
.pg-aside-sheet { padding: 24px 22px; }
.pg-aside-sheet > h2:not(.pg-label) { margin: 0 0 12px; color: var(--ink); font: 400 25px/1.15 var(--serif); letter-spacing: -.02em; }
.pg-aside-sheet p { font-size: 15.5px; }
.pg-aside-sheet.is-ink { color: var(--paper); background: var(--ink); background-image: none; box-shadow: 6px 6px 0 var(--red); }
.pg-aside-sheet.is-ink .pg-label { color: var(--red); }
.pg-aside-sheet.is-ink a { color: var(--paper); text-decoration-color: var(--red); }
.pg-topics { margin: 0; padding: 0 !important; list-style: none; }
.pg-topics > li { margin: 0; }
.pg-topics a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 26px 8px 0; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; font: 700 15px/1.3 var(--sans); }
.pg-topics a span { flex: none; display: grid; place-items: center; width: 34px; height: 34px; color: var(--paper); background: var(--red); font: 400 18px/1 var(--kanji); }
.pg-topics a::after { content: ''; position: absolute; top: 50%; right: 6px; width: 8px; height: 8px; border-top: 2px solid var(--red-ink); border-right: 2px solid var(--red-ink); transform: translateY(-50%) rotate(45deg); transition: transform .2s; }
.pg-topics a:hover { color: var(--red-ink); }

/* ---------- Footer ---------- */

.pg-foot { position: relative; z-index: 1; border-top: 1px solid var(--line); background: #121214; }
.pg-foot-inner { display: grid; gap: 28px; max-width: 1240px; margin: 0 auto; padding: 36px var(--gutter) calc(40px + env(safe-area-inset-bottom)); }
.pg-foot-about p { max-width: 38ch; margin: 14px 0 0; color: var(--muted); font: italic 15px/1.6 var(--serif); }
.pg-foot-label { margin: 0 0 6px; color: var(--muted); font: 800 11px/1.4 var(--sans); letter-spacing: .22em; text-transform: uppercase; }
.pg-foot-links ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin: 0; padding: 0; list-style: none; }
.pg-foot-links a { display: flex; align-items: center; gap: 10px; min-height: 44px; color: #d8d4c8; text-decoration: none; font: 15px/1.3 var(--sans); }
.pg-foot-links a span { color: var(--red); font: 400 17px/1 var(--kanji); }
.pg-foot-links a:hover,
.pg-foot-links a[aria-current] { color: var(--paper); text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 5px; }
.pg-foot-actions p:not(.pg-foot-label) { margin: 0 0 16px; color: #c9c5b9; font: 15px/1.6 var(--sans); }
.pg-foot-actions p a { color: var(--paper); text-decoration-color: var(--red); text-underline-offset: 3px; }
.pg-foot-back { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 22px; color: var(--paper); background: var(--red); text-decoration: none; font: 800 13px/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; transition: background-color .2s, color .2s; }
.pg-foot-back:hover { color: var(--ink); background: var(--paper); }

/* ---------- Motion guards ---------- */

/* motion-boot.js sets .motion-pending before the first paint; pages.js lifts it once GSAP has
   placed the hero, and motion-boot.js gives up after 3 s, so nothing can stay hidden. */
.motion-pending .pg-hero-copy > *,
.motion-pending .pg-sun,
.motion-pending .pg-reading,
.motion-pending .pg-glance > * { visibility: hidden; }

@media (prefers-reduced-motion: no-preference) {
    html:has(> body.pg-body) { scroll-behavior: smooth; }
    .pg-back:hover .pg-back-arrow { transform: translateX(-3px); }
    a.pg-glance-card:hover .pg-glance-more span { transform: translateX(3px); }
    .pg-topics a:hover::after { transform: translate(3px, -50%) rotate(45deg); }
    .pg-button:active, .pg-back:active, .pg-foot-back:active { transform: scale(.97); }
}

/* ---------- Narrow and wider screens ---------- */

/* The smallest phones: the mark alone carries the brand, the way back keeps its words. */
@media (max-width: 369px) {
    .pg-top .pg-brand-name { display: none; }
}

@media (min-width: 700px) {
    :root { --gutter: 28px; }
    .pg-brand small { display: block; }
    .pg-hero { padding-top: 56px; padding-bottom: 56px; }
    .pg-kicker { padding-right: 0; }
    .pg-hero h1 { padding-right: 180px; }
    .pg-sun { top: 40px; right: -40px; width: 230px; height: 230px; }
    .pg-sun span { font-size: 110px; }
    .pg-glance { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-top: 32px; }
    .pg-sheet { padding: 40px 44px 44px; box-shadow: 9px 9px 0 #080808; }
    .pg-section::before { top: 38px; right: 40px; font-size: 30px; }
    .pg-short { grid-template-columns: 76px minmax(0, 1fr); }
    .pg-short > .pg-short-mark { display: flex; justify-content: center; padding: 30px 0; writing-mode: vertical-rl; font-size: 28px; }
    .pg-short > div { padding: 34px 44px 36px 36px; }
    .pg-facts > div { grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: baseline; }
    .pg-ages { max-width: 520px; }
    .pg-rule { grid-template-columns: 56px minmax(0, 1fr); gap: 20px; padding: 24px; }
    .pg-rule-mark { width: 56px; height: 56px; font-size: 30px; }
    .pg-form > .pg-button { width: auto; }
    .pg-aside-sheet { padding: 30px 30px; }
}

@media (min-width: 760px) {
    .pg-table { display: table; }
    .pg-table thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; display: table-header-group; }
    .pg-table tbody { display: table-row-group; }
    .pg-table tr { display: table-row; margin: 0; padding: 0; border: 0; background: none; }
    .pg-table :is(thead, tbody) :is(th, td) { display: table-cell; padding: 16px 18px 16px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
    .pg-table :is(th, td):last-child { padding-right: 0; }
    .pg-table thead th { padding-top: 0; padding-bottom: 10px; border-bottom: 2px solid var(--ink); color: var(--soft); font: 700 11px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
    .pg-table tbody th { width: 27%; margin: 0; font-size: 18px; }
    .pg-table td { margin: 0; }
    .pg-table td::before { display: none; }
    .pg-table-keep tbody th { width: 40%; }
    .pg-rights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pg-rights > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .pg-promises { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
    .pg-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
    .pg-dsa { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pg-dsa-item.is-wide { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
    .pg-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0 44px; padding: 84px 38px 80px; }
    .pg-hero h1 { padding-right: 0; font-size: clamp(60px, 6.4vw, 104px); }
    .pg-sun { position: relative; top: auto; right: auto; width: clamp(220px, 23vw, 330px); height: auto; aspect-ratio: 1; }
    .pg-sun span { font-size: clamp(110px, 11.5vw, 165px); }
    .pg-reading { display: block; align-self: center; margin: 0; color: var(--muted); writing-mode: vertical-rl; font: 700 11px/1 var(--sans); letter-spacing: .32em; text-transform: uppercase; }
    .pg-glance.is-notes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pg-channels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pg-flow { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 14px; }
    .pg-flow > li { grid-template-columns: 1fr; row-gap: 10px; align-content: start; padding: 0; }
    .pg-flow-mark { grid-row: auto; }
    .pg-flow b { align-self: start; }
    .pg-flow > li::before { top: 23px; right: -14px; bottom: auto; left: 54px; width: auto; height: 2px; background: repeating-linear-gradient(90deg, var(--red) 0 5px, transparent 5px 9px); }
    .pg-ladder { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .pg-ladder > li { padding: 54px 14px 14px; border-left: 1px solid var(--rule); border-top: 2px solid #d6aaa3; }
    .pg-ladder > li::before { top: 14px; }
    .pg-ladder > li:nth-child(2) { border-left-color: var(--rule); border-top: 4px solid #e08a80; }
    .pg-ladder > li:nth-child(3) { border-left-color: var(--rule); border-top: 6px solid var(--red); }
    .pg-ladder > li:nth-child(4) { border-left-color: var(--rule); border-top: 8px solid var(--danger); }
    .pg-foot-inner { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 44px; padding: 52px 38px calc(56px + env(safe-area-inset-bottom)); }
    .pg-foot-links ul { grid-template-columns: 1fr; }
}

@media (min-width: 1000px) {
    .pg-top { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); min-height: 82px; padding: env(safe-area-inset-top) 38px 0; }
    .pg-pages { grid-row: 1; grid-column: 2; display: flex; gap: 30px; margin: 0; border: 0; }
    .pg-pages a { flex-direction: row; min-height: 44px; padding: 11px 0; color: #8d8b84; font-size: 12px; }
    .pg-pages-kanji, .pg-pages-short { display: none; }
    .pg-pages-long { display: inline; }
    .pg-pages a[aria-current=page]::after { left: 0; right: 0; bottom: 3px; }
    .pg-back { grid-column: 3; justify-self: end; }
    .pg-glance { padding: 40px 38px 0; }
    .pg-layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 52px; align-items: start; padding: 48px 38px 96px; }
    .pg-layout.is-split { grid-template-columns: minmax(0, 1fr) minmax(300px, 390px); gap: 40px; }
    .pg-content { gap: 28px; max-width: 840px; }
    .pg-layout.is-split .pg-content { max-width: none; }
    .pg-aside { margin-top: 0; gap: 28px; }
    .pg-toc { position: sticky; top: 20px; max-height: calc(100vh - 40px); margin: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3a3a3e transparent; }
    .pg-toc-list a { padding-top: 9px; padding-bottom: 9px; font-size: 14px; line-height: 1.3; }
    .pg-toc.is-live .pg-toc-marker:not(.is-idle) { display: block; }
    .pg-sheet, :where(.pg-sheet) h3 { scroll-margin-top: 28px; }
}

@media (min-width: 1100px) {
    .pg-glance { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .pg-glance-card { grid-template-columns: 1fr; padding: 22px; }
    .pg-glance-kanji { grid-row: auto; margin-bottom: 12px; }
}

@media print {
    body.pg-body { color: #000; background: #fff; }
    body.pg-body::before, .pg-skip, .pg-top, .pg-sun, .pg-reading, .pg-glance, .pg-toc, .pg-foot,
    .pg-form, .pg-export, .pg-actions, .pg-topics, .legal-status { display: none !important; }
    .pg-hero { padding: 0 0 16px; border: 0; }
    .pg-hero :is(h1, .pg-lede, .pg-meta, .pg-kicker) { color: #000; }
    .pg-layout { display: block; padding: 0; }
    .pg-sheet { padding: 12px 0; box-shadow: none; background: none; opacity: 1 !important; transform: none !important; }
}
