/* ============================================================
   Regulatory Operational AI Platform — Style
   Visual language: professional, government-grade, decision-support,
   modern, clean, evidence-driven. Avoid futuristic AI clichés.
   ============================================================ */

:root{
  --navy: #1e3a5f;
  --navy-dark: #142a45;
  --accent: #0e7490;
  --paper: #f8fafc;
  --line: #e2e8f0;
  --ai-color: #6d28d9;
  --human-color: #b45309;
  --font: 'Noto Sans KR', -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

*{box-sizing:border-box;}
html,body{font-family:var(--font); margin:0; padding:0; scroll-behavior:smooth;}

/* ---------------- Top bar ---------------- */
.top-bar{
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color:#fff;
  position: sticky; top:0; z-index: 50;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.top-bar-inner{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 24px; gap:16px; flex-wrap:wrap;
}
.brand{display:flex; align-items:center; gap:12px;}
.brand-mark{
  width:40px; height:40px; border-radius:8px;
  background: rgba(255,255,255,.12);
  display:flex; align-items:center; justify-content:center;
  font-size:18px; color:#e0f2fe; flex-shrink:0;
}
.brand-title{font-weight:700; font-size:16px; letter-spacing:.2px;}
.brand-sub{font-size:11.5px; color:#bcd3ea; margin-top:1px;}
.top-bar-actions{display:flex; gap:10px; flex-wrap:wrap;}

.btn{
  border:none; cursor:pointer; border-radius:7px; font-size:13px; font-weight:600;
  padding:9px 16px; display:inline-flex; align-items:center; gap:8px;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btn-story{
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color:#fff; box-shadow: 0 3px 10px rgba(217,119,6,.4);
}
.btn-ghost{
  background: rgba(255,255,255,.1); color:#e2e8f0; border:1px solid rgba(255,255,255,.25);
}
.btn-ghost:hover{ background: rgba(255,255,255,.18); }

.story-banner{
  background:#fef3c7; color:#78350f; font-size:13px; font-weight:600;
  padding:8px 24px; display:flex; align-items:center; gap:10px;
  border-top:1px solid #fde68a;
}
.story-banner.hidden{ display:none; }
.story-stop{
  margin-left:auto; background:#78350f; color:#fff; border:none;
  padding:4px 12px; border-radius:6px; font-size:12px; cursor:pointer;
}

/* ---------------- Layout ---------------- */
.app-shell{ display:flex; min-height: calc(100vh - 110px); }
.sidebar{
  width: 250px; flex-shrink:0; background:#fff; border-right:1px solid var(--line);
  padding: 18px 12px; position: sticky; top:110px; align-self:flex-start;
  max-height: calc(100vh - 110px); overflow-y:auto;
}
.sidebar-label{
  font-size:11px; font-weight:700; color:#94a3b8; text-transform:uppercase;
  letter-spacing:.08em; padding: 4px 10px 10px;
}
.nav-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:3px; }
.nav-item{
  display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:8px;
  cursor:pointer; font-size:13px; color:#475569; font-weight:500;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover{ background:#f1f5f9; }
.nav-item.active{ background:#e0f2fe; color:var(--navy-dark); font-weight:700; }
.nav-item .nav-num{
  width:22px; height:22px; border-radius:50%; background:#e2e8f0; color:#64748b;
  font-size:10.5px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.nav-item.active .nav-num{ background: var(--navy-dark); color:#fff; }
.nav-item.done .nav-num{ background:#16a34a; color:#fff; }
.sidebar-footer{
  margin-top:16px; padding:12px 10px; font-size:11.5px; color:#94a3b8; border-top:1px solid var(--line);
}

.screen-root{ flex:1; padding: 28px 32px 60px; max-width: 1180px; }

.footer-note{
  text-align:center; font-size:12px; color:#94a3b8; padding: 18px 20px 30px;
  border-top:1px solid var(--line); background:#fff;
}

/* ---------------- Screen common ---------------- */
.screen-header{ margin-bottom:22px; }
.screen-kicker{
  font-size:11.5px; font-weight:700; color:var(--accent); text-transform:uppercase;
  letter-spacing:.08em; margin-bottom:6px;
}
.screen-title{ font-size:24px; font-weight:800; color:#0f172a; margin:0 0 6px; }
.screen-desc{ font-size:14px; color:#64748b; line-height:1.6; max-width:760px; }

.card{
  background:#fff; border:1px solid var(--line); border-radius:12px;
  padding:20px; box-shadow: 0 1px 3px rgba(0,0,0,.03);
}
.card + .card{ margin-top:16px; }

.demo-tag{
  display:inline-flex; align-items:center; gap:5px; font-size:10.5px; font-weight:700;
  color:#92400e; background:#fef3c7; border:1px solid #fde68a; padding:2px 8px; border-radius:5px;
}

/* AI vs Human badges */
.badge{
  display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700;
  padding:3px 9px; border-radius:6px; letter-spacing:.02em;
}
.badge-ai{ background:#ede9fe; color:var(--ai-color); border:1px solid #ddd6fe; }
.badge-human{ background:#fef3c7; color:var(--human-color); border:1px solid #fde68a; }
.badge-unknown{ background:#e2e8f0; color:#334155; border:1px solid #cbd5e1; }

/* State chip */
.state-chip{
  display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:700;
  padding:4px 10px; border-radius:20px; border:1px solid transparent; white-space:nowrap;
}

/* ---------------- Screen 1: intake ---------------- */
.intake-box{
  border:2px dashed #cbd5e1; border-radius:12px; padding:22px; background:#fff;
}
textarea.intake-input{
  width:100%; min-height:110px; border:1px solid var(--line); border-radius:10px;
  padding:14px; font-size:14.5px; font-family:var(--font); resize:vertical;
  outline:none; transition:border-color .15s ease;
}
textarea.intake-input:focus{ border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,116,144,.12); }

.example-chip{
  display:inline-block; font-size:12px; color:#0e7490; background:#ecfeff; border:1px solid #a5f3fc;
  padding:5px 10px; border-radius:16px; cursor:pointer; margin: 4px 6px 0 0;
}
.example-chip:hover{ background:#cffafe; }

/* ---------------- Context grid (screen 2) ---------------- */
.context-grid{
  display:grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap:12px;
}
.context-cell{
  border:1px solid var(--line); border-radius:10px; padding:13px 14px; background:#fff;
  border-left:4px solid var(--accent);
}
.context-axis{ font-size:11px; font-weight:700; color:var(--accent); text-transform:uppercase; letter-spacing:.05em; }
.context-ko{ font-size:11.5px; color:#94a3b8; margin-left:6px; }
.context-value{ font-size:13.5px; color:#1e293b; margin-top:5px; line-height:1.5; }

/* ---------------- Question map (screen 3) ---------------- */
.question-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap:14px; }
.question-card{
  border:1px solid var(--line); border-radius:12px; padding:16px; background:#fff; cursor:pointer;
  transition: box-shadow .15s ease, transform .12s ease;
}
.question-card:hover{ box-shadow:0 4px 14px rgba(0,0,0,.08); transform: translateY(-2px); }
.question-code{ font-family:var(--mono); font-size:11px; color:#94a3b8; font-weight:600; }
.question-text{ font-size:14.5px; font-weight:700; color:#0f172a; margin:5px 0 10px; line-height:1.4; }
.question-footer{ display:flex; align-items:center; justify-content:space-between; }

/* ---------------- Discovery (screen 4) ---------------- */
.candidate-card{
  border:1px solid var(--line); border-radius:10px; padding:14px 16px; margin-bottom:12px; background:#fff;
}
.candidate-top{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.candidate-layer{
  font-size:10.5px; font-weight:700; color:#475569; background:#f1f5f9; padding:2px 8px; border-radius:5px;
  text-transform:uppercase; letter-spacing:.04em;
}
.candidate-title{ font-size:14px; font-weight:700; color:#1e293b; margin:6px 0 4px; }
.evidence-block{
  background:#f8fafc; border:1px solid #eef2f6; border-radius:8px; padding:10px 12px; margin-top:8px; font-size:12.5px;
}
.evidence-row{ display:flex; gap:6px; margin-bottom:3px; }
.evidence-label{ font-weight:700; color:#64748b; flex-shrink:0; min-width:96px; }
.evidence-value{ color:#334155; line-height:1.5; }
.confidence-bar-wrap{ display:flex; align-items:center; gap:8px; margin-top:8px; }
.confidence-bar-track{ flex:1; height:6px; background:#e2e8f0; border-radius:4px; overflow:hidden; }
.confidence-bar-fill{ height:100%; border-radius:4px; background: linear-gradient(90deg, #0e7490, #22d3ee); }
.confidence-label{ font-size:11px; font-weight:700; color:#0e7490; font-family:var(--mono); }

.unknown-note{
  margin-top:8px; font-size:12px; color:#334155; background:#f1f5f9; border:1px dashed #94a3b8;
  border-radius:8px; padding:8px 10px;
}

/* ---------------- Network graph (screen 6) ---------------- */
#network-graph{ width:100%; height:520px; border:1px solid var(--line); border-radius:12px; background:#fbfcfe; }
.legend-row{ display:flex; flex-wrap:wrap; gap:10px; margin-top:12px; }
.legend-item{ display:flex; align-items:center; gap:6px; font-size:11.5px; color:#475569; }
.legend-dot{ width:12px; height:12px; border-radius:3px; display:inline-block; }

/* ---------------- Dashboard (screen 7) ---------------- */
.readiness-hero{
  display:flex; align-items:center; gap:26px; padding:22px; border-radius:14px;
  background: linear-gradient(135deg, #0f2942, #1e3a5f); color:#fff; flex-wrap:wrap;
}
.readiness-ring{ position:relative; width:120px; height:120px; flex-shrink:0; }
.readiness-pct{ font-size:26px; font-weight:800; }
.state-count-grid{ display:grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap:10px; margin-top:16px; }
.state-count-card{
  border-radius:10px; padding:12px 14px; border:1px solid var(--line); background:#fff;
}
.state-count-num{ font-size:24px; font-weight:800; }
.state-count-label{ font-size:11.5px; font-weight:700; margin-top:2px; }

/* ---------------- COA (screen 8) ---------------- */
.coa-grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap:16px; }
.coa-card{ border:1px solid var(--line); border-radius:12px; padding:18px; background:#fff; display:flex; flex-direction:column; }
.coa-name{ font-size:12px; font-weight:800; color:var(--accent); letter-spacing:.05em; }
.coa-title{ font-size:15.5px; font-weight:700; color:#0f172a; margin:4px 0 8px; }
.coa-desc{ font-size:13px; color:#64748b; line-height:1.55; flex:1; }
.coa-changes{ font-size:12.5px; margin-top:10px; color:#334155; }
.coa-changes li{ margin-bottom:3px; }
.coa-meta{ display:flex; justify-content:space-between; align-items:center; margin-top:12px; font-size:12px; color:#94a3b8; }
.coa-approve-status{
  margin-top:12px; font-size:12px; padding:8px 10px; border-radius:8px; background:#f8fafc; border:1px solid var(--line);
}

/* ---------------- Human Review (screen 9) ---------------- */
.review-row{
  display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px;
  border:1px solid var(--line); border-radius:10px; margin-bottom:10px; flex-wrap:wrap; background:#fff;
}
.review-info{ flex:1; min-width:220px; }
.review-actions{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
select.review-select{
  font-size:12.5px; border:1px solid var(--line); border-radius:6px; padding:6px 8px; background:#fff;
}
input.review-input{
  font-size:12.5px; border:1px solid var(--line); border-radius:6px; padding:6px 8px; width:130px;
}
.btn-small{ font-size:12px; padding:6px 12px; border-radius:6px; font-weight:700; cursor:pointer; border:none; }
.btn-close{ background:#16a34a; color:#fff; }
.btn-close:disabled{ background:#cbd5e1; cursor:not-allowed; }

/* ---------------- Hydration (screen 10) ---------------- */
.hydration-event-card{ border:1px solid #fde68a; background:#fffbeb; border-radius:12px; padding:18px; }
.effect-row{ display:flex; align-items:center; gap:10px; font-size:13px; margin-top:8px; flex-wrap:wrap; }
.arrow{ color:#94a3b8; }

/* ---------------- Accountability log (screen 12) ---------------- */
.log-item{
  display:flex; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); font-size:12.5px;
}
.log-item:last-child{ border-bottom:none; }
.log-time{ font-family:var(--mono); color:#94a3b8; flex-shrink:0; width:150px; }
.log-body{ color:#334155; line-height:1.5; }
.log-actor{ font-weight:700; color:#0f172a; }

/* misc */
.pill{ display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700; padding:3px 9px; border-radius:20px; }
.section-title{ font-size:15px; font-weight:800; color:#0f172a; margin: 24px 0 10px; }
.section-title:first-child{ margin-top:0; }
.hint{ font-size:12px; color:#94a3b8; }

.btn-nav{
  display:inline-flex; align-items:center; gap:8px; padding:10px 20px; border-radius:8px;
  background: var(--navy-dark); color:#fff; font-weight:700; font-size:13.5px; border:none; cursor:pointer;
}
.btn-nav:hover{ background:#0f2036; }
.btn-secondary-nav{
  background:#fff; color:var(--navy-dark); border:1px solid var(--line);
}
.btn-secondary-nav:hover{ background:#f1f5f9; }

.step-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:24px; }

@media (max-width: 860px){
  .app-shell{ flex-direction:column; }
  .sidebar{ width:100%; position:static; max-height:none; }
  .screen-root{ padding: 20px 16px 40px; }
}

/* ============================================================
   Readability Pass
   Larger type + stronger contrast for presentation/demo use
   ============================================================ */

body {
  color: #172033;
  font-size: 16px;
}

/* 왼쪽 메뉴 */
.sidebar {
  width: 270px;
}

.sidebar-label {
  font-size: 13px;
  font-weight: 800;
  color: #64748b;
}

.nav-item {
  font-size: 15px;
  font-weight: 700;
  color: #334155;
  padding: 11px 12px;
}

.nav-num {
  font-weight: 800;
}

/* 화면 제목/설명 */
.screen-kicker {
  font-size: 13px;
  font-weight: 800;
}

.screen-title {
  font-size: 28px;
  font-weight: 850;
  color: #0f172a;
}

.screen-desc {
  font-size: 15px;
  line-height: 1.75;
  color: #334155;
}

/* 카드 본문 */
.candidate-title {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}

.candidate-layer {
  font-size: 12px;
  font-weight: 800;
  color: #475569;
}

.evidence-row {
  font-size: 14px;
  line-height: 1.65;
}

.evidence-label {
  font-weight: 800;
  color: #475569;
}

.evidence-value {
  color: #263449;
  font-weight: 550;
}

.confidence-label {
  font-size: 13px;
  font-weight: 800;
  color: #334155;
}

/* UNKNOWN / 안내 문구 */
.unknown-note {
  font-size: 13.5px;
  line-height: 1.6;
  color: #263449;
  font-weight: 550;
}

.hint {
  font-size: 13px;
  color: #475569;
  font-weight: 550;
}

/* 상태 Badge */
.state-chip,
.demo-tag,
.badge {
  font-weight: 800;
}

/* 왼쪽 아래 Evidence 상태 안내 */
.sidebar > p,
.sidebar p {
  color: #475569;
}

/* index.html의 sidebar 하단 안내 영역 */
.sidebar-footer,
.sidebar-note {
  font-size: 13px !important;
  line-height: 1.65 !important;
  color: #334155 !important;
  font-weight: 600;
}

/* 실제 클래스명이 없어도 현재 sidebar 마지막 안내문을 강화 */
.sidebar > :last-child {
  font-size: 13px;
  line-height: 1.65;
  color: #334155;
}

.sidebar > :last-child strong {
  color: #1e293b;
  font-weight: 850;
}

/* 버튼 */
.btn-nav {
  font-size: 14px;
  font-weight: 800;
}

/* 작은 보조문구도 너무 흐리지 않게 */
small {
  color: #475569;
}

/* 공식 근거 링크 */
.evidence-value a {
  color: #075985;
  font-weight: 750;
  text-decoration-thickness: 1px;
}

