    @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+JP:wght@300;400;500;600;700&display=swap');
    [x-cloak] { display: none !important; }

    /*
      閉じているスライドメニュー(.slide-menu-panel)は position:fixed のまま
      translateX(100%) で画面の右外に出しているが、これが文書のスクロール範囲を
      広げてしまい、全ページでスマホが横に41pxほどドラッグできる状態だった。

      overflow-x: hidden ではなく clip を使う。hidden はスクロールコンテナを
      作ってしまい、position:sticky のヘッダー(.site-header)が効かなくなるため。
    */
    html {
        overflow-x: clip;
    }

    body {
        font-family: 'Inter', 'Noto Sans JP', -apple-system, sans-serif;
        overflow-x: clip;
    }
    .btn-primary {
        background-color: #1b4332 !important;
    }
    .nav-link {
        color: #a3a3a3;
        transition: color 0.2s ease;
        border-bottom: 2px solid transparent;
        padding-bottom: 2px;
        /* 幅が足りないとき「マーケッ/ト」と語の途中で折り返していた。
           折り返さないことで、入らなければ気づける（黙って崩れない）。
           表示の切り替えは lg(1024px) 側で担保している。 */
        white-space: nowrap;
    }
    .nav-link:hover {
        color: #1b4332;
    }
    .nav-link.active {
        color: #1b4332;
        font-weight: 600;
        border-bottom-color: #1b4332;
    }
    /* 長い財務表を見ていても主要導線を失わないよう、共通ヘッダーを上端に固定する。 */
    .site-header {
        position: sticky;
        top: 0;
        z-index: 100;
    }
    /* ヘッダーのドロップダウン */
    .nav-dropdown-wrap { position: relative; }
    .nav-link-btn {
        background: none;
        border: none;
        border-bottom: 2px solid transparent;
        cursor: pointer;
        font-family: inherit;
    }
    .nav-dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        margin-top: 8px;
        min-width: 180px;
        background: #fff;
        border: 1px solid #ebebeb;
        border-radius: 10px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.08);
        padding: 6px;
        z-index: 60;
    }
    .nav-dropdown-item {
        display: flex;
        align-items: center;
        gap: 9px;
        padding: 8px 12px;
        font-size: 13px;
        color: #525252;
        text-decoration: none;
        border-radius: 7px;
        transition: all 0.15s;
        white-space: nowrap;
    }
    .nav-dropdown-item:hover { background: #f0fdf4; color: #1b4332; }
    .nav-dropdown-item i { font-size: 11px; color: #2d6a4f; width: 14px; text-align: center; }

    /* ボトムタブナビ（モバイル） */
    .bottom-tab-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 50;
        background: #fff;
        border-top: 1px solid #ebebeb;
        display: flex;
        justify-content: space-around;
        align-items: center;
        height: 56px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .bottom-tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        padding: 4px 0;
        color: #a3a3a3;
        text-decoration: none;
        font-size: 10px;
        font-weight: 500;
        transition: color 0.15s;
        -webkit-tap-highlight-color: transparent;
        border: none;
        background: none;
        cursor: pointer;
    }
    .bottom-tab-item.active {
        color: #1b4332;
    }
    /* 未読のバッジ（ホームの動き）。色は変数で呼ぶ（見た目を変えるときは --cn-badge-* だけ直す） */
    :root {
        --cn-badge-bg: #c62828;
        --cn-badge-fg: #ffffff;
    }
    .nav-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 9999px;
        background: var(--cn-badge-bg);
        color: var(--cn-badge-fg);
        font-size: 11px;
        font-weight: 700;
        line-height: 1;
        font-variant-numeric: tabular-nums;
    }
    .nav-badge[hidden] { display: none; }
    /* アカウント設定の中の、文字だけのボタン（カードの変更）。色は変数で呼ぶ */
    :root {
        --cn-link-btn-fg: #525252;
        --cn-link-btn-line: #ebebeb;
        --cn-link-btn-busy: #a3a3a3;
        --cn-link-error: #b91c1c;
    }
    .account-link-btn {
        font-size: 12px;
        color: var(--cn-link-btn-fg);
        background: none;
        border: none;
        border-bottom: 1px solid var(--cn-link-btn-line);
        padding: 0 0 1px;
        cursor: pointer;
    }
    .account-link-btn:disabled { color: var(--cn-link-btn-busy); cursor: not-allowed; }
    .account-link-error { font-size: 11px; line-height: 1.7; color: var(--cn-link-error); margin: 4px 0 0; }
    .account-link-error:empty { display: none; }
    .nav-link .nav-badge { margin-left: 6px; }
    .bottom-tab-item { position: relative; }
    .bottom-tab-item .nav-badge {
        position: absolute;
        top: 1px;
        left: calc(50% + 6px);
    }
    .bottom-tab-item i {
        font-size: 18px;
        margin-bottom: 2px;
    }
    /* ヘッダー右端のメニューボタン（モバイル） */
    .header-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin-right: -8px; /* 端に寄せる。タップ領域は40pxのまま保つ */
        color: #525252;
        background: none;
        border: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .header-menu-btn i { font-size: 18px; }
    /* スライドメニュー */
    .slide-menu-overlay {
        position: fixed;
        inset: 0;
        z-index: 70;
        background: rgba(0,0,0,0.4);
        transition: opacity 0.3s;
    }
    .slide-menu-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 80;
        width: 280px;
        max-width: 85vw;
        background: #fff;
        box-shadow: -4px 0 24px rgba(0,0,0,0.1);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .slide-menu-panel.open {
        transform: translateX(0);
    }
    .slide-menu-link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 20px;
        color: #525252;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        transition: background 0.15s;
    }
    .slide-menu-link:hover, .slide-menu-link:active {
        background: #fafaf8;
    }
    .slide-menu-link i {
        width: 18px;
        text-align: center;
        font-size: 13px;
        color: #737373;
    }
    /* モバイル時のボトムパディング */
    @media (max-width: 767px) {
        body {
            padding-bottom: 56px;
        }
    }

    /* ------------------------------------------------------------------
       スコアの色。判定は static/js/score-color.js が唯一の正。
       緑＝データが全部揃っていて、かつ点数が高い（＝総合評価）。
       点数が高くても判定できていない項目があれば provisional にする。
       provisional を medium と別の色にしているのは、
       「点数が中くらい」と「まだ分からない」を同じ色にすると読み違えるため。
       ------------------------------------------------------------------ */
    /* 会社の規模。判定は static/js/size-chip.js が唯一の正。
       ⚠️ 色を付けない。緑と赤はスコアとGC/DCで使っており、3つ目の意味を
          同じ色に載せると読み違いが起きる（適合度の色で一度やっている）。 */
    .size-chip {
        display: inline-block;
        margin-left: 6px;
        padding: 1px 6px;
        border: 1px solid #e5e5e5;
        border-radius: 4px;
        background: #fafaf8;
        color: #737373;
        font-size: 10.5px;
        font-weight: 500;
        letter-spacing: 0.02em;
        white-space: nowrap;
        vertical-align: 1px;
    }

    /* 運営のメモがある印。判定は static/js/note-mark.js が唯一の正。
       ⚠️ 緑・赤は使わない（スコアとGC/DCで埋まっている）。 */
    .note-mark {
        display: inline-block;
        margin-left: 6px;
        padding: 1px 7px;
        border: 1px solid #e8e0cc;
        border-radius: 4px;
        background: #fdfaf2;
        color: #8a7440;
        font-size: 10.5px;
        font-weight: 600;
        white-space: nowrap;
        vertical-align: 1px;
    }
    .note-mark i { margin-right: 4px; font-size: 9.5px; }

    .score-tone-high        { color: #15803d; font-weight: 600; }
    .score-tone-medium      { color: #a16207; font-weight: 600; }
    /* low（点数が低い）と provisional（まだ判定できていない）はどちらも灰系だが、
       provisional は青みのあるスレート、low は彩度のない灰にして色味で分ける。
       点線の下線も試したが、表の中でノイズになるのでやめた。 */
    .score-tone-low         { color: #b6bcc4; font-weight: 600; }
    .score-tone-provisional { color: #64748b; font-weight: 600; }
    .score-tone-none        { color: #cbd5e1; font-weight: 400; }

    /* ------------------------------------------------------------------
       会社名・銘柄コードの検索窓。どのページからでも銘柄ページへ飛べる。
       判定は static/js/company-search.js が唯一の正。
       ------------------------------------------------------------------ */
    .cs-wrap { position: relative; }
    .cs-input {
        width: 100%;
        height: 34px;
        padding: 0 12px 0 32px;
        font-size: 13px;
        color: #1a1a1a;
        background: #f7f7f5;
        border: 1px solid #ebebeb;
        border-radius: 8px;
        outline: none;
    }
    .cs-input::placeholder { color: #a3a3a3; }
    .cs-input:focus { border-color: #1b4332; background: #fff; }
    .cs-icon {
        position: absolute;
        left: 11px; top: 50%;
        transform: translateY(-50%);
        font-size: 12px;
        color: #a3a3a3;
        pointer-events: none;
    }
    .cs-list {
        display: none;
        position: absolute;
        top: calc(100% + 4px); left: 0; right: 0;
        max-height: 320px;
        overflow-y: auto;
        background: #fff;
        border: 1px solid #ebebeb;
        border-radius: 8px;
        box-shadow: 0 6px 20px rgba(0,0,0,0.08);
        z-index: 60;
        padding: 4px;
    }
    .cs-item {
        display: flex;
        align-items: baseline;
        gap: 10px;
        width: 100%;
        padding: 7px 10px;
        border: none;
        background: none;
        border-radius: 6px;
        cursor: pointer;
        text-align: left;
        font-size: 13px;
    }
    .cs-item:hover, .cs-item.is-active { background: #f1f5f2; }
    .cs-code {
        font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
        font-size: 12px;
        font-weight: 600;
        color: #1b4332;
        flex: 0 0 auto;
        min-width: 38px;
    }
    .cs-name {
        color: #1a1a1a;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* スマホは下タブから全画面で開く。ヘッダーに窓を置く幅が無いため。 */
    .cs-sheet {
        display: none;
        position: fixed;
        inset: 0;
        background: #fff;
        z-index: 200;
        padding: 14px 16px;
    }
    .cs-sheet.is-open { display: block; }
    .cs-sheet-head {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
    }
    .cs-sheet-head .cs-wrap { flex: 1 1 auto; }
    .cs-sheet-close {
        flex: 0 0 auto;
        border: none;
        background: none;
        font-size: 14px;
        color: #525252;
        padding: 6px 4px;
        cursor: pointer;
    }
    .cs-sheet .cs-list {
        position: static;
        max-height: none;
        border: none;
        box-shadow: none;
        padding: 0;
    }
    .cs-sheet .cs-item { padding: 11px 8px; border-bottom: 1px solid #f4f4f2; border-radius: 0; }
    .cs-sheet-hint { font-size: 12px; color: #a3a3a3; margin-top: 4px; }

    /* 配当利回りが実績に落ちたときの印。判定は static/js/dividend-basis.js が唯一の正。
       主役は予想なので、予想には印を付けず、例外（実績）にだけ付ける。 */
    .div-basis-mark {
        display: inline-block;
        margin-left: 3px;
        padding: 0 3px;
        font-size: 0.6rem;
        line-height: 1.4;
        vertical-align: top;
        color: #64748b;
        background: #f1f5f9;
        border-radius: 3px;
        font-weight: 600;
    }
