/* ベース背景（薄いラジアル） */
body {
    background: radial-gradient(1200px 600px at 50% 50%, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0) 60%);
}

.title {
    font-size: 20px;
    font-weight: 500;
    margin-left: 12.5px;
    margin-top: 2.5px;
}

.site-title {
    font-family: 'Noto Sans JP', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    font-weight: 700;
    font-size: 16px;
    /* 小見出しサイズに抑える */
    line-height: 1.2;
    letter-spacing: .02em;
    color: #0f172a;
    /* アクセント色ではなく本文色 */
}

.logo {
    width: 28px;
    height: 28px;
}

/*ヘッダー以外のpadding */
.maingrid {
    padding-left: 30px !important;
    padding-right: 30px !important;
    padding-top: 30px !important;
    padding-bottom: 30px !important;
}

.w-8 {
    width: 15rem !important;
    height: 1.5rem !important;

}

.py-3 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

/* 日本地図 */


.cls-1,
.cls-2,
.cls-3,
.cls-4,
.cls-5,
.cls-6,
.cls-7,
.cls-8 {
    stroke-width: 0px;
}

.cls-9 {
    stroke: #fff;
    stroke-width: .35px;
}

.cls-9,
.cls-10 {
    fill: none;
    stroke-linejoin: round;
}

.cls-10 {
    stroke: #c9caca;
    stroke-width: .75px;
}

/* 北海道東北 */
.cls-1 {
    fill: #bfd2e6;
}

/* 関東 */
.cls-3 {
    fill: #bfe2e1;
}

/* 四国 */
.cls-4 {
    fill: #d5ccea;
}

/* 中国 */
.cls-5 {
    fill: #C7CEE4;
}

/* 中部 */
.cls-6 {
    fill: #ccd3b5;
}

/* 近畿 */
.cls-7 {
    fill: #e8c9b6;
}

/* 九州沖縄 */
.cls-8 {
    fill: #e7c2cb;
}

/* ゲージの伸縮を滑らかに（JS側で transitionDuration も動的調整） */
.gbar {
    background-color: var(--bar, #888);
    transition: width 180ms cubic-bezier(.2, .6, .2, 1);
}

@media (prefers-reduced-motion: reduce) {
    .gbar {
        transition: none;
    }
}

/* ---- Rails: 縦配置＋行間 ---- */
.rail {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* お好みで 8〜14px */
    height: 100%;
    /* 中央マップの高さに追従 */
}

/* ---- Gauge row ---- */
/* 並び: 県名 → ゲージ → 数値 に変更 */
.row {
    display: flex;
    align-items: center;
    gap: 0px;
    /* お好みで */
}

/* 県名を先頭に */
.row__name {
    order: 1;
    width: 60px;
    /* お好みで 70–100px */
    font-size: 16px;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ゲージは真ん中で横に伸びる */
.row__barwrap {
    order: 2;
    flex: 1 1 0%;
    height: 15px;
    /* あなたの現状に合わせて15px */
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.row__bar {
    height: 15px;
    width: 2%;
    border-radius: 9999px;
    transition: width 180ms cubic-bezier(.2, .6, .2, 1);
}

@media (prefers-reduced-motion: reduce) {
    .row__bar {
        transition: none;
    }
}

/* 数値は末尾・右寄せで固定幅 */
.row__val {
    order: 3;
    width: 80px;
    /* お好みで 70–90px */
    text-align: right;
    font-size: 15px;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}




/* ---- 地域カラー（使うなら行に region-* を付与） ---- */
.region-hokkaido .row__bar {
    background: #6C89B3;
}

/* 北海道・東北 */
.region-kanto .row__bar {
    background: #6BA8A9;
}

/* 関東 */
.region-chubu .row__bar {
    background: #8F9B6E;
}

/* 中部 */
.region-kinki .row__bar {
    background: #B8876B;
}

/* 近畿 */
.region-chugoku .row__bar {
    background: #7C8BA6;
}

/* 中国 */
.region-shikoku .row__bar {
    background: #8C7AAE;
}

/* 四国 */
.region-kyushu .row__bar {
    background: #B87483;
}

/* 九州 */

/* いま 10px → 16〜20px くらいが見やすい */
.rail {
    gap: 20px;
    /* ← 好みで 16 / 18 / 20 など */
}


/* ===== 地域パネル（囲み） ===== */
.region-group {
    --acc: #6C89B3;
    /* 地域アクセント色（既定） */
    --line: color-mix(in srgb, var(--acc) 35%, transparent);
    background: #fff;
    border: 2px solid var(--line);
    border-radius: 18px;
    padding: 14px 16px 16px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .03);
}

/* 地域見出し：文字＋右へ伸びるライン */
.region-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -2px 0 10px;
    /* 上をキュッと */
    font-weight: 700;
    font-size: 20px;
    color: var(--acc);
}

.region-title::after {
    content: "";
    flex: 1 1 auto;
    height: 0;
    border-top: 2px solid var(--line);
    border-radius: 2px;
}

/* グループ内の行リスト（縦並び） */
.rg__list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* レール（グループ間の間隔を広めに） */
.rail {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

/* ===== 地域ごとの色設定（--acc を差し替え） ===== */
.rg--hokkaido {
    --acc: #6C89B3;
}

/* 北海道・東北 */
.rg--kanto {
    --acc: #6BA8A9;
}

.rg--chubu {
    --acc: #8F9B6E;
}

.rg--kinki {
    --acc: #B8876B;
}

.rg--chugoku {
    --acc: #7C8BA6;
}

.rg--shikoku {
    --acc: #8C7AAE;
}

.rg--kyushu {
    --acc: #B87483;
}

/* バーもグループ色で統一したい場合（任意でON） */
/* .region-group .row__bar{ background: var(--acc); } */

:root {
    --bg: rgba(255, 255, 255, .82);
    --line: #e7eef6;
    --text: #0f172a;
    --muted: #64748b;
    --accent: #2f6aa1;
    /* アクティブ色（地図の青に寄せる） */
    --chip: #f1f5f9;
    --shadow: 0 10px 28px rgba(15, 23, 42, .08);
    --radius: 18px;
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    background: radial-gradient(900px 420px at 30% 0%, rgba(148, 163, 184, .12), transparent 60%);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    color: var(--text);
}

/* パネル本体（地図の左上に重ねる想定） */
.cp {
    position: relative;
    /* 単体表示用。統合時は .cp{position:absolute; left:16px; top:16px;} に変更 */
    width: min(640px, 92vw);
    background: var(--bg);
    backdrop-filter: blur(6px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 16px 18px;
}

/* デジタル表示の右に添えるラベル（青灰・控えめ） */
.seg-label {
    align-self: center;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: .05em;
    color: color-mix(in srgb, var(--accent) 45%, var(--muted));
    /* ほどよい青灰 */
    opacity: .95;
}

/* ヘッダ */
.cp-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.cp-title {
    font-weight: 700;
    letter-spacing: .01em;
    margin: 0;
    font-size: 26px;
    color: #62717c;
}

.cp-desc {
    margin: 2px 0 0;
    font-size: 16px;
    color: var(--muted);
    line-height: 1.5;
}

/* 年度ディスプレイ（デジタル） */
.cp-year {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0 19px;
}

.seg {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-weight: 700;
    letter-spacing: .04em;
    font-size: 38px;
    padding: 6px 10px;
    background: #eef3f8;
    border: 1px solid var(--line);
    color: #1f3650;
    border-radius: 10px;
    box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .6);
}

/* コントロール列 */
.cp-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 12px 0;
}

.cp-row.wrap {
    flex-wrap: wrap
}

/* 再生ボタン（大） */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 22px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #0f172a;
    color: #fff;
    font-weight: 700;
    box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    cursor: pointer;
    user-select: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(2, 6, 23, .12);
}

.btn:active {
    transform: translateY(0);
}

.btn--ghost {
    background: #f8fafc;
    color: #0f172a;
}

.btn--ghost:hover {
    background: #eef2f7;
}

/* 速度チップ */
.speed {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.chip {
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--chip);
    border: 1px solid var(--line);
    color: #0f172a;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.chip:hover {
    transform: translateY(-1px);
}

.chip[aria-pressed="true"] {
    background: #e6eef7;
    color: #163a5e;
    border-color: #cfe0f3;
}

/* タイムライン */
.timeline {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.range {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 6px;
    width: 100%;
    background: linear-gradient(90deg, #cfe0f3, #e8edf3);
    border: 1px solid var(--line);
}

.range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0f172a;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #0f172a22;
    cursor: pointer;
    transition: transform .15s ease;
}

.range::-webkit-slider-thumb:hover {
    transform: scale(1.06);
}

.tickbar {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin: 6px 0 0;
}

.tick {
    width: 1px;
    height: 6px;
    background: #cbd5e1;
}

/* 年度入力 */
.year-in {
    width: 90px;
    appearance: textfield;
    text-align: center;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #f8fafc;
    color: #5e768d;
    font-weight: 700;
    font-size: 20px;
}

.year-in:focus {
    outline: 2px solid #cfe0f3;
}

/* モード切替 */
.mode {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mode .chip {
    padding: 6px 12px
}

/* ユーティリティ（右寄せ） */
.util {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.iconbtn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #f8fafc;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}

.iconbtn:hover {
    background: #eef2f7;
    transform: translateY(-1px);
}

/* レイアウト崩し防止 */
@media (max-width: 720px) {
    .cp {
        width: min(560px, 96vw);
    }

    .cp-row.wrap {
        gap: 8px
    }

    .year-in {
        width: 80px
    }
}

@media (prefers-reduced-motion: reduce) {

    .btn,
    .chip,
    .iconbtn,
    .seg {
        transition: none
    }
}


/* 右下ドック配置（.cp の relative を上書き） */
.cp.cp--dock {
    position: fixed !important;
    left: auto !important;
    /* ← 明示リセット */
    top: auto !important;
    /* ← 明示リセット */
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 60;
    /* 既存のfixedより上に */
    width: min(720px, 44vw);
}

/* レスポンシブ幅 */
@media (max-width: 960px) {
    .cp.cp--dock {
        width: min(560px, 92vw);
    }
}

/* ===== 速度メーター ===== */
.speedbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.meter-btn {
    width: 42px;
    height: 42px;
    font-size: 22px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #f8fafc;
    cursor: pointer;
    font-weight: 700;
    color: #7789b4;
    transition: background .15s ease, transform .15s ease;
}

.meter-btn:hover {
    background: #eef2f7;
    transform: translateY(-1px);
}

.meter {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 30px;
    padding: 0 2px;
}

.meter-bar {
    width: 8px;
    border-radius: 3px;
    background: #e2e8f0;
    /* 消灯 */
    transition: background .15s ease, height .15s ease;
    height: 8px;
    /* lv1相当の高さ基準 */
}

.meter-bar[data-lv="1"] {
    height: 12px;
}

.meter-bar[data-lv="2"] {
    height: 17px;
}

.meter-bar[data-lv="3"] {
    height: 22px;
}

.meter-bar[data-lv="4"] {
    height: 27px;
}

.meter-bar[data-lv="5"] {
    height: 32px;
}

.meter-bar.on {
    background: color-mix(in srgb, var(--accent) 70%, #ffffff);
}

.meter-readout {
    min-width: 52px;
    font-weight: 700;
    color: #5e768d;
    font-size: 20px;
}

svg .svg-hl {
    fill: #fff200 !important;
    transition: fill .12s ease;
}

/* === 表示形式パネル === */
.viewpanel {
    position: absolute;
    left: 30px;
    top: 185px;
    z-index: 30;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(6px);
    border: 1px solid #e7eef6;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
    padding: 14px 16px;
    width: min(580px, 62vw);
}

.viewpanel__head {
    font-weight: 700;
    font-size: 19px;
    color: #334155;
    letter-spacing: .06em;
    margin-bottom: 8px;
}

.viewpanel__btns {
    display: flex;
    gap: 12px;
}

.vbtn {
    appearance: none;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .15s ease, border-color .15s ease;
}

.vbtn:hover {
    transform: translateY(-1px);
    background: #eef2f7;
}

.vbtn.is-active {
    background: #e6eef7;
    color: #163a5e;
    border-color: #cfe0f3;
}

.viewpanel__note {
    margin-top: 6px;
    font-size: 11px;
    color: #64748b;
}

/* SVG の塗りを滑らかに */
svg path,
svg polygon,
svg polyline {
    transition: fill .28s ease, stroke .28s ease;
}


/* ===== Hover Popup ===== */
.hoverpop {
    position: absolute;
    z-index: 60;
    display: none;
    min-width: clamp(260px, 30vw, 380px);
    max-width: min(420px, 70vw);
    background: rgba(255, 255, 255, .95);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid #e7eef6;
    border-radius: 14px;
    padding: 10px 12px;
    animation: pop-in .18s ease-out both;
}

@keyframes pop-in {
    from {
        opacity: 0;
        transform: translateY(6px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hoverpop__content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.hoverpop__img {
    width: 126px;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
    background: #fff;
}

.hoverpop__text h4 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 800;
    color: #3e484f
}

.hoverpop__text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
}

/* 吹き出しの三角 */
.hoverpop__arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid #e7eef6;
    border-top: 1px solid #e7eef6;
    transform: rotate(45deg);
}

.hoverpop__arrow[data-side="bottom"] {
    top: -6px;
}

.hoverpop__arrow[data-side="top"] {
    bottom: -6px;
    transform: rotate(225deg);
}

.hoverpop__arrow[data-side="left"] {
    right: -6px;
    transform: rotate(135deg);
}

.hoverpop__arrow[data-side="right"] {
    left: -6px;
    transform: rotate(-45deg);
}

@media (max-width: 640px) {
    .hoverpop {
        min-width: min(260px, 86vw);
    }

    .hoverpop__img {
        width: 84px;
        height: 82pxpx;
    }
}

/* 縦並びにする */
.viewpanel__btns--column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* これまでの “吹き出し” 仕様から、常時表示のカードへ */
.hoverpop.as-button {
    position: static;
    display: block;
    min-width: 0;
    max-width: 100%;
    cursor: pointer;
    user-select: none;
    animation: none;
}

/* 押下/選択の見た目 */
.hoverpop.as-button[aria-pressed="true"] {
    outline: 1px solid #cfe0f3;
}

.hoverpop.as-button:focus {
    outline: 1px solid #93c5fd;
}

/* “吹き出しの矢印” はボタン化では不要なので消す */
.hoverpop.as-button .hoverpop__arrow {
    display: none;
}

.badge {
    font-weight: 700;
    color: #587086;
    font-size: 20px;
}



.credit-badge {
    position: fixed;
    left: 0;
    /* ← 角にピッタリ */
    bottom: 0;
    /* ← 角にピッタリ */
    z-index: 70;

    display: inline-block;
    padding: 8px 12px 8px 14px;
    font-size: 12px;
    line-height: 1.4;
    color: #334155;
    text-decoration: none;

    background: rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border-top-right-radius: 10px;
    /* ← 左下角は角丸しない */
    border: 1px solid #e2e8f0;
    border-left: none;
    border-bottom: none;
    box-shadow: 0 -2px 8px rgba(15, 23, 42, .06);

    transition: opacity .15s ease, transform .15s ease;
}

.credit-badge:hover {
    opacity: .95;
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .credit-badge {
        font-size: 11px;
        padding: 6px 10px;
    }
}


/* ===== Guided Tour (spotlight) ===== */
.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    font-family: inherit
}

.tour-dim {
    position: fixed;
    background: rgba(3, 6, 24, .62);
    pointer-events: auto;
    transition: all .18s ease
}

.tour-pop {
    position: fixed;
    z-index: 1001;
    max-width: min(360px, 92vw);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
    padding: 14px 16px;
    color: #0f172a;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(6px) scale(.98);
    transition: opacity .30s ease, transform .30s ease;
}

.tour-pop.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tour-pop.is-fading-out {
    opacity: 0;
    transform: translateY(6px) scale(.98);
}

.tour-pop .tp-title {
    font-weight: 800;
    margin: 0 0 6px;
    font-size: 15px;
    color: #5e6986;
}

.tour-pop .tp-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #475569
}

.tour-pop .tp-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end
}

.tour-pop .tp-btn {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    font-weight: 700
}

.tour-pop .tp-btn--primary {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a
}

.tour-ring {
    position: fixed;
    z-index: 1001;
    pointer-events: none;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, .18), 0 0 0 12px rgba(15, 23, 42, .18)
}

@media (prefers-reduced-motion:reduce) {

    .tour-dim,
    .tour-pop {
        transition: none;
        animation: none
    }
}

/* ゆっくりフェード＆移動 */
.tour-dim {
    transition: all .30s ease
}

/* 暗転の出入り */
.tour-pop {
    animation: tour-pop-in .30s ease-out both
}

.tour-ring {
    transition: all .30s ease
}

/* 白リングの移動/サイズ */
.tour-ring {
    box-shadow: 0 0 0 0px rgba(255, 255, 255, .18);
}

#tour.is-visible .tour-dim {
    opacity: 1;
}

#tour.is-visible .tour-pop {
    opacity: 1;
    transform: translateY(0) scale(1);
}

#tour.is-fading-out .tour-dim {
    opacity: 0;
}

#tour.is-fading-out .tour-pop {
    opacity: 0;
    transform: translateY(6px) scale(.98);
}

/* 初期状態は非表示気味（JSで is-visible を付与） */
.tour-pop {
    opacity: 0;
}

.tour-dim {
    opacity: 0;
}

/* すでにある .tour-pop のアニメに加えて、直接制御できるクラスを追加 */
.tour-pop {
    opacity: 0;
    transform: translateY(6px) scale(.98);
    transition: opacity .30s ease, transform .30s ease;
}

.tour-pop.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tour-pop.is-fading-out {
    opacity: 0;
    transform: translateY(6px) scale(.98);
}



/* ① カードの外枠を固定（同じ幅・高さ感に） */
.viewpanel__btns--column .hoverpop.as-button {
    width: 100%;
    max-width: 500px;
    /* カード幅を統一 */
    min-height: 130px;
    /* 高さの土台（画像＋余白ぶん） */
    flex: none;
}

/* ② 中身を2カラムのグリッドに（左：画像固定、右：テキスト） */
.viewpanel__btns--column .hoverpop.as-button .hoverpop__content {
    display: grid;
    grid-template-columns: 126px 1fr;
    /* ← 画像列は固定幅 */
    align-items: start;
    gap: 12px;
}

/* ③ 画像は“等倍で全体が見える”＝contain（トリミングしない） */
.viewpanel__btns--column .hoverpop.as-button .hoverpop__img {
    width: 126px;
    /* グリッド列と同じ幅 */
    aspect-ratio: 3 / 2;
    /* 画像枠の比率。必要なら 4/3 や 16/9 に変更 */
    height: 108px;
    object-fit: contain;
    /* ← ここが重要（cover→contain） */
    background: #fff;
    /* レターボックス部分の色 */
    border-radius: 8px;
}

/* ④ テキスト枠の高さを固定（例：行高1.6em × 4行ぶん） */
.viewpanel__btns--column .hoverpop.as-button .hoverpop__text {
    --lines: 4;
    /* ここを変えると固定行数を調整できる */
    line-height: 1.6;
    min-height: calc(var(--lines) * 1.6em);
}

/* テキストが長い時：省略（…）にしたい場合 */
.viewpanel__btns--column .hoverpop.as-button .hoverpop__text p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* スクロールにしたい派は↑を外して、代わりにこれを使う */
/*
.viewpanel__btns--column .hoverpop.as-button .hoverpop__text {
  max-height: calc(var(--lines) * 1.6em);
  overflow: auto;
}
*/

/* 見出しの高さ揺れを抑える（任意） */
.viewpanel__btns--column .hoverpop.as-button .hoverpop__text h4 {
    margin: 0 0 6px;
    min-height: 1.6em;
    /* 1行ぶんの高さを確保 */
}

/* 高さが 1685px 以下のときだけ適用 */
@media (max-height: 1685px) {
    .cp-head {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 10px;
    }

    .cp-title {
        font-weight: 700;
        letter-spacing: .01em;
        margin: 0;
        font-size: 18px;
    }

    .cp-desc {
        margin: 2px 0 0;
        font-size: 15x;
        color: var(--muted);
        line-height: 1.5;
    }

    /* 年度ディスプレイ（デジタル） */
    .cp-year {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 10px 0 14px;
    }

    .seg {
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
        font-weight: 700;
        letter-spacing: .04em;
        font-size: 28px;
        padding: 6px 10px;
        background: #eef3f8;
        border: 1px solid var(--line);
        color: #1f3650;
        border-radius: 10px;
        box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .6);
    }

    /* コントロール列 */
    .cp-row {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 12px 0;
    }

    .cp-row.wrap {
        flex-wrap: wrap
    }

    /* 再生ボタン（大） */
    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 10px 14px;
        border-radius: 12px;
        border: 1px solid var(--line);
        background: #0f172a;
        color: #fff;
        font-weight: 700;
        box-shadow: var(--shadow);
        transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
        cursor: pointer;
        user-select: none;
        font-size: 18px;


    }

    .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 12px 26px rgba(2, 6, 23, .12);
    }

    .btn:active {
        transform: translateY(0);
    }

    .btn--ghost {
        background: #f8fafc;
        color: #0f172a;
    }

    .btn--ghost:hover {
        background: #eef2f7;
    }

    /* 速度チップ */
    .speed {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
    }

    .chip {
        padding: 6px 10px;
        border-radius: 999px;
        background: var(--chip);
        border: 1px solid var(--line);
        color: #0f172a;
        font-size: 12px;
        cursor: pointer;
        transition: background .15s ease, color .15s ease, transform .15s ease;
    }

    .chip:hover {
        transform: translateY(-1px);
    }

    .chip[aria-pressed="true"] {
        background: #e6eef7;
        color: #163a5e;
        border-color: #cfe0f3;
    }

    /* タイムライン */
    .timeline {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .range {
        -webkit-appearance: none;
        appearance: none;
        height: 8px;
        border-radius: 6px;
        width: 100%;
        background: linear-gradient(90deg, #cfe0f3, #e8edf3);
        border: 1px solid var(--line);
    }

    .range::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: #0f172a;
        border: 2px solid #fff;
        box-shadow: 0 0 0 2px #0f172a22;
        cursor: pointer;
        transition: transform .15s ease;
    }

    .range::-webkit-slider-thumb:hover {
        transform: scale(1.06);
    }

    .tickbar {
        display: flex;
        justify-content: space-between;
        width: 100%;
        margin: 6px 0 0;
    }

    .tick {
        width: 1px;
        height: 6px;
        background: #cbd5e1;
    }

    /* 年度入力 */
    .year-in {
        width: 90px;
        appearance: textfield;
        text-align: center;
        padding: 6px 8px;
        border-radius: 10px;
        border: 1px solid var(--line);
        background: #f8fafc;
        color: #5e768d;
        font-weight: 700;
    }

    .year-in:focus {
        outline: 2px solid #cfe0f3;
    }

    /* モード切替 */
    .mode {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .mode .chip {
        padding: 6px 12px
    }

    /* ユーティリティ（右寄せ） */
    .util {
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .iconbtn {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        border: 1px solid var(--line);
        background: #f8fafc;
        display: grid;
        place-items: center;
        cursor: pointer;
        transition: background .15s ease, transform .15s ease;
    }

    .iconbtn:hover {
        background: #eef2f7;
        transform: translateY(-1px);
    }

    .speedbar {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .meter-btn {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        border: 1px solid var(--line);
        background: #f8fafc;
        cursor: pointer;
        font-weight: 700;
        color: #7789b4;
        transition: background .15s ease, transform .15s ease;
    }

    .meter-btn:hover {
        background: #eef2f7;
        transform: translateY(-1px);
    }

    .meter {
        display: flex;
        align-items: flex-end;
        gap: 6px;
        height: 22px;
        padding: 0 2px;
    }

    .meter-bar {
        width: 8px;
        border-radius: 3px;
        background: #e2e8f0;
        /* 消灯 */
        transition: background .15s ease, height .15s ease;
        height: 8px;
        /* lv1相当の高さ基準 */
    }

    .meter-bar[data-lv="1"] {
        height: 8px;
    }

    .meter-bar[data-lv="2"] {
        height: 13px;
    }

    .meter-bar[data-lv="3"] {
        height: 18px;
    }

    .meter-bar[data-lv="4"] {
        height: 23px;
    }

    .meter-bar[data-lv="5"] {
        height: 28px;
    }

    .meter-bar.on {
        background: color-mix(in srgb, var(--accent) 70%, #ffffff);
    }

    .meter-readout {
        min-width: 52px;
        font-weight: 700;
        color: #5e768d;
    }

    .row__barwrap {
        height: 11px;
    }

    .row__bar {
        height: 11px;
    }

    .rg__list {
        gap: 10px;
    }

    .row__name {
        font-size: 15px;
    }

    .row__val {
        font-size: 14.5px;
    }

    .region-title {
        font-size: 17.5px;
    }

    .viewpanel__head {
        font-size: 17px;
    }

    .hoverpop__text h4 {
        font-size: 17px;
    }

    .hoverpop__text p {
        font-size: 14.5px;
    }

    .viewpanel__btns--column .hoverpop.as-button .hoverpop__img {
        width: 102px;
        height: 102px;
    }

    .viewpanel__btns--column .hoverpop.as-button .hoverpop__content {
        grid-template-columns: 104px 1fr;
    }

    .viewpanel__btns--column .hoverpop.as-button {
        min-height: 100px;
    }

    .w-8 {
        height: 20px !important;
        width: 184px !important;
    }

    .cp {
        padding: 16px 16px 6px;
    }

    .vbtn h4 {
        font-size: 16px !important;
    }

    .viewpanel {
        top: 175px;
    }
}

@media (max-height: 1380px) {
    .py-3 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    .responsive_cap {
        display: none;
    }

    .region-group {
        padding: 12px 12px 12px;
    }

    .maingrid {
        padding-top: 20px !important;
    }

    .cp.cp--dock {
        right: max(19%, env(safe-area-inset-right));
        width: 540px !important;
        /* ← pxで固定に */
    }
}


.meter-bar.on[data-lv="1"] {
    background: color-mix(in srgb, #52C252 70%, #ffffff) !important;
}

.meter-bar.on[data-lv="2"] {
    background: color-mix(in srgb, #A6C34B 70%, #ffffff) !important;
}

.meter-bar.on[data-lv="3"] {
    background: color-mix(in srgb, #FFC74C 70%, #ffffff) !important;
}

.meter-bar.on[data-lv="4"] {
    background: color-mix(in srgb, #F48947 70%, #ffffff) !important;
}

.meter-bar.on[data-lv="5"] {
    background: color-mix(in srgb, #E84842 70%, #ffffff) !important;
}

/* 表示指標カード（単一カラム） */
.vbtn {
    appearance: none;
    display: block;
    width: 100%;
    text-align: left;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.vbtn:hover {
    background: #eef2f7;
    transform: translateY(-1px);
}

.vbtn.is-active,
.vbtn[aria-pressed="true"] {
    background: #e6eef7;
    border-color: #cfe0f3;
}

.vbtn h4 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: #334155;
}

.vbtn p {
    margin: 0;
    font-size: 14.5px;
    color: #475569;
    line-height: 1.6;
    font-weight: 500;
}

.metricpanel {
    top: 0px;
}

/* レスポンシブ */
@media (max-width: 960px) {
    .vbtn h4 {
        font-size: 16px;
    }

    .vbtn p {
        font-size: 12.5px;
    }
}

/* ゲージは幅ではなく不透明度だけをアニメ */
.row__bar {
    transition: opacity .28s ease;
    /* ← width は外す */
    will-change: opacity;
}

/* 数値もフェード */
.row__val {
    transition: opacity .28s ease, transform .28s ease;
    will-change: opacity, transform;
}

/* 一括切替中（クラス付与時）は軽く下から */
.metric-switch .row__val {
    opacity: 0;
    transform: translateY(4px);
}

.metric-switch .row__bar {
    opacity: 0;
}

/* ユーザーが動き控えめ設定なら即時反映 */
@media (prefers-reduced-motion: reduce) {

    .row__bar,
    .row__val {
        transition: none;
    }
}

/* メトリクス切替中に UI を一括でフェード */
.metric-switching .cp,
.metric-switching .viewpanel,
.metric-switching .rail .row__bar,
.metric-switching .rail .row__val,
.metric-switching .seg,
.metric-switching .range,
.metric-switching .year-in {
    opacity: 0;
    transform: translateY(2px);
    transition: opacity .28s ease, transform .28s ease;
}

/* 通常時（戻し） */
.cp,
.viewpanel,
.rail .row__bar,
.rail .row__val,
.seg,
.range,
.year-in {
    transition: opacity .28s ease, transform .28s ease;
}


.timeline .badge {
    cursor: pointer;
}

.cp-topbtn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: background .15s ease, transform .15s ease;
}

.cp-topbtn:hover {
    background: #eef2f7;
    transform: translateY(-1px);
}

.cp-topbtn svg {
    width: 23px;
    height: 23px;
    display: block;
}

.cp-topbtn svg .cls-1 {
    fill: #94a3b8;
    /* ← 通常色 */
    transition: fill .2s ease;
}

.cp-topbtn:hover svg .cls-1 {
    fill: #334155;
    /* ← ホバー時に濃く */
}

.cls-1 {
    fill: #c9caca;
    stroke-width: 0px;
}


/* 狭い高さ向けに少しだけ小さく（任意） */
@media (max-height: 1380px) {
    .cp-topbtn {
        width: 30px;
        height: 30px;
    }

}

.region-group {
    position: relative;
}

/* 既存に追加でOK */
/* 近畿など各カード右上の ? ボタン（小型） */
.panel-help {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
    transition: background .15s ease, transform .15s ease;
    z-index: 2;
    /* タイトルより前面に */
}

.panel-help:hover {
    background: #eef2f7;
    transform: translateY(-1px);
}

.panel-help svg {
    width: 23px;
    height: 23px;
    display: block;
}

.panel-help svg .cls-1 {
    fill: #94a3b8;
    transition: fill .2s ease;
}

.panel-help:hover svg .cls-1 {
    fill: #334155;
}

.rg--kinki>.region-title {
    padding-right: 36px;
}


/* 追加：バー行のハイライト */
.row.is-hl {
    background: #fcff2e;
    /* うっすら黄色 */
    border-radius: 3px;
    transition: background .12s ease, box-shadow .12s ease;
}

/* 伸ばす元点を左に固定 & transformを有効に */
.row__bar {
    transform-origin: left center;
    will-change: transform;
    transition: transform .12s ease;
    /* なめらかに */
}

/* ハイライト時に“見かけ上”1.08倍に（お好みで 1.03〜1.10） */
.row.is-hl .row__bar {
    transform: scaleX(1.08);
}

/* ← これが無いとラッパでクリップされて伸びが見えない */
.row.is-hl .row__barwrap {
    overflow: visible;
}

/* 横2分割：左7 / 右3（パネル幅は既存のまま） */
.viewpanel__btns--split {
    display: grid;
    /* 左: 7fr、右: 3fr。ただし右カラムは最小幅を確保して崩れ防止 */
    grid-template-columns: minmax(0, 8fr) minmax(135px, 2fr);
    grid-template-areas: "heat region";
    gap: 12px;
    align-items: stretch;
}

/* グリッドエリア割当（DOM順はそのままでも見た目は左:pop・右:region） */
#pop-pop {
    grid-area: heat;
}

#pop-region {
    grid-area: region;
}

/* カードをグリッドのセルいっぱいに伸ばす */
.viewpanel__btns--split .hoverpop.as-button {
    display: block;
    min-width: 0;
    max-width: none;
    height: 100%;
}

/* 右カラム：地域区分はテキストのみ表示（画像は隠す） */
#pop-region.is-compact .hoverpop__img {
    display: none;
}

#pop-region.is-compact .hoverpop__content {
    display: block;
}


/* 左カラム（ヒートマップ）は画像＋テキストの2カラムのまま */
#pop-pop .hoverpop__content {
    display: grid;
    grid-template-columns: 126px 1fr;
    /* 画像は従来どおり */
    align-items: center;
    gap: 12px;
}

/* せまい画面は縦積みにフォールバック */
@media (max-width: 560px) {
    .viewpanel__btns--split {
        grid-template-columns: 1fr;
        grid-template-areas:
            "heat"
            "region";
    }
}

/* 画像サイズに合わせて1列目が自動で縮む（=テキストが広がる） */
.viewpanel__btns--column .hoverpop.as-button .hoverpop__content,
#pop-pop .hoverpop__content {
    display: grid;
    grid-template-columns: max-content 1fr !important;
    /* ← 126pxをやめる */
    align-items: center;
    gap: 12px;
}

/* 画像は86px四方に */
#pop-pop .hoverpop__img {
    width: 86px;
    height: 86px;
    object-fit: cover;
    border-radius: 8px;
    background: #fff;
}


/* ▼ 凡例パネル */
/* ▼ 凡例パネル */
/* ▼ 凡例パネル（右端アンカー化） */
.legend-panel {
    position: absolute;
    bottom: 0;
    left: -25px;
    /* ← ここが “右端の基準位置” になる */
    transform: translateX(-100%);
    /* ← 自分の幅だけ左へ移動 = 右端が left に揃う */
    text-align: right;
    z-index: 5;
}

/* 画像は今のままでOK */
.legend-img {
    display: none;
    width: auto;
    height: 50px;
    opacity: 0.95;
    transition: opacity .3s ease, transform .3s ease;
}

.legend-img.is-active {
    display: block;
    transform: translateY(0);
}

.legend-img.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.legend-img.is-active {
    display: block;
    transform: translateY(0);
}

/* 指標切り替え時のアニメ感を出す場合 */
.legend-img.fade-in {
    opacity: 1;
    transform: translateY(0);
}

@media (max-height: 1380px) {
.legend-img {
    height: 35px;
}
    .legend-panel {
        left: -145px;
        transform: translateX(-72%);
    }
}

@media (max-width: 1900px) {
.legend-img {
    height: 35px;
}
    .legend-panel {
        left: -145px;
        transform: translateX(-72%);
    }
}

