/* ============================================================
   PiPi Talk — Design System v4  "English Gym × Editorial"
   アイボリーの紙 × インクブラック × ボルト（蛍光ライム）
   英語の見出し・数字はセリフ体（Instrument Serif）で雑誌のように。
   ビルド不要（CDN Bootstrap 5.3 の上に被せるだけ）。
   OEMブランド色は --bs-primary を差し替えれば主要ボタン等に反映される。
   ============================================================ */

:root {
    /* --- Palette --- */
    --paper: #f2efe7;
    --paper-2: #e9e5da;
    --paper-3: #faf8f3;
    --surface: #fffefb;
    --ink: #111113;
    --ink-2: #2b2b30;
    --ink-soft: #6c685f;
    --ink-faint: #a29d91;
    --line: #e2ddd1;
    --line-strong: #d1cbbd;
    --volt: #d9ff3f;
    --volt-deep: #c3ec1c;
    --volt-soft: #f2ffc4;

    --success: #12805a;  --success-soft: #e2f2e9;
    --warning: #a96300;  --warning-soft: #fbefd6;
    --danger:  #cf3434;  --danger-soft:  #fbe5e2;
    --info:    #2f4bd8;  --info-soft:    #e8ebfc;

    /* 互換用（ビュー側のインラインで参照されている名前） */
    --accent-pink: var(--ink);
    --accent-mint: var(--success);
    --accent-soft: rgba(17, 17, 19, .06);
    --surface-muted: var(--paper-3);
    --border-soft: var(--line);
    --ink-invert: #fff;
    --ink-invert-soft: rgba(255, 255, 255, .64);

    /* --- Bootstrap bridge --- */
    --bs-primary: #111113;
    --bs-primary-rgb: 17, 17, 19;
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--paper);
    --bs-border-color: var(--line);
    --bs-secondary-color: var(--ink-soft);
    --bs-link-color: var(--ink);
    --bs-link-color-rgb: 17, 17, 19;
    --bs-link-hover-color-rgb: 0, 0, 0;
    --bs-emphasis-color: var(--ink);
    --bs-success-rgb: 18, 128, 90;
    --bs-danger-rgb: 207, 52, 52;
    --bs-warning-rgb: 169, 99, 0;

    /* --- Type --- */
    --font-sans: "Inter", "Noto Sans JP", -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
    --font-serif: "Instrument Serif", "Noto Sans JP", Georgia, serif;

    /* --- Shape & depth --- */
    --r-xl: 28px;
    --r-lg: 22px;
    --r-md: 16px;
    --r-sm: 12px;
    --shadow-xs: 0 1px 0 rgba(17, 17, 19, .03);
    --shadow-sm: 0 1px 2px rgba(17, 17, 19, .04), 0 4px 14px rgba(17, 17, 19, .04);
    --shadow-md: 0 2px 6px rgba(17, 17, 19, .05), 0 18px 40px rgba(17, 17, 19, .08);
    --shadow-lg: 0 30px 70px rgba(17, 17, 19, .22);
    --ease: cubic-bezier(.22, 1, .36, 1);
    --rail-w: 268px;

    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.7;
    letter-spacing: 0;
    font-feature-settings: "palt" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* 日本語を文節（意味のまとまり）で折り返す（非対応ブラウザは通常の折り返し） */
    word-break: auto-phrase;
    line-break: strict;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--ink);
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1.35;
}
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #000; }
::selection { background: var(--volt); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
hr { border-color: var(--line); opacity: 1; }
small, .small { font-size: .84em; }
img { max-width: 100%; }

.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: 0; }
.serif-italic { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
.eyebrow {
    font-family: "Inter", var(--font-sans);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-faint);
}
.text-primary { color: var(--bs-primary) !important; }
.text-muted { color: var(--ink-soft) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.bg-light { background-color: var(--paper-3) !important; }
.bg-white { background-color: var(--surface) !important; }
.bg-primary { background-color: var(--bs-primary) !important; }
.border, .border-top, .border-bottom, .border-start, .border-end { border-color: var(--line) !important; }
.rounded-3 { border-radius: var(--r-sm) !important; }
.min-w-0 { min-width: 0; }

/* ============================================================
   App shell — 左レール + 本文
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.app-rail {
    position: sticky;
    top: 0;
    height: 100vh;
    width: var(--rail-w);
    flex: 0 0 var(--rail-w);
    flex-direction: column;
    padding: 1.4rem 1rem 1rem;
    border-right: 1px solid var(--line);
    background: var(--paper);
    z-index: 1020;
}
.rail-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .2rem .55rem 1.4rem;
    text-decoration: none;
    color: var(--ink);
}
.rail-logo { max-height: 34px; max-width: 100%; }
.rail-brand-name { font-weight: 800; font-size: .98rem; letter-spacing: .02em; line-height: 1.3; }
.brand-mark {
    width: 34px; height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ink);
    color: var(--volt);
    font-size: 1rem;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.rail-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    margin: 0 -.35rem;
    padding: 0 .35rem;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}
.rail-nav > p,
.rail-nav p.text-uppercase {
    font-family: "Inter", var(--font-sans);
    font-size: .64rem !important;
    font-weight: 700 !important;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink-faint) !important;
    padding: 0 .7rem !important;
    margin: .2rem 0 .6rem !important;
}
.rail-nav .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .58rem .7rem;
    margin: 1px 0;
    border-radius: var(--r-sm);
    color: var(--ink-soft);
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.4;
    transition: background-color .2s var(--ease), color .2s var(--ease);
}
.rail-nav .nav-link i {
    width: 20px;
    flex: 0 0 20px;
    text-align: center;
    font-size: 1.02rem;
    color: var(--ink-faint);
    transition: color .2s var(--ease);
}
.rail-nav .nav-link:hover { background: var(--paper-2); color: var(--ink); }
.rail-nav .nav-link:hover i { color: var(--ink); }
.rail-nav .nav-link.active {
    background: var(--ink);
    color: #fff;
    box-shadow: 0 6px 18px rgba(17, 17, 19, .16);
}
.rail-nav .nav-link.active i { color: var(--volt); }

.rail-user { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.rail-user-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .5rem .55rem;
    border: 0;
    border-radius: var(--r-md);
    background: transparent;
    text-align: left;
    color: var(--ink);
    transition: background-color .2s var(--ease);
}
.rail-user-btn:hover, .rail-user-btn[aria-expanded="true"] { background: var(--paper-2); }
.rail-user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.rail-user-name { font-weight: 700; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-user-role { font-size: .72rem; color: var(--ink-faint); }
.rail-user-more { color: var(--ink-faint); }

/* ---------- 本文 ---------- */
.main-content {
    position: relative;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 2.4rem clamp(1.1rem, 3vw, 3rem) 2rem;
    flex: 1 0 auto;
}
/* ページタイトル: アイコンは外し、大きく静かに */
.main-content h1:not(.hero-panel h1) {
    font-size: clamp(1.45rem, 2.1vw, 1.95rem);
    font-weight: 700;
    letter-spacing: .02em;
}
.main-content h1:not(.hero-panel h1) > .bi:first-child { display: none; }
.main-content h1.mb-4, .main-content .mb-4 > h1.mb-0 { margin-bottom: 1.6rem !important; }

.app-footer {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    font-size: .76rem;
}
.app-footer a { color: var(--ink-faint); text-decoration: none; }
.app-footer a:hover { color: var(--ink); }

/* ---------- モバイル用トップバー ---------- */
.app-navbar {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: rgba(242, 239, 231, .86);
    backdrop-filter: saturate(170%) blur(18px);
    -webkit-backdrop-filter: saturate(170%) blur(18px);
    border-bottom: 1px solid var(--line);
    padding-top: calc(.6rem + env(safe-area-inset-top, 0px));
    padding-bottom: .6rem;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}
.app-navbar .navbar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 800;
    font-size: .98rem;
    color: var(--ink);
    letter-spacing: .02em;
}
.app-navbar .brand-mark { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; font-size: .9rem; }
.app-navbar .navbar-toggler {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .35rem .55rem;
    background: var(--surface);
}
.app-navbar .navbar-toggler:focus { box-shadow: none; }
.app-navbar .navbar-collapse {
    margin-top: .75rem;
    padding: .5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    max-height: 72vh;
    overflow-y: auto;
}
.app-navbar .navbar-collapse .nav-link {
    padding: .7rem .9rem;
    border-radius: var(--r-sm);
    color: var(--ink);
    font-weight: 600;
}
.app-navbar .navbar-collapse .nav-link:hover { background: var(--paper-3); }
.mobile-menu-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: .5rem;
    padding: .85rem .9rem .5rem;
    border-top: 1px solid var(--line);
}

/* ============================================================
   Cards
   ============================================================ */
.card {
    --bs-card-bg: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg) !important;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    color: var(--ink);
    /* 角の四角い中身（テーブル等）が丸角からはみ出ないよう切り取る */
    overflow: hidden;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .25s ease;
}
.card.border-0 { border: 1px solid var(--line) !important; }
.card.shadow-sm, .card.shadow, .card.shadow-lg { box-shadow: var(--shadow-xs) !important; }
.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--line);
    padding: 1.15rem 1.4rem;
    font-weight: 700;
}
.card-header.border-0 { padding-bottom: .4rem; }
.card-header h2, .card-header h3, .card-header h5, .card-header .h6 {
    font-size: .98rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.card-header .bi:first-child, .card-body > h2.h6 > .bi:first-child { color: var(--ink-faint); margin-right: .35rem !important; }
.card-body { padding: 1.4rem; }
.card-footer { background: transparent; border-top: 1px solid var(--line); padding: 1rem 1.4rem; }
.card-title { font-weight: 700; }

a.card:hover, .card.card-hover:hover, .teacher-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
}
.teacher-card { cursor: pointer; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    --bs-btn-focus-box-shadow: 0 0 0 4px rgba(17, 17, 19, .12);
    border-radius: 999px;
    font-weight: 700;
    font-size: .88rem;
    letter-spacing: .01em;
    padding: .66rem 1.35rem;
    transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), transform .15s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn-sm { padding: .44rem 1rem; font-size: .8rem; }
.btn-lg { padding: .9rem 1.8rem; font-size: .98rem; }
.btn i { vertical-align: -.08em; }

.btn-primary, .btn-dark {
    background: var(--bs-primary);
    border: 1px solid var(--bs-primary);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus-visible, .btn-primary:active, .btn-primary.active,
.btn-dark:hover, .btn-dark:active {
    background: #000 !important;
    border-color: #000 !important;
    color: #fff !important;
    box-shadow: 0 8px 22px rgba(17, 17, 19, .2);
}
.btn-primary:disabled, .btn-primary.disabled { background: var(--bs-primary); border-color: var(--bs-primary); opacity: .35; }

.btn-volt, .btn-light.btn-volt {
    background: var(--volt);
    border: 1px solid var(--volt);
    color: var(--ink);
}
.btn-volt:hover, .btn-volt:focus-visible { background: var(--volt-deep); border-color: var(--volt-deep); color: var(--ink); box-shadow: 0 10px 26px rgba(196, 236, 28, .35); }

.btn-outline-primary, .btn-outline-secondary, .btn-outline-dark {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--ink);
}
.btn-outline-primary:hover, .btn-outline-primary.active, .btn-check:checked + .btn-outline-primary,
.btn-outline-secondary:hover, .btn-outline-dark:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}
.btn-check:checked + .btn-outline-secondary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #0d6a4a; border-color: #0d6a4a; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #b12828; border-color: #b12828; }
.btn-warning { background: #f0b429; border-color: #f0b429; color: var(--ink); }
.btn-outline-danger { background: var(--surface); border: 1px solid #efc6c1; color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-outline-success { background: var(--surface); border: 1px solid #bfe0cf; color: var(--success); }
.btn-outline-success:hover { background: var(--success); border-color: var(--success); color: #fff; }
.btn-outline-warning { border: 1px solid #ecd3a3; color: var(--warning); background: var(--surface); }
.btn-outline-warning:hover { background: #f0b429; border-color: #f0b429; color: var(--ink); }
.btn-light { background: #fff; border: 1px solid #fff; color: var(--ink); }
.btn-link { font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); }
.btn-link:hover { color: #000; text-decoration-color: var(--ink); }
.btn-close:focus { box-shadow: none; }

/* 選択中ボタン内の補助テキストは白に */
.btn-primary .text-muted,
.btn-check:checked + .btn .text-muted,
.btn.active .text-muted { color: rgba(255, 255, 255, .72) !important; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
    border-radius: 999px;
    font-weight: 700;
    font-size: .7rem;
    padding: .42em .78em;
    letter-spacing: .04em;
}
.badge.bg-primary   { background: rgba(17, 17, 19, .07) !important; color: var(--ink) !important; }
.badge.bg-info      { background: var(--info-soft) !important; color: var(--info) !important; }
.badge.bg-success   { background: var(--success-soft) !important; color: var(--success) !important; }
.badge.bg-warning   { background: var(--warning-soft) !important; color: var(--warning) !important; }
.badge.bg-danger    { background: var(--danger-soft) !important; color: var(--danger) !important; }
.badge.bg-secondary { background: var(--paper-2) !important; color: var(--ink-soft) !important; }
.badge.bg-dark      { background: var(--ink) !important; color: #fff !important; }
.badge.bg-light     { background: var(--paper-3) !important; color: var(--ink-soft) !important; border: 1px solid var(--line); }
.badge-volt         { background: var(--volt) !important; color: var(--ink) !important; }

/* ============================================================
   Forms
   ============================================================ */
.form-control, .form-select {
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: .7rem 1rem;
    color: var(--ink);
    font-size: .92rem;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.form-control::placeholder { color: var(--ink-faint); }
.form-control:hover, .form-select:hover { border-color: var(--line-strong); }
.form-control:focus, .form-select:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 4px rgba(17, 17, 19, .07);
    background-color: #fff;
}
.form-control-sm, .form-select-sm { padding: .45rem .85rem; font-size: .84rem; }
.form-control-lg { padding: .9rem 1.1rem; }
.form-label { font-weight: 700; font-size: .8rem; color: var(--ink); margin-bottom: .45rem; letter-spacing: .03em; }
.form-text { color: var(--ink-soft); font-size: .78rem; }
.form-check-input { border-color: var(--line-strong); }
.form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(17, 17, 19, .08); border-color: var(--ink); }
.form-switch .form-check-input:checked { background-color: var(--ink); }
.input-group-text { background: var(--paper-3); border-color: var(--line); color: var(--ink-soft); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); }
.invalid-feedback { color: var(--danger); }

/* ============================================================
   Tables
   ============================================================ */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink);
    --bs-table-hover-bg: var(--paper-3);
    --bs-table-striped-bg: var(--paper-3);
    margin-bottom: 0;
    font-size: .9rem;
}
.table-responsive { -webkit-overflow-scrolling: touch; }
/* スマホではセル内改行で崩れるため、折り返さず横スクロールで見せる */
.table-responsive .table, .table-responsive .table td, .table-responsive .table th { white-space: nowrap; }
.table thead th, .table thead.table-light th {
    background: transparent;
    color: var(--ink-faint);
    font-family: "Inter", var(--font-sans);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
    padding-top: 1rem !important;
    padding-bottom: .85rem !important;
}
.table > :not(caption) > * > * {
    border-bottom-color: var(--line);
    padding: 1rem .9rem;
    vertical-align: middle;
}
.table > tbody > tr:last-child > * { border-bottom: 0; }
.table-hover > tbody > tr { transition: background-color .15s ease; }
.table-hover > tbody > tr:hover > * { background-color: var(--paper-3); --bs-table-bg-state: transparent; }
/* カード端まで敷き詰めたテーブルは両端に余白を足して呼吸感を出す */
.card > .card-body.p-0 .table > :not(caption) > tr > :first-child,
.card > .table-responsive .table > :not(caption) > tr > :first-child,
.card > .card-body.p-0 .table-responsive .table > :not(caption) > tr > :first-child { padding-left: 1.5rem; }
.card > .card-body.p-0 .table > :not(caption) > tr > :last-child,
.card > .table-responsive .table > :not(caption) > tr > :last-child,
.card > .card-body.p-0 .table-responsive .table > :not(caption) > tr > :last-child { padding-right: 1.5rem; }

/* ============================================================
   Lists / Pagination / Tabs
   ============================================================ */
.list-group { --bs-list-group-bg: transparent; }
.list-group-item { border-color: var(--line); color: var(--ink); padding: 1rem 1.4rem; background: transparent; }
.list-group-item.active { background: var(--paper-2); color: var(--ink); border-color: var(--line); }
.list-group-item-action:hover { background: var(--paper-3); }

.pagination { gap: .3rem; --bs-pagination-border-color: var(--line); --bs-pagination-color: var(--ink); --bs-pagination-bg: var(--surface); --bs-pagination-hover-bg: var(--paper-3); --bs-pagination-hover-color: var(--ink); --bs-pagination-focus-box-shadow: none; }
.page-link { border-radius: 10px !important; font-weight: 700; font-size: .84rem; min-width: 2.4rem; text-align: center; }
.page-item.active .page-link { background: var(--ink); border-color: var(--ink); color: #fff; }

/* セグメントタブ */
.pill-tab {
    display: inline-flex;
    gap: .2rem;
    padding: .3rem;
    background: var(--paper-2);
    border-radius: 999px;
    max-width: 100%;
}
.pill-tab.flex-wrap { display: flex; border-radius: var(--r-md); }
.pill-tab .nav-link {
    border-radius: 999px;
    font-weight: 700;
    font-size: .82rem;
    color: var(--ink-soft);
    padding: .5rem 1rem;
    transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.pill-tab .nav-link:hover { color: var(--ink); }
.pill-tab .nav-link.active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(17, 17, 19, .08), 0 4px 12px rgba(17, 17, 19, .05);
}
.nav-tabs { border-bottom: 1px solid var(--line); gap: .5rem; }
.nav-tabs .nav-link { color: var(--ink-soft); font-weight: 700; border: 0; border-bottom: 2px solid transparent; padding: .7rem .4rem; background: transparent; }
.nav-tabs .nav-link:hover { color: var(--ink); }
.nav-tabs .nav-link.active { color: var(--ink); background: transparent; border-bottom-color: var(--ink); }
.nav-pills .nav-link { border-radius: 999px; font-weight: 700; color: var(--ink-soft); }
.nav-pills .nav-link.active { background: var(--ink); color: #fff; }

/* ============================================================
   Alerts
   ============================================================ */
.alert {
    border: 1px solid transparent;
    border-radius: var(--r-md);
    font-size: .88rem;
    font-weight: 600;
    padding: .95rem 1.15rem;
}
.alert-success { background: var(--success-soft); border-color: #c8e6d6; color: #0c5d41; }
.alert-danger  { background: var(--danger-soft); border-color: #f2c9c4; color: #a02424; }
.alert-warning { background: var(--warning-soft); border-color: #f0d9a8; color: #7e4a00; }
.alert-info    { background: var(--info-soft); border-color: #cfd6f8; color: #243aa8; }
.alert-secondary, .alert-light { background: var(--paper-3); border-color: var(--line); color: var(--ink-soft); }
.alert .btn-close { padding: 1.1rem; }

/* ============================================================
   Stat tiles
   ============================================================ */
.stat-tile {
    position: relative;
    border-radius: var(--r-lg);
    padding: 1.4rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .25s ease;
}
/* 数字は雑誌風のセリフ体で大きく */
.stat-tile .fs-3 {
    font-family: var(--font-serif) !important;
    font-weight: 400 !important;
    font-size: 2.7rem !important;
    line-height: 1.05;
    letter-spacing: -.01em;
    margin-top: .2rem;
}
.stat-tile .fs-3 .small { font-family: var(--font-sans); font-size: .82rem !important; }
.stat-tile .text-muted.small { font-weight: 600; }
.stat-tile-tappable { cursor: pointer; }
.stat-tile-tappable:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
}
.stat-icon {
    width: 42px; height: 42px;
    flex: 0 0 42px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    background: var(--paper-2);
    color: var(--ink);
}
.stat-icon-mint  { background: var(--success-soft); color: var(--success); }
.stat-icon-amber { background: var(--warning-soft); color: var(--warning); }
.stat-icon-rose  { background: var(--danger-soft);  color: var(--danger); }
.stat-icon-blue  { background: var(--info-soft);    color: var(--info); }
.stat-icon-dark  { background: var(--ink); color: var(--volt); }
.stat-icon-volt  { background: var(--volt); color: var(--ink); }

.quick-link-card { text-align: center; padding: 1.5rem 1rem; font-weight: 700; }
.quick-link-card .stat-icon { margin: 0 auto .8rem; transition: transform .4s var(--ease); }
.quick-link-card:hover .stat-icon { transform: translateY(-2px) rotate(-4deg); }

/* ============================================================
   Hero panel — インクの黒板にボルトの光と粒子感
   ============================================================ */
.hero-panel {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: var(--r-xl);
    background-color: var(--ink);
    background-image:
        radial-gradient(520px 320px at 100% 0%, rgba(255, 255, 255, .08) 0%, transparent 65%),
        radial-gradient(420px 300px at 0% 100%, rgba(120, 130, 255, .16) 0%, transparent 70%);
    color: #fff;
    padding: 2.2rem 2.4rem;
}
.hero-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--grain);
    opacity: .14;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: -1;
}
/* 英会話スクールらしく、巨大な "Aa" をうっすらと敷く（固定pxで配置） */
.hero-panel::after {
    content: "Aa";
    position: absolute;
    right: -10px;
    bottom: -78px;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 15rem;
    line-height: 1;
    color: rgba(255, 255, 255, .045);
    pointer-events: none;
    z-index: -1;
}
.hero-panel h1, .hero-panel h2, .hero-panel h3, .hero-panel .h3, .hero-panel .h4 { color: #fff; }
.hero-panel h1 { font-size: clamp(1.35rem, 2vw, 1.75rem); font-weight: 700; letter-spacing: .02em; }
.hero-panel .text-muted, .hero-panel .opacity-75 { color: rgba(255, 255, 255, .62) !important; opacity: 1 !important; }
.hero-panel .btn-light {
    background: var(--volt);
    border-color: var(--volt);
    color: var(--ink);
}
.hero-panel .btn-light:hover { background: var(--volt-deep); border-color: var(--volt-deep); box-shadow: 0 10px 26px rgba(196, 236, 28, .3); }
.hero-panel .btn-outline-light {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .22);
    color: #fff;
}
.hero-panel .btn-outline-light:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .45); color: #fff; }
.hero-greeting {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(2.4rem, 4.2vw, 3.6rem);
    line-height: 1;
    letter-spacing: -.01em;
    color: var(--volt);
    margin-bottom: .6rem;
}
.hero-meta { color: rgba(255, 255, 255, .55); font-size: .76rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; font-family: "Inter", var(--font-sans); }
.hero-panel-live {
    background-image:
        radial-gradient(560px 360px at 100% 0%, rgba(22, 160, 112, .42) 0%, transparent 62%),
        radial-gradient(420px 300px at 0% 100%, rgba(120, 130, 255, .16) 0%, transparent 70%);
}
.live-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--volt);
    box-shadow: 0 0 0 0 rgba(217, 255, 63, .7);
    animation: live-pulse 1.8s infinite;
    vertical-align: middle;
}
@keyframes live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(217, 255, 63, .6); }
    70% { box-shadow: 0 0 0 10px rgba(217, 255, 63, 0); }
    100% { box-shadow: 0 0 0 0 rgba(217, 255, 63, 0); }
}
@media (max-width: 767.98px) {
    .hero-panel {
        padding: 1.6rem 1.4rem;
        border-radius: var(--r-lg);
        flex-direction: column;
        align-items: stretch !important;
    }
    .hero-panel::after { font-size: 10rem; bottom: -50px; }
    .hero-panel > .d-flex.gap-2, .hero-panel > form { width: 100%; margin-top: .4rem; }
    .hero-panel > .d-flex.gap-2 .btn, .hero-panel > form .btn { flex: 1 1 auto; width: 100%; }
}

/* ============================================================
   Student dashboard
   ============================================================ */
.next-lesson {
    position: relative;
    height: 100%;
    border-radius: var(--r-xl);
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 1.6rem 1.6rem 1.4rem;
    display: flex;
    flex-direction: column;
}
.next-lesson-time {
    font-family: var(--font-serif);
    font-size: 3.6rem;
    line-height: 1;
    letter-spacing: -.02em;
    margin: .5rem 0 .2rem;
}
.next-lesson-date { color: var(--ink-soft); font-weight: 600; font-size: .9rem; }
.next-lesson-teacher {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: auto;
    padding-top: 1.1rem;
    border-top: 1px dashed var(--line-strong);
}
.countdown-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: var(--volt);
    color: var(--ink);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    height: 100%;
    padding: 1.3rem 1.4rem 1.2rem;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    text-align: left;
    color: var(--ink);
    width: 100%;
    cursor: pointer;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .25s ease;
}
.metric:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.metric-head { display: flex; align-items: center; justify-content: space-between; }
.metric-value { font-family: var(--font-serif); font-size: 3rem; line-height: 1; letter-spacing: -.02em; margin-top: .6rem; }
.metric-value small { font-family: var(--font-sans); font-size: .82rem; color: var(--ink-soft); margin-left: .25rem; letter-spacing: .02em; }
.metric-label { font-size: .82rem; font-weight: 700; color: var(--ink-soft); }
.metric-arrow {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--paper-3);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: .8rem;
    transition: background-color .25s var(--ease), color .25s var(--ease), transform .35s var(--ease);
}
.metric:hover .metric-arrow { background: var(--ink); color: var(--volt); border-color: var(--ink); transform: rotate(-45deg); }

.shortcut {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1rem 1.1rem;
    border-radius: var(--r-md);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    font-size: .9rem;
    height: 100%;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .25s ease;
}
.shortcut:hover { color: var(--ink); transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.shortcut .shortcut-sub { display: block; font-size: .74rem; font-weight: 500; color: var(--ink-faint); }
.shortcut .bi-arrow-up-right { margin-left: auto; color: var(--ink-faint); transition: transform .35s var(--ease), color .2s ease; }
.shortcut:hover .bi-arrow-up-right { transform: translate(2px, -2px); color: var(--ink); }

.progress-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.progress-pct { font-family: var(--font-serif); font-size: 2.4rem; line-height: 1; letter-spacing: -.02em; }
.progress-pct small { font-family: var(--font-sans); font-size: .8rem; color: var(--ink-soft); margin-left: .1rem; }

.section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 2.2rem 0 1rem;
}
.section-title h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.section-title .eyebrow { display: block; margin-bottom: .25rem; }

/* ============================================================
   Progress / Empty / Avatar / Slot rows
   ============================================================ */
.progress { background: var(--paper-2); border-radius: 999px; height: 6px; overflow: hidden; }
.progress-bar { background: var(--ink); border-radius: 999px; transition: width .8s var(--ease); }
.progress-volt .progress-bar { background: var(--volt); }

.empty-state { text-align: center; padding: 2.8rem 1rem; color: var(--ink-soft); font-size: .9rem; }
.empty-state i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px; height: 60px;
    margin: 0 auto 1rem;
    border-radius: 18px;
    background: var(--paper-3);
    border: 1px dashed var(--line-strong);
    color: var(--ink-faint);
    font-size: 1.45rem;
}

.avatar-circle {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: var(--ink);
    color: var(--volt);
    font-weight: 700;
}
img.rounded-circle { flex-shrink: 0; }

.slot-row {
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 1rem 1.25rem;
    background: var(--surface);
    color: var(--ink);
    transition: box-shadow .35s var(--ease), transform .35s var(--ease), border-color .25s ease;
}
.slot-row:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-strong); }

.tx-row { display: flex; align-items: center; gap: .9rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.tx-row:last-child { border-bottom: 0; }
.tx-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; flex-shrink: 0; color: #fff; }

/* ============================================================
   Dropdowns / Modals / Accordion
   ============================================================ */
.dropdown-menu {
    --bs-dropdown-link-active-bg: var(--paper-2);
    --bs-dropdown-link-active-color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    padding: .4rem;
    font-size: .88rem;
}
.dropdown-item { border-radius: 10px; padding: .55rem .8rem; font-weight: 600; color: var(--ink); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--paper-3); color: var(--ink); }
.dropdown-item.text-danger:hover { background: var(--danger-soft); }
.dropdown-item-text { color: var(--ink-soft); }
.dropdown-divider { border-color: var(--line); }

.modal-backdrop { background-color: #0b0b0d; }
.modal-backdrop.show { opacity: .5; }
.modal-content {
    border: 0;
    border-radius: var(--r-xl);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    color: var(--ink);
    overflow: hidden;
}
.modal-header { border-bottom: 1px solid var(--line); padding: 1.25rem 1.5rem; }
.modal-title { font-weight: 700; font-size: 1.02rem; }
.modal-title .bi { color: var(--ink-faint); }
.modal-body { padding: 1.5rem; }
.modal-footer { border-top: 1px solid var(--line); padding: 1rem 1.5rem; background: var(--paper-3); }
.modal.fade .modal-dialog { transform: translateY(24px) scale(.97); transition: transform .4s var(--ease); }
.modal.show .modal-dialog { transform: none; }
.modal .display-6 { font-family: var(--font-serif); font-weight: 400 !important; font-size: 3.4rem; }
@media (max-width: 575.98px) {
    .modal-dialog {
        margin-top: calc(.75rem + env(safe-area-inset-top, 0px));
        margin-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
    }
}

.accordion {
    --bs-accordion-bg: var(--surface);
    --bs-accordion-border-color: var(--line);
    --bs-accordion-active-bg: var(--paper-3);
    --bs-accordion-active-color: var(--ink);
    --bs-accordion-btn-focus-box-shadow: none;
    --bs-accordion-border-radius: var(--r-md);
    --bs-accordion-inner-border-radius: var(--r-md);
}
.accordion-button { font-weight: 700; color: var(--ink); }

/* ============================================================
   Mobile bottom tab bar（形と動きは従来のまま、色を新パレットに）
   ============================================================ */
.bottom-tab-bar {
    display: none;
    position: fixed;
    /* iPhone の下端の余白はバーの外側に取り、バー自体は薄くする */
    left: 10px; right: 10px; bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    z-index: 1030;
    background: rgba(17, 17, 19, .94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 20px;
    box-shadow: 0 10px 28px rgba(17, 17, 19, .3);
    padding: .2rem .3rem;
}
.bottom-tab-bar .row { --bs-gutter-x: 0; }
.bottom-tab-bar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .1rem;
    padding: .3rem .1rem;
    color: rgba(255, 255, 255, .5);
    text-decoration: none;
    font-size: .62rem;
    font-weight: 600;
    border-radius: var(--r-sm);
    transition: color .2s ease;
}
.bottom-tab-bar a i { font-size: 1.1rem; line-height: 1; }
.bottom-tab-bar a.active { color: #fff; }
.bottom-tab-bar a.active i { color: var(--volt); transform: translateY(-1px); }
.bottom-tab-bar a.tab-fab { position: relative; margin-top: -1.35rem; }
.bottom-tab-bar a.tab-fab .tab-fab-icon {
    width: 46px; height: 46px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--volt);
    color: var(--ink);
    font-size: 1.25rem;
    box-shadow: 0 8px 20px rgba(196, 236, 28, .4), 0 0 0 4px rgba(17, 17, 19, .94);
    margin-bottom: 0;
}
.bottom-tab-bar a.tab-fab.active i { color: var(--ink); }
.bottom-tab-bar a.tab-fab span { color: rgba(255, 255, 255, .5); }
.bottom-tab-bar a.tab-fab.active span { color: #fff; }

/* 「教材」ドロップアップ。.dropdown-menu には Popper が配置用 transform を
   インラインで書くため、見た目と動きは内側の .dropup-pop に持たせる
   （同じ transform を奪い合うと閉じる時に右下へ飛ぶように見える） */
.bottom-tab-bar .dropdown-menu {
    display: block;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility .22s;
}
.bottom-tab-bar .dropdown-menu.show { opacity: 1; visibility: visible; pointer-events: auto; }
.bottom-tab-bar .dropup-pop {
    min-width: 200px;
    padding: .5rem;
    background: rgba(24, 24, 28, .97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 18px;
    box-shadow: 0 24px 48px rgba(17, 17, 19, .45);
    transform: translateY(16px) scale(.92);
    transform-origin: bottom center;
    transition: transform .22s cubic-bezier(.34, 1.56, .64, 1);
}
.bottom-tab-bar .dropdown-menu.show .dropup-pop { transform: translateY(0) scale(1); }
.bottom-tab-bar .dropdown-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem .8rem;
    border-radius: 12px;
    color: rgba(255, 255, 255, .82);
    font-size: .84rem;
    font-weight: 600;
    white-space: nowrap;
}
.bottom-tab-bar .dropdown-item i { font-size: 1.05rem; color: var(--volt); }
.bottom-tab-bar .dropdown-item:hover, .bottom-tab-bar .dropdown-item:focus { background: rgba(255, 255, 255, .08); color: #fff; }

@media (max-width: 767.98px) {
    .bottom-tab-bar { display: block; }
    body { font-size: 14.5px; }
    .main-content { padding: 1.4rem 1rem 2rem; }
    body.has-bottom-tab-bar .main-content { padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); }
    .card-body { padding: 1.15rem; }
    .card-header { padding: 1rem 1.15rem; }
    .app-footer { margin-top: 2.5rem; }
    .card > .card-body.p-0 > .table-responsive,
    .card > .table-responsive { border-radius: 0 0 var(--r-lg) var(--r-lg); }
}

/* ============================================================
   Video / material cards
   ============================================================ */
.video-accordion .accordion-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md) !important;
    overflow: hidden;
    margin-bottom: .6rem;
    color: var(--ink);
}
.video-accordion .accordion-button { background: transparent; color: var(--ink); font-weight: 700; padding: .9rem 1.15rem; }
.video-accordion .accordion-button:not(.collapsed) { background: var(--paper-3); color: var(--ink); box-shadow: none; }
.video-accordion .accordion-button:focus { box-shadow: none; }
.video-accordion-thumb {
    width: 64px; height: 44px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--ink);
    display: flex; align-items: center; justify-content: center;
    color: var(--volt);
    font-size: 1.1rem;
}
.video-accordion-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-accordion .accordion-body { background: var(--surface); }

.video-card { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; cursor: pointer; color: var(--ink); background: var(--surface); }
.video-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.video-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--ink);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.video-card:hover .video-thumb img, a:hover .video-thumb img { transform: scale(1.045); }
.video-thumb .play-badge {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(180deg, rgba(17,17,19,0) 45%, rgba(17,17,19,.45));
    color: #fff;
    font-size: 0;
}
.video-thumb .play-badge::before {
    content: "\F4F4";
    font-family: "bootstrap-icons";
    font-size: 1.25rem;
    width: 54px; height: 54px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--volt);
    color: var(--ink);
    padding-left: 3px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
    transition: transform .35s var(--ease);
}
.video-card:hover .play-badge::before, a:hover .play-badge::before { transform: scale(1.08); }
.video-card .card-body { padding: 1rem 1.15rem 1.15rem; }
.video-card h3 { font-size: .94rem; margin-bottom: .25rem; font-weight: 700; }

.cover-placeholder {
    display: flex; align-items: center; justify-content: center;
    color: var(--volt);
    background-color: var(--ink);
    background-image: radial-gradient(240px 160px at 100% 0%, rgba(217, 255, 63, .18), transparent 70%);
}

.material-filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.25rem; }
.material-filter-bar input[type="search"], .material-filter-bar select { border-radius: 999px; }

/* ============================================================
   Rich text (Quill)
   ============================================================ */
.lesson-rich-content, .legal-rich-content { line-height: 1.95; }
.lesson-rich-content h1, .lesson-rich-content h2, .lesson-rich-content h3,
.legal-rich-content h1, .legal-rich-content h2, .legal-rich-content h3 { font-weight: 700; margin: 1.6rem 0 .8rem; }
.lesson-rich-content h1:first-child, .lesson-rich-content h2:first-child, .lesson-rich-content h3:first-child,
.legal-rich-content h1:first-child, .legal-rich-content h2:first-child, .legal-rich-content h3:first-child { margin-top: 0; }
.lesson-rich-content p, .legal-rich-content p { margin-bottom: 1rem; }
.lesson-rich-content img, .legal-rich-content img { max-width: 100%; border-radius: var(--r-sm); }
.lesson-rich-content ul, .lesson-rich-content ol, .legal-rich-content ul, .legal-rich-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.lesson-rich-content a, .legal-rich-content a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--volt-deep); text-decoration-thickness: 2px; }
.lesson-rich-content blockquote, .legal-rich-content blockquote { border-left: 3px solid var(--volt-deep); padding: .25rem 0 .25rem 1rem; color: var(--ink-soft); }

/* ============================================================
   Auth / Legal
   ============================================================ */
.auth-shell { min-height: 100vh; }
.auth-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: #fff;
    background-color: var(--ink);
    background-image:
        radial-gradient(760px 520px at 110% -10%, rgba(255, 255, 255, .09) 0%, transparent 60%),
        radial-gradient(600px 460px at -20% 120%, rgba(120, 130, 255, .16) 0%, transparent 62%);
}
.auth-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--grain);
    opacity: .16;
    mix-blend-mode: overlay;
    z-index: -1;
}
.auth-display {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(4rem, 7.4vw, 7.2rem);
    line-height: .92;
    letter-spacing: -.02em;
    color: var(--volt);
    margin: 0 0 1.6rem;
}
.auth-display span { color: #fff; font-style: normal; }
.auth-hero h1 { color: #fff; line-height: 1.5; letter-spacing: .03em; font-weight: 700; }
.auth-hero .lead-copy { color: rgba(255, 255, 255, .6); line-height: 1.95; font-size: .92rem; }
.auth-hero .brand-mark { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.feature-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .86);
    font-size: .8rem;
    font-weight: 600;
}
.feature-chip i { color: var(--volt); }
.auth-card { max-width: 420px; width: 100%; }
.auth-card .card, .register-card .card { border-radius: var(--r-xl) !important; box-shadow: var(--shadow-sm) !important; }
.auth-title { font-size: 1.6rem; font-weight: 700; letter-spacing: .02em; }
.auth-footer-links, .auth-footer-links a { color: var(--ink-soft); }
.auth-footer-links a:hover { color: var(--ink); }
.divider-text { display: flex; align-items: center; gap: .8rem; color: var(--ink-faint); font-size: .76rem; font-weight: 600; letter-spacing: .08em; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.role-choice { cursor: pointer; transition: all .2s var(--ease); border-radius: var(--r-md) !important; }
.role-choice.active { border-color: var(--ink) !important; background: var(--paper-3) !important; box-shadow: 0 0 0 3px rgba(17, 17, 19, .06); }

/* ============================================================
   Motion
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
    .main-content > *:not(.modal):not(script):not(style) { animation: rise-in .6s var(--ease) both; }
    .main-content > *:nth-child(2) { animation-delay: .05s; }
    .main-content > *:nth-child(3) { animation-delay: .1s; }
    .main-content > *:nth-child(4) { animation-delay: .15s; }
    .main-content > *:nth-child(5) { animation-delay: .2s; }
    .main-content > *:nth-child(n+6) { animation-delay: .25s; }
}
@keyframes rise-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 1rem;
    height: 100%;
}
@media (min-width: 992px) { .shortcut-grid { gap: 1.25rem; } }

/* ---------- 大きな数字はセリフ体 ---------- */
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: var(--font-serif);
    font-weight: 400 !important;
    letter-spacing: -.02em;
}

/* ---------- プラン ---------- */
.plan-card .card-body { padding: 2rem !important; }
.plan-card .display-6 { font-size: 3.2rem; line-height: 1; }
.plan-check { color: var(--success); font-weight: 700; }
.plan-featured {
    background: var(--ink) !important;
    border-color: var(--ink) !important;
    color: #fff;
    box-shadow: var(--shadow-lg) !important;
    position: relative;
    isolation: isolate;
}
.plan-featured::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(420px 260px at 100% 0%, rgba(255,255,255,.08), transparent 70%);
    z-index: -1;
}
.plan-featured h2, .plan-featured .display-6 { color: #fff; }
.plan-featured .text-muted { color: rgba(255,255,255,.6) !important; }
.plan-featured .plan-check { color: var(--volt); }
@media (min-width: 768px) { .plan-featured { transform: translateY(-10px); } }

/* ---------- チケット ---------- */
.ticket-visual {
    display: flex;
    min-height: 190px;
    color: #fff;
    filter: drop-shadow(0 20px 40px rgba(17,17,19,.18));
}
.ticket-main, .ticket-stub {
    position: relative;
    background: var(--ink);
    isolation: isolate;
}
.ticket-main {
    flex: 1;
    padding: 1.6rem 1.8rem;
    border-radius: var(--r-lg) 0 0 var(--r-lg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    -webkit-mask: radial-gradient(circle 12px at 100% 0, transparent 98%, #000) top / 100% 51% no-repeat,
                  radial-gradient(circle 12px at 100% 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
            mask: radial-gradient(circle 12px at 100% 0, transparent 98%, #000) top / 100% 51% no-repeat,
                  radial-gradient(circle 12px at 100% 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.ticket-main::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--grain);
    opacity: .14;
    mix-blend-mode: overlay;
    z-index: -1;
}
.ticket-count { font-family: var(--font-serif); font-size: 5rem; line-height: 1; letter-spacing: -.03em; color: var(--volt); }
.ticket-count small { font-family: var(--font-sans); font-size: 1rem; color: #fff; margin-left: .35rem; letter-spacing: .02em; }
.ticket-stub {
    width: 96px;
    border-left: 2px dashed rgba(255,255,255,.18);
    border-radius: 0 var(--r-lg) var(--r-lg) 0;
    background: var(--volt);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    font-family: "Inter", var(--font-sans);
    font-weight: 800;
    font-size: .68rem;
    letter-spacing: .18em;
    text-align: center;
    -webkit-mask: radial-gradient(circle 12px at 0 0, transparent 98%, #000) top / 100% 51% no-repeat,
                  radial-gradient(circle 12px at 0 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
            mask: radial-gradient(circle 12px at 0 0, transparent 98%, #000) top / 100% 51% no-repeat,
                  radial-gradient(circle 12px at 0 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.ticket-stub i { font-size: 1.6rem; }

/* ---------- ページ上部の英字ラベル ---------- */
.page-eyebrow {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .55rem;
    font-family: "Inter", var(--font-sans);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink-faint);
}
.page-eyebrow::before {
    content: "";
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
}

.video-card .card-body { padding: .95rem 1.15rem 1.1rem !important; }
.video-card > .video-thumb { border-radius: 0 !important; }
.video-card .card-body h3, .video-card .card-body .fw-bold { line-height: 1.5; }

.hero-panel h1 > .bi:first-child { color: var(--volt); }

@media (max-width: 575.98px) {
    .shortcut { flex-direction: column; align-items: flex-start; gap: .7rem; padding: 1rem; }
}

.btn-secondary { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.btn-secondary:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-info { background: var(--info); border-color: var(--info); color: #fff; }

/* ---------- 講師用：教材の横に並べるマニュアル ---------- */
.manual-sticky { position: sticky; top: 1.5rem; }
.manual-panel {
    background: var(--ink);
    color: #fff;
    border-radius: var(--r-lg);
    padding: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    scrollbar-width: thin;
}
.manual-panel-head { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.manual-panel .eyebrow { color: rgba(255,255,255,.5); }
.manual-panel h2 { color: #fff; }
.manual-panel .text-muted { color: rgba(255,255,255,.55) !important; }
.manual-panel .lesson-rich-content { color: rgba(255,255,255,.88); font-size: .92rem; }
.manual-panel .lesson-rich-content h1, .manual-panel .lesson-rich-content h2, .manual-panel .lesson-rich-content h3 { color: var(--volt); font-size: 1rem; }
.manual-panel .lesson-rich-content strong { color: #fff; }
.manual-panel .lesson-rich-content table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.manual-panel .lesson-rich-content th, .manual-panel .lesson-rich-content td { border-bottom: 1px solid rgba(255,255,255,.12); padding: .45rem .3rem; vertical-align: top; }
.manual-panel .empty-state { color: rgba(255,255,255,.6); }
.manual-panel .empty-state i { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.2); color: rgba(255,255,255,.5); }
@media (max-width: 1199.98px) { .manual-sticky { position: static; } .manual-panel { max-height: none; } }

/* ---------- 教材本文の表（TinyMCEで編集可能） ---------- */
.lesson-rich-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: .5rem 0 1.4rem;
    font-size: .9rem;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    overflow: hidden;
}
.lesson-rich-content th {
    background: var(--paper-2);
    font-weight: 700;
    font-size: .78rem;
    letter-spacing: .04em;
    text-align: left;
    padding: .6rem .9rem;
}
.lesson-rich-content td { padding: .65rem .9rem; border-top: 1px solid var(--line); vertical-align: top; }
.lesson-rich-content td:first-child { font-weight: 600; }
.lesson-rich-content h2 {
    font-size: 1.15rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--line);
}
.lesson-rich-content h2:first-child { border-top: 0; padding-top: 0; }
.lesson-rich-content h3 { font-size: .98rem; color: var(--ink-soft); }
@media (max-width: 575.98px) {
    .lesson-rich-content table { display: block; overflow-x: auto; white-space: nowrap; }
}
.manual-panel .lesson-rich-content table { border-color: rgba(255,255,255,.14); }
.manual-panel .lesson-rich-content th { background: rgba(255,255,255,.08); color: var(--volt); }
.manual-panel .lesson-rich-content td { border-top-color: rgba(255,255,255,.1); }
.manual-panel .lesson-rich-content h2 { border-top-color: rgba(255,255,255,.12); }


/* ---------- 確認テスト ---------- */
.quiz-no {
    width: 34px; height: 34px; flex: 0 0 34px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ink); color: var(--volt);
    font-family: var(--font-serif); font-size: 1.1rem;
}
.quiz-choices { display: grid; gap: .5rem; }
.quiz-choice {
    display: flex; align-items: center; gap: .75rem;
    padding: .75rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.quiz-choice:hover { border-color: var(--line-strong); background: var(--paper-3); }
.quiz-choice input { accent-color: var(--ink); width: 1.05rem; height: 1.05rem; }
.quiz-choice:has(input:checked) { border-color: var(--ink); background: var(--paper-3); box-shadow: 0 0 0 3px rgba(17,17,19,.06); }
.quiz-choice.is-static { cursor: default; }
.quiz-choice.is-answer { border-color: #bfe0cf; background: var(--success-soft); color: #0c5d41; font-weight: 700; }
.quiz-choice.is-chosen-wrong { border-color: #f2c9c4; background: var(--danger-soft); color: #a02424; }
.quiz-card.is-correct { border-left: 4px solid var(--success); }
.quiz-card.is-wrong { border-left: 4px solid var(--danger); }
.quiz-explain { background: var(--paper-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .8rem 1rem; font-size: .88rem; color: var(--ink-2); }
.quiz-cta {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1.4rem 1.6rem;
    border-radius: var(--r-lg);
    background: var(--ink);
    color: #fff;
}
.lesson-rich-content td:first-child { white-space: nowrap; }

.quiz-choices { max-width: 680px; }

/* ============================================================
   自動生成の教材サムネイル（<x-cover>）
   カードの大きさに合わせて文字が拡縮するよう container query 単位を使う
   ============================================================ */
.gen-cover {
    position: absolute;
    inset: 0;
    container-type: size;
    overflow: hidden;
    isolation: isolate;
    background-color: var(--ink);
    background-image:
        radial-gradient(90% 60% at 100% 0%, rgba(255, 255, 255, .09) 0%, transparent 70%),
        radial-gradient(80% 50% at 0% 100%, color-mix(in srgb, var(--cover-accent) 14%, transparent) 0%, transparent 70%);
    color: #fff;
    text-align: left;
}
.gc-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8cqmin 8cqmin 8cqmin 10cqmin;
}
.gen-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--grain);
    opacity: .16;
    mix-blend-mode: overlay;
    z-index: -1;
}
.gen-cover::after {
    /* 左端の背表紙ライン */
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2.2cqmin;
    background: var(--cover-accent);
    opacity: .9;
}
.gc-top { display: flex; justify-content: space-between; align-items: center; gap: 2cqw; }
.gc-brand {
    font-family: "Inter", var(--font-sans);
    font-weight: 800;
    font-size: max(9px, 5cqmin);
    letter-spacing: .14em;
    color: rgba(255, 255, 255, .85);
    white-space: nowrap;
}
.gc-brand i { color: var(--cover-accent); }
.gc-kicker {
    font-family: "Inter", var(--font-sans);
    font-weight: 700;
    font-size: max(8px, 4.2cqmin);
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--cover-accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gc-num {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 42cqmin;
    line-height: .8;
    letter-spacing: -.04em;
    color: var(--cover-accent);
    align-self: flex-end;
    padding-right: 2cqmin;
}
.gc-bottom { display: flex; flex-direction: column; align-items: flex-start; gap: 2.2cqmin; }
.gc-level {
    font-family: "Inter", var(--font-sans);
    font-weight: 800;
    font-size: max(8px, 3.8cqmin);
    letter-spacing: .1em;
    padding: .5cqmin 2.4cqmin;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--cover-accent) 60%, transparent);
    color: var(--cover-accent);
}
.gc-title {
    font-family: var(--font-serif);
    font-size: max(13px, 10cqmin);
    line-height: 1.05;
    letter-spacing: -.01em;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gc-title--video {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: max(12px, 7.5cqmin);
    line-height: 1.35;
    -webkit-line-clamp: 3;
    max-width: 80%;
}
.gen-cover--manual { background-color: #1a1b20; }
.gen-cover--manual .gc-num { -webkit-text-stroke: .5cqmin var(--cover-accent); color: transparent; }
.gen-cover--video .gc-bottom { display: none; }
.video-thumb .gen-cover { z-index: 0; }

/* 小さく表示されるとき（ロードマップの一覧など）は番号とレベルだけのシンプルな表紙にする */
@container (max-width: 150px) {
    .gc-inner { padding: 10cqmin 8cqmin 10cqmin 12cqmin; justify-content: center; align-items: center; gap: 6cqmin; }
    .gc-top, .gc-title { display: none; }
    .gc-num { font-size: 58cqmin; align-self: center; padding: 0; }
    .gc-bottom { align-items: center; }
    .gc-level { font-size: 11cqmin; padding: .5cqmin 4cqmin; letter-spacing: .04em; white-space: nowrap; }
    .gc-level-prefix { display: none; }
}

/* ============================================================
   単語帳
   ============================================================ */
.vocab-mode {
    display: flex; flex-direction: column; gap: .35rem;
    height: 100%;
    padding: 1.3rem 1.4rem;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .25s ease;
}
.vocab-mode:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.vocab-mode.is-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.vocab-mode.is-primary:hover { color: #fff; }
.vocab-mode.is-primary .eyebrow, .vocab-mode.is-primary .vocab-mode-desc { color: rgba(255,255,255,.6); }
.vocab-mode.is-primary .bi { color: var(--volt); }
.vocab-mode.is-disabled { opacity: .45; pointer-events: none; }
.vocab-mode-count { font-family: var(--font-serif); font-size: 2.8rem; line-height: 1; margin: .3rem 0 .2rem; }
.vocab-mode.is-primary .vocab-mode-count { color: var(--volt); }
.vocab-mode-count small { font-family: var(--font-sans); font-size: .85rem; margin-left: .2rem; }
.vocab-mode-desc { color: var(--ink-soft); }
.vocab-row { display: grid; grid-template-columns: minmax(120px, 28%) 1fr auto; gap: 1rem; align-items: center; }
.vocab-word { font-family: var(--font-serif); font-size: 1.35rem; line-height: 1.2; }
@media (max-width: 575.98px) { .vocab-row { grid-template-columns: 1fr auto; } .vocab-meaning { grid-column: 1 / -1; grid-row: 2; } }

.vocab-levels { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.vocab-level {
    display: inline-flex; align-items: center;
    padding: .42rem .9rem; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface);
    color: var(--ink-soft); font-size: .85rem; font-weight: 600; text-decoration: none;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.vocab-level:hover { color: var(--ink); border-color: var(--line-strong); }
.vocab-level.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.vocab-mastery { font-size: .8rem; font-weight: 700; padding: .2rem .65rem; border-radius: 999px; background: rgba(17,17,19,.06); color: var(--ink-soft); }
.vocab-mastery.is-mastered { background: var(--volt); color: var(--ink); }
.vocab-test { max-width: 680px; margin: 0 auto; }
.vocab-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}
.vocab-card-word { font-family: var(--font-serif); font-size: clamp(2.6rem, 6vw, 3.6rem); line-height: 1.05; }
.vocab-card-example { color: var(--ink-soft); margin-top: .6rem; font-style: italic; }
.vocab-card .quiz-choice { width: 100%; text-align: left; font-weight: 600; }
.vocab-card .quiz-choice:disabled { cursor: default; opacity: 1; }
.vocab-feedback { margin-top: 1rem; padding: .85rem 1rem; border-radius: var(--r-sm); font-weight: 700; }
.vocab-feedback.is-correct { background: var(--success-soft); color: #0c5d41; }
.vocab-feedback.is-wrong { background: var(--danger-soft); color: #a02424; }

/* ============================================================
   ロードマップ
   ============================================================ */
.road-legend { display: flex; flex-wrap: wrap; gap: .5rem; }
.road-legend span {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .4rem .85rem; border-radius: 999px;
    background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
    font-size: .8rem; font-weight: 600; color: rgba(255,255,255,.88);
}
.road-legend i { color: var(--volt); }
.next-checks li { display: flex; align-items: center; gap: .55rem; padding: .3rem 0; color: var(--ink-soft); font-weight: 600; font-size: .9rem; }
.next-checks li i { color: var(--ink-faint); }
.next-checks li.is-done { color: var(--ink); }
.next-checks li.is-done i { color: var(--success); }
.road-book-cover { width: 64px; flex: 0 0 64px; border-radius: 10px; overflow: hidden; }
.road-track {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
    gap: .7rem .5rem;
    position: relative;
}
.road-step {
    display: flex; flex-direction: column; align-items: center; gap: .35rem;
    text-decoration: none; color: var(--ink);
}
.road-dot {
    width: 38px; height: 38px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-serif); font-size: 1.05rem;
    background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-soft);
    transition: transform .25s var(--ease);
}
.road-step:hover .road-dot { transform: scale(1.1); }
.road-step.is-progress .road-dot { background: var(--surface); border: 2px solid var(--ink); color: var(--ink); }
.road-step.is-complete .road-dot { background: var(--ink); border-color: var(--ink); color: var(--volt); font-size: 1.2rem; }
.road-step.is-next .road-dot { box-shadow: 0 0 0 4px var(--volt); }
.road-pips { display: inline-flex; gap: 3px; }
.road-pips i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); display: inline-block; }
.road-pips i.on { background: var(--success); }

.journey-day { display: grid; grid-template-columns: 110px 1fr; gap: 1.2rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.journey-day:last-child { border-bottom: 0; }
.journey-date { display: flex; flex-direction: column; }
.journey-date .serif { font-size: 2rem; line-height: 1; }
.journey-events { display: grid; gap: .6rem; }
.journey-event {
    display: flex; align-items: center; gap: .85rem;
    padding: .8rem 1rem; border-radius: var(--r-md);
    background: var(--surface); border: 1px solid var(--line);
    color: var(--ink); text-decoration: none;
    transition: border-color .2s ease, box-shadow .3s var(--ease);
}
.journey-event:hover { color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.journey-icon { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--paper-2); }
.journey-event.is-lesson .journey-icon { background: var(--success-soft); color: var(--success); }
.journey-event.is-quiz .journey-icon { background: var(--info-soft); color: var(--info); }
.journey-event.is-quiz_perfect .journey-icon { background: var(--ink); color: var(--volt); }
.journey-event.is-words .journey-icon { background: var(--warning-soft); color: var(--warning); }
@media (max-width: 575.98px) { .journey-day { grid-template-columns: 1fr; gap: .6rem; } }
.lesson-video { overflow: hidden; }
.lesson-video video { background: var(--ink); max-height: 70vh; }


/* ============================================================
   講師向けの英訳（教材本文の日本語の下に入る）
   生徒の教材画面では非表示、講師ライブラリ（.show-en）でのみ表示
   ============================================================ */
.en-gloss { display: none; }
.show-en .en-gloss {
    display: block;
    margin-top: .15rem;
    font-size: .82em;
    line-height: 1.5;
    font-weight: 500;
    font-style: normal;
    color: var(--ink-soft);
}
.show-en .en-gloss::before {
    content: "EN";
    display: inline-block;
    margin-right: .4rem;
    padding: 0 .3rem;
    border-radius: 4px;
    font-size: .68em;
    font-weight: 800;
    letter-spacing: .04em;
    vertical-align: .1em;
    background: rgba(17,17,19,.07);
}
.show-en h2[data-en]::after, .show-en h3[data-en]::after {
    content: attr(data-en);
    display: block;
    margin-top: .1rem;
    font-size: .62em;
    font-weight: 600;
    color: var(--ink-soft);
}

/* 英検レッスンのイラスト */
.eiken-picture { margin: 1rem 0; }
.eiken-picture img { display: block; width: 100%; max-width: 720px; height: auto; border-radius: 14px; border: 1px solid rgba(17,17,19,.08); background: #fff; }

/* 世界地図コンテンツ */
.world-search { position: relative; min-width: 280px; }
.world-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #8a8a8a; }
.world-search input { padding-left: 38px; border-radius: 999px; }
.world-map-card { overflow: hidden; background: #eaf3f8; }
.world-map { width: 100%; height: auto; display: block; }
.world-map path { stroke: #fff; stroke-width: .5; }
.world-map .no-content { fill: #d6dbe0; }
.world-map .has-content path { fill: #111113; transition: fill .15s; cursor: pointer; }
.world-map .has-content:hover path, .world-map .has-content.is-match path { fill: #b9d92b; }
.world-legend { display: flex; gap: 18px; font-size: .85rem; color: #666; padding: 8px 6px 0; }
.world-legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: #d6dbe0; margin-right: 6px; vertical-align: -1px; }
.world-legend .dot.is-on { background: #111113; }
.world-flag { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); flex-shrink: 0; }
.world-country-card { transition: transform .12s, box-shadow .12s; }
.world-country-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.world-hero-flag { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.lesson-flag { width: 36px; height: 27px; object-fit: cover; border-radius: 4px; vertical-align: -6px; box-shadow: 0 0 0 1px rgba(0,0,0,.1); }
.world-hero-shape { width: 220px; height: 140px; }
.world-hero-shape path { fill: var(--volt, #d9ff3f); stroke: none; }
.world-list li { margin-bottom: .75rem; }
.world-list li:last-child { margin-bottom: 0; }
.world-timeline { display: grid; gap: 10px; }
.world-timeline-item { display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: start; padding-bottom: 10px; border-bottom: 1px dashed rgba(0,0,0,.1); }
.world-timeline-item:last-child { border-bottom: 0; }
.world-timeline-item .year { font-family: 'Instrument Serif', serif; font-size: 1.6rem; line-height: 1; }
.world-level { border-top: 4px solid #111113; }
.world-level-2 { border-top-color: #7cc8ff; }
.world-level-3 { border-top-color: #ff9b7a; }
.world-map .is-marker circle { fill: #111113; stroke: #fff; stroke-width: 1.2; cursor: pointer; }
.world-map .is-marker:hover circle, .world-map .is-marker.is-match circle { fill: #b9d92b; }
.world-map-card { position: relative; }
.world-map .no-content:hover { fill: #b8c0c8; }
.world-tip { position: absolute; z-index: 5; pointer-events: none; display: flex; align-items: center; gap: 10px; background: #111113; color: #fff; padding: 8px 12px 8px 8px; border-radius: 12px; box-shadow: 0 10px 24px rgba(0,0,0,.25); white-space: nowrap; }
.world-tip[hidden] { display: none; }
.world-tip img { width: 40px; height: 30px; object-fit: cover; border-radius: 4px; box-shadow: 0 0 0 1px rgba(255,255,255,.2); }
.world-tip-name { font-weight: 700; font-size: .95rem; line-height: 1.2; }
.world-tip-sub { font-size: .75rem; opacity: .75; }
.world-tip.is-off { background: #4a4f57; }

/* キッズコース：イラストのカード */
.lesson-rich-content .kids-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin: 1rem 0 1.5rem; }
.lesson-rich-content .kids-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px 12px; background: #fff8ec; border: 2px solid #ffe2b8; border-radius: 22px; text-align: center; }
.lesson-rich-content .kids-card img { width: 100%; max-width: 120px; aspect-ratio: 1; object-fit: contain; }
.lesson-rich-content .kids-card strong { font-size: 1.35rem; line-height: 1.2; color: var(--ink); }
.lesson-rich-content .kids-card small { color: var(--ink-soft); font-size: .95rem; line-height: 1.5; }
.lesson-rich-content .kids-num { position: absolute; top: 8px; left: 10px; width: 28px; height: 28px; border-radius: 50%; background: #ff9a1f; color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .9rem; }
.lesson-rich-content .kids-pattern { font-size: 1.5rem; text-align: center; background: #eef8ff; border-radius: 22px; padding: 18px; }
.lesson-rich-content .kids-chant p { font-size: 1.2rem; margin: 0 0 .6rem; }

/* 教材一覧：5段階レベル表示と試験ごとの小見出し */
.material-level { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; line-height: 1.3; }
/* レベルの色：やさしい（緑）→ むずかしい（赤）。--lv は塗り、--lv-ink は文字用の濃い色 */
.lv-1 { --lv: #3cba54; --lv-ink: #1f7a33; --lv-soft: #e3f5e6; }
.lv-2 { --lv: #9ac43a; --lv-ink: #5a7a12; --lv-soft: #eff6dc; }
.lv-3 { --lv: #f0b020; --lv-ink: #8a5a00; --lv-soft: #fdf2d6; }
.lv-4 { --lv: #f07a28; --lv-ink: #a8470a; --lv-soft: #fde6d6; }
.lv-5 { --lv: #e0344a; --lv-ink: #a81a2c; --lv-soft: #fbe1e4; }
.material-step { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
.material-step[class*="lv-"] { padding: 2px 8px 2px 6px; border-radius: 999px; background: var(--lv-soft); color: var(--lv-ink); }
.material-meter { display: inline-flex; gap: 2px; }
.material-meter i { width: 6px; height: 10px; border-radius: 1px; background: var(--line-strong); }
.material-step[class*="lv-"] .material-meter i { background: rgba(255, 255, 255, .9); }
.material-meter i.on, .material-step[class*="lv-"] .material-meter i.on { background: var(--lv, var(--ink)); }
.lv-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--lv); margin-right: 6px; vertical-align: 1px; }
.vocab-level.active .lv-dot { box-shadow: 0 0 0 2px #fff; }
.material-level-detail { color: var(--ink-soft); }
/* 幅のあるレベル（Lv.2〜4 など）：初級→中上級の色をつなぐ */
.material-step.lv-range { background: linear-gradient(90deg, #eff6dc, #fdf2d6 55%, #fde6d6); color: var(--ink); }
.level-tabs { margin: 1.4rem 0 0; }
.level-tabs-note { font-size: 13px; color: var(--ink-soft); margin: 0 0 8px; }
.level-tab-bar { display: none; gap: 8px; flex-wrap: wrap; margin: 0 0 1rem; }
.level-tabs.is-ready .level-tab-bar { display: flex; }
.level-tabs.is-ready .level-panel-title { display: none; }
.level-tab { flex: 1 1 0; min-width: 96px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; background: var(--paper, #fff); color: var(--ink); font-weight: 800; font-size: 15px; line-height: 1.2; cursor: pointer; transition: border-color .15s, background .15s; }
.level-tab .lv-dot { margin: 0 0 2px; }
.level-tab small { font-size: 11px; font-weight: 600; color: var(--ink-soft); }
.level-tab:hover { border-color: var(--lv); }
.level-tab.active { border-color: var(--lv); background: var(--lv-soft); color: var(--lv-ink); }
.level-tab.active small { color: var(--lv-ink); }
.level-tab:focus-visible { outline: 3px solid var(--lv); outline-offset: 2px; }
.lesson-rich-content .level-panel-title { color: var(--lv-ink); }
.manual-panel .level-tab { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.15); color: #fff; }
.manual-panel .level-tab small { color: rgba(255,255,255,.6); }
.manual-panel .level-tab.active { background: var(--lv-soft); color: var(--lv-ink); border-color: var(--lv); }
.manual-panel .level-tab.active small { color: var(--lv-ink); }
.manual-panel .level-tabs-note { color: rgba(255,255,255,.6); }
.material-group-title { font-size: 15px; font-weight: 700; margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.material-group-title .text-muted { font-weight: 400; font-size: 13px; margin-left: 4px; }

/* キッズ（小学生）：日本語の意味・会話・フォニックス・書く練習 */
.lesson-rich-content .kids-pattern small, .lesson-rich-content .kids-chant small { display: block; font-size: 1rem; color: var(--ink-soft); margin-top: 4px; }
.lesson-rich-content .kids-games .kids-card small { color: var(--ink-soft); font-size: .9rem; line-height: 1.6; }
.lesson-rich-content .kids-talk { display: flex; flex-direction: column; gap: 10px; margin: 1rem 0 1.5rem; }
.lesson-rich-content .kids-talk p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; padding: 12px 16px; border-radius: 18px; max-width: 85%; }
.lesson-rich-content .kids-talk-a { background: #eef8ff; align-self: flex-start; }
.lesson-rich-content .kids-talk-b { background: #fff3d6; align-self: flex-end; }
.lesson-rich-content .kids-talk-who { font-weight: 800; color: var(--ink-faint); }
.lesson-rich-content .kids-talk strong { font-size: 1.15rem; }
.lesson-rich-content .kids-talk small { width: 100%; color: var(--ink-soft); padding-left: 24px; }
.lesson-rich-content .kids-phonics { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; margin: 1rem 0 .25rem; }
.lesson-rich-content .kids-letter { font-size: 3rem; font-weight: 800; line-height: 1; color: #e8344e; }
.lesson-rich-content .kids-sound { font-size: 1.5rem; font-weight: 700; }
.lesson-rich-content .kids-sound-tip { color: var(--ink-soft); }
.lesson-rich-content .kids-write { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 1rem 0; }
.lesson-rich-content .kids-trace { margin: 0; padding: 0 8px; font-size: 2.6rem; line-height: 1.6; letter-spacing: .06em; color: transparent; -webkit-text-stroke: 1.5px #9aa6b8;
    background: repeating-linear-gradient(to bottom, transparent 0 calc(25% - 1px), #c9d3e0 calc(25% - 1px) 25%); background-size: 100% 100%; }
.lesson-rich-content .kids-frame { font-size: 1.4rem; font-weight: 700; padding: 14px 18px; border: 2px dashed #ffd28a; border-radius: 18px; background: #fffaf0; }
/* キッズ専科コース（フォニックス・英検・絵本・中学準備） */
.lesson-rich-content .kids-segments { display: flex; flex-wrap: nowrap; justify-content: center; gap: 3px; margin-top: 4px; max-width: 100%; }
.lesson-rich-content .kids-segments span { min-width: 20px; padding: 1px 3px; text-align: center; border-radius: 10px; background: #fff; border: 2px solid #ffd28a; font-size: 1rem; font-weight: 800; color: #e8344e; }
.lesson-rich-content .kids-passage { margin: 1rem 0 1.5rem; padding: 18px 22px; background: #fffdf6; border: 2px solid #f1e3c4; border-radius: 16px; font-size: 1.1rem; line-height: 1.7; }
.lesson-rich-content .kids-passage p { margin: 0 0 .4rem; }
.lesson-rich-content .kids-sight { display: flex; flex-wrap: wrap; gap: 10px; margin: 1rem 0 1.5rem; }
.lesson-rich-content .kids-sight span { padding: 8px 18px; border-radius: 14px; background: #eef8ff; border: 2px solid #b8dcff; font-size: 1.5rem; font-weight: 800; }
.lesson-rich-content .kids-read { margin: 1rem 0 1.5rem; padding-left: 1.6rem; display: grid; gap: 10px; }
.lesson-rich-content .kids-read li strong { font-size: 1.25rem; }
.lesson-rich-content .kids-read li small { display: block; color: var(--ink-soft); }
.lesson-rich-content .kids-story { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin: 1rem 0 1.5rem; }
.lesson-rich-content .kids-page { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 14px; background: #fffdf6; border: 2px solid #f1e3c4; border-radius: 22px; }
.lesson-rich-content .kids-page img { width: 100%; max-height: 150px; aspect-ratio: 1; object-fit: contain; }
.lesson-rich-content .kids-page p { margin: 0; }
.lesson-rich-content .kids-page strong { display: block; font-size: 1.2rem; line-height: 1.4; }
.lesson-rich-content .kids-page small { display: block; color: var(--ink-soft); margin-top: 4px; }
.lesson-rich-content .kids-test { margin: 0 0 1.2rem; padding: 14px 18px; border-radius: 18px; background: #f7f9fc; border: 1px solid var(--line, #e3e7ee); }
.lesson-rich-content .kids-test-q { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 8px; }
.lesson-rich-content .kids-test-q small { color: var(--ink-soft); }
.lesson-rich-content .kids-test-q strong { width: 100%; font-size: 1.2rem; }
.lesson-rich-content .kids-test-no { width: 28px; height: 28px; border-radius: 50%; background: #3a7bff; color: #fff; font-weight: 800; display: inline-grid; place-items: center; }
.lesson-rich-content .kids-choices { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; counter-reset: ch; }
.lesson-rich-content .kids-choices li { counter-increment: ch; font-size: 1.1rem; }
.lesson-rich-content .kids-choices li::before { content: "(" counter(ch) ") "; font-weight: 700; color: var(--ink-faint); }
.lesson-rich-content .kids-speaking { display: flex; gap: 18px; align-items: flex-start; padding: 16px; border: 2px solid #b8dcff; border-radius: 20px; background: #f4faff; margin: 1rem 0; }
.lesson-rich-content .kids-speaking img { width: 160px; flex: none; }
.lesson-rich-content .kids-speaking p { margin: 0 0 6px; font-size: 1.15rem; line-height: 1.6; }
.lesson-rich-content .kids-grammar { padding: 16px 20px; border-radius: 20px; background: #f4faff; border: 2px solid #b8dcff; margin: 1rem 0 1.5rem; }
.lesson-rich-content .kids-grammar-point { margin: 0 0 10px; font-size: 1.1rem; }
.lesson-rich-content .kids-grammar-table { width: 100%; border-collapse: collapse; }
.lesson-rich-content .kids-grammar-table td { padding: 8px 10px; border-top: 1px solid #d6e8fb; font-size: 1.1rem; }
.lesson-rich-content .kids-grammar-note { margin: 10px 0 0; color: var(--ink-soft); }
@media (max-width: 600px) { .lesson-rich-content .kids-speaking { flex-direction: column; } .lesson-rich-content .kids-speaking img { width: 120px; } }

/* キッズ：レッスンページに埋め込むスライド */
.kids-slides .ratio { border-radius: 20px; overflow: hidden; background: #0b0b0d; box-shadow: 0 10px 30px rgba(17, 17, 19, .12); }
.kids-slides iframe { border: 0; }
.kids-page-view summary { cursor: pointer; list-style: none; }
.kids-page-view summary::-webkit-details-marker { display: none; }
.kids-page-view summary::before { content: "\F285"; font-family: "bootstrap-icons"; margin-right: 8px; display: inline-block; transition: transform .2s; }
.kids-page-view[open] summary::before { transform: rotate(90deg); }

/* ブランドマーク（ピピの顔） */
.pipi-mark { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-mark:has(.pipi-mark) { background: #fff6c8 !important; padding: 2px; overflow: hidden; }
.gc-brand .pipi-mark { display: inline-block; width: 1.3em; height: 1.3em; vertical-align: -0.3em; margin-right: 2px; }
/* ピピトーク以外でロゴのないスクール：マークは出さず、スクール名の文字だけ */
.brand-mark:has(.brand-none) { display: none !important; }
/* スクール情報のロゴのプレビュー */
.school-logo-preview { width: 140px; height: 64px; flex: none; border: 1px dashed #d6d6dc; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #fafafb; overflow: hidden; }
.school-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* マスコット「ピピ」 */
.pipi { display: inline-flex; align-items: center; gap: 10px; }
.pipi img { flex: none; }
.pipi-bubble { position: relative; margin: 0; padding: 10px 14px; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 16px; font-weight: 700; font-size: .9rem; line-height: 1.5; }
.pipi-bubble::before { content: ""; position: absolute; left: -9px; top: 50%; margin-top: -7px; border: 7px solid transparent; border-right-color: var(--ink); border-left: 0; }
.pipi-dark .pipi-bubble { background: #fff6c8; border-color: #fff6c8; }
.pipi-dark .pipi-bubble::before { border-right-color: #fff6c8; }
/* 何もないときの表示は、アイコンの代わりに考えているピピ */
.empty-state > i:first-child { display: none; }
.empty-state::before { content: ""; display: block; width: 84px; height: 84px; margin: 0 auto 10px; background: url("/images/mascot/pipi-think.svg") center / contain no-repeat; }

/* ダッシュボードのピピ */
.hero-pipi { position: absolute; right: 22px; bottom: 16px; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 220px; pointer-events: none; }
.hero-pipi img { width: 120px; height: auto; }
.hero-pipi .pipi-bubble { background: #fff6c8; border-color: #fff6c8; font-size: .82rem; }
.hero-pipi .pipi-bubble::before { left: auto; right: 34px; top: auto; bottom: -9px; margin: 0; border: 7px solid transparent; border-top-color: #fff6c8; border-bottom: 0; }
@media (max-width: 1399px) { .hero-pipi { max-width: 180px; } .hero-pipi img { width: 96px; } }

.result-pipi { width: 104px; height: auto; }
@media (max-width: 575px) { .result-pipi { width: 72px; } }
@media (min-width: 768px) { .hero-panel:has(.hero-pipi) > div:not(.hero-pipi) { padding-right: 210px; } }
@media (min-width: 768px) and (max-width: 1399px) { .hero-panel:has(.hero-pipi) > div:not(.hero-pipi) { padding-right: 170px; } }

/* キッズ教材のテスト：問題の絵と、大きめの選択肢 */
.quiz-image { display: block; width: 150px; height: 150px; object-fit: contain; background: #fff8ec; border: 2px solid #ffe2b8; border-radius: 22px; padding: 12px; margin-bottom: 1rem; }
.quiz-kids .quiz-choice span { font-size: 1.15rem; font-weight: 700; }
.quiz-kids .quiz-no { background: #ff9a1f; color: #fff; }
.unit-test-stars { display: inline-flex; gap: .25rem; font-size: 2.2rem; line-height: 1; }
.unit-test-stars .bi-star { color: rgba(255,255,255,.35); }
.unit-test-stars .bi-star-fill { color: #ffc21f; }
.unit-test-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-top: .75rem; padding: .85rem 1rem; border-radius: 14px; background: #fff8ec; border: 1px solid #ffe2b8; }

/* 空き枠カレンダー（フィリピン時間・クリック／ドラッグで開閉） */
.av-note { background: #eef6ff; border: 1px solid #cfe3ff; border-radius: 10px; padding: .6rem .85rem; font-size: .875rem; }
.av-bulk summary { cursor: pointer; list-style: none; }
.av-bulk summary::-webkit-details-marker { display: none; }
.av-bulk summary::after { content: "\25BE"; float: right; color: #888; }
.av-bulk[open] summary::after { content: "\25B4"; }
.av-scroll { max-height: 72vh; overflow: auto; border-radius: inherit; }
.av-grid { width: 100%; min-width: 1100px; table-layout: fixed; border-collapse: separate; border-spacing: 2px; user-select: none; touch-action: none; font-size: .75rem; }
.av-grid th { font-weight: 600; text-align: center; color: var(--ink, #111); white-space: nowrap; }
.av-grid th span { display: block; font-weight: 400; color: #999; font-size: .68rem; }
.av-grid thead th { padding: .3rem .1rem; position: sticky; top: 0; z-index: 2; background: #fff; }
.av-grid .av-time { position: sticky; left: 0; z-index: 1; background: #fff; }
.av-grid .av-time-head { left: 0; z-index: 3 !important; }
.av-grid .av-time-head { width: 78px; font-size: .7rem; }
.av-grid .av-day, .av-grid .av-time { cursor: pointer; border-radius: 6px; }
.av-grid .av-day:hover, .av-grid .av-time:hover { background: #f1f1f4; }
.av-grid .av-day.is-today { color: var(--bs-primary); }
.av-grid .av-time { padding: 0 .3rem; line-height: 1.05; }
.av-grid .av-time span { display: inline; margin-left: 3px; font-size: .62rem; }
.av-cell { height: 20px; border-radius: 4px; background: #f0f0f3; cursor: pointer; transition: background .08s; }
.av-cell:hover { outline: 2px solid rgba(0,0,0,.18); }
.av-cell.av-open { background: #22c55e; }
.av-cell.av-booked { background: var(--bs-primary, #4f46e5); cursor: not-allowed; }
.av-cell.av-past { background: #f8f8fa; cursor: default; }
.av-cell.av-past.av-was-open { background: #c7eed4; }
.av-cell.av-past:hover, .av-cell.av-booked:hover { outline: none; }
.av-cell.av-painting { outline: 2px solid #111; }
.av-legend { display: inline-block; width: 14px; height: 12px; border-radius: 3px; background: #f0f0f3; vertical-align: -1px; margin-right: 3px; }
.av-legend.av-open { background: #22c55e; }
.av-legend.av-booked { background: var(--bs-primary, #4f46e5); }
.av-status { font-weight: 600; }
/* 2週目の始まり（8日目）に区切り線 */
.av-grid tr > :nth-child(9) { box-shadow: inset 3px 0 0 #fff, inset 4px 0 0 #c9c9d2; }

/* 講師の呼び出し（今すぐレッスン・Zoom 切り替え） */
.call-ring { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 32px; color: #fff; background: #ef4444; animation: callPulse 1.2s ease-in-out infinite; }
@keyframes callPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); transform: rotate(-8deg); } 50% { box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); transform: rotate(8deg); } }
