/* ===================================
   사주봄 — Design System
   =================================== */

@import url('https://cdn.jsdelivr.net/gh/sunn-us/SUIT/fonts/variable/woff2/SUIT-Variable.css');
@font-face {
  font-family: 'Cafe24Ssurround';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2105_2@1.0/Cafe24Ssurround.woff') format('woff');
  font-weight: normal;
  font-display: swap;
}

/* --- CSS Variables --- */
:root {
  --navy: #0f1b2d;
  --navy-light: #1a2a42;
  --gold: #111111;
  --gold-light: #555555;
  --accent-bg: #FF7172;
  --cream: #fefefe;
  --cream-dark: #fefefe;
  --surface: #fefefe;
  --border: #e5e5e5;
  --main: #111111;
  --foreground: rgba(17,17,17,0.8);   /* 80% — 제목, 강조 */
  --muted: rgba(17,17,17,0.7);        /* 70% — 본문, 라벨 */
  --disabled: rgba(17,17,17,0.5);     /* 50% — 비활성화, 플레이스홀더 */
  --error: #dc2626;
  --accent: var(--gold);

  /* elements */
  --el-wood: #81C784;
  --el-fire: #E57373;
  --el-earth: #FFD54F;
  --el-metal: #B0BEC5;
  --el-water: #64B5F6;

  --font-heading: 'Cafe24Ssurround', sans-serif;
  --font-body: 'SUIT Variable', 'SUIT', sans-serif;
  --font-ui: 'SUIT Variable', 'SUIT', sans-serif;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--foreground);
  background: var(--cream);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

input, select {
  font-family: inherit;
  font-size: inherit;
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

/* --- Typography --- */
h1, h2, h3 {
  line-height: 1.3;
}
h1, h2 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}
h3 {
  font-family: var(--font-body);
}

h1 { font-size: 2.25rem; font-weight: 800; }
h2 { font-size: 1.4375rem; font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 700; }

/* --- Layout --- */
.page-wrap {
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  min-height: 100vh;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding-bottom: 88px; /* bottom nav space */
}

.page-content {
  padding: 2rem 1rem;
}

.text-center { text-align: center; }

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  font-family: var(--font-body);
  font-size: 1.4375rem;
  font-weight: 800;
  color: var(--gold);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1rem;
  font-weight: 400;
}
.header-divider {
  width: 1px;
  height: 0.875rem;
  background: var(--border);
}

.header-nav a {
  color: var(--muted);
  transition: color 0.2s;
}

.header-nav a:hover {
  color: var(--foreground);
}

.header-nav a.btn-primary,
.mobile-menu a.btn-primary {
  color: #f4f4f4;
}

.hamburger {
  padding: 0.5rem;
  display: none;
  align-items: center;
}

.hamburger svg {
  width: 24px;
  height: 24px;
}

/* Mobile menu (toggle with JS) */
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  color: var(--muted);
  font-size: 1rem;
}

.mobile-menu a:hover {
  color: var(--foreground);
}

/* --- Profile Scroll --- */
.profile-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}
.profile-scroll::-webkit-scrollbar {
  display: none;
}
.profile-card {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  cursor: pointer;
  text-decoration: none;
  color: var(--foreground);
  min-width: 5.5rem;
  transition: background 0.2s, border-color 0.2s;
}
.profile-card.selected {
  background: var(--accent-bg);
  border-color: var(--accent-bg);
  color: #f4f4f4;
}
.profile-card.selected .profile-meta {
  color: rgba(244,244,244,0.7);
}
.profile-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: rgba(255,113,114,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.0625rem;
}
.profile-card.selected .profile-avatar {
  background: rgba(255,255,255,0.2);
}
.profile-add .profile-avatar {
  font-size: 1.4375rem;
  font-weight: 400;
}
.profile-name {
  font-size: 1.125rem;
  font-weight: 700;
}
.profile-meta {
  font-size: 0.875rem;
  color: var(--muted);
}

/* --- Profile Select Grid --- */
.profile-select-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.profile-select-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  cursor: pointer;
  text-align: left;
  color: var(--foreground);
  transition: background 0.2s, border-color 0.2s;
}
.profile-select-card.selected {
  background: var(--accent-bg);
  border-color: var(--accent-bg);
  color: #f4f4f4;
}
.profile-select-card.selected .profile-meta {
  color: rgba(244,244,244,0.7);
}
.profile-select-card.selected .profile-avatar {
  background: rgba(255,255,255,0.2);
}

/* --- Result List --- */
.result-list-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
}

/* --- Chat --- */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px - 72px);
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.chat-msg {
  display: flex;
  gap: 0.5rem;
  max-width: 85%;
}
.chat-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chat-msg-ai {
  align-self: flex-start;
}
.chat-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent-bg);
  color: #f4f4f4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}
.chat-bubble {
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 1rem;
  line-height: 1.6;
}
.chat-bubble p + p {
  margin-top: 0.5rem;
}
.chat-msg-ai .chat-bubble {
  background: rgba(255,113,114,0.1);
  color: var(--foreground);
}
.chat-msg-user .chat-bubble {
  background: var(--accent-bg);
  color: #f4f4f4;
}
.chat-input-wrap {
  padding: 0.5rem 1rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.chat-input-inner {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 1rem;
  font-family: var(--font-ui);
  background: rgba(255,113,114,0.1);
  color: var(--foreground);
  outline: none;
}
.chat-input:focus {
  border-color: rgba(255,113,114,0.8);
}
.chat-send-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--accent-bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-send-btn svg {
  width: 1.125rem;
  height: 1.125rem;
  stroke: #f4f4f4;
}

/* --- Storage Card --- */
.storage-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  text-decoration: none;
  color: var(--foreground);
  transition: background 0.2s;
}
.storage-card:hover {
  background: var(--accent-bg);
  border-color: var(--accent-bg);
  color: #f4f4f4;
}
.storage-card:hover .storage-card-detail,
.storage-card:hover .storage-card-date {
  color: rgba(244,244,244,0.7);
}
.storage-card-name {
  font-weight: 700;
  font-size: 1.0625rem;
}
.storage-card-detail {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.125rem;
}
.storage-card-date {
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
}

.storage-empty {
  text-align: center;
  padding: 4rem 1rem;
}
.storage-empty-icon {
  font-size: 2.875rem;
  margin-bottom: 0.75rem;
}
.storage-empty-text {
  color: var(--muted);
  font-size: 1rem;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2rem 1rem;
}

.footer-inner {
  max-width: 480px;
  margin: 0 auto;
}

.footer-top {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-brand {
  font-family: var(--font-body);
  font-weight: 800;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a:hover {
  color: var(--foreground);
}

.footer-bottom {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
}

/* --- Share FAB --- */
.share-fab-wrap {
  position: fixed;
  bottom: 80px;
  right: calc(50% - 240px + 16px);
  z-index: 99;
}
.share-fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.share-fab svg {
  width: 22px;
  height: 22px;
}
.share-menu {
  position: absolute;
  bottom: 56px;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  display: none;
  flex-direction: column;
  min-width: 180px;
}
.share-menu.open {
  display: flex;
}
.share-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: none;
  background: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--foreground);
  white-space: nowrap;
}
.share-menu-item:hover {
  background: rgba(255,113,114,0.08);
}
.share-menu-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .share-fab-wrap {
    right: 16px;
  }
}

/* --- Bottom Navigation --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.bottom-nav-inner {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.bottom-nav-bar {
  display: flex;
  height: 68px;
  background: var(--surface);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--disabled);
  font-size: 14px;
  font-weight: 400;
}

.bottom-nav-tab.active {
  color: var(--gold);
  font-weight: 700;
}

.bottom-nav-tab svg {
  width: 24px;
  height: 24px;
}

.bottom-nav-center-spacer {
  flex: 1;
}

.bottom-nav-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

.bottom-nav-center-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  border: 4px solid var(--surface);
}

.bottom-nav-center-btn svg {
  width: 24px;
  height: 24px;
  stroke: #fff;
  fill: #fff;
}
.bottom-nav-center-label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.25rem;
  white-space: nowrap;
}

/* --- Login Buttons --- */
.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 24px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.btn-login svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.btn-login-kakao {
  background: #FEE500;
  color: #3C1E1E;
}
.btn-login-naver {
  background: #03C75A;
  color: #fff;
}
.btn-login-google {
  background: #fff;
  color: var(--foreground);
  border: 1px solid var(--border);
}

/* --- Buttons --- */
.btn-primary {
  display: block;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--accent-bg);
  color: #f4f4f4;
  font-weight: 700;
  font-size: 1.0625rem;
  border: 1px solid var(--accent-bg);
  border-radius: 24px;
  text-align: center;
  transition: background 0.2s, border-color 0.2s;
}

.btn-primary:hover {
  background: #FF7172;
  border: 1px solid #FF7172;
  color: #f4f4f4;
}

.btn-primary:disabled {
  background: #d9d9d9;
  color: var(--disabled);
  border-color: #d9d9d9;
  cursor: not-allowed;
}

.btn-secondary {
  display: block;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--surface);
  color: var(--foreground);
  font-weight: 700;
  font-size: 1.0625rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  text-align: center;
  transition: border-color 0.2s;
}

.btn-secondary:hover {
  background: #FF7172;
  border: 1px solid #FF7172;
  color: #f4f4f4;
}

.btn-inline {
  display: inline-block;
  padding: 0.625rem 2rem;
  background: var(--accent-bg);
  color: #f4f4f4;
  font-weight: 700;
  border: 1px solid var(--accent-bg);
  font-size: 1rem;
  border-radius: 24px;
  text-align: center;
}

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card:hover {
  background: #FF7172;
  border: 1px solid #FF7172;
  color: #f4f4f4;
}

/* --- Form Elements --- */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--surface);
  border-radius: 24px;
  background: rgba(255,113,114,0.1);
  font-size: 1rem;
  transition: border-color 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: rgba(255,113,114,0.8);
}

/* Date input group — 하나의 필드처럼 보이는 생년월일 */
.date-input-group {
  display: flex;
  align-items: center;
  border: 1px solid var(--surface);
  border-radius: 24px;
  background: rgba(255,113,114,0.1);
  padding: 0 0.75rem;
  transition: border-color 0.2s;
}

.date-input-group:focus-within {
  border-color: rgba(255,113,114,0.8);
}

.date-input-group input {
  border: none;
  outline: none;
  background: transparent;
  text-align: center;
  font-size: 1rem;
  padding: 0.75rem 0;
  width: 100%;
}

.date-input-group input::placeholder {
  color: var(--disabled);
}

.date-sep {
  color: var(--border);
  font-size: 1rem;
  flex-shrink: 0;
  user-select: none;
}

/* Time input with siji label */
.time-input-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.time-input-group .form-input {
  flex: 1;
}

.siji-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
  white-space: nowrap;
  min-width: 5rem;
  text-align: right;
}

.form-error {
  font-size: 0.875rem;
  color: var(--error);
  margin-top: 0.25rem;
}

/* Option cards (gender, time, etc.) */
.option-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  border: 1px solid var(--surface);
  border-radius: 24px;
  font-size: 1rem;
  font-weight: 400;
  background: rgba(255,113,114,0.1);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.option-card:hover {
  background: #FF7172;
  border: 1px solid #FF7172;
  color: #f4f4f4;
}

.option-card.selected {
  background: #FF7172;
  border: 1px solid rgba(255,113,114,0.8);
  color: #f4f4f4;
  font-weight: 700;
}

.option-card-sm {
  padding: 0.5rem;
  font-size: 0.875rem;
}

/* --- Hero Banner --- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  aspect-ratio: 16 / 9;
  width: 100%;
  text-align: center;
  color: var(--cream);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--gold);
  font-weight: 400;
  margin-bottom: 0.25rem;
}

.hero h1 {
  font-family: var(--font-body);
  font-size: 2rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.hero-desc {
  font-size: 0.875rem;
  color: rgba(250,246,238,0.7);
}

/* --- Service Cards Grid --- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.service-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid #f0f0f0;
  transition: background 0.2s;
}

.service-card:hover {
  background: #fafafa;
}

.service-card-thumb {
  aspect-ratio: 1/1;
  width: 100%;
  overflow: hidden;
  background: var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.875rem;
}

.service-card-body {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.service-card-title {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--foreground);
}

.service-card-desc {
  font-size: 0.875rem;
  color: var(--muted);
}

.service-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  margin-top: 0.375rem;
}

.service-card-price {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gold);
}

.service-card-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  background: var(--accent-bg);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 160px;
  box-shadow: 2px 2px 0px rgba(0,0,0,0.15);
}

/* --- SEO / About Section --- */
.about-section {
  background: var(--cream);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
}

.about-section h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.about-section .subtitle {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.about-section p {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.about-section ul {
  list-style: disc;
  padding-left: 1.25rem;
}

.about-section li {
  font-size: 0.875rem;
  color: var(--disabled);
  margin-bottom: 0.25rem;
}

/* --- Result Page — Common --- */
.result-section-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.result-text {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
}

.result-sub-label {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0.375rem;
}

/* Tags */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.tag {
  display: inline-block;
  font-size: 0.875rem;
  padding: 0.25rem 0.625rem;
  border-radius: 2px;
  font-weight: 400;
}

.tag-good {
  background: rgba(201,169,78,0.12);
  color: var(--gold);
}

.tag-neutral {
  background: #f3f4f6;
  color: var(--muted);
}

.tag-caution {
  background: rgba(239,68,68,0.08);
  color: #dc2626;
}

/* Lucky Items Grid */
.lucky-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.lucky-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  padding: 0.75rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}

.lucky-icon {
  font-size: 1.25rem;
}

.lucky-label {
  font-size: 0.875rem;
  color: var(--muted);
}

.lucky-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
}

/* Title card story */
.title-card .story {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 0.75rem;
}

/* Blur content tags (inside blurred area) */
.blur-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0.5rem 0 1rem;
}

/* --- Result Page — Saju Table (만세력) --- */
.saju-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.25rem;
  text-align: center;
}
.saju-table-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 1rem;
}
.saju-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.saju-table th {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--foreground);
  padding: 0.5rem 0.25rem;
  background: rgba(255, 113, 114, 0.18);
  border: 1px solid rgba(255, 113, 114, 0.25);
}
.saju-table td {
  padding: 0.25rem;
  text-align: center;
  vertical-align: middle;
}

/* 간지 요약행 */
.saju-row-ganji td {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
  padding: 0.375rem 0.25rem;
  background: rgba(255, 113, 114, 0.12);
  border: 1px solid rgba(255, 113, 114, 0.2);
}

/* 십성행 */
.saju-row-sipsung td {
  font-size: 0.875rem;
  color: var(--foreground);
  padding: 0.25rem;
}
.saju-ilgan {
  color: var(--accent-bg) !important;
  font-weight: 700;
}

/* 큰 글자 블록 */
.saju-block {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  font-size: 2.25rem;
  font-weight: 800;
  color: #fff;
  border-radius: 4px;
  font-family: var(--font-body);
}
.saju-block-sm {
  font-size: 1.75rem;
}
.saju-row-block td {
  padding: 2px;
}

/* 소항목행 */
.saju-row-sub td {
  font-size: 0.875rem;
  color: var(--muted);
  padding: 0.25rem;
  line-height: 1.4;
}

/* 오행 배경색 */
.sg-bg-wood { background: #81C784; }
.sg-bg-fire { background: #E57373; }
.sg-bg-earth { background: #FFD54F; }
.sg-bg-metal { background: #B0BEC5; }
.sg-bg-water { background: #64B5F6; }

/* 오행 텍스트 컬러 */
.sg-wood { color: var(--el-wood); }
.sg-fire { color: var(--el-fire); }
.sg-earth { color: var(--el-earth); }
.sg-metal { color: var(--el-metal); }
.sg-water { color: var(--el-water); }

/* 오행 분포 */
.saju-oheng {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--foreground);
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 0.75rem 0;
}

/* 신살 표 */
.saju-table-sinsal td {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
  padding: 0.5rem 0.25rem;
  border: 1px solid #f0f0f0;
  vertical-align: top;
}

/* 대운 */
.saju-daeun-title {
  text-align: center;
  padding: 1rem 0 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 0.75rem;
}
.saju-daeun-title p:first-child {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
}
.saju-daeun-note {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.saju-daeun-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.saju-daeun-scroll::-webkit-scrollbar {
  display: none;
}
.saju-table-daeun {
  min-width: 420px;
}
.saju-daeun-age td {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
  padding: 0.25rem;
}
.saju-row-sinsal-sm td {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* --- 만세력 C타입 컴포넌트 --- */

/* 4주 카드 그리드 */
.saju-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.saju-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 6px;
  text-align: center;
}
.saju-card.is-ilgan {
  border-color: var(--accent-bg);
  background: rgba(255,113,114,0.04);
}
.saju-card-label {
  font-size: 10px;
  color: var(--disabled);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.saju-card.is-ilgan .saju-card-label {
  color: var(--accent-bg);
  font-weight: 700;
}
.saju-card-gan {
  font-family: 'Noto Serif KR', serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1px;
}
.saju-card-ji {
  font-family: 'Noto Serif KR', serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--foreground);
  margin-bottom: 5px;
}
.saju-card-kor {
  font-size: 11px;
  color: var(--disabled);
  margin-bottom: 4px;
}
.saju-card-unsung {
  display: inline-block;
  font-size: 10px;
  background: rgba(255,113,114,0.08);
  color: var(--accent-bg);
  border-radius: 20px;
  padding: 2px 8px;
}

/* 오행 텍스트 색 */
.sg-text-wood  { color: #388e3c; }
.sg-text-fire  { color: #d32f2f; }
.sg-text-earth { color: #f57f17; }
.sg-text-metal { color: #616161; }
.sg-text-water { color: #1565c0; }

/* 정보 스트립 */
.saju-info-strip {
  display: flex;
  justify-content: space-around;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 8px;
}
.saju-info-strip .i-item { text-align: center; }
.saju-info-strip .i-label {
  font-size: 11px;
  color: var(--disabled);
  margin-bottom: 4px;
}
.saju-info-strip .i-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--foreground);
}
.saju-info-strip .i-value.accent { color: var(--accent-bg); }

/* 신살 */
.saju-sinsal-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}
.saju-sinsal-title {
  font-size: 11px;
  color: var(--disabled);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.saju-sinsal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.saju-sinsal-tag {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--cream-dark);
  color: var(--disabled);
  border: 1px solid var(--border);
}
.saju-sinsal-tag.active {
  background: rgba(255,113,114,0.08);
  color: var(--accent-bg);
  border-color: rgba(255,113,114,0.3);
  font-weight: 700;
}

/* 대운 카드 */
.saju-daeun-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}
.saju-daeun-card-title {
  font-size: 11px;
  color: var(--disabled);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}
.saju-daeun-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.saju-daeun-row::-webkit-scrollbar { display: none; }
.saju-daeun-item {
  flex: 0 0 50px;
  text-align: center;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 4px;
}
.saju-daeun-item.current {
  background: rgba(255,113,114,0.06);
  border-color: var(--accent-bg);
}
.saju-daeun-item .d-age {
  font-size: 10px;
  color: var(--disabled);
  margin-bottom: 4px;
}
.saju-daeun-item.current .d-age {
  color: var(--accent-bg);
  font-weight: 700;
}
.saju-daeun-item .d-hanja {
  font-family: 'Noto Serif KR', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.3;
}
.saju-daeun-item.current .d-hanja { color: var(--accent-bg); }

/* 상세 접기/펼치기 */
.saju-detail-toggle {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--disabled);
  cursor: pointer;
  text-align: left;
}
.saju-detail-toggle .toggle-arrow {
  font-size: 11px;
  transition: transform 0.25s;
}
.saju-detail-toggle.open .toggle-arrow { transform: rotate(180deg); }
.saju-detail-content {
  display: none;
  margin-top: 0;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 14px 14px;
  overflow: hidden;
}
.saju-detail-content.open { display: block; }

/* --- Result Page — Title Card --- */
.title-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: linear-gradient(180deg, var(--cream) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.title-card .label {
  font-size: 0.875rem;
  color: var(--gold);
  font-weight: 400;
  margin-bottom: 0.25rem;
}

.title-card h1 {
  font-family: var(--font-body);
  font-size: 1.4375rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.title-card .summary {
  font-size: 1rem;
  color: var(--muted);
}

.title-card .share-btn {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--gold);
  font-weight: 400;
}

.title-card .share-btn:hover {
  text-decoration: underline;
}

/* Five Elements Bar */
.element-row {
  margin-bottom: 0.75rem;
}

.element-label {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.element-label .value {
  font-weight: 700;
}

.element-bar {
  height: 8px;
  background: #f3f4f6;
  border-radius: 100px;
  overflow: hidden;
}

.element-bar-fill {
  height: 100%;
  border-radius: 100px;
}

/* Blurred section */
.blur-overlay {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.blur-content {
  filter: blur(4px);
  pointer-events: none;
  padding: 1.25rem;
}

.blur-content h3 {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.blur-content h3 + p {
  margin-bottom: 1rem;
}

.blur-content p {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
}

.blur-cta {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.6);
}

.blur-cta-inner {
  text-align: center;
  padding: 0 1.5rem;
}

.blur-cta-inner .title {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.blur-cta-inner .desc {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* Related services grid */
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.related-card {
  text-align: center;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s;
}

.related-card:hover {
  background: #FF7172;
  border: 1px solid #FF7172;
  color: #f4f4f4;
}

.related-card .icon {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.related-card .name {
  font-size: 1rem;
  font-weight: 700;
}

.related-card .desc {
  font-size: 0.875rem;
  color: var(--muted);
}

/* --- Payment Page --- */
.product-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.product-card.selected {
  background: #FF7172;
  border: 1px solid #FF7172;
  color: #f4f4f4;
}

.product-card-static {
  background: none;
  border-color: #FF7172;
  cursor: default;
}

.product-card-static:hover {
  background: none;
  border-color: #FF7172;
  color: inherit;
}

.product-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.product-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.product-card.selected .product-radio {
  border-color: #f4f4f4;
}

.product-radio-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f4f4f4;
  display: none;
}

.product-card.selected .product-radio-dot {
  display: block;
}

.product-card.selected .product-name,
.product-card.selected .product-detail,
.product-card.selected .product-price {
  color: #f4f4f4;
}

.product-info {
  text-align: left;
}

.product-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.product-name {
  font-size: 1rem;
  font-weight: 700;
}

.product-badge {
  font-size: 0.875rem;
  padding: 0.125rem 0.375rem;
  border-radius: 2px;
  background: #CE0000;
  color: #fff;
  font-weight: 700;
}

.product-detail {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.125rem;
}

.product-price {
  font-weight: 700;
  color: var(--gold);
  font-size: 1.0625rem;
  white-space: nowrap;
}

.payment-notes {
  margin-top: 1.5rem;
}

.payment-notes p {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

/* --- Loading Spinner --- */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Utility --- */
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.gap-3 { gap: 0.75rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }

/* --- Responsive --- */

/* Tablet */
@media (min-width: 768px) {
  .page-wrap {
    max-width: 480px;
  }

  .header-nav {
    display: flex;
  }

  .hamburger {
    display: none;
  }

  .footer-top {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .page-wrap {
    box-shadow: var(--shadow-lg);
  }

  body {
    background: var(--cream-dark);
  }
}
