:root {
  --paper: #f7f9f9;
  --ink: #1f2933;
  --muted: #5b6764;
  --jade: #0b5e46;
  --jade-soft: #0f766e;
  --background: #f7f9f9;
  --foreground: #1f2933;
  --card: #ffffff;
  --card-foreground: #1f2933;
  --muted-foreground: #5b6764;
  --primary: #0b5e46;
  --primary-foreground: #ffffff;
  --border: #d5e0dc;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family:
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    "Malgun Gothic",
    Pretendard,
    sans-serif;
}

body {
  display: flex;
  flex-direction: column;
}

.page {
  position: relative;
  display: flex;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  flex: 1;
  flex-direction: column;
  background: #f7f9f9;
}

.wrap,
.site-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  min-width: 0;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.home-main {
  flex: 1;
  padding-bottom: 2rem;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 0.85rem;
  padding-bottom: 0.65rem;
}

.brand {
  margin: 0;
  font-family: "Noto Serif KR", "Apple SD Gothic Neo", serif;
  font-size: 15px;
  letter-spacing: 0.22em;
  color: #64748b;
}

.brand-sub {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #94a3b8;
}

.hero {
  margin-bottom: 0.85rem;
}

.hero-kicker {
  margin: 0 0 0.35rem;
  font-family: "Noto Serif KR", serif;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(6, 95, 70, 0.8);
}

.hero h1 {
  margin: 0 0 0.35rem;
  font-family: "Noto Serif KR", "Apple SD Gothic Neo", serif;
  font-size: clamp(1.85rem, 7vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.hero p {
  margin: 0;
  max-width: 28rem;
  font-family: "Noto Serif KR", serif;
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
}

.stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.sage {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

.sage-face {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef4f2 url("/sage-dosa-sm.jpg") center / cover no-repeat;
  box-shadow: 0 12px 28px rgba(15, 46, 41, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding: 1.75rem 1.35rem;
  box-sizing: border-box;
  text-align: center;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
}

.paper-slip {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 0.7rem 0.9rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), #f8faf9);
  border: 1px solid rgba(148, 163, 160, 0.28);
  border-radius: 1.2rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.paper-slip p {
  margin: 0;
  font-family: "Noto Serif KR", serif;
  font-size: 14px;
  line-height: 1.55;
  color: #1e293b;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.glass-panel,
.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 1.5rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
}

.panel {
  padding: 1.15rem 1.1rem 1.25rem;
}

.panel h2 {
  margin: 0;
  font-family: "Noto Serif KR", serif;
  font-size: 1.25rem;
  color: #0f172a;
}

.dream-input {
  display: block;
  width: 100%;
  min-height: 7.5rem;
  margin-top: 0.85rem;
  padding: 0.7rem 0.85rem;
  resize: vertical;
  border: 1px solid rgba(6, 78, 59, 0.12);
  border-radius: 1rem;
  background: #f8faf9;
  color: #1e293b;
  font: inherit;
  font-size: 1rem;
  line-height: 1.6;
  box-sizing: border-box;
}

.dream-input:focus {
  outline: 2px solid rgba(5, 122, 85, 0.28);
  border-color: rgba(5, 150, 105, 0.4);
}

.hint {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  line-height: 1.75;
  color: #64748b;
}

.alert {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid #fecdd3;
  border-radius: 1rem;
  background: #fff1f2;
  color: #9f1239;
  font-size: 0.9rem;
}

.alert p {
  margin: 0;
  word-break: keep-all;
}

.alert-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.85rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid #e11d48;
  border-radius: 999px;
  background: #fff;
  color: #9f1239;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.alert-retry[hidden] {
  display: none !important;
}

.dream-submit,
.ghost-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 3rem;
  margin-top: 1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #065f46, #0f766e);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(6, 78, 59, 0.28);
  cursor: pointer;
}

.ghost-link {
  margin-top: 0;
  background: rgba(255, 255, 255, 0.8);
  color: #334155;
  border: 1px solid rgba(6, 78, 59, 0.15);
  box-shadow: none;
}

.retry-form {
  position: relative;
  z-index: 6;
  margin: 0.25rem 0 0;
}

#retry-dream {
  margin-top: 0;
  pointer-events: auto;
  cursor: pointer;
  opacity: 1;
}

.loading-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 4rem;
  margin: 0 auto 1.5rem;
}

.dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  background: rgba(6, 95, 70, 0.2);
}

.mist {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  pointer-events: none;
}

.mist-wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(158, 205, 196, 0.45), transparent 36%),
    radial-gradient(circle at 88% 18%, rgba(213, 221, 217, 0.5), transparent 32%),
    radial-gradient(circle at 40% 88%, rgba(183, 207, 201, 0.38), transparent 34%);
}

.mist svg {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  max-width: 100%;
  height: 38vh;
  color: #94a3a0;
  pointer-events: none;
}

.score-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 10rem;
  height: 10rem;
}

.score-wrap svg {
  width: 10rem;
  height: 10rem;
  transform: rotate(-90deg);
}

.score-num {
  position: absolute;
  text-align: center;
}

.score-num strong {
  display: block;
  font-family: "Noto Serif KR", serif;
  font-size: 3rem;
  line-height: 1;
  color: #0f172a;
}

.score-num span {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #065f46;
}

.omen {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid rgba(6, 78, 59, 0.2);
  background: #ecfdf5;
  color: #064e3b;
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.section-label {
  margin: 0;
  font-family: "Noto Serif KR", serif;
  font-size: 0.875rem;
  letter-spacing: 0.18em;
  color: #065f46;
}

.reading-stack {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  margin-top: 1rem;
}

.body-copy {
  margin: 0;
  font-size: 16px;
  line-height: 1.9;
  white-space: pre-wrap;
}

.qi-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.qi-card {
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(248, 250, 249, 0.8);
}

.fate-card .fate-row {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.score-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
}

.grade-seal {
  display: grid;
  place-items: center;
  width: 4.6rem;
  height: 4.6rem;
  transform: rotate(-4deg);
  border-radius: 0.35rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.grade-seal em {
  font-family: "Noto Serif KR", serif;
  font-style: normal;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: 0.12em;
}

.grade-seal span {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
}

.grade-seal.auspicious {
  background: #ecfdf5;
  color: #065f46;
  border: 2px solid #6ee7b7;
  outline: 1px solid rgba(6, 95, 70, 0.35);
  outline-offset: -6px;
}

.grade-seal.neutral {
  background: #f1f5f9;
  color: #334155;
  border: 2px solid #cbd5e1;
  outline: 1px solid rgba(51, 65, 85, 0.28);
  outline-offset: -6px;
}

.grade-seal.inauspicious {
  background: #fff1f2;
  color: #9f1239;
  border: 2px solid #fda4af;
  outline: 1px solid rgba(159, 18, 57, 0.28);
  outline-offset: -6px;
}

.fate-title {
  margin: 0;
  flex: 1 1 12rem;
  font-family: "Noto Serif KR", serif;
  font-size: 1.55rem;
  line-height: 1.45;
}

.symbol-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.symbol-card {
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(6, 78, 59, 0.14);
  background:
    linear-gradient(180deg, rgba(236, 253, 245, 0.7), rgba(248, 250, 249, 0.95));
}

.symbol-name {
  margin: 0;
  font-family: "Noto Serif KR", serif;
  font-size: 1.15rem;
  color: #064e3b;
}

.symbol-meaning {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #334155;
}

.action-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.15rem;
}

.action-card {
  padding: 0.95rem 1rem;
  border-radius: 1rem;
}

.action-card p:last-child {
  margin: 0.4rem 0 0;
  font-size: 0.98rem;
  line-height: 1.7;
}

.action-card.do {
  border: 1px solid rgba(6, 78, 59, 0.18);
  background: #ecfdf5;
}

.action-card.dont {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #f8fafc;
}

.footer-note {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 3rem;
  box-sizing: border-box;
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
}

.quota-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  flex-wrap: wrap;
}

.quota-row h2 {
  margin: 0;
}

.quota-chip {
  margin: 0.15rem 0 0;
  flex: 0 0 auto;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(6, 78, 59, 0.16);
  background: #ecfdf5;
  color: #065f46;
  font-size: 12px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(15, 46, 41, 0.28);
}

.modal-card {
  width: min(26rem, 100%);
  padding: 1.75rem 1.5rem 1.35rem;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

.modal-card h2 {
  margin: 0.65rem 0 0;
  font-family: "Noto Serif KR", serif;
  font-size: 1.45rem;
  line-height: 1.4;
  color: #0f172a;
}

.modal-copy {
  margin: 0.85rem 0 0;
  font-size: 0.95rem;
  line-height: 1.8;
  color: #475569;
}

.modal-secondary {
  margin-top: 0.75rem;
}

.modal-close {
  display: block;
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.65rem;
  border: 0;
  background: transparent;
  color: #64748b;
  font: inherit;
  cursor: pointer;
}

.ad-slot {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  min-height: 8.5rem;
  margin-top: 1.15rem;
  border-radius: 1rem;
  border: 1px dashed rgba(6, 78, 59, 0.28);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(236, 253, 245, 0.7),
      rgba(236, 253, 245, 0.7) 12px,
      rgba(248, 250, 249, 0.9) 12px,
      rgba(248, 250, 249, 0.9) 24px
    );
  color: #065f46;
  text-align: center;
}

.ad-slot p {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ad-slot span {
  font-size: 12px;
  color: #64748b;
}

.countdown {
  display: grid;
  place-items: center;
  margin: 1.15rem 0 0.4rem;
}

.countdown strong {
  font-family: "Noto Serif KR", serif;
  font-size: 3.2rem;
  line-height: 1;
  color: #065f46;
}

.countdown span {
  margin-top: 0.35rem;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: #0f766e;
}

.share-link {
  margin: 0.75rem 0 0;
  padding: 0.7rem 0.8rem;
  border-radius: 0.8rem;
  background: #f8faf9;
  color: #334155;
  font-size: 0.85rem;
  word-break: break-all;
}

@media (max-width: 639px) {
  .hero-kicker {
    display: none;
  }

  .hint {
    display: none;
  }
}

@media (min-width: 640px) {
  .site-header {
    padding-top: 1.5rem;
    padding-bottom: 1.25rem;
  }

  .hero {
    margin-bottom: 1.5rem;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 6vw, 3.2rem);
  }

  .hero p {
    font-size: 16px;
    line-height: 1.8;
  }

  .stack {
    gap: 1.25rem;
  }

  .sage-face {
    width: 108px;
    height: 108px;
  }

  .paper-slip {
    max-width: 24rem;
    padding: 1rem 1.25rem;
  }

  .dream-input {
    min-height: 10rem;
  }

  .panel {
    padding: 1.5rem 1.35rem;
  }

  .qi-grid,
  .action-grid {
    grid-template-columns: 1fr 1fr;
  }

  .symbol-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.dict-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 1.2rem;
  border: 1px solid rgba(6, 95, 70, 0.22);
  background: linear-gradient(180deg, #ecfdf5, #ffffff);
  color: #065f46;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 10px 24px rgba(6, 95, 70, 0.08);
}

.dict-cta strong {
  font-size: 1.08rem;
  letter-spacing: 0.02em;
}

.dict-cta span {
  font-size: 0.84rem;
  color: #5b6764;
}

.dict-cta:hover {
  border-color: rgba(6, 95, 70, 0.4);
}

.site-footer {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin-top: 3rem;
  border-top: 1px solid rgba(11, 94, 70, 0.16);
  padding: 2rem 0 2.5rem;
  font-size: 14px;
  line-height: 1.6;
  color: #5b6764;
  background: #f7f9f9;
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.site-footer a {
  color: #0b5e46;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.policy-page {
  color: #1f2933;
}

.policy-page h1,
.policy-page h2,
.policy-page h3 {
  color: #0f172a;
}

.policy-page a {
  color: #0b5e46;
}

.policy-page ul {
  margin-top: 0.5rem;
}

.policy-page li {
  margin-left: 1.25rem;
  list-style: disc;
}

.bg-emerald-50 { background: #ecfdf5; }
.text-emerald-700 { color: #047857; }
.ring-emerald-200 { --tw-ring-color: #a7f3d0; }
.bg-rose-50 { background: #fff1f2; }
.text-rose-700 { color: #be123c; }
.ring-rose-200 { --tw-ring-color: #fecdd3; }
.bg-amber-50 { background: #fffbeb; }
.text-amber-700 { color: #b45309; }
.ring-amber-200 { --tw-ring-color: #fde68a; }
.ring-1 { box-shadow: 0 0 0 1px var(--tw-ring-color, rgba(11, 94, 70, 0.18)); }
.ring-inset { box-shadow: inset 0 0 0 1px var(--tw-ring-color, rgba(11, 94, 70, 0.18)); }

.text-muted-foreground {
  color: var(--muted-foreground, #5b6764);
}

.text-primary {
  color: var(--primary, #0b5e46);
}

.bg-primary {
  background: var(--primary, #0b5e46);
}

.text-primary-foreground {
  color: var(--primary-foreground, #fff);
}

.bg-card {
  background: var(--card, #fff);
}

.border-border,
.border-border\/60 {
  border-color: rgba(11, 94, 70, 0.18);
}

.bg-muted,
.hover\:bg-muted:hover {
  background: var(--muted, #eef4f2);
}
