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

:root {
  color-scheme: light;
  --primary: #2c2b29;
  --accent: #8b7e74;      /* Sand Brown */
  --accent-rgb: 139, 126, 116;
  --accent-glow: rgba(139, 126, 116, 0.12);

  --bg: #f4f2ec;          /* Original light sand */
  --surface: rgba(253, 253, 251, 0.75); /* Light glassmorphism background */
  --surface-hover: rgba(253, 253, 251, 0.9);
  --muted: #7d7a74;       /* Muted gray */
  --line: rgba(139, 126, 116, 0.16); /* Border color */
  --sand: #c7b198;        /* Re-add missing sand color */

  --gold: #dfd3c3;
  --green: #5f7161;
  --brown: #6d5d50;
  --rose: #d4a5a5;
  --danger: #8f4f2a;

  --shadow: 0 18px 50px rgba(92, 76, 58, 0.08);
  --shadow-glow: 0 0 25px rgba(139, 126, 116, 0.08);

  --font: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-serif: "Noto Serif KR", "AppleMyungjo", "Batang", serif;
}

* {
  box-sizing: border-box;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(223, 211, 195, 0.38), transparent 32rem),
    linear-gradient(180deg, #f8f6f0 0%, var(--bg) 38%, #eee9df 100%);
  color: var(--primary);
  font-family: var(--font);
  line-height: 1.6;
  letter-spacing: -0.02em;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* App Shell */
.app-shell {
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(244, 242, 236, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  min-height: 64px;
  padding: 8px 16px;
  background: rgba(244, 242, 236, 0.85);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.topbar-title {
  margin: 0;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary) 60%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topbar-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.topbar-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(139, 126, 116, 0.15);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.topbar-logo:hover .topbar-logo-img {
  transform: rotate(15deg) scale(1.1);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--primary);
  font-size: 20px;
  transition: all 0.2s ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(139, 126, 116, 0.08);
  border-color: rgba(139, 126, 116, 0.15);
  outline: none;
  transform: scale(1.05);
}

.page {
  padding: 16px 20px 64px;
  flex: 1;
}

.screen-center {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
  padding: 24px;
}

/* Cards & Containers (Glassmorphism) */
.oriental-card,
.menu-card,
.reading-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.oriental-card {
  padding: 20px;
}

/* User Summary Card */
.summary-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(139, 126, 116, 0.25);
  background: linear-gradient(135deg, rgba(253, 253, 251, 0.9), rgba(244, 242, 236, 0.95));
}

.summary-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 140px;
  height: 140px;
  border: 1px dashed rgba(139, 126, 116, 0.2);
  border-radius: 50%;
  pointer-events: none;
  animation: slowSpin 40s linear infinite;
}

@keyframes slowSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.summary-kicker {
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.meta-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(139, 126, 116, 0.3);
}

/* Menu List */
.menu-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.menu-card {
  width: 100%;
  display: grid;
  grid-template-columns: 80px 1fr 24px;
  gap: 20px;
  align-items: center;
  min-height: 112px;
  padding: 16px;
  text-align: left;
  border-color: var(--line);
  color: inherit;
}

.menu-card:hover,
.menu-card:focus-visible {
  border-color: rgba(139, 126, 116, 0.45);
  background: var(--surface-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow), var(--shadow-glow);
  outline: none;
}

.menu-card img,
.banner-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.menu-image {
  width: 80px;
  height: 80px;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  transition: transform 0.3s ease;
}

.menu-card:hover .menu-image {
  transform: scale(1.05);
}

.menu-title {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.menu-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.chevron {
  color: rgba(44, 43, 41, 0.3);
  font-size: 20px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.menu-card:hover .chevron {
  color: var(--accent);
  transform: translateX(4px);
}

/* SEO fallback shown before the JavaScript app mounts */
.seo-fallback {
  display: grid;
  gap: 20px;
}

.seo-fallback .menu-card {
  text-decoration: none;
}

.seo-intro {
  display: grid;
  gap: 12px;
}

.seo-intro h2,
.seo-section-list h2,
.seo-section-list h3,
.seo-noscript h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.35;
}

.seo-intro h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 800;
}

.seo-intro p,
.seo-section-list p,
.seo-noscript p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.seo-section-list {
  display: grid;
  gap: 18px;
}

.seo-section-list h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 800;
}

.seo-section-list section {
  display: grid;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.seo-section-list h3 {
  color: var(--primary);
  font-size: 15px;
  font-weight: 800;
}

.seo-noscript {
  display: grid;
  gap: 8px;
  border-color: rgba(143, 79, 42, 0.24);
  background: rgba(255, 243, 230, 0.78);
}

/* Forms */
.form-stack {
  display: grid;
  gap: 16px;
}

.form-card {
  display: grid;
  gap: 16px;
  background: rgba(253, 253, 251, 0.85);
  border-color: rgba(139, 126, 116, 0.2);
}

.form-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.form-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
}

.helper {
  margin: -6px 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 8px;
}

.field label,
.field-label {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.input,
.select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--primary);
  padding: 12px 14px;
  font-size: 14px;
  transition: all 0.25s ease;
}

.input:focus,
.select:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.8);
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 126, 116, 0.15);
}

/* Choice group / Select grids */
.choice-row,
.target-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.choice,
.target-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.choice:hover,
.target-button:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--primary);
  border-color: rgba(139, 126, 116, 0.3);
}

.choice[aria-pressed="true"],
.target-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(139, 126, 116, 0.08);
  color: var(--accent);
  font-weight: 800;
  box-shadow: 0 0 15px rgba(139, 126, 116, 0.06);
}

/* Target Selector spacing */
.target-selector {
  background: rgba(139, 126, 116, 0.04);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.target-button {
  min-height: 38px;
  border: none;
  border-radius: 8px;
}

/* Checkboxes */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.checkbox-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(139, 126, 116, 0.3);
  border-radius: 5px;
  outline: none;
  background-color: rgba(255, 255, 255, 0.4);
  display: inline-grid;
  place-items: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"]:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.checkbox-row input[type="checkbox"]:checked::before {
  content: "✓";
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.checkbox-row input[type="checkbox"]:focus-visible {
  box-shadow: 0 0 0 2px rgba(139, 126, 116, 0.3);
}

/* Buttons */
.primary-button,
.secondary-button,
.text-button {
  min-height: 48px;
  border-radius: 999px;
  padding: 10px 24px;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.primary-button {
  width: 100%;
  min-height: 54px;
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 8px 20px rgba(139, 126, 116, 0.22);
  font-weight: 800;
}

.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(139, 126, 116, 0.32);
  outline: none;
}

.primary-button:active {
  transform: translateY(0);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(139, 126, 116, 0.46);
  color: var(--accent);
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.5);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.text-button {
  min-height: 36px;
  padding: 6px 14px;
  background: transparent;
  color: var(--accent);
  border: 1px solid transparent;
}

.text-button:hover {
  background: rgba(139, 126, 116, 0.06);
  border-color: rgba(139, 126, 116, 0.1);
}

/* Reading Details & Output Card */
.reading-card {
  overflow: hidden;
  background: rgba(253, 253, 251, 0.85);
  border-color: var(--line);
}

.banner {
  min-height: 100px;
  padding: 14px 20px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
}

.banner::before {
  content: "☾";
  position: absolute;
  left: 20px;
  bottom: -16px;
  font-size: 84px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.24);
  font-family: var(--font-serif);
  font-weight: 800;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.15));
}

.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    radial-gradient(circle at 75% 35%, rgba(255, 255, 255, 0.18) 1.5px, transparent 1.5px),
    radial-gradient(circle at 45% 70%, rgba(255, 255, 255, 0.15) 1.2px, transparent 1.2px),
    radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    radial-gradient(circle at 30% 85%, rgba(255, 255, 255, 0.25) 1px, transparent 1px);
  background-size: 85px 85px, 115px 115px, 95px 95px, 75px 75px, 130px 130px;
  z-index: 1;
  pointer-events: none;
}

.banner.today,
.banner.tojeong {
  background: linear-gradient(135deg, var(--accent), var(--sand));
}
.banner.monthly {
  background: linear-gradient(135deg, var(--brown), var(--green));
}
.banner.saju {
  background: linear-gradient(135deg, var(--green), var(--accent));
}
.banner.daeun {
  background: linear-gradient(135deg, var(--sand), var(--gold));
}
.banner.compatibility {
  background: linear-gradient(135deg, var(--rose), var(--accent));
}

.banner-media {
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  z-index: 2;
  position: relative;
}

.reading-content {
  padding: 24px 24px 32px;
}

.reading-title {
  margin: 12px 0 20px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.4;
  color: var(--primary);
  font-weight: 800;
}

.eyebrow {
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-text {
  margin: 0 0 24px;
  color: var(--primary);
  font-size: 14.5px;
  line-height: 1.85;
  white-space: pre-line;
}

/* Sections inside detail */
.section-block {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.section-title {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 16.5px;
  font-weight: 800;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-body {
  margin: 0;
  color: rgba(44, 43, 41, 0.86);
  font-size: 13.5px;
  line-height: 1.8;
  white-space: pre-line;
}

/* Visualized Score Indicator */
.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}

.score-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.score-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.score-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.score-value {
  color: var(--accent);
  font-size: 22px;
  font-weight: 800;
}

/* Progress bar inside score item */
.score-bar-bg {
  width: 100%;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  border-radius: 2px;
  width: 0; /* Animated dynamically */
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Information Panels */
.info-panel {
  display: grid;
  gap: 10px;
  margin: 16px 0 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(223, 211, 195, 0.16);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 12.5px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
}

.info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-row strong {
  color: var(--primary);
  font-weight: 700;
}

/* Monthly calendar planner */
.monthly-planner {
  margin: 16px 0 24px;
  padding: 16px;
  border: 1px solid rgba(230, 226, 216, 0.82);
  border-radius: 8px;
  background: rgba(244, 242, 236, 0.82);
}

.monthly-planner-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.monthly-planner-head strong {
  display: block;
  margin-top: 3px;
  color: var(--primary);
  font-size: 15px;
  font-weight: 800;
}

.monthly-average {
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.calendar-legend {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 8px;
  color: rgba(44, 43, 41, 0.7);
  font-size: 11px;
  font-weight: 700;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot.good {
  background: var(--green);
}

.legend-dot.caution {
  background: #c97963;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-weekdays {
  margin-bottom: 6px;
}

.calendar-weekdays span {
  text-align: center;
  color: rgba(44, 43, 41, 0.66);
  font-size: 11px;
  font-weight: 800;
}

.calendar-cell {
  min-width: 0;
  min-height: 62px;
  padding: 5px;
  border: 1px solid rgba(44, 43, 41, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--primary);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.calendar-cell.empty {
  border-color: transparent;
  background: transparent;
}

.calendar-cell.good {
  border-color: rgba(95, 113, 97, 0.72);
  background: rgba(95, 113, 97, 0.14);
}

.calendar-cell.caution {
  border-color: rgba(201, 121, 99, 0.72);
  background: rgba(201, 121, 99, 0.14);
}

.calendar-cell.selected {
  box-shadow: 0 0 0 2px rgba(139, 126, 116, 0.18);
}

.calendar-day-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3px;
  color: rgba(44, 43, 41, 0.78);
  font-size: 11px;
  line-height: 1.1;
}

.calendar-cell.good .calendar-day-row {
  color: var(--green);
}

.calendar-cell.caution .calendar-day-row {
  color: #c97963;
}

.calendar-day-row i {
  width: 7px;
  height: 7px;
  margin-top: 2px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.calendar-score {
  margin-top: auto;
  color: rgba(44, 43, 41, 0.86);
  font-size: 11px;
  font-weight: 800;
}

.calendar-keyword {
  color: rgba(44, 43, 41, 0.64);
  font-size: 9px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monthly-day-bubble {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(139, 126, 116, 0.24);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.66);
}

.monthly-day-bubble.good {
  border-color: rgba(95, 113, 97, 0.34);
}

.monthly-day-bubble.caution {
  border-color: rgba(201, 121, 99, 0.34);
}

.monthly-day-bubble div {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.monthly-day-bubble strong {
  color: var(--accent);
  font-size: 13px;
}

.monthly-day-bubble span {
  color: rgba(44, 43, 41, 0.76);
  font-size: 12px;
  font-weight: 800;
}

.monthly-day-bubble p {
  margin: 0;
  color: rgba(44, 43, 41, 0.86);
  font-size: 13px;
  line-height: 1.5;
}

.monthly-score-rows,
.monthly-periods {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(139, 126, 116, 0.08);
  box-shadow: inset 0 1px 2px rgba(92, 76, 58, 0.01), 0 4px 12px rgba(92, 76, 58, 0.02);
}

.monthly-periods h3 {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.monthly-score-row,
.monthly-period-row {
  display: grid;
  grid-template-columns: 56px 1fr 48px;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.monthly-score-row .progress-bar-container,
.monthly-period-row .progress-bar-container {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(139, 126, 116, 0.06);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

@keyframes fill-bar {
  from {
    width: 0;
  }
  to {
    width: var(--target-width);
  }
}

.monthly-score-row i,
.monthly-period-row i {
  display: block;
  height: 100%;
  border-radius: 999px;
  width: 0;
  animation: fill-bar 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.monthly-score-row i.no-animation,
.monthly-period-row i.no-animation {
  animation: none;
  width: var(--target-width);
}

/* 운세별 그라데이션 컬러링 */
.monthly-score-row.work i {
  background: linear-gradient(90deg, #a8c3a7 0%, var(--green) 100%);
}

.monthly-score-row.money i {
  background: linear-gradient(90deg, #e8cfa9 0%, #a07a52 100%);
}

.monthly-score-row.love i {
  background: linear-gradient(90deg, #f5c2c2 0%, var(--rose) 100%);
}

.monthly-period-row i {
  background: linear-gradient(90deg, var(--gold) 0%, var(--accent) 100%);
}

.monthly-score-row strong,
.monthly-period-row strong {
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 800;
  text-align: right;
}

/* Monthly layout */
.monthly-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.monthly-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.36);
}

.monthly-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.monthly-head strong {
  font-size: 14.5px;
  color: var(--accent);
  font-family: var(--font-serif);
}

.monthly-head .chip {
  background: rgba(139, 126, 116, 0.1);
  border-color: var(--line);
}

/* Advice & Guidance Box */
.advice {
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(139, 126, 116, 0.1);
  border: 1px solid var(--line);
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.75;
  position: relative;
}

.advice::before {
  content: "💡";
  display: inline-block;
  margin-right: 6px;
}

/* Loading & State boxes */
.state-box {
  display: grid;
  gap: 20px;
  justify-items: center;
  text-align: center;
}

.state-box strong {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

/* Premium Moon Loader */
.loader {
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 126, 116, 0.1) 0%, transparent 70%);
  position: relative;
}

.loader::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-bottom-color: var(--accent);
  border-radius: 50%;
  animation: spin 2.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.loader::after {
  content: "☾";
  color: var(--accent);
  font-size: 38px;
  position: absolute;
  filter: drop-shadow(0 0 4px rgba(139, 126, 116, 0.3));
  animation: pulseMoon 1.8s ease-in-out infinite alternate;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulseMoon {
  0% {
    transform: scale(0.9) rotate(-10deg);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.1) rotate(10deg);
    opacity: 1;
  }
}

/* Interactive Toast Message */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  width: min(calc(100% - 32px), 480px);
  transform: translateX(-50%);
  padding: 14px 20px;
  border-radius: 16px;
  background: rgba(44, 43, 41, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  animation: toastEntry 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes toastEntry {
  0% {
    bottom: 0px;
    opacity: 0;
    transform: translateX(-50%) scale(0.9);
  }
  100% {
    bottom: 24px;
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

.hidden {
  display: none !important;
}

/* ----------------------------------------------------
   View Transitions API Styles
   ---------------------------------------------------- */
::view-transition-group(root) {
  animation-duration: 0.35s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Forward transition: Slide left */
html:active-view-transition-type(forward)::view-transition-old(root) {
  animation-name: slide-to-left;
}
html:active-view-transition-type(forward)::view-transition-new(root) {
  animation-name: slide-from-right;
}

/* Backward transition: Slide right */
html:active-view-transition-type(backward)::view-transition-old(root) {
  animation-name: slide-to-right;
}
html:active-view-transition-type(backward)::view-transition-new(root) {
  animation-name: slide-from-left;
}

@keyframes slide-to-left {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-30px); opacity: 0; }
}

@keyframes slide-from-right {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slide-to-right {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(30px); opacity: 0; }
}

@keyframes slide-from-left {
  from { transform: translateX(-30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(root) {
    animation: none !important;
  }
  * {
    transition: none !important;
    animation: none !important;
  }
  .loader::before,
  .loader::after {
    animation: none !important;
  }
}

/* Responsive Styles */
@media (min-width: 768px) {
  .app-shell {
    min-height: calc(100vh - 48px);
    margin: 24px auto;
    border: 1px solid rgba(230, 226, 216, 0.8);
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(92, 76, 58, 0.12);
    overflow: hidden;
  }

  .page {
    padding: 24px 32px 64px;
  }

  .menu-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .form-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .form-actions {
    grid-column: 1 / -1;
  }

  .score-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .monthly-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .page {
    padding-inline: 14px;
  }

  .menu-card {
    grid-template-columns: 68px 1fr 16px;
    gap: 14px;
    padding: 14px;
  }

  .menu-image {
    width: 68px;
    height: 68px;
  }

  .reading-content {
    padding-inline: 18px;
  }

  .score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 커스텀 날짜 휠 피커 (Wheel Date Picker) */
.picker-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(44, 43, 41, 0.45);
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.picker-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.picker-container {
  width: calc(100% - 24px);
  margin: 12px;
  background: #fdfdfb;
  border-radius: 24px;
  box-shadow: 0 -5px 30px rgba(92, 76, 58, 0.12), 0 10px 40px rgba(92, 76, 58, 0.08);
  display: flex;
  flex-direction: column;
  transform: translateY(calc(100% + 24px));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.picker-modal.active .picker-container {
  transform: translateY(0);
}

.picker-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.picker-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-serif);
}

.picker-close {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
}

.picker-body {
  position: relative;
  display: flex;
  height: 280px;
  background: #f9f8f4;
  padding: 0 16px;
  overflow: hidden;
}

/* 휠 오버레이 그라데이션 - 위아래 페이드 효과 */
.picker-body::before,
.picker-body::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 90px;
  z-index: 2;
  pointer-events: none;
}

.picker-body::before {
  top: 0;
  background: linear-gradient(to bottom, #f9f8f4 15%, rgba(249, 248, 244, 0));
}

.picker-body::after {
  bottom: 0;
  background: linear-gradient(to top, #f9f8f4 15%, rgba(249, 248, 244, 0));
}

.picker-column {
  flex: 1;
  position: relative;
  height: 100%;
}

.picker-scroll {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none; /* Firefox 스크롤바 숨김 */
  -ms-overflow-style: none; /* IE 스크롤바 숨김 */
  padding: 0; /* 패딩 제거 - HTML 공백 더미로 대체 */
  box-sizing: border-box;
  scroll-behavior: smooth;
}

.picker-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari 스크롤바 숨김 */
}

.picker-item {
  height: 40px;
  line-height: 40px;
  text-align: center;
  scroll-snap-align: center;
  font-size: 15px;
  color: #a09e98;
  font-weight: 600;
  user-select: none;
  transition: color 0.2s, transform 0.2s, font-size 0.2s;
  cursor: pointer;
}

.picker-item.empty {
  height: 40px;
  pointer-events: none;
  opacity: 0;
}

.picker-item.selected {
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
  transform: scale(1.08);
}

/* 정중앙 선택 하이라이트 가이드 */
.picker-highlight {
  position: absolute;
  top: 120px;
  left: 8px;
  right: 8px;
  height: 40px;
  border-top: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  background: rgba(139, 126, 116, 0.04);
  pointer-events: none;
  border-radius: 6px;
  z-index: 1;
}

.picker-footer {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
  background: #fdfdfb;
}

.picker-confirm-btn {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 12px rgba(139, 126, 116, 0.24);
  transition: background-color 0.2s, transform 0.1s;
}

.picker-confirm-btn:active {
  transform: scale(0.98);
  background: var(--brown);
}

/* 데스크톱 모드 모달 대응 */
@media (min-width: 768px) {
  .picker-modal {
    align-items: center;
  }

  .picker-container {
    width: min(100%, 480px);
    margin: 0;
    border-radius: 24px;
    transform: scale(0.9) translateY(40px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .picker-modal.active .picker-container {
    transform: scale(1) translateY(0);
  }
}
