/*
 * みん推wiki の画面の CSS（ビルドなし・外部の読み込みなし）。
 *
 * 値の出どころ（くわしくは README「画面」）:
 *   - 色: Figma の変数（get_variable_defs で取れた 14 個。名前もそのまま）
 *   - 寸法（幅・高さ・余白）: Figma のレイヤーの位置と大きさ（get_metadata）
 *   - 文字の大きさ・太さ・行間・角丸・内側の余白: get_design_context で取った Figma の設定値（2026-11-25）。
 *     部品（ボタン・チップ・入力欄・表・タブ・カード・一覧の行）ごとにまとめ、画面ごとの上書きは置かない。
 *     編集画面（S-08 の項目のカードなど）だけの部品は、Figma の共通の部品に無いものとして前の値のまま。
 *
 * 切り替える幅: 1024px 以上が PC（1440 のカンプ）、それより狭いとスマホ（390 のカンプ）の形。
 * Figma に中間の幅の設計は無い。1024〜1439px は PC の形のまま本文の列が縮む。
 */

/* ---------- デザインの値 ---------- */
:root {
    /* 色（Figma の変数） */
    --bg: #f6f7fb;
    --surface: #ffffff;
    --white: #ffffff;
    --line: #e2e5ef;
    --ink: #1d2340;
    --sub: #6b7190;
    --accent: #4f5bd5;
    --accent-soft: #eceefb;
    --gold: #9a6b00;
    --gold-soft: #fbf3df;
    --green: #1a7f47;
    --green-soft: #e4f5ea;
    --red: #c23b3b;
    --red-soft: #fce9e9;

    /* 書体（Figma: Noto Sans JP の Regular / Medium / Bold。Web フォントは読み込まず、入っている書体を使う） */
    --font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
    --fw-medium: 500;
    --lh: 1.6;       /* Figma の文字はほぼすべて行間 1.6 */

    /* 文字の大きさ（Figma の設定値） */
    --fs-xs: 11px;   /* チップ・下部メニュー・入力欄の補足・表の見出し */
    --fs-s: 12px;    /* 補足・件数・カードのリンク・入力欄のラベル・小さいボタン */
    --fs-ui: 13px;   /* ボタン・表の行・タブ・項目名・チェック・注記・目次 */
    --fs-m: 14px;    /* 本文・項目の値・入力欄・一覧の名前 */
    --fs-l: 15px;    /* 一言説明 */
    --fs-h3: 14px;   /* サイドのカードの見出し */
    --fs-h2: 18px;   /* カード・セクションの見出し */
    --fs-h1: 30px;   /* 人物名 */
    --fs-screen: 22px; /* 画面の見出し（S-06・マイページ・S-15） */

    /* 角丸（Figma の設定値）・余白（Figma の寸法） */
    --radius-card: 12px;
    --radius-btn: 8px;
    --radius-input: 6px;
    --radius-chip: 4px;
    --page-x: 40px;
    --card-pad: 24px;
    --side-pad: 20px;
    --gap-block: 20px;
    --gap-card: 16px;
    --header-h: 64px;
    --side-w: 320px;
    --bottom-nav-h: 43px;
}

/* ---------- 土台 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--fs-m);
    line-height: 1.6;
    overflow-wrap: anywhere;
    min-height: 100vh; display: flex; flex-direction: column;
}
.site-main { flex: 1 0 auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--white); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }
.muted { color: var(--sub); }
.small { font-size: var(--fs-s); }
.only-sp { display: none !important; }

.container { max-width: 1440px; margin: 0 auto; padding: 0 var(--page-x); }
.site-main .container { padding-top: 24px; padding-bottom: 64px; }

/* ---------- ヘッダー（Figma 6:17） ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner {
    max-width: 1440px; margin: 0 auto; height: calc(var(--header-h) - 1px); /* 下の線 1px を含めて 64 / 50 */
    padding: 0 var(--page-x);
    display: flex; align-items: center; gap: 24px;
}
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); flex: none; }
.logo:hover { text-decoration: none; }
/* 印「推」: 16px Bold・行間 1.5・余白 2/8・角丸 8（32×28） */
.logo-mark {
    padding: 2px 8px; border-radius: 8px;
    background: var(--accent); color: var(--white);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; line-height: 1.5;
}
.logo-text { font-size: 18px; font-weight: 700; line-height: 1.5; }
.header-nav { display: flex; gap: 20px; flex: none; }
.header-nav a { color: var(--sub); font-size: var(--fs-m); font-weight: var(--fw-medium); line-height: 1.5; }
.header-search { flex: 1 1 auto; min-width: 120px; }
.header-search input {
    width: 100%; height: 38px; padding: 8px 14px;
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-btn);
    font-size: var(--fs-ui); line-height: 1.5;
}
.header-search input::placeholder { color: var(--sub); }

/* 言語の切り替え: 枠 1px・角丸 8・内側 3・間 2。選んでいる言語は 13px Bold・角丸 6・余白 4/12 */
.lang-switch {
    display: inline-flex; align-items: center; gap: 2px; flex: none; margin-left: auto;
    border: 1px solid var(--line); border-radius: var(--radius-btn); padding: 3px; background: var(--white);
}
.lang-current {
    padding: 4px 12px; border-radius: 6px;
    background: var(--accent); color: var(--white);
    font-size: var(--fs-ui); font-weight: 700; line-height: var(--lh);
}
.lang-more > summary { padding: 4px 12px; border-radius: 6px; line-height: var(--lh); color: var(--sub); font-size: var(--fs-ui); font-weight: var(--fw-medium); }
.caret { font-size: 9px; margin-left: 2px; vertical-align: 1px; }
/* 通知: 12px Medium・行間 1.5・余白 4/10・角丸 16 */
.notif-pill {
    flex: none; padding: 4px 10px; border-radius: 16px;
    background: var(--accent-soft); color: var(--accent); font-size: var(--fs-s); font-weight: var(--fw-medium); line-height: 1.5;
}
.notif-pill:hover { text-decoration: none; }
.user-menu > summary { display: inline-flex; align-items: center; gap: 8px; }
/* ヘッダーの爵位だけ 12px Bold・行間 1.5（ほかのチップは 11px Medium） */
.rank-badge { font-size: var(--fs-s); font-weight: 700; line-height: 1.5; }
.user-name { font-size: var(--fs-ui); font-weight: var(--fw-medium); color: var(--ink); line-height: 1.5; }
.header-login { flex: none; color: var(--ink); font-size: var(--fs-ui); font-weight: 700; }

/* ドロップダウン（details） */
.dropdown { position: relative; flex: none; }
.dropdown > summary { list-style: none; cursor: pointer; user-select: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-panel {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
    min-width: 180px; padding: 6px;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-btn);
    box-shadow: 0 6px 20px rgba(29, 35, 64, .08);
}
.dropdown-panel--right { left: auto; right: 0; }
.dropdown-panel li, .dropdown-panel > a, .dropdown-panel form, .dropdown-name {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: var(--fs-m); color: var(--ink);
}
.dropdown-panel a { color: var(--ink); }
.dropdown-name { color: var(--sub); font-size: var(--fs-s); border-bottom: 1px solid var(--line); }
.dropdown-panel .is-disabled { color: var(--sub); }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: inherit; }
.dropdown-panel .link-button { color: var(--ink); }
/* 長い文のチップ（マイページの「解放されている権限」。英語では1つが 400px を超え、スマホで横にはみ出していた）は折り返す */
.chips--wrap > .chip { max-width: 100%; white-space: normal; }
/* 言語名と「準備中」を1行に（繁體中文 が1文字ずつ折り返していた） */
.lang-more .dropdown-panel li { white-space: nowrap; }

/* ---------- 部品 ---------- */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
    padding: var(--card-pad); min-width: 0;
}
.card--side { padding: var(--side-pad); }
.card--side-lg { padding: 22px; }
/* カードの見出しの行: 見出し 18px Bold・件数 12px sub・右端のリンク 12px Medium、間 10・下に 8（S-03 セクション見出し） */
.card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 12px; }
.card-title { font-size: var(--fs-h2); font-weight: 700; line-height: var(--lh); }
.card-title--sm { font-size: var(--fs-h3); line-height: var(--lh); margin-bottom: 10px; }
.card-head .card-title--sm { margin-bottom: 0; }
.card-title--md { font-size: 16px; }
.card-title--lg { font-size: 20px; }
.card-count { font-size: var(--fs-s); color: var(--sub); }
a.card-count { color: var(--sub); }
.card-link { margin-left: auto; font-size: var(--fs-s); font-weight: var(--fw-medium); }
.card-link-block { display: inline-block; margin-top: 10px; font-size: var(--fs-s); font-weight: var(--fw-medium); }
.card-sub { font-size: var(--fs-xs); color: var(--sub); margin: -4px 0 10px; }

/* チップ: 11px Medium・行間 1.6・余白 2/8・角丸 4（高さ 21.6）。枠つきは 1px 足す */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
    display: inline-flex; align-items: center; padding: 2px 8px;
    border-radius: var(--radius-chip); font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: var(--lh); white-space: nowrap;
    background: var(--bg); color: var(--sub);
}
a.chip:hover { text-decoration: none; filter: brightness(.97); }
.chip--outline { padding: 1px 7px; background: var(--surface); border: 1px solid var(--line); color: var(--sub); }
.chip--period { font-size: var(--fs-s); }
.chip--accent { background: var(--accent-soft); color: var(--accent); }
.chip--gold { background: var(--gold-soft); color: var(--gold); }
.chip--green { background: var(--green-soft); color: var(--green); }
.chip--red { background: var(--red-soft); color: var(--red); }
.chip--muted { background: var(--bg); color: var(--sub); }
.chip--ink { background: var(--ink); color: var(--white); }

/*
 * ボタン: 13px Bold・行間 1.6・角丸 8。
 *   中 = 余白 8/16（塗り 36.8・枠つき 38.8）、大 = 余白 9/16（塗り 38.8・枠つき 40.8）、
 *   小 = 12px・余白 4/10・枠つき（29.2）。塗りは枠なし、枠つきは 1px の line。
 */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 16px; border-radius: var(--radius-btn);
    font-size: var(--fs-ui); font-weight: 700; line-height: var(--lh); white-space: nowrap;
    border: 0; cursor: pointer; font-family: inherit; text-align: center;
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn--primary { background: var(--accent); color: var(--white); }
.btn--outline { padding: 7px 15px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn--lg { padding-top: 9px; padding-bottom: 9px; }
.btn--outline.btn--lg { padding-top: 8px; padding-bottom: 8px; }
.btn--sm { padding: 4px 10px; font-size: var(--fs-s); }
.btn--outline.btn--sm { padding: 3px 9px; }
.btn--danger { background: var(--red); color: var(--white); }
.btn--block { display: flex; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btn-row--end { justify-content: flex-end; }
.btn-stack { display: grid; gap: 12px; margin-top: 14px; }

/* 入力欄: 地 bg・1px line・角丸 6・余白 8/12・14px（高さ 40.4）。トップの検索だけ白地・余白 12・15px */
.input {
    width: 100%; height: 40px; padding: 0 12px;
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-input);
    font-size: var(--fs-m); line-height: var(--lh);
}
textarea.input { height: auto; min-height: 120px; padding: 8px 12px; resize: vertical; }
select.input { padding-right: 8px; }
.input::placeholder { color: var(--sub); }
.input--lg { height: 50px; padding: 0 12px; background: var(--white); font-size: var(--fs-l); }
.input[aria-invalid="true"] { border-color: var(--red); }
/* チェック: 16px の四角（角丸 4）＋ 間 8 ＋ 13px */
.check { display: flex; align-items: center; gap: 8px; font-size: var(--fs-ui); line-height: var(--lh); cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--accent); }
.check.is-disabled { color: var(--sub); cursor: default; }

/* 注記: 余白 12・角丸 8・13px */
.note { background: var(--accent-soft); color: var(--accent); border-radius: var(--radius-btn); padding: 12px; font-size: var(--fs-ui); line-height: var(--lh); }
.note--plain { background: var(--bg); color: var(--ink); }
.note--error { background: var(--red-soft); color: var(--red); }
.flash { background: var(--green-soft); color: var(--green); border-radius: var(--radius-btn); padding: 12px; margin-bottom: 16px; font-size: var(--fs-ui); }

/* 進み具合（次の爵位まで）: 高さ 8・地 line・中身 gold・角丸 4 */
.progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 4px; background: var(--gold); }

/* 一覧の行（領主を募集中・通知・版の一覧・マイページのメニュー〈スマホ〉）: 上下 12・間 12、名前 14px Bold、補足 12px sub、行の中の間 4 */
.list-rows { display: grid; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); }
.list-row:first-child { border-top: 0; }
a.list-row:hover { text-decoration: none; }
.list-row-body { display: grid; gap: 4px; justify-items: start; min-width: 0; flex: 1; }
.list-row-name { font-size: var(--fs-m); font-weight: 700; color: var(--ink); }
.list-row-meta { font-size: var(--fs-s); color: var(--sub); }
.list-row-side { font-size: var(--fs-s); color: var(--sub); white-space: nowrap; flex: none; }

/* 表（S-07・S-10・S-16 など。<table>）: 見出し 地 bg・角丸 6・余白 8/12・11px Bold sub、行 余白 10/12・13px・上線 line、列の間 12 */
.dtable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-ui); }
.dtable th { background: var(--bg); color: var(--sub); font-size: var(--fs-xs); font-weight: 700; text-align: left; padding: 8px 6px; line-height: var(--lh); }
.dtable th:first-child { border-radius: 6px 0 0 6px; padding-left: 12px; }
.dtable th:last-child { border-radius: 0 6px 6px 0; padding-right: 12px; }
.dtable td { padding: 10px 6px; border-top: 1px solid var(--line); vertical-align: middle; color: var(--ink); }
.dtable tbody tr:first-child td { border-top: 0; }
.dtable td:first-child { padding-left: 12px; }
.dtable td:last-child { padding-right: 12px; }
.dtable .num { white-space: nowrap; }
.dtable a { color: var(--ink); }

.breadcrumb { font-size: var(--fs-s); color: var(--sub); margin-bottom: 20px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; }
.breadcrumb li + li::before { content: "／"; margin: 0 2px; }
.breadcrumb a { color: var(--sub); }

.screen-title { font-size: var(--fs-screen); font-weight: 700; line-height: var(--lh); margin: 4px 0 20px; }
.screen-title-count { margin-left: 18px; }

/* 作品の情報など: 項目名 12px sub・幅 72、値 13px、間 12、行の間 10 */
.kv-list { display: grid; gap: 10px; }
.kv-row { display: grid; grid-template-columns: 72px 1fr; gap: 12px; font-size: var(--fs-ui); }
.kv-row dt { color: var(--sub); font-size: var(--fs-s); line-height: 1.75; }

.pager { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; font-size: var(--fs-s); color: var(--sub); }

/* ---------- 2段組み ---------- */
.layout-2col { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); gap: 24px; margin-top: var(--gap-block); align-items: start; }
.layout-2col--home { grid-template-columns: minmax(0, 1fr) 340px; }
.col-main, .col-side { display: grid; gap: var(--gap-card); min-width: 0; }

/* ---------- タイトルカード（S-02 / S-03） ---------- */
.title-card { display: flex; gap: 24px; justify-content: space-between; align-items: flex-start; }
.title-card-body { min-width: 0; flex: 1; }
.title-card-actions { display: flex; gap: 8px; flex: none; }
/* S-03 見出し: 縦の間 8、人物名 30px Bold・行間 1.3、読み 13px sub、一言説明 15px */
.page-name { font-size: var(--fs-h1); font-weight: 700; line-height: 1.3; margin: 8px 0; }
.page-reading { font-size: var(--fs-ui); color: var(--sub); margin-bottom: 8px; }
.page-summary { font-size: var(--fs-l); line-height: var(--lh); margin-bottom: 8px; }

.notice-card { background: var(--accent-soft); border-radius: var(--radius-card); padding: 18px 14px; margin-top: var(--gap-block); }
.notice-title { font-size: var(--fs-l); font-weight: 700; margin-bottom: 6px; }
.notice-card p { font-size: var(--fs-ui); margin-bottom: 12px; }

/* ---------- 項目の行（S-03） ---------- */
.item-rows { border-bottom: 0; }
/* 項目の行: 上線 line・上下 10・間 16、項目名 13px sub・幅 120、値 14px（上でそろえる） */
.item-row {
    display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; column-gap: 16px; align-items: start;
    padding: 10px 0; border-top: 1px solid var(--line);
}
.item-label { font-size: var(--fs-ui); color: var(--sub); line-height: 1.72; }
.item-value { font-size: var(--fs-m); min-width: 0; }
.item-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.is-for-genre .item-label::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 2px; }
.value-list { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.value-list li::before { content: "・"; color: var(--sub); }
.value-note { display: block; font-size: var(--fs-ui); color: var(--sub); margin-top: 2px; }
.value-periods { display: grid; gap: 2px; }
.value-relation-type { color: var(--sub); }
.value-quote { quotes: "「" "」"; }
.value-when { margin-right: 8px; }
.value-people { display: block; font-size: var(--fs-s); color: var(--sub); margin-top: 2px; }
.value-state { color: var(--sub); }

/* ネタバレ（押すと表示。<details>） */
.spoiler > summary { list-style: none; cursor: pointer; color: var(--ink); }
.spoiler > summary::-webkit-details-marker { display: none; }
.spoiler > summary::after { content: " ▾"; color: var(--sub); font-size: 10px; }
.spoiler[open] > summary { color: var(--sub); font-size: var(--fs-s); margin-bottom: 4px; }
.spoiler[open] > summary::after { content: " ▴"; }

.sources { display: inline-block; }
.sources > summary.chip { cursor: pointer; }
.sources-list { min-width: 240px; }
.sources-list li { font-size: var(--fs-s); }

/* ---------- 年表 ---------- */
.timeline-period { margin: 14px 0 6px; }
.timeline-period:first-child { margin-top: 0; }
/* 年表の行: 上下 8・間 16、点 10、時期 13px Bold・幅 100、出来事 14px */
.timeline-row {
    display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; column-gap: 16px; align-items: start;
    padding: 8px 0;
}
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 7px; }
.timeline-main { display: grid; grid-template-columns: 100px minmax(0, 1fr); column-gap: 16px; }
.timeline-when { font-size: var(--fs-ui); font-weight: 700; line-height: 1.72; }
.timeline-text { font-size: var(--fs-m); }
.timeline-spoiler > summary { padding-top: 1px; }
.timeline-more { margin-top: 6px; font-size: var(--fs-s); font-weight: var(--fw-medium); }
.timeline .note { margin-top: 12px; }
.js .timeline:not(.is-expanded) .is-extra { display: none; }

/* ---------- サイド ---------- */
/* サイドのカード: 目次 13px・件数 12px、行の間 10。領主・編集者は 爵位チップ＋名前 13px＋Pt 12px、間 8 */
.toc-list { display: grid; gap: 10px; }
.toc-list li { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-ui); line-height: var(--lh); }
.toc-list a { color: var(--ink); }
.toc-count { color: var(--sub); font-size: var(--fs-s); }
.user-list { display: grid; gap: 10px; }
.user-list li { display: flex; align-items: center; gap: 8px; font-size: var(--fs-ui); }
.user-list-name { min-width: 0; }
.user-badge { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.user-badge-name { color: var(--ink); min-width: 0; }
a.user-badge-name:hover { color: var(--accent); }
.user-list-pt { margin-left: auto; color: var(--sub); font-size: var(--fs-s); white-space: nowrap; }
.side-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 12px; color: var(--accent); }

/* ---------- 表（行ごとのリンク） ---------- */
.ptable { display: grid; }
/* 表の見出し: 地 bg・角丸 6・余白 8/12・11px Bold sub。行: 余白 10/12・13px・行の間に 1px line。列の間 12 */
.ptable-head, .ptable-row { display: grid; align-items: center; column-gap: 12px; padding: 0 12px; }
.ptable-head { padding-top: 8px; padding-bottom: 8px; background: var(--bg); border-radius: var(--radius-input); font-size: var(--fs-xs); font-weight: 700; line-height: var(--lh); color: var(--sub); }
.ptable-row { padding-top: 10px; padding-bottom: 10px; border-top: 1px solid var(--line); color: var(--ink); font-size: var(--fs-ui); }
.ptable-head + .ptable-row { border-top: 0; }
.ptable-row:hover { text-decoration: none; background: #fafbfd; }
.ptable-sub { color: var(--ink); min-width: 0; }
.ptable-date { color: var(--ink); white-space: nowrap; }
.ptable--pages .ptable-head, .ptable--pages .ptable-row { grid-template-columns: 22% minmax(0, 1fr) 70px 110px 90px; }
.ptable--recent .ptable-head, .ptable--recent .ptable-row { grid-template-columns: 22% 18% minmax(0, 1fr) 15% 11%; }
.ptable--recent .ptable-genre { color: var(--ink); }

/* ---------- タブ ---------- */
/* タブ: 余白 8/14・13px（今のタブは Bold accent＋下線 2px）、間 4、下に 1px line。タブのあるカードは中の間 16 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 8px 14px 6px; line-height: var(--lh); color: var(--sub); font-size: var(--fs-ui); white-space: nowrap; border-bottom: 2px solid transparent; }
.tab:hover { text-decoration: none; color: var(--ink); }
.tab.is-current { color: var(--accent); font-weight: 700; border-bottom-color: var(--accent); }
.list-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 16px; }
.period-list { display: flex; flex-wrap: wrap; gap: 8px; }
.prose { font-size: var(--fs-m); line-height: 1.8; }

.lord-list { display: grid; }
.lord-list li { display: grid; gap: 4px; padding: 14px 0; border-top: 1px solid var(--line); }
.lord-list li:first-child { border-top: 0; padding-top: 4px; }
.kv-list--numbers .kv-row, .col-side .kv-list--split .kv-row { display: flex; justify-content: space-between; }
.kv-list--numbers dt { font-size: var(--fs-ui); color: var(--ink); }

/* ---------- トップ（S-01） ---------- */
/* S-01 ヒーロー: 余白 40・縦の間 16、キャッチ 26px Bold・行間 1.4、リード 14px sub、検索 幅 720 */
.hero { padding: 40px; text-align: center; display: grid; gap: 16px; }
.hero-catch { font-size: 26px; font-weight: 700; line-height: 1.4; }
.hero-lead { font-size: var(--fs-m); color: var(--sub); }
.hero-search { width: 100%; max-width: 720px; margin: 0 auto; }
.hero-chips { justify-content: flex-start; }
/* 数値カード: 余白 16・縦の間 2、ラベル 12px sub、数 24px Bold・行間 1.4、補足 11px */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap-card); margin-top: var(--gap-block); }
.stat { padding: 16px; display: grid; gap: 2px; align-content: start; }
.stat-label { font-size: var(--fs-s); color: var(--sub); }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1.4; }
.stat-note { font-size: var(--fs-xs); color: var(--sub); }
.stat-note--up { color: var(--green); }
.genre-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.genre-card {
    position: relative; display: grid; gap: 4px; align-content: start;
    padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-card); color: var(--ink);
}
.genre-card:hover { text-decoration: none; border-color: var(--accent); }
.genre-card-name { font-size: var(--fs-l); }
.genre-card-meta { font-size: var(--fs-s); color: var(--sub); }
.side-list { display: grid; }
.side-list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.side-list-row:first-child { border-top: 0; }
.side-list-row > div { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.side-list-name { font-size: var(--fs-m); font-weight: 700; color: var(--ink); }
.side-list-meta { font-size: var(--fs-s); color: var(--sub); }
.side-list-pt { font-size: var(--fs-s); color: var(--sub); white-space: nowrap; }

/* ---------- 検索（S-04） ---------- */
.layout-search { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.filter-details > summary { list-style: none; cursor: default; }
.filter-details > summary::-webkit-details-marker { display: none; }
.filter-group { border: 0; margin: 0 0 10px; padding: 0; }
.filter-group legend { font-size: var(--fs-s); color: var(--sub); font-weight: 700; padding: 6px 0 2px; }
.col-results { display: grid; gap: var(--gap-card); min-width: 0; }
.result-list { display: grid; }
.result-row { position: relative; padding: 16px 0; border-bottom: 1px solid var(--line); }
.result-row:first-child { padding-top: 4px; }
.result-row:last-child { border-bottom: 0; }
.result-name { font-size: var(--fs-l); font-weight: 700; color: var(--ink); }
.result-sub { font-size: var(--fs-s); color: var(--sub); margin: 4px 0 6px; }
.search-create { justify-self: start; }
.search-box { margin-bottom: 12px; }

/* ---------- 履歴（S-05） ---------- */
.layout-history { display: grid; grid-template-columns: 440px minmax(0, 1fr); gap: 24px; align-items: start; }
/* 版の一覧: 一覧の行と同じ（上下 12、題 14px Bold、補足 12px sub、間 4） */
.version-row { padding: 12px 0; border-top: 1px solid var(--line); }
.version-row:first-child { border-top: 0; }
.version-head { font-size: var(--fs-m); font-weight: 700; display: flex; flex-wrap: wrap; gap: 0 12px; }
.version-summary { font-weight: 700; }
.version-meta { font-size: var(--fs-s); color: var(--sub); margin: 4px 0; }
.version-pick { display: flex; gap: 16px; margin-top: 8px; font-size: var(--fs-s); color: var(--sub); }
.version-pick label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.version-pick input { accent-color: var(--accent); margin: 0; }
.versions-card .btn--block { margin-top: 14px; }
.diff-col { display: grid; gap: var(--gap-card); min-width: 0; }
.diff-card { display: grid; gap: 12px; }
.diff-card .card-head { margin-bottom: 0; }
.diff-row { border: 1px solid var(--line); border-radius: var(--radius-btn); padding: 14px 12px; display: grid; gap: 8px; }
.diff-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-m); }
.diff-before, .diff-after { border-radius: 6px; padding: 10px 14px; font-size: var(--fs-m); }
.diff-before { background: var(--red-soft); color: var(--red); }
.diff-after { background: var(--green-soft); color: var(--green); }
.diff-before del { background: rgba(194, 59, 59, .16); text-decoration: line-through; }
.diff-after ins { background: rgba(26, 127, 71, .16); text-decoration: none; }
.diff-hidden { font-size: var(--fs-ui); }

/* ---------- ログイン（S-06） ---------- */
/* S-06: カード 幅 420・余白 32・縦の間 14、見出し 22px Bold、上下 40 */
.auth-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 420px)); justify-content: center; gap: 24px; padding: 16px 0; align-items: start; }
.auth-layout--single { grid-template-columns: minmax(0, 420px); }
.auth-card { padding: 32px; display: grid; gap: 14px; align-content: start; }
.auth-card form { display: grid; gap: 14px; }
.auth-title { font-size: var(--fs-screen); font-weight: 700; line-height: var(--lh); }
.auth-sub { font-size: var(--fs-ui); color: var(--sub); }
.auth-link { font-size: var(--fs-s); font-weight: var(--fw-medium); justify-self: start; }
.auth-tabs { margin: 0; }
.auth-external { display: grid; gap: 8px; }
.auth-external .btn { justify-content: center; gap: 8px; }
.auth-box { background: var(--accent-soft); border-radius: var(--radius-btn); padding: 12px; display: grid; gap: 8px; justify-items: start; }
.auth-box-title { font-size: var(--fs-ui); font-weight: 700; }
.auth-box p { font-size: var(--fs-s); color: var(--sub); }
/* 入力欄の組: ラベル 12px Medium sub → 4 → 入力欄 → 補足 11px sub / 誤り 12px red */
.field { display: grid; gap: 4px; }
.field label, .field-label { font-size: var(--fs-s); font-weight: var(--fw-medium); color: var(--sub); }
.field-hint { font-size: var(--fs-xs); color: var(--sub); }
.field-error { font-size: var(--fs-s); color: var(--red); }

.message-card { max-width: 720px; margin: 40px auto 0; display: grid; gap: 14px; justify-items: start; }
.message-card .screen-title { margin: 0; }

/* ---------- フッター（Figma に無い。ヘッダーに合わせた簡素なもの） ---------- */
.site-footer { background: var(--white); border-top: 1px solid var(--line); }
.footer-inner { padding-top: 28px; padding-bottom: 28px; display: grid; gap: 12px; }
.logo--small .logo-mark { width: 26px; height: 22px; font-size: 13px; border-radius: 5px; }
.logo--small .logo-text { font-size: var(--fs-l); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: var(--fs-ui); }
.footer-nav a { color: var(--sub); }
.footer-note, .footer-copy { font-size: var(--fs-s); color: var(--sub); }

/* ---------- 下部メニュー（スマホ） ---------- */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--white); border-top: 1px solid var(--line);
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
.bottom-nav a { display: flex; align-items: center; justify-content: center; font-size: var(--fs-xs); line-height: var(--lh); color: var(--sub); }
.bottom-nav a.is-current { color: var(--accent); font-weight: 700; }
.bottom-nav a:hover { text-decoration: none; }

/* ============================================================
 * 編集（S-08 編集画面・S-27 新規ページ作成・S-09 自分のリクエスト）
 * 寸法は Figma のスクリーンショット（PC `6:56` 1440 幅・スマホ `14:1112` 390 幅ほか）から読んだ値。
 * 手引き（figma-design-to-code）が読めず get_design_context を使えなかったため、文字の大きさ・角丸は推測値。
 * ============================================================ */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn:disabled { background: var(--bg); color: var(--sub); border-color: var(--line); cursor: not-allowed; filter: none; }
.btn--danger-soft { background: var(--red-soft); color: var(--red); }
.note--gold { background: var(--gold-soft); color: var(--gold); }
.note--green { background: var(--green-soft); color: var(--green); }
.tab-count { margin-left: 2px; }

/* 編集中の帯（PC は画面の幅いっぱい 63px・スマホはカード） */
.editor-bar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    margin: -24px calc(-1 * var(--page-x)) 24px; padding: 12px var(--page-x);
    min-height: 63px; background: var(--white); border-bottom: 1px solid var(--line);
}
.editor-bar-main { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; min-width: 0; }
.editor-title { font-size: 16px; font-weight: 700; line-height: 1.5; }
.editor-save { font-size: var(--fs-s); color: var(--sub); }
.editor-save.is-error { color: var(--red); }
.editor-bar-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.editor-bar-pt { color: var(--gold); font-weight: 700; font-size: var(--fs-m); white-space: nowrap; margin-right: 2px; }

.editor-banner { border-radius: var(--radius-btn); padding: 12px 14px; margin-bottom: 16px; font-size: var(--fs-ui); }
.editor-banner--error { background: var(--red-soft); color: var(--red); }
.editor-banner--warn { background: var(--gold-soft); color: var(--gold); }
.editor-banner--info { background: var(--accent-soft); color: var(--accent); }
.editor-banner-title { font-weight: 700; margin-bottom: 4px; }
.editor-banner-list { list-style: disc; padding-left: 20px; margin-bottom: 6px; }
.editor-banner .btn { margin-top: 6px; }
.editor-notice { background: var(--gold-soft); border-radius: var(--radius-card); padding: 14px 16px; margin-bottom: 16px; }
.editor-notice-title { font-size: var(--fs-l); font-weight: 700; color: var(--gold); }
.editor-notice-comment { margin-top: 6px; color: var(--ink); }

.editor-layout { display: grid; grid-template-columns: 218px minmax(0, 1fr) 318px; gap: 24px; align-items: start; }
.editor-nav { padding: 16px; position: sticky; top: 87px; }
.editor-nav-title { font-size: var(--fs-s); color: var(--sub); font-weight: 700; margin-bottom: 8px; }
.editor-nav-list a { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 37px; padding: 0 10px; border-radius: var(--radius-btn); color: var(--ink); font-size: var(--fs-ui); }
.editor-nav-list a:hover { background: var(--bg); text-decoration: none; }
.editor-nav-list a.is-current { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.editor-nav-count { height: 20px; }
.editor-main { display: grid; gap: var(--gap-card); min-width: 0; }
.editor-side { display: grid; gap: var(--gap-card); min-width: 0; position: sticky; top: 87px; }
.editor-section { scroll-margin-top: 80px; }
.editor-section > .card-head { margin-bottom: 14px; }
.editor-flow p { font-size: var(--fs-ui); margin-bottom: 10px; }
.editor-summary .card-title { display: block; }
.editor-summary .ed-textarea { min-height: 96px; }
.editor-links { display: flex; gap: 16px; padding: 0 4px; }
.editor-note { font-size: var(--fs-ui); padding: 0 12px; }
.editor-preview { display: grid; gap: var(--gap-card); }
.editor.is-preview .editor-section, .editor.is-preview .editor-nav { display: none; }
.ed-preview-rows { display: grid; }
.ed-preview-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 8px 4px; border-top: 1px solid var(--line); font-size: var(--fs-m); }
.ed-preview-row dt { color: var(--sub); font-size: var(--fs-ui); }
.ed-preview-row.is-changed { background: var(--green-soft); }

/* 見込みPt・変更の概要 */
.est-list { display: grid; gap: 10px; }
.est-row { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-ui); }
.est-row dd { white-space: nowrap; }
.est-row--total dt, .est-row--total dd { color: var(--gold); font-weight: 700; }
.est-note { font-size: var(--fs-xs); color: var(--sub); margin-top: 12px; line-height: 1.7; }

/* 項目のカード */
.ed-items { display: grid; gap: 12px; }
.ed-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 8px; background: var(--white); scroll-margin-top: 90px; }
.ed-item.is-added, .ed-item.is-changed { border: 1.5px solid var(--green); }
.ed-item.is-invalid { border: 1.5px solid var(--red); }
.ed-item-head { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.ed-handle { color: var(--sub); font-size: 12px; letter-spacing: -1px; }
.ed-item-label { font-size: var(--fs-ui); font-weight: 700; }
.ed-item-label--free { flex: 0 1 220px; }
.ed-item-label--free .input { height: 30px; font-weight: 700; font-size: var(--fs-ui); }
.ed-item-status { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.ed-item-tools { display: inline-flex; gap: 4px; }
.ed-icon-btn { min-width: 28px; height: 26px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--sub); font-size: var(--fs-s); cursor: pointer; }
.ed-icon-btn:hover { color: var(--ink); border-color: var(--sub); }
.ed-icon-btn--danger:hover { color: var(--red); border-color: var(--red); }
.ed-item-body { display: grid; gap: 8px; }
.ed-before { font-size: var(--fs-s); color: var(--sub); }
.ed-comment { font-size: var(--fs-s); color: var(--gold); background: var(--gold-soft); border-radius: 6px; padding: 6px 10px; }
.ed-errors li { color: var(--red); font-size: var(--fs-s); }
.ed-errors:empty { display: none; }
.ed-meta-chip { cursor: pointer; border: 0; font-family: inherit; }
.ed-meta-chip.chip--outline { border: 1px solid var(--line); color: var(--accent); }
.ed-meta-inline { border-top: 1px dashed var(--line); padding-top: 10px; }
.ed-empty { font-size: var(--fs-ui); color: var(--sub); padding: 4px 0; }
.ed-period-head { font-size: var(--fs-s); font-weight: 700; color: var(--sub); margin-top: 6px; }

/* 入力欄 */
.ed-field { display: grid; gap: 4px; min-width: 0; }
.ed-label { font-size: var(--fs-s); color: var(--sub); }
.ed-input, .ed-select, .ed-textarea, .ed-rich { background: var(--bg); }
.ed-textarea { height: auto; min-height: 44px; padding: 9px 13px; line-height: 1.6; resize: vertical; }
.ed-select { padding-right: 8px; }
.ed-counter { font-size: var(--fs-s); color: var(--sub); }
.ed-counter.is-over { color: var(--red); }
.ed-hint { font-size: var(--fs-s); color: var(--sub); }
.input:disabled, .input[readonly] { color: var(--sub); }
.ed-seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ed-seg-btn, .ed-chip-btn {
    height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--white);
    color: var(--sub); font-size: var(--fs-s); cursor: pointer;
}
.ed-seg-btn[aria-pressed="true"], .ed-chip-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); font-weight: 700; }
.ed-seg-btn.is-danger[aria-pressed="true"] { background: var(--red-soft); border-color: var(--red-soft); color: var(--red); }
.ed-state { display: grid; gap: 6px; justify-items: start; }
.ed-state-note { width: 100%; }
.ed-item-head .ed-state-seg { margin-left: 4px; }
.ed-item-head .ed-seg-btn { height: 22px; padding: 0 8px; font-size: var(--fs-xs); }
.ed-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-check-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; font-size: var(--fs-ui); cursor: pointer; }
.ed-check-chip input { accent-color: var(--accent); margin: 0; }
.ed-check-chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.ed-numdate { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ed-number { flex: 0 1 220px; }
.ed-unit { flex: 0 1 100px; }
.ed-date { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ed-date-part { display: inline-flex; align-items: center; gap: 4px; }
.ed-date-y { width: 96px; }
.ed-date-m, .ed-date-d { width: 110px; }
.ed-date-unit { font-size: var(--fs-ui); color: var(--sub); }
.ed-date-md { font-size: var(--fs-s); padding: 0; }
.ed-ranges { display: grid; gap: 10px; }
.ed-range { display: grid; gap: 6px; }
.ed-range-main { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 10px; }
.ed-range-sep { padding-bottom: 10px; color: var(--sub); }
.ed-range-enddate { margin-top: 6px; }
.ed-range-remove { font-size: var(--fs-s); justify-self: start; }
.ed-range-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: var(--fs-s); }
.ed-range-foot .link-button { font-size: var(--fs-s); }
.ed-relation { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px 10px; }
.ed-relation-note { grid-column: 1 / -1; }
.ed-chosen { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-chosen:empty { display: none; }
.ed-chosen-chip { gap: 6px; height: 26px; font-size: var(--fs-s); }
.ed-chip-x { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 2px; font-size: 14px; line-height: 1; }
.ed-picker { position: relative; }
.ed-listbox {
    position: absolute; z-index: 25; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow-y: auto;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-btn); box-shadow: 0 6px 20px rgba(29, 35, 64, .1); padding: 4px;
}
.ed-option { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: var(--fs-ui); }
.ed-option.is-active, .ed-option:hover { background: var(--accent-soft); }
.ed-option.is-empty { color: var(--sub); cursor: default; background: none; }
.ed-option-sub { color: var(--sub); font-size: var(--fs-s); }

/* 説明文（太字とリンクだけ） */
.ed-rich-wrap { display: grid; gap: 6px; }
.ed-rich-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-tool { height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); font-size: var(--fs-s); color: var(--ink); cursor: pointer; }
.ed-rich { height: auto; min-height: 80px; padding: 9px 13px; line-height: 1.7; white-space: pre-wrap; }
.ed-rich:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.ed-rich-link { color: var(--accent); text-decoration: underline; cursor: text; }
.ed-rich-linkbox { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }

/* 年表（PC は表の形） */
.ed-tl-head { display: grid; grid-template-columns: 90px 130px minmax(0, 1fr) 110px; gap: 8px; padding: 0 12px; font-size: var(--fs-s); color: var(--sub); font-weight: 700; }
.ed-event { display: grid; grid-template-columns: 90px 130px minmax(0, 1fr) 110px; gap: 8px; align-items: start; }
.ed-event--real { grid-template-columns: minmax(0, 1.6fr) minmax(0, 2fr) 110px; }
.ed-event:not(:has(.ed-ev-period)) { grid-template-columns: 90px minmax(0, 1fr) 110px; }
.ed-event--real:not(:has(.ed-ev-period)) { grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) 110px; }
.ed-item--event { border-color: transparent; padding: 6px 12px; }
.ed-item--event .ed-event .ed-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ed-item--event .ed-item-head .ed-item-label, .ed-item--event .ed-item-head > .chip, .ed-item--event .ed-handle { display: none; }
.ed-item--event.is-added, .ed-item--event.is-changed { background: var(--green-soft); border: 1.5px solid var(--green-soft); }
.ed-item--event.is-invalid { border-color: var(--red); }
.ed-item--event .ed-date-y { width: 70px; }
.ed-item--event .ed-date-m, .ed-item--event .ed-date-d { width: 86px; }

/* 項目の追加（C-07） */
.ed-add { margin-top: 12px; border: 1.5px dashed var(--accent); border-radius: 10px; padding: 12px 14px; }
.ed-add-title { font-weight: 700; color: var(--accent); font-size: var(--fs-m); }
.ed-add-sub { font-size: var(--fs-s); color: var(--sub); margin: 8px 0 4px; }
.ed-add-def { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 0 8px; border: 0; background: none; text-align: left; border-radius: 6px; cursor: pointer; font-size: var(--fs-ui); color: var(--ink); }
.ed-add-def:hover, .ed-add-def:focus-visible { background: var(--accent-soft); }
.ed-add-chip { cursor: pointer; font-family: inherit; height: 28px; font-size: var(--fs-s); }
.ed-add-chip.chip--outline { color: var(--ink); }
.ed-add--timeline { border: 0; padding: 0; }
.ed-add-row { border: 0; background: none; color: var(--accent); font-weight: 700; font-size: var(--fs-m); cursor: pointer; padding: 4px 0; }
.ed-free { margin-top: 10px; display: grid; gap: 6px; }
.ed-free-row { display: grid; grid-template-columns: minmax(0, 1fr) 200px auto; gap: 8px; align-items: end; }
.ed-free--big .ed-free-row { grid-template-columns: minmax(0, 1fr); }
.ed-meta-sub { font-size: var(--fs-s); color: var(--sub); font-weight: 400; margin-left: 10px; }
.ed-deleted-list { display: grid; gap: 6px; margin-top: 10px; }
.ed-deleted-list:empty { display: none; }
.ed-deleted { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: var(--fs-ui); color: var(--sub); }
.ed-deleted .link-button { font-size: var(--fs-s); }

/* 付帯情報（S-30。PC はカードの中で開く） */
.ed-meta { display: grid; gap: 16px; }
.ed-meta-group { display: grid; gap: 8px; }
.ed-meta-title { font-size: var(--fs-m); font-weight: 700; }
.ed-sources { display: grid; gap: 10px; }
.ed-sources:empty { display: none; }
.ed-source { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ed-source-body { display: grid; gap: 6px; }
.ed-radios { display: grid; gap: 2px; }

/* スマホの別の画面（S-29〜S-31・S-33） */
.editor-panel { position: fixed; inset: 0; z-index: 60; overflow-y: auto; background: var(--bg); padding-bottom: 60px; }
.editor-panel-inner { padding-top: 16px; display: grid; gap: 14px; }
.editor-panel-back { justify-self: start; font-size: var(--fs-s); }
.editor-panel-title { margin: 0; }
.editor-panel-sub { font-size: var(--fs-ui); color: var(--sub); margin-top: -10px; }
.editor-panel-body { display: grid; gap: 14px; }
.editor-panel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.editor-panel-actions .btn { width: 100%; height: 39px; }
.ed-panel-card { display: grid; gap: 4px; }
.ed-panel-card-title { font-size: 17px; font-weight: 700; }
.ed-panel-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.ed-panel-row:first-child { border-top: 0; }
.ed-panel-row > div { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.ed-panel-row-name { font-weight: 700; font-size: var(--fs-m); }
body.has-panel { overflow: hidden; }

/* S-27 新規ページ作成 */
.layout-2col--form { grid-template-columns: minmax(0, 1fr) 360px; margin-top: 0; }
.screen-title--tight { margin-bottom: 6px; }
.form-stack { display: grid; gap: var(--gap-card); }
.form-card { display: grid; gap: 14px; }
.card-title--form { font-size: var(--fs-l); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-card .field .input { background: var(--bg); }
.form-card select.input { padding-right: 8px; }
.form-actions { justify-content: flex-end; }
.same-name-list { list-style: disc; padding-left: 20px; margin: 4px 0 8px; }

/* S-09 自分のリクエスト */
/* マイページ（S-07・S-09〜S-11・S-28）・規約（S-16）の左メニュー: 幅 220（S-16 は 240）・余白 12・間 2、見出し 12px Bold sub、項目 余白 7/10・角丸 6・13px */
.layout-mypage { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.layout-mypage--wide-menu { grid-template-columns: 240px minmax(0, 1fr); }
.mypage-menu { padding: 12px; }
.mypage-menu ul { display: grid; gap: 2px; }
.mypage-menu-title { font-size: var(--fs-s); color: var(--sub); font-weight: 700; margin-bottom: 2px; }
.mypage-menu a, .mypage-menu .is-disabled { display: block; padding: 7px 10px; border-radius: var(--radius-input); color: var(--ink); font-size: var(--fs-ui); line-height: var(--lh); }
.mypage-menu a:hover { text-decoration: none; background: var(--bg); }
.mypage-menu a.is-current { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.mypage-menu .is-disabled { color: var(--sub); }
.mypage-main { display: grid; gap: var(--gap-card); min-width: 0; }
.mypage-main .screen-title { margin: 0; }
.mypage-main > .tabs { margin: 0; }
.requests-card { padding-top: 12px; }
.rtable { display: grid; }
.rtable-head, .rtable-row { display: grid; grid-template-columns: 76px 16% minmax(0, 1fr) 150px 96px 84px 140px; column-gap: 14px; align-items: center; padding: 0 12px; }
.rtable-head { padding-top: 8px; padding-bottom: 8px; background: var(--bg); border-radius: var(--radius-input); font-size: var(--fs-xs); font-weight: 700; line-height: var(--lh); color: var(--sub); }
.rtable-row { min-height: 44px; padding-top: 6px; padding-bottom: 6px; border-top: 1px solid var(--line); font-size: var(--fs-ui); }
.rtable-head + .rtable-row { border-top: 0; }
.rtable-page a { color: var(--ink); }
.rtable-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.rtable-actions form { display: inline; }
.comment-card { display: grid; gap: 10px; }
.comment-card .card-head { margin-bottom: 0; }
.comment-items { display: grid; gap: 4px; font-size: var(--fs-ui); }
.empty-card { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 48px 24px; }

/* ============================================================
 * 会員まわり（S-07 プロフィール・S-10 Ptの履歴・S-11 通知・S-28 設定・S-15・S-16・通報）
 * 値は get_design_context（README「画面」）。共通の部品（カード・表・タブ・一覧の行・入力欄）はそのまま使い、ここは並べ方だけ。
 * ============================================================ */
.mypage-main .screen-title, .form-page .screen-title { margin: 0; }
.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* position: relative は、表の中の絶対配置（見出しの .visually-hidden など）を横に送る枠の中に閉じ込めるため
   （無いと、表が枠より広い時にページ全体が横にはみ出す。S-14 の対訳表で起きた） */
.table-scroll { overflow-x: auto; position: relative; }
.form-subtitle { font-size: 16px; font-weight: 700; line-height: var(--lh); }
.form-page { max-width: 760px; margin: 0 auto; display: grid; gap: var(--gap-card); }
.form-page .prose { font-size: var(--fs-m); }
.form-narrow { max-width: 560px; }
.check-list { display: grid; gap: 12px; }
.check-list--2col { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.bullet-list { list-style: disc; padding-left: 20px; display: grid; gap: 4px; font-size: var(--fs-ui); }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field > legend { padding: 0; margin-bottom: 4px; }

/* アイコン（A-03。用意した絵柄を絵文字で出す） */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); font-size: 18px; line-height: 1; }
.avatar--lg { width: 44px; height: 44px; font-size: 24px; }
.icon-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-choice { position: relative; cursor: pointer; }
.icon-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.icon-choice .avatar { width: 40px; height: 40px; font-size: 20px; background: var(--bg); border: 2px solid transparent; }
.icon-choice input:checked + .avatar { border-color: var(--accent); background: var(--accent-soft); }
.icon-choice input:focus-visible + .avatar { outline: 2px solid var(--accent); outline-offset: 2px; }

/* S-07 プロフィールの見出しのカード: 縦の間 12、名前 24px Bold、累計 13px sub、進み具合の下に 12px の行 */
.profile-head { display: grid; gap: 12px; }
.profile-head-row, .points-head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.profile-name { font-size: 24px; font-weight: 700; line-height: var(--lh); }
.profile-head-spacer { flex: 1; }
.profile-summary { font-size: var(--fs-ui); color: var(--sub); }
.progress-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: var(--fs-s); color: var(--sub); }
.progress-legend strong { color: var(--gold); }
.stats--profile { margin-top: 0; }
.mypage-main > .stats { margin-top: 0; }

/* S-10 Ptの履歴の見出しのカード: 縦の間 10、累計 20px Bold、次の爵位まで 13px Bold gold */
.points-head { display: grid; gap: 10px; }
.points-total { font-size: 20px; font-weight: 700; line-height: var(--lh); }
.points-next { font-size: var(--fs-ui); color: var(--gold); }
.dtable .is-minus { color: var(--red); }

/* S-11 通知 */
.notif-card { padding-top: 16px; }
.notif-card .tabs { margin-bottom: 0; }
.notif-row.is-unread .list-row-name { color: var(--ink); }
.notif-row:not(.is-unread) .list-row-name { font-weight: var(--fw-medium); }
.notif-side { display: grid; justify-items: end; gap: 4px; flex: none; }
.notif-side form { display: inline; }

/* S-28 設定: 2列（間 16）、下の行は右寄せ（退会する 12px red・ログアウト・保存する） */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.settings-col { display: grid; gap: 16px; min-width: 0; }
.settings-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.settings-actions form { display: inline; }
.settings-withdraw { color: var(--red); font-size: var(--fs-s); margin-right: 4px; }
.form-card .check { min-height: 21px; }

/* S-16 規約・ガイドライン: 本文のカード 余白 32・縦の間 20、題 24px Bold、小見出し 16px Bold、本文 14px */
.doc-card { padding: 32px; display: grid; gap: 20px; min-width: 0; }
.doc-title { font-size: 24px; font-weight: 700; line-height: var(--lh); }
.doc-meta { font-size: var(--fs-s); color: var(--sub); }
.doc-section { display: grid; gap: 6px; font-size: var(--fs-m); }
.doc-heading { font-size: 16px; font-weight: 700; line-height: var(--lh); }
/* 規約・プライバシーポリシーの本文（条・項の番号つきの箇条書き） */
.doc-body { display: grid; gap: 20px; font-size: var(--fs-m); line-height: var(--lh); }
.doc-body ol { margin: 0; padding-left: 1.6em; display: grid; gap: 6px; list-style: decimal; }
.doc-body ol ol { margin-top: 6px; list-style: lower-alpha; }
.doc-body a { color: var(--accent); text-decoration: underline; }

/* S-15 申請・通報 */
.input--file { text-align: left; color: var(--sub); cursor: not-allowed; }
.report-target { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-m); }
.removal-items { max-height: 260px; overflow-y: auto; padding: 4px 0; }
.version-report { font-size: var(--fs-xs); color: var(--sub); margin-left: auto; }
.verify-banner { margin-bottom: 16px; }
.verify-banner a { font-weight: 700; color: inherit; text-decoration: underline; }

/* ============================================================
 * PC の中で狭い幅（1024〜1199px）: ヘッダーの間を詰める
 * ============================================================ */
@media (max-width: 1199.98px) {
    .header-inner { gap: 16px; }
    .header-nav { gap: 14px; }
    .layout-history { grid-template-columns: 360px minmax(0, 1fr); }
    .genre-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .editor-layout { grid-template-columns: 180px minmax(0, 1fr) 280px; gap: 16px; }
    .rtable-head, .rtable-row { grid-template-columns: 64px 16% minmax(0, 1fr) 120px 90px 70px 120px; column-gap: 10px; }
}

/* ============================================================
 * スマホ（1024px 未満。390 のカンプ）
 * ============================================================ */
@media (max-width: 1023.98px) {
    :root {
        --page-x: 16px;
        --card-pad: 16px;
        --side-pad: 16px;
        --gap-block: 16px;
        --header-h: 50px;
        --fs-h1: 24px;
        --fs-h2: 16px;
        --fs-h3: 16px;
    }
    .only-pc { display: none !important; }
    .only-sp { display: revert !important; }
    .bottom-nav.only-sp { display: grid !important; }
    .btn.only-sp, .btn--block.only-sp { display: flex !important; }
    span.only-sp { display: inline !important; }
    body { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px)); }
    .site-main .container { padding-top: 16px; padding-bottom: 32px; }

    /* スマホのヘッダー（Figma 14:944）: 上下 10・左右 16・間 8。印 14px・余白 0/6・角丸 6、ロゴ 16px、言語 11px（各 余白 2/6・角丸 5、外枠 角丸 6）、☰ 18px */
    .header-inner { gap: 8px; }
    .logo-mark { padding: 0 6px; font-size: 14px; line-height: var(--lh); border-radius: 6px; }
    .logo-text { font-size: 16px; line-height: var(--lh); }
    .lang-switch { padding: 0; gap: 0; border-radius: 6px; }
    .lang-current { padding: 2px 6px; font-size: var(--fs-xs); border-radius: 5px; }
    .lang-more > summary { padding: 2px 6px; font-size: var(--fs-xs); border-radius: 5px; }
    .rank-badge { font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: var(--lh); }
    .header-login { font-size: var(--fs-s); }
    .sp-menu > summary { font-size: 18px; line-height: var(--lh); padding: 0 0 0 2px; }
    .user-menu .dropdown-panel { right: -30px; }
    /* 言語の「ほかの言語」: 左そろえだと画面の右からはみ出し（390 で約 24〜60px）、横に送れてしまうため右そろえにし、言語名と「準備中」を折り返さない */
    .lang-more .dropdown-panel { left: auto; right: 0; }
    /* 項目の「出典 n」: 右そろえ・幅 240 だと、左に寄った項目で画面の左からはみ出す（-15px）。スマホは項目のチップの行の幅に合わせる */
    .item-chips { position: relative; }
    .item-chips .sources { position: static; }
    .item-chips .sources-list { left: 0; right: auto; min-width: 0; width: 100%; }

    .card { border-radius: var(--radius-card); }
    .card-head { margin-bottom: 10px; }
    .card-title--lg { font-size: 18px; }
    .breadcrumb { margin-bottom: 14px; }
    .screen-title { font-size: 20px; margin: 0 0 16px; }
    .screen-title-sub { font-size: var(--fs-m); font-weight: 400; color: var(--sub); }

    .layout-2col, .layout-2col--home, .layout-search, .layout-history { grid-template-columns: minmax(0, 1fr); gap: var(--gap-card); }

    .title-card { display: grid; gap: 14px; }
    .title-card-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
    .title-card-actions .btn { width: 100%; }
    .page-name { line-height: 1.4; margin: 10px 0 4px; }
    .page-summary { font-size: var(--fs-m); }
    .notice-card { margin-top: var(--gap-card); }

    /* 項目: 短い値は「項目名 … 値（右寄せ）」の1行、長い値・ネタバレは縦並び */
    .item-row {
        grid-template-columns: auto minmax(0, 1fr); min-height: 0; padding: 6px 0; border-top: 0; column-gap: 12px;
    }
    .item-label { font-size: var(--fs-m); color: var(--ink); }
    .item-value { text-align: right; font-weight: 700; }
    .item-row .item-chips { grid-column: 1 / -1; justify-content: flex-end; }
    .item-row--stacked { display: block; padding: 12px 0; border-top: 1px solid var(--line); margin-top: 6px; }
    .item-rows > .item-row--stacked:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
    .item-row--stacked .item-label { font-size: var(--fs-s); color: var(--sub); margin-bottom: 2px; }
    .item-row--stacked .item-value { text-align: left; font-weight: 400; font-size: var(--fs-l); line-height: 1.7; }
    .item-row--stacked .item-chips { justify-content: flex-start; margin-top: 6px; }
    .value-list { justify-content: inherit; }
    .toc-chips .chips { gap: 6px; }

    .timeline-row { display: block; padding: 14px 0; border-top: 1px solid var(--line); }
    .timeline-period + .timeline-row { border-top: 0; }
    .timeline-dot { display: none; }
    .timeline-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .timeline-text { color: var(--sub); }
    .timeline-row .item-chips { justify-content: flex-start; margin-top: 6px; }
    .timeline-more { display: flex; justify-content: center; width: 100%; height: 41px; align-items: center; margin-top: 12px;
        border: 1px solid var(--line); border-radius: var(--radius-btn); color: var(--ink); font-weight: 700; font-size: var(--fs-m); }

    .kv-row { display: flex; justify-content: space-between; gap: 12px; }
    .kv-row dt { font-size: var(--fs-m); color: var(--ink); line-height: 1.6; }
    .kv-row dd { text-align: right; font-weight: 700; }

    /* 表 → 縦並びの行 */
    .ptable-row { display: grid; grid-template-columns: minmax(0, 1fr) auto !important; row-gap: 4px; padding: 14px 0; position: relative; }
    .ptable-row > * { grid-column: 1; }
    .ptable-name { font-size: var(--fs-l); font-weight: 700; }
    .ptable-sub { font-size: var(--fs-ui); color: var(--sub); }
    .ptable--pages .ptable-row { grid-template-areas: none; }
    .ptable-row .ptable-chip { display: inline-flex; }
    .ptable--pages .ptable-row { display: flex !important; flex-wrap: wrap; gap: 4px 6px; padding-right: 20px; }
    .ptable--pages .ptable-name, .ptable--pages .ptable-sub { flex-basis: 100%; }
    .ptable--recent .ptable-genre { display: none; }
    .ptable--recent .ptable-date { position: absolute; right: 0; top: 40px; font-size: var(--fs-ui); color: var(--sub); }
    .ptable--recent .ptable-content { padding-right: 70px; }
    .ptable-caret, .genre-card-caret, .result-caret { position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: var(--sub); }

    .tabs { margin-top: -6px; }
    .tab { padding: 0 10px; }
    .list-filter { grid-template-columns: minmax(0, 1fr); }

    .hero { padding: 20px 16px; text-align: left; }
    .hero-catch { font-size: 20px; line-height: 1.5; }
    .hero-lead { margin: 8px 0 12px; font-size: var(--fs-m); }
    .hero-chips { margin-top: 12px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: var(--gap-card); }
    .stat { min-height: 83px; padding: 16px; }
    .stat-value { font-size: 20px; line-height: 30px; }
    .genre-grid { grid-template-columns: minmax(0, 1fr); gap: 0; margin-bottom: 12px; }
    .genre-card { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 16px 14px 0; }
    .genre-card-name { font-size: var(--fs-l); }

    .filter-details > summary { cursor: pointer; margin-bottom: 0; }
    .filter-details > summary::after { content: " ▾"; color: var(--sub); font-size: 11px; }
    .filter-details[open] > summary { margin-bottom: 8px; }
    .result-row { padding-right: 20px; }
    .search-create { justify-self: stretch; }
    .search-create.btn { display: flex; width: 100%; }

    .version-pick { margin-top: 6px; }
    .diff-col > .btn-row { display: grid; }
    .diff-col > .btn-row .btn { width: 100%; }

    .auth-layout { grid-template-columns: minmax(0, 1fr); margin-top: 0; gap: var(--gap-card); }

    /* 編集（スマホ） */
    .editor-bar { position: relative; margin: 0 0 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-card); display: block; min-height: 0; }
    .editor-bar-main { display: grid; gap: 6px; padding-right: 96px; }
    .editor-title { font-size: 18px; }
    .editor-bar-actions { position: absolute; right: 16px; bottom: 16px; }
    .editor-layout { grid-template-columns: minmax(0, 1fr); gap: var(--gap-card); }
    .editor-nav { position: sticky; top: 0; z-index: 15; border: 0; border-radius: 0; background: var(--bg); margin: 0 calc(-1 * var(--page-x)); padding: 0 var(--page-x); border-bottom: 1px solid var(--line); }
    .editor-nav-list { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
    .editor-nav-list a { white-space: nowrap; min-height: 42px; border-radius: 0; padding: 0 10px; font-size: var(--fs-m); color: var(--sub); border-bottom: 2px solid transparent; }
    .editor-nav-list a.is-current { background: none; color: var(--accent); border-bottom-color: var(--accent); }
    .editor-nav-count { display: none; }
    .editor-side { position: static; }
    .editor-section { padding: 16px; }
    .ed-item-head { flex-wrap: wrap; }
    .ed-relation { grid-template-columns: minmax(0, 1fr); }
    .ed-free-row { grid-template-columns: minmax(0, 1fr); }
    .ed-tl-head { display: none; }
    .ed-event, .ed-event--real, .ed-event:not(:has(.ed-ev-period)), .ed-event--real:not(:has(.ed-ev-period)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ed-ev-text, .ed-ev-type, .ed-event--real .ed-ev-when { grid-column: 1 / -1; }
    .ed-item--event { border: 1px solid var(--line); padding: 12px; }
    .ed-item--event .ed-event .ed-label { position: static; width: auto; height: auto; clip: auto; overflow: visible; }
    .ed-item--event .ed-item-head .ed-item-label, .ed-item--event .ed-item-head > .chip, .ed-item--event .ed-handle { display: revert; }
    .ed-item--event.is-added, .ed-item--event.is-changed { background: var(--white); border: 1.5px solid var(--green); }
    .ed-date-y, .ed-item--event .ed-date-y { width: 80px; }
    .ed-date-m, .ed-date-d, .ed-item--event .ed-date-m, .ed-item--event .ed-date-d { width: 96px; }
    .ed-add-row { width: 100%; height: 41px; border: 1px solid var(--line); border-radius: var(--radius-btn); color: var(--ink); }
    .editor-sp-actions.only-sp { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; }
    .editor-sp-actions .btn { width: 100%; height: 41px; }
    .editor-flow { background: none; border: 0; padding: 0 12px; }
    .editor-flow .card-title, .editor-flow .chip { display: none; }
    .ed-preview-row { grid-template-columns: 110px minmax(0, 1fr); }

    .layout-2col--form { grid-template-columns: minmax(0, 1fr); }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .form-actions { display: grid; }
    .form-actions .btn { width: 100%; }
    .form-actions .btn--outline { display: none; }

    .layout-mypage { grid-template-columns: minmax(0, 1fr); }
    .rtable-row { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 14px 76px 14px 0; }
    .rtable-id, .rtable-page { font-weight: 700; font-size: var(--fs-l); }
    .rtable-content { flex-basis: 100%; color: var(--sub); font-size: var(--fs-ui); }
    .rtable-status { flex-basis: 100%; }
    .rtable-pt { position: absolute; right: 0; top: 16px; color: var(--sub); font-size: var(--fs-ui); }
    .rtable-actions { position: absolute; right: 0; bottom: 14px; flex-direction: column; align-items: flex-end; }
    .comment-resubmit { width: 100%; }
    .comment-card .btn-row { display: grid; }
    /* スマホの S-06（Figma 14:943）: カードの余白 16・縦の間 14 */
    .auth-card { padding: 16px; }
    .message-card { margin-top: 0; }

    /* 会員まわり（スマホ） */
    .layout-mypage--wide-menu { grid-template-columns: minmax(0, 1fr); }
    .only-pc-grid, .only-pc-cell { display: none; }
    .stats--profile { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mypage-hub { padding-top: 4px; padding-bottom: 4px; }
    .profile-name { font-size: 20px; }
    .profile-head-row .btn { order: 10; }
    .settings-grid { grid-template-columns: minmax(0, 1fr); }
    .settings-col { display: contents; }
    .settings-notify { order: 10; }
    .settings-actions { flex-wrap: wrap; justify-content: stretch; }
    .settings-actions .btn, .settings-actions form { flex: 1 1 40%; }
    .settings-actions form .btn { width: 100%; }
    .settings-withdraw { order: 10; flex-basis: 100%; text-align: center; margin: 8px 0 0; }
    .check-list--2col { grid-template-columns: minmax(0, 1fr); }
    .doc-card { padding: 16px; gap: 16px; }
    .doc-title { font-size: 20px; }
    .dtable td, .dtable th { white-space: normal; }
    .dtable--points td:nth-child(2), .dtable--points th:nth-child(2) { display: none; }
    .notif-side { align-self: start; }
    .screen-head .btn { flex: none; }
}

/* ---------- 領主の仕事場（S-12・S-13・S-14・S-19・S-34・S-44）と立候補（S-18・S-35・S-43） ----------
 * 値は Figma の S-12 `13:591` の get_design_context（見出し 22px Bold・チップ・タブ・表の見出し 11px Bold／行 13px・
 * 余白 10/12・列の幅 90/180/1fr/170/120/120/110）と、ほかの画面のスクリーンショットの寸法（S-13 は 280 / 1fr / 300）。
 * 仕事場は「タブの入った大きなカード（余白 24・角丸 12）」の中に、枠つきのカード（.subcard）を2列（1fr / 380）で並べる。
 */
.desk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 4px 0 20px; }
.desk-head .screen-title { margin: 0; }
.desk-head-spacer { flex: 1; }
.desk-head-rate { font-size: var(--fs-s); color: var(--sub); }
.desk-switch { display: flex; gap: 6px; align-items: center; }
.input--sm { padding: 4px 8px; font-size: var(--fs-ui); width: auto; }
.desk { display: grid; gap: var(--gap-card); }
.desk > .tabs { margin: 0; }
.tab.is-disabled { color: var(--sub); opacity: .7; cursor: default; display: inline-flex; gap: 4px; align-items: center; }
.stats--desk { margin-top: 0; }
.stats--desk .stat, .stats--limits .stat { border-radius: var(--radius-card); }
.stat-note--down { color: var(--red); }
.desk-empty { text-align: center; padding: 24px; }
.desk-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.desk-filter-input { flex: 1 1 320px; }
.subcard { border: 1px solid var(--line); border-radius: var(--radius-card); padding: var(--card-pad); display: grid; gap: 12px; min-width: 0; background: var(--surface); }
.subcard > .card-head { margin-bottom: 0; }
.desk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--gap-block); align-items: start; }
.desk-col { display: grid; gap: var(--gap-block); min-width: 0; }

/* S-12 の表 */
.qtable { display: grid; }
.qtable-head, .qtable-row { display: grid; grid-template-columns: 90px 180px minmax(0, 1fr) 170px 120px 120px 110px; gap: 12px; align-items: center; padding: 10px 12px; font-size: var(--fs-ui); }
.qtable-head { background: var(--bg); color: var(--sub); font-size: var(--fs-xs); font-weight: 700; border-radius: var(--radius-input); padding-top: 8px; padding-bottom: 8px; }
.qtable-row + .qtable-row { border-top: 1px solid var(--line); }
.qtable-page a { color: var(--ink); }
.qtable-sub { display: block; font-size: var(--fs-xs); color: var(--sub); }
.qtable-editor { flex-wrap: nowrap; overflow: hidden; }
.creation-row { align-items: center; }
.inline-form > summary { list-style: none; cursor: pointer; }
.inline-form > summary::-webkit-details-marker { display: none; }
.inline-form[open] > summary { margin-bottom: 8px; }
.inline-form-body { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form--block { width: 100%; }
.inline-form--block .inline-form-body { border: 1px solid var(--line); border-radius: var(--radius-btn); padding: 16px; background: var(--bg); }
.inline-form--block .inline-form-body.form-grid, .inline-form--block .inline-form-body.form-stack { display: grid; }

/* S-13 リクエスト確認 */
.review-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 20px; }
.review-bar-title { font-size: 16px; font-weight: 700; }
.review-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr) 300px; gap: var(--gap-card); align-items: start; }
.review-queue { padding: 12px; display: grid; gap: 8px; }
.review-queue-title { font-size: var(--fs-s); color: var(--sub); font-weight: 700; }
.review-queue-item { display: grid; gap: 4px; justify-items: start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-btn); color: var(--ink); }
.review-queue-item:hover { text-decoration: none; background: var(--bg); }
.review-queue-item.is-current { background: var(--accent-soft); border-color: var(--accent); }
.review-main, .review-side { display: grid; gap: var(--gap-card); min-width: 0; }
.review-head { display: grid; gap: 12px; }
.review-head-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
.review-head-row > .chip { margin-left: auto; }
.review-page { font-size: 20px; font-weight: 700; }
.review-page a { color: var(--ink); }
.review-summary p + p { margin-top: 4px; }
.change-list { display: grid; gap: 12px; }
.change-card { border: 1px solid var(--line); border-radius: var(--radius-btn); padding: 12px; display: grid; gap: 8px; }
.change-card.is-decided { background: var(--bg); }
.change-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-ui); }
.change-label { font-size: var(--fs-ui); }
.change-pt { margin-left: auto; color: var(--gold); font-weight: 700; font-size: var(--fs-s); }
.change-field { font-size: var(--fs-s); color: var(--sub); }
.item-decision { border: 0; margin: 0; padding: 8px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 8px; min-width: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-btn); padding: 3px; gap: 2px; justify-self: start; }
.seg-btn { position: relative; padding: 4px 12px; border-radius: var(--radius-input); font-size: var(--fs-ui); cursor: pointer; color: var(--sub); }
.seg-btn input { position: absolute; opacity: 0; pointer-events: none; }
.seg-btn:has(input:checked) { background: var(--green-soft); color: var(--green); font-weight: 700; }
.seg-btn--return:has(input:checked) { background: var(--gold-soft); color: var(--gold); }
.seg-btn:has(input:focus-visible) { outline: 2px solid var(--accent); }
.item-comment { display: grid; gap: 4px; }
.item-decision:not(:has(input[value="returned"]:checked)) .item-comment { display: none; }
.review-editor { margin-bottom: 10px; }
.excellent-check { background: var(--bg); border-radius: var(--radius-btn); padding: 8px 10px; margin: 10px 0; }
.review-total dt, .review-total dd { color: var(--gold); font-weight: 700; }
.review-total { margin-top: 8px; }
.pt-excellent { display: none; }
.review-layout:has(input[name="excellent"]:checked) .pt-normal { display: none; }
.review-layout:has(input[name="excellent"]:checked) .pt-excellent { display: inline; }
.decision-card { display: grid; gap: 10px; }
.decision-card .card-title--sm { margin: 0; }
.decision-form { display: grid; gap: 10px; }
.decision-buttons { display: grid; gap: 8px; }
.decision-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.decision-items { display: none; }
.review-layout:has(.item-decision input[value="returned"]:checked) div.decision-items { display: grid; }
.review-layout:has(.item-decision input[value="returned"]:checked) span.decision-items { display: inline; }
.review-layout:has(.item-decision input[value="returned"]:checked) .decision-whole { display: none; }
.report-link { color: var(--sub); }

/* S-14 ジャンル設定 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.field--wide { grid-column: 1 / -1; }
.check-row { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.period-row { display: grid; grid-template-columns: 1fr 1fr auto 1fr; gap: 6px; align-items: center; }
.rules-form { margin-top: 4px; }
.add-row { display: flex; gap: 8px; }
.add-row .input { flex: 1; }
.form-stack { display: grid; gap: 12px; }
.protect-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* S-19 活動状況 */
.nengu-balance { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--gold-soft); color: var(--gold); border-radius: var(--radius-btn); padding: 12px 16px; }
.nengu-balance strong { display: block; font-size: 20px; }
.lord-status { display: grid; }
.lord-status li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.lord-status li:first-child { border-top: 0; padding-top: 0; }
.lord-status li > div { display: grid; gap: 4px; justify-items: start; }
.impeach-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.leave-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }

/* S-34 立候補への同意 */
.candidate-name { font-size: 16px; }
.score-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.progress--accent > span { background: var(--accent); }
.voter-list { display: grid; }
.voter-list li { display: grid; gap: 4px; justify-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.voter-list li:first-child { border-top: 0; }
.vote-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn.is-chosen { border-color: var(--red); color: var(--red); }
.decided-row { display: grid; gap: 4px; justify-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.decided-row:first-of-type { border-top: 0; }

/* S-44・S-43・S-18・S-35 */
.screen-lead { margin: -2px 0 20px; }
.check-results { display: grid; gap: 6px; font-size: var(--fs-ui); }
.total-row dt, .total-row dd { color: var(--gold); font-weight: 700; }
.stats--limits { margin-top: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cannot { white-space: normal; text-align: right; max-width: 220px; display: inline-block; }
.result-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--gap-block); align-items: start; }
.result-layout > .card:first-child { display: grid; gap: 14px; }
.result-banner { display: flex; align-items: center; gap: 14px; border-radius: var(--radius-btn); padding: 14px 16px; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-ui); }
.result-banner strong { font-size: 20px; white-space: nowrap; }
.result-banner--ok { background: var(--green-soft); color: var(--green); }
.result-banner--ng { background: var(--bg); color: var(--ink); }
.stats--recruiting { margin: 0 0 var(--gap-block); }
.stat-value--link { font-size: 18px; }
.recruiting-card { display: grid; gap: 12px; margin-bottom: var(--gap-block); }
.recruiting-sizes { margin-top: -4px; }

@media (max-width: 1199.98px) {
    .review-layout { grid-template-columns: minmax(0, 1fr) 300px; }
    .qtable-head, .qtable-row { grid-template-columns: 70px 140px minmax(0, 1fr) 150px 110px 110px 100px; }
}
@media (max-width: 1023.98px) {
    .desk-head { margin-bottom: 12px; }
    .desk-head .screen-title { font-size: 20px; }
    .desk-head-spacer { display: none; }
    .desk-head-rate { flex-basis: 100%; }
    .desk { padding: 0; border: 0; background: transparent; }
    .desk-grid, .review-layout, .result-layout { grid-template-columns: minmax(0, 1fr); }
    .subcard { padding: 16px; }
    .stats--desk, .stats--recruiting, .stats--limits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .qtable { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 4px 16px; }
    .qtable-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "page action" "content action" "editor action"; gap: 4px 12px; padding: 14px 0; }
    .qtable-id { display: none; }
    .qtable-page { grid-area: page; font-weight: 700; font-size: var(--fs-m); }
    .qtable-content { grid-area: content; color: var(--sub); font-size: var(--fs-s); }
    .qtable-editor { grid-area: editor; flex-wrap: wrap; }
    .qtable-action { grid-area: action; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .period-row { grid-template-columns: 1fr 1fr; }
    .period-row > span { display: none; }
    .nengu-balance, .impeach-row { flex-wrap: wrap; }
    .cannot { max-width: 140px; }
}
.lord-status li > span { white-space: nowrap; }
.subcard .prose p + p, .card--side .prose p + p { margin-top: 8px; }

/* ---------- 記念品の交換（S-36・S-37）・弾劾（S-39・S-40・S-41）・数値の詳細（S-45）・追放・不服の申し立て・判定の基準 ----------
 * 値は Figma の S-36 `140:1187` の get_design_context（数値カード 余白16・角丸12・数 24px Bold／カード 余白24・角丸12・見出し 18px／
 * 記念品のカード 余白12・間8・写真の枠 地 bg・角丸8・上下44／価格 14px Bold gold／ボタン 余白 9/16 全幅／右の列 420）と、
 * S-37・S-39・S-40・S-41・S-45 のスクリーンショットの寸法（右の列 420、S-45 は 360）。ほかは共通の部品（.card・.dtable・.kv-list・.note）。
 */
.layout-2col--420 { grid-template-columns: minmax(0, 1fr) 420px; }
.layout-2col--360 { grid-template-columns: minmax(0, 1fr) 360px; }
.stats--gift { margin-top: 0; margin-bottom: 0; }
.stats--gift .stat { border-radius: var(--radius-card); }
.gift-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 12px; }
.gift-card { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gift-card > .btn { margin-top: auto; }
.gift-card > span.btn { color: var(--ink); cursor: default; }
.gift-photo { background: var(--bg); border-radius: var(--radius-btn); display: flex; align-items: center; justify-content: center; min-height: 112px; overflow: hidden; color: var(--sub); font-size: var(--fs-s); }
.gift-photo img { width: 100%; height: 112px; object-fit: cover; display: block; }
.gift-photo--sm { width: 96px; min-height: 78px; flex: none; }
.gift-photo--sm img { height: 78px; }
.gift-name { font-size: 14px; font-weight: 700; line-height: var(--lh); }
.gift-name--lg { font-size: 16px; }
.gift-desc { font-size: var(--fs-s); color: var(--sub); }
.gift-price { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gift-price strong { color: var(--gold); font-size: 14px; }
.gift-selected { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.exchange-list { display: grid; }
.exchange-row { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); }
.exchange-row:first-child { border-top: 0; padding-top: 0; }
.exchange-row.is-new { background: var(--accent-soft); border-radius: var(--radius-btn); padding: 10px; }
.exchange-row form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.exchange-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.step-list { display: grid; }
.step-list li { display: grid; gap: 4px; justify-items: start; padding: 14px 0; border-top: 1px solid var(--line); font-size: var(--fs-ui); }
.step-list li:first-child { border-top: 0; padding-top: 0; }
.dtable td.is-minus, dd.is-minus { color: var(--red); }
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-chip { position: relative; border: 1px solid var(--line); border-radius: var(--radius-input); padding: 3px 10px; font-size: var(--fs-s); cursor: pointer; color: var(--ink); background: var(--surface); }
.pick-chip input { position: absolute; opacity: 0; pointer-events: none; }
.pick-chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); font-weight: 700; }
.pick-chip:has(input:focus-visible) { outline: 2px solid var(--accent); }
.target-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.target-row > div { display: grid; gap: 4px; justify-items: start; }
.impeach-target { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.impeach-card > .card-head .chip { margin-left: auto; }
.prewrap { white-space: pre-wrap; }
.metric-list .kv-row dd { text-align: right; }
.result-card { display: grid; gap: 14px; }
.result-card > .card-head { margin-bottom: 0; }
.result-banner--remove { background: var(--red-soft); color: var(--red); }
.result-banner--remove span, .result-banner--ok span { color: var(--ink); }

@media (max-width: 1023.98px) {
    .layout-2col--420, .layout-2col--360 { grid-template-columns: minmax(0, 1fr); }
    /* スマホは Figma の並び（S-39: 相手 → 理由 → 記録された数値 → 決まり方、S-45: 領主 → 問題点の目安 …）にするため、列を外して順を付ける */
    .layout-2col--sp-swap > .col-main, .layout-2col--sp-swap > .col-side { display: contents; }
    .layout-2col--sp-swap .sp-order-0 { order: 0; }
    .layout-2col--sp-swap .sp-order-1 { order: 1; }
    .layout-2col--sp-swap .sp-order-2 { order: 2; }
    .layout-2col--sp-swap .sp-order-3 { order: 3; }
    .layout-2col--sp-swap .sp-order-4 { order: 4; }
    .gift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .gift-photo { min-height: 88px; }
    .gift-photo img { height: 88px; }
}

/* B-03 特徴タグ（S-03 の見出しの下・S-08 のカード）。Figma にタグの部品は無いため、チップ（.chip / .pick-chip）で組む */
.page-tags { margin-top: 8px; }
.ed-tags { display: grid; gap: 12px; }
.ed-tag-group { display: grid; gap: 6px; }
.ed-tag-genre { font-size: var(--fs-s); color: var(--sub); font-weight: var(--fw-medium); }
.ed-tag-note { margin-left: 6px; font-size: var(--fs-xs); font-weight: 700; }
.pick-chip.is-added { border-color: var(--green); }
.pick-chip.is-added .ed-tag-note { color: var(--green); }
.pick-chip.is-removed { text-decoration: line-through; color: var(--sub); }
.pick-chip.is-removed .ed-tag-note { color: var(--red); text-decoration: none; display: inline-block; }
.pick-chip:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.card .prose p + p { margin-top: 8px; }
.impeach-card { display: grid; gap: 12px; }
.impeach-card > .card-head { margin-bottom: 0; }
.layout-2col--420 .card > .card-title:first-child, .layout-2col--360 .card > .card-title:first-child, .layout-mypage .result-card > .card-title:first-child { margin-bottom: 12px; }
.layout-2col--420 .kv-list--numbers .kv-row dt, .layout-2col--360 .kv-list--numbers .kv-row dt { flex: none; }
.layout-2col--420 .kv-list--numbers .kv-row dd, .layout-2col--360 .kv-list--numbers .kv-row dd { text-align: right; }
.card > .check-results, .card > .kv-list { margin-top: 12px; }

/* ---------- 運営管理（S-20〜S-26・S-38・S-42。PC の幅だけ） ----------
 * Figma S-20 `13:1560` の get_design_context の値: 運営ヘッダー（地 ink・余白 14/32・「みん推wiki 運営管理」16px Bold 白・右の運営名 13px 白）、
 * 運営メニュー（幅 220・余白 16・間 2・項目 13px 余白 8/10 角丸 6、選択中は地 accent-soft・Bold・accent、下線 line）、
 * 内容（余白 32・間 20）、見出し 22px Bold と説明 13px sub（間 4）、数値カード・タブ・表・チップは共通の部品のまま。
 * 狭い幅では、メニューを上に横に並べ、表は横に送る（ページ全体は横にはみ出さない）。 */
.admin-body { min-width: 0; }
.admin-header { display: flex; align-items: center; gap: 12px; padding: 14px 32px; background: var(--ink); color: var(--white); line-height: var(--lh); }
.admin-header form { margin: 0; }
.admin-brand { color: var(--white); font-size: 16px; font-weight: 700; white-space: nowrap; }
.admin-brand:hover { color: var(--white); }
.admin-header-spacer { flex: 1 1 auto; }
.admin-header-link, .admin-header .link-button { color: var(--white); font-size: var(--fs-s); opacity: .8; }
.admin-header-user { font-size: var(--fs-ui); white-space: nowrap; }
.admin-header-roles { font-size: var(--fs-xs); opacity: .75; }
.admin-frame { display: flex; align-items: flex-start; min-height: calc(100vh - 54px); }
.admin-menu { flex: 0 0 220px; width: 220px; padding: 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.admin-menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.admin-menu a { display: block; padding: 8px 10px; border-radius: var(--radius-input); color: var(--ink); font-size: var(--fs-ui); line-height: var(--lh); }
.admin-menu a:hover { text-decoration: none; background: var(--bg); }
.admin-menu a.is-child { padding-left: 22px; font-size: var(--fs-s); }
.admin-menu a.is-current { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.admin-main { flex: 1 1 auto; min-width: 0; padding: 32px; display: grid; gap: 20px; align-content: start; }
.admin-main > .flash, .admin-main > .note { margin: 0; }
.admin-head { display: grid; gap: 4px; }
.admin-title { margin: 0; font-size: var(--fs-screen); font-weight: 700; line-height: var(--lh); }
.admin-lead { margin: 0; font-size: var(--fs-ui); color: var(--sub); line-height: var(--lh); }
.admin-stats { margin-top: 0; }
.admin-stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.admin-stats--flat { margin: 0; }
.admin-card { display: grid; gap: 16px; align-content: start; }
.admin-card > .card-head, .admin-card > .tabs { margin-bottom: 0; }
.admin-card > .card-title, .admin-card > h2 { margin: 0; }
.admin-subtitle { margin: 8px 0 0; }
.admin-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-filter > .input { flex: 1 1 280px; width: auto; min-width: 200px; }
.admin-filter > .input--sm { flex: 0 1 140px; min-width: 100px; }
.admin-chips { margin: 0; }
.admin-table td { line-height: var(--lh); }
.admin-table tr.is-urgent td { background: var(--red-soft); }
.admin-table tr.is-warn td { background: var(--gold-soft); }
.admin-table tr.is-selected td { background: var(--accent-soft); }
.admin-table td.is-late { color: var(--red); font-weight: 700; }
.admin-table .chips { flex-wrap: nowrap; }
.admin-table .btn-row { flex-wrap: nowrap; }
.admin-main form.inline-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.admin-main form.inline-form .input--sm { width: auto; min-width: 120px; }
.admin-main .admin-id-input { max-width: 150px; min-width: 90px; }
.admin-list { display: grid; }
.admin-list-row { display: flex; gap: 20px; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); }
.admin-list-row:first-child { border-top: 0; padding-top: 0; }
.admin-list-main { display: grid; gap: 4px; min-width: 0; font-size: var(--fs-ui); }
.admin-list-main p { margin: 0; }
.admin-list-title { font-size: var(--fs-m); font-weight: 700; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.admin-list-side { flex: 0 0 260px; display: grid; gap: 10px; align-content: start; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.admin-grid--wide { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.admin-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.admin-grid--flat { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.admin-kv { display: grid; gap: 8px; margin: 0; font-size: var(--fs-ui); }
.admin-kv > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; }
.admin-kv dt { color: var(--ink); }
.admin-kv dd { margin: 0; text-align: right; font-weight: var(--fw-medium); overflow-wrap: anywhere; }
.admin-kv--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; }
.admin-kv--grid > div { grid-template-columns: minmax(0, 1fr) auto; }
.admin-btn-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.admin-plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: var(--fs-ui); }
.admin-plain-list li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.admin-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px 12px; }
.admin-check-grid--scroll { max-height: 220px; overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-input); margin-top: 8px; }
.admin-more > summary { cursor: pointer; font-size: var(--fs-ui); color: var(--accent); }
.admin-more--inline { display: inline-block; position: relative; }
.admin-more--inline > summary { list-style: none; }
.admin-more--inline > summary::-webkit-details-marker { display: none; }
.admin-popover { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; width: 260px; padding: 12px; gap: 8px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-btn); box-shadow: 0 6px 20px rgba(29, 35, 64, .12); }
.admin-popover--wide { width: 420px; display: grid; gap: 10px; }
.admin-json { max-height: 320px; overflow: auto; margin: 8px 0 0; padding: 10px; background: var(--bg); border-radius: var(--radius-input); font-size: var(--fs-xs); white-space: pre-wrap; word-break: break-all; }
.admin-rule { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.admin-inline-fields { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; }
.admin-lord-row { justify-content: space-between; }
.admin-fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.admin-form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-form-grid .field-hint .link-button { font-size: var(--fs-xs); }
.admin-settings { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.admin-settings-form { display: grid; gap: 16px; }
.admin-settings-side { display: grid; gap: 10px; }
.admin-settings-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.admin-settings-foot p { margin: 0 auto 0 0; }
.admin-log-filter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; align-items: end; }
.admin-change { max-width: 360px; overflow-wrap: anywhere; color: var(--sub); }
.admin-bar-cell { width: 45%; }
.admin-address p { margin: 0 0 4px; }
.admin-subcard { margin-top: 4px; }
.admin-held { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.admin-held p { margin: 0; }
.admin-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--fs-s); }
.btn.is-disabled { opacity: .6; cursor: default; gap: 6px; }

@media (max-width: 1023.98px) {
    .admin-header { padding: 12px 16px; flex-wrap: wrap; }
    .admin-frame { display: block; }
    .admin-menu { width: auto; padding: 8px 16px; overflow-x: auto; }
    .admin-menu ul { display: flex; gap: 4px; }
    .admin-menu a { white-space: nowrap; }
    .admin-menu a.is-child { padding-left: 10px; }
    .admin-main { padding: 16px; }
    .admin-grid, .admin-grid--wide, .admin-grid--3, .admin-grid--flat, .admin-settings, .admin-form-grid, .admin-form-grid--3, .admin-kv--grid { grid-template-columns: minmax(0, 1fr); }
    .admin-stats--3 { grid-template-columns: minmax(0, 1fr); }
    .admin-log-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-list-row { flex-direction: column; }
    .admin-list-side { flex: none; }
    .admin-popover, .admin-popover--wide { width: min(320px, calc(100vw - 48px)); }
    /* 表は縮めずに横に送る（.table-scroll の中だけ。ページ全体ははみ出さない） */
    .admin-main .table-scroll > .admin-table { min-width: 760px; }
    .admin-main .table-scroll > .admin-table th { white-space: nowrap; }
}

/* =====================================================================
 * P2 の画面（ランキング・事後確認・推薦・異議申し立て・コメント・検索の拡充・言語・対訳表・広告枠・ゲームからの報告）
 * 値は Figma（広告 62:756 / 62:759 / 62:762、S-17 13:1168、S-13 推薦 140:1176・別の言語 54:633、
 * S-03 翻訳 7:277、S-14 対訳表 13:919、S-26 翻訳のやり直し 13:2777）の get_design_context の設定値と共通の部品。
 * ===================================================================== */

/* B-14 広告枠: 地 bg・破線の枠 line・角丸 8・「広告」12px Bold・大きさ 11px（sub）。枠の大きさは先に確保する */
.ad-frame { display: flex; justify-content: center; min-width: 0; }
.ad-frame--block, .container > .ad-frame, .desk > .ad-frame, .card > .ad-frame { margin: var(--gap-block) 0; }
.col-main > .ad-frame, .col-side > .ad-frame, .mypage-main > .ad-frame, .col-results > .ad-frame, .col-filter > .ad-frame, .diff-col > .ad-frame, .review-main > .ad-frame, .review-side > .ad-frame, .editor-main > .ad-frame, .ad-row > .ad-frame { margin: 0; }
.ad-slot {
    box-sizing: border-box; flex: none; max-width: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    background: var(--bg); border: 1px dashed var(--line); border-radius: var(--radius-btn); color: var(--sub); line-height: var(--lh);
}
.ad-slot--banner { width: 728px; height: 90px; }
.ad-slot--rect { width: 300px; height: 250px; }
/* AdSense の広告（枠の大きさは空の枠と同じ。大きさは ins の CSS で決める = 固定の大きさの広告ユニット） */
.ad-unit { flex: none; max-width: 100%; overflow: hidden; line-height: 0; }
.ad-ins { display: inline-block; }
.ad-unit--banner, .ad-ins--banner { width: 728px; height: 90px; }
.ad-unit--rect, .ad-ins--rect { width: 300px; height: 250px; }
.ad-label { font-size: var(--fs-s); font-weight: 700; }
.ad-size { font-size: var(--fs-xs); }
.ad-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 24px; margin: var(--gap-block) 0; }
.col-filter { display: grid; gap: var(--gap-card); align-content: start; }
.col-results { display: grid; gap: var(--gap-card); align-content: start; }
.diff-col, .review-main, .review-side { display: grid; gap: var(--gap-card); align-content: start; }
.editor-side > .ad-frame { margin-top: var(--gap-card); }

/* S-17 ランキング: 表の列 60 / 残り / 120 / 160 / 140 / 140、1位の行は gold-soft */
.ranking-card { display: grid; gap: 16px; }
.ranking-card > .tabs { margin: 0; }
.ranking-month { display: flex; gap: 8px; align-items: center; }
.ranking-month .input { width: auto; }
.rank-table { display: grid; }
.rank-table-head, .rank-table-row { display: grid; grid-template-columns: 60px minmax(0, 1fr) 120px 160px 140px 140px; gap: 12px; align-items: center; padding: 10px 12px; font-size: var(--fs-ui); line-height: var(--lh); }
.rank-table-head { padding-top: 8px; padding-bottom: 8px; background: var(--bg); border-radius: var(--radius-input); color: var(--sub); font-size: var(--fs-xs); font-weight: 700; }
.rank-table-row + .rank-table-row { border-top: 1px solid var(--line); }
.rank-table-row.is-top { background: var(--gold-soft); }
.rank-table-row.is-me { font-weight: 700; }
.rank-name a { color: var(--ink); }
.rank-genre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-genres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ranking-genres .side-list-row { justify-content: flex-start; }
.ranking-genres .side-list-pt { margin-left: auto; }
.ranking-pos { width: 24px; font-weight: 700; color: var(--sub); }

/* E-10 事後確認待ちの表: 操作の列を広く */
.qtable--post .qtable-head, .qtable--post .qtable-row { grid-template-columns: 70px 170px minmax(0, 1fr) 150px 90px 90px 230px; }
.post-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.post-actions .inline-form-body { flex-direction: column; align-items: stretch; }
/* E-10 事後確認待ちの「取り消す」: 開いている間は小さな「閉じる」にして、理由の欄と確定のボタンを行の幅いっぱいに出す（押し間違えで閉じないように） */
.revert-toggle .revert-toggle-close { display: none; }
.revert-toggle[open] { flex-basis: 100%; }
.revert-toggle[open] > summary { background: none; border: 0; color: var(--sub); padding: 0; font-weight: 500; text-decoration: underline; min-height: 0; }
.revert-toggle[open] .revert-toggle-open { display: none; }
.revert-toggle[open] .revert-toggle-close { display: inline; }
.revert-form { border: 1px solid var(--red-soft, var(--line)); border-radius: var(--radius-btn); padding: 12px; background: var(--bg); width: 100%; }
.revert-form .input { width: 100%; }
.revert-form .btn { align-self: flex-start; }
/* 投票のコメント（S-34 / S-40） */
.vote-form { display: grid; gap: 10px; }
.vote-form .field { margin: 0; }
.voter-comment { flex-basis: 100%; margin: 4px 0 0; padding: 6px 10px; background: var(--bg); border-radius: var(--radius-btn); color: var(--ink); }
/* 過去の版（S-05 / B-05） */
.version-notice .btn-row { margin-top: 4px; }
/* 記念品の申し込みの年齢の確認（1.2） */
.guardian-field { border: 0; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.guardian-consent { margin-top: 2px; }
/* メールが届いていない案内 */
.mail-bounce-banner { margin-bottom: 12px; }

/* K-06 ゲームからの報告 */
.report-row { align-items: flex-start; }
.report-side { display: grid; gap: 6px; justify-items: end; flex: none; max-width: 320px; }
.report-form { display: grid; gap: 6px; }

/* S-13 推薦（Figma 140:1176: 余白 16・間 8、チップ「いいね n」と 12px sub、gold-soft の目立つ推薦 余白 10・12px Bold） */
.endorse-card { display: grid; gap: 8px; }
.endorse-card .card-title--sm { margin-bottom: 0; }
.endorse-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.endorse-notable { background: var(--gold-soft); border-radius: var(--radius-btn); padding: 10px; display: grid; gap: 6px; }
.endorse-notable-head { font-size: var(--fs-s); font-weight: 700; color: var(--ink); }
.endorse-notable ul { display: grid; gap: 4px; font-size: var(--fs-s); }
.endorse-notable li { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.endorse-comment { color: var(--sub); }
.endorse-others { display: grid; gap: 4px; margin-top: 6px; }
.endorse-filter { margin-bottom: 8px; }

/* E-13 別の言語のリクエスト（Figma 54:633: 原文の箱は枠 line・角丸 6・余白 6/12・見出し 11px Bold） */
.tr-switch { gap: 8px; }
.tr-original { border: 1px solid var(--line); border-radius: var(--radius-input); padding: 6px 12px; display: grid; gap: 2px; color: var(--sub); margin-top: 8px; }
.tr-original .diff-before, .tr-original .diff-after { background: transparent; padding: 0; color: var(--sub); }
.tr-both { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tr-both > div { display: grid; gap: 6px; align-content: start; }
.similarity-note { margin-top: 8px; }

/* D-13 異議申し立て */
.appeal-box > summary { list-style: none; display: inline-flex; }
.appeal-box > summary::-webkit-details-marker { display: none; }
.appeal-box[open] > summary { margin-bottom: 8px; }
.appeal-target { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; }

/* I-05 コメント欄 */
.comments-card { display: grid; gap: 12px; }
.comments-card > .card-head { margin-bottom: 0; }
.comment-list { display: grid; }
.comment-row { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.comment-row:first-child { border-top: 0; padding-top: 0; }
.comment-row.is-hidden .comment-body { color: var(--sub); }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.comment-body { font-size: var(--fs-m); line-height: var(--lh); overflow-wrap: anywhere; }
.comment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.comment-form { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }

/* B-08 / B-09 検索の抜き出し・絞り込み */
.result-snippet { margin-top: 6px; font-size: var(--fs-s); color: var(--ink); line-height: var(--lh); overflow-wrap: anywhere; }
.result-snippet mark { background: var(--gold-soft); color: inherit; padding: 0 1px; border-radius: 2px; }
.filter-attr > summary { cursor: pointer; }
.filter-attr .check { margin-top: 6px; }
.genre-filters { margin-top: 10px; }
.genre-filters > summary { cursor: pointer; }
.genre-filter-grid { display: grid; gap: 10px; margin: 10px 0; }
.genre-filter-grid .filter-group { border: 0; padding: 0; margin: 0; }
.genre-filter-grid legend { font-size: var(--fs-s); font-weight: 500; color: var(--sub); margin-bottom: 6px; }

/* L-08 翻訳の状況（Figma 7:277: 余白 20・間 10、13px の行、チップ） */
.tr-card { display: grid; gap: 10px; }
.tr-card .card-title--sm { margin-bottom: 0; }
.tr-card-line { font-size: var(--fs-ui); }
.note--accent { background: var(--accent-soft); color: var(--accent); }
.page-unverified { margin-top: 10px; }

/* L-06 対訳表（Figma 13:919: 見出し 11px Bold・地 bg、行 13px・余白 10/12） */
.glossary-table { width: 100%; border-collapse: collapse; font-size: var(--fs-ui); line-height: var(--lh); }
.glossary-table th { background: var(--bg); color: var(--sub); font-size: var(--fs-xs); font-weight: 700; text-align: left; padding: 8px 12px; }
.glossary-table th:first-child { border-radius: var(--radius-input) 0 0 var(--radius-input); }
.glossary-table th:last-child { border-radius: 0 var(--radius-input) var(--radius-input) 0; }
.glossary-table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.glossary-table tr:first-child td { border-top: 0; }
/* 狭い列（S-14 の右の列・スマホ）でも見出しと訳が1文字ずつ折り返さないよう、列の幅を確保して .table-scroll の中で横に送る */
.glossary-table th { white-space: nowrap; }
.glossary-table td { min-width: 7em; }
.glossary-table td:first-child { white-space: nowrap; }
.glossary-table td:last-child:not(.small) { min-width: 0; }
.glossary-form { flex-direction: column; align-items: stretch; min-width: 220px; }
/* 編集は用語の隣の列（狭い時に表を横に送らなくても届く） */
.glossary-table td.glossary-actions { min-width: 0; white-space: nowrap; }
.glossary-table td.glossary-actions details[open] { white-space: normal; }

/* L-05 言語ごとの名前 */
.localize-lang { border-top: 1px solid var(--line); padding-top: 10px; }
.localize-lang > summary { cursor: pointer; }
.localize-lang .form-grid { margin-top: 10px; }
.localize-row { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.localize-inputs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.localize-inputs .input { width: 150px; }
.side-list-name.is-current { font-weight: 700; color: var(--accent); }

/* I-04 通知の設定 */
.mail-group { border-top: 1px solid var(--line); padding-top: 10px; }
.mail-group > summary { cursor: pointer; margin-bottom: 8px; }
.mail-group .check-list { gap: 8px; }

/* S-05 編集履歴の取り消し */
.version-revert { margin-top: 6px; }

@media (max-width: 1023.98px) {
    .ad-slot--banner, .ad-unit--banner, .ad-ins--banner { width: 320px; height: 100px; }
    .rank-table-row { grid-template-columns: 32px minmax(0, 1fr) auto; padding: 12px 4px; }
    .rank-name { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
    .ranking-genres { grid-template-columns: minmax(0, 1fr); }
    .qtable--post .qtable-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; }
    /* 名前つきの領域を外したので、セルを上から順に並べる（重なってページ名・内容が「取り消す」の下に隠れていた） */
    .qtable--post .qtable-row > * { grid-area: auto; }
    .post-actions { justify-content: flex-start; }
    .report-row { flex-direction: column; }
    .report-side { justify-items: start; max-width: none; }
    .tr-both { grid-template-columns: minmax(0, 1fr); }
    .localize-inputs .input { width: 100%; }
}

/* スマホの人物ページの下の「通報」（PC は上部のボタン） */
.page-report-card { align-items: center; justify-content: space-between; gap: 12px; }
.page-report-card .btn { flex: none; }
@media (max-width: 1023.98px) {
    .page-report-card.only-sp { display: flex !important; }
}

/* G-11 自分の開設の申請: スマホでは操作のボタンを行の下に回す（中身の列が細くならないように） */
.opening-row .list-row-body { min-width: 0; flex: 1; }
@media (max-width: 1023.98px) {
    .opening-row { flex-direction: column; align-items: stretch; }
    .opening-row .list-row-side { white-space: normal; }
}
