/* =========================================================================
 * Financial Control Plane — Components
 * ======================================================================== */

/* ── Demo Control Dock (floating bottom-right) ── */
.demo-dock {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 400;
  font-family: var(--font-sans);
}
.demo-dock__toggle {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, #8A6008 100%);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(184,134,11,0.35), 0 2px 4px rgba(0,0,0,0.08);
  display: flex; align-items: center; justify-content: center;
  transition: transform 180ms var(--ease-out);
  border: none; cursor: pointer;
}
.demo-dock__toggle:hover { transform: scale(1.08) rotate(-8deg); }
.demo-dock__toggle::after {
  content: 'DEMO';
  position: absolute;
  bottom: -18px; left: 50%; transform: translateX(-50%);
  font-size: 9px; font-weight: var(--fw-bold); letter-spacing: 0.1em;
  color: var(--gold);
}
.demo-dock__panel {
  position: absolute;
  bottom: 68px; right: 0;
  width: 320px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(10,31,68,0.28), 0 2px 6px rgba(0,0,0,0.08);
  overflow: hidden;
  animation: cp-pop 220ms var(--ease-out);
}
.demo-dock__head {
  padding: 12px 14px;
  background: var(--navy-900);
  color: var(--white);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
}
.demo-dock__close {
  background: none; border: none; color: var(--navy-200);
  font-size: 22px; line-height: 1; cursor: pointer;
  padding: 0 4px;
}
.demo-dock__list { padding: 6px 4px; }
.demo-dock__item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--navy-900);
  font-size: 12.5px;
  text-decoration: none;
  transition: background 140ms;
}
.demo-dock__item:hover { background: var(--accent-50); color: var(--accent); }
.demo-dock__item-arrow { color: var(--gray-400); transition: transform 140ms; }
.demo-dock__item:hover .demo-dock__item-arrow { transform: translateX(3px); color: var(--accent); }
.demo-dock__sep { border-top: 1px solid var(--border-subtle); }
.demo-dock__speed {
  padding: 10px 12px;
  display: flex; gap: 6px; align-items: center;
  font-size: 11px;
}
.demo-dock__speed span { color: var(--text-muted); margin-right: auto; }
.demo-dock__speed button {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-default);
  background: var(--white);
  color: var(--gray-600);
  font-size: 11px; cursor: pointer;
  transition: all 140ms;
}
.demo-dock__speed button:hover { border-color: var(--accent); }
.demo-dock__speed button.is-active {
  background: var(--navy-900); color: var(--white); border-color: var(--navy-900);
}
.demo-dock__actions {
  padding: 8px 12px; display: flex; gap: 8px;
  border-top: 1px solid var(--border-subtle);
}
.demo-dock__reset, .demo-dock__home {
  flex: 1; padding: 7px 10px;
  border-radius: 5px; font-size: 11.5px;
  text-align: center; text-decoration: none;
  cursor: pointer; border: 1px solid transparent;
  transition: all 140ms;
}
.demo-dock__reset { background: var(--danger-soft); color: var(--danger); border: none; }
.demo-dock__reset:hover { background: var(--danger); color: var(--white); }
.demo-dock__home { background: var(--gray-100); color: var(--navy-900); }
.demo-dock__home:hover { background: var(--navy-900); color: var(--white); }
.demo-dock__hint {
  padding: 8px 12px;
  background: var(--gray-50);
  font-size: 10px; color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}
.demo-dock__hint kbd {
  font-family: var(--font-mono); font-size: 9px;
  padding: 1px 4px;
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: 3px;
}

/* ── Demo Input Modal ── */
.demo-input-modal .cp-modal__body { padding: 22px 24px; }
.demo-input-modal label {
  display: block; font-size: 12px; color: var(--text-muted);
  font-weight: var(--fw-medium); margin: 14px 0 4px;
}
.demo-input-modal input,
.demo-input-modal select,
.demo-input-modal textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--navy-900);
  font-family: var(--font-sans);
  transition: border 140ms;
}
.demo-input-modal input:focus,
.demo-input-modal select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}
.demo-input-modal input.mono { font-family: var(--font-mono); }
.demo-input-modal .field-hint {
  font-size: 11px; color: var(--text-muted); margin-top: 4px;
}

/* ── Demo Highlight (주목할 요소 링) ── */
@keyframes demo-ring {
  0%   { box-shadow: 0 0 0 0 rgba(184,134,11,0.6); }
  70%  { box-shadow: 0 0 0 14px rgba(184,134,11,0); }
  100% { box-shadow: 0 0 0 0 rgba(184,134,11,0); }
}
.demo-highlight {
  position: relative;
  animation: demo-ring 1.5s ease-out infinite;
  border-radius: var(--r-md);
}

/* ── Demo progress (상태머신 진행 애니메이션 보조) ── */
.demo-progress-bar {
  height: 6px;
  background: var(--gray-100);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.demo-progress-bar::after {
  content: '';
  position: absolute; top: 0; bottom: 0; left: 0;
  background: linear-gradient(90deg, var(--accent), var(--navy-700));
  animation: demo-progress-fill 2000ms linear forwards;
  border-radius: 3px;
}
@keyframes demo-progress-fill {
  from { width: 0%; }
  to   { width: 100%; }
}

/* Pulsing dot for "current step" */
@keyframes demo-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(1.25); }
}

/* ── Modal (CP.showModal) ── */
.cp-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,31,68,0.55);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  animation: cp-fade 180ms ease-out;
}
@keyframes cp-fade { from { opacity: 0; } to { opacity: 1; } }
.cp-modal {
  background: #fff;
  border-radius: 12px;
  width: min(560px, 92vw);
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(10,31,68,0.35);
  display: flex; flex-direction: column;
  animation: cp-pop 240ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes cp-pop {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.cp-modal__head {
  padding: 18px 22px;
  border-bottom: 1px solid #E2E8F0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.cp-modal__title {
  font-size: 16px; font-weight: 600; color: #0A1F44;
  display: flex; align-items: center; gap: 10px;
}
.cp-modal__icon {
  width: 28px; height: 28px;
  background: #EBF2FA;
  color: #1E5C97;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.cp-modal__close {
  width: 32px; height: 32px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #64748B;
  transition: all 140ms;
}
.cp-modal__close:hover { background: #F1F5F9; color: #0A1F44; }
.cp-modal__body {
  padding: 20px 22px;
  overflow-y: auto;
  color: #334155;
  font-size: 13.5px;
  line-height: 1.6;
}
.cp-modal__body h4 {
  font-size: 13px; font-weight: 600; color: #0A1F44;
  margin: 14px 0 6px; padding-top: 8px;
  border-top: 1px dashed #E2E8F0;
}
.cp-modal__body h4:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.cp-modal__body ul { margin: 6px 0 10px 20px; }
.cp-modal__body li { margin: 4px 0; }
.cp-modal__body .kv {
  display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px;
  font-size: 13px; padding: 4px 0;
}
.cp-modal__body .kv span:first-child { color: #64748B; font-size: 12px; padding-top: 2px; }
.cp-modal__body .kv strong { color: #0A1F44; font-weight: 500; font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.cp-modal__foot {
  padding: 12px 22px;
  border-top: 1px solid #E2E8F0;
  display: flex; justify-content: flex-end; gap: 8px;
  background: #F8FAFC;
}


/* ── Cards ── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur-fast);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card--compact { padding: var(--sp-4); }
.card--no-pad { padding: 0; }
.card--navy   { background: var(--navy-900); color: var(--text-inverse); border-color: var(--navy-700); }

.card__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-4);
  gap: var(--sp-3);
}
.card__title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--navy-900);
}
.card__sub {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 2px;
}
.card--navy .card__title { color: var(--white); }
.card--navy .card__sub   { color: var(--navy-200); }

/* ── KPI Card ── */
.kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
}
.kpi.success::before { background: var(--success); }
.kpi.warning::before { background: var(--warning); }
.kpi.danger::before  { background: var(--danger); }
.kpi.gold::before    { background: var(--gold); }

.kpi__label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: var(--fw-medium);
  margin-bottom: var(--sp-2);
}
.kpi__value {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  color: var(--navy-900);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.kpi__value .unit {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: var(--fw-medium);
  margin-left: 4px;
}
.kpi__trend {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--success);
  font-weight: var(--fw-medium);
}
.kpi__trend.down { color: var(--danger); }
.kpi__foot {
  margin-top: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ── Status badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  font-family: var(--font-sans);
}
.badge--success { background: var(--success-soft); color: #065F46; }
.badge--warning { background: var(--warning-soft); color: #92400E; }
.badge--danger  { background: var(--danger-soft);  color: #991B1B; }
.badge--info    { background: var(--info-soft);    color: #1E40AF; }
.badge--navy    { background: var(--navy-50);      color: var(--navy-900); }
.badge--gold    { background: var(--gold-50);      color: var(--gold); }
.badge--mono    { background: var(--gray-100);     color: var(--gray-700); font-family: var(--font-mono); }

.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.dot--success { background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.dot--warning { background: var(--warning); box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.dot--danger  { background: var(--danger);  box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
.dot--info    { background: var(--info);    box-shadow: 0 0 0 3px rgba(59,130,246,0.2); }

.dot.pulsing { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(1.2); }
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  transition: all var(--dur-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn--primary {
  background: var(--navy-900);
  color: var(--white);
}
.btn--primary:hover { background: var(--navy-800); }
.btn--secondary {
  background: var(--white);
  color: var(--navy-900);
  border-color: var(--border-default);
}
.btn--secondary:hover { background: var(--gray-50); border-color: var(--navy-500); }
.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn--ghost:hover { background: var(--gray-100); color: var(--navy-900); }
.btn--gold {
  background: var(--gold);
  color: var(--white);
}
.btn--gold:hover { background: #A3770A; }
.btn--danger {
  background: var(--danger);
  color: var(--white);
}
.btn--success {
  background: var(--success);
  color: var(--white);
}
.btn--sm { padding: 4px var(--sp-3); font-size: var(--fs-xs); }
.btn--lg { padding: var(--sp-3) var(--sp-5); font-size: var(--fs-md); }

/* ── Tables ── */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
}
.tbl thead th {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  background: var(--gray-50);
  color: var(--text-secondary);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.tbl tbody td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}
.tbl tbody tr { transition: background var(--dur-fast); }
.tbl tbody tr:hover { background: var(--gray-50); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .mono { font-family: var(--font-mono); font-size: var(--fs-sm); }

/* Hash pill */
.hash {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px var(--sp-2);
  background: var(--bg-mono);
  color: var(--accent);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: all var(--dur-fast);
}
.hash:hover { background: var(--accent-50); border-color: var(--accent-200); }

/* ── Subsystem Tile (9-grid cockpit) ── */
.cockpit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}
.tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.tile__icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--accent-50);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-3);
}
.tile__name {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--navy-900);
  margin-bottom: var(--sp-1);
}
.tile__sub {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
  min-height: 2em;
  line-height: 1.3;
}
.tile__metric {
  display: flex; align-items: baseline; gap: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-subtle);
}
.tile__metric-value {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
}
.tile__metric-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-left: auto;
}

/* ── Live event stream ── */
.feed {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--bg-surface);
}
.feed__row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--fs-sm);
  animation: slide-in var(--dur-slow) var(--ease-out);
}
.feed__row:last-child { border-bottom: none; }
@keyframes slide-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.feed__time { color: var(--text-muted); font-family: var(--font-mono); font-size: var(--fs-xs); min-width: 60px; }
.feed__ev   { font-family: var(--font-mono); color: var(--accent); font-size: var(--fs-xs); }
.feed__text { flex: 1; color: var(--text-primary); }
.feed__tenant {
  padding: 1px var(--sp-2); border-radius: var(--r-sm);
  font-size: 10px; font-weight: var(--fw-semibold);
}
.feed__tenant.bank       { background: rgba(30,92,151,0.1); color: var(--track-bank); }
.feed__tenant.securities { background: rgba(184,134,11,0.1); color: var(--track-securities); }
.feed__tenant.foreign    { background: rgba(107,123,140,0.15); color: var(--track-foreign); }

/* ── Progress / Gauge ── */
.progress {
  height: 8px;
  background: var(--gray-100);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--navy-500) 100%);
  border-radius: var(--r-full);
  transition: width var(--dur-slow) var(--ease-out);
}
.progress__bar.success { background: var(--success); }
.progress__bar.warning { background: var(--warning); }
.progress__bar.danger  { background: var(--danger); }
.progress__bar.gold    { background: var(--gold); }

/* PoR Gauge (large) */
.gauge {
  display: flex; flex-direction: column; align-items: center;
  padding: var(--sp-4);
}
.gauge__value {
  font-size: 48px;
  font-weight: var(--fw-bold);
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
}
.gauge__unit {
  font-size: var(--fs-md);
  color: var(--text-muted);
  margin-top: var(--sp-1);
}
.gauge__label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-top: var(--sp-2);
}

/* ── Grid helpers ── */
.grid { display: grid; gap: var(--sp-4); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid.cols-6 { grid-template-columns: repeat(6, 1fr); }
.grid.gap-lg { gap: var(--sp-6); }
.grid.gap-sm { gap: var(--sp-3); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }
.w-full { width: 100%; }

/* ── Truth Hierarchy Row ── */
.truth-layers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-3);
  position: relative;
}
.truth-layers::before {
  content: '';
  position: absolute;
  top: 28px;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--navy-300), var(--gold));
  z-index: 0;
}
.truth-layer {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  position: relative;
  z-index: 1;
  text-align: center;
}
.truth-layer__dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  margin: 0 auto var(--sp-3);
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(16,185,129,0.2), 0 0 0 1px var(--white);
}
.truth-layer.conflict .truth-layer__dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(239,68,68,0.25), 0 0 0 1px var(--white);
  animation: pulse 1.2s infinite;
}
.truth-layer__name {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--navy-900);
}
.truth-layer__source {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}
.truth-layer__detail {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px dashed var(--border-subtle);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  text-align: left;
}

/* ── Flow Canvas (SVG wrapper) ── */
.flow-canvas {
  background: linear-gradient(to bottom right, var(--gray-50), var(--white));
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  overflow: auto;
  min-height: 440px;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(10,31,68,0.08) 1px, transparent 0);
  background-size: 20px 20px;
}

/* Flow step box (used by flow canvases) */
.flow-step {
  display: inline-flex; flex-direction: column;
  background: var(--white);
  border: 2px solid var(--border-default);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  min-width: 140px;
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-base);
}
.flow-step.current {
  border-color: var(--accent);
  background: var(--accent-50);
  box-shadow: 0 0 0 4px rgba(30,92,151,0.15);
}
.flow-step.done {
  border-color: var(--success);
  background: rgba(16,185,129,0.06);
}
.flow-step.failed {
  border-color: var(--danger);
  background: rgba(239,68,68,0.06);
}
.flow-step__num {
  font-size: 10px;
  font-weight: var(--fw-bold);
  color: var(--accent);
  letter-spacing: 0.05em;
}
.flow-step__title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--navy-900);
  margin-top: 2px;
}
.flow-step__meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* ── Approval card ── */
.approval-card {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--gold);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-sm);
}
.approval-card__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: var(--sp-3);
}
.approval-card__title {
  font-weight: var(--fw-semibold);
  color: var(--navy-900);
  font-size: var(--fs-md);
}
.approval-card__id {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.approval-card__expiry {
  font-size: var(--fs-xs);
  color: var(--warning);
  font-weight: var(--fw-medium);
}
.approval-card__signers {
  display: flex; gap: var(--sp-2);
  margin: var(--sp-3) 0;
}
.signer-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: var(--r-full);
  background: var(--gray-100);
  font-size: var(--fs-xs);
  color: var(--gray-600);
  border: 1px solid var(--border-subtle);
}
.signer-chip.signed {
  background: var(--success-soft);
  color: #065F46;
  border-color: rgba(16,185,129,0.3);
}
.signer-chip.pending {
  background: var(--gray-100);
  color: var(--text-muted);
}
.signer-chip.signed::before { content: '✓'; font-weight: bold; }

/* ── Chart wrapper ── */
.chart {
  position: relative;
  width: 100%;
  height: 280px;
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: var(--sp-5); right: var(--sp-5);
  z-index: var(--z-toast);
  display: flex; flex-direction: column;
  gap: var(--sp-2);
}
.toast {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--info);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  min-width: 280px;
  animation: slide-in 300ms var(--ease-out);
}
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.danger  { border-left-color: var(--danger); }

/* ── Overlay strip (외부 원장 위 표시) ── */
.overlay-strip {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: var(--white);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  margin-bottom: var(--sp-5);
  position: relative;
  overflow: hidden;
}
.overlay-strip::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
  opacity: 0.15;
}
.overlay-strip__label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  color: var(--gold);
  letter-spacing: 0.06em;
  font-weight: var(--fw-semibold);
  margin-bottom: 2px;
}
.overlay-strip__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
}
.overlay-strip__desc {
  font-size: var(--fs-sm);
  color: var(--navy-200);
  margin-top: 4px;
}
.overlay-strip__link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs);
  color: var(--gold);
  margin-top: var(--sp-2);
}

/* ── Rail health cell ── */
.rail-cell {
  padding: var(--sp-2) var(--sp-3);
  text-align: center;
  font-size: var(--fs-sm);
  border-radius: var(--r-sm);
  font-variant-numeric: tabular-nums;
}
.rail-cell.healthy  { background: rgba(16,185,129,0.08); color: #065F46; }
.rail-cell.watch    { background: rgba(245,158,11,0.12); color: #92400E; }
.rail-cell.critical { background: rgba(239,68,68,0.1); color: #991B1B; }

/* ── Incident state machine ── */
.state-machine {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4);
}
.state-node {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--sp-2);
  flex: 1;
  position: relative;
}
.state-node__circle {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border-default);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: var(--fw-bold);
  color: var(--text-muted);
}
.state-node.current .state-node__circle {
  border-color: var(--warning);
  background: var(--warning);
  color: var(--white);
  box-shadow: 0 0 0 6px rgba(245,158,11,0.2);
  animation: pulse 1.5s infinite;
}
.state-node.done .state-node__circle {
  border-color: var(--success);
  background: var(--success);
  color: var(--white);
}
.state-node__label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--navy-900);
}
.state-machine__arrow {
  flex: 0 0 40px;
  height: 2px;
  background: var(--border-default);
  position: relative;
}
.state-machine__arrow::after {
  content: '▶';
  position: absolute;
  right: -8px; top: -9px;
  color: var(--border-default);
  font-size: 12px;
}

/* ── Overlay layer badge ── */
.overlay-layer {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--gray-50);
  border: 1px dashed var(--border-default);
  border-radius: var(--r-md);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}
.overlay-layer strong { color: var(--navy-900); font-weight: var(--fw-semibold); }

/* ── Section header ── */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-4);
}
.section-head__title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  color: var(--navy-900);
  display: flex; align-items: center; gap: var(--sp-2);
}
.section-head__actions { display: flex; gap: var(--sp-2); }

/* Utility colors */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-muted   { color: var(--text-muted); }
.text-gold    { color: var(--gold); }
.text-navy    { color: var(--navy-900); }
