/* KB Back 디자인 시스템 */
:root {
  --kb-yellow: #FFBC00;
  --kb-yellow-soft: #FFF4D6;
  --kb-gold: #F5A800;
  --kb-charcoal: #26282C;
  --kb-gray: #60584C;
  --ink: #1E2024;
  --ink-2: #383C42;
  --ink-3: #63676D;
  --bg: #F4F5F7;
  --card: #FFFFFF;
  --line: #ECEDF0;
  --green: #16A34A;
  --green-soft: #E9F7EE;
  --amber: #B45309;
  --amber-soft: #FEF3C7;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(30, 32, 36, 0.08);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #FFE9A8 0%, transparent 55%),
              radial-gradient(900px 500px at -10% 100%, #FFF1C2 0%, transparent 50%), var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
button { font-family: inherit; }

/* 스테이지: 좌측 피치, 우측 폰 프레임 */
.stage {
  display: flex; gap: 56px; align-items: center; justify-content: center;
  min-height: 100vh; padding: 40px 24px;
}
.pitch { max-width: 480px; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pitch-badge {
  display: inline-block; background: var(--kb-charcoal); color: var(--kb-yellow);
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  padding: 6px 12px; border-radius: 999px;
}
.pitch-badge.silver {
  background: linear-gradient(135deg, #F2F3F5 0%, #C9CDD3 35%, #EDEFF2 60%, #AEB4BC 100%);
  color: #3A3D42; border: 1px solid #D8DBE0; text-shadow: 0 1px 0 rgba(255,255,255,.6);
}
.pitch-credit { margin-top: 14px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.scan-team {
  position: absolute; bottom: 26px; left: 0; right: 0; text-align: center;
  font-size: 10px; font-weight: 800; letter-spacing: .22em; color: #9CA1A7;
}
.team-credit {
  text-align: center; margin: 20px 0 6px; font-size: 10.5px; font-weight: 800;
  letter-spacing: .18em; color: var(--ink-3);
}
.team-credit b {
  background: linear-gradient(135deg, #9BA1A9, #E6E8EB 45%, #8F959D 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pitch h1 { font-size: 44px; line-height: 1.18; font-weight: 800; letter-spacing: -0.02em; }
.pitch h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--kb-yellow) 62%); }
.pitch-tag { margin-top: 12px; font-size: 15px; font-weight: 700; color: var(--kb-gray); }
.pitch-tag b { background: linear-gradient(transparent 60%, var(--kb-yellow) 60%); }
.pitch-lead { margin: 18px 0 22px; font-size: 15.5px; line-height: 1.7; color: var(--ink-2); }
.pitch-points { list-style: none; display: grid; gap: 10px; }
.pitch-points li {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 14px; font-size: 13.5px; color: var(--ink-2); box-shadow: var(--shadow);
}
.pitch-points b { color: var(--ink); display: block; margin-bottom: 2px; }
.pitch-links { margin-top: 22px; }
.pitch-link { color: var(--kb-gray); font-weight: 700; font-size: 14px; text-decoration: none; }
.pitch-link:hover { text-decoration: underline; }

/* 폰 프레임 */
.phone {
  position: relative; width: 420px; height: 880px; background: var(--bg);
  border-radius: 44px;
  box-shadow: 0 30px 80px rgba(30,32,36,.25), 0 0 0 10px var(--kb-charcoal), 0 0 0 12px #3a3d42;
  overflow: hidden; display: flex; flex-direction: column;
}
.statusbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 26px 0; background: var(--kb-yellow); color: var(--kb-charcoal);
  font-size: 13px; font-weight: 700;
}
.sb-icons { display: flex; gap: 5px; align-items: center; }
.app-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px 14px; background: linear-gradient(180deg, var(--kb-yellow) 0%, #FFD34D 100%);
}
.brand { font-weight: 800; font-size: 18px; color: var(--kb-charcoal); }
.brand-star { color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.15); }
.persona-select {
  border: 1px solid rgba(38,40,44,.25); background: rgba(255,255,255,.6);
  color: var(--kb-charcoal); font-size: 12px; font-weight: 600;
  border-radius: 999px; padding: 6px 10px; max-width: 190px;
}
.view { flex: 1; overflow-y: auto; padding: 18px 16px 96px; display: none; }
.view.active { display: block; }

/* 하단 탭바 */
.tabbar {
  position: absolute; bottom: 0; left: 0; right: 0; display: flex;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); padding: 9px 6px 16px;
}
.tab {
  flex: 1; border: 0; background: none; font-size: 11px; font-weight: 700;
  color: var(--ink-3); display: flex; flex-direction: column; gap: 4px; align-items: center; cursor: pointer;
}
.tab svg { width: 22px; height: 22px; fill: #C3C7CD; transition: fill .15s; }
.tab.active { color: var(--kb-charcoal); }
.tab.active svg { fill: var(--kb-gold); }

/* 스캔 오버레이 */
.scan-overlay {
  position: absolute; inset: 0; z-index: 50; background: var(--kb-charcoal);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; color: #fff; transition: opacity .4s;
}
.scan-overlay.hidden { display: none; }
.scan-overlay.fade { opacity: 0; pointer-events: none; }
.radar {
  position: relative; width: 150px; height: 150px; border-radius: 50%;
  border: 1.5px solid rgba(255,188,0,.35);
  background:
    radial-gradient(circle, rgba(255,188,0,.10) 0 32%, transparent 33%),
    radial-gradient(circle, rgba(255,188,0,.07) 0 65%, transparent 66%);
}
.radar-sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255,188,0,.55), transparent 70deg);
  animation: sweep 1.6s linear infinite;
}
@keyframes sweep { to { transform: rotate(360deg); } }
.radar-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--kb-yellow); opacity: 0; animation: blip 1.6s infinite; }
.radar-dot.d1 { top: 28%; left: 62%; animation-delay: .2s; }
.radar-dot.d2 { top: 60%; left: 30%; animation-delay: .7s; }
.radar-dot.d3 { top: 44%; left: 74%; animation-delay: 1.15s; }
@keyframes blip { 0% { opacity: 0; transform: scale(.4); } 18% { opacity: 1; transform: scale(1); } 55% { opacity: .4; } 100% { opacity: 0; } }
.scan-title { font-size: 17px; font-weight: 700; }
.scan-steps { list-style: none; display: grid; gap: 10px; min-width: 250px; }
.scan-steps li {
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: #C9CDD3;
  opacity: 0; transform: translateY(6px); transition: all .3s;
}
.scan-steps li.show { opacity: 1; transform: none; }
.scan-steps li.done { color: #F6F7F8; }
.step-ico {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.step-ico .spin {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255,188,0,.25); border-top-color: var(--kb-yellow);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.scan-steps li.done .step-ico { background: var(--green); }
.scan-steps li.done .step-ico::after { content: "✓"; color: #fff; font-size: 11px; font-weight: 800; }
.scan-steps li.done .step-ico .spin { display: none; }

/* 홈 */
.hello { font-size: 14px; color: var(--ink-2); margin: 2px 2px 10px; }
.hello-sub { display: block; font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.hero {
  background: linear-gradient(135deg, var(--kb-charcoal) 0%, #3B3E44 100%);
  border-radius: var(--radius); padding: 22px 20px 18px; color: #fff; box-shadow: var(--shadow);
}
.hero-label { font-size: 12.5px; color: #EEF0F2; display: flex; align-items: center; gap: 6px; }
.hero-label .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--kb-yellow); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.hero-amount { font-size: 34px; font-weight: 800; margin: 8px 0 2px; letter-spacing: -0.01em; }
.hero-amount small { font-size: 18px; font-weight: 700; }
.hero-sub { font-size: 12.5px; color: #E6E8EB; }
.segbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 13px 0 7px; background: #4A4D53; }
.segbar span { height: 100%; }
.seglegend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 10.5px; color: #E6E8EB; }
.seglegend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.hero-cta {
  margin-top: 14px; width: 100%; border: 0; border-radius: 12px; padding: 13px;
  background: var(--kb-yellow); color: var(--kb-charcoal);
  font-size: 15px; font-weight: 800; cursor: pointer; transition: transform .12s;
}
.hero-cta:active { transform: scale(.98); }
.hero-fun {
  margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--kb-yellow);
  background: rgba(255,188,0,.12); border-radius: 8px; padding: 7px 10px; display: inline-block;
}
.urgent { color: #DC2626; font-weight: 800; font-size: 10.5px; }
.hero-cta2 {
  margin-top: 9px; width: 100%; border: 1px solid #82868D; border-radius: 12px; padding: 11px;
  background: transparent; color: #EEF0F2; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: transform .12s;
}
.hero-cta2:active { transform: scale(.98); }

/* 간이 스캔 위저드 */
.wiz-label { font-size: 11.5px; font-weight: 700; color: var(--ink-2); margin: 11px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-btn {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 999px; padding: 8px 13px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; transition: all .12s;
}
.chip-btn.on { border-color: var(--kb-gold); background: var(--kb-yellow-soft); color: var(--kb-gray); }
.wiz-num { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.wiz-input { display: flex; align-items: center; gap: 6px; }
.wiz-input input {
  width: 92px; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px;
  font-family: inherit; font-size: 14px; font-weight: 700; text-align: right; color: var(--ink);
}
.wiz-input input:focus { outline: 2px solid var(--kb-yellow); border-color: var(--kb-gold); }
.wiz-input em { font-style: normal; font-size: 11.5px; color: var(--ink-3); font-weight: 700; }

.section-title { margin: 22px 4px 10px; font-size: 15px; font-weight: 800; display: flex; justify-content: space-between; align-items: baseline; }
.section-title .hint { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }

.finding {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; gap: 12px; align-items: center; margin-bottom: 10px;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .12s;
  opacity: 0; animation: cardIn .45s cubic-bezier(.2,.9,.3,1) forwards;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.finding:active { transform: scale(.985); }
.f-icon {
  width: 44px; height: 44px; border-radius: 14px; background: var(--kb-yellow-soft);
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none;
}
.f-main { flex: 1; min-width: 0; }
.f-name { font-size: 14.5px; font-weight: 700; }
.f-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.f-amount { text-align: right; flex: none; }
.f-amount b { font-size: 15px; color: var(--kb-gray); }
.f-amount .state { display: block; font-size: 10.5px; margin-top: 3px; font-weight: 700; }
.state.ready { color: var(--green); }
.state.done { color: var(--ink-3); }
.finding.near { opacity: 0; background: #FFFDF4; }
.finding.near .f-icon { background: var(--amber-soft); }
.near-badge { color: var(--amber); font-size: 10.5px; font-weight: 800; }

.trust-strip {
  margin-top: 18px; background: var(--green-soft); border-radius: 12px; padding: 11px 13px;
  font-size: 11.5px; color: #14532D; line-height: 1.55;
}

/* 에이전트 활동 */
.timeline { position: relative; margin: 6px 4px; }
.tl-item { display: flex; gap: 12px; padding: 10px 0; }
.tl-time { width: 74px; flex: none; font-size: 11px; color: var(--ink-3); padding-top: 3px; }
.tl-card { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); }
.tl-title { font-size: 13px; font-weight: 700; }
.tl-action { font-size: 12px; color: var(--kb-gray); margin-top: 3px; font-weight: 600; }
.pipe { margin: 8px 4px 16px; display: grid; gap: 8px; }
.pipe-step { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); }
.pipe-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; }
.chip { font-size: 10px; font-weight: 800; border-radius: 999px; padding: 3px 8px; }
.chip.det { background: var(--green-soft); color: var(--green); }
.chip.llm { background: var(--kb-yellow-soft); color: var(--amber); }
.pipe-detail { font-size: 11.5px; color: var(--ink-2); margin-top: 4px; }
.pipe-engine { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }

/* 신뢰 설계 */
.about-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.about-card h3 { font-size: 14.5px; margin-bottom: 6px; }
.about-card p { font-size: 12.5px; color: var(--ink-2); line-height: 1.65; }
.about-card .tag { display: inline-block; font-size: 10.5px; font-weight: 800; color: var(--kb-gray); background: var(--kb-yellow-soft); border-radius: 6px; padding: 2px 7px; margin-bottom: 7px; }

/* 바텀시트 (상세) */
.sheet { position: absolute; inset: 0; z-index: 30; }
.sheet.hidden { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20,21,24,.45); }
.sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88%;
  background: var(--bg); border-radius: 24px 24px 0 0; overflow-y: auto;
  padding: 10px 16px 28px; animation: rise .28s cubic-bezier(.2,.9,.3,1);
}
@keyframes rise { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 44px; height: 5px; border-radius: 3px; background: #D7D9DE; margin: 6px auto 14px; }
.d-head { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.d-title { font-size: 18px; font-weight: 800; }
.d-amount { font-size: 26px; font-weight: 800; color: var(--kb-gray); margin: 6px 0 2px; }
.d-note { font-size: 11.5px; color: var(--ink-3); margin-bottom: 12px; }
.d-block { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.d-block h4 { font-size: 13px; margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
table.trace { width: 100%; border-collapse: collapse; font-size: 11.5px; }
table.trace th { text-align: left; color: var(--ink-3); font-weight: 700; padding: 4px 6px; border-bottom: 1px solid var(--line); }
table.trace td { padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.trace tr:last-child td { border-bottom: 0; }
table.trace tr.reveal td { animation: rowIn .35s ease forwards; opacity: 0; }
@keyframes rowIn { to { opacity: 1; } }
.ok { color: var(--green); font-weight: 800; }
.no { color: #DC2626; font-weight: 800; }
.legal { font-size: 10.5px; color: var(--ink-3); margin-top: 8px; }
.explain { font-size: 13px; line-height: 1.7; color: var(--ink); }
.doc-item { display: flex; gap: 9px; align-items: flex-start; padding: 7px 0; font-size: 12.5px; border-bottom: 1px dashed var(--line); }
.doc-item:last-child { border-bottom: 0; }
.doc-item input { margin-top: 2px; accent-color: var(--kb-gold); }
.doc-issuer { color: var(--ink-3); font-size: 11px; }
.d-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 4px; }
.btn { border: 0; border-radius: 13px; padding: 14px; font-size: 14px; font-weight: 800; cursor: pointer; transition: transform .12s; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: #fff; border: 1.5px solid var(--line); color: var(--ink-2); }
.btn.primary { background: var(--kb-yellow); color: var(--kb-charcoal); }

/* 진행 타임라인 */
.progress-steps { display: grid; gap: 0; margin-top: 6px; }
.p-step { display: flex; gap: 10px; align-items: flex-start; }
.p-rail { display: flex; flex-direction: column; align-items: center; }
.p-dot { width: 12px; height: 12px; border-radius: 50%; background: #D7D9DE; margin-top: 3px; transition: all .3s; }
.p-line { width: 2px; flex: 1; background: #E3E5E9; min-height: 22px; }
.p-step.on .p-dot { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.p-label { font-size: 12.5px; font-weight: 700; padding-bottom: 16px; }
.p-label small { display: block; font-weight: 500; color: var(--ink-3); font-size: 11px; margin-top: 2px; }
.draft-pre {
  background: #26282C; color: #E8E9EB; border-radius: 12px; padding: 14px;
  font-size: 11px; line-height: 1.65; white-space: pre-wrap; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  max-height: 300px; overflow-y: auto;
}

/* 전국 실데이터 통계 */
.nat-row { padding: 11px 0; border-bottom: 1px dashed var(--line); }
.nat-row:last-child { border-bottom: 0; }
.nat-main { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.nat-main b { font-size: 19px; color: var(--kb-gray); }
.nat-main span { font-size: 12px; font-weight: 700; color: var(--ink); }
.nat-detail { font-size: 11px; color: var(--ink-2); margin-top: 3px; line-height: 1.5; }
.nat-src { font-size: 10px; color: var(--ink-3); margin-top: 2px; }
.nat-trend { display: flex; align-items: flex-end; gap: 9px; margin-top: 8px; }
.nt-col { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.nt-col i { display: block; width: 22px; background: var(--kb-yellow); border-radius: 4px 4px 0 0; min-height: 6px; }
.nt-col em { font-style: normal; font-size: 9px; color: var(--ink-3); }
.nt-unit { font-size: 9.5px; color: var(--ink-3); align-self: flex-end; padding-bottom: 12px; }

/* 실데이터 미니 바 차트 */
.mini-bars { display: grid; gap: 7px; }
.mb-row { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.mb-name { width: 72px; flex: none; color: var(--ink-2); font-weight: 600; }
.mb-track { flex: 1; height: 9px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.mb-fill { display: block; height: 100%; background: #D7D9DE; border-radius: 5px; animation: grow .6s cubic-bezier(.2,.9,.3,1); }
.mb-fill.hl { background: var(--kb-yellow); }
@keyframes grow { from { width: 0 !important; } }
.mb-val { width: 44px; flex: none; text-align: right; font-weight: 700; color: var(--ink-3); }
.mb-val.hl { color: var(--kb-gray); }

/* 승인 모달 */
.modal { position: absolute; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20,21,24,.55); }
.modal-card {
  position: relative; width: 84%; background: #fff; border-radius: 20px; padding: 22px 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3); animation: pop .25s cubic-bezier(.2,.9,.3,1);
  text-align: center;
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-title { font-size: 16.5px; font-weight: 800; margin-bottom: 6px; }
.modal-desc { font-size: 12.5px; color: var(--ink-2); line-height: 1.65; margin-bottom: 14px; }
.modal-meta { background: var(--bg); border-radius: 12px; padding: 10px; font-size: 12px; color: var(--ink-2); margin-bottom: 16px; text-align: left; line-height: 1.7; }
.modal-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; }
.success-check { width: 74px; height: 74px; margin: 4px auto 12px; }
.success-check circle { stroke: var(--green); stroke-width: 2.6; fill: none; stroke-dasharray: 214; stroke-dashoffset: 214; animation: draw .5s ease forwards; }
.success-check path { stroke: var(--green); stroke-width: 3.4; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .35s ease .45s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.toast {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 70;
  background: var(--kb-charcoal); color: #fff; font-size: 13px; font-weight: 600;
  border-radius: 999px; padding: 11px 18px; box-shadow: var(--shadow); animation: rise .25s;
}

/* 반응형 */
@media (max-width: 980px) {
  .stage { flex-direction: column; gap: 28px; padding: 24px 12px; }
  .pitch { text-align: center; }
  .pitch h1 { font-size: 32px; }
  .pitch-points { text-align: left; }
}
@media (max-width: 470px) {
  .phone { width: 100%; height: 100dvh; border-radius: 0; box-shadow: none; }
  .pitch { display: none; }
  .stage { padding: 0; }
}
