/* 은행 이탈 고객 예측 데모 — Linear 다크 대시보드 (포트폴리오와 통일) */
:root {
  /* 포트폴리오 global.css 토큰과 동일 */
  --bg:          #010102;
  --bg-surface:  #0f1011;
  --bg-elevated: #141516;
  --ink:         #f7f8f8;
  --ink-2:       #d0d6e0;
  --muted:       #8a8f98;
  --line:        rgba(255,255,255,0.08);
  --line-mid:    rgba(255,255,255,0.12);
  --accent:      #5e6ad2;
  --accent-2:    #7877c6;
  --accent-light:#ba9cff;
  --accent-pale: rgba(94,106,210,0.15);
  --danger:      #f0a83d; /* 이탈 위험 — status-progress 앰버 */
  --safe:        #5ecf6d; /* 유지 예상 — status-completed 그린 */

  --font-sans: "Pretendard","Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --font-mono: "JetBrains Mono","Roboto Mono",ui-monospace,monospace;

  color-scheme: dark; /* select·number·range·radio 등 네이티브 컨트롤을 다크로 렌더 */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

/* ── Shell ── */
.dash {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 24px 32px;
}

/* ── Toolbar ── */
.dash-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.dash-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent-2);
  text-transform: uppercase;
}
.dash-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.dash-live .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-light);
  animation: pulse 2.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

/* ── Grid ── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: start;
}
.dash-inputs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Panels (포트폴리오 .profile-card / .strength-card 언어) ── */
.panel {
  position: relative;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 16px 20px 20px;
}
.panel::before {
  content: attr(data-kicker);
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}
.field { margin: 0; min-width: 0; }
.field--wide { grid-column: 1 / -1; }

.field > label,
.field > legend {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
  padding: 0;
}
.field output {
  color: var(--accent-light);
  font-weight: 600;
  font-family: var(--font-mono);
  margin-left: 4px;
}

/* number stepper */
.stepper { position: relative; display: flex; align-items: center; }
.stepper input[type="number"] {
  flex: 1;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 8px;
  padding: 11px 92px 11px 14px;
  font-size: 0.95rem;
  color: var(--ink);
  -moz-appearance: textfield;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.stepper input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(94,106,210,0.25);
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.step {
  position: absolute;
  width: 38px;
  height: calc(100% - 10px);
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  border-left: 1px solid var(--line);
  transition: color 0.15s;
}
.step[data-dir="-1"] { right: 44px; }
.step[data-dir="1"]  { right: 5px; }
.step:hover { color: var(--ink); }

/* range slider */
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 6px;
  margin-top: 4px;
}

/* select */
select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(94,106,210,0.25);
}

/* radios → segmented buttons */
fieldset.field { border: none; margin: 0; padding: 0; min-width: 0; }
.radios { display: flex; gap: 8px; }
.radio {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.9rem;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.radio input { accent-color: var(--accent); margin: 0; }
.radio:hover { border-color: var(--line-mid); }
.radio:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-pale);
  color: var(--ink);
}

/* ── Result panel (sticky) ── */
.dash-result { position: sticky; top: 20px; align-self: start; }
.dash-status {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  padding: 6px 0;
}
.result-body.hidden { display: none; }

.verdict {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.4;
  margin-bottom: 18px;
}
.verdict.churn { color: var(--danger); }
.verdict.stay  { color: var(--safe); }

.proba-wrap { display: flex; flex-direction: column; gap: 3px; margin-bottom: 14px; }
.proba-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.proba {
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}

.gauge {
  height: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.gauge-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s ease, background 0.2s ease;
}
.gauge-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--muted);
}

/* ── Responsive ── */
@media (max-width: 720px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-result { position: static; order: -1; }
}
@media (max-width: 460px) {
  .panel-fields { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
}
