:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-2: #242936;
  --border: #2e3442;
  --text: #e6e9f0;
  --muted: #9aa3b5;
  --accent: #4f7cff;
  --accent-2: #56b879;
  --danger: #ff6b6b;
}

/* 라이트 테마 */
[data-theme="light"] {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #eceef4;
  --border: #d5d9e3;
  --text: #1c2030;
  --muted: #6b7280;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
  background: linear-gradient(135deg, #12162a 0%, #1a1d27 60%, #0f1117 100%);
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: 2.2rem;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--text);
  font-size: 1.05rem;
}

.hero .sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
  flex: 1;
  width: 100%;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  margin-bottom: 0.75rem;
  font-size: 1.4rem;
}

.card label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--muted);
}

textarea {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 1rem;
  resize: vertical;
  font-family: inherit;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
}

h3 {
  margin: 1.25rem 0 0.75rem;
  font-size: 1.1rem;
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.persona-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  font-size: 0.95rem;
}

.persona-chip:hover {
  border-color: var(--accent);
}

.persona-chip.selected {
  background: rgba(79, 124, 255, 0.18);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.persona-chip .emoji {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.3rem;
}

.persona-chip .desc {
  font-size: 0.75rem;
  color: var(--muted);
  display: block;
  margin-top: 0.2rem;
}

.actions {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover:not(:disabled) {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79, 124, 255, 0.35);
}

.btn:not(:disabled):active {
  transform: translateY(0) scale(0.97);
}

/* 카드 hover lift 마이크로인터랙션 */
.result-card,
.axis-group,
.chart-box,
.extreme-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.result-card:hover,
.chart-box:hover,
.extreme-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* 숫자 count-up용 강조 */
.summary strong {
  animation: fadeIn 0.6s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status {
  color: var(--muted);
  font-size: 0.9rem;
}

.hidden {
  display: none;
}

.summary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.summary strong {
  color: var(--accent-2);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.result-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}

/* 감정별 테두리 — 긍정 파랑 / 부정 빨강 / 중립 회색 */
.result-card.sentiment-positive {
  border-color: var(--accent);
  border-width: 2px;
}

.result-card.sentiment-negative {
  border-color: var(--danger);
  border-width: 2px;
}

.result-card.sentiment-neutral {
  border-color: var(--muted);
}

/* 카드 등장 애니메이션 (순차 fade-up) */
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.card-enter {
  animation: cardEnter 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* 페르소나 일러스트 아바타 (DiceBear) */
.persona-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.result-card:hover .persona-avatar {
  transform: scale(1.08);
  border-color: var(--accent);
}

/* 감정 게이지 (-100 ~ +100) */
.sentiment-gauge {
  margin-bottom: 0.6rem;
}

.gauge-track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--danger) 0%, #9aa3b5 50%, var(--accent-2) 100%);
}

.gauge-marker {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
  transition: left 0.6s ease;
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* A/B 승자 배지 */
.winner-badge {
  display: inline-block;
  background: linear-gradient(90deg, #f5a623, #ffd76e);
  color: #3d2b00;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
  box-shadow: 0 2px 10px rgba(245, 166, 35, 0.4);
  animation: winnerPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes winnerPop {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

.result-card .persona-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.result-card .persona-head .emoji {
  font-size: 1.4rem;
}

.result-card .persona-name {
  flex: 1;
  min-width: 0;
}

.sentiment-badge {
  flex-shrink: 0;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0.3rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sentiment-badge.positive {
  background: rgba(86, 184, 121, 0.18);
}

.sentiment-badge.negative {
  background: rgba(255, 107, 107, 0.18);
}

.sentiment-badge.neutral {
  background: rgba(154, 163, 181, 0.18);
}

.sentiment-badge.error {
  background: rgba(255, 107, 107, 0.3);
}

.result-card .answer {
  font-size: 0.92rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.result-card .meta {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}

footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

footer .disclaimer {
  color: var(--danger);
  margin-top: 0.4rem;
  font-size: 0.75rem;
}

.skeleton {
  opacity: 0.5;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* === Quiz (육하원칙 질문지) === */
.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.quiz-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.quiz-item .q-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.quiz-item .q-label .q-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
}

.quiz-item .q-title {
  color: var(--text);
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.option {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.12s ease;
}

.option:hover {
  border-color: var(--accent);
}

.option.selected {
  background: rgba(79, 124, 255, 0.18);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.option.other-option {
  border-style: dashed;
  color: var(--success, #56b879);
}

.option.other-option.selected {
  background: rgba(86, 184, 121, 0.15);
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.other-input {
  margin-top: 0.75rem;
  width: 100%;
}

/* === 트리 구조 === */
.hint-inline {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}

.tree-level {
  margin-top: 0.75rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--border);
}

.tree-level .level-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tree-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tree-option {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.12s ease;
}

.tree-option:hover {
  border-color: var(--accent);
}

.tree-option.selected {
  background: rgba(79, 124, 255, 0.18);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.tree-option.other-option {
  border-style: dashed;
}

.tree-option.other-option.selected {
  background: rgba(86, 184, 121, 0.15);
  border-color: var(--accent-2);
  color: var(--accent-2);
}

/* ============================================================
   핵심축(Core Axes) — 표본 정의
   ============================================================ */
.core-axes {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

.axis-group {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.axis-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.axis-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: rgba(86, 184, 121, 0.15);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.axis-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.axis-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.axis-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.12s ease;
}

.axis-chip:hover {
  border-color: var(--accent);
}

.axis-chip.selected {
  background: rgba(79, 124, 255, 0.18);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.axis-chip.small {
  font-size: 0.78rem;
  padding: 0.28rem 0.7rem;
}

.axis-country-box {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.axis-country-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--border);
}

.axis-country-group.hidden {
  display: none;
}

/* ============================================================
   리서치 패널 — 파생축
   ============================================================ */
.research-panel {
  margin-top: 0.75rem;
}

.research-details summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--accent-2);
  font-weight: 600;
  padding: 0.5rem 0;
}

.rp-body {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.rp-row .rp-head {
  font-size: 0.88rem;
}

.rp-examples {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.rp-footnote {
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
  margin-top: 0.2rem;
}

/* ============================================================
   표본 크기 슬라이더
   ============================================================ */
.sample-size-control {
  margin-top: 0.5rem;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}

.slider-value {
  font-weight: 700;
  color: var(--accent);
  min-width: 3.5rem;
  text-align: right;
}

.combo-space-info {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.combo-warning {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--danger);
}

.combo-info {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent);
}

/* ============================================================
   표본 미리보기
   ============================================================ */
.sample-preview {
  margin-top: 0.5rem;
}

.sampling-method-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.sampling-method-row select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
}

.dist-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.dist-label {
  width: 90px;
  flex-shrink: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.dist-bar {
  flex: 1;
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  height: 1.6rem;
  background: var(--surface);
}

.dist-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--accent);
}

.dist-seg:nth-child(4n+2) { background: var(--accent-2); }
.dist-seg:nth-child(4n+3) { background: #a86dff; }
.dist-seg:nth-child(4n+4) { background: #ff9f5b; }

.example-persons {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.example-person {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ============================================================
   리포팅 축 확인
   ============================================================ */
.report-axes-preview {
  margin-top: 0.5rem;
  background: rgba(79, 124, 255, 0.08);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
}

.report-row {
  margin-bottom: 0.4rem;
}

.report-key {
  display: inline-block;
  min-width: 90px;
  font-weight: 600;
  color: var(--accent);
}

.btn.small {
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
}

.btn.secondary {
  background: transparent;
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.btn.secondary:hover:not(:disabled) {
  background: rgba(86, 184, 121, 0.12);
}

.btn.danger {
  border-color: var(--danger);
  color: var(--danger);
  background: transparent;
}

.btn.danger:hover:not(:disabled) {
  background: rgba(255, 107, 107, 0.12);
}

/* ============================================================
   프리셋 저장/불러오기
   ============================================================ */
.preset-controls {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.preset-row select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  flex: 1;
  min-width: 180px;
}

/* ============================================================
   위저드 (Step 진행)
   ============================================================ */
.wizard-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.wizard-progress-step {
  color: var(--muted);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.wizard-progress-step.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.wizard-progress-step.done {
  color: var(--accent-2);
  border-color: var(--accent-2);
}

.wizard-progress-sep {
  color: var(--muted);
}

.wizard-nav {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.wizard-summary-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* ============================================================
   A/B 비교
   ============================================================ */
.ab-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}

.ab-toggle input {
  accent-color: var(--accent);
  width: 1.05rem;
  height: 1.05rem;
}

.results-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.results-compare.hidden {
  display: none;
}

.compare-col {
  min-width: 0;
}

.compare-col h3 {
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.compare-col .extreme-highlight {
  grid-template-columns: 1fr;
}

@media (max-width: 800px) {
  .results-compare {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   교차표 & 극단 조합 하이라이트
   ============================================================ */
.extreme-highlight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0;
}

.extreme-card {
  border-radius: 10px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
}

.extreme-card.best {
  border-color: var(--accent-2);
  background: rgba(86, 184, 121, 0.08);
}

.extreme-card.worst {
  border-color: var(--danger);
  background: rgba(255, 107, 107, 0.08);
}

.extreme-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.extreme-combo {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.extreme-rate {
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 700px) {
  .extreme-highlight {
    grid-template-columns: 1fr;
  }
}

.crosstab-section {
  margin: 1rem 0 1.5rem;
}

.crosstab-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.crosstab-title {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.crosstab-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.82rem;
}

.crosstab-table th,
.crosstab-table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.7rem;
  text-align: center;
  white-space: nowrap;
}

.crosstab-table thead th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
}

.crosstab-table tbody th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  text-align: left;
}

/* 교차표 셀 — 발산형 컬러 스케일 (빨강=부정 ↔ 파랑=긍정) */
.crosstab-cell {
  --r: calc((100 - var(--pct)) / 100 * 255);
  --b: calc(var(--pct) / 100 * 255);
  background: rgb(calc(120 + (var(--r) - 120) * 0.55), 90, calc(120 + (var(--b) - 120) * 0.55));
  color: #fff;
  font-weight: 600;
  transition: filter 0.15s ease;
}

.crosstab-cell:hover {
  filter: brightness(1.25);
}

.crosstab-cell.crosstab-low-n {
  opacity: 0.55;
}

.crosstab-empty {
  color: var(--muted);
}

.crosstab-n {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ============================================================
   차트 & AI 리포트 (1차 고도화)
   ============================================================ */
.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.chart-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}

.chart-box h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--muted);
}

.legend-item .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.kw-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}

.kw-label {
  width: 90px;
  text-align: right;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kw-bar-track {
  flex: 1;
  background: var(--surface);
  border-radius: 4px;
  height: 14px;
  overflow: hidden;
}

.kw-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 4px;
  transition: width 0.4s ease;
}

.kw-count {
  width: 28px;
  color: var(--muted);
  font-size: 0.78rem;
}

.report-box {
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.report-box h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--accent);
}

.report-section h4 {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.9rem;
  color: var(--accent-2);
}

.report-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text);
  margin: 0;
  line-height: 1.6;
}

/* ============================================================
   3줄 결론 (최하단)
   ============================================================ */
.conclusion-box {
  background: rgba(79, 124, 255, 0.08);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
}

.conclusion-box h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: var(--accent);
}

.conclusion-lines {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.7;
}

.conclusion-lines li {
  margin-bottom: 0.3rem;
}

/* ============================================================
   로그인 (Google OAuth) & 내 기록
   ============================================================ */
.auth-bar {
  display: flex;
  justify-content: flex-end;
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1rem 0;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.auth-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.auth-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 1rem;
}

.auth-name {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 600;
}

.auth-note {
  font-size: 0.78rem;
  color: var(--muted);
}

.auth-login-btn {
  text-decoration: none;
  display: inline-block;
}

.my-sims-panel {
  border-color: var(--accent);
}

.my-sims-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.my-sims-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.sims-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sim-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}

.sim-main {
  flex: 1;
  min-width: 0;
}

.sim-question {
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sim-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* ============================================================
   워드클라우드
   ============================================================ */
.wordcloud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.7rem;
  padding: 0.5rem;
  min-height: 120px;
}

.wc-word {
  line-height: 1.2;
  cursor: default;
  transition: transform 0.15s ease;
}

.wc-word:hover {
  transform: scale(1.12);
}

/* ============================================================
   인구 피라미드 (표본 미리보기)
   ============================================================ */
.pyramid-box {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.pyramid-title {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.pyramid-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
}

.pyramid-left,
.pyramid-right {
  flex: 1;
  display: flex;
  height: 16px;
}

.pyramid-left { justify-content: flex-end; }
.pyramid-right { justify-content: flex-start; }

.pyramid-bar-male {
  background: var(--accent);
  border-radius: 3px 0 0 3px;
  height: 100%;
}

.pyramid-bar-female {
  background: #e679a8;
  border-radius: 0 3px 3px 0;
  height: 100%;
}

.pyramid-age {
  width: 44px;
  text-align: center;
  color: var(--muted);
  flex-shrink: 0;
}

.pyramid-count {
  font-size: 0.68rem;
  color: var(--muted);
  min-width: 20px;
}

/* ============================================================
   테마 토글 & 공유 카드
   ============================================================ */
.theme-toggle-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.theme-toggle-btn:hover {
  transform: rotate(30deg) scale(1.08);
}

.share-card-btn {
  margin-top: 1rem;
}

.hero {
  transition: background 0.3s ease;
}

/* ============================================================
   페르소나 심층 인터뷰 (채팅 모달)
   ============================================================ */
.chat-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.chat-modal.hidden {
  display: none;
}

.chat-modal-box {
  width: 100%;
  max-width: 560px;
  height: min(80vh, 640px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cardEnter 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.chat-modal-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.chat-persona-info {
  flex: 1;
  min-width: 0;
}

.chat-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.chat-sub {
  font-size: 0.72rem;
  color: var(--muted);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.chat-bubble {
  max-width: 82%;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  animation: fadeIn 0.25s ease both;
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.chat-form input {
  flex: 1;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
}

.chat-form input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ============================================================
   모드 탭 & 가설 검증 (Hypothesis Lab)
   ============================================================ */
.mode-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.mode-tab {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.8rem 1rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-tab.active {
  background: rgba(79, 124, 255, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.hyp-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.hyp-field label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.hyp-field input {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
}

.hyp-field input:focus,
.hyp-field select:focus {
  outline: none;
  border-color: var(--accent);
}

.hyp-field select {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
}

.hyp-field-full { grid-column: 1 / -1; }

.hyp-cat-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}

.hyp-cat-row input {
  grid-column: 1 / -1;
}

/* 개별 소비자 반응 카드 그리드 */
.hyp-resp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.hyp-resp-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
}

.hr-body {
  min-width: 0;
  font-size: 0.85rem;
}

.hr-name {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.hr-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  line-height: 1.6;
}

.hr-label {
  color: var(--muted);
  font-size: 0.75rem;
  min-width: 38px;
}

.hr-range {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.hr-range strong { color: var(--accent-2); }

/* ① AI 결론 카드 */
.hyp-verdict-box {
  margin-top: 1.5rem;
}

.hyp-verdict {
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  border: 2px solid var(--border);
  background: var(--surface-2);
  animation: cardEnter 0.4s ease both;
}

.hyp-verdict.safe { border-color: var(--accent-2); background: rgba(86, 184, 121, 0.08); }
.hyp-verdict.warn { border-color: #f5a623; background: rgba(245, 166, 35, 0.08); }
.hyp-verdict.danger { border-color: var(--danger); background: rgba(255, 107, 107, 0.08); }

.hv-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.hv-lines {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.95rem;
  line-height: 1.7;
}

.hv-lines li { margin-bottom: 0.25rem; }

/* ② Before → After 비교 */
.hyp-compare {
  margin-top: 1.25rem;
}

.hyp-compare-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
}

.hyp-side {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  text-align: center;
}

.hyp-side.before { border-color: var(--muted); }
.hyp-side.after { border-color: var(--accent); }

.hyp-side-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.hyp-price {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.hyp-intent {
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

.hyp-intent strong { color: var(--accent); font-size: 1.1rem; }

.hyp-revbar {
  height: 12px;
  background: var(--surface);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.hyp-revbar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 6px;
  transition: width 0.6s ease;
}

.hyp-revlabel {
  font-size: 0.75rem;
  color: var(--muted);
}

.hyp-arrow {
  text-align: center;
  font-size: 1.6rem;
  color: var(--muted);
  font-weight: 700;
}

.afford-badge {
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  text-align: center;
}
.afford-badge.seg-ok { background: rgba(86,184,121,0.15); color: var(--accent-2); }
.afford-badge.seg-mid { background: rgba(255,179,71,0.15); color: #ffb347; }
.afford-badge.seg-bad { background: rgba(255,107,107,0.15); color: var(--danger); }
.hr-income { margin-top: 0.25rem; }

/* ===== 4P 믹스 분석 ===== */
.fp-dims {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fp-dim {
  display: grid;
  grid-template-columns: 110px 1fr 1fr;
  gap: 0.5rem;
  align-items: center;
}

.fp-dim-key {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.imp-chart {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.imp-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.imp-label {
  width: 80px;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: right;
}

.imp-track {
  flex: 1;
  height: 18px;
  background: var(--surface);
  border-radius: 9px;
  overflow: hidden;
}

.imp-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 9px;
  transition: width 0.6s ease;
}

.imp-pct {
  width: 44px;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.88rem;
}

.opt-preference {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
}

.fp-top3-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (max-width: 700px) {
  .fp-top3-grid { grid-template-columns: 1fr; }
  .fp-dim { grid-template-columns: 90px 1fr; }
}

.hyp-arrow .up { color: var(--accent-2); font-size: 1rem; }
.hyp-arrow .down { color: var(--danger); font-size: 1rem; }

/* ③ 상세 분석 */
.hyp-details {
  margin-top: 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.hyp-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
}

.hyp-details > div { margin-top: 1rem; }

.hyp-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85rem;
}

.hyp-table th, .hyp-table td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.7rem;
  text-align: center;
}

.hyp-table thead th { background: var(--surface); color: var(--muted); }

.seg-bad { color: var(--danger); font-weight: 700; }
.seg-mid { color: #f5a623; font-weight: 600; }
.seg-ok { color: var(--accent-2); }

.psm-range {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.psm-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
}

.psm-item.psm-danger { border-color: var(--danger); color: var(--danger); }

.hyp-resp {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}

@media (max-width: 700px) {
  .hyp-form { grid-template-columns: 1fr; }
  .hyp-compare-grid { grid-template-columns: 1fr; }
  .hyp-arrow { transform: rotate(90deg); }
}

/* ============================================================
   시각 효과 고도화 (Visual FX)
   ============================================================ */

/* --- 접근성: 모션 최소화 설정 존중 --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- 히어로 그라데이션 광택 흐름 --- */
.hero h1 {
  background-size: 200% auto;
  animation: heroSweep 6s linear infinite;
}
@keyframes heroSweep {
  to { background-position: 200% center; }
}

/* --- 모드 섹션 전환 (슬라이드+페이드) --- */
@keyframes sectionIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.section-enter {
  animation: sectionIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* --- 실행 버튼 로딩 스피너 --- */
.btn.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn.primary.loading::before {
  content: "분석 중...";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- 결론 카드 판정 펄스 --- */
.hyp-verdict.safe { animation: cardEnter 0.4s ease both, pulseSafe 2.5s ease-in-out 0.5s infinite; }
.hyp-verdict.warn { animation: cardEnter 0.4s ease both, pulseWarn 2s ease-in-out 0.5s infinite; }
.hyp-verdict.danger { animation: cardEnter 0.4s ease both, pulseDanger 1.6s ease-in-out 0.5s infinite; }
@keyframes pulseSafe {
  0%,100% { box-shadow: 0 0 0 0 rgba(86,184,121,0); }
  50% { box-shadow: 0 0 24px 2px rgba(86,184,121,0.25); }
}
@keyframes pulseWarn {
  0%,100% { box-shadow: 0 0 0 0 rgba(245,166,35,0); }
  50% { box-shadow: 0 0 24px 2px rgba(245,166,35,0.3); }
}
@keyframes pulseDanger {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,107,107,0); }
  50% { box-shadow: 0 0 28px 3px rgba(255,107,107,0.35); }
}

/* --- 하락 수치 플래시 --- */
@keyframes dropFlash {
  0%,100% { text-shadow: none; }
  30% { text-shadow: 0 0 14px rgba(255,107,107,0.9); }
}
.drop-flash { animation: dropFlash 1.2s ease 0.4s 2; }

/* --- 매출 바 draw-in --- */
.hyp-revbar > div, .imp-bar {
  transform-origin: left;
  animation: barGrow 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes barGrow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* --- 부담 가능 비율 링 게이지 --- */
.ring-gauge-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
}
.ring-gauge-wrap.seg-ok { background: rgba(86,184,121,0.15); color: var(--accent-2); }
.ring-gauge-wrap.seg-mid { background: rgba(255,179,71,0.15); color: #ffb347; }
.ring-gauge-wrap.seg-bad { background: rgba(255,107,107,0.15); color: var(--danger); }
.ring-gauge circle.fg {
  stroke-dasharray: var(--circ);
  stroke-dashoffset: var(--circ);
  animation: ringFill 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}
@keyframes ringFill {
  to { stroke-dashoffset: var(--target); }
}

/* --- 히트맵 행 stagger --- */
.hyp-table tbody tr {
  animation: rowIn 0.4s ease both;
}
.hyp-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.hyp-table tbody tr:nth-child(2) { animation-delay: 0.12s; }
.hyp-table tbody tr:nth-child(3) { animation-delay: 0.19s; }
.hyp-table tbody tr:nth-child(4) { animation-delay: 0.26s; }
.hyp-table tbody tr:nth-child(5) { animation-delay: 0.33s; }
.hyp-table tbody tr:nth-child(6) { animation-delay: 0.40s; }
.hyp-table tbody tr:nth-child(n+7) { animation-delay: 0.47s; }
@keyframes rowIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- 가격대 차트 막대 성장 --- */
.pricebar-grow {
  transform-origin: left;
  animation: barGrow 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* --- Top3 골드 글로우 (1위) --- */
.top3-first {
  border-color: #f5c542 !important;
  animation: cardEnter 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both, goldGlow 2.4s ease-in-out 0.8s infinite;
}
@keyframes goldGlow {
  0%,100% { box-shadow: 0 0 8px 0 rgba(245,197,66,0.15); }
  50% { box-shadow: 0 0 26px 4px rgba(245,197,66,0.4); }
}

/* --- 도넛 조각 확장 hover --- */
#sentiment-donut circle.seg {
  transition: transform 0.2s ease;
  cursor: pointer;
}
#sentiment-donut circle.seg:hover {
  transform: scale(1.06);
  transform-origin: 60px 60px;
}

/* --- shimmer 스켈레톤 --- */
.skeleton {
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* --- 결과 카드 3D tilt --- */
.result-card.tilt {
  will-change: transform;
}

/* ===== 랜덤 페르소나 (카드 플립) ===== */
.rp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.9rem;
}

.rp-flip {
  perspective: 900px;
  min-height: 240px;
}

.rp-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 240px;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.34, 1.2, 0.5, 1);
}

.rp-flip-inner.flipped {
  transform: rotateY(180deg);
}

.rp-back,
.rp-front {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid var(--border);
  overflow-y: auto;
}

.rp-back {
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.rp-back-emoji {
  font-size: 2.2rem;
  animation: pulse 1.6s ease-in-out infinite;
}

.rp-back-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.rp-front {
  transform: rotateY(180deg);
  background: var(--surface-2);
  font-size: 0.85rem;
}

.rp-name {
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.rp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.rp-tag {
  background: rgba(79, 124, 255, 0.12);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  color: var(--accent);
}

.rp-answer {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}

.rp-quirk {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #f5a623;
}
