/* 분석 실행(testing) 화면: 실행 콘솔(.test-console, .run-*), 질문 후보 검토
 * (.analysis-question-*), 단계형 분석(.staged-*,
 * .homepage-enrichment-*, .deep-report-request-panel), 경량 리포트 결과
 * (.test-summary, .metric, .provider-*, .response-*, .citation-*, .audit-*).
 *
 * 순서 제약 메모:
 * - .test-console small/h2/p 규칙에 .section-head small/h2/p 가 같은 선택자
 *   목록으로 묶여 있다. account.css 의 .section-head p 규칙(14px)을 여기서
 *   같은 특이도로 덮어쓰므로(13px) 이 파일은 account.css 뒤에 링크되어야 한다.
 * - .module-grid/.module-card/.module-meta 는 운영 리포트
 *   (renderOperationsReport)가 쓰는 카드라 이 파일로 왔다(원본에서는
 *   provider 설정 블록 뒤에 있었다 -- 선택자가 겹치는 규칙 없음).
 * - 두 번째 .staged-actions button 규칙(width/padding 재정의)은 원본에서
 *   모니터링 블록 사이에 끼어 있던 것을 제자리로 가져온 것으로, 첫 규칙보다
 *   뒤라는 원본 순서는 그대로다.
 *
 * 반경·그림자는 css/tokens.css의 계단을 읽는다. 이 화면은 상자가 세 겹으로
 * 겹치는 곳이다 -- 실행 콘솔 안에 고급 설정 카드가 있고 그 안에 질문 행이 있다.
 * 그런데 셋이 전부 8px이었고 결과 카드만 10px이라, 겹침의 깊이 대신 "어느 시기에
 * 쓴 규칙인가"가 모서리로 드러나 있었다. 이제 콘솔·단계 패널은 --panel-radius,
 * 그 안의 카드는 --card-radius, 행과 띠는 --row-radius다. 손으로 적은 그림자
 * 세 개(10/30/.08, 8/24/.06 두 벌)도 --panel-shadow 하나로 모았다. */

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.module-card {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: #fff;
  padding: 14px;
}

.module-card[data-enabled="false"] {
  border-color: var(--line);
  background: var(--surface-muted);
  opacity: .82;
}

.module-card small {
  color: var(--muted-strong);
  font-family: monospace;
}

.module-card h3 {
  margin: 5px 0;
  font-size: var(--fs-5);
}

.module-card p {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-3);
  line-height: var(--lh-base);
}

.module-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.module-meta span {
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--muted-strong);
  background: var(--surface-muted);
  font-size: var(--fs-1);
}

.module-card strong {
  color: var(--brand-dark);
  font-size: var(--fs-3);
}

.module-card[data-enabled="false"] strong {
  color: var(--warning);
}

.test-console {
  margin-bottom: 14px;
  scroll-margin-top: 96px;
  display: grid;
  gap: 16px;
  border: 1px solid rgba(10, 189, 163, .28);
  border-radius: var(--panel-radius);
  background: var(--surface-soft);
  padding: 20px 22px;
  box-shadow: var(--panel-shadow);
}

.test-console-head {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.test-console small,
.section-head small {
  color: var(--muted-strong);
  font-weight: 800;
  letter-spacing: 0;
}

.test-console h2,
.section-head h2 {
  margin: 6px 0;
}

.test-console p,
.test-run-meta,
.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-2);
  line-height: 1.55;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.test-console label {
  display: grid;
  gap: 7px;
  color: var(--muted-strong);
  font-size: var(--fs-2);
  text-align: left;
}

.test-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.test-console textarea {
  min-height: 88px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  padding: 11px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.field-hint {
  color: var(--muted);
  font-size: var(--fs-1);
  line-height: 1.45;
}

/* .test-console p 가 더 특이해서(클래스+요소) 힌트가 본문 크기로 커진다. 입력란 아래
   보조 문구는 설명 문단이 아니라 힌트로 읽혀야 하므로 크기만 되돌린다. */
.test-console .field-hint {
  font-size: var(--fs-1);
  line-height: 1.45;
}

.test-console input,
.test-console select {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  padding: 0 34px 0 11px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.test-console button {
  height: 44px;
  white-space: nowrap;
  border: 0;
  border-radius: var(--control-radius);
  color: #fff;
  background: var(--brand-dark);
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(8, 127, 111, .22);
}

/* .test-console button is more specific than .secondary, so every control in the
   run console rendered as a primary action. Restore the muted treatment, matching
   the look .analysis-question-toolbar already used for its non-primary buttons. */
.test-console button.secondary {
  border: 1px solid var(--line);
  color: var(--muted-strong);
  background: var(--surface-muted);
  box-shadow: none;
}

.test-console button.secondary:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.test-console button:disabled {
  opacity: .65;
  cursor: not-allowed;
}

/* 세 단계는 서로 자유 이동 가능한 탭이다(랜딩의 순서 강제형 stepDots()와 다르다) --
   재방문자가 결과·이력을 보러 설정부터 다시 밟을 이유가 없다. 이 규칙은 위 .test-console
   button보다 아래에 있어야 한다: 특이도가 같아 나중 규칙이 이긴다. */
.testing-steps {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.testing-steps button {
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--control-radius) var(--control-radius) 0 0;
  color: var(--muted-strong);
  background: transparent;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: none;
}

.testing-steps button.active {
  color: var(--brand-dark);
  background: #fff;
  box-shadow: 0 -2px 0 var(--brand) inset;
}

/* 자유 이동은 유지하되, 번호가 세 탭이 한 흐름의 순서임을 말한다 -- 설정의 다음 버튼과
   실행 완료가 이 순서대로 자동으로 넘겨 준다(app.js advanceSetupToReview·startAnalysisJob). */
.testing-steps button b {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 7px;
  border-radius: 50%;
  color: var(--muted-strong);
  background: var(--surface-muted);
  font-size: 11px;
  font-weight: 800;
}

.testing-steps button.active b {
  color: #fff;
  background: var(--brand);
}

.testing-screen {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 14px;
}

.testing-screen[hidden] {
  display: none;
}

.testing-step-next {
  justify-self: start;
}

.analysis-question-source {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: #fff;
  padding: 14px;
}

.analysis-question-source-head {
  display: grid;
  gap: 3px;
}

.analysis-question-source-head strong {
  font-size: var(--fs-3);
}

.analysis-question-source-head span {
  color: var(--muted);
  font-size: var(--fs-1);
}

.analysis-question-source-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 8px;
}

.analysis-question-source-options label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  cursor: pointer;
}

.analysis-question-source-options label:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.analysis-question-source-options label:has(input:disabled) {
  cursor: not-allowed;
  opacity: .58;
}

.analysis-question-source-options input {
  flex: none;
  margin-top: 3px;
}

.analysis-question-source-options span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.analysis-question-source-options b {
  font-size: var(--fs-2);
}

.analysis-question-source-options small {
  color: var(--muted);
  font-size: var(--fs-1);
  line-height: 1.4;
}

.testing-history-pointer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.testing-history-pointer span {
  color: var(--muted);
  font-size: 12px;
}

.run-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 0;
}

#start-analysis-job {
  height: 48px;
  font-size: var(--fs-3);
  font-weight: 800;
}

.run-target-card {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(10, 189, 163, .24);
  border-radius: var(--row-radius);
  background: #fff;
  padding: 10px;
}

.run-target-card small {
  font-size: var(--fs-1);
}

.run-target-card strong {
  min-width: 0;
  color: var(--text);
  font-size: var(--fs-3);
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.run-target-card span {
  color: var(--muted);
  font-size: var(--fs-1);
  line-height: 1.35;
}

/* An unscoped run is legal but easy to trigger by accident, so the card warns
   before the run instead of leaving the user to wonder where the result went. */
.run-target-card[data-project-linked="false"] {
  border-color: var(--warning);
  background: var(--warning-soft);
}

/* 프로젝트를 안 고르면 새로 만들어 담는다는 안내다 -- 경고가 아니라 사실 전달이라
   경고색을 쓰지 않는다(2026-08-02). 클래스 이름은 마크업·JS가 함께 쓰므로 유지. */
.run-target-warning {
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--fs-1);
  font-style: normal;
  line-height: 1.4;
}

.run-target-warning[hidden] {
  display: none;
}

.run-actions button {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  font-size: var(--fs-2);
  line-height: 1.25;
  white-space: normal;
}

/* 분석 실행 화면에서 결과 화면으로 넘기는 안내 카드. */
.analysis-result-handoff {
  border: 1px solid rgba(10, 189, 163, .24);
  border-radius: var(--card-radius);
  background: #fff;
  padding: 16px 18px;
}

.analysis-result-handoff-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.analysis-result-handoff-grid button {
  display: grid;
  gap: 4px;
  min-height: 66px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  color: var(--muted-strong);
  background: var(--surface-muted);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.analysis-result-handoff-grid button:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.analysis-result-handoff-grid button:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.analysis-result-handoff-grid b {
  color: var(--text);
  font-size: var(--fs-3);
}

.analysis-result-handoff-grid span {
  color: var(--muted);
  font-size: var(--fs-1);
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: keep-all;
}

/* Primary run inputs: 분석할 대상 leads, so it gets the wider column and a
   heavier field treatment; everything else lives under 고급 설정. */
.analysis-primary-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: end;
}

.analysis-primary-grid #analysis-target-company {
  height: 48px;
  font-size: var(--fs-4);
  font-weight: 700;
  border-color: rgba(10, 189, 163, .55);
}

/* 고급 설정: collapsed by default so the run screen is target + project + run. */
.analysis-advanced {
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface-muted);
  overflow: hidden;
}

.analysis-advanced > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  color: var(--muted-strong);
  font-weight: 800;
  font-size: var(--fs-2);
  -webkit-user-select: none;
  user-select: none;
}

.analysis-advanced > summary::-webkit-details-marker {
  display: none;
}

.analysis-advanced > summary::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted-strong);
  border-bottom: 2px solid var(--muted-strong);
  transform: rotate(-45deg);
  transition: transform .15s ease;
}

.analysis-advanced[open] > summary::before {
  transform: rotate(45deg);
}

.analysis-advanced > summary:hover {
  color: var(--brand-dark);
}

.analysis-advanced .adv-hint {
  color: var(--muted);
  font-weight: 600;
  font-size: var(--fs-1);
}

.analysis-advanced[open] .adv-hint {
  display: none;
}

.analysis-advanced-body {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.analysis-advanced-body .test-control-grid {
  align-items: end;
}

/* 실행 화면의 "사용할 AI"는 고르는 자리가 아니라 확인하는 자리다(설정은 AI 설정 화면
   하나뿐). 그래서 입력칸이 아니라 읽는 줄로 서고, 회당 소모 배지와 바꾸러 갈 링크가
   같은 줄 오른쪽에 붙는다 -- 배지는 AI 설정 화면과 같은 .run-quota-badge다. */
.analysis-provider-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--row-radius);
  background: #fff;
}

.analysis-provider-summary small {
  flex: none;
  color: var(--muted);
  font-size: var(--fs-1);
  font-weight: 700;
}

.analysis-provider-summary strong {
  min-width: 0;
  font-size: var(--fs-2);
  font-weight: 700;
}

/* 배지는 AI 설정 화면에서 격자 위에 홀로 서던 크기다. 한 줄 안에 이름·링크와 나란히
   설 때는 그 크기가 줄을 지배하므로 눈금만 줄인다 -- 숫자는 그대로 읽힌다. */
.analysis-provider-summary .run-quota-badge {
  margin-left: auto;
  gap: 4px 10px;
  padding: 5px 11px;
  font-size: var(--fs-1);
}

.analysis-provider-summary .run-quota-badge b { font-size: var(--fs-2); }

.analysis-provider-summary a {
  flex: none;
  color: var(--brand-dark);
  font-size: var(--fs-1);
  font-weight: 700;
}

.analysis-question-reuse {
  min-width: 0;
}

.analysis-question-reuse label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.analysis-question-reuse[hidden] { display: none; }

.analysis-question-review {
  scroll-margin-top: 96px;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(10, 189, 163, .22);
  border-radius: var(--card-radius);
  background: #fff;
  padding: 12px;
}

.analysis-question-review h3 {
  margin: 3px 0;
  font-size: var(--fs-4);
  line-height: 1.35;
}

.analysis-question-toolbar,
.analysis-question-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: stretch;
}

.analysis-question-add {
  grid-template-columns: minmax(0, 1fr) max-content;
}

.analysis-question-toolbar button,
.analysis-question-add button,
.analysis-question-meta button {
  min-height: 38px;
  height: auto;
  padding: 8px 12px;
  font-weight: 800;
}

.analysis-question-toolbar button,
.analysis-question-meta button {
  border: 1px solid var(--line);
  color: var(--muted-strong);
  background: var(--surface-muted);
  box-shadow: none;
}

.analysis-question-selection-actions,
.analysis-question-generation-actions {
  display: flex;
  gap: 8px;
}

.analysis-question-generation-actions {
  justify-content: flex-end;
}

.analysis-question-generation-actions button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  color: var(--muted-strong);
  background: var(--surface-muted);
  box-shadow: none;
  font-weight: 800;
}

.analysis-question-list {
  display: grid;
  gap: 8px;
}

/* PRISM 분포(AidePrism.spectrumBar). 마크업과 색은 landing.css/prism.js가 단일
 * 원천이고 여기서는 이 행의 치수만 올린다.
 *
 * 랜딩의 치수(막대 4px, 범례 10.5px)는 카드 폭이 좁은 목록에 맞춰 잡은 것이다.
 * 여기 행은 질문 입력칸만큼 넓은데 그 폭에 90px짜리 색칸 다섯 개가 오른쪽 끝에
 * 붙어 있었고, 그 안에서 뒤쪽 세 영역은 1px씩이라 색이 있다는 것만 보였다. 폭을
 * 행에 맞추고 두께를 두 배로 올려야 12%와 5%가 서로 다른 굵기로 읽힌다.
 *
 * 랜딩 규칙보다 뒤에 서려면 특이도를 하나 더 얹어야 한다 -- staged.css는
 * index.html에서 landing.css보다 **먼저** 링크되므로 같은 특이도로는 진다. */
.analysis-question-row .prism-spectrum {
  grid-column: 2;
  gap: 6px;
}

.analysis-question-row .prism-spectrum-bar {
  height: 9px;
  border-radius: var(--row-radius);
}

.analysis-question-row .prism-spectrum-legend {
  font-size: var(--fs-1);
  gap: 3px 10px;
}

.analysis-question-row .prism-spectrum-legend i {
  width: 7px;
  height: 7px;
}

.analysis-question-row {
  scroll-margin-top: 96px;
  display: grid;
  grid-template-columns: minmax(92px, max-content) minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--row-radius);
  background: var(--surface-muted);
  padding: 10px;
}

.analysis-question-check {
  display: inline-flex !important;
  align-items: center;
  gap: 7px !important;
  min-height: 38px;
  color: var(--muted-strong);
  font-weight: 800;
}

.analysis-question-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 0;
  accent-color: var(--brand-dark);
}

.analysis-question-review textarea {
  min-height: 58px;
}

.analysis-question-meta {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.analysis-question-meta span {
  min-width: 0;
  color: var(--muted);
  font-size: var(--fs-1);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.run-status {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: var(--fs-1);
}

.run-status span {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.run-status i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width .7s linear;
  will-change: width;
}

.test-console textarea.readonly {
  color: var(--muted-strong);
  background: var(--surface-muted);
}

.staged-analysis-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface);
  padding: 20px 22px;
  box-shadow: var(--panel-shadow);
}

/* 준비→실행 두 걸음짜리 레인 두 개(추가 질문/심층). 묶음은 레인이, 다음에 누를 버튼은
   data-staged-next 강조가 말한다 -- 실행은 과금이 걸려 자동으로 잇지 않는다(views/staged.js). */
.staged-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
}

.staged-flow-lane {
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--row-radius);
  background: var(--surface-muted);
  padding: 10px;
}

.staged-flow-lane > small {
  color: var(--muted-strong);
  font-size: var(--fs-1);
  font-weight: 700;
}

.staged-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px;
  align-items: stretch;
}

.staged-actions button[data-staged-next] {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand);
}

.staged-query-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 190px) max-content;
  gap: 8px;
  align-items: stretch;
}

.staged-actions button,
.staged-query-actions button,
.staged-query-add button {
  min-height: 38px;
  border: 0;
  border-radius: var(--control-radius);
  padding: 0 12px;
  color: #fff;
  background: var(--brand-dark);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.staged-actions button:disabled,
.staged-query-actions button:disabled,
.staged-query-add button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* 주황(경고)은 플랜 잠금에만 -- 순서상 아직 못 누르는 버튼(단순 disabled)까지 이 색을
   입히면 Pro Max 사용자에게도 업그레이드 안내처럼 읽힌다(views/staged.js data-plan-locked). */
.staged-actions button[data-plan-locked]:disabled {
  border: 1px solid rgba(180, 83, 9, .28);
  color: var(--warning);
  background: var(--warning-soft);
}

.staged-upgrade-note {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(180, 83, 9, .28);
  border-radius: var(--row-radius);
  background: var(--warning-soft);
  padding: 11px 12px;
}

.staged-upgrade-note b {
  color: var(--warning);
  font-size: var(--fs-2);
}

.staged-upgrade-note span {
  color: var(--muted-strong);
  font-size: var(--fs-2);
  line-height: 1.5;
}

.homepage-enrichment-status {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, auto) max-content;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--row-radius);
  background: var(--surface-muted);
  padding: 12px;
}

.homepage-enrichment-status > div:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.homepage-enrichment-status small,
.homepage-enrichment-status span {
  color: var(--muted-strong);
  font-size: var(--fs-1);
}

.homepage-enrichment-status > div:first-child span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.homepage-enrichment-status[data-status="failed"] {
  border-color: rgba(185, 28, 28, .26);
  background: rgba(254, 226, 226, .46);
}

.homepage-enrichment-status[data-status="extracting"] {
  border-color: rgba(37, 99, 235, .26);
  background: rgba(219, 234, 254, .42);
}

.homepage-enrichment-pending {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted-strong);
  font-size: var(--fs-1);
  line-height: 1.5;
}

.homepage-enrichment-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  gap: 8px;
}

.homepage-enrichment-metrics span {
  display: grid;
  gap: 2px;
  text-align: center;
}

.homepage-enrichment-metrics b {
  color: var(--text);
  font-size: var(--fs-2);
}

.homepage-topic-keywords {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
}

.homepage-topic-keywords small {
  color: var(--muted-strong);
  font-size: var(--fs-1);
}

.homepage-topic-keywords-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.homepage-topic-keyword-chip {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 3px 10px;
  color: var(--text);
  font-size: var(--fs-1);
  cursor: help;
}

.homepage-enrichment-status button {
  min-height: 38px;
  border: 0;
  border-radius: var(--control-radius);
  padding: 0 12px;
  color: #fff;
  background: var(--brand-dark);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.staged-run-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.staged-run-meta span {
  display: grid;
  min-width: 0;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--row-radius);
  background: var(--surface-muted);
  padding: 9px;
  color: var(--muted-strong);
  font-size: var(--fs-1);
}

.staged-run-meta b {
  color: var(--muted);
  font-size: var(--fs-1);
  text-transform: uppercase;
}

.staged-query-list {
  display: grid;
  gap: 8px;
}

.staged-query-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, max-content);
  gap: 10px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--row-radius);
  background: #fff;
  padding: 10px;
}

.staged-query-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 190px);
  gap: 8px;
}

.staged-query-row textarea,
.staged-query-add textarea {
  min-height: 58px;
  resize: vertical;
}

.staged-query-row textarea,
.staged-query-row select,
.staged-query-add textarea,
.staged-query-add select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  padding: 9px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.staged-query-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(70px, max-content));
  justify-content: end;
  align-content: start;
  gap: 8px;
}

.staged-query-actions span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: var(--fs-1);
  text-align: right;
}

.staged-query-add textarea {
  min-width: 0;
}

.staged-query-add select {
  min-width: 0;
  width: 100%;
}

.deep-report-request-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface);
  padding: 16px 18px;
  box-shadow: var(--panel-shadow);
}

.deep-report-request-panel > div {
  min-width: 0;
}

.deep-report-request-panel small {
  color: var(--brand-dark);
  font-size: var(--fs-1);
  font-weight: 800;
}

.deep-report-request-panel h2 {
  margin: 4px 0;
  font-size: var(--fs-5);
}

.deep-report-request-panel p {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-3);
  line-height: var(--lh-base);
}

.deep-report-request-panel button {
  min-height: 40px;
  white-space: nowrap;
}

.deep-report-request-panel [data-deep-report-request-status] {
  grid-column: 1 / -1;
}

.staged-actions button {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  white-space: normal;
}

.test-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.metric,
.provider-card,
.source-list,
.audit-table {
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--panel-shadow);
}

.metric {
  padding: 16px;
}

.metric small {
  color: var(--brand-dark);
  font-weight: 800;
  letter-spacing: 0;
}

.metric strong {
  display: block;
  margin: 8px 0 3px;
  font-size: var(--fs-6);
}

.metric span {
  color: var(--muted);
  font-size: var(--fs-1);
}

.result-section {
  margin-top: 22px;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
}

.response-list {
  display: grid;
  gap: 12px;
}

.provider-card {
  min-height: 350px;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.response-card {
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface);
  padding: 16px 18px;
  box-shadow: var(--panel-shadow);
}

.response-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.response-head small {
  color: var(--muted);
  font-family: monospace;
}

.response-head h3 {
  margin: 5px 0 0;
  font-size: var(--fs-5);
  line-height: 1.45;
}

.response-head > span {
  flex: 0 0 auto;
  height: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: var(--fs-1);
}

.response-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.response-fields span {
  display: inline-flex;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted-strong);
  background: var(--surface-muted);
  font-size: var(--fs-1);
}

.response-fields b {
  color: var(--brand-dark);
}

.response-card > p {
  max-height: 170px;
  overflow: auto;
  margin: 10px 0;
  /* U-6: this box holds the actual AI answer text -- the content the report
   * exists to show, not a caption around it. */
  color: var(--text);
  font-size: var(--fs-3);
  line-height: var(--lh-base);
  white-space: pre-line;
}

.response-citations {
  margin-top: 10px;
}

.response-citations summary {
  color: var(--brand-dark);
  cursor: pointer;
  font-size: var(--fs-2);
}

.provider-card[data-mode="on"] {
  border-color: rgba(10, 189, 163, .32);
}

.provider-card[data-mode="off"] {
  border-color: rgba(100, 116, 111, .25);
}

.provider-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.provider-head small {
  color: var(--muted);
  font-family: monospace;
}

.provider-head h3 {
  margin: 4px 0 0;
}

.provider-head > span,
.provider-meta span,
.audit-row > span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: var(--fs-1);
}

.provider-card > p {
  min-height: 74px;
  max-height: 112px;
  overflow: auto;
  /* U-6: same as .response-card > p -- the AI answer text itself. */
  color: var(--text);
  font-size: var(--fs-3);
  line-height: var(--lh-base);
}

.provider-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.provider-actions {
  display: flex;
  justify-content: flex-end;
}

.provider-actions button {
  min-height: 34px;
  border: 0;
  border-radius: var(--control-radius);
  background: var(--brand-dark);
  color: #fff;
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.provider-actions button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.provider-error {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  border: 1px solid #f0b8b8;
  border-radius: var(--row-radius);
  padding: 10px;
  background: #fff5f5;
  color: #9f1d1d;
  font-size: var(--fs-1);
}

.citation-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.provider-card .citation-list {
  max-height: 142px;
  overflow: auto;
}

.citation-list a,
.citation-list .citation-item {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--row-radius);
  padding: 9px;
  color: var(--text);
  text-decoration: none;
  background: var(--surface-muted);
}

.citation-list span,
.no-citation {
  color: var(--muted);
  font-size: var(--fs-1);
}

.no-citation {
  border: 1px dashed var(--line);
  border-radius: var(--row-radius);
  padding: 10px;
  background: var(--surface-muted);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.source-list {
  display: grid;
  padding: 8px;
}

.source-list div,
.audit-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.source-list div:last-child,
.audit-row:last-child {
  border-bottom: 0;
}

.source-list span {
  color: var(--muted-strong);
}

.audit-table {
  overflow: hidden;
}

.audit-row {
  align-items: flex-start;
  justify-content: flex-start;
}

.audit-row > span {
  flex: 0 0 auto;
  color: var(--muted-strong);
  background: var(--surface-muted);
}

.audit-row[data-status="implemented"] > span {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.audit-row[data-status="implemented_mock"] > span,
.audit-row[data-status="partial"] > span,
.audit-row[data-status="mock_recreated"] > span,
.audit-row[data-status="recreated_for_lightweight_report"] > span {
  color: var(--warning);
  background: var(--warning-soft);
}

.audit-row[data-status="implemented_control_plane"] > span {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.audit-row[data-status="not_implemented"] > span {
  color: var(--danger);
  background: #fff1f2;
}

.audit-row strong {
  display: block;
}

.audit-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--fs-1);
  line-height: 1.5;
}

/* U-10: was 850px and 560px (docs/plans/ROADMAP.md §2.1) -- both merged onto
 * the console's ≤760px tier. 2026-08-11: 뷰포트 대신 main 컬럼 폭(@container
 * content-col, css/layout.css) 기준으로 이관. */
@container content-col (width < 720px) {
  .analysis-question-review {
    scroll-margin-top: 24px;
  }

  .analysis-question-row {
    grid-template-columns: 1fr;
    scroll-margin-top: 24px;
  }

  /* 한 칸으로 접히면 2번 칸이 없다. 남겨 두면 암시적 열이 하나 생기면서 분포만
     행 밖으로 밀려난다. */
  .analysis-question-row .prism-spectrum {
    grid-column: 1;
  }

  .analysis-question-meta {
    grid-column: 1;
  }

  .homepage-enrichment-status {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .homepage-enrichment-status > div:first-child span {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .analysis-question-toolbar,
  .analysis-question-add {
    grid-template-columns: 1fr;
  }

  .analysis-question-generation-actions {
    justify-content: stretch;
  }

  .analysis-question-generation-actions button {
    width: 100%;
  }
}
