/* main.css — 自動生成: 複数CSSファイルを統合してリクエスト数を削減 (mobile LCP対策) */

/* ===== nav.css ===== */
/* =============================
   City Data JP ヘッダーナビ
   ============================= */

/* ナビ全体ラッパー */
.cdj-nav {
    background-color: #1a3a5c;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.cdj-nav > div {
    display: flex;
    align-items: stretch;
    max-width: 1200px;
    margin: 0 auto;
}

/* サイトブランド（ロゴ） */
.cdj-nav-brand a {
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    padding: 10px 16px;
    font-weight: bold;
    font-size: 15px;
    white-space: nowrap;
}

/* トップレベルメニューリスト */
.cdj-nav ul.menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
}

/* トップレベルメニュー項目 */
.cdj-nav ul.menu > li {
    position: relative;
}

.cdj-nav ul.menu > li > a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 14px 12px;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: border-color 0.2s;
    white-space: nowrap;
}

.cdj-nav ul.menu > li > a:hover,
.cdj-nav ul.menu > li.current-menu-item > a,
.cdj-nav ul.menu > li.current-menu-ancestor > a {
    border-bottom-color: #f0a500;
}

/* ▾ 矢印（子メニューあり） */
.cdj-nav ul.menu > li.menu-item-has-children > a::after {
    content: ' ▾';
    font-size: 11px;
    opacity: 0.8;
}

/* =============================
   メガメニュー（ドロップダウン）
   ============================= */

.cdj-mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border-top: 3px solid #f0a500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 480px;
    padding: 20px 24px;
}

/* ホバーで表示（各 ul がグリッドセルに流れる） */
.cdj-nav ul.menu > li:hover > .cdj-mega-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 32px;
    align-items: start;
}

/* 列数が多いメニュー用（3列） */
.cdj-nav ul.menu > li:hover > .cdj-mega-menu--wide {
    grid-template-columns: 1fr 1fr 1fr;
    min-width: 680px;
}

/* カラム見出し */
li.cdj-mega-menu-heading {
    font-size: 11px;
    font-weight: 700;
    color: #1a3a5c;
    letter-spacing: 0.05em;
    padding: 0 0 8px 0;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 8px;
    pointer-events: none;
    list-style: none;
}

li.cdj-mega-menu-heading span {
    display: block;
}

/* メガメニュー内リンク */
.cdj-mega-menu > ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cdj-mega-menu > ul > li {
    margin-bottom: 4px;
}

.cdj-mega-menu > ul > li > a {
    display: block;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    padding: 5px 6px 5px 12px;
    border-left: 3px solid #f0a500;
    transition: color 0.2s, background-color 0.2s;
    border-radius: 0 4px 4px 0;
}

.cdj-mega-menu > ul > li > a:hover {
    color: #1a3a5c;
    background-color: #f9f5ec;
}

/* =============================
   準備中アイテム
   ============================= */

.menu-item-coming-soon > a {
    color: #aaa !important;
    border-left-color: #ddd !important;
    pointer-events: none;
    cursor: default;
}

.menu-item-coming-soon > a:hover {
    color: #aaa !important;
    background-color: transparent !important;
}

.menu-item-coming-soon > a::after {
    content: '準備中';
    font-size: 10px;
    background: #e8e8e8;
    color: #999;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
}

/* =============================
   都道府県メガメニュー
   ============================= */

.cdj-pref-menu {
    min-width: 680px;
    padding: 20px 24px;
}

.cdj-nav ul.menu > li:hover > .cdj-pref-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
}

.cdj-pref-region {
    min-width: 72px;
}

.cdj-pref-region-name {
    font-size: 10px;
    font-weight: 700;
    color: #1a3a5c;
    letter-spacing: 0.05em;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid #e8e8e8;
    white-space: nowrap;
}

.cdj-pref-region ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cdj-pref-region ul li {
    margin-bottom: 2px;
}

.cdj-pref-region ul li a {
    display: block;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    padding: 3px 4px;
    border-radius: 3px;
    white-space: nowrap;
    transition: color 0.15s, background-color 0.15s;
}

.cdj-pref-region ul li a:hover {
    color: #1a3a5c;
    background-color: #f0f4f8;
}

/* =============================
   ハンバーガーボタン（モバイル）
   ============================= */
.cdj-nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 14px 18px;
    cursor: pointer;
    margin-left: auto;
    background: none;
    border: none;
}
.cdj-nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.2s;
}
.cdj-nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cdj-nav-hamburger.is-open span:nth-child(2) { opacity: 0; }
.cdj-nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =============================
   レスポンシブ（768px 以下）
   ============================= */

@media (max-width: 768px) {
    .cdj-nav-hamburger { display: flex; }

    .cdj-nav ul.menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1a3a5c;
        z-index: 999;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        max-height: 80vh;
        overflow-y: auto;
    }
    .cdj-nav ul.menu.is-open { display: flex; }

    .cdj-nav ul.menu > li > a {
        padding: 13px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        font-size: 15px;
    }

    /* ホバー起動は無効にする */
    .cdj-nav ul.menu > li:hover > .cdj-mega-menu {
        display: none;
    }

    /* サブメニューは JS が .submenu-open を付けたときだけ表示 */
    .cdj-nav ul.menu > li > .cdj-mega-menu {
        display: none;
        position: static;
        min-width: 0;
        width: 100%;
        padding: 0;
        border-top: none;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.25);
        border-radius: 0;
    }
    .cdj-nav ul.menu > li.submenu-open > .cdj-mega-menu {
        display: block;
        grid-template-columns: unset;
    }
    .cdj-nav ul.menu > li.submenu-open > .cdj-pref-menu {
        display: block;
        flex-wrap: unset;
    }

    /* 矢印を反転 */
    .cdj-nav ul.menu > li.menu-item-has-children.submenu-open > a::after {
        content: ' ▴';
    }

    /* サブメニュー内のリンク */
    .cdj-nav ul.menu > li.submenu-open .cdj-mega-menu ul,
    .cdj-nav ul.menu > li.submenu-open .cdj-pref-region ul {
        padding: 0;
    }
    .cdj-nav ul.menu > li.submenu-open .cdj-mega-menu > ul > li > a,
    .cdj-nav ul.menu > li.submenu-open .cdj-pref-region ul li a {
        color: #e2e8f0;
        padding: 9px 20px 9px 32px;
        font-size: 14px;
        background: none;
        border-left: 2px solid rgba(240,165,0,0.6);
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,0.04);
    }
    .cdj-nav ul.menu > li.submenu-open .cdj-mega-menu > ul > li > a:hover,
    .cdj-nav ul.menu > li.submenu-open .cdj-pref-region ul li a:hover {
        background: rgba(255,255,255,0.08);
        color: #fff;
    }

    /* セクション見出し */
    .cdj-nav ul.menu > li.submenu-open .cdj-mega-menu-heading {
        padding: 8px 20px 4px 20px;
        color: rgba(255,255,255,0.45);
        font-size: 10px;
        border-bottom: none;
        margin: 0;
    }

    /* 都道府県メニュー地方ブロック */
    .cdj-nav ul.menu > li.submenu-open .cdj-pref-region {
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .cdj-nav ul.menu > li.submenu-open .cdj-pref-region-name {
        color: rgba(255,255,255,0.45);
        font-size: 10px;
        padding: 6px 20px 2px 20px;
        border-bottom: none;
        margin: 0;
    }
}

/* =============================
   サイトフッター
   ============================= */
.cdj-site-footer {
    background: #1e293b;
    color: #94a3b8;
    font-size: 0.82rem;
    padding: 14px 0;
    margin-top: 40px;
}
.cdj-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.cdj-footer-inner a {
    color: #94a3b8;
    text-decoration: none;
}
.cdj-footer-inner a:hover { color: #e2e8f0; }
.cdj-footer-copy {
    margin-left: auto;
}

/* =============================
   データ出典ツールチップ
   ============================= */
.cdj-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    cursor: help;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 4px;
    background: #e2e8f0;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    vertical-align: middle;
    transition: background 0.15s;
}
.cdj-tip:hover {
    background: #3b82f6;
    color: #fff;
}
/* ポップアップ（JS制御） */
.cdj-tip-popup {
    position: fixed;
    background: #1e293b;
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.6;
    max-width: 320px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.cdj-tip-popup.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== prefecture.css ===== */
/* =============================
   City Data JP 都道府県ページ
   ============================= */

/* 統計カードグリッド */
.cdj-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .cdj-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .cdj-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* 統計カード */
.cdj-stat-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.cdj-stat-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.cdj-stat-label {
    font-size: 11px;
    color: #888;
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.cdj-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1a3a5c;
    margin-bottom: 6px;
    line-height: 1.2;
}

.cdj-stat-rank {
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
}

.cdj-stat-rank strong {
    color: #f0a500;
    font-size: 15px;
}

.cdj-stat-year {
    font-size: 10px;
    color: #bbb;
}

.cdj-pref-summary {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    margin: 8px 0 20px;
    padding: 14px 16px;
    background: #f0f4f8;
    border-left: 4px solid #1a3a5c;
    border-radius: 0 6px 6px 0;
}

.cdj-related-links {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
}

.cdj-related-links li a {
    display: block;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e0e8f0;
    border-radius: 4px;
    color: #1a5276;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}

.cdj-related-links li a:hover {
    background: #e8f0f8;
    color: #f0a500;
}

/* ── 指標推移グラフ ────────────────────────────── */
.cdj-trend-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cdj-trend-row {
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.cdj-trend-row:last-child {
    border-bottom: none;
}

.cdj-trend-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.cdj-trend-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.cdj-trend-latest {
    font-size: 12px;
    color: #6b7280;
}

.cdj-trend-chart {
    width: 100%;
    height: 110px;
}

@media (max-width: 600px) {
    .cdj-trend-chart {
        height: 90px;
    }
}

/* ── 年収ランキング タブ ─────────────────────── */
.cdj-income-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
    margin: 16px 0;
    flex-wrap: wrap;
}
.cdj-income-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
}
.cdj-income-tab:hover {
    color: #3b82f6;
}
.cdj-income-tab--active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    font-weight: 600;
}

/* ── カーブに追加ボタン ───────────────────────── */
.cdj-curve-btn {
    padding: 3px 8px;
    font-size: 12px;
    border: 1px solid #3b82f6;
    border-radius: 4px;
    color: #3b82f6;
    background: #fff;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.cdj-curve-btn--added {
    background: #3b82f6;
    color: #fff;
}

/* ── 年収カーブセクション ────────────────────── */
.cdj-curve-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
}
.cdj-curve-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}
.cdj-curve-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 12px;
}
.cdj-curve-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    min-height: 28px;
}
.cdj-curve-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.cdj-curve-chip-remove {
    cursor: pointer;
    opacity: .7;
    font-size: 11px;
}
.cdj-curve-chip-remove:hover {
    opacity: 1;
}

/* ===== ranking.css ===== */
/* ランキングページ共通スタイル */

.cdj-ranking-page .cdj-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.cdj-ranking-page h1 {
    font-size: 22px;
    font-weight: 700;
    color: #1a3a5c;
    margin-bottom: 6px;
}

.cdj-source {
    font-size: 12px;
    color: #888;
    margin-bottom: 16px;
}

.cdj-ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
    font-size: 14px;
}

.cdj-ranking-table thead th {
    padding: 10px 8px;
    border-bottom: 2px solid #1a3a5c;
    background: #f8fafc;
    color: #1a3a5c;
    font-weight: 600;
}

.cdj-ranking-table tbody td {
    padding: 9px 8px;
    border-bottom: 1px solid #eee;
}

.cdj-ranking-table tbody tr:hover {
    background: #f0f4f8;
}

.cdj-ranking-table .col-rank {
    text-align: center;
    width: 56px;
    font-weight: 600;
    color: #555;
}

.cdj-ranking-table .col-name a {
    color: #1a5276;
    text-decoration: none;
    font-weight: 500;
}

.cdj-ranking-table .col-name a:hover {
    text-decoration: underline;
    color: #f0a500;
}

.cdj-ranking-table .col-value {
    text-align: right;
    font-weight: 600;
    color: #1a3a5c;
}

/* トップ3ハイライト */
.cdj-ranking-table tbody tr:nth-child(1) .col-rank { color: #b8860b; }
.cdj-ranking-table tbody tr:nth-child(2) .col-rank { color: #708090; }
.cdj-ranking-table tbody tr:nth-child(3) .col-rank { color: #8b4513; }

/* ── セクションラベル ──────────────────────────── */
.cdj-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    margin: 20px 0 4px;
}

/* ── トップ3メダルカード ──────────────────────────── */
.cdj-top3 {
    display: flex;
    gap: 12px;
    margin: 16px 0 24px;
}

.cdj-top3-item {
    flex: 1;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 16px 12px;
    text-align: center;
}

.cdj-top3-medal {
    font-size: 2rem;
    line-height: 1;
}

.cdj-top3-ordinal {
    font-size: 11px;
    color: #6b7280;
    margin: 4px 0 6px;
}

.cdj-top3-name {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a3a5c;
    text-decoration: none;
    margin-bottom: 6px;
}

.cdj-top3-name:hover {
    text-decoration: underline;
}

.cdj-top3-value {
    font-size: 1rem;
    font-weight: 700;
    color: #374151;
}

@media (max-width: 600px) {
    .cdj-ranking-page .cdj-container {
        padding: 12px;
    }
    .cdj-ranking-table {
        font-size: 13px;
    }
    .cdj-top3 {
        gap: 8px;
    }
    .cdj-top3-item {
        padding: 12px 8px;
    }
    .cdj-top3-medal {
        font-size: 1.6rem;
    }
    .cdj-top3-value {
        font-size: 0.85rem;
    }
}

/* ===== municipality.css ===== */
/* 市区町村詳細ページスタイル */

.cdj-municipality-page .cdj-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.cdj-breadcrumb {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
}

.cdj-breadcrumb a {
    color: #1a5276;
    text-decoration: none;
}

.cdj-breadcrumb a:hover {
    text-decoration: underline;
}

.cdj-municipality-page h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1a3a5c;
    margin-bottom: 4px;
}

.cdj-subtitle {
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
}

.cdj-section {
    margin-top: 36px;
}

.cdj-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a3a5c;
    border-left: 4px solid #f0a500;
    padding-left: 10px;
    margin-bottom: 16px;
}

/* 年収サマリー */
.cdj-income-summary {
    background: #f8fafc;
    border: 1px solid #e0e8f0;
    border-radius: 8px;
    padding: 24px;
    display: inline-block;
    min-width: 240px;
}

.cdj-income-main {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
}

.cdj-income-value {
    font-size: 42px;
    font-weight: 800;
    color: #1a3a5c;
    line-height: 1;
}

.cdj-income-unit {
    font-size: 18px;
    color: #555;
    font-weight: 500;
}

.cdj-income-rank {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
}

.cdj-income-rank strong {
    font-size: 18px;
    color: #f0a500;
    font-weight: 700;
}

/* 他市区町村ナビリスト */
.cdj-city-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.cdj-city-nav-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e0e8f0;
    border-radius: 4px;
    text-decoration: none;
    color: #1a5276;
    font-size: 13px;
    transition: background 0.15s;
}

.cdj-city-nav-list li a:hover {
    background: #e8f0f8;
    color: #f0a500;
}

.cdj-city-nav-income {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.cdj-no-data {
    color: #999;
    font-size: 14px;
    font-style: italic;
}

@media (max-width: 600px) {
    .cdj-municipality-page .cdj-container {
        padding: 12px;
    }
    .cdj-income-value {
        font-size: 32px;
    }
    .cdj-city-nav-list {
        grid-template-columns: 1fr;
    }
}

/* ===== comparison.css ===== */
/* 都道府県比較ページ */
.cdj-comparison-page .cdj-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px;
}

.cdj-comparison-page h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1a3a5c;
    margin-bottom: 4px;
}

.cdj-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
}

.cdj-comparison-table th,
.cdj-comparison-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e0e8f0;
    vertical-align: middle;
}

.cdj-comparison-table thead th {
    background: #1a3a5c;
    color: #fff;
    font-weight: 700;
    text-align: center;
}

.cdj-comparison-table thead th:nth-child(2) {
    background: #2563eb;
    color: #fff;
}

.cdj-comparison-table thead th:nth-child(3) {
    background: #ea6b0e;
    color: #fff;
}

.cdj-comparison-table thead th a {
    color: #fff;
    text-decoration: none;
}

.cdj-comparison-table .col-label {
    width: 36%;
    font-weight: 600;
    color: #444;
    background: #f8fafc;
}

.cdj-comparison-table .col-pref {
    text-align: center;
    width: 32%;
}

.cdj-comparison-table .col-win {
    background: #fff8e6;
}

.cdj-comparison-table .cell-win {
    color: #c0392b;
    font-weight: 700;
}

.cdj-comparison-table .cdj-compare-section-header td {
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 16px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cdj-rank-badge {
    display: inline-block;
    font-size: 11px;
    color: #888;
    margin-left: 6px;
    white-space: nowrap;
}


@media (max-width: 600px) {
    .cdj-comparison-table .col-label { width: 40%; }
    .cdj-comparison-table th, .cdj-comparison-table td { padding: 8px; font-size: 13px; }
}

/* ── スコア比較テーブル ─────────────────────────────── */
.cdj-score-compare-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 4px;
    font-size: 14px;
}

.cdj-score-compare-table th,
.cdj-score-compare-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #e0e8f0;
    vertical-align: middle;
}

.cdj-score-compare-table thead th:first-child {
    background: #f8fafc;
    color: #555;
    font-weight: 600;
    width: 40%;
    text-align: left;
}

.cdj-score-compare-table thead th:nth-child(2) {
    background: #eff6ff;
    color: #3b82f6;
    font-weight: 700;
    text-align: center;
    width: 30%;
}

.cdj-score-compare-table thead th:nth-child(3) {
    background: #fff7ed;
    color: #f97316;
    font-weight: 700;
    text-align: center;
    width: 30%;
}

.cdj-score-compare-table tbody td:first-child {
    background: #f8fafc;
    color: #374151;
    font-weight: 500;
}

.cdj-score-compare-table tbody td:not(:first-child) {
    text-align: center;
    color: #333;
}

.cdj-score-compare-table .cell-win {
    font-weight: 700;
    color: #c0392b;
}

@media (max-width: 600px) {
    .cdj-score-compare-table th,
    .cdj-score-compare-table td { padding: 8px 8px; font-size: 13px; }
}

/* ===== region.css ===== */
/* 地域別まとめページ */
.cdj-region-page .cdj-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px;
}

.cdj-region-page h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1a3a5c;
    margin-bottom: 4px;
}

.cdj-section-title-h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1a3a5c;
    border-left: 4px solid #f0a500;
    padding-left: 10px;
    margin: 32px 0 12px;
}

.cdj-region-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cdj-region-nav li a {
    display: inline-block;
    padding: 6px 14px;
    background: #f0f4f8;
    border: 1px solid #cdd8e4;
    border-radius: 20px;
    color: #1a5276;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
}

.cdj-region-nav li a:hover {
    background: #dce8f5;
    color: #f0a500;
}

/* ===== scores.css ===== */
/* ── スコアカード ─────────────────────────────────────── */
.cdj-score-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px 24px;
    margin: 16px 0;
}

.cdj-score-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.cdj-score-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.cdj-score-row:last-child {
    margin-bottom: 0;
}

.cdj-score-label {
    width: 130px;
    flex-shrink: 0;
    font-size: 0.875rem;
    color: #374151;
}

.cdj-score-bar-wrap {
    flex: 1;
    background: #f3f4f6;
    border-radius: 4px;
    height: 10px;
    overflow: hidden;
}

.cdj-score-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 4px;
    /* width は style属性でインライン指定 */
}

.cdj-score-value {
    width: 50px;
    text-align: right;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
}

.cdj-score-null {
    color: #9ca3af;
    font-size: 0.8rem;
}

.cdj-score-source-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #6b7280;
    text-decoration: underline;
}

/* ── 比較選択ページ ───────────────────────────────────── */
.cdj-compare-select-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 28px 24px;
    margin: 20px 0;
    max-width: 640px;
}

.cdj-compare-select-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
}

.cdj-compare-select-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cdj-compare-select-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cdj-compare-select-dropdown {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #1f2937;
    background: #fff;
    cursor: pointer;
}

.cdj-compare-select-vs {
    font-size: 1.1rem;
    font-weight: 700;
    color: #9ca3af;
    padding-bottom: 10px;
    flex-shrink: 0;
}

.cdj-compare-select-btn {
    display: inline-block;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 28px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.cdj-compare-select-btn:hover {
    background: #2563eb;
}

.cdj-compare-select-error {
    margin-top: 8px;
    font-size: 0.875rem;
    color: #ef4444;
}

@media (max-width: 480px) {
    .cdj-compare-select-row {
        flex-direction: column;
        align-items: stretch;
    }
    .cdj-compare-select-vs {
        text-align: center;
        padding-bottom: 0;
    }
}


/* ===== performance-utilities ===== */
/* モバイルLCP対策: 下スクロール位置のコンテンツをレンダースキップ */
.cdj-lazy-render { content-visibility: auto; contain-intrinsic-size: auto 600px; }
.cdj-facility-list-section { content-visibility: auto; contain-intrinsic-size: auto 800px; }


/* ===== chart/map lazy-load placeholder with spinner (:empty ベース) ===== */
/* `:has()` はコスト高（毎DOM変更で再評価）なので `:empty` を使う。
   ECharts/MapLibre はコンテナに子要素を追加するため、描画後は :empty にマッチしなくなる。 */
div[id$="-map"]:empty,
div[id$="-chart"]:empty,
div[id$="-radar"]:empty,
div[id$="-sankey"]:empty,
div[id$="-trend"]:empty,
div[id*="-map-a"]:empty,
div[id*="-map-b"]:empty,
div[id="cdj-lv-map"]:empty,
div[id="cdj-city-map"]:empty,
div[id="cdj-ks-map"]:empty,
div[id="cdj-ks-pref-map"]:empty,
div[id="cdj-ex-map"]:empty,
div[id="kaigo-city-map"]:empty,
div[id="kaigo-pref-map"]:empty,
div[id="kaigo-facility-map"]:empty {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    position: relative;
}
div[id$="-map"]:empty::before,
div[id$="-chart"]:empty::before,
div[id$="-radar"]:empty::before,
div[id$="-sankey"]:empty::before,
div[id$="-trend"]:empty::before,
div[id*="-map-a"]:empty::before,
div[id*="-map-b"]:empty::before,
div[id="cdj-lv-map"]:empty::before,
div[id="cdj-city-map"]:empty::before,
div[id="cdj-ks-map"]:empty::before,
div[id="cdj-ks-pref-map"]:empty::before,
div[id="cdj-ex-map"]:empty::before,
div[id="kaigo-city-map"]:empty::before,
div[id="kaigo-pref-map"]:empty::before,
div[id="kaigo-facility-map"]:empty::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -30px 0 0 -18px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: cdj-spin 0.9s linear infinite;
    will-change: transform;
    pointer-events: none;
}
div[id$="-map"]:empty::after,
div[id$="-chart"]:empty::after,
div[id$="-radar"]:empty::after,
div[id$="-sankey"]:empty::after,
div[id$="-trend"]:empty::after,
div[id*="-map-a"]:empty::after,
div[id*="-map-b"]:empty::after,
div[id="cdj-lv-map"]:empty::after,
div[id="cdj-city-map"]:empty::after,
div[id="cdj-ks-map"]:empty::after,
div[id="cdj-ks-pref-map"]:empty::after,
div[id="cdj-ex-map"]:empty::after,
div[id="kaigo-city-map"]:empty::after,
div[id="kaigo-pref-map"]:empty::after,
div[id="kaigo-facility-map"]:empty::after {
    content: "Loading…";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    margin-top: 18px;
    color: #64748b;
    font-size: 0.8rem;
    text-align: center;
    letter-spacing: 0.5px;
    pointer-events: none;
}
@keyframes cdj-spin {
    to { transform: rotate(360deg); }
}
