:root {
  --bg-ivory: #fdfcf7;
  --surface: #ffffff;
  --brand: #5a4e8f;
  --brand-dark: #4a3e7f;
  --accent: #92400e;
  --accent-soft: #ede9d8;
  --text-primary: #1f2937;
  --text-secondary: #475569;
  --text-muted: #6b7280;
  --text-tertiary: #9ca3af;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --success: #15803d;
  --warning: #92400e;
  --danger: #dc2626;
  --bg-purple-soft: #f0ecff;
  --bg-orange-soft: #fef3e6;
  --bg-soft: #f8fafc;
  --gray-warm: #94a3b8;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: 'Pretendard Variable', 'Pretendard', system-ui, -apple-system, sans-serif;
  background: var(--bg-ivory);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 70px;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  overflow-x: hidden;
}

/* 헤더 */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-ivory);
  padding: 12px 22px 10px;
  border-bottom: 0.5px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.logo { font-size: 18px; font-weight: 600; color: var(--brand); white-space: nowrap; }
.logo .dot { color: var(--accent); }
.menu-info {
  font-size: 11px; color: var(--text-secondary);
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.header-icon { font-size: 16px; cursor: pointer; padding: 4px; background: none; border: none; color: inherit; text-decoration: none; }

/* 칩바 */
.chips-bar {
  position: sticky; top: 50px; z-index: 99;
  background: var(--bg-ivory);
  padding: 10px 16px;
  border-bottom: 0.5px solid var(--border);
  display: flex; gap: 6px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.chips-bar::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 0.5px solid var(--border-strong);
  font-size: 11px; color: var(--text-secondary);
  cursor: pointer; white-space: nowrap; transition: all 0.15s; font-family: inherit;
}
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* 본문 */
.content { padding: 16px 22px; }
.screen { display: none; }
.screen.active { display: block; }

/* 타이틀 */
.page-title { font-size: 18px; font-weight: 600; color: var(--brand); margin-bottom: 4px; }
.page-sub { font-size: 11px; color: var(--text-muted); margin-bottom: 14px; }
.section-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; margin-top: 16px; }
.section-title:first-child { margin-top: 0; }

/* 카드 */
.card { background: var(--surface); border: 0.5px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.card-brand { background: var(--brand); color: #fff; border: none; border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.card-soft { background: var(--accent-soft); border: none; border-radius: 12px; padding: 14px; margin-bottom: 12px; color: var(--accent); }

/* 버튼 */
.btn-primary {
  display: block; width: 100%; padding: 12px;
  background: var(--brand); color: #fff; border: none; border-radius: 10px;
  font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit; text-align: center; text-decoration: none;
}
.btn-secondary {
  display: block; width: 100%; padding: 12px;
  background: var(--bg-ivory); color: var(--brand); border: 0.5px solid var(--brand); border-radius: 10px;
  font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit; text-align: center; text-decoration: none;
}

/* placeholder */
.placeholder-hero { background: var(--accent-soft); border-radius: 12px; padding: 24px 16px; text-align: center; margin-bottom: 14px; }
.placeholder-hero .ph-emoji { font-size: 36px; margin-bottom: 8px; }
.placeholder-hero .ph-title { font-size: 15px; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.placeholder-hero .ph-sub { font-size: 11px; color: var(--accent); opacity: 0.85; margin-bottom: 10px; }
.placeholder-hero .ph-badge { display: inline-block; padding: 4px 14px; background: var(--accent); color: #fff; border-radius: 11px; font-size: 10px; font-weight: 600; }
.placeholder-card { background: var(--surface); border: 0.5px dashed var(--border); border-radius: 8px; padding: 12px; margin-bottom: 8px; }
.placeholder-card .pc-title { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; }
.placeholder-card .pc-desc { font-size: 9px; color: var(--text-tertiary); }

/* helper */
.helper-text { font-size: 10px; color: var(--text-tertiary); text-align: center; margin-top: 8px; }
.divider { border-top: 0.5px solid var(--border); margin: 14px 0; }

/* 탭바 */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-ivory); border-top: 0.5px solid var(--border);
  height: 66px; z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
  max-width: 480px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.tabbar-page { display: contents; }
.tabbar-page.hidden { display: none; }
.tab-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; padding: 4px 0;
  background: none; border: none; font-family: inherit; text-decoration: none; color: inherit;
}
.tab-item .tab-icon { font-size: 22px; opacity: 0.55; }
.tab-item .tab-label { font-size: 11px; color: var(--text-tertiary); }
.tab-item.active { background: var(--accent-soft); border-radius: 8px; margin: 4px 6px; }
.tab-item.active .tab-icon { opacity: 1; }
.tab-item.active .tab-label { color: var(--brand); font-weight: 600; }
.tab-item.premium { background: #fef3c7; border: 0.5px solid #fbbf24; border-radius: 8px; margin: 4px 6px; }
.tab-item.premium .tab-icon { opacity: 1; }
.tab-item.premium .tab-label { color: var(--accent); font-weight: 600; }
.tab-arrow {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg-ivory); border: 0.5px solid var(--brand); border-radius: 8px;
  margin: 8px 6px; cursor: pointer; font-family: inherit; color: var(--brand);
}
.tab-arrow .arrow-char { font-size: 18px; font-weight: 600; }
.tab-arrow .arrow-page { font-size: 9px; color: var(--text-tertiary); margin-top: 1px; }

/* 반응형 */
@media (min-width: 481px) {
  body { background: #f5f5f5; padding-top: 20px; padding-bottom: 90px; box-shadow: 0 0 24px rgba(0,0,0,0.08); }
}
