/* ==========================================================================
   FFXIV 採集タイムテーブル (Gathering Timetable) スタイルシート
   スマートフォン最適化＆コンパクトレイアウト
   ========================================================================== */

html, body {
    height: 100%;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #f1f5f9;
}

body {
    display: flex;
    flex-direction: column;
}

/* スティッキー固定ブロック：タイトルバー ＋ エリア選択タブ */
.gathering-sticky-wrapper {
    flex-shrink: 0;
    z-index: 100;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* サイトヘッダー */
.gathering-sticky-wrapper .site-header {
    padding: 6px 12px;
    height: auto;
    min-height: 40px;
    border-radius: 0;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gathering-sticky-wrapper .site-title h1 {
    font-size: 15px;
    margin: 0;
    color: #0f172a;
}

.gathering-sticky-wrapper .site-title-link {
    color: #0f172a;
    text-decoration: none;
}

.gathering-sticky-wrapper .version-badge {
    font-size: 10px;
    padding: 1px 5px;
    background: #e2e8f0;
    color: #475569;
    border-radius: 4px;
    margin-left: 6px;
}

/* ヘッダー時計表示 */
.header-clock-controls {
    display: flex;
    align-items: center;
}

.toggle-control-label {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    user-select: none;
}

.toggle-control-label input[type="checkbox"] {
    cursor: pointer;
    width: 13px;
    height: 13px;
    accent-color: #2563eb;
    margin: 0;
}

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

.clock-unit {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.clock-unit .clock-label {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.clock-unit .clock-value {
    display: inline-block;
    padding: 2px 6px;
    background: #374151;
    color: #f9fafb;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    min-width: 68px;
    text-align: center;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* エリア選択ツールバー */
.gathering-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 10px;
    background: #f8fafc;
    border-bottom: 1px solid #cbd5e1;
}

/* 拡張パッケタブ */
.expansion-tabs-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.expansion-tab-btn {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #2563eb;
    background: #ffffff;
    border: 1px solid #93c5fd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.expansion-tab-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.expansion-tab-btn.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

/* ツールバー (自動スクロールスイッチ ＆ クラス絞り込み) */
.gathering-tools-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.auto-scroll-toggle {
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
}

.filter-btn-group {
    display: inline-flex;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    overflow: hidden;
    background: #ffffff;
}

.filter-btn {
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: transparent;
    border: none;
    border-right: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.12s;
}

.filter-btn:last-child {
    border-right: none;
}

.filter-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.filter-btn.active {
    background: #334155;
    color: #ffffff;
}

/* メインコンテナ：縦方向Flexで画面いっぱい */
.gathering-page-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    overflow: hidden;
    background: #ffffff;
}

/* タイムテーブル外枠：ここが縦横スクロール領域 */
.timetable-card {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    position: relative;
}

/* タイムテーブル本体 */
.gathering-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    background: #ffffff;
    border-left: 1px solid #cbd5e1;
    --gathering-row-height: 64px;
}

/* 1時間ごとの均等行高さ設定 (tbodyのデータ行のみに適用し、theadの列名行は除外) */
.gathering-table tbody tr {
    height: var(--gathering-row-height);
}

.gathering-table thead tr {
    height: auto !important;
}

/* 列名行：スクロール領域の最上部(top: 0)に追従固定 */
.gathering-table th {
    height: auto !important;
    background: #334155;
    color: #ffffff;
    padding: 6px 4px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    border-right: 1px solid #64748b;
    border-bottom: 2px solid #1e293b;
    position: sticky;
    top: 0;
    z-index: 30;
    line-height: 1.2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.gathering-table th .th-sub {
    display: inline-block;
    font-size: 10px;
    font-weight: normal;
    opacity: 0.85;
    margin-left: 2px;
}

.gathering-table td {
    border-right: 1px solid #94a3b8;
    border-bottom: 1px solid #94a3b8;
    vertical-align: top;
    padding: 3px 4px;
    background: #ffffff;
    height: var(--gathering-row-height);
    box-sizing: border-box;
}

.gathering-table td[rowspan="2"] {
    height: calc(var(--gathering-row-height) * 2);
}

.gathering-table td[rowspan="3"] {
    height: calc(var(--gathering-row-height) * 3);
}

.gathering-table td[rowspan="4"] {
    height: calc(var(--gathering-row-height) * 4);
}

/* 時間帯セル */
.time-cell-th,
.time-cell {
    width: 82px;
    min-width: 82px;
    max-width: 82px;
    text-align: center;
    vertical-align: middle !important;
    user-select: none;
    padding: 4px 2px !important;
}

.time-cell-th {
    height: auto !important;
    background: #334155 !important;
    color: #ffffff !important;
}

.time-cell {
    background: #f8fafc !important;
}

.time-cell-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.25;
    gap: 1px;
}

.time-cell-inner .tc-et-title {
    font-size: 11px;
    color: #334155;
    font-weight: 500;
}

.time-cell-inner .tc-et-title strong {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.time-cell-inner .tc-status-lbl {
    font-size: 10.5px;
    color: #475569;
    margin-top: 1px;
}

.time-cell-inner .tc-countdown {
    font-size: 11.5px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.2px;
}

.time-cell-inner .tc-target-lt {
    font-size: 10px;
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* 現在出現中 (ET 現在時刻行) のハイライト：ピンク系背景 */
tr.current-et-row td.time-cell {
    background: #ffe4e6 !important;
    border-left: 3px solid #f43f5e !important;
    box-shadow: inset 0 0 4px rgba(244, 63, 94, 0.15);
}

tr.current-et-row td.time-cell .tc-et-title {
    color: #9f1239;
}

tr.current-et-row td.time-cell .tc-et-title strong {
    color: #881337;
}

tr.current-et-row td.time-cell .tc-status-lbl {
    color: #be123c;
    font-weight: 700;
}

tr.current-et-row td.time-cell .tc-countdown {
    color: #881337;
    font-weight: 800;
}

@keyframes flash-highlight-anim {
    0% { background-color: rgba(254, 240, 138, 0.8); }
    100% { background-color: transparent; }
}

tr.flash-highlight td {
    animation: flash-highlight-anim 1.2s ease-out;
}

/* 空白セル（未発生スロット） */
.empty-slot-cell {
    background-color: #cbd5e1 !important;
}

/* 切り捨て領域セル (採集ポイントが存在するが枠外で分断されたスロット：背景白・中身なし) */
.truncated-cut-cell {
    background-color: #ffffff !important;
}

/* カードコンテナ */
.node-cards-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 100%;
    min-height: 100%;
    box-sizing: border-box;
    justify-content: center; /* 未知・伝説および通常枠：上下中央配置 */
}

/* 未知・伝説および刻限セル：上位置を現在時間帯に追従させ、枠の最後の1時間は下揃え */
.gathering-table td.ephemeral-slot-cell,
.gathering-table td.unknown-legendary-slot-cell {
    vertical-align: top !important;
}

.gathering-table td.ephemeral-slot-cell .node-cards-wrap,
.gathering-table td.unknown-legendary-slot-cell .node-cards-wrap {
    justify-content: flex-start !important;
    transition: padding-top 0.3s ease-out;
}

/* 個別採集地カード */
.gathering-card {
    border-radius: 4px;
    padding: 3px 5px;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.gathering-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* 園芸師カード (ミントグリーン) */
.gathering-card.type-botany {
    background-color: #eafaf1;
    border: 1px solid #a3e6c0;
}

/* 採掘師カード (ウォームイエロー) */
.gathering-card.type-mining {
    background-color: #fefce8;
    border: 1px solid #fde047;
}

/* カードヘッダー */
.card-header {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    line-height: 1.25;
    margin-bottom: 3px;
    flex-wrap: wrap;
}

.class-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    vertical-align: middle;
}

.node-level-text {
    color: #334155;
    font-weight: 600;
}

/* ノード種別バッジ */
.badge-node-type {
    font-weight: 700;
}

.badge-node-type.type-legendary {
    color: #dc2626; /* 伝説は赤文字 */
}

.badge-node-type.type-unknown {
    color: #0f172a; /* 未知 */
}

.badge-node-type.type-ephemeral {
    color: #4338ca; /* 刻限 */
}

/* エリア名リンク */
.spot-link {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.12s;
}

.spot-link:hover {
    color: #1d4ed8;
}

/* アイテムリスト */
.card-items-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.item-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    line-height: 1.25;
}

.item-icon {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #94a3b8;
    background: #111827;
    flex-shrink: 0;
}

.item-name-link {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.12s;
}

.item-name-link:hover {
    color: #1d4ed8;
}

.item-level-stars {
    color: #475569;
    font-size: 10.5px;
    font-weight: 500;
    margin-left: 2px;
    white-space: nowrap;
}

/* 精選 (Reduction) 行 */
.reduction-row {
    margin-left: 16px;
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    color: #475569;
    margin-top: 1px;
}

.reduction-label {
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
}

.reduction-icon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    border: 1px solid #cbd5e1;
    background: #111827;
    flex-shrink: 0;
}

.reduction-link {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
}

.reduction-link:hover {
    color: #1d4ed8;
}

/* 読み込み中・エラー */
.gathering-loading,
.gathering-error {
    text-align: center;
    padding: 40px 10px;
    font-size: 14px;
    color: #64748b;
}

.gathering-error {
    color: #dc2626;
}

/* PC画面など幅が広い場合のみ少しゆとりを持たせる */
@media (min-width: 768px) {
    .time-cell-th,
    .time-cell {
        width: 70px;
        min-width: 70px;
        max-width: 70px;
        font-size: 13px;
    }
    .card-header {
        font-size: 12px;
    }
    .item-row {
        font-size: 12px;
    }
    .item-icon {
        width: 22px;
        height: 22px;
    }
    .expansion-tab-btn {
        padding: 5px 12px;
        font-size: 13px;
    }
}

/* ==========================================================================
   表示対象選択画面スタイル ＆ フィルター反映スタイル
   ========================================================================== */

/* 表示対象選択ボタン */
.btn-open-filter-select {
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-open-filter-select:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

/* 表示対象選択画面 (フルスクリーンモーダル) */
.filter-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #f1f5f9;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.filter-modal-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.filter-modal-header {
    padding: 8px 14px;
    background: #ffffff;
    border-bottom: 1px solid #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.filter-modal-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

.filter-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-filter-batch {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #1e40af;
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 18px;
    transition: all 0.15s ease;
}

.btn-filter-batch:hover {
    background: #bfdbfe;
    border-color: #60a5fa;
}

.btn-filter-reset {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.15s ease;
}

.btn-filter-reset:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.btn-filter-copy-url {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #0369a1;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.15s ease;
}

.btn-filter-copy-url:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0284c7;
}

.btn-filter-cancel {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
}

.btn-filter-confirm {
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    background: #2563eb;
    border: 1px solid #1d4ed8;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.3);
    transition: background 0.15s;
}

.btn-filter-confirm:hover {
    background: #1d4ed8;
}

.filter-modal-controls {
    padding: 6px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.filter-exp-tabs-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.filter-class-switches-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-sw-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    color: #64748b;
}

.filter-sw-btn.is-on {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
}

.filter-modal-table-wrap {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
    background: #ffffff;
}

/* 表示対象選択画面内のタイムテーブル */
.filter-static-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    background: #ffffff;
    font-size: 12px;
    border-left: 1px solid #94a3b8;
    --gathering-row-height: 64px;
}

.filter-static-table tbody tr {
    height: var(--gathering-row-height);
}

.filter-static-table thead tr {
    height: auto !important;
}

.filter-static-table th {
    background: #334155;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 6px 4px;
    height: auto !important;
    border-right: 1px solid #64748b;
    border-bottom: 2px solid #1e293b;
    box-sizing: border-box;
}

.filter-static-table th .th-sub {
    display: inline-block;
    font-size: 10px;
    font-weight: normal;
    opacity: 0.85;
    margin-left: 2px;
}

.filter-static-table td {
    border-right: 1px solid #94a3b8;
    border-bottom: 1px solid #94a3b8;
    padding: 3px 4px;
    vertical-align: top;
    height: var(--gathering-row-height);
    box-sizing: border-box;
}

.filter-static-table td[rowspan="2"] {
    height: calc(var(--gathering-row-height) * 2);
}

.filter-static-table td[rowspan="3"] {
    height: calc(var(--gathering-row-height) * 3);
}

.filter-static-table td[rowspan="4"] {
    height: calc(var(--gathering-row-height) * 4);
}

.filter-static-table .time-cell {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    text-align: center;
    font-weight: 700;
    color: #334155;
    background: #f8fafc;
    vertical-align: middle !important;
    padding: 4px 2px !important;
}

/* 列名スイッチ */
.col-header-switch-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.col-sw-btn {
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 3px;
    cursor: pointer;
    border: 1px solid #94a3b8;
    background: #64748b;
    color: #f8fafc;
    transition: all 0.15s;
}

.col-sw-btn.is-on {
    background: #22c55e;
    border-color: #16a34a;
    color: #ffffff;
}

/* マスキング効果 (表示対象選択画面) */
.filter-static-table td.filter-col-masked {
    opacity: 0.55 !important;
    filter: grayscale(60%) !important;
    background-color: #f1f5f9 !important;
}

.filter-static-table .gathering-card.filter-class-masked {
    opacity: 0.6 !important;
    filter: grayscale(70%) !important;
    background: #f1f5f9 !important;
}

.filter-static-table .gathering-card.filter-point-masked {
    opacity: 0.78 !important;
    filter: grayscale(30%) !important;
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

.filter-static-table .gathering-card.filter-point-masked .card-header {
    color: #475569;
}

.filter-static-table .gathering-card.filter-point-masked .card-header .node-level-text,
.filter-static-table .gathering-card.filter-point-masked .card-header .gathering-spot-link {
    color: #64748b;
}

.filter-static-table .gathering-card.filter-point-masked .card-items-list {
    opacity: 1 !important;
}

.filter-static-table .gathering-card.filter-point-masked .card-items-list .item-name-link {
    color: #334155 !important;
}

.filter-static-table .gathering-card.filter-point-masked .card-items-list .item-level-stars,
.filter-static-table .gathering-card.filter-point-masked .card-items-list .reductions-chain {
    color: #64748b !important;
}

.filter-static-table .gathering-card.filter-point-masked .card-items-list img.item-icon {
    opacity: 0.7;
    filter: grayscale(50%);
}

.filter-static-table .gathering-card.filter-point-masked .item-chk-box {
    opacity: 0.45;
}

.filter-static-table .card-items-list li.filter-item-masked .item-name-link {
    color: #64748b !important;
    text-decoration: none !important;
}

.filter-static-table .card-items-list li.filter-item-masked .item-level-stars,
.filter-static-table .card-items-list li.filter-item-masked .reductions-chain {
    color: #94a3b8 !important;
    opacity: 0.8;
}

.filter-static-table .card-items-list li.filter-item-masked img.item-icon {
    opacity: 0.5;
    filter: grayscale(80%);
}

/* カードおよびアイテムのチェックボックス */
.card-chk-point {
    width: 15px;
    height: 15px;
    accent-color: #2563eb;
    cursor: pointer;
    margin-right: 4px;
    vertical-align: middle;
}

.item-chk-box {
    width: 14px;
    height: 14px;
    accent-color: #2563eb;
    cursor: pointer;
    margin-right: 4px;
    vertical-align: middle;
}

/* リアルタイム表への反映 (非表示クラス) */
.gathering-card.applied-class-hidden {
    display: none !important;
}

.gathering-card.applied-point-hidden {
    display: none !important;
}

.card-items-list li.applied-item-hidden {
    display: none !important;
}

/* 列全体の非表示 */
.table-hide-col-unknown .col-unknown-th,
.table-hide-col-unknown .col-unknown-td {
    display: none !important;
}

.table-hide-col-ephemeral .col-ephemeral-th,
.table-hide-col-ephemeral .col-ephemeral-td {
    display: none !important;
}

/* ==========================================================================
   タイプ・レベルで一括選択モーダル スタイル
   ========================================================================== */
.batch-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(2px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}

.batch-modal-dialog {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 460px;
    max-height: 85vh;
    max-height: 85dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #cbd5e1;
}

.batch-modal-header {
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.batch-modal-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.batch-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-batch-close {
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.12s;
}

.btn-batch-close:hover {
    background: #e2e8f0;
    color: #334155;
}

.btn-batch-confirm {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    background: #2563eb;
    border: 1px solid #1d4ed8;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.12s;
}

.btn-batch-confirm:hover {
    background: #1d4ed8;
}

.batch-modal-exp-name {
    font-size: 13px;
    font-weight: 700;
    color: #2563eb;
    margin-left: 4px;
}

.batch-modal-body {
    padding: 10px 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.batch-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: center;
}

.batch-matrix-table th,
.batch-matrix-table td {
    border: 1px solid #cbd5e1;
    padding: 6px 8px;
    vertical-align: middle;
}

.batch-matrix-table th {
    background: #f1f5f9;
    color: #1e293b;
    font-weight: 700;
}

.matrix-lv-td {
    font-weight: 700;
    color: #0f172a;
    background: #f8fafc;
    width: 84px;
}

.matrix-none {
    color: #94a3b8;
    font-weight: 600;
    font-size: 14px;
}

.batch-cell-btn {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.12s ease;
    min-width: 54px;
}

.batch-cell-btn.is-on {
    background: #22c55e;
    border: 1px solid #16a34a;
    color: #ffffff;
}

.batch-cell-btn.is-off {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #94a3b8;
}
