    :root { --nav-h: 64px; }
    * { box-sizing: border-box; }
    html, body { margin: 0; }
    html { scroll-behavior: smooth; }
    body { font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", sans-serif; line-height: 1.6; color: #e5e7eb; background: #0f172a; }

    /* レイアウト */
    .container { width: 100%; max-width: 1300px; margin: 0 auto; padding: 1rem; }
    section { margin: 1.25rem 0 1.5rem; scroll-margin-top: calc(var(--nav-h) + 12px); }

    /* トップナビ（PCは中央寄せ・SPは右ハンバーガー） */
    .topnav { position: sticky; top: 0; z-index: 50; height: var(--nav-h); padding: 0 1rem; background: linear-gradient(90deg, #1f2937 0%, #374151 50%, #1f2937 100%); border-bottom: 1px solid #4b5563; 
      display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: .75rem; }
    .brand { grid-column: 1; font-weight: 800; font-size: 1.2rem; color: #f9fafb; text-decoration: none; letter-spacing: .3px; 
      padding: .2rem .45rem; border-radius: .6rem; }
    /* デフォルトのフォーカスアウトラインを削除するのではなく、見やすい枠に修正します */
    .brand:focus, .brand:focus-visible{ outline: 2px solid #a78bfa; outline-offset: 3px; }

    .nav-links { grid-column: 2; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; overflow: hidden; justify-self: center; }
    .menu-toggle { grid-column: 3; margin-left: 0; justify-self: end; display: none; width: 44px; height: 44px; border: none; border-radius: .6rem; background: #374151; color: #f9fafb; cursor: pointer; }
    .menu-toggle svg { width: 22px; height: 22px; }

    /* PC時はメニュー幅を内容サイズにして完全中央寄せ */
    @media (min-width: 769px){
      .nav-links { width: max-content; }
    }

    .nav-links a { color:#f9fafb; text-decoration:none; font-weight:700; font-size:.98rem; padding:.55rem 1rem; border-radius:.9rem; background: linear-gradient(135deg, #5b21b6 0%, #6d28d9 60%, #7c3aed 100%); box-shadow: 0 2px 8px rgba(124,58,237,.25); transition: filter .2s ease, box-shadow .2s ease, transform .2s ease; display: block; }
    .nav-links a:hover, .nav-links a:focus { filter: brightness(1.15); box-shadow: 0 4px 14px rgba(124,58,237,.35); transform: translateY(-1px); }
    .nav-links a.is-active { filter: brightness(1.28); box-shadow: 0 6px 18px rgba(124,58,237,.45); }

    /* モバイルメニュー（初期閉・右端ハンバーガー維持） */
    @media (max-width: 768px) {
      .menu-toggle { display: inline-grid; place-items: center; }
      .nav-links { position: fixed; left: 0; right: 0; top: var(--nav-h); display: block; padding: .5rem 1rem 1rem; background: linear-gradient(180deg, #1f2937 0%, #2b3141 100%); border-bottom: 1px solid #4b5563; max-height: 0; opacity: 0; overflow: hidden; pointer-events: none; transition: max-height .28s ease, opacity .22s ease; justify-self: stretch; }
      .topnav.is-open .nav-links { max-height: calc(100vh - var(--nav-h)); opacity: 1; pointer-events: auto; }
      body.menu-open { overflow: hidden; }
      .nav-links a { width: fit-content; margin: .25rem 0; }
    }

    /* セクションヘッダ */
    details > summary.head { list-style: none; }
    summary.head { background: linear-gradient(135deg, #5b21b6 0%, #6d28d9 60%, #7c3aed 100%); color:#f9fafb; border-radius: .6rem; font-size: 1.1rem; font-weight: 800; padding: .6rem .9rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); display: flex; align-items: center; gap: .5rem; cursor: pointer; }
    summary.head:focus { outline: 2px solid #a78bfa; outline-offset: 2px; }
    summary.head::before { content: "\25BC"; font-size: .95rem; opacity:.95; }
    details[open] > summary.head::before { content: "\25B2"; }

    .stack { display: grid; gap: .35rem; margin-top: .35rem; }

    /* 折りたたみ（サブ） */
    .subhead-btn { background:#495265; color:#e5e7eb; border-radius:.45rem; font-weight:800; font-size:1rem; padding:.5rem .85rem; margin:.35rem 0 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); width:100%; text-align:left; border:none; cursor:pointer; position: relative; z-index: 1; }
    .subhead-btn:focus { outline: 2px solid #a78bfa; outline-offset: 2px; }
    .subhead-btn[aria-expanded="true"] { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
    .collapsible-content { max-height: 0; overflow: hidden; transition:max-height .25s ease; margin:0; }
    .subhead-btn[aria-expanded="true"] + .collapsible-content .panel { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: 0; }

    .panel { background:#1f2634; color:#e6ecf5; border-radius:.45rem; padding:.7rem .9rem; box-shadow: inset 0 0 0 1px rgba(0,0,0,.5); }
    .panel p { margin:.4rem 0; }
    .badge-links { display:flex; gap:.5rem; flex-wrap: wrap; margin-top:.35rem; }
    .badge { display:inline-grid; place-items:center; padding:.28rem .55rem; border-radius:.4rem; font-weight:700; background:#e5defc; color:#3b2ea3; box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 1px 2px rgba(0,0,0,.25); text-decoration:none; }
    .badge:focus { outline: 2px solid #a78bfa; outline-offset: 2px; }

    /* フッター */
    footer { padding: 2rem 1rem 3rem; color: #9ca3af; border-top: 1px solid #334155; text-align: center; }

    /* 低モーション設定 */
    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto; }
      .collapsible-content, .nav-links { transition: none; }
    }
  
    /* ===== Character (Grid Lock + Active & Title) ===== */
    .character-section { --title-h: 42px; --title-gap: 10px; margin: 1rem 0; }
    .char-container { display: flex; gap: 1rem; margin-top: .35rem; }

    /* 左メニュー */
    .char-menu { width: 220px; background:#1f2634; border-radius:.6rem; padding:.6rem; display:flex; flex-direction:column; gap:.5rem; }
    details.char-group { background:#1b2330; border-radius:.5rem; overflow:hidden; }
    summary.char-group-title { background:#2a3140; color:#f5f5f5; font-weight:800; padding:.55rem .8rem; cursor:pointer; list-style:none; }
    summary.char-group-title::-webkit-details-marker{ display:none; }
    .char-list { padding:.5rem .6rem .7rem; display:grid; gap:.35rem; }
    .char-item { display:block; width:100%; border:none; background:#2a3343; color:#e5e7eb; padding:.45rem .6rem; border-radius:.35rem; cursor:pointer; text-align:left; }
    .char-item:hover { background:#344154; }
    .char-item.is-active { background:#2b3446; color:#7dd3fc; box-shadow: 0 0 0 1px rgba(125,211,252,.35) inset; }
    .btn-clear { margin-top:auto; background:#b91c1c; color:#f5f5f5; font-weight:800; font-size:13pt; border:none; border-radius:.45rem; padding:.55rem .8rem; cursor:pointer; }

    /* 右：PCは2カラム固定 ／ モバイルは画像にテキスト被せ */
    .char-display { flex:1; background:#121a2b; border-radius:.6rem; padding: 1rem 1rem 3.75rem; padding-top: calc(1rem + var(--title-h) + var(--title-gap)); min-height: 900px; position:relative; }
    .char-grid { display:grid; grid-template-columns: 450px 1fr; grid-template-rows: 800px; column-gap: 2rem; align-items:start; justify-items:stretch; }

    /* 左：画像（原寸 450×800／背景透明） */
    .char-figure { margin:0; width:450px; height:800px; background:transparent; border-radius:.5rem; overflow:hidden; align-self:start; justify-self:start; }
    .char-figure img { display:block; width:450px; height:800px; object-fit:cover; }

    /* 右：テキスト（薄灰背景・12pt・800px固定 / 初期は非表示） */
    .char-text { margin:0; height:800px; overflow:auto; background-color: rgba(34,44,64,0.2); color:#cbd5e0; font-size:13pt; letter-spacing:0.5px; border-radius:.6rem; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6); padding:1rem 1.1rem; white-space:pre-wrap; line-height:1.7; align-self:start; display:none; }
    .char-text-frame-wrap{ height:800px; background-color: rgba(34,34,34,0.2); border-radius:.6rem; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6); overflow:hidden; align-self:start; display:none; }
    .char-text-frame{ width:100%; height:100%; border:0; background:transparent; }
    .is-visible { display:block !important; }

    /* タイトル（右ペイン上部中央） */
    .char-title { position:absolute; top:.5rem; left:50%; transform:translateX(-50%); z-index:3; pointer-events:none; font-size:20px; font-weight:800; color:#7dd3fc; text-shadow: 0px 0px 8px #000, 0px 0px 8px #000; letter-spacing:1px; background:rgba(34,34,34,0.2); padding:.35rem .9rem; border-radius:.6rem; box-shadow: 0 2px 6px rgba(0,0,0,.35); height: var(--title-h); display:grid; place-items:center; white-space:nowrap; }
    .char-title[hidden]{ display:none !important; }

    /* PREV/NEXT */
    .char-controls { position:absolute; left:50%; bottom:1rem; transform:translateX(-50%); display:flex; gap:1rem; z-index:2; }
    .btn { padding:.6rem 1.2rem; border:none; border-radius:.6rem; font-weight:700; cursor:pointer; }
    .btn-primary { background:#4a67d6; color:#fff; }
    .btn-disabled { background:#3a3a3a; color:#9ca3af; cursor:default; pointer-events:none; }

    /* ===== モバイル（幅<=900px）：画像にテキストを被せる ===== */
    @media (max-width: 900px){
      .char-container{ flex-direction:column; }
      .char-menu{ width:100%; }
      .char-display{ min-height:calc(100dvh - 160px); padding: calc(.5rem + var(--title-h)) 0 4.25rem; }
      .char-grid{ grid-template-columns: 1fr; grid-template-rows: auto; column-gap:0; }
      .char-figure{ width:100%; height:auto; justify-self:center; }
      .char-figure img{ width:min(100%, 450px); height:auto; max-height:78dvh; opacity:.784; margin:0 auto; }
      .char-text.is-visible, .char-text-frame-wrap.is-visible{ position:absolute; left:50%; transform:translateX(-50%); bottom:4.25rem; width:min(92%, 680px); height:min(40dvh, 360px); background-color:rgba(34,34,34,.25); backdrop-filter: blur(.25px); }
      .char-controls{ bottom:.75rem; }
    }

/* ボトムにスペースを入れる */

    .bottom-boko877{
        vertical-align: bottom;
        font-size: 20px;
        font-weight: bold;
        margin-top: 0.75rem; /* mb-3相当 */
        margin-bottom: 0.75rem; /* mb-3相当 */
        padding-bottom: 1000px;
        text-shadow: 0px 0px 8px #000, 0px 0px 8px #000;
    }

/* 強調文字1 */
b.highlight1 {
  font-family: "Meiryo", sans-serif;
  font-size: 24px;
  font-weight: bold;
  color: #FF00DC;
}