/* CLICK-TO-INTERROGATE v1 — 창구·채팅 제거, 클릭 가능한 항목 표시 */

/* ---- 창구 장면·질문 버튼 제거. 채팅 로그는 심문 창(팝업) 안으로 이동 ---- */
.inspection-scene,
.question-row { display: none !important; }
.terminal-panel { display: none !important; }

/* ---- 면담 패널: 신청자가 주인공. 얼굴 + 수치 + 대화가 한 기둥 ---- */
.face-panel {
  border: 2px solid #55503f;
  background: var(--paper, #c8bea1);
  box-shadow: 0 18px 32px rgba(0, 0, 0, .55), 5px 6px 0 rgba(5, 7, 5, .5);
  display: flex;
  flex-direction: column;
}
.face-wrap {
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(8, 9, 6, .18) 3px 4px),
    #101512;
  border-bottom: 2px solid #55503f;
  padding: 10px 10px 6px;
}
.face-wrap canvas {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: contain;
  image-rendering: pixelated;
}
.face-panel .profile-data { padding: 4px 10px 8px; border-bottom: 2px dashed #7b755f; }
.face-panel .profile-data div {
  background: transparent;
  border: 0;
  border-bottom: 1px dotted rgba(107, 101, 82, .55);
  padding: 4px 60px 4px 0;   /* 오른쪽 여백 = 심문 칩 자리 */
}
.face-panel .profile-data div:last-child { border-bottom: 0; }
.face-panel .profile-data dt { color: #8b8471; }
.face-panel .profile-data dd { color: #241f16; }
.face-panel #chatLog {
  flex: 1;
  min-height: 0;
  display: block;
  overflow-y: auto;
  padding: 10px;
  background: transparent;
  border: 0;
}
/* 모바일: 하단 시트. 제목을 누르면 접힌다 */
@media (max-width: 1023px) {
  .face-panel {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 300;
    max-height: 58vh;
  }
  .face-panel .desk-window-title { cursor: pointer; }
  .face-wrap #boothPortraitCanvas { height: 90px; }
  .face-panel.face-collapsed .face-wrap,
  .face-panel.face-collapsed #chatLog { display: none; }
}

/* ---- 심문 가능한 항목 ---- */
.askable {
  position: relative;
  cursor: pointer;
  transition: background .08s;
}
.askable::after {
  content: "심문";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 5px;
  color: var(--ink, #19211e);
  background: var(--amber, #e5ae55);
  border: 1px solid rgba(0, 0, 0, .45);
  font: 800 7px/1.4 Consolas, "Malgun Gothic", monospace;
  pointer-events: none;
}
.askable::after { opacity: .85; }        /* 상시 노출 — 클릭 가능함을 숨기지 않는다 */
.askable:hover::after,
.askable:focus-visible::after { opacity: 1; }
.askable:hover { background: rgba(229, 174, 85, .16); }
.askable:focus-visible { outline: 2px solid var(--amber, #e5ae55); outline-offset: 1px; }

.askable.interrogated { cursor: default; opacity: .55; }
.askable.interrogated::after {
  content: "심문 완료";
  opacity: 1;
  color: #6f6a58;
  background: transparent;
  border-color: transparent;
}
.askable.interrogated:hover { background: transparent; }

/* ---- 서류 위 추궁 버튼 ---- */
.ask-probe {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 5px 7px;
  color: var(--ink, #19211e);
  background: var(--amber, #e5ae55);
  border: 1px solid rgba(0, 0, 0, .5);
  box-shadow: 2px 2px 0 rgba(5, 7, 5, .5);
  font: 800 9px/1.3 "Malgun Gothic", sans-serif;
  cursor: pointer;
  text-align: left;
}
.ask-probe::before { content: "▸ "; }
.ask-probe:hover { filter: brightness(1.08); }
.ask-probe:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(5, 7, 5, .5); }
.ask-probe.interrogated { display: none; }

/* .security-rule은 27px+1fr 그리드라 버튼이 첫 칸에 끼어 세로로 찌그러진다 */
.security-rule .ask-probe { grid-column: 1 / -1; margin-top: 5px; }

/* 어두운 검사 서류 안에서는 대비 조정 */
.desk-window.machine-doc .ask-probe { background: #cfa14e; }

/* ---- 옮겨온 후속 추궁 ---- */
.followup-row.relocated {
  display: block;
  margin: 7px 0 0;
  padding: 6px 7px;
  border: 1px dashed #8d5048;
  background: rgba(214, 93, 80, .1);
}
.followup-row.relocated button {
  width: 100%;
  color: inherit;
  background: transparent;
  border: 0;
  font: 700 9px/1.45 "Malgun Gothic", sans-serif;
  text-align: left;
  cursor: pointer;
}
.followup-row.relocated button:hover { text-decoration: underline; }

/* ---- 책상 3열: 면담(주인공) / 증거함·지침 / 도구·분석·도장 ---- */
@media (min-width: 1024px) {
  .work-screen > .face-panel {
    position: absolute; left: 14px; top: 100px; bottom: 12px; width: 402px;
    max-height: none; overflow: visible; z-index: 40;
  }
  .face-wrap #boothPortraitCanvas {
    height: 176px;
    object-fit: contain;
    mix-blend-mode: normal;
  }
  .work-screen > .profile-panel { display: none !important; }
  .desk-tray button:first-child { display: none; }   /* 숨긴 신원철 토글 */

  .desk-window[data-desk-doc="evidence"] {
    left: 430px; top: 100px; width: 322px; right: auto;
    bottom: 12px; max-height: none; overflow-y: auto;
  }
  /* 펼친 지침서는 증거함 위에 얹히는 책 — 평소엔 접혀 있다 */
  .desk-window[data-desk-doc="rules"] {
    left: 430px; top: auto; bottom: 58px; width: 322px; right: auto;
    max-height: 46vh; overflow-y: auto;
    z-index: 130;
    box-shadow: 0 22px 38px rgba(0, 0, 0, .65), 5px 6px 0 rgba(5, 7, 5, .55);
  }
  .desk-window[data-desk-doc="tools"] {
    left: 766px; top: 100px; right: auto; width: min(680px, calc(100vw - 782px));
    max-height: none; overflow: visible;
  }
  .desk-window[data-desk-doc="tools"] .test-list { grid-template-columns: repeat(4, 1fr); }
  .desk-window[data-desk-doc="analysis"] {
    left: 766px; top: 268px; right: auto;
    width: min(680px, calc(100vw - 782px));
    max-height: calc(100vh - 448px); overflow-y: auto;
  }
  .security-rules { max-height: none; overflow: visible; }
  .desk-window[data-desk-doc="evidence"] .evidence-log { max-height: none; overflow: visible; }

  .work-screen > .decision-panel { right: auto; left: 766px; bottom: 12px; width: min(680px, calc(100vw - 782px)); }
  .work-screen > .decision-panel .decision {
    font-size: 11px; line-height: 1.15; padding: 20px 4px 10px; word-break: keep-all;
  }
  .work-screen > .decision-panel .decision::after { display: none; }  /* 영문 고스트 제거 */

  /* 잠긴 단계는 제목 한 줄로 접힌다 — 분석 창은 쓸 수 있을 때만 커진다 */
  .evidence-step.step-locked > *:not(.evidence-step-label) { display: none; }

  /* ---- 텍스트 다이어트 ---- */
  .evidence-token .evidence-summary { -webkit-line-clamp: 1; }        /* 접힌 카드는 1줄 */
  .evidence-token.selected .evidence-summary { -webkit-line-clamp: 4; }
  .relation-recommendation { display: none; }
  .relation-recommendation.no-relation { display: block; }             /* 비교 불가 경고만 유지 */
  [data-relation].recommended { background: transparent; }             /* 정답 표시 제거 */
  [data-relation].recommended::after { content: none; }
  .inspector-status em { display: none; }                              /* 부연 라벨 제거 */
}

/* .security-rule은 `27px 1fr` 그리드다. 자식이 순서대로 칸을 채우므로
   축약형/원문에 열을 명시하지 않으면 원문이 27px 칸으로 밀려 세로로 흐른다. */
.security-rule .rule-short {
  grid-column: 2 / -1;
  display: block;
  font: 800 11px/1.35 "Malgun Gothic", sans-serif;
}
.security-rule .rule-orig {
  grid-column: 2 / -1;
  margin-top: 2px;
  color: #8b8471;
  font-size: 7.5px;
  line-height: 1.4;
}

/* 모바일: 창구 탭이 비었으므로 프로필/증거 두 탭만 의미가 있다 */
@media (max-width: 700px) {
  [data-mobile-workspace="terminal"] { display: none !important; }
}

/* 새 증거 도착: 반짝이며 시선을 끈다 */
@keyframes evNew {
  0% { outline: 3px solid var(--amber, #e5ae55); background: rgba(229, 174, 85, .35); }
  100% { outline: 3px solid transparent; background: transparent; }
}
.evidence-token.ev-new { animation: evNew 1.6s ease-out; }
@media (prefers-reduced-motion: reduce) { .evidence-token.ev-new { animation: none; } }

/* ============================================================
   진행 순서 · 주제 배지 · 사건 교대 안무
   ============================================================ */
.step-bar {
  position: absolute;
  left: 14px; right: 14px; top: 104px;   /* 검사관 상태 줄 아래 */
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  z-index: 60;
}
.step-cell {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 5px 9px;
  color: #7d7765;
  border: 1px solid #4a463a;
  background: rgba(16, 19, 15, .82);
  opacity: .55;
  transition: opacity .18s, background .18s;
}
.step-cell b { font: 800 10px/1.3 "Malgun Gothic", sans-serif; white-space: nowrap; }
.step-cell em { font: 600 8px/1.3 "Malgun Gothic", sans-serif; font-style: normal; }
.step-cell.step-now {
  opacity: 1;
  color: var(--ink, #19211e);
  border-color: #7a5c18;
  background: var(--amber, #e5ae55);
}
.step-cell.step-done { opacity: .92; color: #a9d3ba; border-color: #4d6f57; }
.step-cell.step-done b::before { content: "✓ "; }

/* 단계 바가 생긴 만큼 서류 시작점을 내린다 */
@media (min-width: 1024px) {
  .work-screen > .face-panel,
  .desk-window[data-desk-doc="evidence"],
  .desk-window[data-desk-doc="tools"] { top: 148px; }
  .desk-window[data-desk-doc="analysis"] { top: 316px; }
}

/* ---- 주제 배지 ---- */
.ev-topics { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.ev-topic {
  padding: 1px 5px;
  color: #3a3527;
  border: 1px solid #8d876f;
  background: rgba(255, 255, 255, .35);
  font: 800 7.5px/1.5 Consolas, "Malgun Gothic", monospace;
  font-style: normal;
}
.desk-window.machine-doc .ev-topic { color: #d8d2b8; background: rgba(255,255,255,.08); }

/* 한 장 고르면: 같은 주제는 밝게, 아닌 것은 죽인다 */
.evidence-token.topic-dim { opacity: .32; filter: grayscale(.6); }
.evidence-token.topic-hit { outline: 2px solid var(--amber, #e5ae55); outline-offset: -2px; }

/* ---- 사건 교대: 서류가 차례로 내려앉는다 ---- */
@keyframes docArrive {
  0%   { transform: translateY(-14px) rotate(-1.2deg); opacity: 0; }
  60%  { transform: translateY(3px) rotate(.3deg); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
.doc-arrive { animation: docArrive .42s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: var(--arrive-delay, 0ms); }
@media (prefers-reduced-motion: reduce) { .doc-arrive { animation: none; } }

@media (max-width: 1023px) {
  .step-bar { position: static; margin: 6px; grid-template-columns: repeat(2, 1fr); }
  .step-cell em { display: none; }
}

/* ---- 대조 결과판: 게임이 판정을 말한다 ---- */
.relation-buttons { display: none !important; }   /* 관계 분류 3버튼 제거 */

.pair-verdict {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 2px solid var(--ink, #19211e);
  background: rgba(16, 19, 15, .06);
}
.pair-verdict-text { font: 800 11px/1.45 "Malgun Gothic", sans-serif; word-break: keep-all; }
.pair-verdict[data-verdict="idle"] { opacity: .7; }
.pair-verdict[data-verdict="none"] { border-color: #8a8471; }
.pair-verdict[data-verdict="none"] .pair-verdict-text { color: #6f6a58; }
.pair-verdict[data-verdict="match"] { border-color: #6f9a80; background: rgba(111,154,128,.14); }
.pair-verdict[data-verdict="match"] .pair-verdict-text { color: #35604a; }
.pair-verdict[data-verdict="contradiction"],
.pair-verdict[data-verdict="exception"] {
  border-color: #d65d50;
  background: rgba(214,93,80,.16);
  animation: verdictHit .5s ease-out;
}
.pair-verdict[data-verdict="contradiction"] .pair-verdict-text,
.pair-verdict[data-verdict="exception"] .pair-verdict-text { color: #8e2f26; }
@keyframes verdictHit {
  0% { transform: scale(1.03); background: rgba(214,93,80,.42); }
  100% { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .pair-verdict { animation: none; } }

.pair-verdict-act {
  padding: 6px 8px;
  color: var(--ink, #19211e);
  background: var(--amber, #e5ae55);
  border: 1px solid rgba(0,0,0,.5);
  box-shadow: 2px 2px 0 rgba(5,7,5,.5);
  font: 800 10px/1.3 "Malgun Gothic", sans-serif;
  text-align: left;
  cursor: pointer;
}
.pair-verdict-act:hover { filter: brightness(1.08); }
.pair-verdict-act:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 rgba(5,7,5,.5); }

/* 근거 없이도 도장은 찍힌다 — 잠금 대신 경고로 */
.decision-gate-reason { font-weight: 800; }

/* 분석 여력 소진 */
.pair-verdict[data-verdict="exhausted"] {
  border-color: #8a5b18;
  background: repeating-linear-gradient(45deg, rgba(229,174,85,.18) 0 6px, transparent 6px 12px);
}
.pair-verdict[data-verdict="exhausted"] .pair-verdict-text { color: #7a5410; }

/* 남은 여력을 크게 — 이제 이게 진짜 자원이다 */
.evidence-workspace-heading b { font-size: 15px; }
