/* ================================================
   MALASADA Integrated Marketing Platform Styles
   Prefix: .ig- (integrated)
   Uses CSS variables from base.css
   ================================================ */

/* ===== Layout ===== */
.ig-wrap { padding: 0 4px; max-width: 1280px; margin: 0 auto; }
.ig-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.ig-head h2 { margin: 0; font-size: 22px; font-weight: 700; }
.ig-head-sub { margin: 4px 0 0; font-size: 13px; color: var(--text-sub); }
.ig-head-meta { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.ig-head-actions { display: flex; gap: 8px; align-items: center; }
.ig-breadcrumb { font-size: 12px; color: var(--text-sub); margin-bottom: 4px; }
.ig-breadcrumb a { color: var(--accent); text-decoration: none; }
.ig-breadcrumb a:hover { text-decoration: underline; }
.ig-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

/* ===== Loading / Error / Empty ===== */
.ig-loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 80px 20px; color: var(--text-sub); font-size: 14px; }
.ig-spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: ig-spin 0.7s linear infinite; }
@keyframes ig-spin { to { transform: rotate(360deg); } }
.ig-error { padding: 40px; text-align: center; color: #ef4444; background: #fef2f2; border-radius: 12px; }
.ig-empty { padding: 48px 20px; text-align: center; color: var(--text-sub); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; font-size: 14px; }
.ig-empty-sm { padding: 24px; text-align: center; color: var(--text-sub); font-size: 13px; }
.ig-info-box { background: #eff6ff; color: #1e40af; padding: 12px 16px; border-radius: 8px; font-size: 13px; line-height: 1.6; margin-bottom: 20px; }
[data-theme="dark"] .ig-info-box { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .ig-error { background: #451a1a; }

/* ===== Cards ===== */
.ig-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.ig-card-title { margin: 0 0 16px; font-size: 15px; font-weight: 700; }
.ig-card-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.ig-card-highlight { border-left: 4px solid var(--accent); }
.ig-card-footer { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.ig-subtitle { font-size: 13px; font-weight: 600; color: var(--text-sub); margin: 20px 0 12px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ===== KPI Cards ===== */
.ig-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.ig-kpi-row-5 { grid-template-columns: repeat(5, 1fr); }
.ig-kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow); }
.ig-kpi-label { font-size: 12px; color: var(--text-sub); font-weight: 500; margin-bottom: 6px; }
.ig-kpi-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.ig-kpi-unit { font-size: 14px; font-weight: 500; color: var(--text-sub); margin-left: 2px; }
.ig-kpi-sub { font-size: 11px; color: var(--text-sub); margin-top: 4px; }
.ig-kpi-delta { font-size: 11px; margin-top: 6px; font-weight: 500; }
.ig-positive { color: #16a34a; }
.ig-negative { color: #dc2626; }
.ig-source-row { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin-bottom: 24px; box-shadow: var(--shadow); }
.ig-source-row-label { font-size: 12px; color: var(--text-sub); font-weight: 500; margin-bottom: 12px; }
.ig-source-items { display: flex; flex-wrap: wrap; gap: 10px; }
.ig-source-item { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; }
.ig-source-name { font-size: 12px; font-weight: 600; color: #fff; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.ig-source-count { font-size: 18px; font-weight: 700; line-height: 1; }
.ig-source-count-unit { font-size: 11px; color: var(--text-sub); margin-left: 2px; }
.ig-neutral { color: var(--text-sub); }
[data-theme="dark"] .ig-positive { color: #4ade80; }
[data-theme="dark"] .ig-negative { color: #f87171; }

/* ===== Badges ===== */
.ig-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; background: var(--bdg-bg, var(--bg)); color: var(--bdg-c, var(--text-sub)); }
.ig-badge-poki { background: #dcfce7 !important; color: #16a34a !important; }
.ig-badge-poki-pending { background: #fef3c7 !important; color: #92400e !important; }
[data-theme="dark"] .ig-badge-poki { background: #14532d !important; color: #4ade80 !important; }
[data-theme="dark"] .ig-badge-poki-pending { background: #78350f !important; color: #fcd34d !important; }
.ig-status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.ig-status-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--dot-color, #9ca3af); }
.ig-signal { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.ig-signal-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--sig-color); box-shadow: 0 0 8px var(--sig-color); animation: ig-pulse 1.5s ease-in-out infinite; }
@keyframes ig-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ===== Buttons ===== */
.ig-btn-primary { background: var(--accent); color: #fff; border: none; padding: 10px 20px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; font-family: inherit; transition: opacity 0.15s, transform 0.1s; white-space: nowrap; }
.ig-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.ig-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.ig-btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); padding: 10px 20px; border-radius: 8px; font-weight: 500; font-size: 13px; cursor: pointer; font-family: inherit; transition: border-color 0.15s, color 0.15s; }
.ig-btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.ig-btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 6px; border: 1px solid var(--border); background: transparent; cursor: pointer; font-family: inherit; font-weight: 500; transition: all 0.15s; }
.ig-btn-sm:hover { border-color: var(--btn-color, var(--accent)); color: var(--btn-color, var(--accent)); }
.ig-btn-primary.ig-btn-sm { background: var(--accent); color: #fff; border-color: var(--accent); }
.ig-btn-active { background: var(--btn-color, var(--accent)) !important; color: #fff !important; border-color: var(--btn-color, var(--accent)) !important; }
.ig-btn-icon { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all 0.15s; }
.ig-btn-icon:hover { border-color: var(--accent); color: var(--accent); }
.ig-btn-icon-sm { background: none; border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; cursor: pointer; font-size: 12px; line-height: 1; transition: all 0.15s; color: var(--text-sub); }
.ig-btn-icon-sm:hover { border-color: var(--accent); color: var(--accent); }
.ig-btn-icon-sm:disabled { opacity: 0.3; cursor: not-allowed; }
.ig-btn-danger-icon:hover { border-color: #ef4444 !important; color: #ef4444 !important; }
.ig-btn-link { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 12px; padding: 4px 0; font-family: inherit; }
.ig-btn-link:hover { text-decoration: underline; }
.ig-btn-full { width: 100%; margin-top: 12px; }
.ig-btn-copy { font-size: 12px; padding: 6px 14px; }
.ig-link { color: var(--accent); text-decoration: none; font-size: 13px; }
.ig-link:hover { text-decoration: underline; }

/* ===== Forms ===== */
.ig-field { margin-bottom: 16px; }
.ig-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.ig-required { color: #ef4444; }
.ig-input, .ig-select, .ig-textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; background: var(--surface); color: var(--text); box-sizing: border-box; transition: border-color 0.15s; }
.ig-input:focus, .ig-select:focus, .ig-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ig-textarea { min-height: 80px; resize: vertical; }
.ig-field-hint { color: var(--text-sub); font-size: 11px; margin-top: 4px; }
.ig-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ig-search { max-width: 240px; }
.ig-radio-group { display: flex; gap: 16px; flex-wrap: wrap; }
.ig-radio { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.ig-radio input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.ig-radio-mark { width: 18px; height: 18px; border: 2px solid var(--border); border-radius: 50%; position: relative; transition: border-color 0.15s; flex-shrink: 0; }
.ig-radio input:checked + .ig-radio-mark { border-color: var(--accent); }
.ig-radio input:checked + .ig-radio-mark::after { content: ''; position: absolute; top: 3px; left: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ig-checkbox { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; }
.ig-checkbox input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.ig-checkbox-mark { width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 6px; position: relative; transition: all 0.15s; flex-shrink: 0; }
.ig-checkbox input:checked + .ig-checkbox-mark { background: var(--accent); border-color: var(--accent); }
.ig-checkbox input:checked + .ig-checkbox-mark::after { content: '✓'; position: absolute; top: -1px; left: 3px; color: #fff; font-size: 14px; font-weight: 700; }
.ig-checkbox-sm { display: flex; align-items: center; gap: 4px; font-size: 11px; white-space: nowrap; }
.ig-checkbox-sm input { width: 14px; height: 14px; }

/* ===== Tabs ===== */
.ig-section-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.ig-section-tab { background: none; border: none; padding: 12px 20px; cursor: pointer; font-size: 13px; color: var(--text-sub); border-bottom: 2px solid transparent; margin-bottom: -2px; font-weight: 500; font-family: inherit; white-space: nowrap; transition: all 0.15s; }
.ig-section-tab:hover { color: var(--text); }
.ig-section-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.ig-tab-panel { display: none; }
.ig-tab-panel.active { display: block; }

/* ===== Filter Row ===== */
.ig-filter-row { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.ig-filter-row .ig-select { width: auto; min-width: 140px; padding: 7px 10px; font-size: 12px; }
.ig-filter-row .ig-input { padding: 7px 10px; font-size: 12px; }

/* ===== Period Select ===== */
.ig-period-select { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ig-period-btn { background: transparent; border: none; padding: 8px 16px; font-size: 12px; cursor: pointer; font-family: inherit; color: var(--text-sub); transition: all 0.15s; }
.ig-period-btn:not(:last-child) { border-right: 1px solid var(--border); }
.ig-period-btn.active { background: var(--accent); color: #fff; }

/* ===== Tables ===== */
.ig-table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border); }
.ig-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 13px; }
.ig-table th { background: var(--bg); text-align: left; padding: 10px 14px; font-size: 11px; color: var(--text-sub); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ig-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ig-table tbody tr:last-child td { border-bottom: none; }
.ig-table-row { cursor: pointer; transition: background 0.1s; }
.ig-table-row:hover { background: var(--accent-soft); }
.ig-table-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 参加者一覧: クリックで並び替えできる列ヘッダ。押せることが分かるようカーソルと
   hover 色を付け、現在のソート列は文字色を強めて矢印（▲▼）を出す。 */
.pm-sortable { cursor: pointer; user-select: none; }
.pm-sortable:hover { background: var(--accent-soft); }
.pm-sortable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pm-sortable.pm-sorted { color: var(--text); }
.pm-sort-arrow { font-size: 10px; }

/* 参加者一覧: メモのインライン編集（フォーム申込行のみ .pm-notes-editable が付く）。
   編集できるセルだと分かるよう hover で枠を出し、鉛筆カーソルにする。 */
.pm-notes-cell { max-width: 240px; }
.pm-notes-editable { cursor: text; }
.pm-notes-editable:hover { box-shadow: inset 0 0 0 1px var(--accent); border-radius: 4px; background: var(--accent-soft); }
.pm-notes-input { width: 100%; min-width: 150px; box-sizing: border-box; }

/* 参加者管理の操作列（削除ボタン）を右端に固定する。列が16個あり横スクロールしないと
   最終列に到達しないため、スクロールせずに存在が分かるようにする。
   ヘッダとセルの背景は下の行が透けないよう不透明にし、境目に影を付けて
   「ここから先は固定列」と分かるようにする。 */
#pmTable th:last-child,
#pmTable td:last-child {
  position: sticky;
  right: 0;
  background: var(--surface);
  box-shadow: -8px 0 8px -8px rgba(0, 0, 0, 0.18);
}
#pmTable th:last-child { background: var(--bg); z-index: 2; }
#pmTable td:last-child { z-index: 1; }
/* 行 hover 時は固定列も同じ色に揃える（固定列だけ白く浮かないように）。 */
#pmTable .ig-table-row:hover td:last-child { background: var(--accent-soft); }

/* 参加者管理の名前列を左端に固定する。列が16個あり、右側の ○× 列（参加・面談・
   入会・入金）を見るには横スクロールが必要だが、スクロールすると名前が画面外へ出て
   「誰にどのマークが付いているか」が分からなくなる。
   ★名前より左の4列（No./流入経路/申込日/セミナー日）は固定せず、名前セルの下へ
     潜らせる。左側を全部固定すると幅を取りすぎて ○× 列を見る領域が無くなるため。
   ★hover の行背景も名前セルに追従させる（背景を不透明に塗るので、指定しないと
     行をなぞったとき名前セルだけ色が変わらない）。操作列の固定と同じ理由。 */
#pmTable th.pm-name-cell,
#pmTable td.pm-name-cell {
  position: sticky;
  left: 0;
  background: var(--surface);
  box-shadow: 8px 0 8px -8px rgba(0, 0, 0, 0.18);
}
#pmTable th.pm-name-cell { background: var(--bg); z-index: 2; }
#pmTable td.pm-name-cell { z-index: 1; }
#pmTable .ig-table-row:hover td.pm-name-cell { background: var(--accent-soft); }

/* 固定列の幅に上限を置く。
   ★このセルには氏名に加えてバッジ（テスト／同期済み✅・重複／⚠氏名重複?）が
     最大4つ横に並び、幅無制限だと最も賑やかな1行が列幅を決めて 400px 級になる。
     固定列がその幅を取ると、上のコメントで避けたかった「左側が幅を取りすぎて
     ○× 列を見る領域が無くなる」状態に条件付きで戻る（ノートPCの幅で特に効く）。
   ★はみ出して切れるのは末尾のバッジ側で、氏名は先頭なので必ず残る。固定した目的が
     「氏名を常に見せる」ことなので、優先順位はこれで合っている。
     .ig-row-fixed td が nowrap + overflow:hidden + ellipsis を持つため「…」で示される。 */
#pmTable td.pm-name-cell { max-width: 320px; }
.ig-table-name { font-weight: 600; max-width: 280px; }
.ig-table-actions { display: flex; gap: 4px; white-space: nowrap; }
.ig-table-compact th, .ig-table-compact td { padding: 8px 12px; }
.ig-text-sub { color: var(--text-sub); font-size: 12px; }
.ig-text-truncate { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-text-accent { color: var(--accent); font-weight: 600; }

/* ===== Pagination ===== */
.ig-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 0; font-size: 13px; color: var(--text-sub); }

/* ===== Bar Charts ===== */
.ig-bar-chart { display: flex; flex-direction: column; gap: 10px; }
.ig-bar-row { display: flex; align-items: center; gap: 10px; }
.ig-bar-label { width: 100px; font-size: 12px; color: var(--text-sub); text-align: right; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-bar-track { flex: 1; height: 24px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.ig-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.5s ease; min-width: 2px; }
.ig-bar-accent { background: var(--accent); }
.ig-bar-val { width: 70px; font-size: 12px; font-weight: 600; text-align: right; flex-shrink: 0; }

/* ===== Mini Chart (daily trend) ===== */
.ig-mini-chart { display: flex; align-items: flex-end; gap: 2px; height: 80px; padding: 4px 0; }
.ig-mini-bar { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 3px; transition: height 0.3s ease; cursor: default; }
.ig-mini-bar:hover { opacity: 0.8; }

/* ===== Funnel ===== */
.ig-funnel { padding: 8px 0; }
.ig-funnel-step { margin-bottom: 4px; }
.ig-funnel-bar { background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; min-width: 120px; transition: width 0.5s ease; }
.ig-funnel-stage { font-weight: 700; }
.ig-funnel-nums { font-size: 12px; opacity: 0.9; }
.ig-funnel-arrow { text-align: center; color: var(--text-sub); font-size: 10px; margin: 2px 0; }

/* ===== Attendance Chart (B-1) ===== */
.ig-attendance-chart { display: flex; align-items: flex-end; gap: 12px; height: 140px; padding: 12px 0; }
.ig-att-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.ig-att-fill { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; display: flex; align-items: flex-start; justify-content: center; padding-top: 6px; transition: height 0.5s ease; min-height: 20px; }
.ig-att-val { font-size: 11px; font-weight: 700; color: #fff; }
.ig-att-label { font-size: 10px; color: var(--text-sub); white-space: nowrap; }

/* ===== Today's Webinar (B-1) ===== */
.ig-today-info { margin-bottom: 16px; }
.ig-today-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.ig-today-meta { display: flex; gap: 16px; align-items: center; font-size: 13px; color: var(--text-sub); flex-wrap: wrap; }
.ig-today-stats { display: flex; gap: 32px; margin-top: 16px; }
.ig-stat-item { display: flex; flex-direction: column; align-items: center; }
.ig-stat-num { font-size: 32px; font-weight: 700; color: var(--accent); }
.ig-stat-label { font-size: 12px; color: var(--text-sub); }

/* ===== Targets Chart (B-4) ===== */
.ig-targets-chart { display: flex; flex-direction: column; gap: 12px; }
.ig-target-row { display: flex; align-items: center; gap: 10px; }
.ig-target-label { width: 90px; font-size: 12px; text-align: right; flex-shrink: 0; }
.ig-target-bars { flex: 1; height: 20px; background: var(--bg); border-radius: 4px; position: relative; overflow: visible; }
.ig-target-actual { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.5s ease; }
.ig-target-line { position: absolute; top: -4px; width: 2px; height: 28px; background: #ef4444; }
.ig-target-vals { width: 160px; font-size: 11px; color: var(--text-sub); text-align: right; flex-shrink: 0; }

/* ===== Percent Bar ===== */
.ig-pct-bar { display: flex; align-items: center; gap: 8px; min-width: 100px; }
.ig-pct-track { flex: 1; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.ig-pct-fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
.ig-pct-bar span { font-size: 11px; font-weight: 600; white-space: nowrap; }

/* ===== API Status ===== */
.ig-api-status { display: flex; gap: 24px; flex-wrap: wrap; }
.ig-api-item { display: flex; align-items: center; gap: 8px; }
.ig-api-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ig-api-name { font-size: 13px; font-weight: 600; }
.ig-api-label { font-size: 12px; color: var(--text-sub); }

/* ===== Calendar (B-2) ===== */
.ig-calendar { margin-bottom: 8px; }
/* 曜日ヘッダーとセル本体は別 grid のため、列幅は minmax(0,1fr) で固定する。
   1fr だけだと grid アイテムの既定 min-width:auto により、長いウェビナー名
   (.ig-cal-event は nowrap) がセルを押し広げて本体側の列幅だけが変わり、
   曜日と日付がズレる。 */
.ig-cal-header { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; margin-bottom: 4px; }
.ig-cal-dow { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-sub); padding: 6px 0; }
.ig-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; }
.ig-cal-cell { min-width: 0; min-height: 80px; padding: 4px 6px; border: 1px solid var(--border); background: var(--surface); border-radius: 4px; }
.ig-cal-empty { background: var(--bg); border-color: transparent; }
.ig-cal-num { font-size: 12px; font-weight: 600; display: block; margin-bottom: 4px; }
.ig-cal-today { background: var(--accent-soft); }
.ig-cal-today .ig-cal-num { color: var(--accent); }
.ig-cal-event { font-size: 9px; padding: 2px 4px; border-radius: 3px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

/* ===== Checklist (B-2) ===== */
.ig-checklist { display: flex; gap: 4px; flex-wrap: wrap; }
.ig-check-item { font-size: 10px; padding: 2px 6px; border-radius: 3px; background: var(--bg); color: var(--text-sub); }
.ig-check-done { background: #dcfce7; color: #16a34a; }
[data-theme="dark"] .ig-check-done { background: #14532d; }

/* ===== Video Library (B-3) ===== */
.ig-video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.ig-video-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s; }
.ig-video-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.ig-video-thumb { position: relative; background: var(--bg); height: 120px; display: flex; align-items: center; justify-content: center; }
.ig-video-icon { width: 64px; height: 64px; }
.ig-video-duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.75); color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.ig-video-info { padding: 16px; }
.ig-video-info h4 { margin: 0 0 8px; font-size: 14px; word-break: break-all; }
.ig-video-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-sub); margin-bottom: 8px; }
.ig-video-usage { margin-top: 8px; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

/* ===== Alert Card ===== */
.ig-alert-card { background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; padding: 16px 20px; margin-bottom: 20px; }
.ig-alert-card h4 { margin: 0 0 10px; font-size: 14px; color: #dc2626; }
.ig-alert-item { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; }
.ig-alert-icon { font-size: 16px; }
[data-theme="dark"] .ig-alert-card { background: #451a1a; border-color: #7f1d1d; }

/* ===== Modal ===== */
.ig-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 500; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; }
.ig-modal.active { display: flex; }
.ig-modal-card { background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); animation: ig-modal-in 0.2s ease; }
.ig-modal-lg { max-width: 680px; }
@keyframes ig-modal-in { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.ig-modal-head { padding: 16px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.ig-modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.ig-modal-close-btn { background: none; border: none; font-size: 22px; color: var(--text-sub); cursor: pointer; padding: 0; width: 32px; height: 32px; line-height: 1; border-radius: 6px; transition: all 0.15s; }
.ig-modal-close-btn:hover { background: var(--border); color: var(--text); }
.ig-modal-body { padding: 20px 24px; max-height: 70vh; overflow-y: auto; }
.ig-modal-foot { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ===== Detail Modal ===== */
.ig-detail-section { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.ig-detail-section:last-child { border-bottom: none; margin-bottom: 0; }
.ig-detail-section h4 { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.5px; }
.ig-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ig-detail-item { display: flex; flex-direction: column; gap: 2px; }
.ig-detail-label { font-size: 11px; color: var(--text-sub); }

/* ===== Edit Grid (participant manual edit) ===== */
.ig-edit-grid { display: flex; flex-direction: column; gap: 10px; }
.ig-edit-row { display: flex; align-items: center; gap: 12px; }
.ig-edit-row .ig-detail-label { min-width: 80px; flex-shrink: 0; }
.ig-edit-row .ig-select.ig-select-sm { width: auto; min-width: 110px; padding: 6px 10px; font-size: 13px; }
.ig-edit-row .ig-input.ig-input-sm { width: auto; min-width: 140px; }

/* ===== Timeline ===== */
.ig-timeline { display: flex; flex-direction: column; gap: 0; }
.ig-timeline-step { display: flex; align-items: center; gap: 12px; padding: 8px 0; position: relative; }
.ig-timeline-step:not(:last-child)::after { content: ''; position: absolute; left: 9px; top: 32px; width: 2px; height: calc(100% - 16px); background: var(--border); }
.ig-timeline-active:not(:last-child)::after { background: var(--accent); }
.ig-timeline-dot { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; z-index: 1; }
.ig-timeline-content { display: flex; flex-direction: column; gap: 2px; }
.ig-timeline-content strong { font-size: 13px; }

/* ===== Status Actions ===== */
.ig-status-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== Field Builder (A-2) ===== */
.ig-field-builder { margin-bottom: 16px; }
.ig-field-item { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: var(--surface); }
.ig-field-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ig-field-num { background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.ig-field-label-input { flex: 1; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; min-width: 120px; background: var(--surface); color: var(--text); }
.ig-field-type-tag { background: #eff6ff; color: #1e40af; font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
[data-theme="dark"] .ig-field-type-tag { background: #1e3a5f; color: #93c5fd; }
.ig-field-item-actions { display: flex; gap: 4px; margin-left: auto; }
.ig-field-options { padding: 10px 0 0 32px; }
.ig-opt-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.ig-opt-input { flex: 1; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; background: var(--surface); color: var(--text); }

/* ===== Type Grid (A-2 modal) ===== */
.ig-type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
.ig-type-btn { background: var(--surface); border: 1px solid var(--border); padding: 14px; border-radius: 8px; cursor: pointer; text-align: left; transition: all 0.15s; }
.ig-type-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.ig-type-btn strong { font-size: 13px; }

/* ===== Template Cards (A-4) ===== */
.ig-template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.ig-template-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s; }
.ig-template-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.ig-template-system { border-top: 3px solid #2563eb; }
.ig-template-header { display: flex; gap: 8px; margin-bottom: 12px; }
.ig-template-name { margin: 0 0 8px; font-size: 16px; }
.ig-template-desc { font-size: 13px; color: var(--text-sub); margin: 0 0 12px; line-height: 1.5; }
.ig-template-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-sub); margin-bottom: 12px; }
.ig-template-fields { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.ig-template-field-tag { background: var(--bg); padding: 2px 8px; border-radius: 4px; font-size: 11px; color: var(--text-sub); }

/* ===== Form Actions (A-2) ===== */
.ig-form-wrap { max-width: 800px; }
.ig-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .ig-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .ig-kpi-row-5 { grid-template-columns: repeat(3, 1fr); }
  .ig-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .ig-wrap { padding: 0; }
  .ig-head { flex-direction: column; }
  .ig-kpi-row, .ig-kpi-row-5 { grid-template-columns: 1fr 1fr; }
  .ig-filter-row { flex-direction: column; }
  .ig-filter-row .ig-select, .ig-filter-row .ig-input { width: 100%; max-width: none; }
  .ig-field-row { grid-template-columns: 1fr; }
  .ig-section-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ig-today-stats { gap: 20px; }
  .ig-detail-grid { grid-template-columns: 1fr; }
  .ig-cal-cell { min-height: 60px; }
  .ig-cal-event { font-size: 8px; }
  .ig-template-grid { grid-template-columns: 1fr; }
  .ig-video-grid { grid-template-columns: 1fr; }
  .ig-modal-card { margin: 0 auto; }
  .ig-attendance-chart { height: 100px; }
  .ig-type-grid { grid-template-columns: 1fr; }
  .ig-bar-label { width: 70px; }
}

/* ===== Toast Notification ===== */
.ig-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); padding: 12px 24px; border-radius: 10px; font-size: 14px; font-weight: 600; z-index: 9999; opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none; box-shadow: 0 8px 30px rgba(0,0,0,0.15); }
.ig-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ig-toast-success { background: #16a34a; color: #fff; }
.ig-toast-error { background: #dc2626; color: #fff; }
.ig-toast-info { background: #2563eb; color: #fff; }
/* warning: 処理は通ったが注意して読んでほしいとき（同期の一部除外・スキップ等）。
   success(緑) と混ぜると見落とすため琥珀色で出す。 */
.ig-toast-warning { background: #b45309; color: #fff; }

/* ===== Form Create Enhancements ===== */
.ig-copy-row { display: flex; gap: 8px; align-items: center; }
.ig-copy-row .ig-input { flex: 1; }
.ig-code-input { font-family: monospace; font-size: 12px; }
.ig-code-inline { font-family: monospace; font-size: 12px; background: var(--bg); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
.ig-qr-preview { display: flex; align-items: flex-end; gap: 16px; }
.ig-qr-img { border-radius: 8px; border: 1px solid var(--border); }
.ig-qr-card { margin-bottom: 20px; }
.ig-qr-card-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ig-qr-card-inner code { font-size: 12px; color: var(--text-sub); word-break: break-all; }
.ig-publish-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.ig-var-buttons { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.ig-var-btn { font-family: monospace; font-size: 11px; }

/* ===== Detail Modal Enhancements ===== */
.ig-timeline-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ig-record-btn { font-size: 11px !important; padding: 3px 10px !important; }
.ig-input-sm { padding: 6px 10px; font-size: 13px; }
.ig-btn-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; cursor: pointer; font-family: inherit; font-weight: 500; transition: all 0.15s; }
.ig-btn-danger:hover { background: #dc2626; color: #fff; }
[data-theme="dark"] .ig-btn-danger { background: #451a1a; border-color: #7f1d1d; }
[data-theme="dark"] .ig-btn-danger:hover { background: #dc2626; }

/* ===== Landing Cards (Scenario Management) ===== */
.ig-landing-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.ig-landing-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; display: flex; flex-direction: column; align-items: flex-start; min-height: 200px; }
.ig-landing-card:hover { border-color: var(--accent); box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.ig-landing-card:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.ig-landing-icon { font-size: 40px; margin-bottom: 16px; }
.ig-landing-card h3 { margin: 0 0 10px; font-size: 20px; font-weight: 700; }
.ig-landing-card p { margin: 0 0 16px; font-size: 14px; color: var(--text-sub); line-height: 1.7; }

/* ===== Score Chart (Scenario PDCA) ===== */
.ig-score-chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 8px 0; }
.ig-score-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; cursor: default; }
.ig-score-fill { width: 100%; border-radius: 3px 3px 0 0; transition: height 0.4s ease; min-height: 4px; }
.ig-score-label { font-size: 9px; color: var(--text-sub); white-space: nowrap; }

/* ===== Document Links ===== */
.ig-doc-link { color: #2563eb; text-decoration: none; font-size: 12px; font-weight: 500; white-space: nowrap; }
.ig-doc-link:hover { text-decoration: underline; }
.ig-doc-link-folder { color: var(--text-sub); }

/* ===== Emergency Stop Button ===== */
.ig-btn-emergency { background: #dc2626; color: #fff; border: none; padding: 8px 16px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; transition: opacity 0.15s, transform 0.1s; }
.ig-btn-emergency:hover { opacity: 0.9; transform: translateY(-1px); }
.ig-btn-emergency:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ===== Today Header ===== */
.ig-today-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.ig-today-signal { display: flex; align-items: center; gap: 10px; cursor: help; }
.ig-signal-light { width: 18px; height: 18px; border-radius: 50%; background: var(--sig-color); box-shadow: 0 0 12px var(--sig-color); animation: ig-pulse 1.5s ease-in-out infinite; }
.ig-signal-text { font-size: 16px; font-weight: 700; }
.ig-card-today { border-left: 5px solid var(--accent); }

/* ===== Preparation Checklist ===== */
.ig-check-label { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.ig-check-label input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; }

/* ===== Metric NA/Pending Badges ===== */
.ig-metric-na, .ig-metric-pending { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; cursor: help; white-space: nowrap; }
.ig-metric-na { background: var(--bg); color: var(--text-sub); }
.ig-metric-pending { background: #fef3c7; color: #92400e; }
[data-theme="dark"] .ig-metric-pending { background: #78350f; color: #fcd34d; }

/* ===== Elapsed Timer ===== */
.ig-timer { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); margin: 8px 0; }
.ig-timer-sub { font-size: 13px; font-weight: 400; color: var(--text-sub); margin-left: 8px; }

/* ===== Section Header ===== */
.ig-section-header { margin: 28px 0 16px; }
.ig-section-header h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.ig-section-header p { margin: 0; font-size: 12px; color: var(--text-sub); }

/* ===== Status Marks (〇/×/－) ===== */
.ig-mark { font-weight: 700; font-size: 14px; }
.ig-mark-yes { color: #22c55e; }
.ig-mark-no { color: #ef4444; }
.ig-mark-na { color: #9ca3af; }

/* ===== Fixed Row Height (Participant Table) ===== */
.ig-row-fixed td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 40px; max-height: 40px; padding-top: 6px; padding-bottom: 6px; }

/* ===== MacBook Device Frame ===== */
.ig-device { margin: 0 auto 28px; display: flex; flex-direction: column; align-items: center; }
.ig-device-bezel {
  background: linear-gradient(180deg, #2d2d2f 0%, #1a1a1c 4%, #111113 100%);
  border-radius: 12px 12px 0 0;
  padding: 6px 6px 0;
  width: 100%; max-width: 820px;
  box-shadow: 0 0 0 1px #3a3a3c, 0 0 0 2px #111, 0 25px 70px rgba(0,0,0,0.4), 0 8px 20px rgba(0,0,0,0.2);
  position: relative;
}
.ig-device-topbar { display: none; }
.ig-device-notch-mac {
  width: 16px; height: 5px;
  background: radial-gradient(circle at center, #2a2a2c, #1a1a1c);
  border-radius: 0 0 4px 4px;
  margin: 0 auto 3px;
  position: relative;
}
.ig-device-notch-mac::after {
  content: ''; width: 3px; height: 3px; border-radius: 50%;
  background: radial-gradient(circle, #3a3a3e, #222);
  box-shadow: 0 0 2px rgba(100,100,120,0.3);
  position: absolute; top: 1px; left: 50%; transform: translateX(-50%);
}
.ig-device-screen {
  position: relative; overflow: hidden;
  border-radius: 4px 4px 0 0;
  box-shadow: 0 0 0 1px #000 inset;
}
.ig-device-chin {
  height: 14px;
  background: linear-gradient(180deg, #111113 0%, #1a1a1c 100%);
  border-radius: 0 0 2px 2px; margin: 0 6px;
}
.ig-device-body {
  background: linear-gradient(180deg, #9d9da0 0%, #bbbbbe 15%, #c8c8cb 50%, #b0b0b3 85%, #9a9a9d 100%);
  height: 10px; border-radius: 0 0 4px 4px;
  margin: 0 -1px; position: relative;
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 -1px 0 rgba(0,0,0,0.08) inset, 0 2px 6px rgba(0,0,0,0.12);
}
.ig-device-hinge {
  width: 16%; height: 3px;
  background: linear-gradient(180deg, #a8a8ab 0%, #8a8a8d 100%);
  border-radius: 0 0 2px 2px; margin: 0 auto;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.ig-device-base {
  width: 58%; height: 5px;
  background: linear-gradient(180deg, #d2d2d5 0%, #c0c0c3 40%, #b8b8bb 60%, #c5c5c8 100%);
  border-radius: 0 0 8px 8px; margin: 0 auto;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1), 0 1px 0 rgba(255,255,255,0.5) inset;
}

/* ===== Broadcast Preview Screen ===== */
.ig-preview { background: #0f172a; overflow: hidden; position: relative; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; }
.ig-preview-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; color: #94a3b8; text-align: center; padding: 24px; width: 100%; }
.ig-preview-icon { width: 48px; height: 48px; opacity: 0.5; }
.ig-preview-status { font-size: 15px; font-weight: 600; color: #cbd5e1; }
.ig-preview-sub { font-size: 12px; color: #64748b; }
.ig-preview-live { color: #22c55e; }
.ig-preview-live .ig-preview-status { color: #22c55e; }
.ig-preview-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.ig-preview-badge-live { background: rgba(34,197,94,0.15); color: #22c55e; }
.ig-preview-badge-standby { background: rgba(100,116,139,0.2); color: #94a3b8; }
.ig-preview-badge-preparing { background: rgba(234,179,8,0.15); color: #eab308; }
.ig-preview-badge-dot { width: 8px; height: 8px; border-radius: 50%; animation: ig-pulse 1.5s ease-in-out infinite; }
.ig-preview-countdown { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; color: #e2e8f0; margin-top: 4px; }
.ig-preview-simulated { position: absolute; inset: 0; background: #1a1a2e; display: flex; flex-direction: column; }
.ig-zoom-topbar { height: 28px; background: #232336; display: flex; align-items: center; padding: 0 12px; gap: 8px; }
.ig-zoom-topbar-title { font-size: 10px; color: #aaa; flex: 1; }
.ig-zoom-topbar-dot { width: 6px; height: 6px; border-radius: 50%; }
.ig-zoom-main { flex: 1; position: relative; display: flex; background: linear-gradient(135deg, #16213e 0%, #0f3460 50%, #1a1a2e 100%); }
.ig-zoom-slide { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.ig-zoom-slide-title { font-size: 18px; font-weight: 700; color: #e2e8f0; text-align: center; margin-bottom: 8px; }
.ig-zoom-slide-sub { font-size: 11px; color: #64748b; text-align: center; }
.ig-zoom-slide-bullets { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.ig-zoom-slide-bullet { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); }
.ig-zoom-pip { position: absolute; top: 8px; left: 8px; width: 100px; height: 70px; border-radius: 6px; background: #2a2a3e; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.1); }
.ig-zoom-pip-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #4a5568, #2d3748); display: flex; align-items: center; justify-content: center; }
.ig-zoom-pip-name { position: absolute; bottom: 3px; left: 5px; font-size: 7px; color: #ccc; background: rgba(0,0,0,0.5); padding: 1px 4px; border-radius: 2px; }
.ig-zoom-controls { height: 36px; background: #232336; display: flex; align-items: center; justify-content: center; gap: 16px; }
.ig-zoom-ctrl-btn { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: none; cursor: default; }
.ig-zoom-ctrl-default { background: #3a3a50; }
.ig-zoom-ctrl-red { background: #dc2626; }
@media (max-width: 640px) {
  .ig-zoom-pip { width: 70px; height: 50px; }
  .ig-zoom-slide-title { font-size: 13px; }
  .ig-zoom-topbar, .ig-zoom-controls { height: 24px; }
  .ig-zoom-ctrl-btn { width: 22px; height: 22px; }
}
.ig-preview-overlay { position: absolute; top: 12px; left: 12px; display: flex; gap: 8px; z-index: 1; }
.ig-preview-overlay-right { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; z-index: 1; }
.ig-preview-timer { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; background: rgba(0,0,0,0.6); padding: 4px 10px; border-radius: 6px; }
.ig-preview-viewers { font-size: 13px; color: #fff; background: rgba(0,0,0,0.6); padding: 4px 10px; border-radius: 6px; display: flex; align-items: center; gap: 4px; }

/* ===== Broadcast Step Indicator ===== */
.ig-steps { display: flex; align-items: center; gap: 0; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; }
.ig-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.ig-step-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text-sub); transition: all 0.3s; z-index: 1; }
.ig-step-label { font-size: 11px; color: var(--text-sub); font-weight: 500; }
.ig-step-line { position: absolute; top: 14px; left: calc(50% + 14px); width: calc(100% - 28px); height: 2px; background: var(--border); }
.ig-step:last-child .ig-step-line { display: none; }
.ig-step-active .ig-step-dot { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 10px rgba(37,99,235,0.3); }
.ig-step-active .ig-step-label { color: var(--accent); font-weight: 700; }
.ig-step-done .ig-step-dot { background: #22c55e; border-color: #22c55e; color: #fff; }
.ig-step-done .ig-step-line { background: #22c55e; }
.ig-step-done .ig-step-label { color: #22c55e; }

/* ===== Stat Cards (Large) ===== */
.ig-stat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.ig-stat-card { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 20px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.ig-stat-card-value { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ig-stat-card-unit { font-size: 18px; font-weight: 400; margin-left: 2px; }
.ig-stat-card-label { font-size: 13px; font-weight: 600; color: var(--text-sub); margin-bottom: 6px; }
.ig-stat-card-time { font-size: 10px; color: var(--text-sub); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ===== Webinar Tabs ===== */
.ig-wb-tabs { display: flex; gap: 4px; margin-bottom: 16px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.ig-wb-tab { flex: 1; padding: 8px 16px; border-radius: 8px; border: none; background: transparent; font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit; color: var(--text-sub); transition: all 0.2s; }
.ig-wb-tab:hover { background: var(--surface); }
.ig-wb-tab.active { background: var(--accent); color: #fff; font-weight: 700; }

/* ===== Broadcast Controls ===== */
.ig-broadcast-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ig-btn-start { background: #16a34a; color: #fff; border: none; padding: 8px 20px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; transition: opacity 0.15s, transform 0.1s; }
.ig-btn-start:hover { opacity: 0.9; transform: translateY(-1px); }
.ig-btn-start:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ===== API Status Enhanced ===== */
.ig-api-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.ig-api-card { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); }
.ig-api-card-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.ig-api-card-info { display: flex; flex-direction: column; }
.ig-api-card-name { font-size: 12px; font-weight: 600; }
.ig-api-card-label { font-size: 11px; color: var(--text-sub); }

/* ===== Device Selector ===== */
.ig-device-selector { display: flex; gap: 4px; justify-content: center; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px; flex-wrap: wrap; }
.ig-device-sel-btn { padding: 6px 14px; border-radius: 8px; border: none; background: transparent; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; color: var(--text-sub); transition: all 0.2s; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.ig-device-sel-btn:hover { background: var(--bg); }
.ig-device-sel-btn.active { background: var(--accent); color: #fff; font-weight: 700; }
.ig-device-sel-icon { width: 14px; height: 14px; opacity: 0.7; }
.ig-device-sel-btn.active .ig-device-sel-icon { opacity: 1; }

/* ===== Phone Frame ===== */
.ig-phone { margin: 0 auto 28px; display: flex; flex-direction: column; align-items: center; }
.ig-phone-body {
  background: linear-gradient(180deg, #2d2d2f 0%, #1a1a1c 100%);
  border-radius: 40px; padding: 10px;
  box-shadow: 0 0 0 1px #3a3a3c, 0 0 0 3px #111, 0 25px 50px rgba(0,0,0,0.35);
  position: relative; width: 280px;
}
.ig-phone-body[data-variant="se"] { border-radius: 32px; width: 260px; }
.ig-phone-body[data-variant="android"] { border-radius: 28px; width: 270px; }
.ig-phone-island {
  width: 80px; height: 22px;
  background: #000; border-radius: 20px;
  margin: 6px auto 8px; position: relative; z-index: 2;
}
.ig-phone-island::after {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle, #1a1a2e, #000);
  position: absolute; right: 18px; top: 7px;
}
.ig-phone-notch {
  width: 40%; height: 24px;
  background: #000; border-radius: 0 0 16px 16px;
  margin: 0 auto 4px; position: relative;
}
.ig-phone-punch {
  width: 10px; height: 10px; border-radius: 50%;
  background: #1a1a1c; border: 1px solid #333;
  margin: 8px auto 6px; position: relative;
}
.ig-phone-screen {
  background: #000; border-radius: 30px; overflow: hidden;
  position: relative;
}
.ig-phone-body[data-variant="se"] .ig-phone-screen { border-radius: 4px; }
.ig-phone-body[data-variant="android"] .ig-phone-screen { border-radius: 18px; }
.ig-phone-screen .ig-preview { aspect-ratio: 9/16; border-radius: 0; }
.ig-phone-home {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid #555; margin: 10px auto 4px;
}
.ig-phone-bar {
  width: 100px; height: 4px; background: #555;
  border-radius: 4px; margin: 10px auto 4px;
}
.ig-phone-label {
  font-size: 10px; color: var(--text-sub); text-align: center;
  margin-top: 8px; font-weight: 500;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 640px) {
  .ig-device-bezel { border-radius: 20px 20px 0 0; padding: 6px 6px 0; }
  .ig-device-screen { border-radius: 4px 4px 0 0; }
  .ig-device-body { height: 8px; }
  .ig-device-base { width: 60%; }
  .ig-device-base::after { font-size: 6px; }
  .ig-preview { aspect-ratio: 16/9; }
  .ig-steps { padding: 10px 8px; }
  .ig-step-label { font-size: 10px; }
  .ig-api-grid { grid-template-columns: 1fr; }
}

/* ===== Trend Chart ===== */
.ig-trend-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.ig-trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; }
.ig-trend-bar-wrap { flex: 1; width: 100%; position: relative; display: flex; align-items: flex-end; }
.ig-trend-bar { width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; transition: height 0.4s ease; min-height: 2px; }
.ig-trend-target { position: absolute; left: -4px; right: -4px; height: 2px; background: #ef4444; border-radius: 1px; }
.ig-trend-label { font-size: 10px; color: var(--text-sub); }
.ig-trend-val { font-size: 10px; font-weight: 600; }

/* ===== Custom Period ===== */
.ig-custom-period { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.ig-hidden { display: none !important; }

@media (max-width: 480px) {
  .ig-kpi-row, .ig-kpi-row-5 { grid-template-columns: 1fr; }
  .ig-kpi-value { font-size: 22px; }
  .ig-period-select { width: 100%; }
  .ig-period-btn { flex: 1; padding: 8px 8px; font-size: 11px; }
}
