/* 티오더 CS Quality — 앱 전용 스타일.

   design.css(디자인 시스템)와 refinements.css(대화창·보기 마감) 위에 얹는다.
   여기에는 실제 서비스에만 있는 화면 — 로그인, 주차 선택, 채점 결과, 관리자
   대시보드 — 과 자바스크립트가 만들어 내는 조각들만 둔다.
   색·간격은 전부 design.css 의 토큰을 쓴다. 하드코딩한 색은 다크 모드에서 깨진다. */

:root {
  /* 예전 이름을 새 토큰에 연결해 둔다. */
  --background: var(--bg);
  --soft: var(--surface-2);
  --line-strong: var(--strong-line);
  --muted-dark: var(--muted);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --yellow: #fee500;
  --warning: #8a5b00;
  --warning-bg: #fff8e6;
  --warning-line: #f4dfae;
  --info: #1764b0;
  --info-bg: #f5f9ff;
  --info-line: #b9d8ff;
}

:root[data-theme=dark] {
  --warning: #f2cd7c;
  --warning-bg: #332c1c;
  --warning-line: #55492c;
  --info: #8fc4ff;
  --info-bg: #1a2432;
  --info-line: #2f4966;
}

/* ── 공통 ───────────────────────────────────────────────── */

.icon { flex: 0 0 auto; }

.primary-button,
.secondary-button,
.ghost-button,
.google-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 620;
  line-height: 1.4;
  white-space: nowrap;
  transition: background .2s, transform .2s, border-color .2s;
}

.primary-button { background: #dd1740; color: #fff; }
.primary-button:hover:not(:disabled) { background: #c71338; }
.secondary-button { background: var(--surface-2); color: var(--text); }
.secondary-button:hover:not(:disabled) { background: var(--line); }
.ghost-button { min-height: 42px; background: transparent; color: var(--muted); }
.ghost-button:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.primary-button:disabled, .secondary-button:disabled, .ghost-button:disabled { cursor: default; opacity: .5; }

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}
.icon-button:hover { color: var(--text); }

.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast-region {
  position: fixed;
  z-index: 2000;
  left: 50%;
  bottom: 26px;
  display: grid;
  gap: 8px;
  pointer-events: none;
  transform: translateX(-50%);
}

.toast-region .toast {
  position: static;
  min-width: 210px;
  max-width: calc(100vw - 36px);
  padding: 13px 19px;
  border-radius: 12px;
  background: var(--text);
  color: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: .2s ease;
}
.toast-region .toast.is-visible { opacity: 1; transform: translateY(0); }

.caution-box {
  display: flex;
  gap: 11px;
  padding: 15px 17px;
  border: 1px solid var(--warning-line);
  border-radius: var(--radius-md);
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 13px;
  line-height: 1.6;
}
.caution-box .icon { margin-top: 1px; }
.caution-list { display: grid; gap: 8px; }

.rate-track { height: 9px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.rate-fill { height: 100%; border-radius: inherit; background: var(--red); }

/* ── 헤더 · 로고와 테마 선택 ────────────────────────────── */

/* 다크 모드에서는 흰 박스를 두르는 대신 모노(흰색) 로고로 바꾼다.
   두 이미지의 여백이 서로 달라 잘라내는 값도 따로 잡는다.
   컬러 1200x1200 안에서 글자는 (67,469)-(1133,705), 모노 1200x800 안에서는
   (200,311)-(1000,488) 이다. */
.brand-logo > .brand-mark-mono {
  position: absolute;
  display: block;
  width: 150%;
  height: auto;
  max-width: none;
  left: -25%;
  top: -175.6%;
  opacity: 0;
}
:root[data-theme=dark] .brand-logo { background: none; border: 0; border-radius: 0; }
:root[data-theme=dark] .brand-logo > .brand-mark-color { opacity: 0; }
:root[data-theme=dark] .brand-logo > .brand-mark-mono { opacity: 1; }

/* 다크 모드에서 select 의 펼친 목록은 OS 가 그린다. 배경·글자색을 직접 주지
   않으면 흰 글자가 흰 배경에 얹혀 읽히지 않는다. */
.theme-picker select,
.filter-select {
  color: var(--text);
  background: var(--surface);
}
.theme-picker select option,
.filter-select option {
  background: var(--surface);
  color: var(--text);
}
/* 크롬은 펼친 목록을 OS 로 그린다. color-scheme 을 select 자체에 걸어야
   목록 배경까지 어두워진다. (투명 배경만 주면 흰 목록에 흰 글자가 된다) */
:root[data-theme=dark] .theme-picker select,
:root[data-theme=dark] .filter-select { color-scheme: dark; }

/* ── CS 에이전트 · 입력 ─────────────────────────────────── */

.prompt-form { position: relative; margin: 4px 0 18px; }

.prompt-field {
  margin-top: 0 !important;
  padding: 2px;
  border-radius: 26px !important;
}
.prompt-inner {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  border-radius: 24px;
  background: var(--surface);
  overflow: hidden;
}
.prompt-field textarea {
  flex: 1;
  min-width: 0;
  min-height: 64px;
  max-height: 260px;
  display: block;
  padding: 19px 4px 19px 24px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  resize: vertical;
  font-size: 16px;
  line-height: 1.7;
}
.prompt-field textarea::placeholder { color: var(--faint); }
.prompt-send {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  margin: 0 9px 9px 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #dd1740;
  color: #fff;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.prompt-send:hover:not(:disabled) { background: #c71338; transform: translateY(-1px); }
.prompt-send:disabled { cursor: default; opacity: .55; }
.prompt-send .spinner { border-color: rgba(255, 255, 255, .45); }
.prompt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 10px 6px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.prompt-count { flex: 0 0 auto; }

/* 검색 뒤에는 입력창이 결과를 가리지 않도록 한 줄로 접고, 다시 누르면 원래 높이로 연다. */
body[data-page="agent"] .prompt-form.has-results:not(:focus-within) .prompt-field textarea {
  min-height: 46px;
  height: 46px;
  padding-block: 9px;
  font-size: 14px;
}
body[data-page="agent"] .prompt-form.has-results:not(:focus-within) .prompt-send { width: 40px; height: 40px; }
body[data-page="agent"] .prompt-form.has-results:not(:focus-within) .prompt-foot { display: none; }
body[data-page="agent"] #agent-results { scroll-margin-top: 190px; }

#examples { margin-bottom: 26px; }
.example-label { margin-top: 0; }
.example-chip { text-align: left; line-height: 1.5; cursor: pointer; }
.input-hint { color: var(--muted); font-size: 13px; }

/* ── CS 에이전트 · 결과 ─────────────────────────────────── */

/* 유형 판정은 참고용 — 한 줄 칩으로만 둔다. */
.intent-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 20px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
}
.intent-strip-label { margin-right: 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.intent-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}
.intent-chip b { font-weight: 620; }
.intent-chip i { font-style: normal; font-variant-numeric: tabular-nums; opacity: .75; }
.intent-chip.is-top { background: var(--red-soft); color: var(--red-text); }

/* 왼쪽은 그대로 쓰는 것, 오른쪽은 참고만 하는 것. */
.agent-result-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.result-col { min-width: 0; }
.result-empty-col {
  padding: 26px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
}
.kms-name { padding: 4px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--info-line); color: var(--info); font-size: 11px; font-weight: 600; }
.results-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.results-topline h2 { font-size: 20px; }
.fixture-label { padding: 5px 9px; border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 650; }

/* 검색 결과 첫 화면 — 문의 맥락, 사용할 수 있는 문안과 확인량을 먼저 요약한다. */
.result-overview {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(470px, 1.2fr);
  gap: 22px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--red-soft) 48%, var(--surface)), var(--surface) 48%);
}
.result-query-summary { min-width: 0; padding-right: 8px; }
.result-eyebrow { display: block; margin-bottom: 8px; color: var(--red-text); font-size: 11px; font-weight: 700; }
.result-query-summary > strong { display: block; font-size: 20px; line-height: 1.45; letter-spacing: -.45px; overflow-wrap: anywhere; }
.result-query-summary > p { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.result-overview-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-self: stretch; }
.result-overview-metrics > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 13px 12px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}
.result-overview-metrics span { margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 650; }
.result-overview-metrics strong { overflow: hidden; font-size: 15px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.result-overview-metrics strong small { margin-left: 2px; color: currentColor; font-size: 11px; }
.result-overview-metrics > div > small { margin-top: 5px; overflow: hidden; color: var(--faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.result-evidence-state {
  position: absolute;
  top: 0;
  right: 20px;
  padding: 5px 9px;
  border-radius: 0 0 8px 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}
.result-evidence-state.is-weak { background: var(--warning-bg); color: var(--warning); }

.result-overview + .intent-strip { margin-top: 10px; margin-bottom: 10px; }
.result-jump-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 24px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.result-jump-nav > span { flex: 0 0 auto; padding-left: 3px; color: var(--muted); font-size: 11px; font-weight: 650; }
.result-jump-nav > div { min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.result-jump-nav > div::-webkit-scrollbar { display: none; }
.result-jump {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 620;
}
.result-jump:hover { border-color: var(--strong-line); color: var(--text); }
.result-jump.is-active { border-color: color-mix(in srgb, var(--red) 30%, var(--line)); background: var(--red-soft); color: var(--red-text); }
.result-jump b { min-width: 18px; padding: 2px 5px; border-radius: 999px; background: var(--surface); font-size: 9px; text-align: center; }
.result-jump-section { scroll-margin-top: 245px; }
.result-jump-section.is-jump-highlight { animation: result-jump-highlight .85s ease-out; }
@keyframes result-jump-highlight {
  35% { filter: drop-shadow(0 0 9px color-mix(in srgb, var(--red) 24%, transparent)); }
}

.workflow-heading,
.result-support-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 30px 0 14px;
}
.workflow-heading span,
.result-support-head span { display: block; margin-bottom: 5px; color: var(--red-text); font-size: 10px; font-weight: 700; }
.workflow-heading h3,
.result-support-head h3 { font-size: 18px; letter-spacing: -.35px; }
.workflow-heading > p,
.result-support-head > p { color: var(--muted); font-size: 12px; }
.agent-workflow-grid,
.agent-support-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 22px; align-items: start; }
.result-col-action,
.result-col-answer {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 72%, var(--bg));
}
.result-col-answer { border-color: color-mix(in srgb, var(--info-line) 70%, var(--line)); }
.result-column-kicker { display: flex; align-items: center; gap: 10px; padding: 2px 2px 14px; border-bottom: 1px solid var(--line); }
.result-column-kicker > span { width: 29px; height: 29px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--red-soft); color: var(--red-text); font-size: 12px; font-weight: 750; }
.result-column-kicker.is-answer > span { background: var(--info-bg); color: var(--info); }
.result-column-kicker div { min-width: 0; display: grid; gap: 2px; }
.result-column-kicker b { font-size: 13px; }
.result-column-kicker small { color: var(--muted); font-size: 10px; }
.result-column-kicker + .result-section { margin-top: 18px; }
.result-col-action > .result-section + .result-section,
.result-col-answer > .result-section + .result-section { margin-top: 26px; }
.result-col-answer > .result-empty-col { margin-top: 14px; background: var(--surface); }

.probe-progress { flex: 0 0 110px; display: grid; gap: 5px; }
.probe-progress span { color: var(--muted); font-size: 10px; font-weight: 650; text-align: right; }
.probe-progress i { height: 5px; overflow: hidden; border-radius: 999px; background: var(--line); }
.probe-progress b { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--red); transition: width .24s ease; }
.probe-progress.is-ready span { color: var(--green); }
.probe-progress.is-ready b { background: var(--green); }
.approved-label { flex: 0 0 auto; padding: 5px 8px; border-radius: 7px; background: var(--info-bg); color: var(--info); font-size: 10px; font-weight: 700; }

.standard-rank-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.standard-rank { padding: 4px 8px; border-radius: 6px; background: var(--surface); color: var(--info); font-size: 10px; font-weight: 700; }
.standard-card.is-primary .standard-rank { background: var(--info); color: #fff; }
.standard-match { color: var(--muted); font-size: 10px; font-weight: 620; }
.source-pill { padding: 4px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 600; }
.answer-evidence { margin-top: 14px; border-top: 1px solid var(--info-line); }
.answer-evidence summary { display: flex; align-items: center; gap: 6px; padding-top: 12px; color: var(--info); cursor: pointer; font-size: 11px; font-weight: 650; list-style: none; }
.answer-evidence summary::-webkit-details-marker { display: none; }
.answer-evidence > div { margin-top: 10px; padding: 12px; border-radius: 10px; background: var(--surface); color: var(--text); font-size: 12px; line-height: 1.7; }
.answer-evidence p { margin-bottom: 8px; }
.answer-evidence p:last-child { margin-bottom: 0; }

.result-support-head { margin-top: 42px; padding-top: 28px; border-top: 1px solid var(--line); }
.result-support-head span { color: var(--muted); }
.agent-support-grid > .result-col > .result-section:first-child { margin-top: 0; }
/* 결과 화면의 세로 리듬. 구획끼리 붙으면 어디까지가 한 덩어리인지 안 보인다. */
.result-section { margin-top: 34px; }
.result-col > .result-section:first-child { margin-top: 0; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-heading h3 { font-size: 16px; }
.section-heading p { color: var(--muted); font-size: 12px; }
/* 제목 아래 한 줄 설명. 제목 옆의 상태 문구와 같은 줄에 서지 않게 묶는다. */
.section-heading-copy { min-width: 0; }
.section-sub { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }

.intent-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.intent-list { display: flex; flex-wrap: wrap; gap: 11px; }
.intent-item { flex: 1; min-width: 210px; padding: 15px; border-radius: 12px; background: var(--bg); }
.intent-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.intent-tag { padding: 4px 8px; border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 600; }
.intent-label { margin-bottom: 10px; font-size: 15px; font-weight: 680; }
.confidence-line { display: flex; align-items: center; gap: 9px; }
.confidence-track { flex: 1; height: 6px; overflow: hidden; border-radius: 999px; background: var(--line); }
.confidence-fill { height: 100%; border-radius: inherit; background: var(--red); }
.confidence-value { color: var(--muted); font-size: 12px; font-weight: 650; }

/* 먼저 확인할 것 — 항목마다 카드로 쪼개면 "무엇부터 묻나"가 안 보인다.
   테두리는 박스에 한 번만 두르고, 줄 사이는 얇은 선으로만 나눈다. */
.probe-box {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.probe-row {
  position: relative;
  display: grid;
  grid-template-columns: 19px 23px 1fr;
  gap: 11px;
  align-items: start;
  padding: 15px 17px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background .15s;
}
.probe-row:first-of-type { border-top: 0; }
.probe-row:hover { background: var(--surface-2); }
.probe-row.is-checked { background: var(--red-soft); }
.probe-row input { position: absolute; opacity: 0; pointer-events: none; }
/* 번호는 읽는 순서를 잡아 주는 표시라, 체크해도 사라지지 않는다. */
.probe-num { color: var(--muted); font-size: 15px; font-weight: 650; line-height: 1.5; font-variant-numeric: tabular-nums; }
.probe-row.is-checked .probe-num { color: var(--red-text); }
.probe-copy { min-width: 0; }
.custom-check {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--strong-line);
  border-radius: 7px;
  background: var(--surface);
  color: transparent;
  transition: .15s ease;
}
/* 번호가 input 과 체크칸 사이에 끼어 있어 인접(+) 대신 형제(~) 로 잡는다. */
.probe-row input:checked ~ .custom-check { border-color: var(--red); background: var(--red); color: #fff; }
.probe-question { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 650; line-height: 1.55; }
.probe-why { display: block; color: var(--muted); font-size: 13px; line-height: 1.6; }

.answer-lock-note { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.answer-lock-note.is-ready { color: var(--green); font-weight: 650; }
/* inline-flex 가 [hidden] 을 이겨서, 숨길 때는 따로 눌러 준다. */
.answer-lock-note[hidden] { display: none; }
.answer-list { display: grid; gap: 12px; }
.answer-card {
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  opacity: .7;
  transition: opacity .2s;
}
.answer-list.is-ready .answer-card { opacity: 1; }
/* 과거 상담 답변은 참고용이다. 승인 문안(.standard-card)과 무게가 같으면
   상담사가 둘을 가르지 않고 복사한다. 배경과 글자를 한 단계 낮춘다. */
.answer-list.is-reference .answer-card { background: var(--bg); }
.answer-list.is-reference .answer-card h4 { color: var(--muted); font-size: 14px; font-weight: 650; letter-spacing: -.2px; }
.answer-list.is-reference .answer-body { margin: 14px 0; font-size: 13px; line-height: 1.8; }
.answer-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.answer-card h4 { font-size: 16px; letter-spacing: -.3px; }
.copy-button {
  flex: 0 0 auto;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 620;
}
.copy-button:hover { border-color: var(--strong-line); background: var(--surface-2); color: var(--text); }
.answer-body { margin: 17px 0; font-size: 14px; line-height: 1.85; white-space: pre-wrap; }
.answer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.usage { color: var(--muted); font-size: 12px; }
.usage strong { color: var(--red-text); }
.type-pill { padding: 4px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; }

/* KMS 승인 문안 — "그대로 보내도 되는 글"과 "참고할 글"을 헷갈리면 안 된다. */
.standard-card { opacity: 1; border-color: var(--info-line); background: var(--info-bg); }
.kms-pill { padding: 4px 9px; border-radius: 6px; background: var(--info); color: var(--surface); font-size: 11px; font-weight: 650; }
.kms-link { padding: 4px 9px; border-radius: 6px; border: 1px solid var(--info-line); background: var(--surface); color: var(--info); font-size: 11px; font-weight: 600; }
.kms-link:hover { background: var(--info-bg); }
.standard-caution { display: flex; gap: 8px; margin: -4px 0 15px; padding: 11px 12px; border-radius: 10px; background: var(--warning-bg); color: var(--warning); font-size: 12px; line-height: 1.6; }

/* 관련 공지 박스는 화면에서 걷어냈다(.notice-* 규칙도 같이 지웠다).
   지금 답이 달라지는 공지는 아래 .policy-* 가 맡는다. */

.policy-section { margin-top: 28px; }
.policy-list { display: grid; gap: 10px; }
.policy-box { display: flex; gap: 12px; padding: 17px; border: 1px solid; border-radius: var(--radius-md); }
.policy-box.is-override { border-color: #ff7d9666; background: var(--red-soft); color: var(--red-text); }
.policy-box.is-info { border-color: var(--info-line); background: var(--info-bg); color: var(--info); }
.policy-icon { flex: 0 0 auto; width: 33px; height: 33px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); }
.policy-copy { flex: 1; min-width: 0; }
.policy-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.policy-title-row h4 { margin-bottom: 8px; color: currentColor; font-size: 15px; }
.policy-title-row span { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; background: var(--surface); font-size: 10px; font-weight: 700; }
.policy-copy > p { color: var(--text); font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.policy-conflict { display: grid; gap: 4px; margin-top: 11px; padding: 11px 12px; border-radius: 10px; background: var(--surface); color: var(--red-text); font-size: 12px; line-height: 1.6; }
.policy-conflict strong { font-size: 10px; }
/* 정리된 답이 없을 때 — 참고 답변이 정답처럼 보이는 것이 이 도구에서 가장
   위험하다. 결과 맨 위에서 한 번, 분명하게 말한다. */
.no-answer-box {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  padding: 17px 18px;
  border: 1px solid var(--warning-line);
  border-radius: var(--radius-md);
  background: var(--warning-bg);
  color: var(--warning);
}
.no-answer-box > svg { flex: 0 0 auto; margin-top: 2px; }
.no-answer-box h3 { margin-bottom: 6px; color: currentColor; font-size: 15px; }
.no-answer-box p { color: var(--text); font-size: 13px; line-height: 1.7; }

.result-skeleton { display: grid; gap: 12px; }
.skeleton-block {
  height: 84px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--surface-2) 20%, var(--bg) 50%, var(--surface-2) 80%);
  background-size: 220% 100%;
  animation: shimmer 1.2s infinite linear;
}
.skeleton-block:nth-child(2) { height: 148px; }
@keyframes shimmer { to { background-position: -220% 0; } }

/* ── 신입 평가 ──────────────────────────────────────────── */

.quiz-user { display: flex; align-items: center; gap: 9px; }
.quiz-user-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; }
/* 계정 이름·이메일이 길면 헤더 폭을 밀어냈다. grid 자식은 기본 min-width가
   내용물 크기라 줄어들지 않는데, min-width:0 으로 풀고 말줄임으로 자른다. */
.quiz-user-copy { display: grid; gap: 1px; min-width: 0; }
.quiz-user-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.quiz-user-copy span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.login-screen { display: grid; place-items: center; padding: 40px 0 60px; }
.login-card { width: min(100%, 440px); padding: 40px; border-radius: 22px; text-align: center; }
.login-symbol { margin: 0 auto 22px; }
.login-card h1 { font-size: 27px; letter-spacing: -1px; }
.login-card > p { margin: 13px 0 26px; color: var(--muted); line-height: 1.7; font-size: 14px; }
.google-button { width: 100%; min-height: 52px; border-color: var(--strong-line); background: var(--surface); color: var(--text); }
.google-button:hover:not(:disabled) { background: var(--surface-2); }
/* 구글 공식 G 마크(SVG) */
.google-mark { width: 19px; height: 19px; flex: none; display: block; }
/* !important 를 걷어낸다. 뒤에 오는 파일이 이 규칙을 다시 덮어써야 하는데
   !important 가 그 재정의를 막고 있었다. */
.login-policy { margin-top: 15px; color: var(--muted); font-size: 12px; }

.week-select-list { display: grid; gap: 10px; }
.week-select-loading, .curriculum-loading, .curriculum-error, .dashboard-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 160px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  font-size: 13px;
}
.week-select-loading .spinner, .curriculum-loading .spinner { border-color: var(--line); border-top-color: var(--red); }

.week-select-card {
  width: 100%;
  min-height: 88px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto 34px;
  gap: 15px;
  align-items: center;
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.week-select-card:hover:not(:disabled) { border-color: var(--strong-line); box-shadow: var(--shadow); transform: translateY(-1px); }
.week-select-card.is-preferred { border-color: var(--red); }
.week-select-card.is-locked { background: var(--bg); }
.week-select-card:disabled { cursor: wait; opacity: .6; }
.week-select-number { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: var(--red-soft); color: var(--red-text); font-size: 18px; font-weight: 700; }
.week-select-card.is-passed .week-select-number { background: var(--green-soft); color: var(--green); }
.week-select-card.is-locked .week-select-number { background: var(--surface-2); color: var(--muted); }
.week-select-copy { min-width: 0; display: grid; gap: 5px; }
.week-select-copy strong { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.week-select-copy span { color: var(--muted); font-size: 12px; }
.week-select-score { padding: 7px 10px; border-radius: 9px; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 650; }
.week-select-action { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: var(--muted); }
.week-select-card:hover .week-select-action { background: var(--surface-2); color: var(--text); }

.assessment-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.assessment-progress { flex-direction: column; align-items: stretch; gap: 11px; }
.assessment-progress .progress-track { width: 100%; height: 6px; flex: none; }
.score-boxes { display: flex; gap: 8px; }
.score-box { flex: 1; min-width: 92px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: center; }
.score-box span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.score-box strong { font-size: 15px; }

.conversation-column { min-width: 0; display: grid; gap: 12px; align-content: start; position: sticky; top: 100px; }
.conversation { padding: 0; }
.conversation-head h2 { font-size: 15px; }
.conversation-body {
  height: min(620px, calc(100vh - 260px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.chat-row { animation: chatIn .3s ease backwards; }
@keyframes chatIn { from { opacity: 0; transform: translateY(8px); } }
.chat-row.is-correction { margin-top: -16px; }
.chat-row.is-incorrect .chat-bubble.mine {
  background: var(--yellow);
  color: #8e1830;
  box-shadow: inset 0 0 0 2px #d81940;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.chat-row.is-correction .chat-bubble.mine { background: #fff8bf; color: #4f460e; }
.correction-label { text-align: right; font-weight: 650; }

.temperament-badge { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.temperament-badge.is-impatient { background: #fff0df; color: #c25b00; }
.temperament-badge.is-tired { background: #fff6c7; color: #8a6700; }
.temperament-badge.is-angry { background: #ffe9ee; color: #d32044; }
.temperament-badge.is-provocative { background: #f3eaff; color: #7836aa; }
.temperament-badge.is-hard { background: #e8ebed; color: #3e4852; }

.store-context-card { padding: 0; overflow: hidden; }
.store-context-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.store-context-head h2 { flex: 0 0 auto; font-size: 15px; }
.store-context-head p { text-align: right; font-size: 11px; line-height: 1.4; }
.store-context-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 13px; }
.store-context-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(48px, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--bg);
}
.store-context-item dt { color: var(--muted); font-size: 10px; font-weight: 650; white-space: nowrap; }
.store-context-item dd { min-width: 0; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; line-height: 1.45; }
.store-context-item.is-decision dd { color: var(--text); font-weight: 700; }
.store-context-item.is-evidence { animation: storeEvidencePulse 1.15s ease-out 1; }
@keyframes storeEvidencePulse {
  0%, 100% { background: var(--bg); box-shadow: inset 0 0 0 0 transparent; }
  38% { background: var(--red-soft); box-shadow: inset 0 0 0 2px var(--red); }
}

.decision-panel .question-kicker > span:first-child,
.decision-panel #question-type { font-size: 13px; font-weight: 650; color: var(--red-text); }
.choice-list { display: grid; gap: 10px; }
.choice-card {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr 22px;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.choice-card:hover:not(:disabled) { border-color: var(--strong-line); }
.choice-card:disabled { cursor: default; }
.choice-card.is-pending { opacity: .6; }
.choice-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.choice-text { padding-top: 3px; font-size: 14px; line-height: 1.7; word-break: keep-all; }
.choice-status { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--strong-line); border-radius: 50%; color: transparent; }
.choice-card.is-correct { border-color: var(--green); background: var(--green-soft); }
.choice-card.is-correct .choice-number,
.choice-card.is-correct .choice-status { background: var(--green); border-color: var(--green); color: #fff; }
.choice-card.is-wrong { border-color: var(--red-text); background: var(--red-soft); }
.choice-card.is-wrong .choice-number,
.choice-card.is-wrong .choice-status { background: var(--red); border-color: var(--red); color: #fff; }

.explanation-card { margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg); }
.explanation-result { display: flex; align-items: center; gap: 9px; padding: 15px 17px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 700; }
.explanation-result.correct { color: var(--green); }
.explanation-result.wrong { color: var(--red-text); }
.explanation-block { padding: 16px 17px; }
.explanation-block + .explanation-block { border-top: 1px solid var(--line); }
.explanation-block.is-problem { background: var(--red-soft); }
.explanation-block h3 { margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.explanation-block p { font-size: 13px; line-height: 1.75; }
.explanation-principle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 17px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.principle-label { flex: 0 0 auto; padding: 3px 7px; border-radius: 6px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; }
.explanation-principle strong { color: var(--text); font-size: 12px; line-height: 1.7; }
.quiz-next { width: 100%; margin-top: 16px; }

.result-screen { max-width: 860px; margin: 0 auto; padding: 8px 0 30px; }
.result-hero { padding: 38px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); text-align: center; }
.pass-label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pass-label.passed { background: var(--green-soft); color: var(--green); }
.pass-label.failed { background: var(--red-soft); color: var(--red-text); }
.result-week { margin: 17px 0 -6px; color: var(--muted); font-size: 13px; font-weight: 650; }
.result-score { margin: 16px 0 5px; font-size: 62px; line-height: 1.1; letter-spacing: -3px; }
.result-score small { font-size: 24px; letter-spacing: -1px; color: var(--muted); }
.result-summary { margin-top: 12px; color: var(--muted); line-height: 1.7; font-size: 14px; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
.result-section-card { margin-top: 15px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.result-section-card h2 { margin-bottom: 19px; font-size: 18px; }
.type-result-list { display: grid; gap: 15px; }
.type-result-row { display: grid; grid-template-columns: 140px 1fr 58px; gap: 12px; align-items: center; }
.type-result-row span { overflow: hidden; font-size: 13px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.type-result-row strong { text-align: right; font-size: 12px; }
.wrong-review-list { display: grid; gap: 10px; }
.wrong-review { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); }
.wrong-review summary { display: flex; justify-content: space-between; gap: 14px; padding: 15px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 650; }
.wrong-review summary::-webkit-details-marker { display: none; }
.wrong-review summary span { color: var(--muted); font-size: 12px; font-weight: 500; }
.wrong-review-body { display: grid; gap: 12px; padding: 15px; border-top: 1px solid var(--line); background: var(--bg); }
.review-line strong { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.review-line p { font-size: 13px; line-height: 1.7; }
.empty-review { padding: 21px; border-radius: var(--radius-md); background: var(--green-soft); color: var(--green); text-align: center; font-size: 14px; font-weight: 620; }

/* ── 커리큘럼 ───────────────────────────────────────────── */

.curriculum-user-card { flex: 0 0 auto; display: flex; align-items: center; gap: 11px; padding: 12px 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.learning-summary .competency-bars { margin: 22px 0 24px; }
.learning-summary .summary-note { margin-top: 16px; }
.curriculum-pass-note { background: var(--red-soft); color: var(--red-text); }
.curriculum-week-list { display: grid; gap: 10px; }
.curriculum-week-card {
  min-height: 104px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.curriculum-week-card.is-locked { background: var(--bg); }
.curriculum-week-index { width: 54px; height: 54px; display: grid; place-items: center; align-content: center; border-radius: 15px; background: var(--red-soft); color: var(--red-text); }
.curriculum-week-index span { font-size: 21px; font-weight: 700; line-height: 1; }
.curriculum-week-index small { margin-top: 3px; font-size: 8px; font-weight: 700; letter-spacing: .5px; }
.curriculum-week-card.is-passed .curriculum-week-index { background: var(--green-soft); color: var(--green); }
.curriculum-week-card.is-locked .curriculum-week-index { background: var(--surface-2); color: var(--muted); }
.curriculum-week-copy { min-width: 0; }
.curriculum-week-title-row { display: flex; align-items: center; gap: 10px; }
.curriculum-week-title-row h3 { min-width: 0; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.curriculum-week-copy > p { margin-top: 7px; color: var(--muted); font-size: 12px; }
.curriculum-state { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 700; }
.curriculum-state.passed { background: var(--green-soft); color: var(--green); }
.curriculum-week-metrics { display: flex; gap: 22px; }
.curriculum-week-metrics div { min-width: 54px; }
.curriculum-week-metrics dt { margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.curriculum-week-metrics dd { font-size: 13px; font-weight: 650; }
.curriculum-start { min-height: 42px; display: inline-flex; align-items: center; gap: 5px; padding: 0 13px; border-radius: 11px; background: var(--surface-2); color: var(--text); font-size: 12px; font-weight: 650; }
.curriculum-start:hover { background: var(--text); color: var(--surface); }
.curriculum-start.primary { background: var(--text); color: var(--surface); }
.curriculum-start:disabled { cursor: not-allowed; opacity: .55; }
.curriculum-actions { display: flex; gap: 7px; }
.curriculum-state.is-live { background: var(--red-soft); color: var(--red-text); }
.curriculum-state.needs-work { background: #fff4dc; color: #956006; }
:root[data-theme="dark"] .curriculum-state.needs-work { background: #382b17; color: #f0bd5a; }
.is-locked .curriculum-start { border: 1px solid var(--line); background: var(--surface); color: var(--muted); }

.competency-bars { display: grid; gap: 17px; }
.competency-bar-row { display: grid; grid-template-columns: 110px 1fr 44px; gap: 13px; align-items: center; }
.competency-bar-label { display: grid; gap: 3px; }
.competency-bar-label strong { font-size: 13px; }
.competency-bar-label span { color: var(--muted); font-size: 10px; }
.competency-progress { height: 10px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.competency-progress span { display: block; height: 100%; border-radius: inherit; background: var(--red); }
.competency-percent { text-align: right; font-size: 13px; }

/* ── 관리자 ─────────────────────────────────────────────── */

.admin-lock-card { max-width: 380px; }
body[data-page="admin"] .admin-lock {
  min-height: calc(100svh - 82px);
  display: grid;
  place-items: center;
  padding: 48px 24px 72px;
}
body[data-page="admin"] .admin-lock[hidden] { display: none; }
body[data-page="admin"] .admin-lock-card {
  width: min(100%, 390px);
  padding: 24px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.admin-pw-input {
  width: 100%;
  min-height: 50px;
  margin-top: 4px;
  padding: 0 16px;
  border: 1px solid var(--strong-line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  letter-spacing: 1px;
}
.admin-pw-input:focus { border-color: var(--red); outline: 0; }
.admin-lock-submit { margin-top: 11px; }
#admin-lock-error, #delete-error { color: var(--red-text) !important; }

.summary-grid-five { grid-template-columns: repeat(5, 1fr); }
.summary-card { min-height: 122px; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.summary-card span { display: block; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.summary-card strong { display: block; font-size: 27px; font-weight: 650; letter-spacing: -1px; }
.summary-card strong.text-value { font-size: 17px; line-height: 1.45; letter-spacing: -.4px; }
.summary-card small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.summary-card.is-weak { border-color: #ff7d9645; background: var(--red-soft); }
.summary-card.is-weak strong { color: var(--red-text); }

.insight-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr); gap: 14px; margin-top: 18px; }
.insight-card { padding: 22px; }
.insight-card-head { align-items: flex-start; }
.insight-card-head h2 { font-size: 17px; }

.heatmap-legend { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.heatmap-legend i { width: 15px; height: 15px; display: block; border-radius: 4px; }
.heatmap-legend .score-empty { margin-left: 6px; }
.heatmap-scroll { max-height: 430px; overflow: auto; }
.heatmap-grid { min-width: 590px; display: grid; grid-template-columns: 150px repeat(var(--week-count, 6), minmax(56px, 1fr)); gap: 5px; }
.heatmap-label, .heatmap-cell { min-height: 38px; border: 0; border-radius: 8px; cursor: pointer; }
.heatmap-label { min-width: 0; display: grid; align-content: center; gap: 1px; padding: 4px 8px; background: transparent; color: inherit; text-align: left; }
.heatmap-label:hover { background: var(--surface-2); }
.heatmap-label strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.heatmap-label span { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.heatmap-head-label { min-height: 28px; color: var(--muted); font-size: 9px; cursor: default; }
.heatmap-week-head { min-height: 28px; display: grid; place-items: center; color: var(--muted); font-size: 9px; font-weight: 650; }
.heatmap-cell { display: grid; place-items: center; font-size: 11px; font-weight: 700; transition: transform .12s, box-shadow .12s; }
.heatmap-cell:hover { box-shadow: inset 0 0 0 2px var(--strong-line); transform: scale(.97); }
/* 라이트 전용 헥스를 하드코딩해 다크 모드에서 안 보였다. color-mix 로 --red 를
   섞어 네 단계 진하기를 유지하고, 옅은 두 단계는 글자를 --red-text 로,
   짙은 두 단계는 --surface 로 둬 배경이 짙어질수록 글자가 밝게 뒤집히게 한다. */
.score-level-1 { background: color-mix(in srgb, var(--red) 10%, transparent); color: var(--red-text); }
.score-level-2 { background: color-mix(in srgb, var(--red) 25%, transparent); color: var(--red-text); }
.score-level-3 { background: color-mix(in srgb, var(--red) 48%, transparent); color: var(--surface); }
.score-level-4 { background: color-mix(in srgb, var(--red) 82%, transparent); color: var(--surface); }
.score-empty { background: var(--surface-2); color: var(--faint); }

.compare-legend { display: flex; gap: 15px; margin: -4px 0 20px; color: var(--muted); font-size: 10px; }
.compare-legend span { display: flex; align-items: center; gap: 6px; }
.compare-legend i { width: 9px; height: 9px; display: block; border-radius: 3px; }
.compare-legend .is-overall { background: var(--strong-line); }
.compare-legend .is-person { background: var(--red); }
.competency-compare-list { display: grid; gap: 21px; }
.compare-axis-row { display: grid; grid-template-columns: 95px 1fr; gap: 8px 12px; align-items: center; }
.compare-axis-label { display: grid; gap: 3px; }
.compare-axis-label strong { font-size: 12px; }
.compare-axis-label span { color: var(--red-text); font-size: 10px; font-weight: 650; }
.dual-bar { position: relative; height: 19px; overflow: hidden; border-radius: 7px; background: var(--surface-2); }
.dual-bar span { position: absolute; left: 0; display: block; border-radius: 4px; }
.overall-bar { top: 3px; height: 5px; background: var(--strong-line); }
.person-bar { bottom: 3px; height: 6px; background: var(--red); }
.overall-value { grid-column: 2; margin-top: -5px; color: var(--muted); font-size: 9px; }

.dashboard-card { margin-top: 19px; overflow: hidden; }
.tab-list { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.tab-button { position: relative; padding: 15px 14px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; font-weight: 620; }
.tab-button::after { content: ""; position: absolute; right: 12px; bottom: -1px; left: 12px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
.tab-button[aria-selected="true"] { color: var(--text); }
.tab-button[aria-selected="true"]::after { background: var(--red); }
.tab-panel { padding: 18px 0 0; }
.table-count { color: var(--muted); font-size: 13px; }
.table-toolbar .search-field { width: min(100%, 250px); }
.search-field input { border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; width: 100%; }

.data-table { width: 100%; border-collapse: collapse; min-width: 880px; white-space: nowrap; }
.data-table th { padding: 12px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); color: var(--muted); text-align: left; font-size: 11px; font-weight: 600; }
.data-table td { padding: 15px 18px; border-top: 0; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; white-space: normal; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr[data-user-index] { cursor: pointer; transition: background .14s; }
.data-table tbody tr[data-user-index]:hover { background: var(--bg); }
.admin-user-table { min-width: 940px; }
.question-stat-table { min-width: 1040px; }
.person-cell { display: grid; gap: 3px; }
.person-cell strong { font-size: 14px; font-weight: 620; }
.person-cell span { color: var(--muted); font-size: 11px; }
.score-value { font-weight: 700; }
.muted-value { color: var(--muted); }
.weak-badge { display: inline-block; max-width: 170px; overflow: hidden; padding: 6px 8px; border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.accuracy-cell { min-width: 150px; }
.accuracy-inline { display: flex; align-items: center; gap: 10px; }
.accuracy-inline .rate-track { width: 78px; height: 7px; }
.accuracy-inline strong { min-width: 32px; font-size: 12px; }
.low-rate { color: var(--red-text); }
.empty-table { padding: 48px !important; color: var(--muted) !important; text-align: center; }
.axis-badge { display: inline-flex; align-items: center; padding: 6px 8px; border-radius: 7px; font-size: 10px; font-weight: 650; white-space: nowrap; }
.axis-discovery { background: #eef5ff; color: #3269a8; }
.axis-resolution { background: #edf9f5; color: #197d5d; }
.axis-compliance { background: #fff1f4; color: #c62444; }
.axis-empathy { background: #f5efff; color: #7441a0; }
.axis-none { background: var(--surface-2); color: var(--muted); }
.top-wrong-cell { min-width: 240px; max-width: 360px; line-height: 1.6; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.row-delete { padding: 5px 10px; border: 1px solid var(--strong-line); border-radius: 8px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 600; }
.row-delete:hover { border-color: var(--red); color: var(--red-text); }

.modal-backdrop { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: #080c1670; backdrop-filter: blur(5px); }
.modal-card { width: min(100%, 390px); padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 24px 60px #0000003d; }
.modal-card h2 { margin-bottom: 10px; font-size: 20px; }
.modal-card > p { margin-bottom: 18px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.modal-actions { display: flex; gap: 9px; margin-top: 13px; }
.modal-actions .btn { flex: 1; }

.drawer-overlay { position: fixed; z-index: 100; inset: 0; background: #080c1652; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-overlay.is-open { opacity: 1; pointer-events: auto; }
.detail-drawer { position: absolute; top: 0; right: 0; width: min(100%, 520px); height: 100%; overflow-y: auto; padding: 30px 26px 44px; background: var(--surface); transform: translateX(100%); transition: transform .26s ease; }
.drawer-overlay.is-open .detail-drawer { transform: translateX(0); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.drawer-head h2 { font-size: 23px; letter-spacing: -.8px; }
.drawer-head p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.drawer-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 24px 0 30px; }
.drawer-metric { padding: 14px 10px; border-radius: 12px; background: var(--bg); text-align: center; }
.drawer-metric span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.drawer-metric strong { font-size: 16px; }
.drawer-section + .drawer-section { margin-top: 28px; }
.drawer-section h3 { margin-bottom: 14px; font-size: 16px; }
.drawer-type-list { display: grid; gap: 15px; }
.drawer-type-row-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 12px; }
.drawer-type-row-top span { color: var(--muted); }
.drawer-type-row-top strong { font-size: 11px; }
.drawer-wrong-list { display: grid; gap: 9px; }
.drawer-wrong { padding: 15px; border: 1px solid var(--line); border-radius: 12px; }
.drawer-wrong-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.drawer-wrong-top strong { font-size: 13px; }
.drawer-wrong-top span { color: var(--red-text); font-size: 10px; font-weight: 650; }
.drawer-wrong p { color: var(--muted); font-size: 12px; line-height: 1.65; }
.drawer-wrong p + p { margin-top: 6px; }
.drawer-wrong p b { color: var(--text); }
.drawer-customer { padding: 9px 10px; border-radius: 9px; background: var(--bg); }
.drawer-principle { display: grid; gap: 4px; margin-top: 10px; padding: 10px 11px; border-radius: 9px; background: var(--red-soft); color: var(--red-text); font-size: 11px; line-height: 1.65; }
.drawer-principle b { font-size: 9px; }
.drawer-empty { padding: 18px; border-radius: 12px; background: var(--green-soft); color: var(--green); text-align: center; font-size: 12px; font-weight: 620; }
.store-condition-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.store-condition-badges .drawer-empty { width: 100%; }
.store-condition-badge { max-width: 100%; display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid #ff7d9645; border-radius: 9px; background: var(--red-soft); color: var(--red-text); font-size: 11px; font-weight: 650; line-height: 1.5; }
.store-condition-badge span { overflow: hidden; text-overflow: ellipsis; }
.store-condition-badge b { flex: 0 0 auto; padding: 2px 5px; border-radius: 999px; background: var(--surface); font-size: 9px; }
.trend-chart-wrap { position: relative; min-height: 170px; padding: 9px; border-radius: 12px; background: var(--bg); }
.trend-chart { width: 100%; height: auto; }
.trend-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 11px; }

/* ── 반응형 ─────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .summary-grid-five { grid-template-columns: repeat(3, 1fr); }
  .insight-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .agent-result-columns { grid-template-columns: 1fr; gap: 0; }
  .result-col + .result-col { margin-top: 32px; }
  .result-overview { grid-template-columns: minmax(0, 1fr); }
  .agent-workflow-grid,
  .agent-support-grid { grid-template-columns: minmax(0, 1fr); }
  .agent-workflow-grid > .result-col + .result-col,
  .agent-support-grid > .result-col + .result-col { margin-top: 0; }
}

@media (max-width: 980px) {
  .conversation-column { position: static; }
}

@media (max-width: 900px) {
  .curriculum-week-card { grid-template-columns: 54px minmax(0, 1fr) auto; }
  .curriculum-week-metrics { grid-column: 2; grid-row: 2; }
  .curriculum-week-card > .curriculum-start,
  .curriculum-actions { grid-column: 3; grid-row: 1 / span 2; }
  .conversation-body { height: 500px; }
}

@media (max-width: 760px) {
  .conversation-body { height: 440px; }
  .assessment-progress { width: 100%; }
}

@media (max-width: 640px) {
  .result-overview { gap: 17px; padding: 18px 15px 15px; }
  .result-query-summary { padding-right: 0; }
  .result-query-summary > strong { font-size: 18px; }
  .result-overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-overview-metrics > div { min-height: 84px; }
  .result-evidence-state { right: 14px; }
  .result-jump-nav { align-items: flex-start; flex-direction: column; gap: 7px; }
  .result-jump-nav > div { width: 100%; }
  .workflow-heading,
  .result-support-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .result-col-action,
  .result-col-answer { padding: 11px; }
  #agent-results .section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  #agent-results .section-heading > .probe-progress { width: 100%; flex-basis: auto; }
  .probe-progress span { text-align: left; }
  .answer-card { padding: 17px 15px; }
  .answer-card-top { gap: 10px; }
  .copy-button { min-height: 34px; padding-inline: 9px; }
  .login-card { padding: 28px 22px; }
  body[data-page="admin"] .admin-lock { min-height: calc(100svh - 68px); padding: 34px 20px 54px; }
  body[data-page="admin"] .admin-lock-card { padding: 20px 0; }
  .policy-title-row { align-items: flex-start; flex-direction: column; gap: 0; }
  .week-select-card { grid-template-columns: 42px minmax(0, 1fr) 30px; gap: 11px; padding: 15px 14px; }
  .week-select-number { width: 40px; height: 40px; border-radius: 12px; }
  .week-select-score { grid-column: 2; width: max-content; }
  .week-select-action { grid-column: 3; grid-row: 1 / span 2; }
  .week-select-copy strong { white-space: normal; }
  .score-boxes { display: grid; grid-template-columns: 1.25fr 1fr 1fr; }
  .score-box { min-width: 0; padding-inline: 7px; }
  .score-box strong { font-size: 13px; }
  .temperament-badge { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .curriculum-user-card { width: 100%; }
  .curriculum-week-card { grid-template-columns: 46px minmax(0, 1fr); gap: 13px; padding: 16px; }
  .curriculum-week-index { width: 46px; height: 46px; border-radius: 13px; }
  .curriculum-week-title-row { align-items: flex-start; flex-direction: column-reverse; gap: 6px; }
  .curriculum-week-title-row h3 { white-space: normal; }
  .curriculum-week-metrics { grid-column: 2; grid-row: auto; }
  .curriculum-week-card > .curriculum-start,
  .curriculum-actions { grid-column: 1 / -1; grid-row: auto; justify-content: center; }
  .curriculum-actions .curriculum-start { flex: 1; justify-content: center; }
  .competency-bar-row { grid-template-columns: 92px 1fr 39px; gap: 10px; }
  .summary-grid-five { grid-template-columns: 1fr 1fr; }
  .insight-card { padding: 18px 15px; }
  .heatmap-legend { flex-wrap: wrap; }
  .compare-axis-row { grid-template-columns: 85px 1fr; }
  .result-hero { padding: 28px 20px; }
  .result-score { font-size: 52px; }
  .type-result-row { grid-template-columns: 96px 1fr 50px; }
}

@media (max-width: 420px) {
  .quiz-user { display: none; }
  .store-context-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .store-context-head p { text-align: left; }
  .store-context-grid { grid-template-columns: 1fr; }
  .summary-grid-five { grid-template-columns: 1fr; }
  .policy-box { padding: 15px; }
  .competency-bar-row { grid-template-columns: 1fr 38px; }
  .competency-bar-label { grid-column: 1 / -1; display: flex; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-row, .skeleton-block, .store-context-item.is-evidence, .result-jump-section { animation: none !important; }
  .probe-progress b { transition: none; }
}

/* ── 되답 검수 화면 ─────────────────────────────────────── */

.review-card { margin-bottom: 14px; }
.review-card.is-done { border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.review-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.review-head h2 { margin-top: 6px; font-size: 17px; line-height: 1.5; }
.reply-candidates { display: grid; gap: 8px; }
.reply-candidate {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  line-height: 1.6;
  transition: border-color .15s, background .15s;
}
.reply-candidate:hover { border-color: var(--strong-line); }
.reply-candidate.is-picked { border-color: var(--red); background: var(--red-soft); }
.reply-text { min-width: 0; }
.reply-tag { flex: 0 0 auto; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; }
.reply-candidate.is-affirm .reply-tag { background: var(--green-soft); color: var(--green); }
.reply-candidate.is-negative .reply-tag { background: var(--warning-bg); color: var(--warning); }
.review-foot { display: flex; align-items: center; gap: 9px; margin-top: 14px; }
.review-custom {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.review-custom:focus { border-color: var(--red); outline: 0; }

/* ── 처리 절차 카드 ───────────────────────────────────────────────────
   과거 상담 통계 위에 얹는 "정제된 절차". 통계는 많이 쓴 말을 고르지만
   이 카드는 무엇을 묻고 무엇을 조회하고 어떤 조건에서 답이 뒤집히는지를 적는다.
   검수 전 초안이 섞여 있어, 그 사실을 카드 머리에 그대로 적는다. */
.playbook-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 20px 0 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.playbook-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.playbook-title h3 { font-size: 17px; }
.playbook-group { padding: 4px 9px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 650; }
.playbook-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); font-size: 12px; }
.playbook-meta strong { color: var(--text); }
.playbook-evidence { padding: 4px 9px; border-radius: 6px; background: var(--warning-bg); color: var(--warning); font-size: 11px; font-weight: 650; }
.playbook-evidence.is-approved { background: var(--green-soft); color: var(--green); }
.playbook-related { margin-top: 26px; color: var(--muted); font-size: 12px; }

/* 고객에게 물을 것과 상담사가 조회할 것은 섞이면 안 된다. 신입이 가장 자주
   틀리는 자리라 항목마다 어느 쪽인지 붙여 둔다. */
.probe-tag { margin-left: 7px; padding: 2px 7px; border-radius: 5px; font-size: 10px; font-style: normal; font-weight: 650; vertical-align: 1px; }
.probe-tag.is-ask { background: var(--red-soft); color: var(--red-text); }
.probe-tag.is-check { background: var(--info-bg); color: var(--info); }
.probe-where { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; color: var(--info); font-size: 12px; font-weight: 600; }

.branch-list { display: grid; gap: 10px; }
.branch-item { padding: 15px 17px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.branch-when { display: inline-block; margin-bottom: 9px; padding: 4px 9px; border-radius: 6px; background: var(--surface-2); font-size: 12px; font-weight: 650; }
.branch-guide { font-size: 14px; line-height: 1.8; }
.branch-add,
.branch-no { display: flex; gap: 7px; margin-top: 10px; padding: 9px 11px; border-radius: 9px; font-size: 12.5px; line-height: 1.65; }
.branch-add { background: var(--info-bg); color: var(--info); }
.branch-no { background: var(--warning-bg); color: var(--warning); }
.branch-add svg,
.branch-no svg { margin-top: 3px; }

.forbidden-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.forbidden-list li {
  padding: 13px 15px 13px 32px;
  border-radius: var(--radius-md);
  background: var(--red-soft);
  color: var(--red-text);
  font-size: 13px;
  line-height: 1.7;
  position: relative;
}
.forbidden-list li:before { content: "×"; position: absolute; left: 15px; top: 11px; font-size: 15px; font-weight: 700; }

.escalate-list { display: grid; gap: 8px; }
.escalate-item { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.escalate-when { font-size: 13px; font-weight: 650; }
.escalate-to { margin-top: 6px; color: var(--info); font-size: 13px; font-weight: 620; }
.escalate-required { margin-top: 7px; color: var(--muted); font-size: 12px; }

.channel-list { display: grid; gap: 8px; }
.channel-item { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: baseline; padding: 12px 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.channel-item span { color: var(--muted); font-size: 12px; font-weight: 650; }
.channel-item p { font-size: 13px; line-height: 1.7; }

/* 입력창 아래 추천 — 상담사가 고객 말로 치는 도중에 어느 요청 유형인지 보여준다. */
.suggest-box {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  margin-top: 6px;
  padding: 6px;
  display: grid;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.suggest-item {
  display: grid;
  gap: 3px;
  padding: 11px 13px;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}
.suggest-item:hover,
.suggest-item.is-active { background: var(--surface-2); }
.suggest-title { font-size: 14px; font-weight: 640; }
.suggest-ask { color: var(--info); font-size: 12px; line-height: 1.55; }
.suggest-meta { color: var(--muted); font-size: 11.5px; }

/* 관련 지식 — 절차 카드가 답하지 않는 "왜 그런가". 본문이 길어 접어 둔다. */
.note-list { display: grid; gap: 8px; }
.note-item { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.note-item summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 13px 15px;
  cursor: pointer;
  list-style: none;
}
.note-item summary::-webkit-details-marker { display: none; }
.note-item summary:hover { background: var(--surface-2); border-radius: inherit; }
.note-title { font-size: 13.5px; font-weight: 640; }
.note-chapter { color: var(--muted); font-size: 11px; }
.note-body { padding: 0 15px 15px; color: var(--text); font-size: 13px; line-height: 1.8; }
.note-body p { margin: 0 0 9px; overflow-wrap: anywhere; }
.note-body p:last-child { margin-bottom: 0; }
.note-body code { padding: 1px 5px; border-radius: 5px; background: var(--surface-2); font-size: 12px; }
.note-bullets { margin: 0 0 10px; padding-left: 17px; display: grid; gap: 5px; }
.note-bullets li { overflow-wrap: anywhere; }
/* 지식 노트의 표 — 보증기간·상태값·권한 등급이 전부 표라 읽히게 세운다. */
.note-table-wrap { margin: 4px 0 12px; overflow-x: auto; }
.note-table { width: 100%; border-collapse: collapse; font-size: 12.5px; white-space: normal; }
.note-table th,
.note-table td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.note-table th { background: var(--surface-2); color: var(--muted); font-weight: 650; }


/* 상담사가 알고 있어야 하는 것 — 고객에게 나가는 문장이 아니다.
   고객 문장과 시각적으로 확실히 갈라 놔야 실수로 보내지 않는다. */
.explanation-block.is-agent-note {
  border-left: 3px solid var(--warning, var(--line));
  background: var(--warning-bg, var(--surface-2));
  padding-left: 12px;
}
.explanation-block.is-agent-note h3 { color: var(--warning-text, var(--muted)); }
.explanation-block.is-agent-note p { color: var(--text, inherit); }
