/* APEX 分析路徑規劃引擎頁面（沿用 style.css 的色彩變數與按鈕、彈窗樣式） */

.apex-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(280px, 360px);
  gap: 20px;
  padding: 20px 24px 60px;
  align-items: start;
}
.apex-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.apex-state { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; }
.apex-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; box-shadow: var(--shadow);
}
.apex-card-head { font-weight: 700; font-size: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
}
.apex-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.apex-row input, .apex-row select, .adjust-row select {
  flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel-alt); color: var(--text); font-family: var(--sans); font-size: 14px;
}
.apex-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.apex-note { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; }
.apex-sub { font-size: 11.5px; color: var(--text-dim); line-height: 1.5; }
.mono { font-family: var(--mono); }
.apex-h { margin: 14px 0 6px; font-size: 12.5px; color: var(--text-dim); letter-spacing: 0.5px; }
.apex-check { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text-dim); margin-top: 6px; }
.apex-back { font-size: 13px; color: var(--accent); text-decoration: none; }
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; }

.pill {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px;
  background: var(--panel-alt); border: 1px solid var(--line); color: var(--text-dim); white-space: nowrap;
}
.pill.ok { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.pill.warn { background: rgba(217, 119, 6, 0.12); border-color: transparent; color: var(--warm); }
.pill.err { background: rgba(220, 38, 38, 0.1); border-color: transparent; color: var(--danger); }

.kv { display: grid; grid-template-columns: 64px 1fr; gap: 6px 10px; margin: 0; font-size: 13px; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.apex-details { margin-top: 10px; font-size: 13px; }
.apex-details > summary { cursor: pointer; color: var(--accent); font-size: 12.5px; }
.apex-table-wrap { overflow-x: auto; }
.apex-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.apex-table th, .apex-table td { border-bottom: 1px solid var(--line); padding: 6px; text-align: left; vertical-align: top; }
.apex-table th { color: var(--text-dim); font-weight: 600; background: var(--panel-alt); }
.ev-table td:nth-child(3), .ev-table td:nth-child(4), .ev-table td:nth-child(5) { font-variant-numeric: tabular-nums; text-align: right; }
.ev-table tr.small td { background: rgba(217, 119, 6, 0.06); }
.ev-table tr.nodata td { color: var(--text-faint); }
.apex-table pre, .ev-count pre { white-space: pre-wrap; word-break: break-all; font-size: 11px; background: var(--panel-alt); padding: 6px; border-radius: 4px; margin: 4px 0; }
.sql-label { font-size: 11px; color: var(--text-dim); }
.ev-count { font-size: 12.5px; margin: 6px 0; }
details.inline { display: inline-block; }
details.inline > summary { cursor: pointer; color: var(--accent); font-size: 11.5px; }

/* 題目 */
.q-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.q-item {
  text-align: left; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--panel);
  cursor: pointer; font-family: var(--sans); color: var(--text); transition: border-color 0.15s;
}
.q-item:hover:not(:disabled) { border-color: var(--accent); }
.q-item.q-blocked { background: var(--panel-alt); }
.q-text { font-weight: 700; font-size: 14px; }
.q-reason { font-size: 12.5px; color: var(--text-dim); margin: 4px 0 6px; line-height: 1.55; }
.q-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.q-why { font-size: 11.5px; color: var(--danger); }

/* 計畫預覽 */
.plan-card { border-color: var(--accent); }
.plan-q { font-size: 16px; line-height: 1.5; }
.plan-why { font-size: 13px; color: var(--text-dim); margin: 6px 0; line-height: 1.6; }
.plan-flow { font-size: 13.5px; margin: 8px 0; line-height: 1.7; }
.plan-steps { padding-left: 18px; margin: 8px 0 0; }
.plan-steps li { margin-bottom: 10px; }
.plan-step-title { font-size: 13px; }
.plan-step-meta { font-size: 12px; color: var(--text-dim); line-height: 1.55; }
.plan-err { font-size: 12.5px; color: var(--danger); margin-top: 4px; }
.plan-warn { font-size: 12px; color: var(--warm); margin-top: 4px; }
.plan-bad .plan-step-title { color: var(--danger); }
.adjust-title { font-weight: 600; margin: 12px 0 6px; font-size: 13px; }
.adjust-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; margin: 6px 0; }
.adjust-row select { flex: 0 1 140px; padding: 4px 8px; font-size: 13px; }

.confirm-card { border-color: var(--warm); }
.confirm-q { font-size: 15px; font-weight: 600; }
.stop-card { border-color: var(--danger); font-size: 13px; }

/* 時間軸 */
.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline-head { font-weight: 700; font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.t-step { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line-bright); border-radius: 8px; padding: 12px 14px; }
.t-step.st-done { border-left-color: var(--accent); }
.t-step.st-running { border-left-color: var(--warm); }
.t-step.st-failed, .t-step.st-blocked, .t-step.st-unavailable { border-left-color: var(--danger); }
.t-step.st-skipped { opacity: 0.7; }
.t-step.st-needs_authorization { border-left-color: var(--warm); }
.t-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.t-icon { color: var(--accent); width: 14px; }
.st-failed .t-icon, .st-blocked .t-icon, .st-unavailable .t-icon { color: var(--danger); }
.t-status { margin-left: auto; font-size: 11.5px; color: var(--text-dim); }
.t-purpose { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }
.t-rationale { font-size: 12.5px; color: var(--warm); margin-top: 4px; }
.t-error { font-size: 12.5px; color: var(--danger); margin-top: 4px; }
.t-checks { list-style: none; padding: 0; margin: 8px 0 0; font-size: 12.5px; line-height: 1.6; }
.t-checks li.warn { color: var(--warm); }

.branch-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; font-family: var(--sans); }
.tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 狀態 */
.progress { height: 6px; background: var(--panel-alt); border-radius: 3px; overflow: hidden; border: 1px solid var(--line); }
.progress-bar { height: 100%; background: var(--accent); transition: width 0.3s; }
.next-box { margin-top: 10px; padding: 10px; border-radius: 8px; background: var(--accent-soft); font-size: 13px; }
.concl { font-size: 12.5px; line-height: 1.6; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.concl.st-revised .pill:first-child, .concl.st-needs_verification .pill:first-child { background: rgba(217, 119, 6, 0.12); color: var(--warm); border-color: transparent; }
.concl.st-supported .pill:first-child { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.concl.hyp { font-style: italic; }
.rev { font-size: 12.5px; padding: 4px 0; line-height: 1.55; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--line); background: var(--panel-alt); border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; text-align: left; font-family: var(--sans); }
.pb-item, .hist-item { display: block; width: 100%; text-align: left; border: none; border-bottom: 1px solid var(--line); padding: 8px 0; background: none; font-family: var(--sans); font-size: 13px; color: var(--text); cursor: pointer; }
.pb-item .btn { margin-top: 4px; }

.apex-toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff;
  padding: 10px 16px; border-radius: 8px; font-size: 13px; z-index: 400; max-width: calc(100vw - 32px);
}
.apex-toast.err { background: var(--danger); }

@media (max-width: 1180px) {
  .apex-layout { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }
  .apex-state { grid-column: 1 / -1; position: static; max-height: none; }
}
@media (max-width: 760px) {
  /* 手機：三欄拆開重新排序——選資料 → 契約 → 題目 → 計畫 → 執行 → 狀態，方案與歷史放最後 */
  .apex-layout { display: flex; flex-direction: column; gap: 14px; padding: 12px 16px 40px; }
  .apex-col { display: contents; }
  .apex-data > .apex-card:first-child { order: 1; }
  #contractCard { order: 2; }
  #questionCard { order: 3; }
  #planCard { order: 4; }
  #confirmCard, #stopCard { order: 5; }
  #branchTabs, #timeline, #branchView { order: 6; }
  #stateCard { order: 7; }
  #followCard { order: 8; }
  #saveCard { order: 9; }
  #playbookCard { order: 10; }
  #historyCard { order: 11; }
  .topbar { padding: 12px 16px; }
  .brand-sub { display: none; }
  .ev-table { font-size: 11px; }
}

/* ===== 白話報告與圖表（v1.1） ===== */
.report-view { display: flex; flex-direction: column; gap: 14px; }
.apex-page { --series-1: #2a78d6; --series-2: #eb6834; --lab: 150px; --val: 170px; --gap: 10px; }
.report-hero { border-color: var(--accent); }
.report-kicker { font-size: 12px; color: var(--text-dim); letter-spacing: 0.5px; }
.report-headline { font-size: 18px; line-height: 1.6; font-weight: 700; margin: 6px 0 12px; }
.hero-stat { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero-num { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); line-height: 1; }
.hero-sub { font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.report-block h4 { margin: 12px 0 6px; font-size: 14px; }
.report-block ul, .finding-notes { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.7; }
.finding-head { display: flex; gap: 10px; align-items: center; }
.finding-head h3 { margin: 0; font-size: 15.5px; }
.finding-no { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--panel-alt); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.finding-answer { font-size: 15px; line-height: 1.7; margin: 8px 0 4px; }
.finding-revised { border-left: 3px solid var(--warm); }
.finding-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.finding-link { margin-left: auto; font-size: 12.5px; color: var(--accent); }

.viz { margin: 12px 0 6px; }
.bars { position: relative; }
.bars.has-ref { padding-top: 20px; }
.bar-row, .bar-axis { display: grid; grid-template-columns: var(--lab) minmax(0, 1fr) var(--val); gap: var(--gap); align-items: center; }
.bar-row { padding: 3px 0; border-radius: 4px; outline: none; }
.bar-row:hover, .bar-row:focus-visible { background: var(--panel-alt); }
.bar-label { font-size: 13px; color: var(--text); text-align: right; overflow-wrap: anywhere; line-height: 1.3; }
.bar-track { position: relative; height: 16px; }
.bar-fill { height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-fill.muted { background: repeating-linear-gradient(45deg, #b8bcc4, #b8bcc4 3px, #d7dae0 3px, #d7dae0 6px); }
.bar-value { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-value span { color: var(--text-dim); font-size: 12px; }
.bar-axis { margin-top: 2px; }
.bar-track.axis { height: 14px; border-top: 1px solid var(--line); }
.bar-track.axis span { position: absolute; top: 2px; transform: translateX(-50%); font-size: 10.5px; color: var(--text-faint); }
.bar-track.axis span:first-child { transform: none; }
.bar-track.axis span:last-child { transform: translateX(-100%); }
/* 整體比率參考線：落在「長條區」內對應的百分比位置 */
.ref-line, .ref-label { position: absolute; left: calc(var(--lab) + var(--gap) + (100% - var(--lab) - var(--val) - 2 * var(--gap)) * var(--ref) / 100); }
.ref-line { top: 20px; bottom: 0; border-left: 1.5px dashed var(--text-dim); z-index: 1; pointer-events: none; }
.ref-label { top: 0; transform: translateX(-50%); font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.viz-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text); margin-bottom: 8px; }
.viz-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.bar-group { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.bar-group:last-of-type { border-bottom: none; }
.bar-group-label { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.bar-group .bar-row { padding: 1px 0; }
.bar-group .bar-row + .bar-row { margin-top: 2px; }
.bar-row.in-group .bar-label { font-size: 12px; color: var(--text-dim); }
.viz-tip { position: absolute; z-index: 500; background: var(--text); color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 6px; max-width: 320px; pointer-events: none; line-height: 1.5; }
.audit-wrap > summary { cursor: pointer; color: var(--accent); font-size: 13px; padding: 6px 0; }
.audit-wrap[open] > summary { margin-bottom: 8px; }
@media (max-width: 760px) {
  .apex-page { --lab: 84px; --val: 118px; --gap: 6px; }
  .report-headline { font-size: 16px; }
  .hero-num { font-size: 32px; }
  #reportView { order: 6; }
  #auditWrap { order: 6; }
}

.q-expand { display: none; margin-left: auto; font-size: 12.5px; color: var(--accent); font-weight: 400; }
.q-collapsed .q-expand { display: inline; }
.q-collapsed #questionHead { cursor: pointer; margin-bottom: 0; }
.q-collapsed > :not(#questionHead) { display: none; }

/* v1.2：收斂成答案 */
.report-hero .hero-stat { margin: 10px 0 4px; }
.report-hero .report-block h4 { font-size: 15px; margin: 16px 0 6px; }
.discovered { margin: 0; padding-left: 22px; font-size: 15px; line-height: 1.75; font-weight: 600; }
.report-block.keep ul { color: var(--text); }
.report-block.keep h4::before { content: '⚠ '; }
.next-q { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-alt); margin-top: 6px; }
.next-q .btn { flex: none; }
.report-sub-head { font-size: 13px; color: var(--text-dim); margin: 6px 0 -4px; letter-spacing: 0.5px; }
.chart-title { font-size: 12.5px; color: var(--text-dim); margin-top: 12px; font-weight: 600; }
@media (max-width: 760px) { .next-q { flex-direction: column; align-items: stretch; } }

.state-compact .apex-h, .state-compact #knownBox, .state-compact #pendingBox, .state-compact #limitBox { display: none; }
.state-note { margin-top: 8px; }

/* v1.4：從戰情室圖表發動 */
.focus-banner { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.6; margin-bottom: 8px; }
.focus-banner ul { margin: 4px 0 0; padding-left: 18px; color: var(--text-dim); font-size: 12.5px; }
.origin-line { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }
.origin-line a { color: var(--accent); }

/* v1.6：已找到這份資料的相關分析、沿用與新發現 */
.related-card { border-left: 3px solid var(--accent); }
.rel-item { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.rel-item:first-of-type { border-top: 0; }
.rel-main { min-width: 0; }
.rel-head { font-size: 13px; margin: 2px 0; line-height: 1.55; }
.rel-actions { display: flex; gap: 6px; flex: none; }
.rel-older { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--panel-alt); font-size: 12.5px; line-height: 1.6; color: var(--text-dim); }
.rel-older .btn { margin-top: 6px; }
.q-done { border-color: var(--accent); }
.q-done-note { font-size: 12.5px; color: var(--accent); margin: 2px 0 4px; }
.pill.reuse { background: var(--accent-soft); color: var(--accent); }
.dv-line { font-size: 12px; color: var(--text-dim); margin-top: 4px; line-height: 1.6; }
.nov { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; vertical-align: 1px; white-space: nowrap; }
.nov-new { background: var(--accent); color: #fff; }
.nov-upd { background: var(--warm); color: #fff; }
.nov-known { background: var(--line); color: var(--text-dim); }
.finding-head .nov { margin-left: auto; flex: none; }
.nov-note { margin: -4px 0 6px; }
.report-block.novelty { background: var(--accent-soft); border-radius: 8px; padding: 2px 12px 10px; margin-top: 12px; }
.nov-list { margin: 0; padding-left: 4px; list-style: none; line-height: 1.7; }
.nov-list li + li { margin-top: 4px; }
.first-note { margin: 8px 0 0; }
.next-block.flash { animation: apexFlash 1.6s ease; border-radius: 8px; }
@keyframes apexFlash { 0%, 60% { background: var(--accent-soft); } 100% { background: transparent; } }

/* v1.7：探索地圖 */
.map-card > summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: baseline; }
.map-card > summary::-webkit-details-marker { display: none; }
.map-card > summary::after { content: '▾'; margin-left: auto; color: var(--text-faint); }
.map-card:not([open]) > summary { margin-bottom: 0; }
.map-card:not([open]) > summary::after { content: '▸'; }
.map-stages { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.map-stages li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; padding: 8px; border-radius: 8px; background: var(--panel-alt); }
.map-stages li.done { background: var(--accent-soft); }
.stage-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--line); color: var(--text-dim); }
.map-stages li.done .stage-dot { background: var(--accent); color: #fff; }
.map-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.map-tile { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 4px; background: var(--panel); }
.map-tile.t-unexplored { border-style: dashed; background: var(--panel-alt); }
.map-tile.t-clear { border-color: var(--accent); }
.tile-head { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; justify-content: space-between; }
.tile-text { font-size: 12.5px; line-height: 1.55; }
.tile-stop { font-size: 12px; color: var(--warm); line-height: 1.5; }
.tile-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.pill.open { background: var(--accent-soft); color: var(--accent); }
.pill.none { background: transparent; border: 1px dashed var(--line-bright); color: var(--text-faint); }
@media (max-width: 760px) {
  .map-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rel-item { flex-direction: column; align-items: stretch; }
  .rel-actions .btn { flex: 1; }
}

/* v1.8：一般／專業模式（跟戰情室共用設定） */
.mode-simple .pro-only { display: none !important; }
.apex-mode { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-right: 8px; }
.apex-mode-btn { border: 0; background: var(--panel); color: var(--text-dim); font-size: 12px; padding: 4px 10px; cursor: pointer; font-family: var(--sans); }
.apex-mode-btn.active { background: var(--accent); color: #fff; }

/* v1.8：範圍確認（執行前說清楚分析的是誰） */
.scope-confirm { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; font-size: 13.5px; line-height: 1.7; }
.scope-confirm .sc-k { display: inline-block; min-width: 5.5em; color: var(--text-dim); font-size: 12.5px; margin-right: 6px; }
.scope-confirm ul { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--text-dim); }

/* v1.8：執行中 */
.run-view .run-head { font-weight: 700; font-size: 14px; }
.run-now { font-size: 13px; color: var(--accent); margin: 6px 0; }
.run-steps { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; line-height: 1.9; }
.run-steps .rs-i { display: inline-block; width: 1.4em; color: var(--text-faint); }
.run-steps .rs-done .rs-i { color: var(--accent); }
.run-steps .rs-running { font-weight: 600; }
.run-steps .rs-failed .rs-i, .run-steps .rs-blocked .rs-i { color: var(--danger); }

/* v1.8：證據標示與口徑 */
.ev { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 4px; vertical-align: 1px; white-space: nowrap; border: 1px solid transparent; }
.ev-obs { background: var(--panel-alt); color: var(--text-dim); border-color: var(--line-bright); }
.ev-cmp { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.ev-hyp { background: rgba(217, 119, 6, 0.1); color: var(--warm); border-color: var(--warm); border-style: dashed; }
.finding-head .ev { flex: none; }
.finding-head h3 { flex: 1; }
.ev-legend { font-size: 12px; color: var(--text-dim); margin-top: 6px; line-height: 1.8; }
.basis { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 12.5px; margin: 12px 0 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-alt); }
.basis dt { color: var(--text-dim); white-space: nowrap; }
.basis dd { margin: 0; }
.embed-next-actions { margin-top: 8px; }

/* v1.8：戰情室面板裡（iframe）——只留中間一欄：範圍確認 → 計畫 → 執行中 → 答案 */
.apex-embed .topbar, .apex-embed .apex-data, .apex-embed .apex-state, .apex-embed #relatedCard, .apex-embed #mapCard, .apex-embed .apex-check { display: none !important; }
.apex-embed .apex-layout { display: block; padding: 12px 14px 40px; }
.apex-embed .apex-main { gap: 12px; }
.apex-embed .report-hero { padding: 14px; }
.embed-note { font-size: 13.5px; line-height: 1.7; }
.apex-embed .step-num { display: none; }

/* v1.11：探索地圖階段的入口按鈕與捲動後的提示閃爍 */
.map-stages .stage-link { margin-top: 6px; padding: 2px 8px; font-size: 12px; }
.flash { outline: 2px solid var(--accent); outline-offset: 2px; transition: outline-color .3s; }

/* v1.11：分頁式探索地圖 */
.map-stages li[data-stage] { cursor: pointer; border: 2px solid transparent; }
.map-stages li[data-stage]:hover { border-color: var(--line, #d7e3e0); }
.map-stages li.current { border-color: var(--accent); box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.map-panel { border-top: 1px solid var(--line, #e3ebe9); padding-top: 12px; margin-bottom: 8px; }
.panel-lead { margin: 0 0 10px; font-size: 13px; color: var(--muted, #5b6b68); }
.panel-list { margin: 0 0 10px; padding-left: 18px; font-size: 14px; line-height: 1.8; }
.panel-list .btn { margin-left: 6px; padding: 1px 8px; font-size: 12px; }

/* v1.11：目前狀態標出任務、任務清單標出正在看的那筆 */
.state-task-title { font-size: 13px; line-height: 1.6; margin: 0 0 8px; padding: 6px 8px; border-radius: 6px; background: var(--panel-alt); }
.btn-link { background: none; border: 0; padding: 0; margin-left: 4px; color: var(--accent); cursor: pointer; font-size: 12px; text-decoration: underline; }
.hist-item.current { border-left: 3px solid var(--accent); background: var(--accent-soft); }

/* v1.11：探索地圖的指標選擇 */
.measure-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; }
.measure-pick select { padding: 3px 6px; }
