/* 라이트·다크 테마 색상 변수 */
:root {
  color-scheme: light;
  --surface-1: #ffffff;
  --plane: #f3f5f8;
  --text-primary: #111110;
  --text-secondary: #4a4946;
  --text-muted: #76746e;
  --grid: #e2e1da;
  --axis: #c3c2b7;
  --border: rgba(17, 17, 16, 0.11);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #d95f8e;
  --metric-cost: #7c5cdb;
  /* 기법 색: 초록·빨강(절감·증가 전용)과 겹치지 않게 고른다. validate_palette.js 통과(인접 쌍). */
  --cond-1: #8a8984; --cond-2: #1d4ea3; --cond-3: #c2449a; --cond-4: #eda100; --cond-5: #3fb4dc;
  --seq-100: #cde2fb;
  --seq-250: #86b6ef;
  --seq-400: #3987e5;
  --seq-550: #1c5cab;
  --seq-700: #0d366b;
  --critical: #c93535;
  --good: #0d8a3e;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --plane: #0f0f0e;
    --text-primary: #f5f5f3;
    --text-secondary: #c5c4bc;
    --text-muted: #8e8c85;
    --grid: #2c2c2a;
    --axis: #3c3c38;
    --border: rgba(255, 255, 255, 0.12);
    --series-1: #4b96ef;
    --series-2: #e56a39;
    --series-3: #25b583;
    --series-4: #d89311;
    --series-5: #df6895;
    --metric-cost: #9b7ff0;
    --cond-1: #8e8c85; --cond-2: #3d66c9; --cond-3: #cf5aa8; --cond-4: #c98500; --cond-5: #2f9cc4;
    --seq-100: #0d366b;
    --seq-250: #184f95;
    --seq-400: #3987e5;
    --seq-550: #5598e7;
    --seq-700: #9ec5f4;
    --critical: #ef6464;
    --good: #3cc96b;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #1a1a19;
  --plane: #0f0f0e;
  --text-primary: #f5f5f3;
  --text-secondary: #c5c4bc;
  --text-muted: #8e8c85;
  --grid: #2c2c2a;
  --axis: #3c3c38;
  --border: rgba(255, 255, 255, 0.12);
  --series-1: #4b96ef;
  --series-2: #e56a39;
  --series-3: #25b583;
  --series-4: #d89311;
  --series-5: #df6895;
  --metric-cost: #9b7ff0;
  --cond-1: #8e8c85; --cond-2: #3d66c9; --cond-3: #cf5aa8; --cond-4: #c98500; --cond-5: #2f9cc4;
  --seq-100: #0d366b;
  --seq-250: #184f95;
  --seq-400: #3987e5;
  --seq-550: #5598e7;
  --seq-700: #9ec5f4;
  --critical: #ef6464;
  --good: #3cc96b;
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }

body {
  margin: 0;
  padding: 0 1.25rem 3.5rem;
  background: var(--plane);
  color: var(--text-primary);
  font: 15px/1.62 system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  overflow-x: clip;
}

a { color: var(--series-1); text-underline-offset: 2px; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  padding: .1rem .32rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--text-primary) 7%, transparent);
}

.wrap { max-width: 1240px; margin: 0 auto; padding-top: 1.25rem; }

/* 상단 바 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: .75rem 1.25rem;
  padding: .75rem 1.25rem; margin: 0 -1.25rem;
  background: var(--surface-1); border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .6rem; margin-right: auto; min-width: 0; }
.brand-mark { width: 20px; height: 20px; fill: var(--series-1); flex: none; }
.brand h1 { font-size: 1.05rem; margin: 0; letter-spacing: -0.01em; white-space: nowrap; }

.tabs { display: flex; gap: .2rem; border-bottom: none; margin: 0; }
.tabs button {
  border: none; border-bottom: 2px solid transparent; border-radius: 0;
  background: none; color: var(--text-secondary);
  padding: .45rem .8rem; font-weight: 500; white-space: nowrap;
}
.tabs button[aria-selected="true"] {
  color: var(--series-1); border-bottom-color: var(--series-1); font-weight: 600;
}

.topbar-controls { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
#theme {
  padding: .32rem .65rem;
  font-size: .84rem;
  white-space: nowrap;
}

/* 그리드 레이아웃 */
.grid12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; align-items: stretch; }
.grid12 > * { min-width: 0; margin-bottom: 0; }
.inner-grid { margin-top: .5rem; }
.subpanel { display: flex; flex-direction: column; min-width: 0; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }
@media (max-width: 900px) {
  .col-4, .col-6, .col-8 { grid-column: span 12; }
}

/* 페이지 헤더 */
.page-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: end; gap: .85rem 1rem; margin: .5rem 0 1rem;
}
@media (max-width: 900px) {
  .page-head { grid-template-columns: 1fr; }
}
.page-title { font-size: 1.3rem; margin: 0 0 .2rem; letter-spacing: -0.01em; }

.scope { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.scope-inline { margin-top: .9rem; }
.scope-wrap { justify-content: flex-end; }
@media (max-width: 900px) {
  .scope-wrap { justify-content: flex-start; }
}
.scope-field {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .84rem; color: var(--text-muted); white-space: nowrap;
  max-width: 100%;
}
#run-select { width: min(16rem, 62vw); text-overflow: ellipsis; }

.segmented {
  display: inline-flex; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  max-width: 100%;
}
.segmented button {
  border: none; border-radius: 0; background: var(--surface-1);
  color: var(--text-secondary); font-size: .82rem; padding: .38rem .68rem;
  border-right: 1px solid var(--border); white-space: nowrap;
}
.segmented button:last-child { border-right: none; }
.segmented button[aria-pressed="true"] {
  color: var(--series-1); font-weight: 600;
  background: color-mix(in srgb, var(--series-1) 14%, var(--surface-1));
}

.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .6rem; border-radius: 999px; font-size: .8rem;
  border: 1px solid var(--border); color: var(--text-secondary); background: var(--plane);
}
.chip b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.chip.warn { border-color: var(--critical); color: var(--critical); }
.chip.ok { border-color: var(--good); color: var(--good); }

/* 카드 공통 */
[hidden] { display: none !important; }

.card {
  display: flex; flex-direction: column;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.15rem 1.3rem 1.25rem;
  margin-bottom: 1rem;
  max-width: 100%;
}

/* 첫 화면 결론 카드 */
.hero-card {
  border-left: 4px solid var(--series-1);
}
.hero-intro {
  margin: 0 0 .55rem;
  color: var(--text-secondary);
  font-size: .95rem;
  line-height: 1.58;
}
.verdict {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.3;
  margin: .1rem 0 .5rem;
  letter-spacing: -0.02em;
}
.run-verdict, .verify-verdict {
  font-size: 1.35rem;
}
.verdict.good { color: var(--good); }
.verdict.bad { color: var(--critical); }

.hero-note {
  color: var(--text-secondary);
  margin: 0;
  font-size: .95rem;
  line-height: 1.6;
}
.evidence-line {
  display: block;
  margin-top: .6rem;
  padding-top: .55rem;
  border-top: 1px dashed var(--grid);
  font-size: .86rem;
  color: var(--text-muted);
}

h2 { font-size: 1.08rem; margin: 0 0 .3rem; letter-spacing: -0.01em; }
h3 { font-size: .95rem; margin: 1.2rem 0 .35rem; letter-spacing: -0.005em; }
#report > h3:first-child { margin-top: .9rem; }
.sub { color: var(--text-secondary); margin: 0; }
.muted { color: var(--text-muted); font-size: .88rem; margin: 0 0 .65rem; }
.note { color: var(--text-muted); font-size: .81rem; margin: .65rem 0 0; line-height: 1.55; }

/* 접기 카드 (자세히 보기) */
.fold-card { padding: .85rem 1.2rem; }
.fold > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .5rem;
  user-select: none;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before {
  content: "▸";
  color: var(--series-1);
  font-size: .9rem;
  flex: none;
  transition: transform .15s ease;
}
.fold[open] > summary::before { content: "▾"; }
.fold > summary h2 { display: inline; font-size: 1rem; margin: 0; }
.fold[open] > summary {
  margin-bottom: .85rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--grid);
}

/* 컨트롤·버튼 */
.controls {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  padding: .65rem 0 .5rem;
}
select, button, input {
  font: inherit; font-size: .88rem;
  padding: .35rem .6rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-1); color: var(--text-primary);
  max-width: 100%;
}
button { cursor: pointer; }
button.primary {
  background: var(--series-1); border-color: var(--series-1); color: #fff;
  font-weight: 600; padding: .48rem 1.05rem;
}
button.primary:hover { filter: brightness(1.07); }
button.primary:disabled { opacity: .5; cursor: default; }
button[aria-pressed="true"] { border-color: var(--series-1); color: var(--series-1); }

/* KPI 요약 */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .75rem 1rem;
}
.run-kpis {
  margin-top: 1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--grid);
}
.kpi .label { color: var(--text-muted); font-size: .78rem; }
.kpi .value { font-size: 1.25rem; font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums; }
.tight-kpis { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .65rem; margin-top: .5rem; }
.tight-kpis .value { font-size: 1.15rem; }

/* 차트 & 범례 */
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin: .35rem 0 .35rem; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; font-size: .84rem; color: var(--text-secondary); }
.legend span.clickable { cursor: pointer; }
.legend span.dim { opacity: .35; }
.swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.swatch-line { flex: none; overflow: visible; }

.chart { padding-top: .2rem; max-width: 100%; overflow: hidden; }
.run-delta-chart { margin-top: .65rem; }
svg { display: block; max-width: 100%; height: auto; }
.grid-line { stroke: var(--grid); stroke-width: 1; }
.axis-line { stroke: var(--axis); stroke-width: 1; }
.tick { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.mark-label { fill: var(--text-secondary); font-size: 11px; font-variant-numeric: tabular-nums; }
.mark-label.on-mark { fill: var(--surface-1); font-weight: 600; }

/* 표 & 세부 열 접기 */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem 1rem;
  flex-wrap: wrap;
  margin: .35rem 0 .5rem;
}
.table-toolbar .muted, .table-toolbar h3 { margin: 0; }
.toggle-cols-btn {
  font-size: .78rem;
  padding: .25rem .6rem;
  white-space: nowrap;
  color: var(--text-secondary);
  background: var(--plane);
}
.toggle-cols-btn[aria-expanded="true"] {
  border-color: var(--series-1);
  color: var(--series-1);
}

table:not(.show-extra-cols) .extra-col {
  display: none;
}

.scroll-x { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.table-scroll { overflow: auto; max-height: 25rem; max-width: 100%; -webkit-overflow-scrolling: touch; }
.table-scroll th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-1);
  box-shadow: inset 0 -1px 0 var(--grid);
}

table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th, td {
  text-align: right;
  padding: .4rem .5rem;
  border-bottom: 1px solid var(--grid);
  vertical-align: top;
}
th { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
td { font-variant-numeric: tabular-nums; }
td.good { color: var(--good); font-weight: 500; }
td.bad { color: var(--critical); font-weight: 500; }

#summary-table th:first-child, #summary-table td:first-child,
#detail-table th:first-child, #detail-table td:first-child,
#detail-table th:nth-child(2), #detail-table td:nth-child(2),
#detail-table th:nth-child(6), #detail-table th:nth-child(8),
#detail-table th:nth-child(9), #detail-table th:nth-child(10) { text-align: left; }
#jobs-table th, #jobs-table td { text-align: left; white-space: nowrap; }
#plan-table { max-width: 28rem; margin-top: .5rem; }
#plan-table th:first-child, #plan-table td:first-child { text-align: left; }

.mono-cell { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; white-space: nowrap; }
.diag-cell { min-width: 16rem; max-width: 28rem; white-space: normal; }

/* 5가지 기법 안내 그리드 */
.treatment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .7rem;
  margin-top: .5rem;
}
.treatment-item {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .75rem .85rem;
  background: var(--plane);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.treatment-tag {
  align-self: flex-start;
  font-size: .75rem;
  font-weight: 700;
  padding: .18rem .48rem;
  border-radius: 4px;
  letter-spacing: .02em;
}
.treatment-tag.base { background: color-mix(in srgb, var(--series-1) 15%, transparent); color: var(--series-1); }
.treatment-tag.prompt { background: color-mix(in srgb, var(--series-3) 15%, transparent); color: var(--series-3); }
.treatment-tag.tool { background: color-mix(in srgb, var(--series-2) 15%, transparent); color: var(--series-2); }
.treatment-desc { font-size: .83rem; line-height: 1.48; color: var(--text-secondary); }

/* 상위 턴 행 */
.turn-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .6rem 1rem;
  align-items: center; padding: .65rem .8rem; margin-top: .5rem;
  border: 1px solid var(--border); border-radius: 8px;
}
.turn-row.lead { border-color: var(--series-1); background: color-mix(in srgb, var(--series-1) 7%, transparent); }
.turn-what { display: flex; flex-direction: column; gap: .12rem; font-size: .86rem; min-width: 0; word-break: break-word; }
.targets { color: var(--text-muted); font-size: .8rem; word-break: break-all; }
.turn-figure { font-size: 1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.turn-metrics { display: flex; gap: .85rem; font-size: .8rem; color: var(--text-secondary); white-space: nowrap; }
.turn-metrics .label { display: block; color: var(--text-muted); font-size: .72rem; }
.turn-detail { margin-top: .75rem; }
.turn-detail summary { cursor: pointer; color: var(--text-muted); font-size: .84rem; }

ul.notes { margin: .6rem 0 0; padding-left: 1.15rem; color: var(--text-secondary); font-size: .88rem; }
ul.notes li { margin-bottom: .5rem; }
ul.notes b { color: var(--text-primary); }

/* 실험 설정 폼 및 모달 */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: .7rem 1rem;
  margin: .65rem 0 .25rem;
}
.field-grid label { display: flex; flex-direction: column; gap: .28rem; font-size: .84rem; color: var(--text-secondary); min-width: 0; }
input[type="checkbox"] { width: auto; }
#condition-list label { display: block; color: var(--text-primary); font-size: .88rem; padding: .15rem 0; }
.condition-row { padding: .28rem 0; }
.condition-row.unavailable label { color: var(--text-muted); }
.condition-row.unavailable .note { margin: .1rem 0 .3rem 1.4rem; }

.archive-box {
  padding: .9rem 1rem;
  background: var(--plane);
  border: 1px solid var(--border);
  border-radius: 8px;
  line-height: 1.55;
}
.archive-box p { margin: 0 0 .4rem; }
.archive-box p:last-child { margin-bottom: 0; }

.live-log {
  max-height: 22rem; overflow-y: auto; background: var(--plane);
  border: 1px solid var(--border); border-radius: 8px; padding: .6rem .8rem; font-size: .82rem;
}
.live-log .event { padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.live-log .event:last-child { border-bottom: none; }
.live-log .tag { font-weight: 600; margin-right: .4rem; }
.live-log .tag-text { color: var(--text-primary); }
.live-log .tag-tool_use { color: var(--series-1); }
.live-log .tag-tool_result { color: var(--text-secondary); }
.live-log .tag-result { color: var(--text-primary); font-weight: 600; }
.live-log .body { color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh .85rem; overflow-y: auto; z-index: 100;
}
.modal {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.15rem 1.25rem; width: 100%; max-width: 620px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.modal-head h2 { margin: 0; }
.modal-close {
  background: none; border: none; font-size: 1.4rem; line-height: 1;
  cursor: pointer; color: var(--text-secondary); padding: .1rem .4rem;
}
.modal-close:hover { color: var(--text-primary); }

/* 툴팁 & 유틸 */
.tooltip {
  position: fixed; pointer-events: none; z-index: 20;
  background: var(--surface-1); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 8px;
  padding: .48rem .6rem; font-size: .8rem; line-height: 1.45;
  box-shadow: 0 6px 20px rgba(0,0,0,.14);
  max-width: min(280px, calc(100vw - 16px));
  opacity: 0; transition: opacity .1s;
}
.tooltip.on { opacity: 1; }
.tooltip b { font-variant-numeric: tabular-nums; }

.empty { color: var(--text-secondary); padding: .75rem 0; }
.warn { color: var(--critical); }
.hidden { display: none; }
.link-button {
  background: none; border: 0; padding: 0;
  color: var(--series-1); cursor: pointer; font: inherit; font-size: .82rem; white-space: nowrap;
}
.link-button:hover { text-decoration: underline; }

/* 모바일 (너비 390px 포함) 가로 잘림 방지 및 가독성 최적화 */
@media (max-width: 720px) {
  body {
    padding: 0 .85rem 2.75rem;
    font-size: 14.5px;
  }
  .wrap { padding-top: .9rem; }
  .topbar {
    position: static;
    gap: .45rem .5rem;
    padding: .65rem .85rem;
    margin: 0 -.85rem;
  }
  .brand h1 { font-size: .98rem; }
  .topbar .tabs {
    order: 3;
    width: 100%;
    border-top: 1px solid var(--border);
    padding-top: .3rem;
    gap: 0;
  }
  .tabs button {
    flex: 1 1 0;
    text-align: center;
    padding: .4rem .2rem;
    font-size: .82rem;
  }
  .topbar-controls {
    width: 100%;
    gap: .35rem .5rem;
  }
  .topbar-controls .scope-field { font-size: .78rem; }
  .topbar-controls select {
    max-width: 7.8rem;
    font-size: .78rem;
    padding: .24rem .38rem;
  }
  #theme {
    margin-left: auto;
    font-size: .78rem;
    padding: .24rem .5rem;
  }
  .card {
    padding: .95rem .95rem 1.05rem;
    margin-bottom: .8rem;
  }
  .fold-card { padding: .78rem .95rem; }
  .verdict { font-size: 1.35rem; }
  .run-verdict, .verify-verdict { font-size: 1.18rem; }
  .hero-intro, .hero-note { font-size: .9rem; }
  .segmented { width: 100%; }
  .segmented button {
    flex: 1 1 auto;
    text-align: center;
    padding: .35rem .42rem;
    font-size: .76rem;
    border-bottom: 1px solid var(--border);
  }
  #run-select {
    width: auto;
    max-width: 12.5rem;
    flex: 1 1 auto;
    font-size: .8rem;
  }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem .75rem; }
  .kpi .value { font-size: 1.1rem; }
  .turn-row { grid-template-columns: 1fr; gap: .4rem; }
  .turn-metrics { flex-wrap: wrap; gap: .65rem 1rem; }
  table { font-size: .78rem; }
  th, td { padding: .34rem .32rem; }
}

/* ---- 개요 대시보드 ---- */
.hero-compact { padding-bottom: 1rem; }
.hero-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .35rem; }
.status-pill { background: color-mix(in srgb, var(--series-4) 18%, transparent); color: var(--series-4); border: 1px solid var(--series-4); border-radius: 999px; padding: .15rem .7rem; font-size: .82rem; font-weight: 700; }
.eyebrow { margin: 0; color: var(--text-secondary); font-size: .95rem; }
.kpi-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0; }
.kpi-tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: .75rem 1rem; }
.kpi-tile.warn { border-color: var(--series-4); }
.kpi-tile.ok .kpi-value { color: var(--good); }
.kpi-label { color: var(--text-muted); font-size: .78rem; }
.kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--text-muted); font-size: .78rem; }
.section-label { margin: 1.25rem 0 .6rem; font-size: 1rem; }
.section-label .muted { font-weight: 400; font-size: .82rem; margin-left: .5rem; }
.score-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.score-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: .85rem 1rem; display: flex; flex-direction: column; gap: .3rem; }
.score-card.is-base { background: transparent; border-style: dashed; }
.score-main { font-size: 1.8rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.score-main small { font-size: .78rem; font-weight: 400; color: var(--text-muted); margin-left: .35rem; }
.score-main.good { color: var(--good); }
.score-main.bad { color: var(--critical); }
.score-sub { color: var(--text-secondary); font-size: .82rem; }
.range { position: relative; height: 10px; margin: .35rem 0; background: color-mix(in srgb, var(--grid) 40%, transparent); border-radius: 5px; }
.range-band { position: absolute; top: 0; bottom: 0; background: var(--axis); opacity: .55; border-radius: 5px; }
.range-zero { position: absolute; top: -2px; bottom: -2px; left: 50%; width: 1px; background: var(--text-muted); }
.range-dot { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--surface-1); }
.range-dot.good { background: var(--good); }
.range-dot.bad { background: var(--critical); }
.score-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .25rem; flex-wrap: wrap; }
.howto-list { margin: .5rem 0; padding-left: 1.1rem; display: grid; gap: .5rem; font-size: .92rem; color: var(--text-secondary); }
@media (max-width: 1100px) { .kpi-strip, .score-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpi-strip, .score-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi-value { font-size: 1.3rem; } .score-main { font-size: 1.5rem; } }
.hero-compact .scope-inline { display: none; }

.kpi-tile.neutral { border-color: var(--series-1); }
.kpi-tile.neutral .kpi-value { color: var(--series-1); }
.mini-glossary { margin: .75rem 0 .5rem; display: grid; gap: .15rem; font-size: .85rem; }
.mini-glossary dt { font-weight: 600; margin-top: .45rem; }
.mini-glossary dd { margin: 0; color: var(--text-secondary); }

/* ---- 엔터프라이즈 톤 정리 ---- */
.topbar { background: var(--surface-1); border-bottom: 1px solid var(--border); box-shadow: 0 1px 3px rgba(16, 24, 40, .06); }
.card { border-radius: 12px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.card h2 { letter-spacing: -0.01em; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.legend-inline { margin: 0; display: flex; gap: .9rem; font-size: .8rem; color: var(--text-secondary); flex-wrap: wrap; }
.legend-inline .swatch { display: inline-block; vertical-align: middle; margin-right: .35rem; }
.swatch.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); }
.swatch.bar { width: 4px; height: 14px; border-radius: 2px; background: var(--text-muted); }
.swatch.band { width: 18px; height: 10px; border-radius: 3px; background: var(--grid); border: 1px solid var(--axis); }
.col-7 { grid-column: span 7; }
@media (max-width: 900px) { .col-7 { grid-column: span 12; } }
.kpi-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi-tile { box-shadow: 0 1px 2px rgba(16, 24, 40, .05); border-radius: 12px; }
.overview-main { margin-bottom: 1rem; }
.fold-card + .fold-card { margin-top: .75rem; }
.col-5 { grid-column: span 5; }
@media (max-width: 900px) { .col-5 { grid-column: span 12; } }

/* 비교한 5가지 기법: 이름은 항상, 설명만 접고 펼친다. */
.method-toggle { background: none; border: 1px solid var(--border); border-radius: 6px; padding: .2rem .6rem; font: inherit; font-size: .8rem; color: var(--text-secondary); cursor: pointer; }
.method-toggle:hover { border-color: var(--axis); color: var(--text-primary); }
.method-list { display: grid; gap: .7rem; margin-top: .75rem; }
.method-item { display: grid; grid-template-columns: 8.5rem 1fr; gap: .75rem; align-items: start; font-size: .88rem; color: var(--text-secondary); }
.method-item .treatment-tag { justify-self: start; }
.method-list.collapsed { display: flex; flex-wrap: wrap; gap: .5rem; }
.method-list.collapsed .treatment-desc { display: none; }
.method-list.collapsed .method-item { display: block; }
@media (max-width: 640px) { .method-item { grid-template-columns: 1fr; gap: .3rem; } }
.delta-card { margin-bottom: 1rem; }

/* 회차별 추세 범례: 그래프 아래, 마우스를 올린 기법만 강조 */
.trend-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: .75rem 0 .25rem; }
.trend-key { display: inline-flex; align-items: center; gap: .4rem; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 999px; padding: .3rem .8rem; font: inherit; font-size: .85rem; color: var(--text-primary); cursor: default;
  transition: opacity .15s ease, border-color .15s ease; }
.trend-key:hover, .trend-key.is-on { border-color: var(--axis); box-shadow: 0 1px 3px rgba(16, 24, 40, .08); }
.trend-key.is-dim { opacity: .35; }
#trend [data-cond] { transition: opacity .15s ease; }

.swatch.dot.hollow { background: transparent; border: 2px solid var(--text-muted); width: 9px; height: 9px; }
.status-pill.is-muted { background: color-mix(in srgb, var(--text-muted) 15%, transparent); color: var(--text-secondary); border-color: var(--text-muted); }
.kpi-tile.muted-tile .kpi-value { color: var(--text-secondary); }


/* 대시보드 공통 레이아웃 */
body { padding: 0 0 3rem 220px; font-size: 14px; line-height: 1.5; }
.topbar { position: fixed; inset: 0 auto 0 0; width: 220px; height: 100dvh; padding: 22px 14px; margin: 0; display: flex; flex-direction: column; align-items: stretch; gap: 24px; border: 0; border-right: 1px solid var(--border); box-shadow: none; overflow-y: auto; }
.brand { margin: 0; padding: 0 8px; }
.brand h1 { font-size: 1rem; }
.tabs { display: flex; flex-direction: column; gap: 3px; }
.tabs button { text-align: left; padding: .7rem .8rem; border: 0; border-radius: 5px; }
.tabs button[aria-selected="true"] { color: var(--text-primary); background: var(--plane); box-shadow: inset 3px 0 var(--series-1); }
.topbar-controls { margin-top: auto; display: grid; gap: .8rem; }
.topbar-controls .scope-field { display: grid; gap: .25rem; }
.topbar-controls select, #theme { width: 100%; }
.wrap { max-width: 1700px; padding: 20px 24px 0; }
.preview-heading { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin-bottom: 14px; }
.preview-heading h2 { font-size:1.2rem; margin:0; }
.preview-heading p, .preview-heading span { margin:2px 0 0; font-size:.8rem; color:var(--text-muted); }
.kpi-strip { margin: 0 0 10px; gap:10px; }
.kpi-tile { padding: 14px 16px; min-height: 100px; box-shadow:none; border-radius:6px; }
.kpi-tile.warn, .kpi-tile.neutral { border-color:var(--border); }
.kpi-tile.neutral .kpi-value { color:var(--text-primary); }
.kpi-label { font-size:.8rem; } .kpi-value { font-size:1.45rem; margin:4px 0; }
.card { box-shadow:none; border-radius:6px; padding:16px; margin-bottom:10px; }
.hero-card { border-left:1px solid var(--border); }
.hero-compact { display:grid; grid-template-columns: minmax(200px, .8fr) 2fr; gap: 3px 20px; align-items:center; }
.hero-head { grid-column:1; margin:0; } .hero-head .eyebrow { display:none; }
.hero-compact .verdict { grid-column:1; font-size:1rem; margin:0; }
.hero-compact .hero-note { grid-column:2; grid-row:1 / span 2; font-size:.86rem; }
.status-pill { border:0; border-radius:3px; padding:2px 5px; font-size:.72rem; }
.grid12 { gap:10px; } .overview-main { margin-bottom:10px; }
.overview-main > .card { margin:0; }
.card h2 { font-size:1rem; } .muted { font-size:.82rem; }
.trend-legend { justify-content:flex-start; gap:.3rem; }
.trend-key { border-radius:4px; padding:.25rem .5rem; font-size:.78rem; }
.trend-key:hover, .trend-key.is-on { box-shadow:none; }
.methods .method-list { grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; }
.methods .method-item { display:flex; flex-direction:column; gap:5px; }
.method-item .treatment-tag { background:none; padding:0; }
.fold-card + .fold-card { margin-top:0; }
button:hover, select:hover { border-color:var(--axis); }
button:focus-visible, select:focus-visible, summary:focus-visible { outline:2px solid var(--series-1); outline-offset:2px; }
@media (max-width: 900px) {
 body { padding:0 0 2rem; } .topbar { position:relative; inset:auto; width:auto; height:auto; padding:12px 16px; gap:12px; }
 .tabs { flex-direction:row; flex-wrap:wrap; } .tabs button { padding:.45rem .65rem; }
 .topbar-controls { display:flex; margin:0; } .topbar-controls .scope-field { display:flex; } .topbar-controls select, #theme { width:auto; }
 .wrap { padding:16px 14px 0; } .hero-compact { display:block; } .hero-compact .hero-note { margin-top:6px; }
 .methods .method-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px) { .kpi-strip { grid-template-columns:repeat(2,minmax(0,1fr)); } .methods .method-list { grid-template-columns:1fr; } }
/* 두 차트는 같은 열에 배치하고 오른쪽에 기법 설명을 둔다. */
.overview-main { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); align-items: start; }
.overview-main > .delta-card { grid-column: 1; grid-row: 1; }
.overview-main > .strip-card { grid-column: 1; grid-row: 2; }
.overview-main > .methods { grid-column: 2; grid-row: 1 / span 2; }
.overview-main .methods .method-list { grid-template-columns: 1fr; gap: 0; }
.overview-main .methods .method-item { padding: .75rem 0; border-bottom: 1px solid var(--grid); }
.overview-main .methods .method-item:last-child { border: 0; }
@media (max-width: 900px) {
  .overview-main { grid-template-columns: minmax(0, 1fr); }
  .overview-main > .delta-card, .overview-main > .strip-card, .overview-main > .methods { grid-column: 1; grid-row: auto; }
  .overview-main > .delta-card { order: 0; }
  .overview-main > .strip-card { order: 1; }
  .overview-main > .methods { order: 2; }
}
/* 결론과 지표를 함께 읽도록 상단을 한 묶음으로 배치한다. */
.summary-band { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(340px, 1fr); align-items: center; gap: 20px; margin-bottom: 10px; padding: 16px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px; }
.summary-band .hero-compact { display: block; justify-self: center; align-self: center; text-align: center; padding: 0; margin: 0; background: transparent; border: 0; }
.summary-band .hero-head { justify-content: center; margin-bottom: 7px; }
.summary-band .hero-compact .verdict { font-size: 1.15rem; line-height: 1.35; margin-bottom: 6px; }
.summary-band .hero-compact .hero-note { font-size: .85rem; }
.summary-band .kpi-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 14px 20px 14px 28px; gap: 12px 20px; background: var(--plane); border-radius: 5px; }
.summary-band .kpi-tile { min-height: 0; padding: 0; background: transparent; border: 0; }
.summary-band .kpi-value { font-size: 1.2rem; margin: 2px 0; }
@media (max-width: 1200px) and (min-width: 901px) {
 body { padding-left: 180px; } .topbar { width: 180px; } .wrap { padding: 16px; }
 .overview-main { grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); }
 .summary-band { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); }
}
@media (max-width: 700px) {
 .summary-band { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
/* 조금 줄인 창에서도 본문 가장자리에 일정한 여유를 둔다. */
.wrap { padding-left: clamp(24px, 3vw, 48px); padding-right: clamp(24px, 3vw, 48px); }
.overview-main .methods .method-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
.method-kind { color: var(--text-muted); font-size: .75rem; }
.overview-main .methods .treatment-desc { grid-column: 1 / -1; font-size: .82rem; }
@media (max-width: 700px) { .wrap { padding-left: 18px; padding-right: 18px; } }
/* 같은 위치에서 비교 관점을 전환한다. */
.overview-main > .chart-panel { grid-column: 1; grid-row: 1; min-width: 0; }
.overview-main > .methods { grid-column: 2; grid-row: 1; }
.chart-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 8px; }
.chart-header > div:first-child, .chart-header > div:nth-child(2) { min-width: 0; flex: 1 1 220px; }
.chart-header h2 { margin: 0 0 .3rem; }
.chart-header .muted { margin: 0; }
.chart-tabs { display: inline-flex; flex-wrap: wrap; gap: 3px; margin: 0 0 0 auto; padding: 3px; background: var(--plane); border: 1px solid var(--border); border-radius: 7px; }
.chart-tabs button { border: 0; border-radius: 4px; padding: .4rem .7rem; color: var(--text-secondary); background: transparent; font-size: .82rem; }
.chart-tabs button[aria-selected="true"] { color: var(--text-primary); background: var(--surface-1); font-weight: 600; }
.chart-tabs button:hover { color: var(--text-primary); }
.chart-panel .delta-card { margin: 0; }
@media (max-width: 900px) {
 .overview-main > .chart-panel, .overview-main > .methods { grid-column: 1; grid-row: auto; }
}
/* 공통 UI: 패널은 부드러운 모서리, 선택 컨트롤은 둥근 형태로 통일한다. */
.card, .summary-band, .modal { border-radius: 10px; box-shadow: none; }
.summary-band .kpi-strip { border-radius: 8px; }
.tabs button { border-radius: 8px; }
select, input, button, .method-toggle { border-radius: 8px; }
input[type="checkbox"], input[type="radio"] { border-radius: initial; }
.chart-tabs, .segmented {
  align-self: flex-start; max-width: 100%; padding: 4px; gap: 2px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--plane);
}
.chart-tabs button, .segmented button {
  border: 0; border-radius: 999px; background: transparent;
  color: var(--text-secondary); padding: .45rem .85rem; font-weight: 500;
}
.chart-tabs button[aria-selected="true"], .segmented button[aria-pressed="true"] {
  color: var(--text-primary); background: var(--surface-1); font-weight: 600;
}
.trend-key, .chip, .status-pill { border-radius: 999px; }
.trend-key { padding: .3rem .65rem; }
button, select { transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
@media (max-width: 540px) {
 .chart-tabs, .segmented { border-radius: 14px; }
 .chart-tabs button, .segmented button { padding: .4rem .65rem; }
}
/* 전환 중 그래프 영역의 크기를 유지하고 제목·설명·범례 순서를 통일한다. */
.chart-panel [role="tabpanel"] { min-height: 0; animation: chart-enter .18s ease-out; }
.chart-panel [role="tabpanel"] > .legend { justify-content: flex-start; margin: 0; min-height: 1.4rem; }
.chart-panel [role="tabpanel"] > .chart { min-height: 300px; padding-top: 0; }
.chart-panel [role="tabpanel"] > .trend-legend { margin: .5rem 0 0; }
@keyframes chart-enter { from { opacity: .45; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .chart-panel [role="tabpanel"] { animation: none; } }

/* 전환할 때 그래프와 기법 이름의 시작 위치를 맞춘다. */
.chart-panel [role="tabpanel"] > .legend { min-height: 1.4rem; align-content: start; }
/* 실행 상세, 결과 검증, 실험 설정 공통 정보 밀도 */
#view-run .page-head, #view-verify .page-head, #view-settings .page-head { margin: 0 0 14px; align-items: center; }
#view-run .page-head .muted, #view-verify .page-head .muted, #view-settings .page-head .muted { margin-bottom: 0; }
#view-run .scope-wrap { justify-content: flex-end; }
#view-run .run-kpis { margin: 4px 0 14px; padding: 0 0 14px; border-top: 0; border-bottom: 1px solid var(--grid); }
#view-run .run-kpis .kpi { min-width: 0; }
#view-run .detail-analysis { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 10px; align-items: start; margin-bottom: 10px; }
#view-run .detail-analysis > .card { margin: 0; }
#view-run .detail-analysis .turn-row { padding: .5rem 0; margin: 0; border: 0; border-bottom: 1px solid var(--grid); border-radius: 0; background: transparent; }
#view-run .detail-analysis .turn-metrics { flex-wrap: wrap; }
#view-verify .hero-card { border-left: 1px solid var(--border); }
#view-verify .verify-verdict { font-size: 1.3rem; line-height: 1.35; }
#view-verify table, #view-run table, #view-settings table { font-variant-numeric: tabular-nums; }
#view-verify tbody tr:hover, #view-run tbody tr:hover, #view-settings tbody tr:hover { background: var(--plane); }
#view-settings .step-number { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-right: .35rem; border-radius: 50%; background: var(--plane); color: var(--text-secondary); font-size: .78rem; }
#view-settings .field-grid { grid-template-columns: minmax(0, 1fr); }
#view-settings .field-grid input, #view-settings .field-grid select { width: 100%; min-height: 2.35rem; }
#view-settings .condition-row { padding: .5rem 0; border-bottom: 1px solid var(--grid); }
#view-settings .controls button[data-jobs-tab] { border-radius: 999px; }
#view-settings .controls button[data-jobs-tab][aria-pressed="true"] { background: var(--plane); color: var(--text-primary); border-color: var(--border); font-weight: 600; }
@media (max-width: 1050px) { #view-run .detail-analysis { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { #view-run .scope-wrap { justify-content: flex-start; } }
.analysis-detail { margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--grid); }
.analysis-detail > summary { cursor: pointer; color: var(--text-secondary); font-size: .84rem; }
#view-settings :disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 1300px) {
 #view-run .page-head { grid-template-columns: minmax(0, 1fr); }
 #view-run .scope-wrap { justify-content: flex-start; }
}
/* 요청한 기록과 분석은 항상 펼쳐 표시한다. */
.expanded-section > h2 { margin: 0 0 .65rem; }
.expanded-section > .table-toolbar { margin-top: 0; }
.analysis-detail > h3 { margin: 0 0 .4rem; }
.scroll-x table, .table-scroll table { min-width: max-content; }
/* 사이드바는 클릭 가능한 영역 전체를 둥글게 표시한다. */
.tabs button { border-radius: 999px; padding: .65rem .9rem; }
.tabs button:hover { background: var(--plane); }
.tabs button[aria-selected="true"] { background: var(--plane); box-shadow: inset 3px 0 var(--series-1); }
/* 핵심 차트 옆에는 상위 턴만, 긴 분석은 아래에 펼쳐 둔다. */
#view-run .run-analysis-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
#view-run .run-analysis-grid > div { min-width: 0; }
#view-run .run-analysis-grid h3 { margin-top: .35rem; }
#view-run .run-analysis-grid .notes li { margin-bottom: .75rem; }
#view-run .detail-analysis .turn-row { grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .5rem; }
#view-run .detail-analysis .turn-metrics { grid-column: 1 / -1; gap: 1.2rem; }
#view-run .detail-analysis .turn-metrics .label { display: inline; margin-right: .3rem; }
@media (max-width: 1050px) { #view-run .run-analysis-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
/* 개요와 다른 화면의 페이지 제목·설명 위계를 맞춘다. */
.preview-heading h2 { font-size: 1.3rem; margin: 0 0 .2rem; letter-spacing: -.01em; }
.preview-heading p { font-size: .82rem; margin: 0; }
@media (min-width: 901px) { .topbar > .tabs { margin-top: 24px; } }

.related-links { display: grid; gap: .45rem; padding: 0 .8rem; }
.related-links h2 { margin: 0 0 .15rem; color: var(--text-muted); font-size: .78rem; }
.related-links a { color: var(--text-secondary); font-size: .8rem; line-height: 1.4; text-decoration: none; }
.related-links a:hover { color: var(--series-1); text-decoration: underline; }
.related-links a:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.summary-band .hero-compact { align-self: center; }
@media (max-width: 900px) { .related-links { padding: 0 .65rem; } }

/* 정리 패스: 한 기법은 어디서나 한 색, 판정은 한 번만, 빈 칸 대신 읽을 거리. */
.treatment-tag.series-colored { color: var(--tag-color); }
.summary-band .kpi-tile.lead .kpi-value { font-size: 1.45rem; }
.run-kpis .kpi .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-kpis .kpi[title] .label { text-decoration: underline dotted var(--text-muted); text-underline-offset: 3px; cursor: help; }
.expanded-section .scroll-x + .table-toolbar { margin-top: 1.75rem; }
.static-methods { list-style: none; margin: 0 0 14px; padding: 0; }
.static-methods li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--grid); font-size: .88rem; }
.static-methods li:last-child { border-bottom: 0; }
.static-methods .treatment-tag { background: none; padding: 0; }
.static-methods .muted { margin: 0; }
.archive-box .run-cmd { margin: 10px 0 0; padding: 8px 12px; background: var(--plane); border-radius: 5px; font-size: .8rem; overflow-x: auto; }
#jobs-table .empty-row td { padding: 18px 12px; color: var(--text-muted); text-align: center; font-size: .86rem; }
.archive-box .run-cmd code { background: none; padding: 0; border: 0; }

/* 설명 3단 */
.tier-hidden { display: none !important; }
.info-dot {
  display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 7px; padding: 0;
  vertical-align: 2px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-1);
  color: var(--text-muted); font: italic 600 11px/1 Georgia, serif; cursor: help; flex: none;
}
.info-dot:hover, .info-dot:focus-visible { color: var(--text-primary); border-color: var(--text-muted); }
.tooltip.info { max-width: min(360px, calc(100vw - 16px)); }
.tooltip.info p { margin: 0; }
.tooltip.info p + p { margin-top: .45rem; }
details.tier-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
details.tier-fold > summary::-webkit-details-marker { display: none; }
details.tier-fold > summary::before {
  content: ""; width: 7px; height: 7px; flex: none; margin: 0 4px 0 2px;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: rotate(-45deg); transition: transform .15s;
}
details.tier-fold[open] > summary::before { transform: rotate(45deg); }
details.tier-fold > summary h2 { margin: 0; }
details.tier-fold[open] > summary { margin-bottom: 12px; }
.method-item { cursor: default; }
.overview-main .methods .method-item { padding: .55rem 0; flex-direction: row; justify-content: space-between; align-items: baseline; }

/* 레이아웃 정리: 결론 한 줄 → 지표 4칸 → 전체 폭 차트 → 접힌 표.
   박스 안에 박스를 두지 않고, 같은 줄의 카드는 높이를 맞춘다. */
.summary-band { display: block; padding: 0; margin: 0 0 12px; background: none; border: 0; }
.summary-band .hero-compact { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; text-align: left; justify-self: auto; margin: 0 0 14px; }
.summary-band .hero-head { margin: 0; justify-content: flex-start; }
.summary-band .hero-compact .verdict { margin: 0; font-size: 1.3rem; line-height: 1.35; }
.summary-band .kpi-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0; background: none; }
.summary-band .kpi-tile { padding: 14px 16px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px; min-height: 0; }
.summary-band .kpi-value { font-size: 1.45rem; margin: 4px 0 2px; }
.summary-band .kpi-tile.lead .kpi-value { color: var(--good); }
.overview-main { grid-template-columns: minmax(0, 1fr); }
.overview-main > .methods { display: none; }
.overview-main > .chart-panel { grid-column: 1; grid-row: auto; }
#view-run .detail-analysis { align-items: stretch; }

@media (max-width: 900px) { .summary-band .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.summary-band .hero-compact .hero-head { flex: none; width: auto; }
.summary-band .hero-compact .verdict { flex: 0 1 auto; width: auto; text-align: left; }

/* 화면 공통 틀: 결론 한 줄(.view-head) → 숫자 카드 한 줄(.tile-row) → 카드 짝(.pair-row) → 접힌 표 */
.view-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.view-head .verdict { margin: 0; font-size: 1.3rem; line-height: 1.35; }
.tile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 10px; }
.tile-row .kpi-tile { padding: 14px 16px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px; min-height: 0; box-shadow: none; }
.tile-row .kpi-value { font-size: 1.45rem; margin: 4px 0 0; line-height: 1.25; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-row .kpi-label { color: var(--text-muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-row .kpi-tile[title] .kpi-label { text-decoration: underline dotted var(--text-muted); text-underline-offset: 3px; cursor: help; }
#view-run .run-kpis { margin: 0 0 10px; padding: 0; border: 0; }
.pair-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: stretch; margin: 0 0 10px; }
.pair-row.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); }
.pair-row > .card { margin: 0; }
#view-run .run-delta-chart { margin-top: 6px; }
@media (max-width: 1050px) { .pair-row, .pair-row.wide-left { grid-template-columns: minmax(0, 1fr); } }
/* 결과 검증의 회차 칩은 숫자 카드로 옮겼다 */
#view-verify .page-head .scope { display: none; }
/* 실험 설정, 공개 사이트(정적) 모드 */
.static-mode .field-grid, .static-mode #plan-btn, .static-mode #plan-btn + *, .static-mode .card .note:not(#status) { display: none !important; }
.static-mode #plan-btn { display: none !important; }
.static-mode .controls:has(#plan-btn) { display: none; }
.static-mode section.card:has(#jobs-table) { display: none; }
.static-mode .archive-box { margin-top: 4px; }
@media (max-width: 640px) { .tile-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tile-row .kpi-tile:last-child:nth-child(odd) { grid-column: 1 / -1; } }

/* 네 화면 공통 치수: 화면을 바꿔도 제목·결론·숫자 카드·카드 간격이 같은 자리에 오도록 */
#view-overview .preview-heading, .page-head { min-height: 44px; align-items: center; margin: 0 0 14px; padding: 0; }
.preview-heading h2, .page-head .page-title { font-size: 1.3rem; line-height: 1.5; margin: 0; }
.summary-band .hero-compact .verdict, .view-head .verdict, .view-head .verdict.verify-verdict { font-size: 1.3rem; line-height: 1.35; font-weight: 700; margin: 0; }
.summary-band .hero-compact, .view-head { margin: 0 0 14px; min-height: 28px; }
.summary-band { margin: 0; }
.summary-band .kpi-strip, .tile-row { margin: 0 0 10px; gap: 10px; }
.summary-band .kpi-tile, .tile-row .kpi-tile { padding: 14px 16px; min-height: 0; }
.summary-band .kpi-label, .tile-row .kpi-label { font-size: .8rem; line-height: 1.5; color: var(--text-muted); }
.summary-band .kpi-value, .tile-row .kpi-value { font-size: 1.45rem; line-height: 1.25; font-weight: 700; margin: 4px 0 0; }
.summary-band .kpi-tile[title] { cursor: help; }
#view-verify > .card, #view-settings section.card, #view-run > .card, #view-overview > .card { margin: 0 0 10px; }
.overview-main { margin: 0 0 10px; }
.summary-band .kpi-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) {
  #view-overview .preview-heading, .page-head { align-items: flex-start; min-height: 0; }
}

/* 개요: 증감률 차트 오른쪽 판정 카드 */
.overview-main { grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); align-items: stretch; }
.overview-main > .chart-panel { grid-column: 1; grid-row: 1; }
.overview-main > .judge-card { grid-column: 2; grid-row: 1; margin: 0; display: flex; flex-direction: column; }
.judge-card .card-head { margin-bottom: 6px; }
.judge-card .card-head h2 { font-size: 1rem; margin: 0; }
.judge-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; flex: 1; justify-content: space-around; }
.judge-item { padding: 10px 0; border-bottom: 1px solid var(--grid); }
.judge-item:last-child { border-bottom: 0; }
.judge-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.judge-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .86rem; color: var(--text-primary); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.judge-name .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.judge-chip { flex: none; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; color: var(--text-secondary); background: color-mix(in srgb, var(--text-muted) 14%, transparent); }
.judge-chip.good { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.judge-chip.bad { color: var(--critical); background: color-mix(in srgb, var(--critical) 14%, transparent); }
.judge-chip.muted { opacity: .7; }
.judge-bar { display: flex; align-items: center; gap: 10px; margin-top: 7px; padding-left: 17px; }
.judge-empty { font-size: .76rem; color: var(--text-muted); }
.judge-gauge { position: relative; flex: 1; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--text-muted) 16%, transparent); }
.judge-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.judge-fill.good { background: var(--good); }
.judge-fill.bad { background: var(--critical); }
.judge-line { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text-secondary); border-radius: 1px; }
.judge-value { flex: none; width: 52px; text-align: right; font-size: .78rem; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
@media (max-width: 1100px) {
  .overview-main { grid-template-columns: minmax(0, 1fr); }
  .overview-main > .judge-card { grid-column: 1; grid-row: auto; }
}
