/* U-Sphere 화면 시안 — 공통 스타일. 시안용이며 제품 코드가 아니다. 색은 dataviz 기본 팔레트(검증됨)를 쓴다. */
:root {
  color-scheme: light;
  --page: #f9f9f7; --surface: #fcfcfb; --ink: #0b0b0b; --ink-2: #52514e; --ink-3: #898781;
  --grid: #e1e0d9; --axis: #c3c2b7; --ring: rgba(11,11,11,.10);
  --s1: #2a78d6; --s1-soft: #cde2fb; --s2: #eb6834; --s2-soft: #fbe1d6;
  --good: #0ca30c; --good-ink: #006300; --warn: #fab219; --serious: #ec835a; --crit: #d03b3b;
  --r: 12px;
  --f: system-ui, -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--ink); font: 14px/1.5 var(--f); }
svg text { font-family: var(--f); }
.app { display: grid; grid-template-columns: 76px 1fr; min-height: 100vh; width: 1440px; }

/* 레일 */
.rail { background: var(--surface); border-right: 1px solid var(--ring); padding: 16px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.logo { display: block; margin: 0 0 12px; }
.agent { display: block; flex: none; }
.nav { width: 60px; padding: 8px 0 6px; border-radius: 10px; text-align: center; color: var(--ink-2); font-size: 11px; line-height: 1.2; }
.nav i { display: block; font-style: normal; font-size: 18px; margin-bottom: 2px; }
.nav.on { background: var(--s1-soft); color: #104281; font-weight: 600; }
.nav.later { opacity: .55; }

/* 상단 바 */
.top { height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--ring); }
.crumb { font-weight: 600; font-size: 15px; }
.crumb small { color: var(--ink-3); font-weight: 400; margin-left: 8px; }
.sp { flex: 1; }
.ask { width: 380px; height: 38px; border-radius: 19px; border: 1px solid var(--axis); background: var(--page); padding: 0 16px; display: flex; align-items: center; color: var(--ink-3); gap: 8px; }
.ask b { color: var(--s1); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; background: var(--page); border: 1px solid var(--ring); color: var(--ink-2); white-space: nowrap; }
.badge.demo { background: #fff6d6; border-color: #f1dc8a; color: #6b5200; }
.badge.later { background: #efeafc; border-color: #d7cdf6; color: #3f2fa0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: inline-block; }
.dot.warn { background: var(--warn); } .dot.crit { background: var(--crit); }

.main { padding: 24px 28px 40px; }
h1 { font-size: 22px; line-height: 1.3; margin: 0 0 4px; letter-spacing: -.3px; }
h2 { font-size: 15px; margin: 0; letter-spacing: -.2px; }
.sub { color: var(--ink-2); }
.muted { color: var(--ink-3); }
.row { display: flex; gap: 16px; } .col { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; gap: 16px; }

.card { background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r); padding: 18px 20px; }
.card h2 + .sub { margin-top: 2px; font-size: 12px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

/* 상태: 색만으로 전하지 않는다 — 아이콘 + 글자 */
.status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.status svg { width: 14px; height: 14px; }
.st-crit { background: #fbe3e3; color: #8f1f1f; } .st-serious { background: #fde6dc; color: #8a3410; }
.st-warn { background: #fdf0cc; color: #6b5200; } .st-info { background: #e3eefb; color: #184f95; }
.st-good { background: #dff3df; color: #006300; }

/* 근거 표시: 원천 사실(●) 과 추론됨(◇) 은 모양이 다르다 */
.basis { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 4px; }
.basis.fact { background: #ececea; color: var(--ink-2); }
.basis.infer { background: transparent; border: 1px dashed var(--s1); color: #184f95; }

.btn { height: 36px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--axis); background: var(--surface); font: inherit; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.btn.pri { background: var(--s1); border-color: var(--s1); color: #fff; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.chip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--axis); background: var(--surface); font-size: 13px; color: var(--ink-2); }
.chip.on { border-color: var(--s1); background: #e3eefb; color: #184f95; }

.kpi .v { font-size: 30px; font-weight: 650; letter-spacing: -.8px; line-height: 1.1; }
.kpi .v small { font-size: 14px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; margin-left: 2px; }
.kpi .l { color: var(--ink-2); font-size: 12px; margin-bottom: 6px; }
.kpi .d { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.up-bad { color: #8f1f1f; } .up-good { color: var(--good-ink); }

table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12px; padding: 0 10px 8px 0; border-bottom: 1px solid var(--grid); }
td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--grid); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }

.chart { width: 100%; height: auto; display: block; }
.spark { width: auto; }
.chart text { fill: var(--ink-3); font-size: 11px; }
.chart .tick-x text { text-anchor: middle; }
.chart .lbl { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); align-items: center; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.legend i.band { height: 10px; opacity: .35; }

.tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; padding: 8px 10px; border-radius: 8px; line-height: 1.5; white-space: nowrap; display: none; z-index: 5; }

.dock { margin-top: 24px; }
.dock .bar { width: 760px; margin: 0 auto; background: var(--surface); border: 1px solid var(--axis); border-radius: 28px; box-shadow: 0 6px 24px rgba(11,11,11,.10); padding: 12px 20px; display: flex; align-items: center; gap: 12px; }
.callout { font-size: 12px; color: var(--ink-2); background: var(--page); border: 1px solid var(--ring); border-radius: 8px; padding: 8px 10px; }
.ribbon { background: #efeafc; border: 1px solid #d7cdf6; color: #3f2fa0; border-radius: 8px; padding: 8px 12px; font-size: 12px; display: flex; gap: 8px; align-items: center; }

/* 브랜드 (brand.md §4) — 에이전트 상태 로고는 말하는 자리에만, 어두운 바탕은 브랜드 구역에만 */
.ask .agent, .dock .agent { margin: -4px 0 -4px -8px; }
.voice { display: flex; align-items: center; gap: 14px; }
.voice .agent { margin-left: 0; }
.bubble.ai { position: relative; }
.stage { position: relative; overflow: hidden; border-radius: var(--r); background: #0d0d14; color: #f2f1f8; }
.stage > img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.stage > .in { position: relative; }
.stage .sub { color: #b9b7c9; }
.bubble.ai > .agent { float: left; margin: -2px 8px 0 -4px; }

/* 에이전트 · 스튜디오 (07 · 08) — 시안과 목업 사이트가 함께 쓴다 */
.ag-li { padding: 12px 14px; border-bottom: 1px solid var(--grid); display: grid; gap: 6px; cursor: pointer; }
.ag-li:last-child { border-bottom: 0; } .ag-li.on { background: #f3f8fe; box-shadow: inset 3px 0 0 var(--s1); } .ag-li b { font-weight: 600; }
.ag-tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 4px; background: #ececea; color: var(--ink-2); }
.ag-tag.stable { background: #dff3df; color: #006300; } .ag-tag.active { background: #e3eefb; color: #184f95; } .ag-tag.shadow { background: #efeafc; color: #3f2fa0; } .ag-tag.draft { background: #fff6d6; color: #6b5200; }
.ag-rule { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 9px 0; border-bottom: 1px solid var(--grid); font-size: 13px; align-items: center; }
.ag-rule:last-child { border-bottom: 0; } .ag-rule .then { margin-right: 4px; }
.ag-chan { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--grid); font-size: 13px; } .ag-chan.off { color: var(--ink-3); }
.ag-tl { display: grid; grid-template-columns: 22px 1fr 70px; gap: 10px; align-items: start; padding-bottom: 12px; position: relative; font-size: 13px; }
.ag-tl:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: -2px; width: 1px; background: var(--axis); }
.ag-tl i { width: 15px; height: 15px; border-radius: 50%; background: var(--s1); margin: 3px 3px 0; } .ag-tl .t { color: var(--ink-3); font-size: 12px; text-align: right; }
.ag-ladder { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
.ag-step { border: 1px solid var(--ring); border-radius: 8px; padding: 8px 10px; font-size: 12px; color: var(--ink-2); background: var(--page); line-height: 1.4; }
.ag-step b { display: block; font-size: 13px; color: var(--ink); } .ag-step.cur { border-color: var(--s1); background: #e3eefb; color: #184f95; } .ag-step.cur b { color: #104281; }
.ag-canvas { background: #f1f1ee; border: 1px solid var(--ring); border-radius: 14px; padding: 22px; }
.ag-sheet { background: var(--surface); border-radius: 10px; box-shadow: 0 1px 0 var(--ring); padding: 18px 22px 22px; }
.ag-sec { margin: 0 0 18px; } .ag-h { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 6px; }
.ag-sel { position: relative; outline: 2px solid var(--s1); outline-offset: 8px; border-radius: 6px; }
.ag-tb { position: absolute; top: -52px; left: -6px; background: var(--ink); color: #fff; border-radius: 8px; padding: 6px 10px; display: flex; gap: 14px; font-size: 12px; white-space: nowrap; z-index: 3; } .ag-tb b { color: #9ec5f4; }
.ag-tool { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 5px 0; } .ag-tool.off { color: var(--ink-3); }
.ag-ck::before { content: "✓"; color: var(--good-ink); font-weight: 700; display: inline-block; width: 18px; text-align: center; }
ul.ag-ok { padding: 0; margin: 8px 0 0; } ul.ag-ok li { list-style: none; margin: 4px 0; } ul.ag-ok li::before { content: "✓"; color: var(--good-ink); font-weight: 700; margin-right: 8px; }
