@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --primary: #2563eb;
  --primary-light: #eff6ff;
  --primary-lighter: #f5f9ff;
  --primary-dark: #1d4ed8;
  --success: #059669;
  --danger: #dc2626;
  --bg: #f5f7fb;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --header-h: 60px;
  --stepper-h: 96px;
  --nav-h: 72px;
}

html, body { height: 100%; margin: 0; padding: 0; overflow: hidden; }
body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* ═══════ HEADER ═══════ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: #0f172a;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 32px;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.2);
}
.header-logo {
  border: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.header-logo span { color: #3b82f6; }
.lab-caret {
  color: #94a3b8 !important;
  font-size: 11px;
  margin-left: 2px;
  transition: transform 0.15s;
}
.header-lab-trigger:hover .lab-caret,
.header-lab-trigger.is-open .lab-caret { color: #e2e8f0 !important; }
.header-lab-trigger.is-open .lab-caret { transform: rotate(180deg); }
.header-lab-trigger.has-active { color: #bfdbfe; }
.header-nav { display: flex; gap: 4px; min-width: 0; }
.header-nav a,
.header-lab-menu a {
  color: #94a3b8;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}
.header-nav a:hover,
.header-lab-menu a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.header-nav a.active,
.header-lab-menu a.active { color: #fff; background: rgba(59,130,246,0.25); }
.header-lab-menu {
  position: absolute;
  top: calc(100% - 8px);
  left: 24px;
  min-width: 190px;
  padding: 8px;
  border: 1px solid rgba(148,163,184,0.24);
  border-radius: 10px;
  background: #111827;
  box-shadow: 0 16px 36px rgba(15,23,42,0.28);
  display: grid;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.15s, transform 0.15s;
}
.header-lab-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.header-lab-menu a {
  display: block;
  padding: 10px 12px;
}

/* ═══════ DATA STATUS BANNER ═══════ */
.data-banner {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  padding: 8px 24px;
  font-size: 12px;
  font-weight: 500;
  z-index: 60;
  text-align: center;
  border-bottom: 1px solid;
}
.data-banner.warn {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}
.data-banner.ok {
  background: #ecfdf5;
  color: #065f46;
  border-color: #6ee7b7;
}
.data-banner a { color: inherit; text-decoration: underline; }
.has-banner .stepper-bar { top: calc(var(--header-h) + 32px); }
.has-banner .step-content { top: calc(var(--header-h) + var(--stepper-h) + 32px); }

/* ── PREFETCH PROGRESS BANNER ── */
.prefetch-banner {
  position: fixed;
  bottom: var(--nav-h);
  left: 0; right: 0;
  background: #1e293b;
  color: #e2e8f0;
  padding: 10px 20px;
  z-index: 70;
  border-top: 1px solid #334155;
  display: flex;
  align-items: center;
  gap: 16px;
}
.prefetch-text {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  white-space: nowrap;
}
.prefetch-label { font-weight: 600; color: #93c5fd; }
#prefetch-detail { color: #94a3b8; font-size: 11px; }
.prefetch-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.prefetch-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  width: 0%;
  transition: width 0.4s;
  border-radius: 3px;
}
.prefetch-banner.done {
  background: #064e3b;
  color: #d1fae5;
}
.prefetch-banner.done .prefetch-label { color: #6ee7b7; }

/* ═══════ STEPPER ═══════ */
.stepper-bar {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  height: var(--stepper-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.stepper {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 900px;
  padding: 0 24px;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}
.step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #94a3b8;
  font-weight: 700;
  font-size: 15px;
  transition: all 0.2s;
}
.step-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.step.active .step-num {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.15);
}
.step.active .step-label {
  color: var(--primary);
  font-weight: 700;
}
.step.completed .step-num {
  background: var(--success);
  color: #fff;
}
.step.completed .step-num::before {
  content: '✓';
  font-size: 16px;
}
.step.completed .step-label {
  color: var(--success);
}
.step-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  margin: 0 8px;
  margin-bottom: 26px;  /* align with circle center */
  transition: background 0.2s;
}
.step-line.active { background: var(--primary); }

/* ═══════ STEP CONTENT (main scroll area) ═══════ */
.step-content {
  position: fixed;
  top: calc(var(--header-h) + var(--stepper-h));
  bottom: var(--nav-h);
  left: 0; right: 0;
  overflow-y: auto;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.step-content::-webkit-scrollbar { width: 8px; }
.step-content::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.step-panel { display: none; }
.step-panel.active { display: block; }

.panel-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.step-header { margin-bottom: 24px; }
.step-header h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.step-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ═══════ SECTIONS ═══════ */
.section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 16px;
}
.section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hint-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

/* 유니버스 필터 체크박스 그리드 */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.filter-chk {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s;
  user-select: none;
}
.filter-chk:hover { border-color: var(--primary); background: var(--primary-lighter); }
.filter-chk.checked { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; }
.filter-chk input { margin: 0; cursor: pointer; accent-color: var(--primary); }
.filter-chk.master {
  background: #f1f5f9;
  font-weight: 600;
}
.filter-chk.master.checked { background: var(--primary); color: #fff; border-color: var(--primary); }
.filter-chk.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.section-padded { padding: 24px; }

/* ═══════ OPTION CARDS (시장, 섹터, 리밸런싱, 프리셋 모두 사용) ═══════ */
.card-grid {
  display: grid;
  gap: 10px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 800px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}

.opt-card {
  padding: 18px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
}
.opt-card.sm {
  padding: 12px 10px;
  font-size: 13px;
  font-weight: 500;
}
.opt-card:hover {
  border-color: var(--primary);
  background: var(--primary-lighter);
  transform: translateY(-1px);
}
.opt-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 2px 8px rgba(37,99,235,0.15);
}
.opt-card.active .opt-title { color: var(--primary); }

.opt-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.opt-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.opt-card.active .opt-sub { color: var(--primary); opacity: 0.8; }

/* ═══════ BIG RANGE SLIDER ═══════ */
.big-range {
  display: flex;
  align-items: center;
  gap: 24px;
}
.big-range input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
  outline: none;
  cursor: pointer;
}
.big-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37,99,235,0.4);
  border: 3px solid #fff;
}
.big-display {
  font-size: 42px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -1px;
  min-width: 140px;
  text-align: center;
  line-height: 1;
}
.big-display small {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 6px;
}
.range-hint {
  display: flex;
  justify-content: space-between;
  padding: 8px 0 0 0;
  margin-right: 164px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ═══════ DATE INPUTS ═══════ */
.date-section {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 14px;
}
.date-input { flex: 1; }
.date-input label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 6px;
}
.date-input input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.date-input input:focus { border-color: var(--primary); }
.date-input input.invalid {
  border-color: var(--danger);
  background: #fef2f2;
}
.date-input input.invalid:focus { border-color: var(--danger); }
.date-arrow {
  font-size: 22px;
  color: var(--text-muted);
  padding-bottom: 12px;
}

.capital-input {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.capital-input input {
  flex: 1;
  padding: 14px 16px;
  font-size: 20px;
  font-weight: 700;
  text-align: right;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  letter-spacing: 0.5px;
}
.capital-input input:focus { border-color: var(--primary); }
.capital-input .unit {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 600;
}

.period-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.period-chip {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  transition: all 0.15s;
}
.period-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-lighter);
}

/* ─ 거래비용 안내 ─ */
.cost-table { display: flex; flex-direction: column; gap: 10px; }
.cost-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.cost-region {
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  color: var(--text);
}
.cost-detail {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.cost-detail b { color: var(--primary-dark); }
.cost-hint {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef3c7;
  border-radius: 8px;
  font-size: 12px;
  color: #92400e;
  border-left: 3px solid #f59e0b;
}

/* ─ 손절/익절 카드 ─ */
.sl-tp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 800px) { .sl-tp-grid { grid-template-columns: 1fr; } }
.sl-tp-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}
.sl-tp-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.sl-tp-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sl-tp-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 5px;
  border-radius: 3px;
  background: #cbd5e1;
  outline: none;
  cursor: pointer;
}
.sl-tp-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(37,99,235,0.4);
}
.sl-tp-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  min-width: 70px;
  text-align: center;
}
.sl-tp-value small { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-left: 2px; }
.sl-tp-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ═══════ FACTORS (Step 4) ═══════ */
.preset-help {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

#active-factors-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
  align-items: center;
}
.no-factors {
  font-size: 13px;
  color: var(--text-muted);
}
.factor-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
}
.chip-pct {
  font-size: 11px;
  color: var(--primary-dark);
  font-weight: 700;
  background: rgba(37,99,235,0.15);
  padding: 1px 6px;
  border-radius: 8px;
}

.factor-category { margin-bottom: 20px; }
.factor-category:last-child { margin-bottom: 0; }
.factor-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-left: 3px solid;
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
  margin-bottom: 10px;
}
.factor-cat-label { font-weight: 700; font-size: 13px; }
.factor-cat-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  background: #fff;
  padding: 2px 8px;
  border-radius: 10px;
}

.factor-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}

.factor-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  transition: all 0.15s;
}
.factor-item:hover { border-color: #93c5fd; }
.factor-item.active {
  border-color: var(--primary);
  background: var(--primary-lighter);
}

.factor-toggle-area { display: flex; align-items: center; gap: 10px; }
.factor-info { flex: 1; min-width: 0; }
.factor-name { font-size: 13px; font-weight: 700; display: block; }
.factor-desc {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}
.factor-dir {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.dir-up { background: #dcfce7; color: #16a34a; }
.dir-down { background: #fee2e2; color: #dc2626; }

/* 방향 토글 버튼 (변동성·사이즈 등) */
.dir-flip {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  border-radius: 6px;
  width: 26px; height: 24px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  transition: all 0.15s;
}
.dir-flip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-lighter);
}

/* 미구현 배지 + disabled 카드 */
.factor-item.disabled {
  opacity: 0.45;
  pointer-events: none;
  background: #f8fafc;
}
.factor-item.disabled .toggle-slider { background: #cbd5e1 !important; }
.unsupported-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  border-radius: 8px;
  border: 1px solid #fcd34d;
}

.factor-weight-area {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e0eaf5;
}
.weight-label {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 500;
}
.weight-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: #cbd5e1;
  outline: none;
}
.weight-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(37,99,235,0.4);
}
.weight-value {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
  min-width: 18px;
}

/* ═══════ TOGGLE SWITCH ═══════ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px; height: 20px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #cbd5e1;
  transition: 0.2s;
  border-radius: 20px;
}
.toggle-slider:before {
  position: absolute;
  content: '';
  height: 14px; width: 14px;
  left: 3px; bottom: 3px;
  background: #fff;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
input:checked + .toggle-slider { background: var(--primary); }
input:checked + .toggle-slider:before { transform: translateX(16px); }

/* ═══════ STEP 5: SUMMARY ═══════ */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.summary-item {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
}
.summary-item.col-span-2 { grid-column: span 2; }
.summary-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}
.summary-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.run-btn-big {
  width: 100%;
  padding: 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
  transition: all 0.2s;
  letter-spacing: -0.3px;
}
.run-btn-big:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.4);
}
.run-btn-big:disabled {
  background: #93c5fd;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.run-btn-big.running {
  background: var(--danger);
  box-shadow: 0 4px 14px rgba(220,38,38,0.35);
}
.run-btn-big.running:hover {
  background: #b91c1c;
  box-shadow: 0 6px 20px rgba(220,38,38,0.5);
}

/* 백테스트 진행 상태 */
.bt-progress {
  margin-top: 12px;
  padding: 16px 20px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 12px;
}
.bt-progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
#bt-progress-percent { color: var(--primary); font-size: 16px; }
.bt-progress-bar {
  height: 8px;
  background: #e0f2fe;
  border-radius: 4px;
  overflow: hidden;
}
.bt-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  width: 0%;
  transition: width 0.4s;
  border-radius: 4px;
}
.bt-progress-detail {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* 내보내기 버튼 */
.export-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  transition: all 0.15s;
}
.export-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-lighter);
}

/* 전략 vs 벤치마크 비교 표 */
.compare-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.compare-table th {
  padding: 10px 14px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  background: #f8fafc;
}
.compare-table th:first-child { text-align: left; }
.compare-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.compare-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--text-secondary);
}
.compare-table tr:hover { background: #f8fafc; }
.compare-table .diff-pos { color: var(--success); font-weight: 600; }
.compare-table .diff-neg { color: var(--danger); font-weight: 600; }
.compare-table .strategy-col { color: var(--primary); font-weight: 600; }

/* ═══════ RESULTS ═══════ */
#results-panel { display: none; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.metric-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.metric-card.highlight {
  border-color: var(--primary);
  background: var(--primary-light);
}
.metric-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.metric-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.metric-value.positive { color: var(--success); }
.metric-value.negative { color: var(--danger); }
.metric-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.chart-wrap { position: relative; height: 320px; padding: 8px 0; }
.chart-small { height: 220px; }
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 800px) { .chart-grid { grid-template-columns: 1fr; } }

.section-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.3px;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 4px; height: 18px;
  background: var(--primary);
  border-radius: 2px;
}

/* ═══════ HOLDINGS TABLE ═══════ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  background: #f8fafc;
}
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: #f8fafc; }
tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.rank { font-weight: 700; color: var(--text-muted); width: 40px; }
.stock-name { font-weight: 700; font-size: 13px; }
.stock-ticker { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.score {
  font-weight: 700;
  color: var(--primary);
  font-size: 12px;
  font-family: 'SF Mono', monospace;
}

.sector-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.sector-tech     { background: #dbeafe; color: #1d4ed8; }
.sector-bio      { background: #d1fae5; color: #065f46; }
.sector-finance  { background: #fef3c7; color: #92400e; }
.sector-industry { background: #f3e8ff; color: #6b21a8; }
.sector-consumer { background: #fce7f3; color: #9d174d; }
.sector-energy   { background: #ffedd5; color: #c2410c; }
.sector-chemical { background: #e0f2fe; color: #075985; }
.sector-auto     { background: #f0fdf4; color: #166534; }

.positive { color: var(--success) !important; }
.negative { color: var(--danger) !important; }

/* ═══════ BOTTOM NAV BAR ═══════ */
.step-nav-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 50;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.04);
}
.btn-step {
  padding: 11px 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.btn-step:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-step:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.btn-next {
  background: var(--primary);
  color: #fff !important;
  border-color: var(--primary);
}
.btn-next:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}
.step-progress {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.step-progress span {
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
}

/* ═══════ STOCK ANALYSIS VIEW ═══════ */
.stock-view {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  background: var(--bg);
}
.has-banner .stock-view { top: calc(var(--header-h) + 32px); }
.stock-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}
.stock-header h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}
.stock-header p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 20px;
}

.search-area { position: relative; margin-bottom: 24px; }
.search-area input {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  font-family: inherit;
  border: 2px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: #fff;
  transition: border-color 0.15s;
}
.search-area input:focus { border-color: var(--primary); }
.search-dropdown {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 4px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  display: none;
}
.search-dropdown.show { display: block; }
.search-item {
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--primary-lighter); }
.search-item-name { font-weight: 600; flex: 1; }
.search-item-ticker {
  font-family: 'SF Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
}
.search-item-market {
  padding: 2px 8px;
  background: #f1f5f9;
  border-radius: 10px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* 종목 메타 카드 */
.stock-meta-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}
.stock-meta-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.stock-meta-title h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.stock-meta-title span {
  font-family: 'SF Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
}
.stock-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.stock-stat {
  background: #f8fafc;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.stock-stat-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.stock-stat-value { font-size: 16px; font-weight: 700; color: var(--text); }
.stock-stat-sector {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-secondary);
}

/* 경고 박스 */
.stock-warning {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.6;
}

/* 차트 그리드 */
.stock-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.chart-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.chart-card.large { grid-column: span 2; }
.chart-card h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
@media (max-width: 800px) {
  .stock-charts { grid-template-columns: 1fr; }
  .chart-card.large { grid-column: span 1; }
}

/* ═══════ TOAST ═══════ */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  right: 24px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.toast-info  { background: var(--primary-light); color: var(--primary); border: 1px solid #bfdbfe; }

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 800px) {
  :root { --stepper-h: 80px; }
  .step-label { display: none; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-item.col-span-2 { grid-column: span 1; }
  .big-display { font-size: 32px; min-width: 100px; }
  .range-hint { margin-right: 124px; }
  .panel-inner { padding: 20px 16px 40px; }
  .step-header h2 { font-size: 22px; }
}

/* ═══════════════════════════════════════════════════════════════
   GURUS VIEW — 거장 포트폴리오
   ═══════════════════════════════════════════════════════════════ */
.gurus-view {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  background: var(--bg);
}
.has-banner .gurus-view { top: calc(var(--header-h) + 32px); }
.gurus-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

/* 헤더 */
.gurus-header h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
}
.gurus-header p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.6;
}
.gurus-disclaimer {
  background: #fef9e7;
  border: 1px solid #fde68a;
  color: #78350f;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.6;
  margin-bottom: 24px;
}
.gurus-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}
.gurus-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 16px;
  border-radius: 8px;
  margin-top: 16px;
}

/* 검색 + 필터 컨트롤 */
.gurus-controls {
  margin: 18px 0 22px;
}
.gurus-search-wrap {
  position: relative;
  margin-bottom: 14px;
}
.gurus-search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-secondary);
}
#gurus-search {
  width: 100%;
  padding: 11px 40px 11px 40px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#gurus-search:focus {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.10);
}
.gurus-search-clear {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1;
}
.gurus-search-clear:hover { background: #fef2f2; color: #b91c1c; }

.gurus-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.gurus-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text);
  font-family: inherit;
}
.gurus-chip small {
  background: #fff;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10.5px;
  color: var(--text-secondary);
}
.gurus-chip:hover {
  background: #e2e8f0;
}
.gurus-chip.active {
  background: var(--chip-color, var(--primary, #2563eb));
  border-color: var(--chip-color, var(--primary, #2563eb));
  color: #fff;
}
.gurus-chip.active small {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.gurus-stats {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.gurus-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  grid-column: 1 / -1;
}

/* 카드 그리드 */
.gurus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

/* 데이터 캐싱 안 된 카드 — 살짝 dim */
.guru-card.pending {
  opacity: 0.82;
  border-style: dashed;
}
.guru-card.pending:hover { opacity: 1; }
.guru-card-pending {
  background: #f8fafc !important;
  color: var(--text-secondary) !important;
}
.guru-card-pending .card-top-label {
  font-size: 11px !important;
}
.guru-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.guru-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.10);
  border-color: var(--primary);
}
.guru-card-header { display: flex; gap: 12px; align-items: center; }
.guru-card-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}
.guru-card-name { flex: 1; min-width: 0; }
.card-name-row { display: flex; gap: 6px; align-items: baseline; }
.card-name-ko { font-size: 16px; font-weight: 700; }
.card-flag { font-size: 14px; }
.card-name-en { font-size: 12px; color: var(--text-secondary); }
.guru-card-fund {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
.guru-card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.card-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 11px;
}
.card-tag-since {
  font-size: 11px;
  color: var(--text-secondary);
  padding: 3px 8px;
  background: #f1f5f9;
  border-radius: 11px;
}
.guru-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light, #eff6ff);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12.5px;
}
.card-top-label { color: var(--text-secondary); font-size: 11px; }
.card-top-ticker { font-weight: 700; color: var(--primary, #2563eb); }
.card-top-pct { margin-left: auto; font-weight: 600; }
.guru-card-aum {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.guru-card-famous {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  margin-top: 2px;
}

/* 전체 거장 포트폴리오 요약 */
.gurus-aggregate {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}
.gurus-aggregate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.gurus-aggregate-head h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 3px;
}
.gurus-aggregate-head p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}
.aggregate-metrics { margin-bottom: 16px; }
.guru-bubble-chart {
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 6px;
}
.guru-bubble {
  width: var(--size);
  height: var(--size);
  flex: 0 0 var(--size);
  border-radius: 50%;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,0.42), rgba(255,255,255,0) 34%),
    var(--bubble-color);
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
}
.guru-bubble-rank {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 800;
  opacity: 0.7;
}
.guru-bubble b {
  display: block;
  max-width: 82%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1.1;
}
.guru-bubble small {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.88;
}
.aggregate-table .owner-names {
  color: var(--text-muted);
  font-size: 11px;
}
.aggregate-table .owners-cell {
  cursor: help;
  outline: none;
}
.aggregate-table .owners-cell:hover,
.aggregate-table .owners-cell:focus {
  background: #f8fafc;
}
.aggregate-table .owners-count {
  font-weight: 700;
  color: var(--text);
}
.aggregate-table td:nth-child(4) {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.owner-floating-tooltip {
  position: fixed;
  z-index: 9999;
  display: none;
  max-width: min(420px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.26);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-line;
  pointer-events: none;
}

/* 상세 페이지 */
.gurus-back {
  background: none;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 16px;
}
.gurus-back:hover { background: #f1f5f9; }

.guru-profile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}
.guru-profile-main { display: flex; gap: 18px; align-items: flex-start; }
.guru-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 28px; color: #fff;
  flex-shrink: 0;
}
.guru-profile-text { flex: 1; }
.guru-name-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.guru-profile-text h1 { font-size: 24px; font-weight: 800; margin: 0; }
.guru-style-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 12px;
}
.guru-fund {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 4px 0 12px;
}
.guru-bio {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 10px;
}
.guru-famous {
  font-size: 12.5px;
  color: var(--text-secondary);
  background: #fef9e7;
  padding: 8px 12px;
  border-radius: 6px;
}

/* 지표 그리드 */
.guru-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

/* 2단 그리드 (현재 포트폴리오) */
.guru-2col {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .guru-2col { grid-template-columns: 1fr; }
}

/* 보유 테이블 */
.holdings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.holdings-table th, .holdings-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.holdings-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
}
.holdings-table .rank { color: var(--text-secondary); width: 28px; }
.holdings-table .ticker { font-weight: 700; color: var(--primary, #2563eb); }
.holdings-table .name { color: var(--text); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.holdings-table .pct { text-align: right; }
.holdings-table .val { text-align: right; color: var(--text-secondary); }

.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.pill-new    { background: #dcfce7; color: #166534; }
.pill-add    { background: #dbeafe; color: #1e40af; }
.pill-reduce { background: #fed7aa; color: #9a3412; }
.pill-exit   { background: #fee2e2; color: #991b1b; }
.pill-hold   { background: #f1f5f9; color: #64748b; }

/* 차트 노트 */
.chart-note {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.6;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid var(--border);
}

/* 타임라인 */
.timeline-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}
.leg-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.guru-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tl-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.tl-period { border-right: 1px solid var(--border); padding-right: 12px; }
.tl-period-q { font-size: 15px; font-weight: 700; }
.tl-period-date { font-size: 11px; color: var(--text-secondary); margin: 2px 0; }
.tl-period-aum { font-size: 12px; color: var(--primary, #2563eb); font-weight: 600; margin-top: 4px; }
.tl-content { display: flex; flex-direction: column; gap: 8px; }
.tl-block { display: flex; gap: 10px; align-items: flex-start; }
.tl-block-title {
  font-size: 12px;
  font-weight: 600;
  width: 96px;
  flex-shrink: 0;
  padding-top: 4px;
}
.tl-new    .tl-block-title { color: #15803d; }
.tl-add    .tl-block-title { color: #1d4ed8; }
.tl-reduce .tl-block-title { color: #c2410c; }
.tl-exit   .tl-block-title { color: #b91c1c; }
.tl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 12px;
}
.tl-chip b { color: var(--primary, #2563eb); font-weight: 700; }
.tl-chip small { color: var(--text-secondary); font-weight: 500; font-size: 11px; }
.tl-chip em { font-style: normal; font-weight: 600; color: var(--text); font-size: 11px; }
.tl-chip em.dim { color: var(--text-secondary); font-weight: 400; }
.timeline-empty {
  text-align: center;
  padding: 30px;
  color: var(--text-secondary);
  font-size: 13px;
}

@media (max-width: 800px) {
  .gurus-grid { grid-template-columns: 1fr; }
  .gurus-container { padding: 20px 14px 56px; }
  .gurus-header h1 { font-size: 23px; }
  .gurus-header p,
  .gurus-disclaimer { font-size: 12px; }
  .gurus-aggregate,
  .guru-profile,
  .guru-card { border-radius: 10px; padding: 14px; }
  .gurus-aggregate-head {
    align-items: stretch;
    flex-direction: column;
  }
  .guru-bubble-chart {
    min-height: 180px;
    gap: 7px;
    padding: 8px 0;
  }
  .guru-bubble {
    width: min(var(--size), 96px);
    height: min(var(--size), 96px);
    flex-basis: min(var(--size), 96px);
  }
  .guru-bubble b { font-size: 13px; }
  .guru-bubble small { font-size: 10px; }
  .guru-bubble-rank { top: 7px; font-size: 9px; }
  .tl-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }
  .tl-period {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 0 0 8px;
  }
  .tl-block {
    flex-direction: column;
    gap: 5px;
  }
  .tl-block-title {
    width: auto;
    padding-top: 0;
  }
  .tl-chip {
    max-width: 100%;
    font-size: 11.5px;
  }
  .guru-profile-main { flex-direction: column; }
  .guru-avatar { width: 60px; height: 60px; font-size: 22px; }
  .guru-profile-text { width: 100%; min-width: 0; }
  .guru-profile-text h1 { font-size: 21px; }
  .guru-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .holdings-table { min-width: 520px; }
  .table-wrap,
  .strategy-table-wrap { -webkit-overflow-scrolling: touch; }
}

/* ═══════════════════════════════════════════════════════════════
   전략 랭킹
   ═══════════════════════════════════════════════════════════════ */
.strategy-view {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  background: var(--bg);
}
.has-banner .strategy-view { top: calc(var(--header-h) + 32px); }
.strategy-container {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  padding: 26px 24px 64px;
}
.strategy-view-locked .strategy-container > :not(.strategy-locked-overlay) {
  filter: blur(7px);
  opacity: 0.72;
  pointer-events: none;
  user-select: none;
}
.strategy-locked-overlay {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 20;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(rgba(248, 250, 252, 0.60), rgba(248, 250, 252, 0.72)),
    repeating-linear-gradient(45deg, rgba(15, 23, 42, 0.08) 0 8px, transparent 8px 16px);
}
.has-banner .strategy-locked-overlay { top: calc(var(--header-h) + 32px); }
.strategy-view-locked .strategy-locked-overlay { display: flex; }
.strategy-locked-panel {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.strategy-locked-eyebrow {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 12px;
}
.strategy-locked-panel h2 {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 800;
  margin-bottom: 8px;
}
.strategy-locked-panel p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}
.strategy-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.strategy-header h1 { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.strategy-header p { color: var(--text-secondary); font-size: 13px; }
.strategy-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) minmax(120px, 0.7fr) minmax(140px, 0.8fr) minmax(220px, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.strategy-file-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -2px 0 14px;
}
.strategy-file-breakdown span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 700;
}
.strategy-control { display: flex; flex-direction: column; gap: 5px; }
.strategy-control label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}
.strategy-control select,
.strategy-control input {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.strategy-control select:focus,
.strategy-control input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
}
.strategy-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.strategy-stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 0;
}
.strategy-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 4px;
}
.strategy-stat-value {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strategy-stat-sub {
  font-size: 11px;
  color: var(--success);
  margin-top: 3px;
  min-height: 16px;
}
.strategy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 14px;
  align-items: start;
}
.strategy-rank-panel,
.strategy-detail-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.strategy-rank-panel { min-width: 0; overflow: hidden; }
.strategy-table-wrap { overflow-x: auto; }
.strategy-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}
.strategy-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.strategy-table th:nth-child(1),
.strategy-table th:nth-child(2),
.strategy-table th:nth-child(3) { text-align: left; }
.strategy-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #eef2f7;
  font-size: 12.5px;
  vertical-align: middle;
}
.strategy-table tbody tr { cursor: pointer; }
.strategy-table tbody tr:hover { background: #f8fafc; }
.strategy-table tbody tr.active { background: #eff6ff; }
.rank-cell {
  width: 54px;
  color: var(--text-secondary);
  font-weight: 800;
}
.strategy-row-title {
  max-width: 420px;
  color: var(--text);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.strategy-row-sub {
  max-width: 420px;
  color: var(--text-secondary);
  font-size: 11px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.strategy-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.strategy-table .danger { color: #b91c1c; }
.strategy-kind {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.strategy-kind.stock { background: #ecfdf5; color: #047857; }
.strategy-kind.etf { background: #fff7ed; color: #c2410c; }
.strategy-detail-panel {
  position: sticky;
  top: 18px;
  padding: 16px;
}
.strategy-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.strategy-detail-kicker {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 5px;
}
.strategy-detail-head h2 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
}
.strategy-score {
  min-width: 58px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.strategy-detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}
.strategy-metric {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
}
.strategy-metric span,
.strategy-metric small {
  display: block;
  color: var(--text-secondary);
  font-size: 11px;
}
.strategy-metric b {
  display: block;
  font-size: 18px;
  margin: 2px 0;
  font-variant-numeric: tabular-nums;
}
.strategy-detail-section { margin-top: 14px; }
.strategy-detail-section h3 {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}
.strategy-setting-list {
  display: grid;
  gap: 6px;
}
.strategy-setting-row {
  display: grid;
  grid-template-columns: 24px minmax(88px, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #f8fafc;
}
.strategy-setting-index {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 800;
}
.strategy-setting-label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
}
.strategy-setting-row b {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}
.strategy-chip-list,
.strategy-holdings,
.strategy-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.strategy-factor-chip,
.strategy-holding,
.strategy-settings span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 12px;
}
.strategy-factor-chip b { font-weight: 800; }
.strategy-holding b {
  font-weight: 800;
}
.strategy-holding em {
  color: var(--text-secondary);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}
.strategy-factor-chip small,
.strategy-holding small {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 800;
}
.strategy-holding small {
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e2e8f0;
}
.strategy-muted,
.strategy-detail-empty {
  color: var(--text-secondary);
  font-size: 13px;
  padding: 12px 0;
}

@media (max-width: 1180px) {
  .strategy-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strategy-layout { grid-template-columns: 1fr; }
  .strategy-detail-panel { position: static; }
}
@media (max-width: 760px) {
  :root { --header-h: 104px; }
  .header {
    min-height: var(--header-h);
    height: auto;
    flex-wrap: wrap;
    align-content: center;
    gap: 8px 10px;
    padding: 8px 12px;
  }
  .header-logo { font-size: 17px; }
  .header-nav {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
  }
  .header-nav a {
    min-width: 0;
    padding: 7px 6px;
    text-align: center;
    font-size: 12px;
  }
  .header-lab-menu {
    top: calc(100% - 6px);
    left: 12px;
    right: 12px;
    min-width: 0;
  }
  .header-user {
    margin-left: auto;
    padding-right: 0;
  }
  .auth-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .strategy-container { padding: 18px 12px 48px; }
  .strategy-header { align-items: stretch; flex-direction: column; }
  .strategy-header h1 { font-size: 22px; }
  .strategy-header p { line-height: 1.55; }
  .strategy-controls,
  .strategy-stats,
  .strategy-detail-metrics { grid-template-columns: 1fr; }
  .strategy-rank-panel,
  .strategy-detail-panel { border-radius: 8px; }
  .strategy-detail-panel { padding: 12px; }
  .strategy-detail-head { flex-direction: column; gap: 8px; }
  .strategy-score {
    width: 100%;
    height: 32px;
  }
  .strategy-table { min-width: 0; }
  .strategy-table th,
  .strategy-table td { padding: 9px 8px; }
  .strategy-table th:nth-child(n+6),
  .strategy-table td:nth-child(n+6) { display: none; }
  .strategy-table th:nth-child(4),
  .strategy-table td:nth-child(4),
  .strategy-table th:nth-child(5),
  .strategy-table td:nth-child(5) { display: none; }
  .rank-cell { width: 38px; }
  .strategy-row-title,
  .strategy-row-sub { max-width: 46vw; }
  .strategy-kind {
    height: 20px;
    padding: 0 6px;
    font-size: 10px;
  }
  .strategy-setting-row {
    grid-template-columns: 22px minmax(72px, 0.75fr) minmax(0, 1.25fr);
    gap: 6px;
  }
  .strategy-factor-chip,
  .strategy-holding,
  .strategy-settings span {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 420px) {
  .header { padding-left: 10px; padding-right: 10px; }
  .header-logo { font-size: 16px; gap: 6px; }
  .header-nav a { font-size: 11.5px; padding-left: 4px; padding-right: 4px; }
}

/* ═══════════════════════════════════════════════════════════════
   ETF · 자산배분 백테스트
   ═══════════════════════════════════════════════════════════════ */
.etf-view {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  background: var(--bg);
}
.has-banner .etf-view { top: calc(var(--header-h) + 32px); }
.etf-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}
.etf-header h1 { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.etf-header p { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }

.etf-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.etf-section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.etf-section-title .hint-text { font-weight: 400; color: var(--text-secondary); font-size: 12px; }
.etf-section h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* 프리셋 그리드 */
.etf-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.etf-preset-card {
  background: #f8fafc;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.etf-preset-card:hover {
  border-color: var(--primary, #2563eb);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.etf-preset-card.active {
  border-color: var(--primary, #2563eb);
  background: #eff6ff;
}
.etf-preset-card.etf-preset-custom {
  border-style: dashed;
  background: linear-gradient(135deg, #f0f9ff 0%, #fef3c7 100%);
}
.etf-preset-card.etf-preset-custom.active {
  background: linear-gradient(135deg, #dbeafe 0%, #fde68a 100%);
  border-style: solid;
}
.etf-preset-card.etf-preset-custom .etf-preset-title { color: #b45309; }
.etf-preset-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.etf-preset-author { font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; }
.etf-preset-philosophy {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 8px;
  min-height: 36px;
}
.etf-preset-alloc { display: flex; flex-wrap: wrap; gap: 4px; }
.etf-preset-chip {
  background: #fff;
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}
.etf-preset-chip b { color: var(--primary, #2563eb); font-weight: 600; }

/* 비중 합 표시 + ? 도움말 */
.etf-weight-sum-wrap {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.etf-weight-sum {
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
}
.etf-weight-sum.ok { background: #dcfce7; color: #166534; }
.etf-weight-sum.warn { background: #fef9c3; color: #854d0e; }

/* ? 도움말 (호버 툴팁) */
.etf-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--border, #cbd5e1);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  user-select: none;
  outline: none;
}
.etf-help:hover, .etf-help:focus { background: var(--primary, #2563eb); }
.etf-help-tip {
  position: absolute;
  top: calc(100% + 8px);
  right: -8px;
  width: 320px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 100;
  pointer-events: none;
  white-space: normal;
}
.etf-help-tip::before {
  content: "";
  position: absolute;
  top: -5px; right: 12px;
  width: 10px; height: 10px;
  background: #0f172a;
  transform: rotate(45deg);
}
.etf-help-tip b { color: #fde68a; font-weight: 600; }
.etf-help:hover .etf-help-tip,
.etf-help:focus .etf-help-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ETF 브라우저 (검색 + 카테고리) */
.etf-btn-primary {
  padding: 8px 18px;
  background: var(--primary, #2563eb);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  transition: background 0.15s;
}
.etf-btn-primary:hover { background: #1d4ed8; }

.etf-browser {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.etf-browser-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.etf-browser-icon { font-size: 14px; color: var(--text-secondary); }
.etf-browser-search input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  outline: none;
}
.etf-browser-search input:focus {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.etf-browser-close {
  width: 30px; height: 30px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1;
}
.etf-browser-close:hover { background: #fef2f2; color: #b91c1c; }

/* 카테고리 칩 */
.etf-categories { padding: 14px; }
.etf-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.etf-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 18px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text);
  transition: all 0.12s;
  font-family: inherit;
}
.etf-cat-chip small {
  background: #fff;
  border-radius: 8px;
  padding: 1px 6px;
  font-size: 10.5px;
  color: var(--text-secondary);
}
.etf-cat-chip:hover { background: #e2e8f0; }
.etf-cat-chip.active {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #fff;
}
.etf-cat-chip.active small {
  background: rgba(255,255,255,0.25);
  color: #fff;
}
.etf-cat-current {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

/* ETF 카드 그리드 */
.etf-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.etf-tile {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.12s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.etf-tile:hover {
  background: #fff;
  border-color: var(--primary, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}
.etf-tile.added {
  background: #f0fdf4;
  border-color: #86efac;
  cursor: default;
}
.etf-tile.added:hover {
  transform: none;
  box-shadow: none;
  background: #f0fdf4;
}
.etf-tile-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.etf-tile-ticker {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary, #2563eb);
  font-family: 'SF Mono', Menlo, monospace;
}
.etf-tile.added .etf-tile-ticker { color: #166534; }
.etf-tile-add {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}
.etf-tile:hover .etf-tile-add { color: var(--primary, #2563eb); }
.etf-tile-badge {
  font-size: 10.5px;
  font-weight: 600;
  color: #166534;
  background: #dcfce7;
  padding: 2px 8px;
  border-radius: 10px;
}
.etf-tile-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.etf-tile-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 30px;
}
.etf-tile-meta {
  font-size: 10.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* 검색 결과 */
.etf-search-results { padding: 14px; }
.etf-search-summary {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 500;
}
.etf-search-empty {
  text-align: center;
  padding: 30px 20px;
}
.etf-search-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.etf-search-empty-hint {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* yfinance lookup 로딩 */
.etf-search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 20px;
  font-size: 13px;
  color: var(--text-secondary);
}
.etf-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e2e8f0;
  border-top-color: var(--primary, #2563eb);
  border-radius: 50%;
  animation: etf-spin 0.7s linear infinite;
}
@keyframes etf-spin { to { transform: rotate(360deg); } }


/* ETF 편집 행 */
.etf-allocation {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.etf-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 13px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed var(--border);
}
.etf-alloc-row {
  display: grid;
  grid-template-columns: 1.2fr 2fr 100px 32px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.etf-alloc-info { min-width: 0; }
.etf-alloc-ticker {
  font-size: 14px;
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 2px;
}
.etf-alloc-ticker b { font-weight: 700; color: var(--primary, #2563eb); }
.etf-alloc-name { font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etf-alloc-desc {
  font-size: 11px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.etf-alloc-desc em { font-style: italic; color: var(--primary, #2563eb); }
.etf-alloc-slider input[type="range"] { width: 100%; }
.etf-alloc-value {
  display: flex; align-items: center; gap: 4px;
}
.etf-alloc-num {
  width: 60px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  text-align: right;
  font-family: inherit;
}
.etf-alloc-value span { color: var(--text-secondary); font-size: 12px; }
.etf-alloc-remove {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-secondary);
}
.etf-alloc-remove:hover { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.etf-add-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.etf-add-row select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}
.etf-btn-secondary {
  padding: 7px 14px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.etf-btn-secondary:hover { background: #e2e8f0; }

/* 설정 그리드 */
.etf-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}
.etf-setting-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.etf-setting-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.etf-setting-field input,
.etf-setting-field select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}
.etf-setting-field small {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.etf-period-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

@media (max-width: 800px) {
  .etf-presets-grid { grid-template-columns: 1fr; }
  .etf-alloc-row { grid-template-columns: 1fr 100px 32px; }
  .etf-alloc-slider { grid-column: 1 / -1; }
}

/* ═══════════════════════════════════════════════════════════════
   📚 시작하기 (INTRO) — Emerald 톤으로 다른 탭과 차별화
   ═══════════════════════════════════════════════════════════════ */

/* 헤더 탭의 "📚 시작하기" 자체 강조 — emerald underline */
.header-nav a.nav-intro {
  color: #6ee7b7;
  position: relative;
}
.header-nav a.nav-intro:hover,
.header-nav a.nav-intro.active {
  color: #fff;
  background: rgba(16,185,129,0.18);
}
.header-nav a.nav-intro.active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 6px;
  height: 2px;
  background: #10b981;
  border-radius: 2px;
}

/* intro 모드일 때 헤더 자체 살짝 다른 색 — 전체적 톤 차별화 */
body.intro-theme .header {
  background: linear-gradient(135deg, #064e3b 0%, #0f172a 80%);
}

.intro-view {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  background: linear-gradient(180deg, #ecfdf5 0%, #f8fafc 240px);
}
.has-banner .intro-view { top: calc(var(--header-h) + 32px); }

.intro-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ── 헤더 ── */
.intro-header { margin-bottom: 28px; }
.intro-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #047857;
  background: #d1fae5;
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.intro-header h1 {
  font-size: 32px;
  font-weight: 800;
  color: #064e3b;
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}
.intro-header p {
  font-size: 15px;
  color: #475569;
  line-height: 1.7;
  max-width: 740px;
}

/* ── 레이아웃: 좌측 sticky nav + 우측 content ── */
.intro-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 900px) {
  .intro-layout { grid-template-columns: 1fr; }
  .intro-nav { position: static !important; }
}

.intro-nav {
  position: sticky;
  top: 12px;
  background: #fff;
  border: 1px solid #d1fae5;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(16,185,129,0.06);
}
.intro-nav-title {
  font-size: 11px;
  font-weight: 700;
  color: #047857;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #d1fae5;
}
.intro-nav-link {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: #374151;
  text-decoration: none;
  margin-bottom: 4px;
  transition: all 0.15s;
}
.intro-nav-link:hover {
  background: #ecfdf5;
  color: #047857;
}
.intro-nav-link.active {
  background: #10b981;
  color: #fff;
  font-weight: 600;
}
.intro-nav-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #d1fae5;
  font-size: 11px;
  color: #64748b;
  line-height: 1.6;
}
.intro-nav-foot b { color: #047857; }

/* ── 카테고리 섹션 ── */
.intro-cat {
  scroll-margin-top: 20px;
  margin-bottom: 40px;
}
.intro-cat-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #064e3b;
  margin: 0 0 4px;
}
.intro-cat-header p {
  color: #64748b;
  font-size: 13.5px;
  margin: 0 0 18px;
}

/* ── 카드 그리드 ── */
.intro-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.intro-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px 20px;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
}
.intro-card:hover {
  border-color: #10b981;
  box-shadow: 0 6px 18px rgba(16,185,129,0.10);
  transform: translateY(-1px);
}

.intro-card-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.intro-card-name {
  font-size: 17px;
  font-weight: 700;
  color: #064e3b;
}
.intro-card-en {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

.intro-card-oneliner {
  font-size: 13.5px;
  color: #047857;
  background: #ecfdf5;
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 3px solid #10b981;
  margin-bottom: 12px;
  font-weight: 500;
  line-height: 1.6;
}

.intro-card-body {
  font-size: 13px;
  color: #374151;
  line-height: 1.75;
  margin-bottom: 12px;
}
.intro-card-body b { color: #064e3b; font-weight: 600; }
.intro-card-body ul { margin: 6px 0; padding-left: 22px; }
.intro-card-body li { margin-bottom: 2px; }

.intro-card-chart {
  position: relative;
  height: 140px;
  margin-bottom: 12px;
  padding-top: 4px;
  border-top: 1px dashed #d1fae5;
}

.intro-card-used {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.6;
}
.intro-card-used b { color: #047857; }

/* 클릭 가능한 버튼 형태 */
button.intro-card-used.clickable {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  background: #ecfdf5;
  border: 1px solid #d1fae5;
  border-radius: 8px;
  padding: 9px 12px;
  margin-top: 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all 0.15s;
}
button.intro-card-used.clickable:hover {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16,185,129,0.20);
}
button.intro-card-used.clickable:hover .intro-used-text,
button.intro-card-used.clickable:hover .intro-used-text b {
  color: #fff;
}
button.intro-card-used.clickable:hover .intro-used-arrow {
  color: #fff;
}
.intro-used-text {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.6;
}
.intro-used-text b { color: #047857; }
.intro-used-arrow {
  font-size: 12.5px;
  font-weight: 600;
  color: #047857;
  text-align: right;
}

@media (max-width: 600px) {
  .intro-cards { grid-template-columns: 1fr; }
  .intro-header h1 { font-size: 24px; }
}

/* ═══════════════════════════════════════════════════════════════
   인증 — 헤더 위젯 / 로그인 모달 / 내 저장소
   ═══════════════════════════════════════════════════════════════ */

.header { display: flex; align-items: center; }
.header-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 14px;
}
.auth-btn {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.16);
  color: #e2e8f0;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.auth-btn:hover { background: rgba(255,255,255,0.18); color: #fff; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 4px 12px 4px 4px;
  border-radius: 20px;
  cursor: pointer;
  position: relative;
  color: #e2e8f0;
  font-size: 13px;
}
.user-chip:hover { background: rgba(255,255,255,0.16); color: #fff; }
.user-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: #475569;
}
.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  color: #0f172a;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  padding: 6px;
  min-width: 160px;
  display: none;
  z-index: 200;
}
.user-chip.open .user-menu { display: block; }
.user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  border-radius: 6px;
  color: #0f172a;
}
.user-menu-item:hover { background: #f1f5f9; }

/* ── 모달 공통 ─────────────────────────────────────── */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.auth-modal[style*="flex"] { display: flex !important; }
.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.auth-modal-panel {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 28px 28px 22px;
  width: min(420px, 92vw);
  box-shadow: 0 30px 80px rgba(0,0,0,0.30);
}
.auth-modal-panel.saves-panel { width: min(640px, 94vw); padding-bottom: 8px; }
.auth-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  color: #475569;
}
.auth-modal-close:hover { background: #fee2e2; color: #b91c1c; }
.auth-modal-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
  color: #0f172a;
}
.auth-modal-sub {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ── 로그인 provider 버튼들 ───────────────────────── */
.auth-providers { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.auth-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.auth-provider:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.auth-provider.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: auto;
}
.auth-google { background: #fff; color: #1f2937; border-color: #d1d5db; }
.auth-kakao { background: #FEE500; color: #381e1e; border-color: #FEE500; }
.auth-naver { background: #03C75A; color: #fff; border-color: #03C75A; }

.auth-modal-note {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.7;
  padding: 9px 12px;
  background: #f8fafc;
  border-left: 3px solid #cbd5e1;
  border-radius: 4px;
}
.auth-modal-note code {
  background: #e2e8f0;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}

/* ── 내 저장소 모달 ──────────────────────────────── */
.saves-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e2e8f0;
  margin: 14px 0 0;
}
.saves-tab {
  background: none;
  border: none;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
}
.saves-tab.active {
  color: var(--primary, #2563eb);
  border-bottom-color: var(--primary, #2563eb);
}
.saves-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 14px 0;
}
.saves-empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.7;
}
.saves-list { display: flex; flex-direction: column; gap: 8px; }
.saves-group { margin-bottom: 18px; }
.saves-group:last-child { margin-bottom: 0; }
.saves-group-title {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}
.saves-empty-sub {
  text-align: left;
  padding: 12px 4px;
  font-size: 12px;
  color: #94a3b8;
}
.save-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: all 0.12s;
}
.save-row:hover { background: #fff; border-color: var(--primary, #2563eb); }
.save-info { flex: 1; min-width: 0; }
.save-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.save-meta { font-size: 11px; color: #64748b; margin-top: 2px; }
.save-tickers {
  font-size: 11px;
  color: #475569;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'SF Mono', Menlo, monospace;
}
.save-actions { display: flex; gap: 6px; }
.save-btn-primary, .save-btn-secondary {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid transparent;
}
.save-btn-primary { background: var(--primary, #2563eb); color: #fff; }
.save-btn-primary:hover { background: #1d4ed8; }
.save-btn-secondary { background: #fff; color: #64748b; border-color: var(--border); }
.save-btn-secondary:hover { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* ── Admin Usage ───────────────────────────────────────────────── */
.admin-view {
  min-height: calc(100vh - var(--nav-h));
  padding: 28px 20px 48px;
  background: #f8fafc;
}
.admin-container {
  max-width: 1280px;
  margin: 0 auto;
}
.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.admin-header h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: 0;
  color: #0f172a;
}
.admin-header p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.admin-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
}
.admin-stat-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.admin-stat-value {
  margin-top: 8px;
  color: #0f172a;
  font-size: 26px;
  font-weight: 800;
}
.admin-grid {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 16px;
}
.admin-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.admin-panel h2 {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 15px;
  color: #0f172a;
}
.admin-table-wrap {
  overflow: auto;
  max-height: 620px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}
.admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}
.admin-table td {
  color: #334155;
}
.admin-empty {
  color: #94a3b8;
  text-align: center !important;
  padding: 26px 12px !important;
}
.admin-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #dcfce7;
  color: #166534;
  font-size: 10px;
  font-weight: 800;
}

@media (max-width: 760px) {
  .header-user { padding-right: 0; }
  .user-chip { max-width: 140px; }
  .user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .stepper { padding: 0 14px; }
  .step-line { margin-left: 5px; margin-right: 5px; }
  .step-nav-bar { padding: 0 14px; }
  .btn-step { padding: 10px 16px; }
  .prefetch-banner {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
  }
  .prefetch-text {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    white-space: normal;
  }
  .toast {
    left: 12px;
    right: 12px;
    bottom: calc(var(--nav-h) + 12px);
    text-align: center;
  }
  .auth-modal-panel {
    width: calc(100vw - 28px);
    max-width: none;
  }
  .save-row {
    align-items: stretch;
    flex-direction: column;
  }
  .save-actions { justify-content: flex-end; }
  .admin-view { padding: 18px 12px 36px; }
  .admin-header {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .grid-4,
  .grid-5 { grid-template-columns: 1fr; }
  .etf-container,
  .gurus-container,
  .strategy-container,
  .admin-container,
  .intro-container { padding-left: 12px; padding-right: 12px; }
  .etf-section { padding: 14px 12px; }
  .intro-nav { padding: 10px; }
}
