/* ============================================================
   lexion — 静かな言語書斎
   世界観: 知的で静か、余白がある、押しつけない
   背景:   温度のあるアイボリー
   文字:   濃い墨色
   アクセント: 深緑 / 鈍い金
   ============================================================ */

/* ── カラートークン ──────────────────────────────────── */
/*
   デザインリファレンス:
   - モバイル: 白背景、深緑丸ボタン、植物イラスト
   - デスクトップ: チャコールサイドバー、暖かいオフホワイト本体、
                   セージグリーン（くすんだオリーブ）アクセント、星アイコン栞
*/
:root {
    /* ── app-wide変数を直接上書き ── */
    --app-base:           #EDE8E0;   /* 参考画像: 温かいベージュ */
    --app-surface:        #F7F4EF;   /* カード面 */
    --app-section:        #E5DFD5;   /* セクション区切り */
    --app-text:           #1C1B18;
    --app-muted:          #79756F;
    --app-primary:        #4B5C3B;   /* セージグリーン */
    --app-sub-accent:     #896D2C;   /* 鈍い金 */
    --app-border:         #D5CFC5;
    --app-radius-card:    12px;
    --app-radius-control: 8px;

    /* 基盤 — 参考画像の暖かいベージュ */
    --lx-ivory:       #EDE8E0;
    --lx-surface:     #F7F4EF;
    --lx-surface-alt: #E5DFD5;

    /* テキスト — 墨色 */
    --lx-ink:         #1C1B18;
    --lx-ink-mid:     #38352F;
    --lx-muted:       #79756F;
    --lx-faint:       #AEA99F;

    /* アクセント — セージグリーン（参考画像のオリーブ） */
    --lx-green:       #4B5C3B;
    --lx-green-mid:   #3C4A2E;
    --lx-green-soft:  #E8EDE0;
    --lx-green-btn:   #3C4A2E;   /* 濃いアクションボタン */

    /* 鈍い金 — 栞・星 */
    --lx-gold:        #896D2C;
    --lx-gold-soft:   #F2E8CC;

    /* サイドバー — 参考画像の濃いチャコール */
    --lx-sidebar-bg:     #252420;
    --lx-sidebar-fg:     #C5C0B6;
    --lx-sidebar-active: #EDEBE4;
    --lx-sidebar-hover:  #333129;

    /* ボーダー */
    --lx-line:        #D5CFC5;
    --lx-line-soft:   #E8E3DA;

    /* ステータス — 参考画像の3段階 */
    --lx-status-unsorted-bg:   #EEEBE4;   /* 未整理 — グレーベージュ */
    --lx-status-unsorted-fg:   #79756F;
    --lx-status-reread-bg:     #F5E8C8;   /* 再読待ち — アンバー */
    --lx-status-reread-fg:     #8B6020;
    --lx-status-settled-bg:    #DDE8D5;   /* 定着 — セージグリーン */
    --lx-status-settled-fg:    #3C5A2C;

    /* 旧変数（後方互換） */
    --lx-settled:     #4B5C3B;
    --lx-unsorted:    #AEA99F;
    --lx-reread:      #896D2C;

    /* シャドウ */
    --lx-shadow-xs:   0 1px 3px rgba(30, 29, 27, 0.04);
    --lx-shadow-sm:   0 2px 8px rgba(30, 29, 27, 0.06);
    --lx-shadow-md:   0 6px 20px rgba(30, 29, 27, 0.08);

    /* ラジウス */
    --lx-radius-sm:   6px;
    --lx-radius-md:   10px;
    --lx-radius-lg:   14px;

    /* タイポグラフィ */
    --lx-font:        "Georgia", "Hiragino Mincho ProN", "Yu Mincho", serif;
    --lx-font-ui:     "Inter", "Noto Sans JP", "Segoe UI", sans-serif;
    --lx-line-height: 1.75;
}

/* ── ベース — app.css / site.css のすべてのbody backgroundを上書き ── */
body,
html body,
body.lx-world {
    background: #EDE8E0 !important;
    background-color: #EDE8E0 !important;
    color: #1C1B18 !important;
}

main,
.page,
.content,
.container,
.container-fluid {
    background: #EDE8E0 !important;
}

body.lx-world {
    font-family: var(--lx-font-ui);
    line-height: var(--lx-line-height);

    /* app-wide CSS var オーバーライド */
    --app-base:        var(--lx-ivory);
    --app-surface:     var(--lx-surface);
    --app-section:     var(--lx-surface-alt);
    --app-text:        var(--lx-ink);
    --app-muted:       var(--lx-muted);
    --app-primary:     var(--lx-green);
    --app-sub-accent:  var(--lx-gold);
    --app-border:      var(--lx-line);
    --app-radius-card: var(--lx-radius-lg);
    --app-radius-control: var(--lx-radius-md);
}

/* ── 見出し ─────────────────────────────────────────── */
body.lx-world h1,
body.lx-world h2,
body.lx-world h3,
body.lx-world h4,
body.lx-world h5 {
    font-family: var(--lx-font);
    color: var(--lx-ink) !important;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ── カード — 紙片のような薄い境界線 ────────────────── */
body.lx-world .card {
    background: var(--lx-surface) !important;
    border: 1px solid var(--lx-line-soft) !important;
    border-radius: var(--lx-radius-lg) !important;
    box-shadow: var(--lx-shadow-sm) !important;
    backdrop-filter: none !important;
    transition: box-shadow 0.2s ease !important;
}

body.lx-world .card:hover {
    box-shadow: var(--lx-shadow-md) !important;
    transform: none !important;
}

/* ── プライマリボタン — 深緑 ─────────────────────────── */
body.lx-world .btn-primary {
    background: var(--lx-green) !important;
    border-color: var(--lx-green) !important;
    color: #FDFCF8 !important;
    border-radius: var(--lx-radius-md) !important;
    box-shadow: 0 2px 8px rgba(45, 80, 22, 0.20) !important;
    font-weight: 500;
    letter-spacing: 0.01em;
}

body.lx-world .btn-primary:hover {
    background: var(--lx-green-mid) !important;
    border-color: var(--lx-green-mid) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.25) !important;
}

/* ── アウトラインボタン ───────────────────────────────── */
body.lx-world .btn-outline-primary {
    color: var(--lx-green) !important;
    border-color: var(--lx-green) !important;
}

body.lx-world .btn-outline-primary:hover,
body.lx-world .btn-outline-primary:focus {
    background: var(--lx-green-soft) !important;
    color: var(--lx-green) !important;
}

body.lx-world .btn-outline-secondary {
    color: var(--lx-muted) !important;
    border-color: var(--lx-line) !important;
    background: transparent !important;
}

body.lx-world .btn-outline-secondary:hover {
    background: var(--lx-surface-alt) !important;
    color: var(--lx-ink-mid) !important;
}

/* ── フォームコントロール ─────────────────────────────── */
body.lx-world .form-control,
body.lx-world .form-select,
body.lx-world textarea.form-control {
    background: var(--lx-surface) !important;
    border-color: var(--lx-line) !important;
    color: var(--lx-ink) !important;
    border-radius: var(--lx-radius-md) !important;
    box-shadow: none !important;
}

body.lx-world .form-control:focus,
body.lx-world textarea.form-control:focus {
    border-color: var(--lx-green) !important;
    box-shadow: 0 0 0 0.15rem rgba(45, 80, 22, 0.15) !important;
}

/* ── テキストカラー ───────────────────────────────────── */
body.lx-world p,
body.lx-world li,
body.lx-world label,
body.lx-world .form-label {
    color: var(--lx-ink) !important;
}

body.lx-world .text-muted,
body.lx-world .form-text {
    color: var(--lx-muted) !important;
}

/* ── リンク ──────────────────────────────────────────── */
body.lx-world a,
body.lx-world .btn-link {
    color: var(--lx-green);
}

body.lx-world a:hover {
    color: var(--lx-green-mid);
}

/* ── バッジ・タグ ─────────────────────────────────────── */
body.lx-world .badge.bg-success,
body.lx-world .btn-success {
    background: var(--lx-green) !important;
    border-color: var(--lx-green) !important;
}

/* ── スクロールバー ───────────────────────────────────── */
body.lx-world ::-webkit-scrollbar-thumb {
    background: var(--lx-line);
    border-radius: 999px;
}

/* ── セクション区切り ─────────────────────────────────── */
body.lx-world .section-soft {
    background: var(--lx-surface-alt) !important;
    border-radius: var(--lx-radius-md) !important;
}

/* ── ステータスバッジ — 参考画像の3段階 ─────────────── */
.lx-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* 未整理 — グレーベージュ */
.lx-badge--unsorted,
body.lx-world .badge-unsorted {
    background: var(--lx-status-unsorted-bg);
    color:      var(--lx-status-unsorted-fg);
}

/* 再読待ち — アンバー */
.lx-badge--reread,
body.lx-world .badge-reread {
    background: var(--lx-status-reread-bg);
    color:      var(--lx-status-reread-fg);
}

/* 定着 — セージグリーン */
.lx-badge--settled,
body.lx-world .badge-settled {
    background: var(--lx-status-settled-bg);
    color:      var(--lx-status-settled-fg);
}

/* ── 語彙ページ固有 ───────────────────────────────────── */

/* 語彙棚ヘッダー */
body.lx-world .vocab-kicker {
    color: var(--lx-green) !important;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* フラッシュカード */
body.lx-world .flashcard {
    background: var(--lx-surface) !important;
    border: 1px solid var(--lx-line) !important;
    box-shadow: var(--lx-shadow-sm) !important;
}

/* 語彙行 */
body.lx-world .border-bottom {
    border-color: var(--lx-line-soft) !important;
}

/* ── NavMenu — チャコールサイドバー ─────────────────── */
body.lx-world .navbar,
body.lx-world .top-row {
    background: var(--lx-sidebar-bg) !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

body.lx-world .nav-scrollable {
    background: var(--lx-sidebar-bg) !important;
    border-right: none !important;
}

body.lx-world .brand-wordmark {
    color: var(--lx-sidebar-active) !important;
    font-family: var(--lx-font);
    font-weight: 400;
    letter-spacing: 0.04em;
}

body.lx-world .nav-link {
    color: var(--lx-sidebar-fg) !important;
    border-radius: var(--lx-radius-sm);
    transition: background 0.15s ease, color 0.15s ease;
}

body.lx-world .nav-link:hover {
    color: var(--lx-sidebar-active) !important;
    background: var(--lx-sidebar-hover) !important;
}

body.lx-world .nav-link.active {
    color: var(--lx-sidebar-active) !important;
    background: rgba(255,255,255,0.08) !important;
}

body.lx-world .nav-group-label {
    color: rgba(200, 196, 188, 0.45) !important;
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ヘッダーアイコン（チャコール背景上） */
body.lx-world .header-icon svg {
    stroke: var(--lx-sidebar-fg);
}

body.lx-world .header-icon:hover svg {
    stroke: var(--lx-sidebar-active);
}

/* ── BottomNav ───────────────────────────────────────── */
body.lx-world .bottom-nav {
    background: var(--lx-surface) !important;
    border-top: 1px solid var(--lx-line-soft) !important;
    box-shadow: 0 -1px 8px rgba(30, 29, 27, 0.05) !important;
}

body.lx-world .bottom-nav-icon-shell {
    color: var(--lx-faint) !important;
}

body.lx-world .bottom-nav-item.active .bottom-nav-icon-shell,
body.lx-world .bottom-nav-hit:hover .bottom-nav-icon-shell {
    color: var(--lx-green) !important;
}

body.lx-world .bottom-nav-label {
    color: var(--lx-faint) !important;
    font-size: 0.65rem;
    letter-spacing: 0.01em;
}

body.lx-world .bottom-nav-item.active .bottom-nav-label {
    color: var(--lx-green) !important;
}

/* Final palette guard: this intentionally stays last. */
body.lx-world {
    accent-color: var(--lx-green);
    scrollbar-color: var(--lx-green) var(--lx-surface-alt);
}

body.lx-world ::-webkit-scrollbar-track {
    background: var(--lx-surface-alt) !important;
}

body.lx-world ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #7A8B6B, var(--lx-green)) !important;
    border: 2px solid var(--lx-surface-alt) !important;
}

body.lx-world input[type="checkbox"],
body.lx-world input[type="radio"],
body.lx-world input[type="range"] {
    accent-color: var(--lx-green) !important;
}

body.lx-world .form-check-input:checked,
body.lx-world .bg-primary,
body.lx-world .progress-bar {
    background-color: var(--lx-green) !important;
    border-color: var(--lx-green) !important;
}

body.lx-world .today-mission-progress {
    color: var(--lx-green-mid) !important;
    background: var(--lx-green-soft) !important;
    border-color: rgba(75, 92, 59, 0.24) !important;
}

body.lx-world .today-mission-item.is-done {
    background: linear-gradient(100deg, var(--lx-green-soft), rgba(247, 244, 239, 0.86)) !important;
    border-color: rgba(75, 92, 59, 0.32) !important;
}

body.lx-world .today-mission-state,
body.lx-world .today-mission-item.is-done .today-mission-state {
    color: var(--lx-green-mid) !important;
}

body.lx-world .today-mission-icon img,
body.lx-world .today-mission-item.is-done .today-mission-icon img,
body.lx-world .today-mission-state img {
    filter: invert(34%) sepia(16%) saturate(1083%) hue-rotate(43deg) brightness(91%) contrast(88%) !important;
}

body.lx-world .discovery-page .candidate-card.selected,
body.lx-world .diary-page .vocab-card.selected {
    border-color: rgba(75, 92, 59, 0.52) !important;
    box-shadow: 0 0 0 2px rgba(75, 92, 59, 0.14), 0 12px 28px rgba(56, 53, 47, 0.10) !important;
}

body.lx-world .diary-page .selection-badge,
body.lx-world .diary-page .card-chip,
body.lx-world .result-heading-primary {
    color: var(--lx-green-mid) !important;
    background: var(--lx-green-soft) !important;
}

/* Keep every native and Bootstrap state inside the Lexion paper-and-sage palette. */
body.lx-world {
    --bs-primary: var(--lx-green);
    --bs-primary-rgb: 75, 92, 59;
    --bs-link-color: var(--lx-green);
    --bs-link-hover-color: var(--lx-green-mid);
    accent-color: var(--lx-green);
    scrollbar-color: var(--lx-green) var(--lx-surface-alt);
    scrollbar-width: thin;
}

body.lx-world ::selection {
    background: var(--lx-green-soft);
    color: var(--lx-ink);
}

body.lx-world ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

body.lx-world ::-webkit-scrollbar-track {
    background: var(--lx-surface-alt);
}

body.lx-world ::-webkit-scrollbar-thumb {
    min-height: 42px;
    background: linear-gradient(180deg, #7A8B6B, var(--lx-green)) !important;
    border: 2px solid var(--lx-surface-alt);
    border-radius: 999px;
}

body.lx-world ::-webkit-scrollbar-thumb:hover {
    background: var(--lx-green-mid) !important;
}

body.lx-world input[type="checkbox"],
body.lx-world input[type="radio"],
body.lx-world input[type="range"] {
    accent-color: var(--lx-green) !important;
}

body.lx-world .form-check-input:checked {
    background-color: var(--lx-green) !important;
    border-color: var(--lx-green) !important;
}

body.lx-world .form-check-input:focus,
body.lx-world .form-control:focus,
body.lx-world .form-select:focus,
body.lx-world .btn:focus-visible,
body.lx-world a:focus-visible {
    border-color: var(--lx-green) !important;
    outline-color: var(--lx-green) !important;
    box-shadow: 0 0 0 0.2rem rgba(75, 92, 59, 0.18) !important;
}

body.lx-world .spinner-border,
body.lx-world .spinner-grow,
body.lx-world .text-primary,
body.lx-world .link-primary {
    color: var(--lx-green) !important;
}

body.lx-world .bg-primary {
    background-color: var(--lx-green) !important;
}

body.lx-world .border-primary {
    border-color: var(--lx-green) !important;
}

body.lx-world .alert-primary,
body.lx-world .alert-success {
    color: var(--lx-green-mid) !important;
    background: var(--lx-green-soft) !important;
    border-color: rgba(75, 92, 59, 0.24) !important;
}

/* Today's ritual: completed work should feel settled, never electric purple. */
body.lx-world .today-mission-kicker {
    color: var(--lx-gold) !important;
}

body.lx-world .today-mission-progress {
    color: var(--lx-green-mid) !important;
    background: var(--lx-green-soft) !important;
    border: 1px solid rgba(75, 92, 59, 0.24) !important;
}

body.lx-world .today-mission-item:hover,
body.lx-world .today-mission-item:focus-visible {
    background: rgba(247, 244, 239, 0.92) !important;
    border-color: rgba(137, 109, 44, 0.42) !important;
    box-shadow: 0 6px 18px rgba(56, 53, 47, 0.08) !important;
}

body.lx-world .today-mission-item.is-done {
    background: linear-gradient(100deg, var(--lx-green-soft), rgba(247, 244, 239, 0.86)) !important;
    border-color: rgba(75, 92, 59, 0.32) !important;
}

body.lx-world .today-mission-icon,
body.lx-world .today-mission-item.is-done .today-mission-icon {
    color: var(--lx-green) !important;
    background: rgba(247, 244, 239, 0.92) !important;
    border-color: rgba(75, 92, 59, 0.22) !important;
}

body.lx-world .today-mission-icon img,
body.lx-world .today-mission-item.is-done .today-mission-icon img,
body.lx-world .today-mission-state img {
    filter: invert(34%) sepia(16%) saturate(1083%) hue-rotate(43deg) brightness(91%) contrast(88%) !important;
}

body.lx-world .today-mission-state,
body.lx-world .today-mission-item.is-done .today-mission-state {
    color: var(--lx-green-mid) !important;
}

body.lx-world .btn:active:not(:disabled) {
    box-shadow: 0 2px 8px rgba(75, 92, 59, 0.16) !important;
}

body.lx-world .discovery-page .discovery-hero {
    background:
        radial-gradient(circle at 94% 8%, rgba(137, 109, 44, 0.18) 0, transparent 28%),
        linear-gradient(135deg, #252420 0%, #30372f 54%, #4B5C3B 100%) !important;
}

body.lx-world .discovery-page .discovery-search-btn {
    background: linear-gradient(135deg, var(--lx-green-mid), var(--lx-green)) !important;
    border-color: var(--lx-green-mid) !important;
    box-shadow: 0 14px 28px rgba(75, 92, 59, 0.24) !important;
}

body.lx-world .discovery-page .candidate-card.selected,
body.lx-world .diary-page .vocab-card.selected {
    border-color: rgba(75, 92, 59, 0.52) !important;
    box-shadow: 0 0 0 2px rgba(75, 92, 59, 0.14), 0 12px 28px rgba(56, 53, 47, 0.10) !important;
}

body.lx-world .discovery-page .saved-badge,
body.lx-world .discovery-page .candidate-meta span,
body.lx-world .diary-page .vocab-card .selection-badge,
body.lx-world .diary-page .vocab-card .card-chip,
body.lx-world .swipe-card .card-chip,
body.lx-world .result-heading-primary {
    color: var(--lx-green-mid) !important;
    background: var(--lx-green-soft) !important;
    border-color: rgba(75, 92, 59, 0.24) !important;
}

body.lx-world.dark-mode,
body.dark-mode.lx-world {
    scrollbar-color: #7A8B6B #252420;
}

body.dark-mode.lx-world ::-webkit-scrollbar-track {
    background: #252420;
}

body.dark-mode.lx-world ::-webkit-scrollbar-thumb {
    border-color: #252420;
}

body.dark-mode.lx-world .today-mission-progress,
body.dark-mode.lx-world .today-mission-icon,
body.dark-mode.lx-world .today-mission-item.is-done {
    color: #DDE8D5 !important;
    background: rgba(75, 92, 59, 0.34) !important;
    border-color: rgba(122, 139, 107, 0.46) !important;
}

/* 中央プラスボタン — 画像のダークグリーン丸ボタン */
body.lx-world .bottom-nav-icon-shell--primary {
    background: var(--lx-green-btn) !important;
    box-shadow: 0 4px 16px rgba(63, 81, 50, 0.30) !important;
}

body.lx-world .bottom-nav-icon-svg--plus {
    stroke: #F5F3EE !important;
}

/* ── アップグレードバナー ─────────────────────────────── */
body.lx-world .nav-upgrade-cta {
    margin-top: 1.15rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(246, 241, 232, 0.1);
}

body.lx-world .nav-upgrade-btn {
    gap: 0.7rem;
    padding: 0.78rem 0.82rem;
    background: rgba(246, 241, 232, 0.045);
    border: 1px solid rgba(183, 178, 167, 0.22);
    border-radius: var(--lx-radius-md);
    color: var(--lx-sidebar-fg);
}

body.lx-world .nav-upgrade-btn:hover {
    background: rgba(246, 241, 232, 0.085);
    border-color: rgba(183, 178, 167, 0.42);
}

body.lx-world .nav-upgrade-icon {
    width: 1.25rem;
    color: #AAB99A;
    font-size: 1rem;
    text-align: center;
}

body.lx-world .nav-upgrade-title {
    color: var(--lx-sidebar-active);
    font-family: var(--lx-font);
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

body.lx-world .nav-upgrade-sub {
    margin-top: 0.22rem;
    color: rgba(200, 196, 188, 0.58);
    font-size: 0.62rem;
}

body.lx-world .nav-upgrade-arrow {
    color: rgba(200, 196, 188, 0.42);
}

/* ── AlertとBadge ────────────────────────────────────── */
body.lx-world .alert-success {
    background: var(--lx-green-soft) !important;
    border-color: rgba(45, 80, 22, 0.2) !important;
    color: var(--lx-settled) !important;
}

body.lx-world .text-success {
    color: var(--lx-settled) !important;
}

/* ── チェックボックス ─────────────────────────────────── */
body.lx-world input[type="checkbox"] {
    accent-color: var(--lx-green);
}

/* ── ProgressBar ─────────────────────────────────────── */
body.lx-world .progress-bar {
    background: var(--lx-green) !important;
}

/* ── ランキングページ調整 ─────────────────────────────── */
body.lx-world .score-row__fill {
    background: linear-gradient(90deg, var(--lx-green), var(--lx-green-mid)) !important;
}

/* ── フォーカスリング ─────────────────────────────────── */
body.lx-world .btn:focus,
body.lx-world .form-control:focus,
body.lx-world .form-select:focus {
    box-shadow: 0 0 0 0.18rem rgba(45, 80, 22, 0.18) !important;
}

/* ── セクションヘッダー余白 ─────────────────────────────── */
body.lx-world .container,
body.lx-world .container-fluid {
    max-width: 960px;
}

body.lx-world .dashboard-shell {
    max-width: 1044px;
}

/* ── 読解の記録 / クイズ結果 ──────────────────────────── */
body.lx-world .quiz-result-remembered {
    border-color: rgba(45, 80, 22, 0.25) !important;
    color: var(--lx-settled) !important;
}

body.lx-world .quiz-result-forgot {
    border-color: rgba(146, 112, 15, 0.25) !important;
    color: var(--lx-gold) !important;
}

/* ── 栞（お気に入り）星アイコン ──────────────────────── */
body.lx-world .lx-bookmark-star,
body.lx-world [aria-label="栞"],
body.lx-world .bi-star-fill {
    color: var(--lx-gold) !important;
}

body.lx-world .bi-star {
    color: var(--lx-faint) !important;
}

/* ── ステータスドット（画像のカラードット） ──────────── */
body.lx-world .lx-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

body.lx-world .lx-dot--settled  { background: var(--lx-settled); }
body.lx-world .lx-dot--reread   { background: var(--lx-reread); }
body.lx-world .lx-dot--unsorted { background: var(--lx-unsorted); }

/* ── 語彙行 — 画像のリスト表示 ─────────────────────── */
body.lx-world .vocab-item {
    border-bottom: 1px solid var(--lx-line-soft) !important;
    padding: 0.65rem 0;
    transition: background 0.1s ease;
}

body.lx-world .vocab-item:hover {
    background: rgba(74, 92, 58, 0.04);
}

/* ── 語彙ページヘッダー ───────────────────────────────── */
body.lx-world .vocab-hero {
    border-bottom: 1px solid var(--lx-line-soft);
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
}

body.lx-world .vocab-hero h2 {
    font-family: var(--lx-font);
    font-weight: 400;
    color: var(--lx-ink) !important;
    font-size: 1.4rem;
}

/* ── 検索インプット ───────────────────────────────────── */
body.lx-world .vocab-search-input,
body.lx-world input.form-control[placeholder*="検索"],
body.lx-world input.form-control[placeholder*="search"] {
    background: var(--lx-surface) !important;
    border: 1px solid var(--lx-line) !important;
    border-radius: 999px !important;
    padding-left: 1.1rem;
}

/* ── フラッシュカード（単語詳細） ────────────────────── */
body.lx-world .flashcard {
    background: var(--lx-surface) !important;
    border: 1px solid var(--lx-line-soft) !important;
    border-radius: var(--lx-radius-lg) !important;
    box-shadow: var(--lx-shadow-sm) !important;
}

body.lx-world .flashcard-word {
    font-family: var(--lx-font);
    font-weight: 400;
    color: var(--lx-ink) !important;
}

/* ── 単語詳細パネル（右サイドパネル） ──────────────── */
body.lx-world .vocab-detail-panel,
body.lx-world .word-detail {
    background: var(--lx-surface) !important;
    border-left: 1px solid var(--lx-line-soft) !important;
}

/* ── プログレスドット（画像の「●●●○○」スタイル） ── */
body.lx-world .lx-progress-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

body.lx-world .lx-progress-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--lx-line);
}

body.lx-world .lx-progress-dot.filled {
    background: var(--lx-green);
}

/* ── 引用ブロック（翻訳者の机っぽい） ────────────────── */
body.lx-world blockquote,
body.lx-world .lx-quote {
    border-left: 2px solid var(--lx-green-soft);
    border-left-color: var(--lx-green) !important;
    background: var(--lx-surface-alt);
    padding: 0.75rem 1rem;
    border-radius: 0 var(--lx-radius-sm) var(--lx-radius-sm) 0;
    color: var(--lx-ink-mid);
    font-style: italic;
}

/* ── ページ全体のグラデーション除去 ─────────────────── */
body.lx-world main {
    background: var(--lx-ivory) !important;
}

body.lx-world body {
    background: var(--lx-ivory) !important;
}

/* ── ダークモード非活性化 (lx-worldはライトのみ) ─────── */
/* ダークモードは後で拡張する */
/* App-wide Lexion unification */
body.lx-world {
    background:
        radial-gradient(circle at 18% 0%, rgba(181, 166, 139, 0.16), transparent 30%),
        linear-gradient(180deg, #f7f4ed 0%, #f1eee5 100%) !important;
    color: var(--lx-ink);
}

body.lx-world .page,
body.lx-world .content,
body.lx-world .main-content,
body.lx-world .app-main,
body.lx-world main {
    background: transparent !important;
}

body.lx-world h1,
body.lx-world h2,
body.lx-world h3,
body.lx-world h4,
body.lx-world h5,
body.lx-world h6 {
    color: var(--lx-ink);
    letter-spacing: 0;
}

body.lx-world .card,
body.lx-world .panel,
body.lx-world .surface,
body.lx-world .dashboard-card,
body.lx-world .dashboard-hero,
body.lx-world .today-mission-panel,
body.lx-world .metric-card,
body.lx-world .chart-card,
body.lx-world .coach-card,
body.lx-world .latest-card,
body.lx-world .invite-card,
body.lx-world .diary-writing-card,
body.lx-world .diary-correction-card,
body.lx-world .diary-next-action-panel,
body.lx-world .diary-auto-vocab-card,
body.lx-world .catalog-sidebar,
body.lx-world .catalog-list,
body.lx-world .catalog-detail,
body.lx-world .vocab-detail-panel,
body.lx-world .flashcard,
body.lx-world .billing-card,
body.lx-world .pricing-card,
body.lx-world .profile-card,
body.lx-world .settings-card,
body.lx-world .login-card,
body.lx-world .register-card,
body.lx-world .home-empty-card,
body.lx-world .home-latest-card {
    background: rgba(255, 252, 246, 0.92) !important;
    border: 1px solid rgba(122, 113, 96, 0.20) !important;
    border-radius: 8px !important;
    box-shadow: 0 18px 44px rgba(38, 47, 43, 0.08) !important;
}

body.lx-world .dashboard-hero,
body.lx-world .today-mission-panel,
body.lx-world .home-mobile-focus {
    background:
        linear-gradient(135deg, rgba(255, 252, 246, 0.96), rgba(237, 231, 216, 0.82)),
        linear-gradient(90deg, rgba(35, 49, 54, 0.04), rgba(76, 96, 64, 0.07)) !important;
    border: 1px solid rgba(122, 113, 96, 0.22) !important;
    border-radius: 8px !important;
    box-shadow: 0 20px 54px rgba(38, 47, 43, 0.10) !important;
}

body.lx-world .btn-primary,
body.lx-world .btn-success,
body.lx-world button.btn-primary,
body.lx-world a.btn-primary {
    background: #31483b !important;
    border-color: #31483b !important;
    color: #fffaf0 !important;
    box-shadow: 0 10px 24px rgba(49, 72, 59, 0.18) !important;
}

body.lx-world .btn-primary:hover,
body.lx-world .btn-success:hover,
body.lx-world button.btn-primary:hover,
body.lx-world a.btn-primary:hover {
    background: #25372f !important;
    border-color: #25372f !important;
}

body.lx-world .btn-outline-primary,
body.lx-world a.btn-outline-primary,
body.lx-world button.btn-outline-primary {
    border-color: rgba(49, 72, 59, 0.42) !important;
    color: #31483b !important;
    background: rgba(255, 252, 246, 0.62) !important;
}

body.lx-world .btn-outline-primary:hover,
body.lx-world a.btn-outline-primary:hover,
body.lx-world button.btn-outline-primary:hover {
    background: rgba(49, 72, 59, 0.10) !important;
    color: #25372f !important;
}

body.lx-world .btn-outline-secondary,
body.lx-world .btn-light,
body.lx-world .btn-secondary {
    border-color: rgba(122, 113, 96, 0.28) !important;
    background: rgba(255, 252, 246, 0.70) !important;
    color: var(--lx-ink-mid) !important;
}

body.lx-world .badge,
body.lx-world .pill,
body.lx-world .tag,
body.lx-world .status-badge,
body.lx-world .home-latest-badge {
    border-radius: 999px !important;
    background: rgba(49, 72, 59, 0.10) !important;
    color: #31483b !important;
    border: 1px solid rgba(49, 72, 59, 0.18) !important;
}

body.lx-world .text-muted,
body.lx-world .small,
body.lx-world small {
    color: rgba(44, 54, 50, 0.66) !important;
}

body.lx-world .form-control,
body.lx-world .form-select,
body.lx-world textarea,
body.lx-world input,
body.lx-world select {
    background-color: rgba(255, 252, 246, 0.94) !important;
    border: 1px solid rgba(122, 113, 96, 0.28) !important;
    color: var(--lx-ink) !important;
    border-radius: 8px !important;
}

body.lx-world .form-control::placeholder,
body.lx-world textarea::placeholder,
body.lx-world input::placeholder {
    color: rgba(44, 54, 50, 0.42) !important;
}

body.lx-world .table,
body.lx-world table {
    color: var(--lx-ink) !important;
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(49, 72, 59, 0.035);
    --bs-table-hover-bg: rgba(49, 72, 59, 0.06);
}

body.lx-world hr,
body.lx-world .divider,
body.lx-world .border-top,
body.lx-world .border-bottom {
    border-color: rgba(122, 113, 96, 0.22) !important;
}

body.lx-world .sidebar,
body.lx-world .left-nav,
body.lx-world .nav-column,
body.lx-world .nav-panel {
    background: linear-gradient(180deg, #223036, #182327) !important;
    color: #f8f3e8 !important;
    border-color: rgba(255, 252, 246, 0.10) !important;
}

body.lx-world .nav-link,
body.lx-world .menu-link {
    color: inherit;
}

body.lx-world .nav-link.active,
body.lx-world .menu-link.active,
body.lx-world .active > .nav-link {
    background: rgba(201, 190, 163, 0.18) !important;
    color: #fffaf0 !important;
}

body.lx-world .progress {
    background: rgba(122, 113, 96, 0.16) !important;
    border-radius: 999px;
}

body.lx-world .progress-bar {
    background: linear-gradient(90deg, #31483b, #8a8f62) !important;
}

body.lx-world .home-mobile-focus {
    padding: clamp(1.25rem, 3vw, 2rem);
    display: grid;
    gap: 1rem;
}

body.lx-world .home-mobile-kicker {
    color: #6d724d;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

body.lx-world .home-mobile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

body.lx-world .home-latest-preview {
    color: var(--lx-ink-mid);
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    body.lx-world .home-mobile-actions .btn {
        width: 100%;
    }

    body.lx-world .card,
    body.lx-world .panel,
    body.lx-world .dashboard-hero,
    body.lx-world .today-mission-panel {
        box-shadow: 0 12px 30px rgba(38, 47, 43, 0.08) !important;
    }
}

/* Lexion world tokens - quiet study, stationery, and personal lexicon. */
:root {
    --color-bg: #F4EFE6;
    --color-surface: #FFF9EF;
    --color-surface-muted: #F8F1E7;
    --color-text: #2E2923;
    --color-text-muted: #746A5E;
    --color-accent: #1F3A4A;
    --color-accent-dark: #172D3A;
    --color-brass: #7A5A3A;
    --color-border: #D8CDBD;
    --color-sidebar: #263942;
    --color-paper: #FFF9EF;
    --color-book-green: #556B69;
    --color-book-beige: #CDBB9F;
    --color-book-gray: #9E978D;
    --radius-card: 14px;
    --radius-large: 20px;
    --shadow-soft: 0 16px 36px rgba(46, 41, 35, 0.07);
    --shadow-card: 0 8px 20px rgba(46, 41, 35, 0.07);

    --app-base: var(--color-bg);
    --app-surface: var(--color-surface);
    --app-section: var(--color-surface-muted);
    --app-text: var(--color-text);
    --app-muted: var(--color-text-muted);
    --app-primary: var(--color-accent);
    --app-sub-accent: var(--color-brass);
    --app-border: var(--color-border);
    --app-radius-card: var(--radius-card);

    --lx-ivory: var(--color-bg);
    --lx-surface: var(--color-surface);
    --lx-surface-alt: var(--color-surface-muted);
    --lx-ink: var(--color-text);
    --lx-ink-mid: #4D463E;
    --lx-muted: var(--color-text-muted);
    --lx-green: var(--color-accent);
    --lx-green-mid: var(--color-accent-dark);
    --lx-green-soft: #E4EAEB;
    --lx-green-btn: var(--color-accent);
    --lx-gold: var(--color-brass);
    --lx-gold-soft: #EFE3D3;
    --lx-sidebar-bg: var(--color-sidebar);
    --lx-sidebar-fg: #D8D1C5;
    --lx-sidebar-active: #FFF9EF;
    --lx-sidebar-hover: #344B56;
    --lx-line: var(--color-border);
    --lx-line-soft: #E6DCCE;
    --lx-shadow-md: var(--shadow-soft);
    --lx-radius-lg: var(--radius-card);
}

body.lx-world {
    background: var(--color-bg);
    color: var(--color-text);
}

body.lx-world .btn-primary {
    background: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 10px 24px rgba(122, 139, 107, 0.18);
}

body.lx-world .btn-primary:hover,
body.lx-world .btn-primary:focus-visible {
    background: #68785D;
    border-color: #68785D;
}

body.lx-world .btn-outline-primary {
    color: var(--color-accent);
    border-color: rgba(122, 139, 107, 0.45);
}

body.lx-world .btn-outline-primary:hover,
body.lx-world .btn-outline-primary:focus-visible {
    background: #E8EDE0;
    border-color: var(--color-accent);
    color: var(--color-text);
}

body.lx-world .card {
    background: var(--color-surface);
    border-color: var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
}

/* Reference-aligned application shell */
body.lx-world {
    background: var(--color-bg) !important;
}

body.lx-world .page:not(.page--landing),
body.lx-world .page:not(.page--landing) main,
body.lx-world .page:not(.page--landing) .content {
    background: var(--color-bg) !important;
}

body.lx-world .page:not(.page--landing) main {
    min-width: 0;
}

body.lx-world .page:not(.page--landing) .content {
    width: 100%;
    max-width: 1320px !important;
    margin: 0 auto !important;
    padding: 1.5rem 2rem 3rem !important;
}

body.lx-world .sidebar {
    width: 68px !important;
    background: var(--color-sidebar) !important;
}

body.lx-world .lex-rail {
    width: 68px !important;
    background: var(--lx-sidebar-bg) !important;
}

body.lx-world .lex-rail-logo {
    font-family: Georgia, "Yu Mincho", serif !important;
    font-size: 0.92rem !important;
    letter-spacing: 0.02em !important;
    color: #F6F1E8 !important;
}

body.lx-world .lex-rail-link {
    width: 44px !important;
    height: 44px !important;
    border-radius: 12px !important;
    color: #D8D2C5 !important;
}

body.lx-world .lex-rail-link:hover,
body.lx-world .lex-rail-link:focus-visible {
    color: var(--lx-sidebar-active) !important;
    background: rgba(246, 241, 232, 0.10) !important;
}

body.lx-world .lex-rail-link.active,
body.lx-world .lex-rail-link.is-active {
    background: rgba(246, 241, 232, 0.13) !important;
    color: var(--lx-sidebar-active) !important;
    box-shadow: none !important;
}

body.lx-world .card,
body.lx-world .panel {
    border-radius: 10px !important;
    box-shadow: 0 12px 28px rgba(31, 36, 34, 0.07) !important;
}

/* Dictionary / Lexicon Search */
body.lx-world .discovery-page {
    max-width: 1180px !important;
}

body.lx-world .discovery-page .discovery-hero {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    min-height: auto !important;
    margin-bottom: 1rem !important;
    padding: 1.6rem 1.75rem !important;
    color: #2B2B2B !important;
    background: #FFFDF8 !important;
    border: 1px solid #E5DED2 !important;
    border-radius: 10px !important;
    box-shadow: 0 12px 28px rgba(31, 36, 34, 0.07) !important;
}

body.lx-world .discovery-page .discovery-hero::after {
    display: none !important;
}

body.lx-world .discovery-page .discovery-hero h2 {
    max-width: 17em !important;
    margin: 0.55rem 0 !important;
    color: #2B2B2B !important;
    font-family: Georgia, "Yu Mincho", serif !important;
    font-size: clamp(2rem, 5vw, 3.25rem) !important;
    font-weight: 400 !important;
    line-height: 1.15 !important;
}

body.lx-world .discovery-page .discovery-hero p:not(.discovery-kicker) {
    color: #77736A !important;
}

body.lx-world .discovery-page .discovery-kicker {
    color: #68785D !important;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
}

body.lx-world .discovery-page .discovery-hero-points span {
    color: #555148 !important;
    background: #EEE8DE !important;
    border: 1px solid #E5DED2 !important;
    border-radius: 7px !important;
}

body.lx-world .discovery-page .discovery-vocab-link {
    color: #2B2B2B !important;
    background: #FFFDF8 !important;
    border: 1px solid #CFC7B9 !important;
    border-radius: 7px !important;
    box-shadow: none !important;
}

body.lx-world .discovery-page .discovery-search {
    margin: 0 0 1rem !important;
    padding: 0.85rem !important;
    background: #FFFDF8 !important;
    border: 1px solid #E5DED2 !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 24px rgba(31, 36, 34, 0.06) !important;
}

body.lx-world .discovery-page .discovery-search .form-control {
    color: #2B2B2B !important;
    background: #FFFDF8 !important;
    border-color: #E5DED2 !important;
}

body.lx-world .discovery-page .discovery-search-btn {
    color: #FFFDF8 !important;
    background: #7A8B6B !important;
    border-color: #7A8B6B !important;
    border-radius: 7px !important;
    box-shadow: none !important;
}

body.lx-world .discovery-page .starter-panel,
body.lx-world .discovery-page .saved-groups,
body.lx-world .discovery-page .discovery-result {
    background: #FFFDF8 !important;
    border: 1px solid #E5DED2 !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 24px rgba(31, 36, 34, 0.06) !important;
}

body.lx-world .discovery-page .sample-chip {
    color: #555148 !important;
    background: #F8F6F2 !important;
    border-color: #E5DED2 !important;
    box-shadow: none !important;
}

@media (max-width: 767.98px) {
    /* スマホでは2カラムのヒーローを1カラムに畳む(見出しが極端に折り返すのを防ぐ)。
       上の !important 指定が .razor.css のメディアクエリより優先されるため、ここでも上書きする。 */
    body.lx-world .discovery-page .discovery-hero {
        grid-template-columns: 1fr !important;
        padding: 1.25rem 1.15rem !important;
    }

    body.lx-world .discovery-page .discovery-hero h2 {
        max-width: none !important;
    }

    body.lx-world .discovery-page .discovery-vocab-link {
        width: 100% !important;
    }
}

/* Study Room */
body.lx-world .settings-page {
    max-width: 1120px !important;
}

body.lx-world .settings-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.65fr);
    align-items: center;
    min-height: 180px;
    overflow: hidden;
    background: #FFFDF8;
    border: 1px solid #E5DED2;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(31, 36, 34, 0.07);
}

body.lx-world .settings-hero > div {
    padding: 1.5rem 1.75rem;
}

body.lx-world .settings-hero img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-left: 1px solid #E5DED2;
}

body.lx-world .settings-kicker {
    color: #7A8B6B;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

body.lx-world .settings-hero h2,
body.lx-world .settings-page h5 {
    color: #2B2B2B !important;
    font-family: Georgia, "Yu Mincho", serif;
    font-weight: 400 !important;
}

body.lx-world .settings-hero p,
body.lx-world .settings-page .text-muted,
body.lx-world .settings-page .form-text {
    color: #77736A !important;
}

body.lx-world .settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

body.lx-world .settings-grid .card {
    margin: 0 !important;
    background: #FFFDF8 !important;
    border: 1px solid #E5DED2 !important;
    box-shadow: 0 10px 24px rgba(31, 36, 34, 0.06) !important;
}

body.lx-world .settings-grid .card-body {
    padding: 1.2rem !important;
}

body.lx-world .settings-grid .form-control,
body.lx-world .settings-grid .form-select {
    background: #FFFDF8 !important;
    border-color: #E5DED2 !important;
}

/* Membership */
body.lx-world .billing-page {
    max-width: 1180px !important;
}

body.lx-world .billing-page > h3 {
    font-family: Georgia, "Yu Mincho", serif;
    font-weight: 400;
}

body.lx-world .billing-page > .alert-secondary {
    background: #FFFDF8 !important;
}

body.lx-world .membership-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

body.lx-world .membership-card {
    display: flex;
    flex-direction: column;
    min-height: 500px;
    padding: 1.35rem;
    text-align: center;
    background: #FFFDF8;
    border: 1px solid #E5DED2;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(31, 36, 34, 0.07);
}

body.lx-world .membership-card.is-current {
    border-color: #7A8B6B;
}

body.lx-world .membership-tier {
    margin: 0;
    color: #77736A;
    font-family: Georgia, serif;
}

body.lx-world .membership-card h4,
body.lx-world .membership-card .price-tag {
    color: #2B2B2B !important;
    font-family: Georgia, "Yu Mincho", serif;
    font-weight: 400;
}

body.lx-world .membership-card > img {
    width: auto;
    height: 130px;
    margin: 1rem auto;
    opacity: 0.86;
}

body.lx-world .membership-card--pro > img {
    height: 155px;
}

body.lx-world .membership-card--premium > img {
    height: 180px;
}

body.lx-world .membership-card .feature-list {
    margin: 0 0 1rem;
    padding-left: 1.1rem;
    text-align: left;
}

body.lx-world .membership-card .feature-list li {
    color: #555148 !important;
    font-size: 0.88rem;
}

body.lx-world .membership-action {
    width: 100%;
    min-height: 42px;
    margin-top: auto;
    color: #FFFDF8;
    background: #7A8B6B;
    border: 1px solid #7A8B6B;
    border-radius: 7px;
    font-weight: 700;
}

body.lx-world .membership-action--premium {
    background: #B08B4D;
    border-color: #B08B4D;
}

body.lx-world .membership-action.is-disabled,
body.lx-world .membership-action:disabled {
    color: #77736A;
    background: #EEE8DE;
    border-color: #E5DED2;
}

/* Community Shelf */
body.lx-world .ranking-page {
    max-width: 1040px !important;
}

body.lx-world .ranking-heading h2 {
    margin: 0;
    color: #2B2B2B;
    font-family: Georgia, "Yu Mincho", serif;
    font-weight: 400;
}

body.lx-world .ranking-kicker {
    color: #7A8B6B;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

body.lx-world .ranking-table-card,
body.lx-world .ranking-my-row-card,
body.lx-world .ranking-share-card,
body.lx-world .ranking-page .card {
    background: #FFFDF8 !important;
    border: 1px solid #E5DED2 !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 24px rgba(31, 36, 34, 0.06) !important;
}

body.lx-world .ranking-table thead th {
    color: #77736A !important;
    background: #F8F6F2 !important;
    border-color: #E5DED2 !important;
}

body.lx-world .ranking-table td {
    border-color: #E5DED2 !important;
}

body.lx-world .ranking-medal {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    color: #5F584C;
    background: #EEE8DE;
    border: 1px solid #D7CBB8;
    border-radius: 50%;
    font-family: Georgia, serif;
}

/* Today's Practice */
body.lx-world .ic-root {
    max-width: 760px !important;
    margin: 0 auto !important;
    color: #2B2B2B !important;
}

body.lx-world .ic-list-view {
    padding: 1.25rem !important;
}

body.lx-world .ic-list-title {
    display: grid !important;
    gap: 0.15rem;
    color: #2B2B2B !important;
    font-family: Georgia, "Yu Mincho", serif;
}

body.lx-world .ic-list-title strong {
    font-size: 1.7rem;
    font-weight: 400;
}

body.lx-world .ic-list-kicker {
    color: #7A8B6B;
    font-family: Inter, "Noto Sans JP", sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

body.lx-world .ic-tab-bar {
    border-color: #E5DED2 !important;
}

body.lx-world .ic-tab.active {
    color: #2B2B2B !important;
    border-color: #7A8B6B !important;
}

body.lx-world .ic-session-card {
    min-height: 210px !important;
    padding: 1.5rem !important;
    color: #2B2B2B !important;
    background: #FFFDF8 !important;
    border: 1px solid #E5DED2 !important;
    border-radius: 10px !important;
    box-shadow: 0 12px 28px rgba(31, 36, 34, 0.07) !important;
}

body.lx-world .ic-session-mark {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    color: #FFFDF8;
    background: #7A8B6B;
    border-radius: 50%;
    font-family: Georgia, serif;
}

body.lx-world .ic-session-title,
body.lx-world .ic-session-count,
body.lx-world .ic-session-progress-label,
body.lx-world .ic-chevron {
    color: #2B2B2B !important;
}

body.lx-world .ic-progress-bar-sm {
    background: #EEE8DE !important;
}

body.lx-world .ic-progress-fill-sm {
    background: #7A8B6B !important;
}

@media (max-width: 900px) {
    body.lx-world .page:not(.page--landing) .content {
        padding: 1rem 1rem 6rem !important;
    }

    /* 日記は没入感のある「暗い部屋」。スマホ／タブレットでは、丸角や余白から
       周囲のベージュ背景がのぞいて白っぽく見えてしまうため、外枠も暗色にして
       ワークスペースと一体化させる。 */
    body.lx-world .page:not(.page--landing) .content.content--diary {
        background: #21170f !important;
    }

    body.lx-world .settings-grid,
    body.lx-world .membership-grid {
        grid-template-columns: 1fr;
    }

    body.lx-world .settings-hero {
        grid-template-columns: 1fr;
    }

    body.lx-world .settings-hero img {
        height: 140px;
        border-top: 1px solid #E5DED2;
        border-left: 0;
    }
}

/* ============================================================
   Lexion Rituals — 静かな蒐集の所作（トースト / 栞 / 標本カード）
   ============================================================ */
.lexion-ritual-layer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 1.5rem;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.lexion-toast {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    max-width: min(88vw, 26rem);
    padding: 0.7rem 1.15rem;
    border-radius: 999px;
    background: var(--color-sidebar, #1F2422);
    color: #F6F1E8;
    border: 1px solid rgba(246, 241, 232, 0.10);
    box-shadow: 0 16px 38px rgba(31, 36, 34, 0.26);
    font-family: Georgia, "Yu Mincho", "Hiragino Mincho ProN", serif;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.lexion-toast.is-in {
    opacity: 1;
    transform: translateY(0);
}

.lexion-toast.is-out {
    opacity: 0;
    transform: translateY(-6px);
}

.lexion-toast__bookmark {
    display: inline-flex;
    width: 0.85rem;
    height: 0.85rem;
    flex: 0 0 auto;
}

.lexion-toast__bookmark svg {
    width: 100%;
    height: 100%;
    fill: var(--color-brass, #B8A27A);
}

.lexion-toast__text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 栞がスッと現れ、上へ吸い込まれるように溶ける */
.lexion-bookmark-fly {
    position: fixed;
    right: clamp(1.5rem, 6vw, 4rem);
    bottom: clamp(4.5rem, 16vh, 8rem);
    z-index: 11050;
    width: 2.1rem;
    height: 3rem;
    pointer-events: none;
    opacity: 0;
    transform: translateY(28px) rotate(-6deg) scale(0.92);
    transition: opacity 1.4s ease, transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.lexion-bookmark-fly svg {
    width: 100%;
    height: 100%;
    fill: var(--color-brass, #B8A27A);
    filter: drop-shadow(0 8px 16px rgba(31, 36, 34, 0.22));
}

.lexion-bookmark-fly.is-active {
    opacity: 1;
    transform: translateY(-46px) rotate(0deg) scale(1);
    animation: lexion-bookmark-settle 1.4s ease forwards;
}

@keyframes lexion-bookmark-settle {
    0%   { opacity: 0; transform: translateY(28px) rotate(-6deg) scale(0.92); }
    35%  { opacity: 1; transform: translateY(-46px) rotate(0deg) scale(1); }
    70%  { opacity: 1; transform: translateY(-52px) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: translateY(-92px) rotate(2deg) scale(0.96); }
}

/* 標本カードが机に置かれ、棚へ収まる */
.lexion-card-fly {
    position: fixed;
    right: clamp(1.5rem, 7vw, 5rem);
    bottom: clamp(5rem, 18vh, 9rem);
    z-index: 11050;
    width: 3.2rem;
    height: 2.1rem;
    border-radius: 6px;
    background: linear-gradient(160deg, #FFFDF8, #EEE8DE);
    border: 1px solid var(--color-border, #E5DED2);
    box-shadow: 0 10px 22px rgba(31, 36, 34, 0.18);
    pointer-events: none;
    opacity: 0;
    transform: translateY(18px) rotate(-3deg) scale(0.9);
}

.lexion-card-fly::before {
    content: "";
    position: absolute;
    left: 0.45rem;
    top: 0.5rem;
    width: 1.4rem;
    height: 2px;
    background: var(--color-brass, #B8A27A);
    opacity: 0.6;
}

.lexion-card-fly.is-active {
    animation: lexion-card-settle 1.3s ease forwards;
}

@keyframes lexion-card-settle {
    0%   { opacity: 0; transform: translateY(18px) rotate(-3deg) scale(0.9); }
    30%  { opacity: 1; transform: translateY(-10px) rotate(0deg) scale(1); }
    65%  { opacity: 1; transform: translateY(-14px) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: translateY(-40px) rotate(2deg) scale(0.84); }
}

/* 案5 本棚収蔵 — 一冊の本が持ち上がり、棚へ吸い込まれる */
.lexion-book-fly {
    position: fixed;
    left: 50%;
    bottom: clamp(5rem, 20vh, 10rem);
    z-index: 11050;
    width: 2.6rem;
    height: 3.6rem;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 20px) rotate(-4deg) scale(0.9);
}

.lexion-book-fly__spine {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 3px 5px 5px 3px;
    background: linear-gradient(105deg, #4B5C3B 0%, #3C4A2E 100%);
    border: 1px solid rgba(184, 162, 122, 0.5);
    box-shadow: inset 4px 0 rgba(255, 255, 255, 0.06), inset -3px 0 rgba(0, 0, 0, 0.25), 0 10px 22px rgba(31, 36, 34, 0.28);
}

.lexion-book-fly__spine::after {
    content: "";
    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    top: 0.55rem;
    height: 1px;
    background: var(--color-brass, #B8A27A);
    opacity: 0.7;
}

.lexion-book-fly.is-active {
    animation: lexion-book-shelve 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes lexion-book-shelve {
    0%   { opacity: 0; transform: translate(-50%, 22px) rotate(-4deg) scale(0.9); }
    25%  { opacity: 1; transform: translate(-50%, -16px) rotate(0deg) scale(1); }
    55%  { opacity: 1; transform: translate(-50%, -22px) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -120px) rotate(3deg) scale(0.6); }
}

@media (prefers-reduced-motion: reduce) {
    .lexion-toast {
        transition: opacity 0.3s ease;
        transform: none;
    }
    .lexion-toast.is-in { transform: none; }
}

/* ============================================================
   NavMenu — モバイルのチャコールバー上で見える明色アイコン
   （ハンバーガー・通知・ヘッダーアイコンを世界観に合わせる）
   ============================================================ */
body.lx-world .top-row {
    background: var(--lx-sidebar-bg) !important;
    border-bottom: 1px solid rgba(246, 241, 232, 0.08) !important;
    box-shadow: 0 8px 22px rgba(31, 36, 34, 0.18) !important;
}

body.lx-world .brand-wordmark {
    font-family: var(--lx-font);
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--lx-sidebar-active) !important;
}

/* ハンバーガーアイコン — 明色ストロークでチャコール上でも視認できる */
body.lx-world .navbar-toggler {
    color: var(--lx-sidebar-active);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: transparent
        url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28246, 241, 232, 0.92%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")
        no-repeat center/1.45rem !important;
}

body.lx-world .navbar-toggler:hover {
    background-color: rgba(246, 241, 232, 0.08) !important;
}

body.lx-world .navbar-toggler[aria-expanded="true"] {
    background-color: rgba(246, 241, 232, 0.13) !important;
}

/* ヘッダーアイコン（設定・通知・プロフィール） */
body.lx-world .header-icon,
body.lx-world .notification-button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: var(--lx-sidebar-fg) !important;
}

body.lx-world .header-icon:hover,
body.lx-world .notification-button:hover {
    background: rgba(246, 241, 232, 0.08) !important;
    color: var(--lx-sidebar-active) !important;
}

body.lx-world .header-icon svg,
body.lx-world .notification-button svg {
    stroke: currentColor;
}

/* スライドアウトメニュー — 世界観のチャコール、サージュ系アクティブ */
body.lx-world .nav-scrollable {
    background: var(--lx-sidebar-bg) !important;
    border-top: 1px solid rgba(246, 241, 232, 0.08) !important;
}

body.lx-world .nav-item ::deep .nav-link {
    color: var(--lx-sidebar-fg);
    border-radius: var(--lx-radius-md);
}

body.lx-world .nav-item ::deep .nav-link i {
    color: var(--lx-sidebar-fg);
}

body.lx-world .nav-item ::deep .nav-link:hover {
    background: var(--lx-sidebar-hover) !important;
    border-color: transparent !important;
    color: var(--lx-sidebar-active) !important;
}

body.lx-world .nav-item ::deep a.active {
    background: rgba(122, 139, 107, 0.28) !important;
    border-color: transparent !important;
    color: var(--lx-sidebar-active) !important;
}

body.lx-world .nav-item ::deep a.active i {
    color: var(--lx-sidebar-active) !important;
}

/* 通知パネル — アイボリー面に合わせる */
body.lx-world .notification-action {
    background: var(--lx-green) !important;
    color: #FBFAF5 !important;
}

body.lx-world .notification-action:hover {
    background: var(--lx-green-mid) !important;
}

/* 下部ナビ アクティブ色を紫からサージュへ */
body.lx-world .bottom-nav-item.active .bottom-nav-icon-shell,
body.lx-world .bottom-nav-hit:hover .bottom-nav-icon-shell,
body.lx-world .bottom-nav-hit.active .bottom-nav-icon-shell {
    background: rgba(122, 139, 107, 0.16) !important;
    color: var(--lx-green) !important;
}

body.lx-world .bottom-nav-item.active .bottom-nav-label {
    color: var(--lx-green) !important;
}

/* ============================================================
   ナビゲーション中の多重押下を防ぐ
   ページ読み込み中（isNavigating=true で .is-disabled が付く間）は
   ナビ要素のクリックを完全に無効化し、競合する2回目の遷移を防ぐ。
   （NavLink が描画する <a> にもクラスは伝わるためグローバルで指定）
   ============================================================ */
.lex-rail-logo.is-disabled,
.lex-rail-link.is-disabled,
.nav-link.is-disabled,
.bottom-nav-hit.is-disabled,
.navbar-brand.is-disabled,
.header-icon.is-disabled,
.nav-upgrade-btn.is-disabled,
.notification-action.is-disabled {
    pointer-events: none !important;
    opacity: 0.55;
    cursor: default;
}

/* ============================================================
   ページ見出し — 全画面共通の統一タイトル
   小さな金色キッカー + セリフ大見出し + 落ち着いた副題
   （Collection Room のタイトル様式を全画面の標準に）
   ============================================================ */
body.lx-world .lx-page-header {
    max-width: 1200px;
    margin: 0 auto 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

body.lx-world .lx-page-kicker {
    margin: 0 0 .35rem;
    color: var(--lx-gold) !important;
    font-family: var(--lx-font-ui);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
}

body.lx-world .lx-page-header h1,
body.lx-world .lx-page-title {
    margin: 0;
    font-family: var(--lx-font);
    font-weight: 400;
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    line-height: 1.12;
    letter-spacing: .03em;
    color: var(--lx-ink) !important;
}

body.lx-world .lx-page-sub {
    margin: .55rem 0 0;
    color: var(--lx-muted) !important;
    font-family: var(--lx-font-ui);
    font-size: .9rem;
    line-height: 1.6;
}

@media (max-width: 640px) {
    body.lx-world .lx-page-header { margin-bottom: 1.25rem; }
    body.lx-world .lx-page-header h1,
    body.lx-world .lx-page-title { font-size: 1.55rem; }
}

/* ============================================================
   Collection Room 様式のヘッダー帯 — ダッシュボード/英語日記/語彙棚など
   ダークな書斎パネルに金キッカー＋セリフ見出し（lx-page-* を流用）
   ============================================================ */
body.lx-world .lx-room-header {
    max-width: 1280px;
    margin: 0 auto 1.75rem;
    padding: clamp(1.3rem, 3vw, 2.1rem) clamp(1.2rem, 3vw, 2.3rem);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    border: 1px solid rgba(120, 84, 46, .35);
    border-radius: 18px;
    color: #f0e4cd;
    /* Collection Room の木目・書斎のブラウン基調（黒にしない） */
    background:
        radial-gradient(circle at 50% -25%, rgba(201, 168, 95, .22), transparent 55%),
        linear-gradient(120deg, #3c2817, #2c1c10 58%, #221610);
    box-shadow: inset 0 0 70px rgba(0, 0, 0, .38), 0 18px 50px rgba(35, 26, 16, .2);
}

body.lx-world .lx-room-header > div { min-width: 0; }

/* キッカー・見出し・サブの色味も Collection Room ヘッダーの実値に合わせる */
body.lx-world .lx-room-header .lx-page-kicker {
    color: #d6b66f !important;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .55);
}

body.lx-world .lx-room-header h1,
body.lx-world .lx-room-header .lx-page-title {
    color: #f6ecd6 !important;
    font-family: Georgia, "Yu Mincho", "Hiragino Mincho ProN", serif;
    letter-spacing: .03em;
}

body.lx-world .lx-room-header .lx-page-sub {
    color: rgba(246, 236, 214, .78) !important;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .58);
}

@media (max-width: 640px) {
    body.lx-world .lx-room-header {
        margin-bottom: 1.25rem;
        padding: 1.2rem 1.15rem;
        border-radius: 14px;
    }
}

/* ============================================================
   Journal Entry（/diary）を Collection Room 様式に統一
   - 内側 .container は palette-guard が ivory 背景を !important で塗るため、
     ここで打ち消して書斎ブラウン(.diary-workspace)を透かす。
   - ヘッダーは「箱パネル」をやめ、Collection Room と同じ素の左寄せ見出しにする。
   グローバル指定にすることで palette-guard を確実に上書きし、scoped CSS の
   グループセレクタ無効化リスクを避ける。
   ============================================================ */
/* .diary-workspace-main は <main> 要素なので palette-guard の
   `body.lx-world .page:not(.page--landing) main { ivory !important }`(詳細度
   0,3,2)にも該当する。打ち消し側も同等以上の詳細度が必要なため、祖先に .page を
   足して 0,4,1 まで上げ、確実に上書きする。.container/.diary-page も同様に揃える。
   これを怠ると ivory な <main> がカードの角丸から透けて見える（角に白いはみ出し）。 */
body.lx-world .page .diary-workspace .diary-workspace-main,
body.lx-world .page .diary-workspace main,
body.lx-world .page .diary-workspace .container,
body.lx-world .page .diary-workspace .diary-page {
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

body.lx-world .diary-workspace .lx-room-header {
    max-width: 1100px;
    margin: 0 auto 1.25rem;
    padding: clamp(0.5rem, 2vw, 1rem) clamp(0.5rem, 2vw, 1rem) clamp(0.75rem, 2vw, 1rem);
    /* ミニマル：箱をやめ、アイボリー地に素の左寄せ見出し。下に細い罫線だけ。 */
    border: 0;
    border-bottom: 1px solid var(--qt-line, #E0D8CC);
    border-radius: 0;
    background: none;
    box-shadow: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    text-align: left;
}

/* 見出しはアイボリー地に乗る落ち着いたチャコール／タンに。 */
body.lx-world .diary-workspace .lx-page-kicker {
    color: var(--qt-brown, #8B7040) !important;
    background: none !important;
    padding: 0 !important;
    text-shadow: none;
}

body.lx-world .diary-workspace .lx-page-title {
    color: var(--qt-charcoal, #2C2418) !important;
    font-family: Georgia, "Yu Mincho", "Hiragino Mincho ProN", serif !important;
    font-weight: 400 !important;
    letter-spacing: .01em;
    text-shadow: none;
}

body.lx-world .diary-workspace .lx-page-sub {
    color: var(--qt-gray, #6A5F52) !important;
    text-shadow: none;
}

@media (max-width: 640px) {
    body.lx-world .diary-workspace .lx-room-header {
        margin-bottom: 1rem;
        padding: .25rem .25rem .75rem;
        border-radius: 0;
        gap: .5rem;
    }
}
