:root {
  color-scheme: light;
  font-size: 18px;
  --green: #17483d;
  --green-deep: #10382f;
  --green-soft: #eaf1e9;
  --gold: #8b6027;
  --ink: #243a34;
  --muted: #4d6259;
  --line: #cbd8cf;
  --paper: #fff;
  --background: #f4f7f3;
  --focus: #9a6414;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  font-size: 1rem;
}
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.site-header {
  width: min(100%, 920px);
  min-height: 84px;
  margin: auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #d9e2da;
}
.brand { display: inline-block; color: var(--green); text-decoration: none; }
.brand-name { display: block; font: 600 1.2rem/1.25 Georgia, "Times New Roman", serif; letter-spacing: .01em; }
.brand-tagline { display: block; margin-top: .18rem; font-size: .86rem; color: var(--muted); }
.free-label { flex: none; color: var(--green); font-size: .86rem; font-weight: 600; }

.app-shell { width: min(100% - 2rem, 650px); margin: 0 auto; padding: 1rem 0 2.25rem; }
.screen { width: 100%; }
.welcome {
  min-height: min(690px, calc(100svh - 110px));
  padding: 2rem 1.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.celestial { display: flex; align-items: center; gap: 1.1rem; margin-bottom: .65rem; color: var(--gold); font: 2.8rem/1 Georgia, serif; }
.celestial span:nth-child(2) { color: var(--green); font-size: 3.2rem; }
.eyebrow { margin: .25rem 0 .75rem; color: #5b6f48; font-size: .78rem; font-weight: 750; letter-spacing: .14em; }
h1, h2, h3 { color: var(--green); font-family: Georgia, "Times New Roman", serif; font-weight: 500; line-height: 1.2; }
.welcome h1 { max-width: 16ch; margin: .3rem auto .8rem; font-size: clamp(2.25rem, 8vw, 3.2rem); }
.welcome-copy { max-width: 29ch; margin: .5rem auto 1.6rem; font-size: 1.15rem; }
.privacy-note { margin: .9rem 0 0; color: var(--muted); font-size: .85rem; text-align: center; }

.progress { margin: .2rem 0 1rem; padding: 0; }
.progress ol { display: flex; justify-content: space-between; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.progress li { position: relative; flex: 1; padding: .3rem .15rem; color: #586b61; text-align: center; font-size: .76rem; }
.progress li::before { content: ""; display: block; height: 4px; margin-bottom: .35rem; border-radius: 999px; background: #d6e0d7; }
.progress li.completed::before, .progress li[aria-current="step"]::before { background: var(--green); }
.progress li[aria-current="step"] { color: var(--green-deep); font-weight: 750; }
.progress-text { margin: .35rem 0 0; color: var(--muted); text-align: center; font-size: .82rem; }

.question-panel, .results {
  padding: clamp(1.2rem, 5vw, 2rem);
  border: 1px solid #d0dcd2;
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 14px 38px rgb(20 62 53 / 6%);
}
.question-panel { min-height: 390px; }
.question-panel h1, .results > h1 { margin: .2rem 0 .85rem; font-size: clamp(1.8rem, 6vw, 2.35rem); }
.question-copy { max-width: 48ch; color: #3f534b; }
label { display: block; margin: 1.1rem 0 .45rem; color: #253c34; font-weight: 700; }
input:not([type="checkbox"]), select {
  display: block;
  width: 100%;
  min-height: 60px;
  padding: .7rem .85rem;
  border: 1.5px solid #758b80;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-size: 1.05rem;
}
input::placeholder { color: #65766e; opacity: 1; }
input:disabled { background: #edf1ed; color: #5d6e65; }
small { display: block; margin: .45rem 0 .8rem; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.check-row { display: flex; align-items: flex-start; gap: .75rem; margin: 1.2rem 0 .4rem; padding: .9rem; border: 1px solid var(--line); border-radius: 12px; background: #f7f9f6; font-weight: 600; cursor: pointer; }
.check-row input { flex: none; width: 25px; height: 25px; margin: .15rem 0 0; accent-color: var(--green); }
.step-error { min-height: 0; margin: .7rem 0 0; color: #8d2525; font-weight: 650; }
.step-error:empty { display: none; }
.step-actions { display: grid; grid-template-columns: minmax(105px, .8fr) minmax(0, 1.5fr); gap: .75rem; margin-top: 1.25rem; }
.button {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  padding: .75rem 1rem;
  border: 1.5px solid #758b80;
  border-radius: 12px;
  font-weight: 720;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button-primary { border-color: var(--green); background: var(--green); color: #fff; }
.button-primary:hover { background: var(--green-deep); }
.button-primary:disabled { cursor: not-allowed; opacity: .58; }
.button-large { width: min(100%, 360px); min-height: 68px; font-size: 1.12rem; }
.button-back { background: #fff; color: var(--green); }
.button-back:hover { background: #f1f5f1; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible, [tabindex="-1"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.city-options { display: grid; gap: .5rem; margin: .4rem 0; }
.city-option { min-height: 54px; padding: .65rem .8rem; border: 1px solid #b7c8bc; border-radius: 10px; background: #f5f8f4; color: var(--ink); text-align: left; cursor: pointer; }
.city-option:hover, .city-option:focus-visible { border-color: var(--green); background: var(--green-soft); }
.city-confirmation { margin: .7rem 0; color: #174f3c; font-weight: 680; overflow-wrap: anywhere; }
.ambiguity { margin: 1rem 0; padding: .9rem; border: 1px solid #d7c7a7; border-radius: 12px; background: #faf7ee; }

.results { margin-top: .5rem; }
.results > .eyebrow { margin-top: 0; }
.result-summary { color: #42564d; font-size: .92rem; overflow-wrap: anywhere; }
.tap-hint { margin: 1rem 0 .75rem; color: var(--muted); font-size: .9rem; }
.result-cards { display: grid; gap: .8rem; }
.result-card { padding: 1rem 1.1rem; border: 1px solid #cedbd1; border-radius: 15px; background: #fff; }
.card-symbol { color: var(--gold); font: 2rem/1 Georgia, serif; }
.card-name { margin: .4rem 0 .1rem; font-weight: 700; }
.card-sign { margin: .15rem 0 .25rem; font-size: 1.8rem; overflow-wrap: anywhere; }
.degree { margin: 0 0 .4rem; color: #53665d; font-size: .86rem; }
.interpretation { margin-top: .7rem; border-top: 1px solid #e0e7e1; }
.interpretation summary { min-height: 48px; padding: .7rem .1rem .35rem; color: var(--green); font-weight: 720; cursor: pointer; }
.interpretation p { margin: .3rem 0 .2rem; color: #344941; }
.undetermined { background: #f7f8f5; }
.uncertainty-note { margin: .45rem 0 .1rem; color: #42574d; }
.calculation-note { margin: 1rem 0; padding: .85rem 1rem; border-left: 3px solid #849366; border-radius: 5px; background: #eef3eb; color: #35493f; font-size: .87rem; }
.edit-button { width: 100%; }

.book-promo { display: grid; grid-template-columns: minmax(92px, 125px) minmax(0, 1fr); gap: 1rem; align-items: center; margin-top: 1.6rem; padding: 1.1rem; border: 1px solid #d1ddcf; border-radius: 16px; background: #eef3eb; }
.book-cover { display: block; width: 100%; height: auto; max-height: 190px; object-fit: cover; object-position: top; border-radius: 7px; box-shadow: 0 5px 16px rgb(18 63 54 / 16%); }
.book-content .eyebrow { margin-top: 0; }
.book-content h2 { margin: .2rem 0 .6rem; font-size: 1.45rem; }
.book-content p:not(.eyebrow) { margin: .4rem 0 .7rem; font-size: .92rem; }
.book-button { width: 100%; }
.more-links { display: grid; gap: .25rem; margin: 1.1rem 0 .2rem; }
.more-links a { display: flex; min-height: 50px; align-items: center; padding: .55rem .25rem; color: #194d3e; font-weight: 630; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.astrology-note { margin: 1.2rem 0 0; padding: .2rem .4rem; color: #56685f; text-align: center; font-size: .82rem; }
.site-footer { display: grid; justify-items: center; gap: .3rem; padding: 1.2rem 1rem 1.8rem; border-top: 1px solid #d9e2da; color: var(--green); font-family: Georgia, "Times New Roman", serif; }
.site-footer > a { font: 500 .86rem system-ui, sans-serif; }
.credits { width: min(100%, 650px); margin-top: .5rem; color: #45594f; font: .82rem/1.55 system-ui, sans-serif; }
.credits summary { min-height: 48px; padding: .65rem 0; text-align: center; cursor: pointer; font-weight: 650; }
.credits p { margin: .45rem 0; }
.skip { position: absolute; z-index: 10; top: -100px; left: .8rem; padding: .8rem 1rem; border-radius: 8px; background: #fff; color: var(--green); }
.skip:focus { top: .8rem; }

@media (max-width: 520px) {
  :root { font-size: 18px; }
  .site-header { min-height: 78px; padding: .85rem .95rem; gap: .55rem; }
  .brand-name { max-width: 18ch; font-size: 1.05rem; }
  .brand-tagline { font-size: .82rem; }
  .free-label { max-width: 90px; font-size: .76rem; line-height: 1.4; text-align: right; }
  .app-shell { width: min(100% - 1.2rem, 650px); padding-top: .55rem; }
  .welcome { min-height: min(650px, calc(100svh - 90px)); padding: 1.5rem .35rem 2rem; }
  .celestial { gap: .8rem; font-size: 2.5rem; }
  .celestial span:nth-child(2) { font-size: 2.9rem; }
  .eyebrow { font-size: .74rem; }
  .progress li { font-size: .68rem; }
  .question-panel, .results { padding: 1.15rem; border-radius: 16px; }
  .question-panel { min-height: 0; }
  .question-panel h1, .results > h1 { font-size: 1.8rem; }
  .step-actions { grid-template-columns: minmax(98px, .8fr) minmax(0, 1.45fr); gap: .55rem; }
  .button { min-height: 58px; padding: .7rem .65rem; }
  .book-promo { grid-template-columns: 82px minmax(0, 1fr); gap: .8rem; padding: .9rem; align-items: start; }
  .book-cover { max-height: 125px; }
  .book-content h2 { font-size: 1.3rem; }
  .book-content p:not(.eyebrow) { font-size: .88rem; }
  .more-links { margin-top: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
