/* ======================================================================
   Glasshouse / Quanty — design-v2 shared tokens & components
   A 패키지 (A.1 Landing · A.2 Onboarding · A.3 Result)
   compliance-demo.html 시각 정합 · DEC-019 vanilla 단일 · DEC-027 토큰
   ====================================================================== */
@import url('https://cdn.jsdelivr.net/npm/pretendard/dist/web/static/pretendard.min.css');

:root {
  /* ─── Brand (lock — DEC-027) ─── */
  --quanty-primary:        #5B3DF5;
  --quanty-primary-dark:   #4A2FE8;
  --quanty-primary-soft:   #EEEAFF;
  --quanty-primary-soft-2: #F6F3FF;
  --quanty-mint:           #00D9A3;
  --quanty-mint-soft:      #E0FAF1;
  --quanty-coral:          #FF5C7A;
  --quanty-coral-soft:     #FFE9EE;
  --quanty-amber:          #FFB020;
  --quanty-amber-soft:     #FFF4DE;

  /* ─── Neutral (light) ─── */
  --ink:        #0A0A1A;
  --ink-2:      #1F1F2E;
  --text:       #2C2C3A;
  --text-mid:   #6B6B7B;
  --text-sub:   #9B9BAB;
  --text-faint: #C4C4D1;
  --border:     #EDEDF2;
  --border-strong: #E0E0E8;
  --bg:         #F7F7FB;
  --bg-card:    #FFFFFF;

  /* ─── Distribution ─── */
  --dist-band:   rgba(91, 61, 245, 0.14);
  --dist-edge:   rgba(91, 61, 245, 0.28);

  /* ─── Radii ─── */
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-xxl: 36px;
  --r-pill: 999px;

  /* ─── Shadows ─── */
  --shadow-soft: 0 2px 8px rgba(91,61,245,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-card: 0 4px 16px rgba(20,18,50,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-pop:  0 16px 40px rgba(91,61,245,0.18), 0 4px 12px rgba(91,61,245,0.10);
  --shadow-cta:  0 12px 28px rgba(91,61,245,0.30);

  /* ─── Type ─── */
  --font: "Pretendard Variable", Pretendard, -apple-system, "SF Pro",
          "Apple SD Gothic Neo", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ─── Motion ─── */
  --t-quick: 120ms;
  --t-base:  220ms;
  --t-slow:  360ms;
  --ease:    cubic-bezier(0.2, 0.8, 0.2, 1);

  /* ─── Layout ─── */
  --shell-max: 720px;          /* mobile-first stretch */
  --shell-pad-x: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-feature-settings: "ss10";
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; color: var(--ink); letter-spacing: -0.025em; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
input, textarea, select { font-family: inherit; }

/* ─── Motion primitives ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translate3d(0, 12px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes shimmerSweep {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.fade-up { animation: fadeUp var(--t-base) var(--ease) both; }
.fade-up.s1 { animation-delay: 80ms; }
.fade-up.s2 { animation-delay: 160ms; }
.fade-up.s3 { animation-delay: 240ms; }
.fade-up.s4 { animation-delay: 320ms; }
.fade-up.s5 { animation-delay: 400ms; }
.fade-up.s6 { animation-delay: 480ms; }
.fade-up.s7 { animation-delay: 560ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── App shell ─── */
.shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--shell-pad-x);
}
.page {
  min-height: 100vh;
  padding-top: calc(var(--safe-top) + 16px);
  padding-bottom: calc(var(--safe-bot) + 40px);
}

/* ─── Top app bar ─── */
.appbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-top);
}
.appbar-inner {
  max-width: var(--shell-max); margin: 0 auto;
  padding: 12px var(--shell-pad-x);
  display: flex; align-items: center; gap: 10px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 15px; letter-spacing: -0.02em; color: var(--ink);
  text-decoration: none;
}
.brand-glyph {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--quanty-primary) 0%, #7B5DFF 100%);
  color: #fff; font-weight: 800; font-size: 16px; letter-spacing: -0.04em;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--quanty-primary) 40%, transparent);
}
.brand-name { font-weight: 800; }
.brand-sub  { font-weight: 600; color: var(--text-mid); margin-left: 2px; }
.appbar-spacer { flex: 1; }
.beta-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--quanty-primary-soft); color: var(--quanty-primary);
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em;
}
.beta-pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--quanty-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--quanty-primary) 22%, transparent);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 22px; border: none;
  border-radius: var(--r-md); background: var(--bg-card); color: var(--ink);
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
  transition: transform var(--t-quick) var(--ease), box-shadow var(--t-quick) var(--ease),
    background var(--t-quick) var(--ease);
}
.btn:hover { transform: translate3d(0,-1px,0); }
.btn:active { transform: translate3d(0,0,0); }
.btn-primary {
  background: var(--quanty-primary); color: #fff;
  box-shadow: var(--shadow-cta);
}
.btn-primary:hover { background: var(--quanty-primary-dark); box-shadow: var(--shadow-pop); }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--border-strong); height: 44px; padding: 0 16px; }
.btn-ghost:hover { background: var(--quanty-primary-soft-2); border-color: var(--quanty-primary); color: var(--quanty-primary); }
.btn-block { display: flex; width: 100%; }
.btn-tall { height: 56px; font-size: 16px; }

/* ─── Card ─── */
.card {
  background: var(--bg-card); border-radius: var(--r-lg);
  padding: 22px; box-shadow: var(--shadow-card);
}
.card.tight  { padding: 16px; }
.card.flat   { box-shadow: none; border: 1px solid var(--border); }

/* ─── Chip ─── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 12px; font-weight: 700; color: var(--text-mid);
}
.chip-brand { background: var(--quanty-primary-soft); color: var(--quanty-primary); border-color: transparent; }
.chip-mint  { background: var(--quanty-mint-soft); color: #0E7A5C; border-color: transparent; }
.chip-amber { background: var(--quanty-amber-soft); color: #8A5A00; border-color: transparent; }
.chip-dot   { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ============================================================
   A.5 — Disclaimer box (lock)
   ============================================================ */
.disclaimer {
  margin-top: 16px;
  background: var(--quanty-amber-soft);
  border: 1px solid color-mix(in srgb, var(--quanty-amber) 20%, var(--border));
  border-radius: var(--r-md);
  padding: 14px 14px 14px 38px;
  position: relative;
  font-size: 11px; line-height: 1.7; color: var(--ink-2);
}
.disclaimer::before {
  content: 'ⓘ';
  position: absolute; left: 14px; top: 14px;
  width: 18px; height: 18px;
  font-size: 14px; line-height: 18px;
  color: #8A5A00;
  font-weight: 800;
}
.disclaimer-tag {
  display: inline-block;
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: #8A5A00;
  margin-bottom: 4px;
}

/* Inline 1-liner variant */
.disclaimer-line {
  font-size: 11px; line-height: 1.6; color: var(--text-mid);
  padding: 8px 12px; border-left: 2px solid var(--text-faint);
  background: transparent;
}

/* ============================================================
   A.4 — Copy compare card (블랙박스 vs 유리상자)
   ============================================================ */
.copy-compare {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
@media (max-width: 640px) { .copy-compare { grid-template-columns: 1fr; } }

.cc-cell {
  border-radius: var(--r-md); padding: 18px 18px 16px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
}
.cc-cell.bad {
  border-color: color-mix(in srgb, var(--quanty-coral) 35%, var(--border));
  background: var(--quanty-coral-soft);
}
.cc-cell.good {
  border-color: color-mix(in srgb, var(--quanty-mint) 35%, var(--border));
  background: var(--quanty-mint-soft);
}
.cc-tag {
  display: inline-flex; align-self: flex-start;
  align-items: center; gap: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--r-pill);
}
.cc-cell.bad  .cc-tag { background: rgba(255,92,122,0.20); color: #B0263F; }
.cc-cell.good .cc-tag { background: rgba(0,217,163,0.24); color: #0E7A5C; }
.cc-headline {
  font-size: 22px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.025em; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.cc-headline .num { color: var(--quanty-coral); font-size: 32px; }
.cc-cell.good .cc-headline .num { color: var(--quanty-primary); }
.cc-headline .sub-num {
  font-size: 13px; color: var(--text-mid); font-weight: 700; margin-left: 4px;
}
.cc-mini-chart {
  height: 36px; width: 100%;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--quanty-primary) 18%, transparent) 0%,
      color-mix(in srgb, var(--quanty-primary) 28%, transparent) 50%,
      color-mix(in srgb, var(--quanty-primary) 18%, transparent) 100%);
  border-radius: var(--r-sm);
  position: relative; overflow: hidden;
}
.cc-mini-chart::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg,
      transparent 0%,
      transparent 8%,
      var(--quanty-primary) 8%,
      var(--quanty-primary) 8.5%,
      transparent 8.5%);
  /* p50 line — drawn via SVG inline in HTML where needed */
}
.cc-desc {
  font-size: 12px; line-height: 1.6; color: var(--text-mid);
}
.cc-foot {
  margin-top: 16px;
  font-size: 12px; color: var(--text-mid); line-height: 1.6;
  text-align: center;
}
.cc-foot strong { color: var(--quanty-primary); font-weight: 800; }

/* ============================================================
   Form controls (used by A.2)
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.form-help  { font-size: 11.5px; color: var(--text-sub); line-height: 1.5; }

.form-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-mid); font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  margin: 28px 0 12px;
}
.form-divider::before, .form-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.input-text {
  width: 100%; height: 52px; padding: 0 16px;
  border-radius: var(--r-md); border: 1.5px solid var(--border);
  background: var(--bg-card); color: var(--ink);
  font-size: 16px; font-weight: 700; letter-spacing: -0.005em;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--t-quick) var(--ease), box-shadow var(--t-quick) var(--ease);
}
.input-text:focus {
  outline: none; border-color: var(--quanty-primary);
  box-shadow: 0 0 0 4px var(--quanty-primary-soft);
}
.input-text::placeholder { color: var(--text-faint); font-weight: 600; }
.input-text.has-error {
  border-color: var(--quanty-coral);
  box-shadow: 0 0 0 4px var(--quanty-coral-soft);
}
.input-with-suffix { position: relative; }
.input-with-suffix .suffix {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: var(--text-mid); font-size: 13px; font-weight: 700; pointer-events: none;
}

/* Slider */
.slider-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 6px;
}
.slider-val {
  font-size: 28px; font-weight: 800; color: var(--quanty-primary);
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.slider-val .unit { font-size: 14px; color: var(--text-mid); margin-left: 4px; }
.slider-min-max { font-size: 11px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.slider-range {
  width: 100%; -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 3px;
  background: var(--border); outline: none;
}
.slider-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--quanty-primary);
  border: 3px solid var(--bg-card);
  box-shadow: var(--shadow-soft), 0 0 0 4px color-mix(in srgb, var(--quanty-primary) 18%, transparent);
  cursor: pointer;
}
.slider-range::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--quanty-primary); border: 3px solid var(--bg-card);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

/* Chip selector (성별, FIRE 시점) */
.chip-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
}
.chip-pick {
  border: 1.5px solid var(--border); background: var(--bg-card);
  border-radius: var(--r-md); padding: 14px 8px;
  font-family: var(--font); font-size: 13.5px; font-weight: 700; color: var(--text);
  text-align: center; line-height: 1.4;
  transition: all var(--t-quick) var(--ease);
}
.chip-pick:hover { border-color: var(--quanty-primary); background: var(--quanty-primary-soft-2); }
.chip-pick[aria-pressed="true"] {
  background: var(--quanty-primary); border-color: var(--quanty-primary); color: #fff;
  box-shadow: var(--shadow-soft);
}
.chip-pick .chip-pick-sub {
  display: block; font-size: 11px; font-weight: 600; color: var(--text-sub); margin-top: 2px;
}
.chip-pick[aria-pressed="true"] .chip-pick-sub { color: rgba(255,255,255,0.8); }

/* Card pick (공격성 3종) */
.card-grid {
  display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 480px) { .card-grid { grid-template-columns: 1fr; } }
.card-pick {
  border: 1.5px solid var(--border); background: var(--bg-card);
  border-radius: var(--r-md); padding: 16px 14px;
  font-family: var(--font); text-align: left;
  display: flex; flex-direction: column; gap: 6px;
  transition: all var(--t-quick) var(--ease);
}
.card-pick:hover { border-color: var(--quanty-primary); background: var(--quanty-primary-soft-2); }
.card-pick[aria-pressed="true"] {
  border-color: var(--quanty-primary); background: var(--quanty-primary-soft-2);
  box-shadow: var(--shadow-soft);
}
.card-pick .cp-name {
  font-size: 15px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em;
}
.card-pick[aria-pressed="true"] .cp-name { color: var(--quanty-primary); }
.card-pick .cp-desc { font-size: 11.5px; color: var(--text-mid); line-height: 1.5; }
.card-pick .cp-bar {
  height: 4px; border-radius: 2px; margin-top: 6px;
  background: linear-gradient(90deg, var(--quanty-mint) 0%, var(--quanty-amber) 50%, var(--quanty-coral) 100%);
  position: relative;
}
.card-pick .cp-bar::after {
  content: ''; position: absolute; top: -4px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--quanty-primary);
  border: 2px solid var(--bg-card); box-shadow: 0 0 0 1.5px var(--quanty-primary);
}
.card-pick[data-level="conservative"] .cp-bar::after { left: 8%; }
.card-pick[data-level="moderate"]    .cp-bar::after { left: calc(50% - 6px); }
.card-pick[data-level="aggressive"]  .cp-bar::after { left: calc(92% - 12px); }

/* Toast (검증 에러) */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bot) + 20px);
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 12px 16px 12px 14px; border-radius: var(--r-md);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-pop);
  max-width: calc(100% - 32px); z-index: 50;
  animation: fadeUp var(--t-base) var(--ease) both;
}
.toast::before {
  content: '!'; flex: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--quanty-coral); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
}

/* ============================================================
   Hero (A.1)
   ============================================================ */
.hero { padding: 32px 0 8px; }
.hero h1 {
  font-size: clamp(30px, 7vw, 44px); font-weight: 800;
  line-height: 1.18; letter-spacing: -0.035em;
  margin-top: 18px;
}
.hero h1 .accent { color: var(--quanty-primary); }
.hero .lede {
  margin-top: 16px; font-size: 16px; line-height: 1.6;
  color: var(--text-mid); max-width: 560px;
}
.hero .cta-row {
  margin-top: 28px; display: flex; flex-direction: column; gap: 10px;
}
@media (min-width: 480px) {
  .hero .cta-row { flex-direction: row; align-items: center; }
  .hero .cta-row .btn-primary { min-width: 220px; }
}
.hero .cta-meta { font-size: 12px; color: var(--text-sub); }

/* Feature grid (A.1) */
.feature-grid {
  margin-top: 44px;
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .feature-grid { grid-template-columns: 1fr 1fr; } }

.feature {
  background: var(--bg-card); border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; gap: 10px;
}
.feature-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--quanty-primary-soft); color: var(--quanty-primary);
  display: flex; align-items: center; justify-content: center;
}
.feature-title { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.feature-desc { font-size: 13px; color: var(--text-mid); line-height: 1.6; }
.feature-meta {
  font-size: 11px; color: var(--text-sub);
  font-family: var(--font-mono); letter-spacing: 0;
}

/* Backtest placeholder card (A.1) */
.backtest-placeholder {
  margin-top: 44px;
  background:
    linear-gradient(135deg, var(--quanty-primary-soft-2) 0%, var(--bg-card) 100%);
  border-radius: var(--r-lg); padding: 24px;
  border: 1px dashed var(--border-strong);
}
.placeholder-skeleton {
  height: 120px; border-radius: var(--r-md); margin-top: 14px;
  background: linear-gradient(90deg,
    var(--bg) 0%,
    color-mix(in srgb, var(--quanty-primary) 8%, var(--bg)) 50%,
    var(--bg) 100%);
  background-size: 200% 100%;
  animation: shimmerSweep 1800ms linear infinite;
}

/* ============================================================
   Section + Eyebrow (shared)
   ============================================================ */
.section { margin-top: 56px; scroll-margin-top: 76px; }
.section-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--quanty-primary);
}
.section-eyebrow::before {
  content: ''; width: 22px; height: 2px; background: var(--quanty-primary); border-radius: 2px;
}
.section h2 {
  font-size: clamp(22px, 4vw, 28px); font-weight: 800;
  margin-top: 8px;
}
.section .sub { margin-top: 8px; font-size: 14px; color: var(--text-mid); max-width: 560px; }

/* ============================================================
   Result-specific (A.3): donut, dist chart, reason cards
   ============================================================ */
.donut-wrap {
  display: grid; grid-template-columns: 1fr; gap: 18px; align-items: center;
}
@media (min-width: 560px) {
  .donut-wrap { grid-template-columns: 200px 1fr; }
}
.donut-svg { width: 200px; height: 200px; margin: 0 auto; display: block; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-legend-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--bg);
  font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.donut-swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.donut-name { color: var(--text); flex: 1; }
.donut-pct  { color: var(--ink); font-weight: 800; }
.donut-rc   { color: var(--text-sub); font-size: 11px; }

/* Distribution chart card */
.dist-card { padding: 20px; }
.dist-svg { width: 100%; height: 200px; display: block; }
.dist-axis {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-sub); margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.dist-readout {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
}
.dist-readout .lbl {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--text-mid);
}
.dist-readout .swatch { width: 10px; height: 10px; border-radius: 3px; }
.dist-readout .val {
  font-size: 18px; font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.dist-readout .sub { font-size: 10.5px; color: var(--text-sub); }

.trinity-card {
  margin-top: 14px;
  background: var(--quanty-primary-soft-2);
  border-radius: var(--r-md); padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
}
.trinity-card .label {
  font-size: 11px; font-weight: 700; color: var(--quanty-primary);
}
.trinity-card .val {
  font-size: 20px; font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.trinity-card .source {
  font-size: 10.5px; color: var(--text-mid); margin-left: auto; text-align: right; line-height: 1.4;
}

/* Reason cards (5 expandable) */
.reason-card {
  background: var(--bg-card); border-radius: var(--r-md);
  border: 1px solid var(--border);
  overflow: hidden;
}
.reason-card + .reason-card { margin-top: 8px; }
.reason-summary {
  list-style: none;
  padding: 14px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}
.reason-summary::-webkit-details-marker { display: none; }
.reason-card[open] .reason-summary { border-bottom: 1px solid var(--border); }
.reason-swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.reason-ticker {
  font-weight: 800; color: var(--ink); font-size: 14px;
  letter-spacing: -0.01em;
}
.reason-name { font-size: 12px; color: var(--text-mid); margin-left: 4px; }
.reason-pct {
  margin-left: auto;
  font-size: 14px; font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.reason-caret {
  width: 18px; height: 18px; color: var(--text-faint);
  transition: transform var(--t-base) var(--ease);
}
.reason-card[open] .reason-caret { transform: rotate(180deg); }
.reason-body {
  padding: 14px 16px 18px;
  font-size: 13px; line-height: 1.65; color: var(--text);
}
.reason-body .why {
  font-weight: 600; color: var(--ink-2);
}
.reason-body .rc {
  margin-top: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--quanty-mint-soft); color: #0E7A5C;
  font-size: 11px; font-weight: 800;
}

/* Beta inline card */
.beta-card {
  margin-top: 24px;
  background: linear-gradient(135deg, var(--quanty-primary) 0%, #7B5DFF 100%);
  border-radius: var(--r-lg); padding: 22px;
  color: #fff;
  box-shadow: var(--shadow-pop);
}
.beta-card h3 { color: #fff; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.beta-card p { margin: 8px 0 16px; font-size: 13px; line-height: 1.55; opacity: 0.92; }
.beta-row { display: flex; gap: 8px; }
.beta-row .input-text {
  flex: 1; background: rgba(255,255,255,0.92); color: var(--ink);
  border-color: transparent;
}
.beta-row .input-text:focus { box-shadow: 0 0 0 4px rgba(255,255,255,0.30); }
.beta-row .btn {
  background: #fff; color: var(--quanty-primary); height: 52px; padding: 0 20px;
}
.beta-row .btn:hover { background: var(--quanty-primary-soft); }
.beta-foot {
  margin-top: 10px; font-size: 11px; opacity: 0.78; line-height: 1.55;
}

/* Result header */
.result-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 8px 0 14px;
}
.result-header h1 {
  font-size: clamp(24px, 6vw, 30px); font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.25;
}
.result-header .actions { display: flex; gap: 8px; flex: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--bg-card); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-quick) var(--ease);
}
.icon-btn:hover { border-color: var(--quanty-primary); color: var(--quanty-primary); background: var(--quanty-primary-soft-2); }

/* Restart chip footer */
.restart-row {
  margin-top: 32px; display: flex; justify-content: center;
}
.restart-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--r-pill);
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 13px; font-weight: 700; color: var(--text-mid);
  text-decoration: none;
  transition: all var(--t-quick) var(--ease);
}
.restart-chip:hover { color: var(--quanty-primary); border-color: var(--quanty-primary); }

/* ─── Footer ─── */
.foot {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-sub); line-height: 1.7;
  text-align: center;
}
.foot .links { margin-bottom: 12px; }
.foot .links a {
  color: var(--text-mid); text-decoration: none; font-weight: 700;
  margin: 0 8px;
}
.foot .links a:hover { color: var(--quanty-primary); }

/* ─── DEC-036: FIRE chip ≤380px wrap fix (Round 1 미해결 → 본진 hotfix) ─── */
/* onboarding.html line 133의 inline style="grid-template-columns: repeat(4, 1fr)"
   는 좁은 모바일에서 wrap. !important로 override하여 2×2 grid. */
@media (max-width: 380px) {
  #fireGroup,
  .chip-grid[role="radiogroup"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* DEC-038 — 조건부 숨김 (분포 카드 자산 미입력 시 등) */
.is-hidden { display: none !important; }
