/* ===== Design tokens ===== */
:root {
  --ink: #4a3a52;
  --ink-soft: #7a6c80;
  --ink-light: #a89db0;
  --blush: #fde4ec;
  --lavender: #e9def0;
  --peach: #ffe9d6;
  --cream: #fff6ef;
  --white-soft: #fffdfb;
  --border: rgba(122, 108, 128, 0.18);
  --border-strong: rgba(122, 108, 128, 0.4);
  --shadow: 0 8px 32px rgba(180, 140, 200, 0.12);
  --shadow-strong: 0 16px 48px rgba(180, 140, 200, 0.2);
}

/* ===== Element colours (pastel) ===== */
:root {
  --el-wood: #b8d4b8;
  --el-fire: #f4b7b7;
  --el-earth: #d9c4a3;
  --el-metal: #c9c9c9;
  --el-water: #a8c0d4;

  --el-wood-soft: #e8f0e3;
  --el-fire-soft: #fce4e0;
  --el-earth-soft: #f3ead9;
  --el-metal-soft: #eaeaea;
  --el-water-soft: #dee7ef;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background:
    radial-gradient(circle at 20% 20%, var(--lavender) 0%, transparent 55%),
    radial-gradient(circle at 80% 30%, var(--peach) 0%, transparent 55%),
    radial-gradient(circle at 50% 90%, var(--blush) 0%, transparent 60%),
    var(--cream);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Korean text support */
html[lang="ko"] body,
.hangul {
  font-family: 'Noto Serif KR', 'Inter', -apple-system, sans-serif;
}

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 8px 1px rgba(255, 255, 255, 0.6);
  animation: twinkle 4s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ===== Header ===== */
header {
  position: relative;
  z-index: 1;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
}

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

.moon-cat-mini {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 4px 12px rgba(180, 140, 200, 0.3));
}

.moon-cat-hero {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 1.25rem;
  filter: drop-shadow(0 8px 24px rgba(180, 140, 200, 0.25));
  animation: cat-float 6s ease-in-out infinite;
}

@keyframes cat-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-4px) rotate(1deg); }
}

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

.form-intro h1,
.form-intro .subtitle,
.form-intro .privacy {
  text-align: left;
}

@media (max-width: 720px) {
  .moon-cat-hero { width: 80px; height: 80px; }
}

.brand-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

/* Tiny moon-cat watermark in the corner of the chart section */
.cat-watermark {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: cat-float 8s ease-in-out infinite;
}

.lang-toggle {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: background 0.2s, border-color 0.2s;
}

.lang-toggle:hover {
  background: var(--white-soft);
  border-color: var(--ink-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.header-link {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: background 0.2s, border-color 0.2s;
}
.header-link:hover {
  background: var(--white-soft);
  border-color: var(--ink-soft);
}
.header-link[hidden] { display: none; }

/* ===== Main layout ===== */
main {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 2rem 4rem;
}

/* ===== Form ===== */
.form-section {
  max-width: 560px;
  margin: 2rem auto;
  animation: fade-up 0.8s ease-out both;
}

.mode-picker {
  margin: 1.5rem 0 2rem;
}
.mode-picker-label {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  color: var(--ink-soft);
  text-align: center;
  margin: 0 0 1rem;
  font-style: italic;
}
.mode-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
@media (max-width: 560px) {
  .mode-cards { grid-template-columns: 1fr; }
}
.mode-card {
  appearance: none;
  background: var(--white-soft);
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 1.1rem 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  font-family: inherit;
  color: var(--ink);
  text-align: center;
}
.mode-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.mode-card.is-active {
  border-color: rgba(180, 140, 200, 0.55);
  background: linear-gradient(135deg, rgba(253, 228, 236, 0.55), rgba(255, 246, 239, 0.7));
  box-shadow: var(--shadow);
}
.mode-icon {
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink-soft);
}
.mode-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.15;
}
.mode-desc {
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* Daily mode — strip everything but the daily card + Oracle/Full upsells.
   Per-card visibility for the upsell stack is handled by the rules in the
   "Upsell stack — mode-conditional" section below. */
body[data-mode="daily"] .templated-reading-section,
body[data-mode="daily"] .chart-details-block,
body[data-mode="daily"] .dm-prose,
body[data-mode="daily"] .pillars-grid,
body[data-mode="daily"] .elements-section,
body[data-mode="daily"] .email-capture {
  display: none;
}

/* Compatibility mode — emphasize the compat form, hide the full-reading distractions */
body[data-mode="compatibility"] .templated-reading-section,
body[data-mode="compatibility"] .upsell-card.upsell-full,
body[data-mode="compatibility"] .chart-details-block,
body[data-mode="compatibility"] .daily-fortune-section {
  display: none;
}

/* "Their birth" inline fields — appear inside the birth form when compat
   mode is selected so both people's info is collected in one go. */
.compat-inline-fields {
  display: none;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border);
}
body[data-mode="compatibility"] .compat-inline-fields {
  display: block;
}
.compat-inline-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 500;
  margin: 0 0 0.3rem;
  color: var(--ink);
}
.compat-inline-sub {
  margin: 0 0 1.1rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* When we collected partner info upfront, hide the duplicate compat form
   on the upsell card — the result section renders immediately instead. */
body[data-mode="compatibility"] .upsell-card.upsell-compat .compat-form,
body[data-mode="compatibility"] .upsell-card.upsell-compat > p {
  display: none;
}

/* ==========================================================================
   Upsell stack — mode-conditional visibility and order.
   - Reading mode: Full Reading (primary) → More-readings drawer → Oracle (bridge)
   - Compat mode: Compatibility unlock (primary) → Oracle (bridge)
   - Daily mode:  Oracle (primary, lifted to top) → Full Reading (secondary, compact)
   ========================================================================== */
.upsells-stack {
  display: flex;
  flex-direction: column;
}

/* Default order — DOM order is Full → Compat → Drawer → Oracle */
.upsells-stack > .upsell-card.upsell-full,
.upsells-stack > .upsell-card.upsell-compat,
.upsells-stack > .more-readings-drawer,
.upsells-stack > .upsell-card.oracle-card {
  order: 0;
}

/* Reading mode — hide Compat card (user came for their own reading) */
body[data-mode="reading"] .upsells-stack > .upsell-card.upsell-compat {
  display: none;
}

/* Compat mode — hide Full + drawer (user came for compatibility) */
body[data-mode="compatibility"] .upsells-stack > .upsell-card.upsell-full,
body[data-mode="compatibility"] .upsells-stack > .more-readings-drawer {
  display: none;
}

/* Daily mode — hide Compat + drawer, lift Oracle to the top */
body[data-mode="daily"] .upsells-stack > .upsell-card.upsell-compat,
body[data-mode="daily"] .upsells-stack > .more-readings-drawer {
  display: none;
}
body[data-mode="daily"] .upsells-stack > .upsell-card.oracle-card {
  order: -1;
}
body[data-mode="daily"] .upsells-stack > .upsell-card.upsell-full {
  /* Secondary card in daily mode: smaller, less prominent */
  padding: 1.5rem 1.75rem;
  margin-top: 1rem;
  background: var(--white-soft);
}
body[data-mode="daily"] .upsells-stack > .upsell-card.upsell-full h3 {
  font-size: 1.25rem;
}
body[data-mode="daily"] .upsells-stack > .upsell-card.upsell-full .upsell-list {
  display: none;
}

/* "Or included in Oracle" cross-sell note under the Full Reading card */
.upsell-included-note {
  font-size: 0.82rem;
  color: var(--ink-light);
  margin: 0.8rem 0 0;
  text-align: center;
  font-style: italic;
}

/* More-readings drawer */
.more-readings-drawer {
  margin-top: 2.5rem;
}
.more-readings-drawer > summary {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0.8rem 1.2rem;
  border: 1px dashed var(--border);
  border-radius: 14px;
  list-style: none;
  text-align: center;
  background: var(--cream);
  transition: background 0.2s ease;
}
.more-readings-drawer > summary:hover {
  background: var(--white-soft);
}
.more-readings-drawer > summary::-webkit-details-marker {
  display: none;
}
.more-readings-drawer[open] > summary {
  margin-bottom: 1rem;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-intro h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  margin: 0 0 0.5rem;
  letter-spacing: 0.01em;
  line-height: 1;
}

.subtitle {
  color: var(--ink-soft);
  font-size: 1rem;
  margin: 0 0 0.4rem;
}

.privacy {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-style: italic;
  opacity: 0.85;
  margin: 0 0 2rem;
}

form .field {
  margin-bottom: 1.4rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  display: block;
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--ink);
  margin-bottom: 0.45rem;
  letter-spacing: 0.02em;
}

input[type="date"],
input[type="time"],
select {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

input:focus, select:focus {
  border-color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.95);
}

.radio-group {
  display: flex;
  gap: 0.5rem;
}

.radio {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 400;
  transition: all 0.2s;
  font-size: 0.95rem;
  margin: 0;
}

.radio input {
  position: absolute;
  opacity: 0;
}

.radio:has(input:checked) {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.hint {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-style: italic;
  opacity: 0.85;
  transition: color 0.2s;
}

.hint.ok {
  color: #5d8c5d;
  font-style: normal;
  opacity: 1;
}

.hint.error {
  color: #9c5c5c;
  font-style: normal;
  opacity: 1;
}

/* Style the text input similarly to the date/time inputs */
input[type="text"] {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

input[type="text"]:focus {
  border-color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.95);
}

input[type="text"]::placeholder {
  color: var(--ink-light);
  opacity: 0.6;
}

.btn-primary {
  width: 100%;
  padding: 1rem 2rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
  background: var(--ink);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  margin-top: 1rem;
  transition: transform 0.15s ease, background 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}

.btn-primary:hover { background: #5a4664; transform: translateY(-1px); box-shadow: var(--shadow-strong); }
.btn-primary:active { transform: translateY(0); }

.btn-text {
  background: transparent;
  border: none;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.btn-text:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
}

/* ===== Chart section ===== */
.chart-section {
  animation: fade-up 0.8s ease-out both;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.chart-header h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin: 0;
  letter-spacing: 0.01em;
}

.section-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 1.4rem;
  margin: 2.5rem 0 1rem;
  color: var(--ink);
  letter-spacing: 0.04em;
}

/* Day Master card */
.dm-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(253, 228, 236, 0.6));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.dm-card .dm-label {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 0.5rem;
}

.dm-card .dm-hanja {
  font-family: 'Noto Serif KR', serif;
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
  margin: 0.5rem 0;
}

.dm-card .dm-hangul {
  font-family: 'Noto Serif KR', sans-serif;
  font-size: 1.4rem;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.dm-card .dm-archetype {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.dm-card .dm-element {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-transform: lowercase;
  letter-spacing: 0.12em;
}

/* Four Pillars */
.pillars-grid {
  margin-bottom: 2rem;
}

.pillars-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.pillar {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 0.75rem;
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.2s, box-shadow 0.2s;
}

.pillar:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.pillar.day {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(253, 228, 236, 0.4));
  border-color: var(--border-strong);
}

.pillar .pillar-label {
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 0.5rem;
}

.pillar .pillar-hanja {
  font-family: 'Noto Serif KR', serif;
  font-size: 2.2rem;
  line-height: 1;
  font-weight: 400;
  color: var(--ink);
  margin: 0.3rem 0;
}

.pillar .pillar-hangul {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
  font-family: 'Noto Serif KR', sans-serif;
}

.pillar .pillar-element {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
  margin-top: 0.2rem;
}

.el-wood .pillar-element { background: var(--el-wood-soft); }
.el-fire .pillar-element { background: var(--el-fire-soft); }
.el-earth .pillar-element { background: var(--el-earth-soft); }
.el-metal .pillar-element { background: var(--el-metal-soft); }
.el-water .pillar-element { background: var(--el-water-soft); }

.pillar .pillar-tengod {
  font-size: 0.78rem;
  color: var(--ink);
  margin-top: 0.4rem;
  line-height: 1.3;
}

.pillar .pillar-tengod .tg-ko,
.tg-cell .tg-value .tg-ko {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-soft);
  opacity: 0.7;
  margin-top: 0.15rem;
  font-family: 'Noto Serif KR', sans-serif;
}

.star-badge .star-ko {
  opacity: 0.55;
  font-size: 0.78em;
  margin-left: 0.15rem;
  font-family: 'Noto Serif KR', sans-serif;
}

.star-badge .dm-marker {
  color: var(--ink);
  font-weight: 600;
  margin-left: 0.15rem;
  cursor: help;
}

.star-badge.blocked {
  opacity: 0.6;
  text-decoration: line-through;
  text-decoration-color: var(--ink-light);
  text-decoration-thickness: 1px;
}

.star-badge .blocked-marker {
  opacity: 0.7;
  font-style: italic;
}

/* Element bars */
.elements-bars {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.6);
  padding: 1.25rem;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.el-bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 50px;
  align-items: center;
  gap: 0.75rem;
}

.el-bar-row .el-name {
  font-size: 0.85rem;
  color: var(--ink);
  text-transform: lowercase;
  letter-spacing: 0.06em;
}

.el-bar-row .el-bar-track {
  height: 10px;
  background: rgba(122, 108, 128, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.el-bar-row .el-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.el-bar-row.el-wood .el-bar-fill { background: var(--el-wood); }
.el-bar-row.el-fire .el-bar-fill { background: var(--el-fire); }
.el-bar-row.el-earth .el-bar-fill { background: var(--el-earth); }
.el-bar-row.el-metal .el-bar-fill { background: var(--el-metal); }
.el-bar-row.el-water .el-bar-fill { background: var(--el-water); }

.el-bar-row .el-value {
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Summary cards (strength / formation / yongshin) */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  backdrop-filter: blur(6px);
}

.summary-card.highlight {
  background: linear-gradient(135deg, rgba(255, 233, 214, 0.5), rgba(253, 228, 236, 0.3));
  border-color: var(--border-strong);
}

.summary-card h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 1.05rem;
  margin: 0 0 0.8rem;
  letter-spacing: 0.04em;
}

.summary-card .main-value {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.4rem;
  font-family: 'Noto Serif KR', sans-serif;
}

.summary-card .sub-value {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
}

.summary-card .tag-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.tag {
  display: inline-block;
  font-size: 0.74rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  color: var(--ink);
}

.tag.pass { background: var(--el-wood-soft); border-color: transparent; }
.tag.fail { background: var(--el-fire-soft); border-color: transparent; opacity: 0.7; }

/* Ten Gods grid */
.tengods-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.5);
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.tg-cell {
  text-align: center;
  padding: 0.75rem 0.4rem;
}

.tg-cell .tg-label {
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.6rem;
}

.tg-cell .tg-value {
  font-family: 'Noto Serif KR', sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.tg-cell .tg-value.muted {
  color: var(--ink-light);
  font-style: italic;
}

.tg-cell .tg-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0;
}

/* 12운성 row */
.lifestages-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.ls-cell {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 0.5rem;
  text-align: center;
}

.ls-cell .ls-label {
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.4rem;
}

.ls-cell .ls-stage {
  font-family: 'Noto Serif KR', sans-serif;
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.ls-cell .ls-hanja {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.ls-cell.strong { background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), var(--el-wood-soft)); }
.ls-cell.weak { background: rgba(255, 255, 255, 0.4); opacity: 0.85; }

/* 신살 list */
.stars-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.star-badge {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-family: 'Noto Serif KR', sans-serif;
  cursor: help;
  transition: transform 0.15s;
}

.star-badge:hover { transform: translateY(-1px); }

.star-badge.auspicious { background: linear-gradient(135deg, var(--el-wood-soft), rgba(255, 255, 255, 0.7)); border-color: transparent; }
.star-badge.inauspicious { background: linear-gradient(135deg, var(--el-fire-soft), rgba(255, 255, 255, 0.7)); border-color: transparent; }
.star-badge.mixed { background: linear-gradient(135deg, var(--el-earth-soft), rgba(255, 255, 255, 0.7)); border-color: transparent; }

.star-badge .star-glyph {
  opacity: 0.7;
  font-size: 0.75rem;
}

/* 대운 */
#daeun-content {
  background: rgba(255, 255, 255, 0.5);
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.daeun-row {
  display: grid;
  grid-template-columns: 80px 60px 1fr 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid rgba(122, 108, 128, 0.08);
  font-size: 0.88rem;
}

.daeun-row:last-child { border-bottom: none; }

.daeun-row.current {
  background: linear-gradient(90deg, var(--blush), transparent);
  border-radius: 8px;
  font-weight: 500;
}

.daeun-row .daeun-age { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.daeun-row .daeun-pillar { font-family: 'Noto Serif KR', sans-serif; font-size: 1.1rem; color: var(--ink); }
.daeun-row .daeun-tengod { color: var(--ink-soft); }
.daeun-row .daeun-favor { font-size: 0.78rem; }
.daeun-row .daeun-favor.good { color: #5d8c5d; }
.daeun-row .daeun-favor.bad { color: #9c5c5c; }

/* ===== Funnel: FREE zone ===== */

/* Day Master prose — 2–3 paragraph free interpretation */
.dm-prose {
  margin: -0.5rem auto 2.5rem;
  max-width: 38rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--ink);
  text-align: center;
}
.dm-prose p {
  margin: 0.7rem 0;
}
[lang="ko"] .dm-prose {
  font-family: 'Noto Serif KR', 'Cormorant Garamond', Georgia, serif;
}

.pillars-note {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin: 1rem auto 0;
  max-width: 36rem;
  font-style: italic;
}

.elements-summary {
  margin: 1rem auto 0;
  max-width: 36rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.55;
}

/* Templated reading */
.templated-reading-section {
  margin-top: 3rem;
  background: var(--white-soft);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem 2.25rem 1.75rem;
  box-shadow: var(--shadow);
}

.templated-reading-header {
  text-align: center;
  margin-bottom: 1.4rem;
}

.templated-reading-header h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1.55rem;
  margin: 0 0 0.4rem;
}

.templated-reading-header p {
  color: var(--ink-soft);
  font-size: 0.94rem;
  margin: 0 auto;
  max-width: 36rem;
}

.templated-reading-section .reading-prose {
  font-size: 1.04rem;
}

/* Daily Fortune */
.daily-fortune-section {
  margin-top: 3rem;
}

.daily-fortune-card {
  max-width: 38rem;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(233, 222, 240, 0.45), rgba(255, 233, 214, 0.35));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem 1.75rem;
  text-align: center;
}

.daily-fortune-date {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.daily-fortune-energy {
  margin: 0.4rem 0 0.9rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  color: var(--ink);
}

.daily-fortune-energy .chip {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  margin: 0 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.daily-fortune-prose {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--ink);
  margin: 0;
}

[lang="ko"] .daily-fortune-prose {
  font-family: 'Noto Serif KR', serif;
}

/* Email capture */
.email-capture {
  margin-top: 3rem;
  background: var(--white-soft);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.email-capture-inner {
  max-width: 36rem;
  margin: 0 auto;
}

.email-capture h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 1.4rem;
  margin: 0 0 0.4rem;
  text-align: center;
}

.email-capture-text p {
  margin: 0.4rem auto 1.2rem;
  color: var(--ink-soft);
  text-align: center;
  font-size: 0.96rem;
}

.email-capture-form {
  display: flex;
  gap: 0.6rem;
}

.email-capture-form input[type="email"] {
  flex: 1;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.email-capture-form input[type="email"]:focus {
  outline: none;
  border-color: var(--ink-soft);
  background: var(--white-soft);
}

.btn-compact {
  padding: 0.85rem 1.3rem;
  font-size: 0.95rem;
  white-space: nowrap;
}

.email-status {
  margin-top: 0.8rem;
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.email-status.ok {
  color: #5d8c5d;
}

.email-status.err {
  color: #9c5c5c;
}

/* ===== Chart details (at-a-glance visuals in a collapsible block) ===== */
.chart-details-block {
  margin-top: 3rem;
}

.chart-details-block > summary {
  cursor: pointer;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  width: fit-content;
  margin: 0 auto;
  list-style: none;
  user-select: none;
}

.chart-details-block > summary::-webkit-details-marker { display: none; }
.chart-details-block[open] > summary { margin-bottom: 1.5rem; }

.chart-detail-section {
  margin-top: 2rem;
}

/* ===== Inline CTA used inside the compat upsell card ===== */

.upsell-buy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.upsell-buy-btn .price {
  display: inline-block;
  font-size: 0.92em;
  opacity: 0.85;
  padding-left: 0.6rem;
  border-left: 1px solid rgba(255, 255, 255, 0.4);
}

.locked-inline-cta {
  margin-top: 1.2rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.locked-inline-cta--centered {
  justify-content: center;
}

/* The summary cards (strength / formation / yongshin) get a soft veil */
.summary-card.locked-mini {
  position: relative;
  overflow: hidden;
}

.summary-card.locked-mini .locked-mini-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(255, 253, 251, 0.4) 60%, rgba(255, 253, 251, 0.6) 100%);
  pointer-events: none;
  border-radius: inherit;
}

/* ===== Funnel: UPSELL CARDS ===== */

.upsell-card {
  margin-top: 2.5rem;
  background: var(--white-soft);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow);
  position: relative;
}

.upsell-card.upsell-full {
  background: linear-gradient(135deg, rgba(253, 228, 236, 0.5), rgba(255, 233, 214, 0.4));
  border-color: var(--border-strong);
}

.upsell-tag,
.oracle-tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.6);
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 0.8rem;
}

.upsell-card h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1.55rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.upsell-card > p {
  color: var(--ink-soft);
  margin: 0.4rem 0 1.2rem;
  font-size: 0.98rem;
  line-height: 1.6;
}

.upsell-list {
  margin: 0 0 1.5rem;
  padding-left: 1.3rem;
  color: var(--ink);
  font-size: 0.97rem;
  line-height: 1.7;
}

.upsell-list li {
  margin: 0.3rem 0;
}

.upsell-list li.upsell-list-emphasis {
  font-weight: 500;
  color: var(--ink);
}

.upsell-buy-btn {
  font-size: 1rem;
}

/* Compatibility card */
.compat-form {
  margin-top: 0.4rem;
}

.compat-form .field {
  margin-bottom: 0.8rem;
}

.compat-teaser-out {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(253, 228, 236, 0.5), rgba(255, 233, 214, 0.35));
  border-radius: 16px;
}

.compat-teaser-line {
  margin: 0 0 1.2rem;
  text-align: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  color: var(--ink);
  line-height: 1.55;
}

[lang="ko"] .compat-teaser-line {
  font-family: 'Noto Serif KR', serif;
}

/* Yearly forecast colored month bar (decorative teaser) */
.yearly-monthbar {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.35rem;
  margin: 0.8rem 0 0.6rem;
}

.yearly-monthbar > div {
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--ink-soft);
  background: var(--lavender);
}

.yearly-caption {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-style: italic;
  margin: 0.4rem 0 1.4rem;
}

/* Oracle (subscription) card — the final ask */
.oracle-card {
  background:
    radial-gradient(circle at 70% 0%, rgba(255, 233, 214, 0.65), transparent 60%),
    linear-gradient(135deg, rgba(233, 222, 240, 0.7), rgba(253, 228, 236, 0.6));
  border-color: var(--border-strong);
  text-align: center;
}

.oracle-card .upsell-list {
  display: inline-block;
  text-align: left;
  margin: 0 auto 1.5rem;
}

.oracle-fineprint {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
}

.btn-secondary {
  display: inline-block;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.btn-secondary:hover {
  transform: translateY(-1px);
  background: var(--white-soft);
}

/* Reading panel (kept for streaming output later) */
.reading-output {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 1.75rem 2rem;
}

.reading-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 1.2rem;
}

.reading-spinner {
  display: inline-block;
  animation: spin 2.4s linear infinite;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

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

.reading-prose {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--ink);
}

.reading-prose h1,
.reading-prose h2,
.reading-prose h3,
.reading-prose h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  margin-top: 1.6rem;
  margin-bottom: 0.4rem;
  color: var(--ink);
}

.reading-prose h1 { font-size: 1.6rem; }
.reading-prose h2 { font-size: 1.35rem; }
.reading-prose h3 { font-size: 1.15rem; letter-spacing: 0.02em; }
.reading-prose h4 { font-size: 1.02rem; font-style: italic; }

.reading-prose p {
  margin: 0.7rem 0;
}

.reading-prose ul {
  padding-left: 1.4rem;
  margin: 0.6rem 0;
}

.reading-prose li {
  margin: 0.25rem 0;
}

.reading-prose strong {
  color: var(--ink);
  font-weight: 600;
}

.reading-actions {
  margin-top: 1.5rem;
  text-align: center;
}

[lang="ko"] .reading-prose {
  font-family: 'Noto Serif KR', 'Cormorant Garamond', Georgia, serif;
}

/* ===== Email-verification modal ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(74, 58, 82, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 28rem;
  background: var(--white-soft);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 2.25rem 2rem 1.75rem;
  box-shadow: var(--shadow-strong);
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1;
}

.modal-card h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1.4rem;
  margin: 0 0 0.6rem;
  text-align: center;
}

.modal-card > div > p {
  color: var(--ink-soft);
  font-size: 0.96rem;
  text-align: center;
  margin: 0 auto 1.2rem;
  line-height: 1.55;
}

.verify-step .field {
  margin-bottom: 1rem;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 12px;
  color: #3c4043;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.96rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  margin-bottom: 1.1rem;
}

.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.12);
}

.google-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.verify-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1rem 0 1.1rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.verify-divider::before,
.verify-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.verify-divider span {
  padding: 0 0.8rem;
}

.verify-auth-toggle {
  display: flex;
  gap: 0;
  margin: 0 0 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  background: var(--cream);
}
.verify-auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.verify-auth-tab:hover {
  color: var(--ink);
}
.verify-auth-tab.is-active {
  background: var(--white-soft);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(122, 108, 128, 0.08);
}

.verify-forgot-line {
  text-align: center;
  margin-top: 1rem;
}
.verify-forgot-line .btn-text {
  font-size: 0.82rem;
  color: var(--ink-light);
}
.verify-forgot-line .btn-text:hover {
  color: var(--ink);
}

.verify-email-echo-line {
  text-align: center;
  margin: -0.6rem 0 1rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.02rem;
  color: var(--ink);
}

.verify-step .btn-primary {
  width: 100%;
  margin-top: 0.4rem;
}

#verify-code-input {
  text-align: center;
  letter-spacing: 0.5em;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  padding-left: 0.5em;
}

.modal-status {
  margin: 0.8rem 0 0;
  text-align: center;
  font-size: 0.9rem;
}

.modal-status.err {
  color: #9c5c5c;
}

.modal-status.ok {
  color: #5d8c5d;
}

.modal-status.dev {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.9rem;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.5);
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 1px dashed var(--border-strong);
  font-style: italic;
}

.modal-fineprint {
  margin: 0.8rem 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* Footer */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  opacity: 0.6;
  text-transform: uppercase;
}

/* ==========================================================================
   Oracle chat modal — bigger, scrollable thread, persistent input bar
   ========================================================================== */
.modal-panel.oracle-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 36rem;
  max-height: 86vh;
  background: var(--white-soft);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 1.75rem 1.75rem 1.25rem;
  box-shadow: var(--shadow-strong);
  display: flex;
  flex-direction: column;
}

.oracle-header {
  margin-bottom: 0.85rem;
}
.oracle-header h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1.6rem;
  margin: 0 0 0.3rem;
  color: var(--ink);
}
.oracle-subhead {
  margin: 0 0 0.4rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}
.oracle-quota {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-light);
  letter-spacing: 0.02em;
}

.oracle-thread {
  flex: 1;
  overflow-y: auto;
  margin: 0.5rem 0 1rem;
  padding: 0.5rem 0.25rem;
  min-height: 200px;
  max-height: 50vh;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.oracle-turn {
  border-radius: 16px;
  padding: 0.9rem 1.1rem;
  line-height: 1.6;
  font-size: 0.95rem;
}
.oracle-turn-user {
  background: linear-gradient(135deg, rgba(253, 228, 236, 0.55), rgba(255, 246, 239, 0.7));
  color: var(--ink);
  align-self: flex-end;
  max-width: 88%;
  border: 1px solid rgba(180, 140, 200, 0.18);
}
.oracle-turn-oracle {
  background: var(--white-soft);
  color: var(--ink);
  align-self: flex-start;
  max-width: 95%;
  border: 1px solid var(--border);
}
.oracle-turn-oracle p {
  margin: 0 0 0.6rem;
}
.oracle-turn-oracle p:last-child {
  margin-bottom: 0;
}
.oracle-turn-oracle strong { color: var(--ink); }
.oracle-turn-oracle em { color: var(--ink-soft); font-style: italic; }
.oracle-turn-oracle.is-streaming::after {
  content: " ✦";
  color: var(--ink-light);
  animation: oracle-pulse 1.2s ease-in-out infinite;
}
@keyframes oracle-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.oracle-empty {
  color: var(--ink-light);
  font-size: 0.9rem;
  text-align: center;
  padding: 1.5rem 1rem;
}
.oracle-empty-text {
  font-style: italic;
  margin: 0 0 1.2rem;
}
.oracle-empty-starters-label {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin: 0 0 0.7rem;
}
.oracle-starters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}
.oracle-starter {
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.65rem 0.95rem;
  text-align: left;
  cursor: pointer;
  font-style: normal;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.oracle-starter:hover {
  border-color: var(--border-strong);
  background: var(--white-soft);
}

.oracle-form {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}
.oracle-form textarea {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.7rem 0.9rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
  min-height: 2.8rem;
  box-sizing: border-box;
}
.oracle-form textarea:focus {
  outline: none;
  border-color: var(--border-strong);
  background: var(--white-soft);
}
.oracle-send-btn {
  flex: 0 0 auto;
  width: auto;
  white-space: nowrap;
  align-self: stretch;
  padding: 0.7rem 1.5rem;
  margin-top: 0;
  font-size: 0.88rem;
  text-transform: none;
  letter-spacing: 0.05em;
}
.oracle-send-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.oracle-foot {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--ink-light);
  font-style: italic;
}

.oracle-paywall {
  text-align: center;
  padding: 1.5rem 1rem;
  background: linear-gradient(135deg, rgba(253, 228, 236, 0.4), rgba(255, 246, 239, 0.6));
  border-radius: 16px;
  margin: 0.5rem 0;
}
.oracle-paywall h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  margin: 0 0 0.4rem;
  font-size: 1.3rem;
  color: var(--ink);
}
.oracle-paywall p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ==========================================================================
   Checkout sandbox modal — visually credible as a "Stripe-style" checkout,
   but clearly labeled TEST MODE. Replaced by a Stripe Checkout Session
   redirect once Stripe is wired (task #25).
   ========================================================================== */
.modal-panel.checkout-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 30rem;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 1.5rem 1.5rem 1.25rem;
  box-shadow: var(--shadow-strong);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.checkout-test-banner {
  background: linear-gradient(135deg, rgba(253, 228, 236, 0.85), rgba(255, 233, 214, 0.85));
  color: var(--ink);
  border: 1px solid rgba(232, 165, 184, 0.5);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-align: center;
  margin-bottom: 0.3rem;
}

.checkout-merchant {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.checkout-merchant-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}

.checkout-product {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0;
  color: var(--ink);
  line-height: 1.2;
}
.checkout-product-desc {
  margin: 0 0 0.4rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

.checkout-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.45rem 0;
  font-size: 0.92rem;
  color: var(--ink);
}
.checkout-row-total {
  border-top: 1px solid var(--border);
  font-weight: 500;
  font-size: 1rem;
  margin-top: 0.2rem;
  padding-top: 0.7rem;
}

.checkout-fields {
  margin-top: 0.5rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}
.checkout-fields .field {
  margin-bottom: 0.55rem;
}
.checkout-fields label {
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.checkout-fields input {
  width: 100%;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  box-sizing: border-box;
}
.checkout-fields input:disabled {
  color: var(--ink-soft);
  cursor: not-allowed;
}
.checkout-fields .hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: var(--ink-light);
  letter-spacing: 0;
  text-transform: none;
}

.checkout-pay-btn {
  margin-top: 0.6rem;
  width: 100%;
}
.checkout-pay-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.checkout-fineprint {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  color: var(--ink-light);
  text-align: center;
  font-style: italic;
  line-height: 1.5;
}

.checkout-success {
  text-align: center;
  padding: 1rem 0.5rem;
}
.checkout-success-icon {
  font-size: 2.4rem;
  color: #6ba277;
  line-height: 1;
}
.checkout-success h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0.6rem 0 0.3rem;
}
.checkout-success p {
  color: var(--ink-soft);
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ==========================================================================
   Account view — dedicated full-page surface (not a modal). When body
   data-view="account", the home form/chart sections are hidden and the
   account view takes over. The streaming reading panel renders inside
   this view so it never gets dumped at the bottom of the upsell stack.
   ========================================================================== */

.account-view {
  max-width: 760px;
  margin: 2rem auto 3rem;
  animation: fade-up 0.5s ease-out both;
}
.account-view[hidden] { display: none; }

/* When the account view is active, hide everything else inside <main>. */
body[data-view="account"] #form-section,
body[data-view="account"] #chart-section,
body[data-view="account"] #account-modal {
  display: none !important;
}

/* Header button changes meaning in account view — repurpose to "Home" */
body[data-view="account"] #account-btn::before { content: ""; }

.account-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.account-view-greeting {
  margin: 0 0 0.2rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}
.account-view-greeting > span:last-child {
  color: var(--ink);
  font-weight: 500;
}
.account-view-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin: 0;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.account-back-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.88rem;
}

.account-reading-panel {
  margin: 0 0 2rem;
  padding: 2rem 2.25rem;
  background: linear-gradient(135deg, rgba(253, 228, 236, 0.35), rgba(255, 246, 239, 0.55));
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.account-reading-panel[hidden] { display: none; }
.account-reading-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.account-reading-header h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1.55rem;
  margin: 0;
  color: var(--ink);
}
.account-reading-status {
  font-size: 0.82rem;
  color: var(--ink-light);
  font-style: italic;
}
.account-reading-status.is-streaming::after {
  content: " ✦";
  animation: oracle-pulse 1.2s ease-in-out infinite;
}
.account-reading-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.9rem;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.account-reading-actions .btn-compact {
  margin-top: 0;
  padding: 0.65rem 1.4rem;
  font-size: 0.85rem;
}

/* Loading state — replaces the typewriter stream with a polished "we're
   working on it" panel. Hides until the reading is fully done. */
.reading-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1.5rem;
  text-align: center;
}
.reading-loading[hidden] { display: none; }
.reading-loading-orb {
  font-size: 3.2rem;
  color: var(--ink-soft);
  animation: orb-pulse 2.4s ease-in-out infinite;
  margin-bottom: 0.6rem;
  line-height: 1;
}
@keyframes orb-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.95) rotate(0deg); }
  50%      { opacity: 1;   transform: scale(1.05) rotate(15deg); }
}
.reading-loading-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0 0 0.3rem;
  color: var(--ink);
}
.reading-loading-eta {
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
}
.reading-loading-bar {
  width: 100%;
  max-width: 18rem;
  height: 6px;
  background: rgba(122, 108, 128, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 auto 0.6rem;
}
.reading-loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blush), var(--peach), var(--lavender));
  background-size: 200% 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 1s linear;
  animation: bar-shimmer 3s linear infinite;
}
@keyframes bar-shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.reading-loading-elapsed {
  margin: 0 0 1rem;
  font-size: 0.84rem;
  color: var(--ink-light);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}
.reading-loading-sub {
  margin: 0;
  max-width: 28rem;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.55;
  font-style: italic;
}

/* Hide the print-only PDF artifact wrappers from screen */
.pdf-print-area { display: none; }

/* Print stylesheet — used as fallback if html2pdf isn't available */
@media print {
  body { background: white !important; }
  body * { visibility: hidden; }
  .pdf-print-area, .pdf-print-area * { visibility: visible; }
  .pdf-print-area {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1in;
    font-size: 11pt;
    color: #2a1f30;
    background: white;
  }
}

.account-view-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.account-view #account-view-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ===== Empty-state banner in account view (no primary chart yet) ===== */
.account-empty-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1.25rem 1.5rem;
  margin: 0 0 1.5rem;
  background: linear-gradient(135deg, rgba(253, 228, 236, 0.45), rgba(232, 217, 240, 0.45));
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.account-empty-banner[hidden] { display: none; }
.account-empty-banner-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1.3rem;
  margin: 0 0 0.2rem;
  color: var(--ink);
}
.account-empty-banner-sub {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.account-empty-banner .btn-compact {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 0.65rem 1.3rem;
  font-size: 0.85rem;
  white-space: nowrap;
}
@media (max-width: 540px) {
  .account-empty-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}

/* Friend rename pencil */
.account-friend-rename {
  background: none;
  border: none;
  color: var(--ink-light);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.25rem 0.4rem;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}
.account-friend-rename:hover {
  color: var(--ink);
  background: rgba(122, 108, 128, 0.08);
}

/* ===== Friend invite banner (top of home page when ?invite=… is present) ===== */
.invite-banner {
  max-width: 760px;
  margin: 1.25rem auto 0;
  padding: 0.85rem 1.1rem;
  background: linear-gradient(135deg, rgba(253, 228, 236, 0.55), rgba(233, 222, 240, 0.55));
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  box-shadow: var(--shadow);
  animation: fade-up 0.5s ease-out both;
}
.invite-banner[hidden] { display: none; }
.invite-banner-line {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.5;
}
.invite-banner-dismiss {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
.invite-banner-dismiss:hover { color: var(--ink); background: rgba(255,255,255,0.5); }

/* ===== Invite modal ===== */
.modal-panel.invite-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  background: var(--white-soft);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: 1.75rem 1.75rem 1.4rem;
  box-shadow: var(--shadow-strong);
}
.invite-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
}
.invite-sub {
  margin: 0 0 1.1rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}
.invite-link-row {
  display: flex;
  gap: 0.55rem;
  align-items: stretch;
  margin-bottom: 0.4rem;
}
.invite-link-row input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--cream);
  box-sizing: border-box;
}
.invite-link-row .btn-compact {
  flex: 0 0 auto;
  width: auto;
  margin-top: 0;
  padding: 0.6rem 1.1rem;
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: 0.04em;
}
.invite-copy-status {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-style: italic;
}
.invite-fineprint {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-light);
  font-style: italic;
}

.account-view-header-actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: flex-end;
}
.account-invite-btn {
  font-size: 0.85rem;
  color: var(--ink);
  white-space: nowrap;
}

/* ===== Friends list in Library tab ===== */
.account-friend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.15s ease;
}
.account-friend:hover { border-color: var(--border-strong); }
.account-friend-info {
  flex: 1;
  min-width: 0;
}
.account-friend-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 0.15rem;
}
.account-friend-sub {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0;
}
.account-friend-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}
.account-friend-view {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.account-friend-view:hover { background: var(--white-soft); }

/* ===== Account tabs (Today / Library / My chart) ===== */
.account-tabs {
  display: flex;
  gap: 0.2rem;
  background: rgba(122, 108, 128, 0.08);
  border-radius: 999px;
  padding: 4px;
  margin: 0 0 1.5rem;
  width: fit-content;
}
.account-tab {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.account-tab:hover { color: var(--ink); }
.account-tab.is-active {
  background: var(--white-soft);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(122, 108, 128, 0.1);
}
.account-tab-panel[hidden] { display: none; }

/* ===== Reflection (daily 5-min journal anchored in today's chart energy) ===== */
.reflection {
  margin: 0 0 1.5rem;
  padding: 1.5rem 1.6rem 1.25rem;
  background: linear-gradient(135deg, rgba(255, 233, 214, 0.45), rgba(255, 246, 239, 0.7));
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.reflection-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.4rem;
}
.reflection-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1.45rem;
  margin: 0 0 0.2rem;
  color: var(--ink);
  line-height: 1.15;
}
.reflection-sub {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}
.reflection-streak {
  margin: 0;
  flex: 0 0 auto;
  font-size: 0.78rem;
  color: var(--ink-light);
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-align: right;
}
.reflection-streak-strong {
  color: var(--ink);
  font-weight: 500;
}

.reflection-energy {
  margin: 0.5rem 0 1.1rem;
  padding: 0.55rem 0.85rem;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.5);
  border-left: 2px solid rgba(180, 140, 200, 0.45);
  border-radius: 0 8px 8px 0;
}
.reflection-energy:empty { display: none; }

.reflection-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.reflection-mood-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}
.reflection-mood-label {
  font-size: 0.86rem;
  color: var(--ink);
}
.reflection-mood-dots {
  display: flex;
  gap: 0.35rem;
}
.reflection-mood-dot {
  appearance: none;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.8rem;
  color: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  line-height: 1;
}
.reflection-mood-dot:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.reflection-mood-dot.is-selected {
  background: var(--blush);
  border-color: var(--ink-soft);
  box-shadow: 0 0 0 2px rgba(232, 165, 184, 0.25);
}
.reflection-mood-dot[data-mood="1"].is-selected { background: var(--el-water); }
.reflection-mood-dot[data-mood="2"].is-selected { background: var(--el-metal); }
.reflection-mood-dot[data-mood="3"].is-selected { background: var(--el-earth); }
.reflection-mood-dot[data-mood="4"].is-selected { background: var(--el-wood);  }
.reflection-mood-dot[data-mood="5"].is-selected { background: var(--el-fire);  }

.reflection-fields {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.reflection-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.reflection-field > span {
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.reflection-field textarea,
.reflection-field input[type="text"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
}
.reflection-field textarea:focus,
.reflection-field input[type="text"]:focus {
  outline: none;
  border-color: var(--border-strong);
  background: var(--white-soft);
}

.reflection-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 0.4rem;
}
.reflection-actions .btn-compact {
  margin-top: 0;
  padding: 0.6rem 1.3rem;
  font-size: 0.84rem;
  text-transform: none;
  letter-spacing: 0.04em;
  width: auto;
}
.reflection-saved {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-style: italic;
}

.reflection-recent {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(122, 108, 128, 0.12);
}
.reflection-recent-label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-light);
}
.reflection-strip {
  display: flex;
  gap: 0.4rem;
  align-items: flex-end;
}
.reflection-strip-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.2rem 0.5rem;
  font-size: 0.7rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.reflection-strip-cell:hover {
  border-color: var(--border-strong);
  background: var(--white-soft);
}
.reflection-strip-cell.is-today {
  border-color: rgba(180, 140, 200, 0.55);
  background: var(--white-soft);
}
.reflection-strip-cell-mood {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(122, 108, 128, 0.12);
}
.reflection-strip-cell-mood.mood-1 { background: var(--el-water); }
.reflection-strip-cell-mood.mood-2 { background: var(--el-metal); }
.reflection-strip-cell-mood.mood-3 { background: var(--el-earth); }
.reflection-strip-cell-mood.mood-4 { background: var(--el-wood);  }
.reflection-strip-cell-mood.mood-5 { background: var(--el-fire);  }

.reflection-calendar-toggle {
  margin-top: 1rem;
}
.reflection-calendar-toggle > summary {
  font-size: 0.82rem;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0.5rem 0;
  list-style: none;
  letter-spacing: 0.02em;
}
.reflection-calendar-toggle > summary::-webkit-details-marker { display: none; }
.reflection-calendar-toggle[open] > summary { margin-bottom: 0.8rem; }
.reflection-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.reflection-calendar-day {
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  background: rgba(122, 108, 128, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  color: var(--ink-light);
  cursor: pointer;
}
.reflection-calendar-day.has-entry { color: var(--ink); }
.reflection-calendar-day.mood-1 { background: var(--el-water); color: var(--ink); }
.reflection-calendar-day.mood-2 { background: var(--el-metal); color: var(--ink); }
.reflection-calendar-day.mood-3 { background: var(--el-earth); color: var(--ink); }
.reflection-calendar-day.mood-4 { background: var(--el-wood);  color: var(--ink); }
.reflection-calendar-day.mood-5 { background: var(--el-fire);  color: var(--ink); }
.reflection-calendar-day.is-today {
  outline: 2px solid rgba(180, 140, 200, 0.55);
  outline-offset: 1px;
}
.reflection-calendar-day-pad { background: transparent; cursor: default; }

/* ===== Inline Oracle (primary daily-use chat surface in account view) ===== */
.inline-oracle {
  margin: 0 0 2rem;
  padding: 1.5rem 1.6rem 1.25rem;
  background: linear-gradient(135deg, rgba(232, 217, 240, 0.45), rgba(255, 246, 239, 0.7));
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.inline-oracle-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.inline-oracle-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1.45rem;
  margin: 0 0 0.2rem;
  color: var(--ink);
  line-height: 1.15;
}
.inline-oracle-sub {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}
.inline-oracle-quota {
  margin: 0;
  flex: 0 0 auto;
  font-size: 0.76rem;
  color: var(--ink-light);
  letter-spacing: 0.04em;
  text-align: right;
  white-space: nowrap;
}

.inline-oracle-thread {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 0 0 0.85rem;
  max-height: 32rem;
  overflow-y: auto;
}
.inline-oracle-thread:empty { margin: 0; }
.inline-oracle-starters {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.25rem 0 0.5rem;
}
.inline-oracle-starters-label {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin: 0 0 0.3rem;
}
.inline-oracle-starter {
  appearance: none;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.inline-oracle-starter:hover {
  border-color: var(--border-strong);
  background: var(--white-soft);
}

.inline-oracle-turn {
  border-radius: 14px;
  padding: 0.8rem 1rem;
  line-height: 1.55;
  font-size: 0.92rem;
}
.inline-oracle-turn-user {
  background: rgba(253, 228, 236, 0.7);
  color: var(--ink);
  align-self: flex-end;
  max-width: 88%;
  border: 1px solid rgba(180, 140, 200, 0.18);
}
.inline-oracle-turn-oracle {
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  align-self: flex-start;
  max-width: 95%;
  border: 1px solid var(--border);
}
.inline-oracle-turn-oracle p {
  margin: 0 0 0.55rem;
}
.inline-oracle-turn-oracle p:last-child { margin-bottom: 0; }
.inline-oracle-turn-oracle.is-streaming::after {
  content: " ✦";
  color: var(--ink-light);
  animation: oracle-pulse 1.2s ease-in-out infinite;
}

.inline-oracle-form {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}
.inline-oracle-form textarea {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
  min-height: 2.6rem;
  box-sizing: border-box;
}
.inline-oracle-form textarea:focus {
  outline: none;
  border-color: var(--border-strong);
  background: var(--white-soft);
}
.inline-oracle-send {
  flex: 0 0 auto;
  width: auto;
  white-space: nowrap;
  align-self: stretch;
  padding: 0.7rem 1.4rem;
  margin-top: 0;
  font-size: 0.86rem;
  text-transform: none;
  letter-spacing: 0.04em;
}
.inline-oracle-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.inline-oracle-paywall {
  text-align: center;
  padding: 1.25rem 1rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  margin-top: 0.5rem;
}
.inline-oracle-paywall h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  color: var(--ink);
}
.inline-oracle-paywall p {
  margin: 0 0 0.85rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

/* ===== Expandable chart in account view ===== */
.account-chart-expand {
  margin-top: 0.6rem;
  padding: 1rem 1.2rem 1.2rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: none;
}
.account-item.is-expanded .account-chart-expand { display: block; }
.account-item-chevron {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.85rem;
  color: var(--ink-light);
  transition: transform 0.2s ease;
}
.account-item.is-expanded .account-item-chevron {
  transform: rotate(90deg);
}
.account-chart-dm {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  margin: 0 0 0.85rem;
}
.account-chart-dm-hanja {
  font-size: 2rem;
  color: var(--ink);
  line-height: 1;
  font-family: 'Noto Serif KR', serif;
}
.account-chart-dm-meta {
  display: flex;
  flex-direction: column;
}
.account-chart-dm-archetype {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1rem;
}
.account-chart-dm-element {
  font-size: 0.85rem;
  color: var(--ink-light);
  letter-spacing: 0.05em;
}
.account-chart-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 0 0 0.85rem;
}
.account-chart-pillar {
  text-align: center;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.4rem 0.65rem;
}
.account-chart-pillar-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin: 0 0 0.3rem;
}
.account-chart-pillar-stem {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.5rem;
  color: var(--ink);
  line-height: 1;
}
.account-chart-pillar-branch {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin-top: 0.25rem;
}
.account-chart-pillar-element {
  font-size: 0.7rem;
  color: var(--ink-light);
  margin-top: 0.4rem;
  letter-spacing: 0.02em;
}
.account-chart-elements {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.account-chart-element-row {
  display: grid;
  grid-template-columns: 60px 1fr 36px;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
}
.account-chart-element-row .el-name {
  color: var(--ink);
}
.account-chart-element-row .el-bar {
  height: 6px;
  background: rgba(122, 108, 128, 0.12);
  border-radius: 999px;
  overflow: hidden;
}
.account-chart-element-row .el-bar-fill {
  height: 100%;
  border-radius: 999px;
}
.account-chart-element-row .el-bar-fill.el-wood  { background: var(--el-wood);  }
.account-chart-element-row .el-bar-fill.el-fire  { background: var(--el-fire);  }
.account-chart-element-row .el-bar-fill.el-earth { background: var(--el-earth); }
.account-chart-element-row .el-bar-fill.el-metal { background: var(--el-metal); }
.account-chart-element-row .el-bar-fill.el-water { background: var(--el-water); }
.account-chart-element-row .el-value {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* On small screens, stack the header so back button doesn't squeeze */
@media (max-width: 540px) {
  .account-view-header {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .account-back-btn { align-self: flex-start; }
  .account-reading-panel { padding: 1.5rem 1.25rem; }
}

/* ==========================================================================
   Account view — shared item-row styling used across all account tabs
   (Library, My chart) and the inline-expand chart card.
   ========================================================================== */
.account-loading {
  text-align: center;
  color: var(--ink-light);
  font-style: italic;
  padding: 1.5rem 1rem;
}

.account-section {
  margin: 0 0 1.5rem;
}
.account-section h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1.15rem;
  margin: 0 0 0.6rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.account-section .account-empty {
  font-size: 0.88rem;
  color: var(--ink-light);
  font-style: italic;
  margin: 0;
}

.account-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.5rem;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.account-item:hover {
  border-color: var(--border-strong);
  background: var(--white-soft);
}
.account-item-main {
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  font-family: inherit;
  color: var(--ink);
}
.account-item-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0 0 0.15rem;
}
.account-item-sub {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0;
}
.account-item-delete {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: var(--ink-light);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}
.account-item-delete:hover {
  color: var(--ink);
  background: rgba(122, 108, 128, 0.08);
}

.account-oracle-q {
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 0.3rem;
  font-size: 0.85rem;
}
.account-oracle-a {
  font-size: 0.82rem;
  color: var(--ink-light);
  margin: 0;
  max-height: 3em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.account-delete-btn {
  color: var(--ink-light);
  font-size: 0.78rem;
}
.account-delete-btn:hover {
  color: #b65a5a;
}

/* Mobile responsiveness */
@media (max-width: 720px) {
  main { padding: 1rem 1.25rem 3rem; }
  header { padding: 1rem 1.25rem; }

  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .pillars-row { grid-template-columns: repeat(2, 1fr); }
  .tengods-grid { grid-template-columns: repeat(2, 1fr); }
  .lifestages-row { grid-template-columns: repeat(2, 1fr); }
  .summary-grid { grid-template-columns: 1fr; }

  .daeun-row {
    grid-template-columns: 60px 50px 1fr;
    font-size: 0.82rem;
  }
  .daeun-row .daeun-favor { display: none; }

  .dm-card { padding: 1.5rem 1rem; }

  .section-title { font-size: 1.2rem; }

  /* Oracle chat modal — stack input/button on narrow screens */
  .modal-panel.oracle-panel {
    max-height: 92vh;
    padding: 1.25rem 1.1rem 1rem;
  }
  .oracle-form {
    flex-direction: column;
    align-items: stretch;
  }
  .oracle-send-btn {
    align-self: flex-end;
    width: auto;
  }
  .oracle-thread {
    max-height: 56vh;
  }
}
