@charset "UTF-8";
/* AIAP 화면 공통 스타일 — 모든 화면의 바탕과 허브·처리 기록 화면(trace 뷰어). 사이트 두 곳의 모양은 site.css(D57).
 *
 * 색은 tokens.css의 토큰만 쓴다. 판정 색(--outcome-*, 체크포인트 통과·위반 색)은 판정된 데이터
 * (Verdict·ReportViewModel)를 그리는 화면에서만 쓰고, 이 파일의 셸·사이트·관측 화면은 쓰지 않는다.
 * 오류 표시도 판정이 아니므로 빨강 대신 점선 테두리·고정폭 글자로 구분한다.
 * 인라인 style 속성을 쓰지 않는다(CSP style-src 'self') — 상태는 클래스·hidden·aria 속성으로.
 * 보이는 글자는 쉬운 말(D34). 기술 이름(필드명·체크포인트 코드·도구 이름)은 .tech로 작게 곁들인다.
 */

/* Pretendard(가변 글꼴) — 저장소에 넣은 파일을 쓴다(외부 주소 없음, SIL OFL 1.1 — fonts/OFL.txt). 이 선언은 보고서에 인라인되는
 * tokens.css가 아니라 여기 둔다: 보고서는 단일 파일이라 파일 참조를 싣지 않는다(보고서는 글꼴 이름만 쓰고 없으면 시스템 글꼴). */
@font-face {
  font-family: "Pretendard Variable";
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url("fonts/PretendardVariable.woff2") format("woff2-variations");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  /* 밝은 회색 바탕에 얇은 격자 선(D57·D58 — 사이트와 같은 바탕) */
  background-color: var(--page);
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 420px 100%, 100% 560px;
  background-position: calc(50% - 210px) 0, 0 64px;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }
a { color: var(--link); text-decoration-color: var(--point); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
code { font-family: var(--font-mono); font-size: 0.9em; }
h1, h2 { line-height: 1.25; letter-spacing: -0.03em; font-weight: 800; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--point-ink);
}
.lede { color: var(--muted); max-width: 60ch; margin: 0; }
.hint { color: var(--muted); font-size: 0.85rem; }
/* 쉬운 말 옆에 곁들이는 기술 이름(개발자 대조용) — 작게, 고정폭, 흐리게. 어두운 띠 위에서도 읽히게 색 대신 투명도 */
.tech {
  font-family: var(--font-mono);
  font-size: 0.74em;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.72;
}

/* ───────────── 안내 띠 — 얇고 차분하게(무늬 없음) */
.fake-notice {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 2px 10px;
  padding: 7px 16px;
  font-size: 0.82rem;
  color: var(--notice-text);
  background: var(--notice-bg);
  border-bottom: 1px solid var(--notice-border);
}
.fake-notice-mode { font-weight: 700; color: var(--text); }
.fake-notice-config { font-weight: 600; color: var(--text); }
/* 현재 구성 한 줄(Step 17 — 전부 실제 AI일 때). 연습 모드 띠와 같은 자리·모양, 판정 색 아님 */
.config-strip { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 10px; padding: 7px 16px; font-size: 0.82rem; color: var(--muted); background: var(--surface); border-bottom: 1px solid var(--border); }
.config-strip-head { color: var(--point-ink); }
.config-strip-line { font-weight: 700; color: var(--text); }
.demo-notice-config { flex-basis: 100%; text-align: center; font-size: 0.74rem; color: var(--faint); }
.demo-notice {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 18px;
  padding: 18px 16px 24px;
  font-size: 0.82rem;
  color: var(--faint);
  border-top: 1px solid var(--border);
}
.demo-notice-text { font-weight: 600; }
.demo-notice-hub { color: var(--faint); }

/* ───────────── 버튼 — 알약 모양, 3단계(D62 — tokens.css의 --btn-*).
   주(.btn-primary): 포인트 색 채움 / 보조(.btn): 흰 바탕 + 굵은 테두리 + 그림자 / 약한(.btn-quiet): 회색 채움.
   누를 수 있는 것은 hover에 떠오르고 active에 눌리며 커서가 손 모양이다 — 정보 상자는 그림자 없이 평평하다.
   포인트 색 채움은 판정이 아니다: 판정은 작은 배지 + 글자(출시 차단 등), 버튼은 큰 알약 + 동사 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  background: var(--btn-secondary-bg);
  border: 1.5px solid var(--btn-secondary-border);
  border-radius: 999px;
  box-shadow: var(--btn-shadow);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), box-shadow 0.25s, border-color 0.2s, background-color 0.2s;
}
.btn:hover { border-color: var(--text); box-shadow: var(--btn-shadow-hover); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.98); box-shadow: none; }
.btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.btn:disabled { opacity: 0.5; cursor: progress; transform: none; box-shadow: none; }
.btn-primary { color: var(--btn-primary-text); background: var(--btn-primary-bg); border-color: transparent; }
.btn-primary:hover { background: var(--btn-primary-hover); border-color: transparent; }
.btn-quiet { padding: 7px 14px; font-size: 0.88rem; background: var(--btn-quiet-bg); border-color: transparent; box-shadow: none; }
.btn-quiet:hover { border-color: var(--btn-secondary-border); box-shadow: var(--btn-shadow); }

/* ───────────── 운영자 화면 머리(허브·trace 뷰어·콘솔) — 흰 띠 + 워드마크 표식(포인트 색) */
.op-bar {
  color: var(--text);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.op-bar-inner { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 0; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: 0.02em; font-size: 1.12rem; }
.wordmark::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--point);
  box-shadow: inset 0 0 0 5.5px var(--point), inset 0 0 0 8px var(--on-point);
}
.op-title { padding-left: 12px; font-weight: 600; color: var(--muted); border-left: 1px solid var(--border-strong); }
.op-meta { margin-left: auto; font-size: 0.84rem; color: var(--faint); }
a.op-meta { color: var(--muted); }
.op-meta code { color: var(--text); }

/* ───────────── 허브 */
.hub-main { padding: 64px 0 72px; }
.hub-intro h1 { margin: 0 0 14px; font-size: clamp(1.7rem, 1.1rem + 2vw, 2.6rem); }
.hub-intro .lede { font-size: 1.02rem; line-height: 1.7; }
.screen-grid {
  list-style: none;
  margin: 32px 0 20px;
  padding: 0;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.screen-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px 26px 22px;
  background: var(--surface);
  /* 이동 카드 — 누를 수 있다: 보조 버튼과 같은 굵은 테두리·그림자, 제목 옆 화살표(D62) */
  border: 1.5px solid var(--btn-secondary-border);
  border-radius: var(--radius-l);
  box-shadow: var(--btn-shadow);
  cursor: pointer;
  transition: box-shadow 0.3s, transform 0.3s var(--ease), border-color 0.2s;
}
.screen-card:hover { box-shadow: var(--btn-shadow-hover); transform: translateY(-4px); border-color: var(--text); }
.screen-card:active { transform: translateY(0) scale(0.99); box-shadow: none; }
.screen-card:focus-within { border-color: var(--text); }
.screen-name::after { content: "→"; display: inline-block; margin-left: 8px; font-weight: 600; color: var(--card-accent, var(--point)); transition: transform 0.25s var(--ease); }
.screen-card:hover .screen-name::after { transform: translateX(4px); }
.screen-audience {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}
/* 카드 표식 — 타겟 사이트 카드는 파랑(사이트의 포인트 색), AIAP 화면 카드는 붉은 포인트 */
.screen-card .screen-audience::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--card-accent, var(--point)); }
.screen-card--bank, .screen-card--portal { --card-accent: var(--site-point); }
.screen-name { margin: 0; font-size: 1.3rem; }
.screen-main-link { color: var(--text); text-decoration: none; }
.screen-main-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.screen-desc { margin: 0; color: var(--muted); }
.screen-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 10px 0 0;
}
.hub-trace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px 32px;
  align-items: end;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
}
.hub-trace h2 { margin: 2px 0 6px; font-size: 1.3rem; }
.hub-trace .hint { margin: 10px 0 0; }
.hub-trace .hint .tech { display: block; margin-top: 4px; }
.hub-trace .screen-flow { margin-top: 8px; }

/* ───────────── 전체 흐름(허브 흐름 그림·화면 카드·처리 기록 화면의 지금 위치) — 번호 없는 흐름, 판정 색 없음 */
.hub-flow { margin: 44px 0 0; }
.hub-flow h2 { margin: 0 0 4px; font-size: 1.15rem; }
.hub-flow > .hint { margin: 0 0 12px; }
.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 0;
}
.flow-step { display: inline-flex; align-items: center; gap: 6px; font-size: 0.86rem; }
.flow-step + .flow-step::before { content: "→"; margin: 0 8px; color: var(--muted); }
.flow-name {
  padding: 3px 11px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  white-space: nowrap;
}
/* 지금 위치 — 짙은 회색(포인트 색을 쓰지 않는다: 처리 기록 화면에서 붉은 표시가 판정처럼 읽히지 않게) */
.flow-step.is-here .flow-name { color: var(--surface); background: var(--text); border-color: var(--text); }
.flow-here { font-size: 0.76rem; font-weight: 700; color: var(--text); white-space: nowrap; }
/* 허브: 단계마다 칸 하나 — 이름·한 줄 설명·보는 화면 */
.flow--map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 10px 22px;
  align-items: stretch;
}
.flow--map .flow-step {
  position: relative;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
}
.flow--map .flow-step + .flow-step::before {
  position: absolute;
  top: 50%;
  left: -17px;
  margin: 0;
  transform: translateY(-50%);
}
.flow-caption { font-size: 0.82rem; color: var(--muted); }
.flow-where { margin-top: auto; font-size: 0.76rem; font-weight: 700; color: var(--muted); }
.screen-flow { margin: 4px 0 0; font-size: 0.82rem; font-weight: 600; color: var(--text); }
.screen-flow-label {
  margin-right: 4px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* ───────────── trace id 입력(허브·뷰어 공용) */
.trace-open { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.trace-open-label { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.trace-open input {
  flex: 1 1 22ch;
  min-width: 0;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}
.trace-open input { padding-inline: 16px; transition: border-color 0.2s, box-shadow 0.2s; }
.trace-open input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 4px var(--btn-quiet-bg); }

/* ───────────── 사이트(가상은행·사내 포털)와 챗봇 대화창·발표자 화면의 모양은 site.css 한 곳(`.site` 범위, D57) */
/* 서버가 돌려준 사유 원문 — 지어내지 않고 글자 그대로, 작게(대화창 오류 말풍선·콘솔 상태 줄 공용) */
.msg-detail, .status-detail {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* ───────────── trace 뷰어(중립 — 판정 색 없음) */
.viewer .wrap { width: min(1440px, 100% - 32px); }
.viewer-main { display: flex; flex-direction: column; gap: 16px; padding: 26px 0 56px; }
/* 화면 역할 설명 — 제목·한 줄 설명·전체 흐름의 지금 위치 */
.viewer-head { display: flex; flex-direction: column; gap: 10px; }
.viewer-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
.viewer-title { margin: 0; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.8rem); }
.viewer-lede { margin: 0; color: var(--muted); }
.viewer-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 16px;
  align-items: start;
}
.viewer-origin, .about-box {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
}
.box-title, .about-box summary { margin: 0 0 6px; font-size: 0.95rem; font-weight: 700; }
.origin-line, .origin-how { margin: 0 0 8px; font-size: 0.92rem; }
.origin-how { color: var(--muted); font-size: 0.86rem; }
.origin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.origin-actions:not(:has(a:not([hidden]))) { display: none; }
.about-box summary { cursor: pointer; }
.about-box:not([open]) summary { margin-bottom: 0; }
.about-box[open] summary { margin-bottom: 10px; }
.about-hint { margin-left: 6px; font-size: 0.76rem; font-weight: 400; color: var(--muted); }
.viewer-open { padding-top: 12px; border-top: 1px dashed var(--border); }
.about-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 0; }
.about-list dt { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.about-list dd { margin: 2px 0 0; font-size: 0.88rem; line-height: 1.5; }
.operator-notice {
  margin: 0;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--ink);
  border-radius: var(--radius-s);
}
.viewer-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 8px;
  margin: 0;
}
.viewer-summary div {
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
}
.viewer-summary dt { font-size: 0.76rem; font-weight: 700; color: var(--muted); }
.viewer-summary dd { margin: 0; font-family: var(--font-mono); font-size: 0.9rem; overflow-wrap: anywhere; }
.viewer-summary dd[data-summary="agent_id"] { font-family: var(--font-sans); font-weight: 600; }
.viewer-summary dd .tech { display: block; font-weight: 400; }
.viewer-status { margin: 0; font-size: 0.9rem; color: var(--muted); }
.viewer-status.is-error {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-s);
}
.table-scroll {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
}
.event-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.event-table th, .event-table td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.event-table tbody tr:last-child td { border-bottom: 0; }
.event-table th {
  position: sticky;
  top: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-sunken);
  white-space: nowrap;
}
.event-table th .tech { display: block; margin-top: 1px; }
.event-table .col-paired { background: var(--pair-bg); }
.event-table th.paired { color: var(--text); background: var(--pair-head-bg); }
.event-table td[data-field="seq"] { font-family: var(--font-mono); color: var(--muted); white-space: nowrap; }
.event-table td[data-field="principal_id"] { font-family: var(--font-mono); white-space: nowrap; }
.event-table td[data-field="tool_name"], .event-table td[data-field="planned_tools"] { white-space: nowrap; }
.event-table td .tech { display: block; margin-top: 2px; }
.tool-name { font-weight: 600; }
.tool-item { display: block; }
.tool-item + .tool-item { margin-top: 6px; }
.event-table td[data-field="ts"] {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}
/* 시각의 원래 값(세계 표준시 ISO)은 title — 마우스를 올리면 보인다는 표시로 점선 */
.event-table td[data-field="ts"] time[title] { cursor: help; border-bottom: 1px dotted var(--border-strong); }
/* 기능에 넘긴 값·조회된 데이터 — 쉬운 줄(이름 + 값) 아래에 원문 JSON을 작게. 결정타 장면에서 가장 먼저 읽는 칸 */
.event-table td[data-field="tool_args"], .event-table td[data-field="data_ids"] { min-width: 22ch; }
.cell-pair { display: block; }
.cell-pair + .cell-pair { margin-top: 3px; }
.pair-name { font-size: 0.8rem; color: var(--muted); }
.pair-value { font-family: var(--font-mono); font-weight: 600; overflow-wrap: anywhere; }
/* 원문 JSON은 글자 단위로 쪼개지지 않게 최소 폭을 둔다 */
.cell-json { display: block; min-width: 16ch; max-width: 36ch; white-space: pre-wrap; overflow-wrap: break-word; }
.event-table td[data-field="tool_args"] .cell-json { min-width: 26ch; }
.cell-text { display: block; min-width: 20ch; max-width: 40ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.cell-empty { color: var(--muted); }
.cp-label {
  display: inline-block;
  padding: 1px 7px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cp-label);
  background: var(--cp-label-bg);
  border: 1px solid var(--cp-label-border);
  border-radius: 4px;
  white-space: nowrap;
}
.viewer-legend { display: flex; flex-direction: column; gap: 12px; }
.legend-group { display: flex; flex-direction: column; gap: 6px; }
.legend-title { margin: 0; font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.cp-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; }
.cp-legend div { display: flex; align-items: center; gap: 6px; }
.cp-legend dt { display: flex; align-items: baseline; gap: 6px; }
.cp-legend dd { margin: 0; font-size: 0.84rem; color: var(--muted); }
.tool-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; font-size: 0.84rem; }
.tool-legend li { display: flex; align-items: baseline; gap: 6px; }
.viewer-legend .hint { margin: 0; max-width: 90ch; }

/* ───────────── 좁은 화면 */
@media (max-width: 900px) {
  .hub-trace { grid-template-columns: minmax(0, 1fr); }
  .viewer-intro, .about-list { grid-template-columns: minmax(0, 1fr); }
  .flow--map .flow-step + .flow-step::before { content: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen-card, .btn { transition: none; }
  .screen-card:hover, .btn:hover { transform: none; }
}

/* ───────────── 관리자 확인(/login, D67) — 비밀번호 칸 하나와 주 버튼. 안내 상자는 평평하게(D62), 판정 색을 쓰지 않는다 */
.login-main { display: flex; justify-content: center; padding-block: 48px 64px; }
.login-card {
  width: 100%;
  max-width: 34rem;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
}
.login-card h1 { margin: 4px 0 8px; }
.login-card .lede { margin: 0 0 18px; }
.login-note, .login-message { margin: 0 0 14px; padding: 10px 14px; font-size: 0.92rem; border-radius: var(--radius-s); }
.login-note { color: var(--text); background: var(--surface-sunken); }
.login-message { color: var(--notice-text); background: var(--notice-bg); border: 1px solid var(--notice-border); font-weight: 700; }
.login-label { display: block; margin-bottom: 6px; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.login-row { display: flex; flex-wrap: wrap; gap: 8px; }
.login-input {
  flex: 1 1 16ch;
  min-width: 0;
  padding: 9px 16px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 4px var(--btn-quiet-bg); }
.login-back { margin: 18px 0 0; }
@media (max-width: 480px) { .login-card { padding: 20px 16px; } }
