/* =========================
   THEME VARIABLES
========================= */
:root {
    --bg-main: #1e293b;

    --card-bg: rgba(255, 255, 255, 0.06);
    --card-border: rgba(255, 255, 255, 0.12);

    --text-main: #e5e7eb;
    --text-sub: #9ca3af;

    --accent-blue: #38bdf8;
    --accent-green: #34d399;
    --accent-red: #fb7185;
    --accent-yellow: #facc15;

    --grid-line: rgba(255,255,255,0.08);
}

/* =========================
   BASE
========================= */
body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', 'Noto Sans JP', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
}

h1, h2, h3 {
    color: #f9fafb;
    font-weight: 600;
    margin: 16px 0 8px;
}
h1{
    margin:0 0 1rem !important;
}

.view-more-btn {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #38bdf8; /* アクセントブルー */
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s ease;
    padding: 0.5rem;
}
.view-more-btn:hover {
    background: rgba(56, 189, 248, 0.15);
}

/* ====================================
   HEADER & MENU STYLES
   ==================================== */

/* Body調整: ヘッダーの高さ分だけ上を開ける */
    body {
        padding-top: 60px; /* ヘッダーの高さ */
    }

    /* --- ヘッダー本体 --- */
    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px; /* スマホでも邪魔にならない高さ */
        background: rgba(23, 32, 51, 0.95); /* var(--bg-main) に近い色 */
        backdrop-filter: blur(10px); /* すりガラス効果 */
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 9000;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    }

    .header-inner {
        max-width: 640px; /* コンテンツ幅に合わせる */
        margin: 0 auto;
        height: 100%;
        display: flex;
        align-items: center;
        padding: 0 16px;
        position: relative;
    }

    /* --- ハンバーガーボタン --- */
    .menu-btn {
        background: transparent;
        border: none;
        color: #e5e7eb; /* var(--text-main) */
        font-size: 1.2rem;
        padding: 8px;
        cursor: pointer;
        margin-right: 16px;
        transition: color 0.2s;
    }
    .menu-btn:hover {
        color: #38bdf8;
    }

    /* --- ロゴエリア --- */
    .header-logo {
        display: flex;
        align-items: center;
        text-decoration: none;
        color: #fff;
        gap: 10px;
    }

    /* 丸アイコン */
    .logo-circle {
        width: 32px;
        height: 32px;
        background: #373c45;
        border-radius: 50%;
        border: 1px solid rgba(255,255,255,0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden; /* 画像がはみ出ないように */
    }

    /* ロゴ画像を使う場合 */
    .logo-circle img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* アイコンを使う場合 */
    .logo-circle i {
        font-size: 0.9rem;
        color: #38bdf8;
    }

    .logo-text {
        font-size: 1.1rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        color: #f9fafb;
    }

/* ====================================
   SIDE MENU (Drawer)
   ==================================== */
    .side-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        height: 100%;
        background: #1f2937; /* 濃いグレー */
        z-index: 9999;
        transform: translateX(-100%); /* 画面外へ隠す */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 15px rgba(0,0,0,0.5);
        display: flex;
        flex-direction: column;
    }

    .side-menu.active {
        transform: translateX(0); /* 表示 */
    }

    /* メニュー内ヘッダー */
    .menu-header {
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        background: rgba(0,0,0,0.2);
    }

    .menu-title {
        font-weight: bold;
        color: #9ca3af;
        letter-spacing: 0.1em;
    }

    .close-btn {
        background: transparent;
        border: none;
        color: #fff;
        font-size: 1.2rem;
        cursor: pointer;
    }

    /* メニューリスト */
    .menu-nav {
        flex: 1;
        overflow-y: auto;
        padding: 20px 0;
    }

    .menu-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .menu-nav li a {
        display: flex;
        align-items: center;
        padding: 14px 24px;
        color: #e5e7eb;
        text-decoration: none;
        font-size: 0.95rem;
        transition: background 0.2s, color 0.2s;
        border-left: 4px solid transparent;
    }

    .menu-nav li a i {
        width: 24px;
        margin-right: 10px;
        text-align: center;
        color: #64748b;
    }

    .menu-nav li a:hover {
        background: rgba(255,255,255,0.05);
        color: #38bdf8;
        border-left-color: #38bdf8;
    }

    .menu-nav li a:hover i {
        color: #38bdf8;
    }

    /* --- 背景の黒幕 --- */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.6);
        backdrop-filter: blur(2px);
        z-index: 9990;
        opacity: 0;
        pointer-events: none; /* クリック無効 */
        transition: opacity 0.3s ease;
    }

    .menu-overlay.active {
        opacity: 1;
        pointer-events: auto; /* クリック有効 */
    }


/* ====================================
   TOOLTIP STYLES
   ==================================== */
/* --- ツールチップ --- */
    .tooltip-container {
        position: relative;
        display: inline-block;
        margin-left: 6px;
        cursor: help;
    }
    .tooltip-icon {
        color: #94a3b8;
        font-size: 0.9rem;
    }
    .tooltip-text {
        visibility: hidden;
        width: 220px;
        background-color: #334155;
        color: #fff;
        text-align: center;
        border-radius: 6px;
        padding: 8px;
        position: absolute;
        z-index: 1;
        bottom: 125%; /* 上に表示 */
        left: 50%;
        margin-left: -110px; /* 中央寄せ */
        opacity: 0;
        transition: opacity 0.3s;
        font-size: 0.75rem;
        font-weight: normal;
        line-height: 1.4;
        box-shadow: 0 4px 6px rgba(0,0,0,0.3);
        border: 1px solid rgba(255,255,255,0.1);
    }
    .tooltip-text::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 50%;
        margin-left: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: #334155 transparent transparent transparent;
    }
    .tooltip-container:hover .tooltip-text {
        visibility: visible;
        opacity: 1;
    }

/* ====================================
   NEW ARRIVALS STYLES
   ==================================== */
    /* 新着エリアのスタイル */
    .new-arrival-section {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.05));
        border: 1px solid rgba(59, 130, 246, 0.2);
        padding: 16px;
        margin: 1rem auto 1rem;
        max-width: 640px;
        font-size: 0.8rem;
    }
    .new-arrival-title {
        font-size: 0.9rem;
        font-weight: 700;
        color: #60a5fa; /* 明るい青 */
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .new-stock-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        color: #e5e7eb;
        text-decoration: none;
    }
    /* ★ 6件目以降を隠すためのクラス */
    .new-stock-item.hidden-row {
        display: none;
    }
    .new-stock-item:last-child {
        border-bottom: none;
    }
    .new-stock-info {
        flex: 1;
    }
    .new-stock-name {
        font-weight: 600;
        margin-bottom: 4px;
        display: block;
    }
    .new-stock-date {
        font-size: 0.7rem;
        color: #94a3b8;
        margin-right: 8px;
    }
    /* タグ */
    .tag-mini {
        font-size: 0.6rem;
        padding: 1px 5px;
        border-radius: 3px;
        border: 1px solid;
        margin-right: 4px;
    }
    .tag-c { color: #34d399; border-color: #34d399; background: rgba(52,211,153,0.1); } /* 連続 */
    .tag-p { color: #38bdf8; border-color: #38bdf8; background: rgba(56,189,248,0.1); } /* 累進 */
    .tag-d { color: #f472b6; border-color: #f472b6; background: rgba(244,114,182,0.1); } /* DOE */


    /* 開閉ボタン */
    .accordion-toggle-btn {
        display: block;
        width: 100%;
        text-align: center;
        margin-top: 8px;
        color: #94a3b8;
        font-size: 0.8rem;
        background: transparent;
        border: none;
        cursor: pointer;
        transition: color 0.2s;
    }
    .accordion-toggle-btn:hover {
        color: #fff;
    }

/* ====================================
   SEARCH BOX STYLES
   ==================================== */
/* --- 検索ボックス周辺 --- */
    .search-container {
        position: relative;
        margin: 3rem auto 2rem; /* 上0、左右自動（中央）、下24px */
        width: 100%;
        max-width: 40rem;    /* PCでの最大幅を480pxに制限 */
    }

    .search-input-wrapper {
        position: relative;
        display: flex;
        align-items: center;
    }

    .search-icon {
        position: absolute;
        left: 14px;
        color: rgba(255, 255, 255, 0.5); /* 色を少し薄くして上品に */
        pointer-events: none;
        font-size: 0.85rem; /* アイコンサイズ縮小 */
    }

    .search-input {
        width: 100%;
        padding: 10px 12px 10px 38px; /* 上下パディングを少し減らす */
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 99px;
        color: #f1f5f9;
        font-size: 0.9rem; /* ★文字サイズを小さく */
        line-height: 1.5;
        outline: none;
        transition: all 0.2s ease;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .search-input::placeholder {
        color: rgba(255, 255, 255, 0.4);
        font-size: 0.85rem;
    }

    .search-input:focus {
        border-color: #38bdf8;
        background: rgba(255, 255, 255, 0.12);
        box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2); /* フォーカス時のリング */
    }

    /* --- 検索候補リスト --- */
    .search-results {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        background: #1e293b;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        z-index: 1000;
        max-height: 280px; /* 高さを少し抑える */
        overflow-y: auto;
        display: none;
        /* スクロールバー装飾（Chrome/Safari） */
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,0.2) transparent;
    }
    
    .search-results::-webkit-scrollbar {
        width: 6px;
    }
    .search-results::-webkit-scrollbar-thumb {
        background-color: rgba(255,255,255,0.2);
        border-radius: 3px;
    }

    .search-results.show {
        display: block;
        animation: fadeIn 0.15s ease-out;
    }

    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(-5px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .search-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 9px 14px; /* リストの間隔も少し詰め気味に */
        color: #e2e8f0;
        text-decoration: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        transition: background 0.1s;
        font-size: 0.9rem; /* リスト文字サイズ */
    }

    .search-item:last-child {
        border-bottom: none;
    }

    .search-item:hover {
        background: rgba(56, 189, 248, 0.15);
    }

    .search-item .code {
        font-size: 0.75rem; /* コードはさらに小さく */
        color: #94a3b8;
        background: rgba(255,255,255,0.08);
        padding: 2px 6px;
        border-radius: 4px;
        margin-right: 10px;
        font-family: monospace; /* 数字を見やすく */
    }

    .search-item .name {
        font-weight: 500;
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis; /* 長い名前は省略 */
    }

    .no-results {
        padding: 12px;
        text-align: center;
        color: #64748b;
        font-size: 0.85rem;
    }

/* heatmap styles */
    .heatmap-controls {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 10px;
        margin-bottom: 10px;
        scrollbar-width: none; /* Firefox */
    }
    .heatmap-controls::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .hm-btn {
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.1);
        color: #94a3b8;
        padding: 6px 12px;
        border-radius: 20px;
        font-size: 0.75rem;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.2s;
    }
    .hm-btn.active {
        background: #38bdf8;
        color: #0f172a;
        font-weight: bold;
        border-color: #38bdf8;
    }

    .heatmap-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.1rem;
    }

    .heatmap-cell {
        background: #1e293b;
        padding: 10px 8px;
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        border: 1px solid rgba(255,255,255,0.05);
        transition: transform 0.2s;
        position: relative;
        overflow: hidden;
    }
    .heatmap-cell:active {
        transform: scale(0.98);
    }

    /* 背景色のオーバーレイ */
    .heatmap-bg {
        position: absolute;
        top: 0; left: 0; width: 100%; height: 100%;
        opacity: 0.2; /* 基本の薄さ */
        z-index: 0;
        transition: background 0.3s;
    }

    .cell-name {
        font-size: 0.8rem;
        color: #e2e8f0;
        margin-bottom: 4px;
        z-index: 1;
        font-weight: 500;
        line-height: 1.2;
    }
    .cell-value {
        font-size: 0.9rem;
        font-weight: bold;
        color: #fff;
        z-index: 1;
    }
    .cell-unit {
        font-size: 0.65rem;
        font-weight: normal;
        margin-left: 1px;
        opacity: 0.8;
    }


/* 月別ボタン */
    .month-buttons {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 6px;
        margin-bottom: 12px;
    }
    .month-btn {
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.1);
        color: #e5e7eb;
        padding: 8px 0;
        border-radius: 6px;
        font-size: 0.8rem;
        cursor: pointer;
        transition: all 0.2s;
    }
    .month-btn:hover { background: rgba(255,255,255,0.1); }
    .month-btn.active {
        background: #38bdf8;
        color: #0f172a;
        font-weight: bold;
        border-color: #38bdf8;
    }


/* --- サイドメニュー拡張 --- */
.menu-nav li.has-submenu {
    position: relative;
}

.submenu-toggle {
    display: flex;
    justify-content: space-between; /* 矢印を右端に */
    align-items: center;
    cursor: pointer;
}

.submenu-toggle .arrow {
    transition: transform 0.3s;
    font-size: 0.8rem;
    color: #64748b;
}

/* 開いた状態 */
.menu-nav li.has-submenu.open .arrow {
    transform: rotate(90deg); /* 矢印を下向きに */
}

/* サブメニュー本体 */
.submenu {
    display: none; /* デフォルト非表示 */
    background: rgba(0, 0, 0, 0.2); /* 少し暗く */
    padding-left: 0;
}

.menu-nav li.has-submenu.open .submenu {
    display: block !important; /* 開いたら表示 */
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* サブメニューのリンク */
.submenu li a {
    padding: 10px 24px 10px 54px; /* インデント深め */
    font-size: 0.9rem;
    color: #d1d5db;
    border-left: none; /* 親のボーダーを消す */
}

.submenu li a:hover {
    color: #38bdf8;
    background: rgba(255,255,255,0.03);
}

/* =========================
   PAGE
========================= */
.stock-page, .stock-list-section {
    max-width: 640px;
    margin: auto;
    /*padding: 12px;*/
    background: transparent; /* ← body背景を殺さない */
}

.stock-list-section {
    margin-top: 2rem !important;
}

.title {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 16px;
}

/* =========================
   CARD COMMON
========================= */
.stock-card,
.graph-card,
.kpi {
    background: rgb(31 40 58);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* =========================
   STOCK CARD
========================= */
.stock-card {
    margin-bottom: 18px;
}

.stock-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.stock-title h1 {
    margin: 4px 0;
    font-size: 1.35rem;
}

.stock-code {
    font-size: 0.75rem;
    opacity: 0.7;
}

.industry {
    font-size: 0.75rem;
    background: #334155;
    padding: 2px 8px;
    border-radius: 999px;
}

.stock-price strong {
    font-size: 1.5rem;
}

/* =========================
   GRID ITEMS
========================= */
.stock-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.item {
    display: flex;
    align-items: center;
    background: rgb(0 0 0 / 23%);
    border-radius: 12px;
    padding: 0.5rem;
}

.fas {
    font-size: 1.3rem;
    margin-right: 0.5rem;
    color: #999798;
}

.item span {
    font-size: 0.75rem;
    color: var(--text-sub);
}

.item strong {
    display: block;
    font-size: 1.05rem;
}

/* =========================
   KPI
========================= */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.kpi {
    text-align: center;
}

.kpi span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-sub);
    margin-bottom: 4px;
}

.kpi strong {
    font-size: 1.1rem;
}

/* =========================
   COLORS
========================= */
.green { color: var(--accent-green); }
.red { color: var(--accent-red); }
/* ===== 評価カラー ===== */
.good { color: #34d399; }      /* 緑 */
.warn { color: #facc15; }      /* 黄 */
.bad  { color: #fb7185; }      /* 赤 */

/* ===== タグ ===== */
.tag {
    margin-left: 6px;
    padding: 0px 8px;
    font-size: 9px !important;
    border-radius: 999px;
}
.tag-small { background:#334155; color:#ffffff  !important; }
.tag-mid   { background:#2563eb; color:#ffffff  !important; }
.tag-large { background:#16a34a; color:#ffffff  !important; }

.tag-danger {
    background:#dc2626;
    color:#fff;
}

/* =========================
   GRAPH
========================= */
.graph-card {
    margin-top: 20px;
}

.graph-title {
    font-size: 0.9rem;
    color:#ffffff  !important;
    margin-bottom: 8px;
}

/* ★重要：Chart.js 無限縦伸び防止 */
.chart-wrap {
    position: relative;
    width: 100%;
    height: 280px;
}

canvas {
    width: 100% !important;
    height: 90% !important;
}

/* =========================
   META
========================= */
.update-time {
    margin-top: 12px;
    font-size: 0.7rem;
    opacity: 0.6;
    text-align: right;
}

/* =========================
   BADGE
========================= */
.badge-rank {
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    color: #020617;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}


/* =========================
   SECTION TITLE
========================= */
.section-title {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff96;
    margin: 0.5rem 0 0;
    padding-left: 6px;
    border-left: 0.5rem solid #595f5d;
}

.section-title.highlight {
    border-left-color: #b88c24;
    color: #b88c24;
}


/* =========================
   Score Section
========================= */

.score-section .section-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 総合スコア */
.total-score-card {
    background: linear-gradient(135deg, #1f2933, #111827);
    color: #fff;
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 1rem;
}

.total-score-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.total-score-value {
    font-size: 3rem;
    font-weight: bold;
    margin: 10px 0;
}

.total-score-value.excellent { color: #22c55e; }
.total-score-value.good      { color: #38bdf8; }
.total-score-value.normal    { color: #facc15; }

.total-score-rank {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* スコアカード */
.score-section{
    background: rgb(31 40 58);
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    margin-top: 1rem;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 2fr));
    gap: 0.7rem;
}

.score-card {
    background: #131b29;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.score-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    margin-bottom: 8px;
}

.score-header i {
    color: #2fc063;
}

.score-value {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

/* バー */
.score-bar {
    height: 8px;
    background: #000000;
    border-radius: 999px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2c4072, #25bec5);
}


/* =========================
   STOCK LIST (FINAL)
========================= */

/* 一覧全体 */
.stock-list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

/* 1銘柄＝1行 */
.stock-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    background: rgb(39 48 66);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0.45rem;
    color: #fff;
    text-decoration: none;
    transition: background .15s ease, transform .12s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stock-row:hover {
    background: #323844;
    transform: translateX(2px);
}

.stock-row:active {
    transform: scale(0.985);
}

.text-red {
    color: #ef4444; /* Tailwind red-500 */
    font-weight: 700;
}

.text-yellow {
    color: #facc15; /* Tailwind yellow-400 */
    font-weight: 700;
}
.text-green {
    color: #34d399; /* Tailwind green-400 */
    font-weight: 700;
}


/* =========================
   LEFT : BASIC INFO
========================= */
.col-basic {
    min-width: 9.5rem;
    max-width: 9.5rem;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.col-basic .name {
    font-weight: 700;
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-basic .code {
    font-size: 0.6rem;
    color: #9ca3af;
}

/* =========================
   CENTER : METRICS
========================= */
.col-metrics {
    display: flex;
    flex: 1;
    gap: 0.35rem;
    justify-content: space-between;
}

/* 各指標 */
.col-metrics .metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 2.8rem;
    font-size: 0.5rem;
    line-height: 1.05;
    opacity: 0.95;
}

.col-metrics .metric i {
    font-size: 0.65rem;
    margin: auto;
    margin-bottom: 0.1rem;
    opacity: 0.85;
    font-style: normal;   /* ← 超重要（斜体防止） */
    letter-spacing: 0.02em;
}

/* 数値 */
.col-metrics .metric strong {
    font-size: 0.7rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}




/* =========================
   METRIC COLORS (意味で判断)
========================= */
/*.metric.yield    strong { color: #38bdf8; }   /* 配当利回り */
.metric.per      strong { color: #e5e7eb; }
/*.metric.pbr      strong { color: #e5e7eb; }*/
/*.metric.payout   strong { color: #facc15; }   /* 配当性向 */
/*.metric.streak   strong { color: #34d399; }   /* 連続増配 */
/*.metric.progressive strong { color: #22c55e; }*/
.metric.fcf      strong { color: #60a5fa; }

/* =========================
   RIGHT : TAG (PC ONLY)
========================= */
.col-tag {
    font-size: 0.55rem;
    white-space: nowrap;
    color: #34d399;
}


/* ====================================
   LAYOUT (PC: 2 Columns, Mobile: 1 Column)
   ==================================== */

/* コンテンツ全体を包むラッパー */
.page-wrapper {
    max-width: 1200px; /* 全体の最大幅を広げる */
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 24px;
    justify-content: center;
}

/* メインコンテンツエリア */
.main-column {
    flex: 1;
    max-width: 640px; /* 記事部分の幅は維持 */
    min-width: 0; /* フレックスアイテムの縮小対策 */
}

/* サイドバー（PCのみ表示） */
.sidebar-column {
    width: 300px; /* アドセンスのレクタングル(300x250)に合わせる */
    flex-shrink: 0;
    display: none; /* デフォルト非表示（スマホ） */
}

/* PC以上でサイドバー表示 */
@media (min-width: 1000px) {
    .sidebar-column {
        display: none;
    }
}

/* アドセンス用プレースホルダー（スタイル確認用） */
.adsense-box {
    background: rgba(255,255,255,0.05);
    border: 1px dashed rgba(255,255,255,0.2);
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
}

/* 追従型広告（スクロールしてもついてくる） */
.sticky-ad {
    position: sticky;
    top: 80px; /* ヘッダーの高さ + 余白 */
}

/* =========================
   MOBILE OPTIMIZED
========================= */
@media (max-width: 600px) {

    /* 行を縦2段にせず、横密度を最大化 */
    .stock-row {
        padding: 0.4rem 0.45rem;
        gap: 0.35rem;
    }

    .col-basic {
        min-width: 6.8rem;
        max-width: 6.8rem;
    }

    .col-basic .name {
        font-size: 0.7rem;
    }

    .col-basic .code {
        font-size: 0.55rem;
    }

    .col-metrics {
        gap: 0.1rem;
    }

    .col-metrics .metric {
        min-width: 2.2rem;
        font-size: 0.45rem;
    }

    .col-metrics .metric i {
        font-size: 0.6rem;
    }

    .col-metrics .metric strong {
        font-size: 0.65rem;
    }

    /* タグは完全排除（情報密度優先） */
    .col-tag {
        display: none;
    }

    .search-container {
        max-width: 23rem;
    }

    .cell-name {
        font-size: 0.8rem;
    }

    .cell-value {
        font-size: 0.7rem;
    }

    .heatmap-grid{
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }

    .hm-btn{
        padding: 3px 6px;
        border-radius: 0.5rem;
    }

    .page-wrapper{
        padding: 0.85rem;
    }
}



/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
    .chart-wrap {
        height: 240px;
    }
    .item strong {
        display: block;
        font-size: 0.8rem;
    }
    .score-value {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }
    .score-header{
        font-size: 0.85rem;
    }
}

@media (max-width: 400px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    .kpi span {
        font-size: 0.6rem;
    }

    .kpi strong {
        font-size: 0.8rem;
    }
}
