:root {
            --bg: #0f172a;
            --bg-card: #1e293b;
            --bg-hover: #334155;
            --accent: #38bdf8;
            --accent-dim: #0ea5e9;
            --text: #e2e8f0;
            --text-dim: #94a3b8;
            --success: #22c55e;
            --danger: #ef4444;
            --warning: #f59e0b;
            --border: #334155;
            --radius: 12px;
        }
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: 'Inter', 'Segoe UI', sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100vh;
        }
        .header {
            background: linear-gradient(135deg, #1e293b, #0f172a);
            border-bottom: 1px solid var(--border);
            padding: 16px 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
        }
        .header h1 {
            font-size: 20px;
            font-weight: 700;
            background: linear-gradient(135deg, var(--accent), #a78bfa);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        .header .user-info {
            font-size: 13px;
            color: var(--text-dim);
        }
        .header > div {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 10px;
            flex-wrap: wrap;
        }
        .container {
            width: 100%;
            max-width: none;
            margin: 0;
            padding: 24px 32px;
        }
        @media (min-width: 1600px) { .container { padding: 32px 48px; } }
        @media (max-width: 768px) { .container { padding: 16px; } }

        /* ログイン画面 */
        #loginSection {
            display: flex; align-items: center; justify-content: center;
            min-height: 80vh; text-align: center;
        }
        .login-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 48px;
        }
        .login-card h2 { margin-bottom: 8px; font-size: 24px; }
        .login-card p { color: var(--text-dim); margin-bottom: 24px; }
        .btn {
            display: inline-flex; align-items: center; gap: 8px;
            padding: 10px 20px;
            border: none; border-radius: 8px;
            font-size: 14px; font-weight: 600;
            cursor: pointer; transition: all 0.2s;
        }
        .btn-primary {
            background: var(--accent); color: #0f172a;
        }
        .btn-primary:hover { background: var(--accent-dim); }
        .btn-danger { background: var(--danger); color: white; }
        .btn-danger:hover { opacity: 0.9; }
        .btn-sm { padding: 6px 12px; font-size: 12px; }
        .btn-xs { padding: 4px 8px; font-size: 11px; }
        /* 20260508: 価格元セルの「自動反映」ボタン — btn-sm の形を維持しつつ、削除ボタン (btn-danger) と区別するため白背景・黒文字。
           余白は狭め (左右 8px) で視認性確保。 */
        .pricing-source-cell button.reset-to-auto {
            background: #f3f4f6;
            color: #111827;
            border: 1px solid var(--border);
            padding: 6px 8px;
            font-size: 12px;
        }
        .pricing-source-cell button.reset-to-auto:hover {
            background: #ffffff;
            border-color: var(--accent);
        }

        /* 統計カード */
        .stats {
            display: grid;
            grid-template-columns: repeat(4, minmax(220px, 1fr));
            gap: 16px;
            margin-bottom: 4px;
            max-width: 1400px;
        }
        @media (max-width: 1300px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
        @media (max-width: 700px) { .stats { grid-template-columns: 1fr; } }
        .stat-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 20px;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
            align-items: start;
        }
        .stat-cell { min-width: 0; }
        .stat-cell .label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .stat-cell .value { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.15; }
        .stat-cell .value.accent { color: var(--accent); }
        .stat-cell .value.success { color: var(--success); }
        .stat-cell .value.warning { color: var(--warning); }
        .stat-cell .value.forecast { color: #a78bfa; }
        /* 20260508: 統合ヘッダー (sticky 追従)。
           計画書: docs/計画書/202605/20260508/20260508_admin画面ページタブ化(実装計画書).md */
        .admin-header {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            grid-template-areas:
                "brand user"
                "tabs tabs";
            align-items: center;
            gap: 8px 16px;
            padding: 8px 16px;
            background: var(--bg);
            border-bottom: 1px solid var(--border);
            position: sticky;
            top: 0;
            z-index: 110;
        }
        .admin-header-brand {
            font-size: 16px;
            font-weight: 700;
            color: var(--text);
            grid-area: brand;
            flex-shrink: 0;
            white-space: nowrap;
        }
        .admin-page-tabs {
            display: flex;
            gap: 4px;
            grid-area: tabs;
            flex-wrap: wrap;
            row-gap: 6px;
            min-width: 0;
            overflow: visible;
        }
        .admin-page-tab {
            border: 1px solid transparent;
            background: transparent;
            color: var(--text-dim);
            cursor: pointer;
            font-size: 13px;
            font-weight: 700;
            padding: 7px 12px;
            border-radius: 6px;
            white-space: nowrap;
        }
        .admin-page-tab:hover {
            color: var(--text);
            background: rgba(56, 189, 248, 0.06);
        }
        .admin-page-tab.active {
            color: var(--accent);
            background: rgba(56, 189, 248, 0.14);
            border-color: var(--accent);
        }
        .admin-header-user {
            display: flex;
            align-items: center;
            gap: 12px;
            grid-area: user;
            flex-shrink: 0;
        }
        .admin-page.hidden {
            display: none !important;
        }
        .fx-footer {
            font-size: 11px;
            color: var(--text-dim);
            margin-bottom: 20px;
        }
        .fx-footer.warning { color: var(--warning); }

        /* 設定パネル */
        .settings-panel {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 20px;
            margin-bottom: 24px;
            display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
        }
        .settings-panel label { font-size: 13px; color: var(--text-dim); }
        .settings-panel input[type="number"] {
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text);
            padding: 8px 12px;
            width: 100px;
            font-size: 14px;
        }
        .settings-grid {
            display: grid;
            grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.4fr);
            gap: 20px;
            width: 100%;
            align-items: start;
        }
        .settings-limits,
        .analytics-summary {
            min-width: 0;
        }
        .analytics-summary {
            border-left: 1px solid var(--border);
            padding-left: 20px;
        }
        .settings-limits .limit-row {
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
            margin-bottom: 14px;
        }
        .settings-limits .limit-subheading {
            font-size: 13px;
            font-weight: 700;
            color: var(--text);
            margin: 0 0 8px;
        }
        .settings-limits .limit-input-subheading {
            margin-top: 16px;
        }
        .settings-limits .limit-help {
            color: var(--text-dim);
            font-size: 12px;
            line-height: 1.5;
            margin: 0 0 12px;
        }
        .settings-limits .limit-help-line {
            display: block;
        }
        .settings-limits .limit-help-line + .limit-help-line {
            margin-top: 2px;
        }
        .settings-limits .limit-plan-table-wrap {
            overflow-x: auto;
            width: 100%;
        }
        .settings-limits .limit-plan-table {
            border-collapse: collapse;
            min-width: 760px;
            width: 100%;
        }
        .settings-limits .limit-plan-table th,
        .settings-limits .limit-plan-table td {
            border-bottom: 1px solid var(--border);
            padding: 8px 10px;
            text-align: left;
            vertical-align: middle;
        }
        .settings-limits .limit-plan-table thead th {
            color: var(--text);
            font-size: 12px;
            font-weight: 700;
        }
        .settings-limits .limit-plan-table tbody th {
            color: var(--text-dim);
            font-size: 12px;
            font-weight: 600;
            width: 220px;
        }
        .settings-limits .limit-plan-enabled {
            align-items: center;
            color: var(--text);
            display: inline-flex;
            font-size: 12px;
            font-weight: 600;
            gap: 6px;
        }
        .settings-limits .limit-field {
            min-width: 260px;
        }
        .settings-limits .limit-field label,
        .settings-limits .mode-limit-field label {
            display: block;
            font-size: 12px;
            color: var(--text-dim);
            font-weight: 600;
            margin-bottom: 4px;
        }
        .settings-limits .limit-input-row {
            margin-bottom: 14px;
        }
        .settings-limits .limit-inline-field {
            align-items: center;
            display: inline-flex;
            flex-wrap: wrap;
            gap: 12px;
            min-width: 0;
        }
        .settings-limits .limit-inline-field label {
            margin-bottom: 0;
        }
        .settings-limits .mode-limit-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
            gap: 12px;
            width: 100%;
        }
        .settings-limits .mode-limit-inputs {
            display: flex;
            gap: 4px;
            align-items: center;
        }
        .settings-limits .limit-plan-inputs {
            align-items: center;
            display: flex;
            gap: 4px;
            white-space: nowrap;
        }
        /* 20260508: ページタブ化後、上限設定は .settings-panel の外に出たため、
           単価設定など他の入力欄と同じ dark input chrome をここで明示する。 */
        .settings-limits input[type="number"] {
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text);
            padding: 6px 8px;
            width: 100px;
            font-size: 12px;
        }
        .settings-limits .mode-limit-inputs input {
            width: 100px;
        }
        .settings-limits .limit-plan-inputs input {
            width: 92px;
        }
        .settings-limits .override-status {
            color: var(--success);
        }
        @media (max-width: 1100px) {
            .settings-grid { grid-template-columns: 1fr; }
            .analytics-summary {
                border-left: none;
                border-top: 1px solid var(--border);
                padding-left: 0;
                padding-top: 16px;
            }
        }

        /* コスト分析 */
        .analytics-summary h3,
        .analytics-section h3 {
            font-size: 16px;
            margin-bottom: 12px;
        }
        .dashboard-fixed-summary-header,
        .analytics-summary h3,
        .analytics-section-header h3 {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }
        .dashboard-fixed-summary-header {
            margin-bottom: 12px;
        }
        .dashboard-fixed-summary-header h3 {
            font-size: 16px;
            margin: 0;
        }
        .dashboard-fixed-summary-header .period-note,
        .users-period-note {
            color: var(--text-dim);
            font-size: 12px;
            line-height: 1.5;
        }
        .analytics-range-bar {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 14px 16px;
            margin-bottom: 18px;
        }
        .analytics-range-head {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
            margin-bottom: 10px;
        }
        .analytics-range-title {
            color: var(--text);
            font-size: 14px;
            font-weight: 800;
        }
        .analytics-range-current,
        .analytics-range-inline {
            border: 1px solid rgba(56, 189, 248, 0.45);
            border-radius: 999px;
            background: rgba(56, 189, 248, 0.12);
            color: var(--accent);
            font-size: 12px;
            font-weight: 700;
            padding: 4px 9px;
        }
        .analytics-range-inline {
            display: inline-flex;
            align-items: center;
            margin-left: 2px;
        }
        .analytics-range-scope {
            color: var(--text-dim);
            font-size: 12px;
        }
        .analytics-inline-reload {
            font-size: 12px;
            min-height: 28px;
            padding: 4px 10px;
            white-space: nowrap;
        }
        .range-tabs {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 12px;
        }
        .analytics-range-bar .range-tabs {
            margin-bottom: 0;
        }
        .range-tab,
        .analytics-tab {
            border: 1px solid var(--border);
            border-radius: 8px;
            background: rgba(15, 23, 42, 0.72);
            color: var(--text-dim);
            cursor: pointer;
            font-size: 12px;
            font-weight: 700;
            padding: 8px 12px;
            transition: all 0.2s;
        }
        .range-tab:hover,
        .analytics-tab:hover {
            border-color: var(--accent);
            color: var(--text);
        }
        .range-tab.active,
        .analytics-tab.active {
            background: rgba(56, 189, 248, 0.14);
            border-color: var(--accent);
            color: var(--accent);
        }
        /* 20260508: カスタム期間 (案 B) — 開始日・終了日 input と適用ボタンを横並び */
        .range-tab-custom {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-left: 4px;
        }
        .range-date-input {
            background: rgba(15, 23, 42, 0.72);
            color: var(--text);
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 6px 8px;
            font-size: 12px;
            font-family: inherit;
        }
        input[type="date"]::-webkit-calendar-picker-indicator {
            cursor: pointer;
            filter: invert(79%) sepia(14%) saturate(476%) hue-rotate(181deg) brightness(93%) contrast(90%);
            opacity: 0.88;
        }
        input[type="date"]:hover::-webkit-calendar-picker-indicator,
        input[type="date"]:focus::-webkit-calendar-picker-indicator {
            filter: invert(73%) sepia(89%) saturate(1120%) hue-rotate(163deg) brightness(102%) contrast(102%);
            opacity: 1;
        }
        .range-date-input:focus {
            border-color: var(--accent);
            outline: none;
        }
        .range-date-sep {
            color: var(--text-dim);
            font-size: 12px;
        }
        .per-user-avg-section {
            margin-top: 14px;
            padding: 12px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: rgba(15, 23, 42, 0.4);
        }
        .per-user-avg-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 8px;
        }
        .per-user-avg-header h4 {
            margin: 0;
            font-size: 13px;
            font-weight: 700;
            color: var(--text);
        }
        .per-user-metric-tabs {
            display: flex;
            gap: 6px;
        }
        .per-user-metric-tab {
            border: 1px solid var(--border);
            border-radius: 6px;
            background: rgba(15, 23, 42, 0.72);
            color: var(--text-dim);
            cursor: pointer;
            font-size: 11px;
            font-weight: 700;
            padding: 5px 10px;
            transition: all 0.2s;
        }
        .per-user-metric-tab:hover {
            border-color: var(--accent);
            color: var(--text);
        }
        .per-user-metric-tab.active {
            background: rgba(56, 189, 248, 0.14);
            border-color: var(--accent);
            color: var(--accent);
        }
        .kpi-per-user {
            color: var(--accent) !important;
            font-weight: 700;
        }
        .analytics-kpis {
            display: grid;
            grid-template-columns: repeat(5, minmax(0, 1fr));
            gap: 10px;
        }
        @media (max-width: 1200px) {
            .analytics-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        }
        @media (max-width: 900px) {
            .analytics-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        }
        .analytics-kpi {
            border: 1px solid var(--border);
            border-radius: 8px;
            background: rgba(15, 23, 42, 0.54);
            padding: 12px;
            min-width: 0;
        }
        .analytics-kpi .kpi-title {
            align-items: center;
            color: var(--text-dim);
            display: flex;
            font-size: 12px;
            font-weight: 700;
            gap: 6px;
            margin-bottom: 8px;
        }
        .analytics-kpi .kpi-dot {
            border-radius: 999px;
            display: inline-block;
            height: 9px;
            width: 9px;
        }
        .analytics-kpi .kpi-cost {
            color: var(--text);
            font-size: 18px;
            font-variant-numeric: tabular-nums;
            font-weight: 800;
            line-height: 1.2;
            overflow-wrap: anywhere;
        }
        .analytics-kpi .kpi-meta {
            color: var(--text-dim);
            display: grid;
            font-size: 11px;
            gap: 2px;
            margin-top: 8px;
        }
        .analytics-kpi .kpi-unit-meta {
            font-size: 12px;
            font-weight: 700;
        }
        .analytics-kpi .kpi-meta span {
            overflow-wrap: anywhere;
        }
        .history-cache-kpis {
            margin-bottom: 14px;
        }
        .history-cache-chart-card {
            margin-bottom: 14px;
        }
        .history-cache-chart-grid {
            display: grid;
            gap: 14px;
            grid-template-columns: repeat(2, minmax(260px, 1fr));
        }
        @media (max-width: 900px) {
            .history-cache-chart-grid { grid-template-columns: 1fr; }
        }
        .history-cache-chart-title {
            color: var(--text);
            font-size: 12px;
            font-weight: 700;
            margin-bottom: 4px;
        }
        .history-cache-chart {
            min-height: 220px;
        }
        .history-cache-chart .apexcharts-tooltip,
        .history-cache-chart .apexcharts-tooltip.apexcharts-theme-light,
        .history-cache-chart .apexcharts-tooltip.apexcharts-theme-dark {
            background: #0f172a !important;
            border: 1px solid var(--border) !important;
            box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35) !important;
            color: var(--text) !important;
        }
        .history-cache-chart .apexcharts-tooltip-title {
            background: #1e293b !important;
            border-bottom: 1px solid var(--border) !important;
            color: var(--text) !important;
        }
        .history-cache-chart .apexcharts-tooltip-text,
        .history-cache-chart .apexcharts-tooltip-y-group,
        .history-cache-chart .apexcharts-tooltip-series-group,
        .history-cache-chart .apexcharts-tooltip-text-y-label,
        .history-cache-chart .apexcharts-tooltip-text-y-value {
            color: var(--text) !important;
        }
        .analytics-alert {
            background: rgba(245, 158, 11, 0.12);
            border: 1px solid rgba(245, 158, 11, 0.42);
            border-radius: 8px;
            color: var(--warning);
            display: none;
            font-size: 12px;
            margin-top: 10px;
            padding: 8px 10px;
        }
        .analytics-status {
            color: var(--text-dim);
            font-size: 12px;
            min-height: 18px;
        }
        .analytics-section {
            margin-top: 18px;
            margin-bottom: 24px;
        }
        .analytics-section-header {
            align-items: flex-start;
            display: flex;
            gap: 12px;
            justify-content: space-between;
            margin-bottom: 12px;
            padding: 0 2px;
            flex-wrap: wrap;
        }
        .analytics-section-header h3 {
            margin-bottom: 8px;
        }
        .analytics-toolbar {
            align-items: center;
            display: flex;
            gap: 12px;
            justify-content: space-between;
            margin-bottom: 14px;
            flex-wrap: wrap;
        }
        .analytics-tabs {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 0;
        }
        .analytics-grid {
            display: grid;
            grid-template-columns: minmax(280px, 0.92fr) minmax(360px, 1.08fr);
            gap: 14px;
            margin-bottom: 14px;
        }
        .analytics-unit-overview-grid {
            grid-template-columns: repeat(2, minmax(280px, 1fr));
        }
        @media (max-width: 1100px) {
            .analytics-grid { grid-template-columns: 1fr; }
        }
        .analytics-chart-card {
            border: 1px solid var(--border);
            border-radius: 8px;
            background: rgba(15, 23, 42, 0.38);
            padding: 12px 14px;
            min-width: 0;
        }
        .analytics-chart-card h4 {
            color: var(--text-dim);
            font-size: 13px;
            margin-bottom: 10px;
        }
        .model-cost-controls {
            align-items: flex-end;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 12px;
        }
        .model-cost-control {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .model-cost-control label,
        .model-cost-check {
            color: var(--text-dim);
            font-size: 11px;
            font-weight: 700;
        }
        .model-cost-control select,
        .model-cost-control input,
        .api-log-date-input,
        .model-cost-search {
            background: rgba(15, 23, 42, 0.72);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text);
            font-family: inherit;
            font-size: 12px;
            min-height: 32px;
            padding: 6px 8px;
        }
        .model-cost-search {
            min-width: 220px;
        }
        .history-cache-search-control {
            flex: 1 1 520px;
            max-width: 760px;
            min-width: 360px;
        }
        .history-cache-search-input {
            width: 100%;
        }
        .api-log-controls {
            align-items: stretch;
            display: grid;
            grid-template-columns: minmax(560px, 0.9fr) minmax(640px, 1.1fr);
        }
        .api-log-control-group {
            align-content: flex-start;
            align-items: flex-end;
            background: rgba(255, 255, 255, 0.025);
            border: 1px solid var(--border);
            border-radius: 8px;
            display: flex;
            flex-wrap: wrap;
            gap: 10px 12px;
            min-width: 0;
            padding: 12px 14px;
        }
        .api-log-control-group-title,
        .api-log-control-note {
            flex-basis: 100%;
        }
        .api-log-control-group-title {
            color: var(--text);
            font-size: 11px;
            font-weight: 800;
        }
        .api-log-control-note {
            color: var(--text-dim);
            font-size: 11px;
            line-height: 1.35;
        }
        .api-log-date-input {
            min-width: 180px;
        }
        .api-log-custom-range {
            align-items: flex-end;
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .api-log-fetch-row {
            align-items: flex-end;
            display: flex;
            flex-wrap: wrap;
            gap: 10px 12px;
            width: 100%;
        }
        .api-log-reload-button {
            align-self: flex-end;
            margin-left: auto;
        }
        .api-log-search-group .model-cost-control {
            flex: 1 1 320px;
            min-width: 260px;
        }
        .api-log-search-group .model-cost-search {
            width: 100%;
        }
        @media (max-width: 1280px) {
            .api-log-controls {
                grid-template-columns: 1fr;
            }
            .api-log-reload-button {
                margin-left: 0;
            }
        }
        .api-log-table {
            min-width: 1780px;
        }
        .history-cache-table {
            min-width: 2575px;
            table-layout: fixed;
        }
        .history-cache-table col.history-cache-col-date { width: 130px; }
        .history-cache-table col.history-cache-col-user { width: 90px; }
        .history-cache-table col.history-cache-col-doc-id { width: 190px; }
        .history-cache-table col.history-cache-col-lookup-length { width: 92px; }
        .history-cache-table col.history-cache-col-text { width: 430px; }
        .history-cache-table col.history-cache-col-lengths { width: 85px; }
        .history-cache-table col.history-cache-col-actions { width: 150px; }
        .api-log-cell-pre {
            font-family: 'Consolas', 'Courier New', monospace;
            font-size: 11px;
            line-height: 1.45;
            margin: 0;
            max-height: 110px;
            max-width: 360px;
            overflow: auto;
            white-space: pre-wrap;
            word-break: break-word;
        }
        .history-cache-table .api-log-cell-pre {
            max-height: 170px;
            max-width: none;
            width: 100%;
        }
        .history-cache-id-cell code {
            display: block;
            font-size: 11px;
            line-height: 1.35;
            max-width: 100%;
            overflow-wrap: anywhere;
            white-space: normal;
            word-break: break-all;
        }
        .history-cache-id-wrap {
            align-items: flex-start;
            display: flex;
            flex-direction: column;
            gap: 6px;
            min-width: 0;
        }
        .history-cache-copy-button {
            align-self: flex-start;
            padding-inline: 7px;
        }
        .history-cache-date-cell,
        .history-cache-lookup-length-cell,
        .history-cache-lengths-cell,
        .history-cache-actions-cell {
            overflow-wrap: anywhere;
        }
        .history-cache-text-cell {
            min-width: 0;
        }
        .history-cache-text-copy-wrap {
            align-items: flex-start;
            display: flex;
            flex-direction: column;
            gap: 6px;
            min-width: 0;
        }
        .history-cache-no-correction {
            align-items: flex-start;
            display: flex;
            flex-direction: column;
            gap: 6px;
            min-width: 0;
        }
        .history-cache-no-correction-badge {
            background: rgba(34, 197, 94, 0.14);
            border: 1px solid rgba(34, 197, 94, 0.46);
            border-radius: 999px;
            color: #bbf7d0;
            display: inline-flex;
            font-size: 11px;
            font-weight: 800;
            line-height: 1;
            padding: 5px 9px;
            white-space: nowrap;
        }
        .history-cache-no-correction-note {
            color: var(--text-dim);
            font-size: 11px;
            line-height: 1.35;
            overflow-wrap: anywhere;
        }
        .history-cache-row-editing {
            background: rgba(56, 189, 248, 0.06);
        }
        .history-cache-edit-textarea {
            background: var(--bg);
            border: 1px solid var(--accent);
            border-radius: 6px;
            color: var(--text);
            font-family: 'Consolas', 'Courier New', monospace;
            font-size: 11px;
            line-height: 1.45;
            max-width: 100%;
            min-height: 92px;
            min-width: 0;
            padding: 7px 8px;
            resize: vertical;
            width: 100%;
        }
        .history-cache-row-actions {
            align-items: center;
            display: flex;
            gap: 6px;
            min-width: 150px;
            white-space: nowrap;
        }
        .api-log-header-cell {
            user-select: none;
        }
        .api-log-header-content {
            align-items: center;
            display: inline-flex;
            gap: 4px;
            max-width: calc(100% - 6px);
            min-width: 0;
        }
        .api-log-header-filter,
        .api-log-header-sort,
        .api-log-header-label {
            align-items: center;
            background: transparent;
            border: 0;
            color: inherit;
            display: inline-flex;
            font: inherit;
            gap: 4px;
            min-width: 0;
            padding: 0;
        }
        .api-log-header-filter {
            cursor: pointer;
            overflow: hidden;
            text-align: left;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .api-log-header-filter:hover,
        .api-log-header-filter.is-active {
            color: var(--text);
        }
        .api-log-header-sort {
            border-radius: 4px;
            cursor: pointer;
            flex: 0 0 auto;
            font-size: 10px;
            justify-content: center;
            min-height: 18px;
            min-width: 18px;
            opacity: 0.7;
        }
        .api-log-header-sort:hover {
            background: rgba(255, 255, 255, 0.06);
            opacity: 1;
        }
        .api-log-filter-count {
            background: rgba(99, 179, 237, 0.16);
            border: 1px solid rgba(99, 179, 237, 0.28);
            border-radius: 999px;
            color: var(--accent);
            flex: 0 0 auto;
            font-size: 10px;
            font-weight: 800;
            line-height: 1;
            padding: 2px 5px;
            text-transform: none;
        }
        .api-log-clear-filters {
            min-height: 32px;
        }
        .api-log-filter-popover {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 8px;
            box-shadow: var(--shadow);
            color: var(--text);
            max-height: min(460px, calc(100vh - 32px));
            overflow: hidden;
            padding: 10px;
            position: absolute;
            width: 320px;
            z-index: 1000;
        }
        .api-log-filter-popover-head {
            align-items: center;
            display: flex;
            justify-content: space-between;
            gap: 8px;
        }
        .api-log-filter-close {
            background: transparent;
            border: 0;
            color: var(--text-dim);
            cursor: pointer;
            font: inherit;
            font-size: 11px;
            font-weight: 700;
            padding: 2px 4px;
        }
        .api-log-filter-close:hover {
            color: var(--text);
        }
        .api-log-filter-popover-summary {
            color: var(--text-dim);
            font-size: 11px;
            margin-top: 4px;
        }
        .api-log-filter-actions {
            display: flex;
            gap: 6px;
            margin-top: 8px;
        }
        .api-log-filter-search {
            background: rgba(15, 23, 42, 0.72);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text);
            font-family: inherit;
            font-size: 12px;
            margin-top: 8px;
            min-height: 30px;
            padding: 6px 8px;
            width: 100%;
        }
        .api-log-filter-option-list {
            display: grid;
            gap: 4px;
            margin-top: 8px;
            max-height: 260px;
            overflow: auto;
            padding-right: 2px;
        }
        .api-log-filter-option {
            align-items: center;
            border-radius: 6px;
            color: var(--text);
            cursor: pointer;
            display: flex;
            gap: 7px;
            min-height: 26px;
            padding: 4px 5px;
        }
        .api-log-filter-option:hover {
            background: rgba(255, 255, 255, 0.04);
        }
        .api-log-filter-option span {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .api-log-filter-option input {
            accent-color: var(--accent);
            flex: 0 0 auto;
        }
        .api-log-filter-empty {
            color: var(--text-dim);
            font-size: 12px;
            padding: 10px 4px;
        }
        .api-log-table .mono {
            font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
            font-size: 11px;
        }
        .api-log-status-badge {
            border-radius: 999px;
            display: inline-flex;
            font-size: 11px;
            font-weight: 700;
            padding: 2px 8px;
            white-space: nowrap;
        }
        .api-log-status-success {
            background: rgba(16, 185, 129, 0.15);
            color: #34d399;
        }
        .api-log-status-error,
        .api-log-status-timeout,
        .api-log-status-rejected,
        .api-log-status-cancelled {
            background: rgba(239, 68, 68, 0.14);
            color: #f87171;
        }
        .api-log-detail {
            color: var(--text-dim);
            font-size: 11px;
            line-height: 1.35;
            margin-top: 2px;
            overflow-wrap: anywhere;
        }
        .model-cost-column-menu {
            position: relative;
        }
        .model-cost-column-menu summary {
            border: 1px solid var(--border);
            border-radius: 6px;
            background: rgba(15, 23, 42, 0.72);
            color: var(--text-dim);
            cursor: pointer;
            font-size: 12px;
            font-weight: 700;
            list-style: none;
            min-height: 32px;
            min-width: 128px;
            padding: 7px 10px;
        }
        .model-cost-column-menu summary::-webkit-details-marker {
            display: none;
        }
        .model-cost-column-menu[open] summary,
        .model-cost-column-menu summary:hover {
            border-color: var(--accent);
            color: var(--text);
        }
        .model-cost-column-list {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 8px;
            box-shadow: var(--shadow);
            display: grid;
            gap: 6px;
            left: 0;
            max-height: 320px;
            min-width: 210px;
            overflow: auto;
            padding: 10px;
            position: absolute;
            top: calc(100% + 6px);
            z-index: 20;
        }
        .model-cost-column-option,
        .model-cost-check {
            align-items: center;
            display: inline-flex;
            gap: 6px;
            min-height: 24px;
            white-space: nowrap;
        }
        .model-cost-column-option input,
        .model-cost-check input {
            accent-color: var(--accent);
        }
        .model-cost-column-option input:disabled + span {
            opacity: 0.62;
        }
        .model-cost-filter-summary {
            color: var(--text-dim);
            font-size: 12px;
            min-height: 32px;
            padding: 8px 2px 0;
        }
        .model-cost-pricing-row td {
            cursor: help;
        }
        .analytics-chart {
            min-height: 230px;
            overflow: visible;
        }
        .analytics-chart.timeline-main {
            min-height: 280px;
        }
        .analytics-chart.timeline-brush {
            min-height: 92px;
        }
        .analytics-chart.is-empty-chart {
            min-height: 140px;
        }
        .analytics-chart.timeline-main.is-empty-chart {
            min-height: 140px;
        }
        .analytics-chart.timeline-brush.is-empty-chart {
            min-height: 0;
        }
        .analytics-chart.is-empty-chart .analytics-empty {
            min-height: 140px;
        }
        .analytics-unit-kpis {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
            gap: 8px;
        }
        .analytics-empty {
            align-items: center;
            color: var(--text-dim);
            display: flex;
            font-size: 13px;
            justify-content: center;
            min-height: 160px;
            padding: 20px;
            text-align: center;
        }
        .analytics-note {
            color: var(--text-dim);
            font-size: 13px;
            line-height: 1.65;
            padding: 14px 2px;
        }
        .analytics-table {
            font-size: 12px;
            table-layout: fixed;
        }
        /* 列幅マウスリサイズ機構 (analytics-table / users-table / pricing-table 共通)。
           th 末尾以外の右端に 6px のハンドルを動的差込し、mousedown→drag で width を更新。
           localStorage に table id 別で永続化 (キー: adminColWidth:{tableId})。 */
        table.js-resizable-cols {
            table-layout: fixed;
        }
        table.js-resizable-cols th {
            position: relative;
        }
        .col-resizer {
            position: absolute;
            top: 0;
            right: 0;
            width: 6px;
            height: 100%;
            cursor: col-resize;
            -webkit-user-select: none;
            user-select: none;
            z-index: 2;
        }
        .col-resizer:hover,
        .col-resizer.is-dragging {
            background: rgba(99, 179, 237, 0.4);
        }
        body.col-resizing,
        body.col-resizing * {
            cursor: col-resize !important;
            -webkit-user-select: none !important;
            user-select: none !important;
        }
        .analytics-table th,
        .analytics-table td {
            border-bottom: 1px solid var(--border);
            padding: 9px 10px;
            text-align: left;
            vertical-align: top;
        }
        .analytics-table th {
            color: var(--text-dim);
            font-weight: 700;
        }
        /* 20260512: 行数が多い運用テーブルだけ列見出しを固定する。
           横スクロールと列幅リサイズは維持し、分析用の小さな表には波及させない。 */
        .api-log-table thead th,
        .pricing-table thead th,
        .users-table thead th {
            position: sticky;
            top: 0;
            z-index: 6;
            background: var(--bg-card);
            box-shadow: 0 1px 0 var(--border);
        }
        .sticky-table-scroll {
            max-height: calc(100vh - var(--admin-sticky-header-height, 0px) - 24px);
            overflow: auto;
            overscroll-behavior: auto;
        }
        .analytics-table td:last-child,
        .analytics-table th:last-child,
        .analytics-table td:nth-last-child(2),
        .analytics-table th:nth-last-child(2) {
            text-align: right;
        }
        /* テーブル */
        .table-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            overflow-x: auto;
        }
        .table-card h3 {
            padding: 16px 20px;
            font-size: 16px;
            border-bottom: 1px solid var(--border);
        }
        table {
            width: 100%;
            border-collapse: collapse;
        }
        .table-card table {
            min-width: 1500px;
        }
        .table-card .users-table {
            min-width: 1180px;
            table-layout: fixed;
        }
        .users-table th,
        .users-table td {
            padding: 10px 12px;
        }
        .users-table .col-email { width: 210px; }
        .users-table .col-plan { width: 78px; }
        .users-table .col-count { width: 82px; }
        .users-table .col-total { width: 86px; }
        .users-table .col-cost { width: 170px; }
        .users-table .col-cache { width: 110px; }
        .users-table .col-last-used { width: 116px; }
        .users-table .col-action { width: 86px; }
        .users-table .th-wrap {
            white-space: normal;
            line-height: 1.25;
        }
        .user-email {
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        .last-used-cell {
            color: var(--text-dim);
            line-height: 1.35;
            white-space: normal;
        }
        .last-used-cell .time {
            display: block;
        }
        th {
            text-align: left;
            padding: 12px 20px;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-dim);
            background: rgba(0,0,0,0.2);
            border-bottom: 1px solid var(--border);
            white-space: nowrap;
        }
        td {
            padding: 12px 20px;
            font-size: 13px;
            border-bottom: 1px solid var(--border);
            vertical-align: top;
        }
        tr:hover td { background: var(--bg-hover); }
        .badge {
            display: inline-block;
            padding: 3px 10px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 600;
        }
        .badge-pro { background: rgba(56,189,248,0.15); color: var(--accent); }
        .badge-admin { background: rgba(245,158,11,0.18); color: var(--warning); }
        .badge-free { background: rgba(148,163,184,0.15); color: var(--text-dim); }
        .plan-select {
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text);
            padding: 4px 8px;
            font-size: 12px;
        }
        select option {
            background: var(--bg-card);
            color: var(--text);
        }
        select option:checked {
            background: var(--accent-dim);
            color: #f8fafc;
        }

        /* アクセス拒否 */
        .access-denied {
            text-align: center;
            padding: 80px 24px;
        }
        .access-denied h2 { color: var(--danger); margin-bottom: 12px; }

        .loading { text-align: center; padding: 40px; color: var(--text-dim); }
        #adminSection { display: none; }
        #accessDenied { display: none; }

        /* モデル管理 */
        .model-section {
            margin-top: 24px;
        }
        .usage-limits-section {
            margin-top: 0;
            margin-bottom: 36px;
        }
        .model-header {
            display: flex; align-items: center; justify-content: space-between;
            flex-wrap: wrap; gap: 12px;
            margin-bottom: 16px;
        }
        .model-header h3 { font-size: 18px; }
        .model-header h3 .section-title-note {
            margin-left: 12px;
            font-size: 13px;
            color: var(--text-dim);
            font-weight: 600;
        }
        .model-actions { display: flex; gap: 8px; flex-wrap: wrap; }
        .btn-outline {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 8px 16px;
            border: 1px solid var(--accent);
            border-radius: 8px;
            background: transparent;
            color: var(--accent);
            font-size: 13px; font-weight: 600;
            cursor: pointer; transition: all 0.2s;
        }
        .btn-outline:hover { background: rgba(56,189,248,0.1); }
        .btn-outline:disabled { opacity: 0.4; cursor: not-allowed; }
        .tippy-box[data-theme~='archtype-admin'] {
            background: #f8fafc;
            border-radius: 14px;
            box-shadow: 0 18px 42px rgba(2, 6, 23, 0.34);
            color: #111827;
            font-size: 13px;
            font-weight: 600;
            line-height: 1.55;
        }
        .tippy-box[data-theme~='archtype-admin'] > .tippy-arrow {
            color: #f8fafc;
        }
        .tippy-box[data-theme~='archtype-admin'] .tippy-content {
            padding: 10px 13px;
            overflow-wrap: anywhere;
        }
        .tippy-box[data-theme~='archtype-admin'] .admin-tooltip-term {
            color: #0284c7;
            font-weight: 800;
        }
        [data-admin-tooltip] {
            cursor: help;
        }
        button[data-admin-tooltip],
        select[data-admin-tooltip],
        summary[data-admin-tooltip],
        label[data-admin-tooltip] {
            cursor: pointer;
        }
        input[data-admin-tooltip],
        textarea[data-admin-tooltip] {
            cursor: text;
        }
        .update-status {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 14px 20px;
            margin-bottom: 16px;
            display: flex; align-items: center; gap: 12px;
            font-size: 13px;
        }
        .update-status .dot {
            width: 8px; height: 8px;
            border-radius: 50%;
            flex-shrink: 0;
        }
        .dot-success { background: var(--success); }
        .dot-fail { background: var(--danger); }
        .dot-unknown { background: var(--text-dim); }
        .model-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
            margin-bottom: 16px;
        }
        @media (max-width: 768px) { .model-grid { grid-template-columns: 1fr; } }
        .model-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            overflow: hidden;
            min-width: 0;
        }
        .model-card h4 {
            padding: 12px 16px;
            font-size: 14px;
            border-bottom: 1px solid var(--border);
            background: rgba(0,0,0,0.2);
        }
        .model-card table { width: 100%; table-layout: fixed; }
        .model-card td { padding: 8px 16px; font-size: 12px; }
        .model-card td:first-child { color: var(--text-dim); width: 96px; }
        .model-id {
            display: block;
            font-family: 'Consolas', 'Courier New', monospace;
            color: var(--accent);
            font-size: 11px;
            line-height: 1.35;
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        .raw-models-panel {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            margin-top: 16px;
            overflow: hidden;
            display: none;
        }
        .raw-models-panel h4 {
            padding: 12px 16px;
            font-size: 14px;
            border-bottom: 1px solid var(--border);
            cursor: pointer;
        }
        .raw-models-content {
            max-height: 400px;
            overflow-y: auto;
            padding: 12px 16px;
        }
        .raw-models-content pre {
            font-size: 11px;
            color: var(--text-dim);
            white-space: pre-wrap;
            word-break: break-all;
        }
        .spinner {
            display: inline-block;
            width: 14px; height: 14px;
            border: 2px solid rgba(56,189,248,0.3);
            border-top-color: var(--accent);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* オーバーライド設定 */
        .override-section {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 20px;
            margin-top: 16px;
            overflow: hidden;
        }
        .override-section h4 {
            font-size: 14px;
            margin-bottom: 12px;
            display: flex; align-items: center; gap: 8px;
            flex-wrap: wrap;
            line-height: 1.4;
        }
        .usage-limits-section .override-section {
            margin-top: 0;
        }
        .override-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 16px;
        }
        @media (max-width: 768px) { .override-grid { grid-template-columns: 1fr; } }
        .override-group { min-width: 0; }
        .override-group h5 {
            font-size: 12px;
            color: var(--text-dim);
            margin-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .override-row {
            display: flex; align-items: flex-start; gap: 8px;
            margin-bottom: 8px;
        }
        /* 2026-05-07: モデルオーバーライドカード内に Cloud ASR 設定を統合表示 */
        .override-asr-divider {
            margin-top: 16px;
            padding-top: 16px;
            border-top: 1px dashed var(--border);
        }
        .override-asr-heading {
            font-size: 13px;
            margin-bottom: 12px;
            color: var(--text);
            font-weight: 600;
        }
        .override-asr-heading-sub {
            font-size: 11px;
            color: var(--text-dim);
            font-weight: normal;
            margin-left: 4px;
        }
        /* Cloud ASR モデル行: Provider 切替で 2 つの select を display 切替 */
        .cloud-asr-model-stack {
            position: relative;
            min-width: 0;
        }
        .cloud-asr-model-stack > select {
            width: 100%;
        }
        .provider-http-settings {
            background: rgba(15, 23, 42, 0.46);
            border: 1px solid var(--border);
            border-radius: 8px;
            margin-bottom: 12px;
            padding: 10px 12px;
        }
        .provider-http-heading {
            color: var(--text);
            font-size: 12px;
            font-weight: 700;
            margin-bottom: 8px;
        }
        .provider-http-heading span {
            color: var(--text-dim);
            font-size: 11px;
            font-weight: 500;
            margin-left: 6px;
        }
        .provider-http-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(130px, 1fr));
            gap: 8px;
        }
        .prompt-cache-key-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 8px;
        }
        .provider-http-field {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .provider-http-field label {
            color: var(--text-dim);
            font-size: 11px;
            font-weight: 700;
        }
        @media (max-width: 768px) {
            .provider-http-grid { grid-template-columns: 1fr; }
            .prompt-cache-key-grid { grid-template-columns: 1fr; }
        }
        .cloud-asr-hidden-by-default {
            display: none;
        }
        /* Cloud ASR 個別設定: 1 カード、上段に inline 設定 3 種、下段にシステムプロンプト全幅 (20260507 改修) */
        .cloud-asr-subgroups {
            background: rgba(0, 0, 0, 0.18);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 12px 14px;
            margin-top: 16px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .cloud-asr-inline-settings-row {
            display: flex;
            flex-wrap: wrap;
            gap: 16px;
            align-items: center;
        }
        .cloud-asr-inline-section {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .cloud-asr-note {
            color: var(--text-muted);
            white-space: nowrap;
        }
        .history-cache-inline-section {
            /* 履歴キャッシュは項目数が多いため、他の inline 設定と同じ幅に押し込まず専用行で揃える。 */
            display: grid;
            flex: 1 1 100%;
            grid-template-columns: max-content max-content repeat(3, max-content minmax(120px, 180px));
            gap: 8px 10px;
            align-items: center;
            max-width: none;
            min-width: 0;
            padding-top: 4px;
            border-top: 1px solid rgba(148, 163, 184, 0.16);
        }
        .history-cache-inline-section .cloud-asr-field-label {
            min-width: 0;
        }
        .history-cache-inline-section .cloud-asr-inline-input {
            flex: initial;
            min-width: 0;
            width: 100%;
        }
        .cloud-asr-format-short-skip-section {
            /* 短文スキップも複数入力を持つため、ラベルと入力が対応して見える専用グリッドにする。 */
            display: grid;
            grid-template-columns: max-content max-content repeat(2, max-content minmax(88px, 140px));
            gap: 8px 10px;
            align-items: center;
            max-width: none;
            min-width: 0;
        }
        .cloud-asr-format-short-skip-section .cloud-asr-field-label {
            min-width: 0;
        }
        .cloud-asr-format-short-skip-section .cloud-asr-inline-input {
            flex: initial;
            min-width: 0;
            width: 100%;
        }
        .cloud-asr-execution-policy-section {
            display: grid;
            flex: 1 1 100%;
            grid-template-columns: max-content max-content repeat(5, max-content minmax(96px, 150px)) minmax(160px, 1fr);
            gap: 8px 10px;
            align-items: center;
            max-width: none;
            min-width: 0;
            padding-top: 4px;
            border-top: 1px solid rgba(148, 163, 184, 0.16);
        }
        .cloud-asr-execution-policy-section .cloud-asr-field-label {
            min-width: 0;
            justify-self: end;
            text-align: right;
        }
        .cloud-asr-execution-policy-section .cloud-asr-inline-input {
            flex: initial;
            min-width: 0;
            width: 100%;
        }
        @media (max-width: 1180px) {
            .history-cache-inline-section {
                grid-template-columns: max-content max-content repeat(2, max-content minmax(120px, 1fr));
            }
            .cloud-asr-format-short-skip-section {
                grid-template-columns: max-content max-content repeat(2, max-content minmax(88px, 1fr));
            }
            .cloud-asr-execution-policy-section {
                grid-template-columns: max-content max-content repeat(3, max-content minmax(96px, 1fr));
            }
        }
        @media (max-width: 760px) {
            .history-cache-inline-section {
                grid-template-columns: max-content minmax(0, 1fr);
            }
            .history-cache-inline-section .cloud-asr-subgroup-title,
            .history-cache-inline-section .cloud-asr-toggle,
            .cloud-asr-format-short-skip-section .cloud-asr-subgroup-title,
            .cloud-asr-format-short-skip-section .cloud-asr-toggle {
                grid-column: 1 / -1;
            }
            .cloud-asr-format-short-skip-section {
                grid-template-columns: max-content minmax(0, 1fr);
            }
            .cloud-asr-execution-policy-section {
                grid-template-columns: max-content minmax(0, 1fr);
            }
        }
        .history-cache-refine-card {
            margin-bottom: 14px;
        }
        .batch-run-tabs {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin: 0 0 12px;
        }
        .batch-run-tab {
            align-items: center;
            background: rgba(15, 23, 42, 0.72);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text-dim);
            cursor: pointer;
            display: inline-flex;
            font-size: 13px;
            font-weight: 700;
            gap: 6px;
            min-height: 34px;
            padding: 7px 11px;
            transition: background 0.16s, border-color 0.16s, color 0.16s;
        }
        .batch-run-tab:hover {
            background: var(--bg-hover);
            color: var(--text);
        }
        .batch-run-tab.active {
            background: rgba(56, 189, 248, 0.14);
            border-color: rgba(56, 189, 248, 0.55);
            color: var(--accent);
        }
        .batch-run-tab-icon {
            line-height: 1;
        }
        .batch-run-page-status {
            margin: 0 0 12px;
        }
        .batch-run-panel.hidden {
            display: none;
        }
        .batch-run-scroll {
            border: 1px solid var(--border);
            border-radius: 8px;
        }
        .batch-run-table {
            min-width: 1680px;
            table-layout: fixed;
        }
        .batch-run-table col.batch-run-col-status { width: 128px; }
        .batch-run-table col.batch-run-col-name { width: 250px; }
        .batch-run-table col.batch-run-col-date { width: 176px; }
        .batch-run-table col.batch-run-col-duration { width: 94px; }
        .batch-run-table col.batch-run-col-counts { width: 310px; }
        .batch-run-table col.batch-run-col-model { width: 220px; }
        .batch-run-table col.batch-run-col-id { width: 154px; }
        .batch-run-table col.batch-run-col-error { width: 260px; }
        .batch-run-table col.batch-run-col-details { width: 128px; }
        .batch-run-status {
            border-radius: 999px;
            display: inline-block;
            font-size: 12px;
            font-weight: 800;
            max-width: 100%;
            overflow: hidden;
            padding: 3px 8px;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .batch-run-status-completed {
            background: rgba(34, 197, 94, 0.14);
            color: var(--success);
        }
        .batch-run-status-completed_with_errors,
        .batch-run-status-skipped,
        .batch-run-status-skipped_locked {
            background: rgba(245, 158, 11, 0.14);
            color: var(--warning);
        }
        .batch-run-status-running {
            background: rgba(56, 189, 248, 0.14);
            color: var(--accent);
        }
        .batch-run-status-failed {
            background: rgba(239, 68, 68, 0.14);
            color: var(--danger);
        }
        .batch-run-name {
            color: var(--text);
            font-weight: 800;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .batch-run-sub {
            color: var(--text-dim);
            font-size: 11px;
            margin-top: 2px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .batch-run-date,
        .batch-run-id code,
        .batch-run-error-cell {
            color: var(--text-dim);
            font-size: 12px;
        }
        .batch-run-number {
            font-variant-numeric: tabular-nums;
            text-align: right;
            white-space: nowrap;
        }
        .batch-run-error-cell {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .batch-run-error-cell.has-error {
            color: var(--danger);
        }
        .batch-run-details summary {
            color: var(--accent);
            cursor: pointer;
            font-size: 12px;
            font-weight: 700;
        }
        .batch-run-details pre {
            background: rgba(15, 23, 42, 0.88);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text);
            font-size: 11px;
            line-height: 1.45;
            margin-top: 8px;
            max-height: 280px;
            overflow: auto;
            padding: 10px;
            white-space: pre-wrap;
            width: 420px;
        }
        .history-cache-refine-controls {
            align-items: stretch;
            display: grid;
            gap: 18px;
            grid-template-columns: minmax(300px, 1fr) minmax(320px, 1.15fr) minmax(260px, 0.85fr) minmax(220px, 0.7fr);
        }
        .history-cache-refine-group {
            border-right: 1px solid rgba(148, 163, 184, 0.16);
            display: flex;
            flex-direction: column;
            gap: 10px;
            min-width: 0;
            padding-right: 18px;
        }
        .history-cache-refine-group:last-child {
            border-right: 0;
            padding-right: 0;
        }
        .history-cache-refine-group-title {
            color: var(--text-dim);
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.04em;
        }
        .history-cache-refine-field-grid {
            display: grid;
            gap: 10px;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            min-width: 0;
        }
        .history-cache-refine-field-wide {
            grid-column: 1 / -1;
        }
        .history-cache-refine-controls .model-cost-control {
            color: var(--text-dim);
            font-size: 12px;
            font-weight: 700;
            gap: 6px;
            min-width: 0;
        }
        .history-cache-refine-controls .cloud-asr-inline-input,
        .history-cache-refine-controls select {
            min-height: 36px;
            width: 100%;
        }
        .history-cache-refine-toggle {
            align-items: center;
            color: var(--text);
            cursor: pointer;
            display: inline-flex;
            font-size: 12px;
            font-weight: 700;
            gap: 10px;
            min-width: 0;
            padding: 3px 0;
        }
        .history-cache-refine-toggle input[type="checkbox"] {
            accent-color: var(--accent);
            cursor: pointer;
            flex: 0 0 auto;
            height: 16px;
            margin: 0;
            width: 16px;
        }
        .history-cache-refine-toggle span {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        @media (max-width: 1500px) {
            .history-cache-refine-controls {
                grid-template-columns: repeat(2, minmax(280px, 1fr));
            }
            .history-cache-refine-group:nth-child(2n) {
                border-right: 0;
                padding-right: 0;
            }
        }
        @media (max-width: 760px) {
            .history-cache-refine-controls {
                gap: 14px;
                grid-template-columns: 1fr;
            }
            .history-cache-refine-group {
                border-bottom: 1px solid rgba(148, 163, 184, 0.16);
                border-right: 0;
                padding-bottom: 14px;
                padding-right: 0;
            }
            .history-cache-refine-group:last-child {
                border-bottom: 0;
                padding-bottom: 0;
            }
            .history-cache-refine-field-grid {
                grid-template-columns: 1fr;
            }
            .history-cache-refine-field-wide {
                grid-column: auto;
            }
        }
        .history-cache-refine-model-current {
            align-items: center;
            background: rgba(56, 189, 248, 0.08);
            border: 1px solid rgba(56, 189, 248, 0.28);
            border-radius: 8px;
            color: var(--text);
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 12px;
            padding: 10px 12px;
        }
        .history-cache-refine-model-current code {
            color: var(--text);
            overflow-wrap: anywhere;
        }
        .history-cache-refine-model-chip {
            background: rgba(15, 23, 42, 0.82);
            border: 1px solid var(--border);
            border-radius: 999px;
            color: var(--accent);
            font-size: 11px;
            font-weight: 700;
            padding: 3px 8px;
        }
        .history-cache-refine-model-note {
            color: var(--text-dim);
            font-size: 12px;
        }
        .history-cache-refine-actions {
            margin-bottom: 14px;
        }
        .history-cache-refine-run-list {
            display: block;
        }
        .history-cache-refine-run-scroll {
            border: 1px solid var(--border);
            border-radius: 8px;
        }
        .history-cache-refine-run-table {
            min-width: 1420px;
            table-layout: fixed;
        }
        .history-cache-refine-run-table col.history-cache-refine-run-col-status { width: 118px; }
        .history-cache-refine-run-table col.history-cache-refine-run-col-date { width: 142px; }
        .history-cache-refine-run-table col.history-cache-refine-run-col-count { width: 82px; }
        .history-cache-refine-run-table col.history-cache-refine-run-col-target { width: 92px; }
        .history-cache-refine-run-table col.history-cache-refine-run-col-cost { width: 104px; }
        .history-cache-refine-run-table col.history-cache-refine-run-col-id { width: 154px; }
        .history-cache-refine-run-table col.history-cache-refine-run-col-error { width: 258px; }
        .history-cache-refine-run-status {
            color: var(--text);
            display: inline-block;
            font-size: 13px;
            font-weight: 700;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            vertical-align: top;
            white-space: nowrap;
        }
        .history-cache-refine-run-date {
            color: var(--text-dim);
            font-size: 12px;
            white-space: nowrap;
        }
        .history-cache-refine-run-table td.history-cache-refine-run-number {
            font-variant-numeric: tabular-nums;
            text-align: right;
            white-space: nowrap;
        }
        .history-cache-refine-run-table th:nth-child(4),
        .history-cache-refine-run-table th:nth-child(5),
        .history-cache-refine-run-table th:nth-child(6),
        .history-cache-refine-run-table th:nth-child(7),
        .history-cache-refine-run-table th:nth-child(8),
        .history-cache-refine-run-table th:nth-child(10) {
            text-align: right;
        }
        .history-cache-refine-run-table th:nth-child(11),
        .history-cache-refine-run-table th:nth-child(12),
        .history-cache-refine-run-table td:nth-child(11),
        .history-cache-refine-run-table td:nth-child(12) {
            text-align: left;
        }
        .history-cache-refine-run-id code {
            color: var(--text-dim);
            display: block;
            font-size: 11px;
            overflow-wrap: anywhere;
            line-height: 1.35;
        }
        .history-cache-refine-run-error-cell {
            color: var(--text-dim);
            font-size: 12px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .history-cache-refine-run-error-cell.has-error {
            color: var(--danger);
        }
        .cloud-asr-subgroup-title {
            font-size: 13px;
            color: var(--text);
            font-weight: 600;
            white-space: nowrap;
        }
        .cloud-asr-system-prompt-row {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .cloud-asr-subgroup-row {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: nowrap;
        }
        .cloud-asr-toggle {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: var(--text);
            cursor: pointer;
        }
        .cloud-asr-toggle input[type="checkbox"] {
            cursor: pointer;
        }
        .cloud-asr-field-label {
            font-size: 11px;
            color: var(--text-dim);
            flex-shrink: 0;
            min-width: 80px;
        }
        .cloud-asr-inline-input {
            flex: 1;
            min-width: 0;
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text);
            padding: 6px 10px;
            font-size: 12px;
            font-family: 'Consolas', 'Courier New', monospace;
            height: 34px;
        }
        .override-timeout-control {
            grid-column: 2 / 5;
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
        }
        .override-timeout-control .cloud-asr-inline-input {
            max-width: 180px;
            flex: 0 0 180px;
        }
        .cloud-asr-help-text {
            font-size: 11px;
            color: var(--text-dim);
            line-height: 1.4;
        }
        .cloud-asr-subgroup-row-stack {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 4px;
        }
        .cloud-asr-textarea {
            width: 100%;
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text);
            padding: 8px 12px;
            font-size: 14px;
            font-family: 'Consolas', 'Courier New', monospace;
            line-height: 1.5;
            resize: vertical;
        }
        .cloud-asr-default-prompt-details {
            margin-top: 6px;
            font-size: 13px;
            color: var(--text-dim);
        }
        .cloud-asr-default-prompt-details summary {
            cursor: pointer;
            user-select: none;
            padding: 4px 0;
            color: var(--text);
        }
        .cloud-asr-default-prompt-content {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-top: 4px;
        }
        .cloud-asr-prompt-preview-section {
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 9px 11px;
        }
        .cloud-asr-prompt-preview-section.readonly {
            background: rgba(245, 158, 11, 0.12);
            border-color: rgba(245, 158, 11, 0.45);
        }
        .cloud-asr-prompt-preview-section.default-body {
            background: var(--bg);
        }
        .cloud-asr-prompt-preview-title {
            font-size: 12px;
            font-weight: 700;
            margin-bottom: 6px;
        }
        .cloud-asr-prompt-preview-section.readonly .cloud-asr-prompt-preview-title {
            color: #fbbf24;
        }
        .cloud-asr-prompt-preview-body {
            color: var(--text);
            font-family: 'Consolas', 'Courier New', monospace;
            font-size: 14px;
            line-height: 1.5;
            margin: 0;
            white-space: pre-wrap;
        }
        .cloud-asr-default-prompt-actions {
            margin-top: 6px;
            display: flex;
            gap: 8px;
        }
        /* 2026-05-07: 機能別プロバイダー選択化。
           2026-06-02: OpenRouter 方針と固定 provider をモデルIDの左へ差し込めるよう可変行にする。 */
        .override-by-function {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-bottom: 12px;
        }
        .override-fn-row {
            display: flex;
            gap: 8px;
            align-items: center;
            min-width: 0;
        }
        .override-fn-row label {
            flex: 0 0 110px;
            font-size: 12px;
            color: var(--text-dim);
            font-weight: 600;
        }
        .override-fn-row > select[id$="-apiType"],
        .override-fn-row > #cloudAsrProvider {
            flex: 0 0 180px;
        }
        .override-fn-row > .openrouter-provider-mode {
            flex: 0 0 160px;
            border-color: rgba(249, 115, 22, 0.5);
        }
        .override-fn-row > .openrouter-provider-only-group {
            flex: 0 0 540px;
            display: flex;
            gap: 6px;
            min-width: 0;
        }
        .override-fn-row > .openrouter-provider-only-group.cloud-asr-hidden-by-default {
            display: none;
        }
        .override-fn-row > .openrouter-provider-only-group > .openrouter-provider-only {
            flex: 1 1 0;
            min-width: 0;
            border-color: rgba(249, 115, 22, 0.5);
        }
        .override-fn-row > input[id$="-modelId"],
        .override-fn-row > .cloud-asr-model-stack,
        .override-fn-row > .override-timeout-control {
            flex: 1 1 260px;
            min-width: 0;
        }
        .override-fn-row > .override-reasoning-effort {
            flex: 0 0 150px;
        }
        .override-fn-row > .override-gemini-thinking-budget {
            flex: 0 0 150px;
        }
        .output-token-limit-card {
            background: rgba(15, 23, 42, 0.48);
            border: 1px solid var(--border);
            border-radius: 8px;
            display: grid;
            gap: 8px;
            margin: 2px 0 6px 118px;
            padding: 10px 12px;
        }
        .output-token-limit-title {
            color: var(--text-dim);
            font-size: 12px;
            font-weight: 700;
        }
        .output-token-limit-grid {
            align-items: center;
            display: grid;
            grid-template-columns: 88px minmax(180px, 260px) 88px minmax(180px, 260px);
            gap: 8px 10px;
        }
        .output-token-limit-grid label {
            color: var(--text-dim);
            font-size: 12px;
            font-weight: 600;
        }
        .output-token-limit-control {
            align-items: center;
            display: flex;
            gap: 6px;
            min-width: 0;
        }
        .output-token-limit-control span {
            color: var(--text-dim);
            font-size: 11px;
            font-weight: 700;
            white-space: nowrap;
        }
        .output-token-limit-input {
            flex: 0 1 130px;
            max-width: 130px;
            text-align: right;
        }
        .override-fn-row > .instruction-grounding-toggle {
            align-items: center;
            color: var(--text);
            cursor: pointer;
            display: inline-flex;
            flex: 0 0 118px;
            font-size: 12px;
            font-weight: 700;
            gap: 8px;
            min-width: 0;
        }
        .override-fn-row > .instruction-grounding-toggle input[type="checkbox"] {
            accent-color: var(--accent);
            cursor: pointer;
            flex: 0 0 auto;
            height: 16px;
            margin: 0;
            width: 16px;
        }
        .override-fn-row > .instruction-grounding-toggle span {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .override-fn-row > .instruction-grounding-toggle.instruction-grounding-toggle-disabled {
            color: var(--text-dim);
            cursor: not-allowed;
            opacity: 0.62;
        }
        @media (max-width: 768px) {
            .override-fn-row {
                flex-direction: column;
                align-items: stretch;
            }
            .override-fn-row label,
            .override-fn-row > select[id$="-apiType"],
            .override-fn-row > #cloudAsrProvider,
            .override-fn-row > .openrouter-provider-mode,
            .override-fn-row > .openrouter-provider-only-group,
            .override-fn-row > input[id$="-modelId"],
            .override-fn-row > .cloud-asr-model-stack,
            .override-fn-row > .override-timeout-control,
            .override-fn-row > .override-reasoning-effort,
            .override-fn-row > .override-gemini-thinking-budget,
            .override-fn-row > .instruction-grounding-toggle {
                flex: 1 1 auto;
                width: 100%;
            }
            .override-fn-row > .openrouter-provider-only-group {
                flex-direction: row;
            }
            .output-token-limit-card {
                margin-left: 0;
            }
            .output-token-limit-grid {
                grid-template-columns: 1fr;
            }
            .output-token-limit-input {
                max-width: none;
            }
        }
        .override-row label {
            font-size: 12px;
            color: var(--text-dim);
            width: 70px;
            flex-shrink: 0;
            padding-top: 8px;
        }
        .override-select {
            flex: 1;
            min-width: 0;
            width: 100%;
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text);
            padding: 6px 10px;
            font-size: 12px;
            font-family: 'Consolas', 'Courier New', monospace;
        }
        .override-model-input { height: 34px; }
        .override-reasoning-effort.reasoning-effort-disabled {
            opacity: 0.55;
        }
        .override-gemini-thinking-budget:disabled {
            opacity: 0.55;
        }
        .override-select option { font-size: 12px; }
        .override-actions {
            display: flex; gap: 8px; margin-top: 16px;
            align-items: center;
            flex-wrap: wrap;
        }
        .override-status {
            font-size: 12px;
            margin-left: 8px;
            min-width: 0;
        }
        .pricing-toolbar {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 12px;
        }
        .table-scroll {
            width: 100%;
            overflow-x: auto;
        }
        .table-scroll.drag-scroll-enabled {
            cursor: grab;
        }
        .table-scroll.drag-scroll-enabled.drag-scroll-active {
            cursor: grabbing;
            -webkit-user-select: none;
            user-select: none;
        }
        .table-scroll.drag-scroll-enabled.drag-scroll-active * {
            cursor: grabbing !important;
        }
        .pricing-controls {
            display: grid;
            grid-template-columns: minmax(160px, 220px) 1fr;
            gap: 12px;
            margin-bottom: 16px;
        }
        .pricing-summary-layout {
            display: grid;
            grid-template-columns: minmax(420px, 1fr) minmax(300px, 520px);
            gap: 16px;
            align-items: start;
            margin-bottom: 16px;
        }
        .pricing-summary-layout .pricing-controls {
            margin-bottom: 0;
        }
        @media (max-width: 1100px) { .pricing-summary-layout { grid-template-columns: 1fr; } }
        @media (max-width: 768px) { .pricing-controls { grid-template-columns: 1fr; } }
        .pricing-field label {
            display: block;
            font-size: 12px;
            color: var(--text-dim);
            margin-bottom: 6px;
        }
        .pricing-field input,
        .pricing-table input,
        .pricing-table select {
            width: 100%;
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text);
            padding: 6px 8px;
            font-size: 12px;
        }
        .pricing-link {
            display: inline-flex;
            align-items: center;
            min-height: 34px;
            color: var(--accent);
            font-size: 12px;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            text-decoration: none;
            white-space: nowrap;
        }
        .pricing-link:hover {
            text-decoration: underline;
        }
        .pricing-links {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            align-items: center;
            column-gap: 24px;
            row-gap: 6px;
            max-width: 100%;
        }
        .pricing-table input[type="checkbox"] {
            width: auto;
        }
        .pricing-table {
            min-width: 1320px;
            table-layout: fixed;
        }
        .asr-pricing-table {
            min-width: 980px;
        }
        .pricing-table td,
        .pricing-table th {
            padding: 8px 10px;
        }
        .pricing-table th {
            vertical-align: middle;
        }
        .pricing-table .th-wrap {
            white-space: normal;
            line-height: 1.25;
        }
        .pricing-table .th-api { width: 100px; }
        .pricing-table .th-model { width: 280px; }
        .pricing-table .th-number { width: 100px; }
        .pricing-table .th-check { width: 90px; }
        .pricing-table .th-grounding { width: 100px; }
        .pricing-table .th-memo { width: 140px; }
        .pricing-table .th-action { width: 80px; }
        .pricing-table .th-source { width: 90px; }
        .pricing-table .th-provider { width: 100px; }
        .pricing-table .th-minimum { width: 120px; }
        /* 20260508: 列ソート機能。data-sortable th をクリックで該当列の input/checkbox/select 値で tbody を並び替え。
           モデルコスト表 (modelTableSortIndicator) と表記統一: 未ソート時は薄字 ⇅、ソート中は ▲/▼。 */
        .pricing-table th[data-sortable="true"] {
            cursor: pointer;
            user-select: none;
        }
        .pricing-table th[data-sortable="true"]:hover {
            background: rgba(255, 255, 255, 0.04);
        }
        .pricing-table th[data-sortable="true"]::after {
            content: ' ⇅';
            font-size: 11px;
            opacity: 0.3;
            margin-left: 2px;
        }
        .pricing-table th[data-sortable="true"][data-sort-dir="asc"]::after {
            content: ' ▲';
            font-size: 10px;
            opacity: 0.7;
        }
        .pricing-table th[data-sortable="true"][data-sort-dir="desc"]::after {
            content: ' ▼';
            font-size: 10px;
            opacity: 0.7;
        }
        .pricing-table .model-input {
            min-width: 260px;
            font-family: 'Consolas', 'Courier New', monospace;
        }
        .pricing-table .pricing-memo {
            min-width: 0;
        }
        .cost-cell {
            color: var(--accent);
            font-variant-numeric: tabular-nums;
            white-space: normal;
        }
        .cost-detail {
            margin-top: 3px;
            color: var(--text-dim);
            font-size: 11px;
            line-height: 1.35;
        }
        .cost-detail span {
            display: inline-block;
            margin-right: 6px;
            white-space: nowrap;
        }
        .pricing-missing-detail {
            color: var(--warning);
            white-space: nowrap;
        }
        .pricing-missing-panel {
            min-height: 74px;
            border: 1px solid rgba(245, 158, 11, 0.35);
            border-radius: 8px;
            background: rgba(245, 158, 11, 0.08);
            padding: 10px 12px;
            color: var(--warning);
        }
        .pricing-missing-panel.is-empty {
            border-color: var(--border);
            background: rgba(148, 163, 184, 0.06);
            color: var(--text-dim);
        }
        .pricing-missing-panel-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 6px;
            font-weight: 700;
            font-size: 12px;
        }
        .pricing-missing-panel-count {
            color: var(--text-dim);
            font-size: 11px;
            font-weight: 500;
            white-space: nowrap;
        }
        .pricing-missing-panel-list {
            display: flex;
            flex-direction: column;
            gap: 4px;
            max-height: 160px;
            overflow: auto;
        }
        .pricing-missing-panel-item {
            font-size: 12px;
            line-height: 1.35;
            word-break: break-all;
        }
        .pricing-missing-panel-more {
            margin-top: 4px;
            color: var(--text-dim);
            font-size: 11px;
        }
        .token-muted {
            color: var(--text-dim);
            font-variant-numeric: tabular-nums;
            white-space: nowrap;
        }

        /* ===== 📚 辞書テンプレート管理タブ専用スタイル ===== */
        .dt-card { display: flex; flex-direction: column; gap: 16px; }
        .dt-maxchars-row {
            display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
            background: rgba(255,255,255,0.03);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 12px 16px;
        }
        .dt-maxchars-row label {
            font-size: 13px; color: var(--text-dim);
            display: inline-flex; align-items: center; gap: 8px;
        }
        .dt-input {
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text);
            padding: 8px 12px;
            font-size: 14px;
            font-family: inherit;
            box-sizing: border-box;
        }
        .dt-input:focus {
            outline: none;
            border-color: var(--accent);
        }
        .dt-input-num { width: 90px; }
        .dt-input-fluid { width: 100%; }
        .dt-textarea {
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text);
            padding: 10px 14px;
            font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
            font-size: 13px;
            line-height: 1.5;
            width: 100%;
            resize: vertical;
            box-sizing: border-box;
        }
        .dt-textarea:focus {
            outline: none;
            border-color: var(--accent);
        }
        .dt-toolbar {
            display: flex; justify-content: space-between; align-items: center;
            flex-wrap: wrap; gap: 8px;
        }
        .dt-status {
            font-size: 12px; color: var(--text-dim);
        }
        .dt-table {
            width: 100%; border-collapse: collapse; font-size: 13px;
        }
        .dt-table thead th {
            background: rgba(255,255,255,0.04);
            color: var(--text-dim);
            text-align: left;
            padding: 10px 12px;
            font-weight: 600;
            font-size: 12px;
            border-bottom: 1px solid var(--border);
        }
        .dt-table tbody td {
            padding: 12px;
            border-bottom: 1px solid var(--border);
            vertical-align: middle;
        }
        .dt-table tbody tr:hover {
            background: rgba(56,189,248,0.04);
        }
        .dt-table .dt-col-enabled { width: 50px; text-align: center; font-size: 18px; font-weight: 700; }
        .dt-table .dt-col-order { width: 60px; }
        .dt-table .dt-col-icon { width: 50px; font-size: 22px; line-height: 1; }
        /* ヘッダー行はデータ行用の大きいフォントサイズを継承しないようリセット */
        .dt-table thead .dt-col-enabled,
        .dt-table thead .dt-col-icon { font-size: inherit; font-weight: 600; }
        .dt-table .dt-col-stats { width: 80px; text-align: right; }
        .dt-table .dt-col-actions { width: 180px; white-space: nowrap; }
        .dt-table .dt-name { font-weight: 600; }
        .dt-table .dt-id { font-size: 11px; color: var(--text-dim); font-family: monospace; }
        .dt-table .dt-desc { font-size: 12px; color: var(--text-dim); }
        .dt-editor {
            background: rgba(255,255,255,0.03);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 18px 20px;
            display: flex; flex-direction: column; gap: 12px;
        }
        .dt-editor h4 {
            margin: 0 0 4px;
            font-size: 14px; font-weight: 600;
        }
        .dt-editor-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
        }
        .dt-editor-grid label {
            display: flex; flex-direction: column; gap: 4px;
            font-size: 12px; color: var(--text-dim);
        }
        .dt-editor-full {
            display: flex; flex-direction: column; gap: 4px;
            font-size: 12px; color: var(--text-dim);
        }
        .dt-editor-actions {
            display: flex; gap: 8px; justify-content: flex-end;
            padding-top: 4px;
        }
        .dt-editor-checkbox {
            display: inline-flex; align-items: center; gap: 8px;
            font-size: 13px; color: var(--text);
        }
        .dt-lead {
            margin: 6px 0 0;
        }
        .dt-section-label {
            font-size: 13px; font-weight: 600; color: var(--text);
        }
        .dt-toolbar-buttons {
            display: flex; gap: 8px;
        }
        .dt-hint {
            font-size: 11px; opacity: 0.7;
        }
        .dt-hint-dim {
            font-size: 11px; opacity: 0.7; color: var(--text-dim);
        }
        .hp-preview-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 12px;
        }
        .hp-field {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .hp-count-label {
            font-size: 12px;
            color: var(--text-dim);
        }
        .dt-editor-hidden {
            display: none;
        }
        .dt-empty-row {
            padding: 24px;
            text-align: center;
            color: var(--text-dim);
        }
        .dt-enabled-on { color: #10B981; }
        .dt-enabled-off { color: var(--text-dim); }
        .dt-btn-edit {
            background: rgba(56,189,248,0.12);
            color: var(--accent);
            border: 1px solid rgba(56,189,248,0.3);
            padding: 4px 10px; font-size: 11px;
        }
        .dt-btn-edit:hover {
            background: rgba(56,189,248,0.2);
        }
        .dt-btn-delete {
            background: rgba(239,68,68,0.1);
            color: var(--danger);
            border: 1px solid rgba(239,68,68,0.3);
            padding: 4px 10px; font-size: 11px;
            margin-left: 4px;
        }
        .dt-btn-delete:hover {
            background: rgba(239,68,68,0.2);
        }

