/*
  ZodiacSolver styles.
  Idea: every page opens under the night sky (header + intro share one indigo band), and the
  reading and calculating happens on a light page below it. Gold marks astrological glyphs;
  the four element colors (fire, earth, air, water) mark the signs wherever a sign is the subject.
  Sections: fonts, tokens, base, header, footer, night band, home, tools and forms, results,
  tables, FAQ, then page-specific blocks in the order they were added.
*/

/* ---------- Fonts (self-hosted, see src/fonts/README.md) ---------- */
@font-face { font-family: "Young Serif"; src: url("fonts/young-serif.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
/* Zodiac, planet and aspect glyphs: one look on every device. */
@font-face { font-family: "ZS Astro"; src: url("fonts/astro-1.woff2") format("woff2"); font-weight: 100 900; font-display: swap; size-adjust: 116%; unicode-range: U+260A-260D, U+263D-2640, U+2642-2653, U+26B7-26B9; }
@font-face { font-family: "ZS Astro"; src: url("fonts/astro-2.woff2") format("woff2"); font-display: swap; size-adjust: 116%; unicode-range: U+25A1, U+25B3, U+25CB, U+25CF, U+2600, U+2609, U+2726, U+2736; }

/* ---------- Tokens ---------- */
:root {
  /* Page */
  --paper: #faf9fd;
  --surface: #ffffff;
  --panel: #efecf8;
  --ink: #1a1638;
  --muted: #5a5478;
  --line: #dedaec;
  --plum: #4f3db5;
  --plum-ink: #ffffff;
  --ochre: #9a6a12;
  --ochre-soft: #f3e3bd;
  --now: #1f7a68;
  --focus: #4f3db5;
  --danger: #b3261e;
  /* Night band (header, intro, footer): the same in both themes */
  --night: #1b1642;
  --night-2: #2a2060;
  --night-ink: #f4f1ff;
  --night-muted: #bcb4e0;
  --night-line: rgba(255, 255, 255, 0.14);
  --gold: #e9c06c;
  /* Elements, as they read on the night band and on the page */
  --fire: #ff9273; --earth: #86d6a3; --air: #f3d470; --water: #8fb9ff;
  --fire-ink: #b8402a; --earth-ink: #2c7a4c; --air-ink: #8a6a08; --water-ink: #2f5fc4;
  --el: var(--gold);
  --el-ink: var(--ochre);

  --sym: "ZS Astro", "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols", "DejaVu Sans", sans-serif;
  --display: "Young Serif", "ZS Astro", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --body: "Figtree", "ZS Astro", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --measure: 68ch;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(27, 22, 66, 0.06), 0 22px 44px -28px rgba(27, 22, 66, 0.4);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #110e27;
    --surface: #1a1639;
    --panel: #221d47;
    --ink: #eeebfa;
    --muted: #aea7cc;
    --line: #322c5c;
    --plum: #b9aaff;
    --plum-ink: #15112f;
    --ochre: #e3b862;
    --ochre-soft: #4a3c1f;
    --now: #6cc7b5;
    --focus: #b9aaff;
    --danger: #ffb4ab;
    --night: #1b1642;
    --night-2: #2a2060;
    --fire-ink: var(--fire); --earth-ink: var(--earth); --air-ink: var(--air); --water-ink: var(--water);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 22px 44px -28px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}

body[data-el="fire"] { --el: var(--fire); --el-ink: var(--fire-ink); }
body[data-el="earth"] { --el: var(--earth); --el-ink: var(--earth-ink); }
body[data-el="air"] { --el: var(--air); --el-ink: var(--air-ink); }
body[data-el="water"] { --el: var(--water); --el-ink: var(--water-ink); }

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
}
main { overflow-x: clip; }

a { color: var(--plum); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { margin: 0; text-wrap: balance; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: -0.012em; }
h1 { font-size: clamp(2.1rem, 5.6vw, 3.5rem); line-height: 1.06; }
h2 { font-size: clamp(1.5rem, 3.2vw, 1.95rem); line-height: 1.15; margin-top: 3.25rem; }
h3 { font: 700 1.17rem/1.3 var(--body); letter-spacing: -0.005em; margin-top: 1.75rem; }
p, ul, ol, table { margin: 0.9rem 0 0; }
strong, b { font-weight: 650; }

.wrap { width: min(100% - 2rem, 62rem); margin-inline: auto; }
.prose { max-width: var(--measure); }
.prose li + li { margin-top: 0.35rem; }
@media (min-width: 900px) { .prose { font-size: 1.125rem; } .prose table, .prose .faq { font-size: 1rem; } }
.prose ul > li::marker { color: var(--ochre); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Night surfaces: header, intro, footer ---------- */
.site-head, .intro, .site-foot {
  --ink: var(--night-ink);
  --muted: var(--night-muted);
  --line: var(--night-line);
  --plum: #cfc5ff;
  --ochre: var(--gold);
  --focus: var(--gold);
  --el-ink: var(--el);
  color: var(--ink);
}

/* Header */
.site-head { background: var(--night); position: relative; z-index: 30; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.75rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font: 400 1.3rem/1 var(--display); letter-spacing: -0.01em; }
.brand svg { width: 1.9rem; height: 1.9rem; }
.site-nav { display: flex; align-items: center; gap: 0.25rem; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 550; font-size: 0.98rem; white-space: nowrap; padding: 0.5rem 0.7rem; border-radius: 999px; }
.site-nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.site-nav a[aria-current="page"] { color: var(--night); background: var(--gold); }
.site-nav .nav-more { display: none; }
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0 0.9rem; margin-right: -0.4rem;
    font: 600 0.98rem/1 var(--body); color: var(--ink); background: rgba(255, 255, 255, 0.08); border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  }
  .nav-toggle::before { content: ""; width: 1.05rem; height: 0.7rem; border-block: 2px solid currentColor; }
  .nav-toggle[aria-expanded="true"] { background: var(--gold); color: var(--night); }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--night); border-top: 1px solid var(--line); padding: 0.5rem 1rem 1rem; box-shadow: 0 24px 40px -20px rgba(0, 0, 0, 0.6);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { font-size: 1.08rem; padding: 0.85rem 0.6rem; border-radius: 10px; color: var(--ink); border-bottom: 1px solid var(--line); }
  .site-nav a:last-child { border-bottom: 0; }
  .site-nav a[aria-current="page"] { background: transparent; color: var(--gold); }
  .site-nav .nav-more { display: block; }
}
@media (max-width: 420px) {
  .brand { font-size: 1.15rem; }
  .brand svg { width: 1.6rem; height: 1.6rem; }
}

/* Footer */
.site-foot { margin-top: 5rem; background: var(--night); font-size: 0.95rem; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--ink); text-decoration: underline; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 2rem 1.5rem; padding-block: 3rem 2rem; }
.foot-cols h2 { font: 700 0.95rem/1.3 var(--body); letter-spacing: 0; margin: 0; color: var(--ink); }
.foot-cols ul { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.1rem; }
.foot-cols li a { display: inline-block; padding: 0.3rem 0; }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; padding-block: 1.25rem 2.25rem; border-top: 1px solid var(--line); color: var(--muted); }
.foot-base p { margin: 0; }
.foot-base nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }

/* ---------- Page intro: the night band ---------- */
.intro { position: relative; isolation: isolate; padding: clamp(1.75rem, 5vw, 3rem) 0 clamp(2.25rem, 5vw, 3.25rem); margin-bottom: 2.5rem; }
/* Full-width sky behind the intro, wider than the text column. A few fixed stars and a faint glow in the element color. */
.intro::before {
  content: ""; position: absolute; z-index: -1; inset: 0 calc(50% - 50vw);
  background: linear-gradient(180deg, var(--night), var(--night-2));
}
/* On wide screens: a few fixed stars and a faint glow in the element color, kept to the empty right side. */
@media (min-width: 900px) {
  .intro::before {
    background:
      radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.7) 50%, transparent 52%) right 4% top / 30rem 15rem no-repeat,
      radial-gradient(1.5px 1.5px at 42% 74%, rgba(255, 255, 255, 0.5) 50%, transparent 52%) right 4% top / 30rem 15rem no-repeat,
      radial-gradient(1.5px 1.5px at 63% 22%, rgba(255, 255, 255, 0.6) 50%, transparent 52%) right 4% top / 30rem 15rem no-repeat,
      radial-gradient(2.5px 2.5px at 78% 58%, rgba(233, 192, 108, 0.85) 50%, transparent 52%) right 4% top / 30rem 15rem no-repeat,
      radial-gradient(1.5px 1.5px at 92% 34%, rgba(255, 255, 255, 0.55) 50%, transparent 52%) right 4% top / 30rem 15rem no-repeat,
      radial-gradient(1px 1px at 55% 90%, rgba(255, 255, 255, 0.45) 50%, transparent 52%) right 4% top / 30rem 15rem no-repeat,
      radial-gradient(closest-side, color-mix(in srgb, var(--el) 15%, transparent), transparent) right 6% center / 44rem 150% no-repeat,
      linear-gradient(180deg, var(--night), var(--night-2));
  }
  .home-hero::before { background: linear-gradient(180deg, var(--night), var(--night-2)); }
}
/* A calculator or summary card that follows the intro rises out of the band. */
.intro:has(+ .tool) { padding-bottom: 5rem; margin-bottom: 0; }
.intro + .tool { margin-top: -3rem; position: relative; }
.intro + h2, .intro + .prose > h2:first-child, .intro + article > h2:first-child { margin-top: 0; }

.intro .lede { font-size: 1.17rem; line-height: 1.6; color: var(--muted); max-width: 60ch; margin-top: 1rem; }
.crumbs { font-size: 0.9rem; color: var(--muted); margin: 0 0 1rem; }
.crumbs a { color: var(--muted); text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.crumbs a:hover { color: var(--ink); }
.intro h1 .zc-pair { color: var(--el); }
.sky-now { margin-top: 1.5rem; font-size: 1.05rem; color: var(--muted); }
.sky-now strong { color: var(--ink); }

/* Period switch (today / this week / this month) */
.hs-tabs { display: inline-flex; gap: 0.2rem; padding: 0.25rem; border-radius: 999px; background: rgba(255, 255, 255, 0.09); margin-top: 1.5rem; flex-wrap: wrap; }
.hs-tabs a { padding: 0.5rem 1.05rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 650; font-size: 0.95rem; }
.hs-tabs a:hover { color: var(--ink); }
.hs-tabs a[aria-current] { background: var(--gold); color: var(--night); }

/* ---------- Home ---------- */
.home-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 2.5rem; align-items: center; padding-top: clamp(2rem, 5vw, 3.25rem); }
.home-hero h1 { max-width: 15ch; font-size: clamp(2.4rem, 6.4vw, 4.1rem); }
.hero-text, .hero-pick, .hero-sky { min-width: 0; }
.hero-pick { margin-top: 0.5rem; }
.hero-sky { margin: 2.25rem auto 0; width: min(100%, 21rem); text-align: center; }
.sky-wheel { display: block; width: 100%; height: auto; --wheel-line: rgba(255, 255, 255, 0.3); }
.sky-wheel text { font-family: var(--sym); }
.sky-cap { margin: 0.6rem 0 0; font-size: 0.92rem; color: var(--muted); }
.sky-cap strong { color: var(--ink); font-weight: 600; }
@media (min-width: 900px) {
  .home-hero { grid-template-columns: minmax(0, 1fr) 21rem; grid-template-areas: "text sky" "pick pick"; }
  .hero-text { grid-area: text; }
  .hero-sky { grid-area: sky; margin: 0; }
  .hero-pick { grid-area: pick; margin-top: 1.25rem; }
}

.hs-signs { list-style: none; padding: 0; margin: 1.1rem 0 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.hs-signs li { --c: var(--gold); }
.hs-signs .el-fire { --c: var(--fire); }
.hs-signs .el-earth { --c: var(--earth); }
.hs-signs .el-air { --c: var(--air); }
.hs-signs .el-water { --c: var(--water); }
.hs-signs a {
  position: relative; display: grid; justify-items: center; gap: 0.1rem; height: 100%; padding: 0.95rem 0.4rem 0.8rem;
  border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
}
.hs-signs a:hover { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.hs-signs li.is-season a { border-color: color-mix(in srgb, var(--c) 70%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); }
.hs-glyph { font-family: var(--sym); font-size: 1.9rem; line-height: 1.1; color: var(--c, var(--ochre)); }
.hs-name { font-weight: 650; font-size: 0.98rem; }
.hs-when { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.hs-in { position: absolute; top: 0.3rem; right: 0.45rem; font: 500 0.82rem/1 var(--sym); letter-spacing: 0.08em; color: var(--muted); }
.hs-in:empty { display: none; }
@media (max-width: 760px) { .hs-signs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; } }
@media (max-width: 520px) { .hs-signs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Tool directory */
.home-jump { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.home-jump a { display: inline-block; padding: 0.5rem 0.95rem; border-radius: 999px; background: var(--panel); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.home-jump a:hover { background: var(--plum); color: var(--plum-ink); }
.home-jump + h2 { margin-top: 2.5rem; }
.tool-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.25rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); }
.tool-list a { display: grid; grid-template-columns: 3rem 1fr; gap: 0.1rem 1rem; align-items: start; padding: 0.85rem 0.75rem; margin-inline: -0.75rem; border-radius: var(--radius); text-decoration: none; color: var(--ink); height: 100%; }
.tool-list a:hover { background: var(--panel); }
.tool-list a:hover .tool-name { color: var(--plum); }
.tool-list .glyph {
  grid-row: span 2; width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: 50%;
  background: var(--night); color: var(--gold); font: 500 1.45rem/1 var(--sym);
}
.tool-list .glyph[lang="zh"] { font-family: "Noto Serif TC", "Songti SC", "PMingLiU", serif; font-size: 1.35rem; }
.tool-list .num-glyph { font: 700 1rem/1 var(--body); letter-spacing: -0.02em; }
.tool-name { font: 700 1.12rem/1.3 var(--body); align-self: end; }
.tool-desc { color: var(--muted); font-size: 0.97rem; line-height: 1.5; }
.soon { color: var(--muted); margin-top: 1.5rem; }
h2 + .tool-list { margin-top: 0.75rem; }
.num-glyph { font-family: var(--body); font-weight: 700; }

/* ---------- Tools and forms ---------- */
.tool { margin-top: 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(1.25rem, 4vw, 2rem); box-shadow: var(--shadow); }
.tool + .tool { margin-top: 1.5rem; }
.tool-h { margin-top: 0; font-size: 1.4rem; }
.tool form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; }
.field { display: grid; gap: 0.4rem; }
.field label, .choice legend { font-weight: 650; font-size: 0.95rem; }
.field .hint { font-size: 0.9rem; color: var(--muted); }
.field-wide { flex: 1 1 18rem; }
.opt { font-weight: 400; color: var(--muted); font-size: 0.9rem; }

input[type="date"], input[type="time"], input[type="text"], input[type="number"], input[type="email"], select {
  font: 500 1.05rem/1.2 var(--body); color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 0.7rem 0.85rem; min-height: 3.1rem;
}
input[type="text"], input[type="number"] { width: 100%; }
input[type="number"] { width: 8rem; }
select { min-width: 12rem; }
input:hover, select:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent); outline-offset: 0; border-color: var(--focus); border-radius: 12px; }
input[type="time"]:disabled { opacity: 0.45; }
::placeholder { color: var(--muted); opacity: 0.8; }
.field .hint input[type="date"] { min-height: 2.4rem; padding: 0.35rem 0.5rem; font-size: 0.95rem; margin-top: 0.3rem; }

.btn {
  font: 700 1.03rem/1 var(--body); background: var(--plum); color: var(--plum-ink);
  border: 0; border-radius: 12px; padding: 0.95rem 1.5rem; min-height: 3.1rem; cursor: pointer;
}
.btn:hover { background: color-mix(in srgb, var(--plum) 86%, var(--ink)); }
.btn:active { transform: translateY(1px); }
.btn-link { display: inline-block; text-decoration: none; }
.btn-small { padding: 0.65rem 1.1rem; min-height: 2.6rem; font-size: 0.95rem; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: var(--panel); }
.form-error { color: var(--danger); font-weight: 600; flex-basis: 100%; margin: 0; }

/* Radio choice and checkboxes */
.choice { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; align-items: center; }
.choice legend { padding: 0; margin-bottom: 0.35rem; width: 100%; }
.choice label { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 3rem; cursor: pointer; }
.choice input { width: 1.1rem; height: 1.1rem; accent-color: var(--plum); }
.check { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 500 !important; font-size: 0.95rem; margin-top: 0.4rem; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--plum); }

/* Form order on every screen: fields, then options, then the button, then errors. */
.tool form .form-row, .tool form .choice { flex-basis: 100%; order: 10; margin-top: -0.25rem; }
.tool form .btn { order: 20; }
.tool form .form-error { order: 21; }
.tool form .choice legend { width: auto; margin-bottom: 0; margin-right: 0.5rem; }
.tool form .choice label { min-height: 2.25rem; }
.check.form-row { margin-top: -0.1rem; }
#cz-form[data-tool="compat"] { align-items: flex-start; }
#cz-form[data-tool="compat"] .btn { margin-top: calc(0.95rem * 1.65 + 0.4rem); }
@media (max-width: 640px) {
  .tool form .field { flex: 1 1 100%; }
  .tool form .field input, .tool form .field select { width: 100%; }
  .tool form .form-row { order: 5; margin-top: -0.5rem; }
  .tool form .combo { order: 6; }
  .tool form .field:has(> select) { order: 7; }
  .tool form .btn { flex: 1 1 100%; }
  #cz-form[data-tool="compat"] .btn { margin-top: 0; }
}

/* City search */
.combo { position: relative; }
.combo-list { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; margin: 0.25rem 0 0; padding: 0.3rem; list-style: none; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 18rem; overflow-y: auto; }
.combo-list li { padding: 0.6rem 0.7rem; border-radius: 8px; cursor: pointer; }
.combo-list li[aria-selected="true"] { background: var(--panel); }

/* ---------- Results ---------- */
.result { margin-top: 1.75rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.result[hidden] { display: none; }
.result h3 { margin-top: 1.5rem; }
.result-grid { display: grid; gap: 1.75rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 760px) { .result-grid { grid-template-columns: 300px minmax(0, 1fr); } }

.wheel { width: 100%; max-width: 300px; margin-inline: auto; display: block; }
.wheel-legend { list-style: none; padding: 0; margin: 0.75rem auto 0; max-width: 300px; font-size: 0.92rem; color: var(--muted); display: grid; gap: 0.3rem; }
.wheel-legend span { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 50%; margin-right: 0.45rem; vertical-align: -0.05rem; }

.headline-result:focus { outline: none; }
.headline-result { font: 400 clamp(1.45rem, 3.8vw, 1.9rem)/1.2 var(--display); margin: 0; }
.natal-line { color: var(--muted); margin-top: 0.5rem; }
.natal-line strong { color: var(--ink); }

.returns { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: 0; }
.returns > li { padding: 1rem 0; border-top: 1px solid var(--line); }
.returns > li:first-child { border-top: 0; padding-top: 0.25rem; }
.returns h3 { margin: 0; font-size: 1.1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.badge { font: 650 0.8rem/1 var(--body); border-radius: 999px; padding: 0.35rem 0.6rem; background: var(--ochre-soft); color: var(--ink); }
.badge.now { background: var(--now); color: var(--paper); }
.season { margin: 0.4rem 0 0; }
.passes { margin: 0.4rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.97rem; }
.passes strong { color: var(--ink); font-weight: 600; }

@media (prefers-reduced-motion: no-preference) {
  .result.reveal .wheel .transit-arc { animation: draw 900ms ease-out both; }
  @keyframes draw { from { stroke-dashoffset: var(--arc-len); } to { stroke-dashoffset: 0; } }
}

.note { font-size: 0.95rem; color: var(--muted); background: color-mix(in srgb, var(--ochre-soft) 45%, transparent); border-radius: 10px; padding: 0.7rem 0.9rem; margin-top: 0.8rem; }
.share-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.share-msg { align-self: center; color: var(--muted); font-size: 0.92rem; overflow-wrap: anywhere; }
.code-box { width: 100%; font: 0.9rem/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--ink); background: var(--panel); border: 1.5px solid var(--line); border-radius: 12px; padding: 0.8rem; resize: vertical; margin-top: 1rem; }

/* ---------- Tables ---------- */
/* position: relative keeps visually hidden labels inside the scroll box, so they cannot widen the page. */
.table-scroll { overflow-x: auto; margin-top: 1rem; position: relative; }
table { border-collapse: collapse; width: 100%; font-size: 0.97rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; color: var(--muted); font-size: 0.92rem; padding-bottom: 0.5rem; }
th, td { text-align: left; padding: 0.65rem 0.9rem 0.65rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 0.88rem; font-weight: 650; color: var(--muted); border-bottom: 2px solid var(--line); }
tbody th { font-weight: 650; }
td.sign { white-space: nowrap; }
td.sign a { text-decoration: none; font-weight: 600; }
td.sign a:hover { text-decoration: underline; }
tr.row-now td { font-weight: 650; background: color-mix(in srgb, var(--ochre-soft) 45%, transparent); }
table.chart td:first-child { font-weight: 650; width: 6rem; }

/* ---------- FAQ ---------- */
.faq { margin-top: 1rem; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 650; font-size: 1.05rem; list-style: none; display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: 1rem 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.5rem/1 var(--body); color: var(--plum); width: 1.75rem; height: 1.75rem; display: grid; place-items: center; border-radius: 50%; background: var(--panel); }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { color: var(--plum); }
.faq details p { color: var(--muted); margin: 0; padding: 0 2.75rem 1.1rem 0; }

/* ---------- Sign and link grids ---------- */
.sign-grid { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.sign-grid a { display: grid; grid-template-columns: 2.5rem 1fr; gap: 0.8rem; align-items: start; height: 100%; padding: 0.85rem 0.95rem; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.sign-grid a:hover { border-color: var(--plum); }
.sign-grid a:hover .n { color: var(--plum); }
.sign-grid a[aria-current="page"] { border-color: var(--plum); box-shadow: inset 0 0 0 1px var(--plum); }
.sign-grid a[aria-current="page"] .n { color: var(--plum); }
.sign-grid .g { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: 50%; background: var(--panel); font: 500 1.35rem/1 var(--sym); color: var(--ochre); }
.sign-grid .g .cz-glyph { font-size: 1.2rem; }
.sign-grid .n { display: block; font-weight: 650; }
.sign-grid .t { display: block; color: var(--muted); font-size: 0.93rem; line-height: 1.45; }
.plain-links { padding-left: 1.1rem; }
.plain-list { list-style: none; padding: 0; }
.plain-list li { padding: 0.35rem 0; border-top: 1px solid var(--line); }
.facts { padding-left: 1.1rem; }

/* ---------- Numerology ---------- */
.num-list { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.num-row { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem; padding: 1.1rem 0; border-top: 1px solid var(--line); }
.num-row:first-child { border-top: 0; }
.num-row h3 { margin: 0; font-size: 1.15rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.num-big { font: 400 3.2rem/1 var(--display); color: var(--plum); text-align: center; }
.math { margin-top: 0.6rem; font-size: 0.95rem; }
.math summary { cursor: pointer; color: var(--plum); font-weight: 600; }
.math ol { padding-left: 1.2rem; }
.math code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9rem; word-break: break-word; }
.num-g { font-family: var(--display); }
.meanings { margin: 1rem 0 0; }
.meanings div { padding: 0.7rem 0; border-top: 1px solid var(--line); }
.meanings dt { font-weight: 650; }
.meanings dd { margin: 0.2rem 0 0; color: var(--muted); }
@media (max-width: 420px) { .num-row { grid-template-columns: 3rem 1fr; } .num-big { font-size: 2.4rem; } }

/* ---------- Chinese zodiac ---------- */
.cz-born { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.4rem; }
.cz-glyph { font-family: "Noto Serif TC", "Songti SC", "PMingLiU", serif; font-size: 1.35rem; color: var(--ochre); }
.cz-result { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: start; }
.cz-big { font: 400 5.5rem/1 "Noto Serif TC", "Songti SC", "PMingLiU", serif; color: var(--ochre); }
.cz-pair { font-size: 3.6rem; letter-spacing: 0.05em; }
@media (max-width: 520px) { .cz-result { grid-template-columns: 1fr; gap: 0.5rem; } .cz-big { font-size: 4rem; } }
.rating { display: flex; gap: 0.35rem; margin-top: 0.6rem; }
.rating .dot { width: 0.85rem; height: 0.85rem; border-radius: 50%; background: var(--line); }
.rating .dot.on { background: var(--ochre); }
table.cz-matrix { width: auto; border-collapse: separate; border-spacing: 3px; }
table.cz-matrix th, table.cz-matrix td { border: 0; padding: 0; text-align: center; }
table.cz-matrix thead th { padding-bottom: 0.3rem; border: 0; color: var(--ink); }
table.cz-matrix tbody th { text-align: right; padding-right: 0.6rem; font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
table.cz-matrix td { width: clamp(1.05rem, 5vw, 2.6rem); height: clamp(1.05rem, 5vw, 2.6rem); border-radius: 6px; }
@media (max-width: 420px) { table.cz-matrix { border-spacing: 2px; } table.cz-matrix tbody th { font-size: 0.82rem; padding-right: 0.4rem; } table.cz-matrix thead th { font-size: 0.95rem; } table.cz-matrix td { border-radius: 4px; } }
.r5 { background: var(--plum); }
.r3 { background: color-mix(in srgb, var(--plum) 28%, var(--paper)); }
.r2 { background: color-mix(in srgb, var(--ochre) 40%, var(--paper)); }
.r1 { background: var(--ochre); }
.cz-legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.92rem; color: var(--muted); }
.cz-legend span { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 4px; margin-right: 0.4rem; vertical-align: -0.1rem; }
.cz-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 2rem; }

/* ---------- Retrogrades ---------- */
.status-answer { font: 400 clamp(1.5rem, 4vw, 2.2rem)/1.2 var(--display); margin-top: 1.25rem; max-width: 30ch; }
.status-answer[data-state="retrograde"] { color: var(--ochre); }
.retro { margin-top: 2rem; }
.retro h3 { margin-top: 0; }
.timeline { list-style: none; padding: 0; margin: 1rem 0 0; border-left: 2px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 11rem 1fr; gap: 0.15rem 1rem; padding: 0.55rem 0 0.55rem 1rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 0.95rem; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.timeline li.tl-main::before { background: var(--ochre); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ochre) 22%, transparent); }
.timeline .tl-k { font-weight: 650; }
.timeline .tl-n { grid-column: 2; color: var(--muted); font-size: 0.95rem; }
@media (max-width: 560px) { .timeline li { grid-template-columns: 1fr; } .timeline .tl-n { grid-column: 1; } }

/* ---------- Birth chart ---------- */
.placements { list-style: none; padding: 0; margin: 1rem 0 0; }
.placements li { display: grid; grid-template-columns: 2.6rem 1fr; gap: 0.8rem; padding: 0.85rem 0; border-top: 1px solid var(--line); }
.placements li:first-child { border-top: 0; }
.placements h3 { margin: 0; font-size: 1.08rem; }
.placements .pl-glyph { font: 500 1.5rem/1.2 var(--sym); color: var(--plum); text-align: center; }
.placements li.is-focus .pl-glyph { color: var(--ochre); }
.placements li.is-focus h3 { font-size: 1.25rem; }
.pl-deg { font-weight: 500; color: var(--muted); font-size: 0.95rem; margin-left: 0.3rem; }
@media (min-width: 760px) { .chart-grid { grid-template-columns: 340px minmax(0, 1fr); } }
.chart-wheel { max-width: 340px; }
.placements-table th[scope="row"] { white-space: nowrap; font-weight: 650; }
.pl-g { display: inline-block; width: 1.6rem; color: var(--plum); font-family: var(--sym); }
.pl-line { color: var(--muted); font-size: 0.95rem; min-width: 14rem; }
.placements-table abbr { text-decoration: none; color: var(--ochre); font-weight: 700; cursor: help; }
.asp-g { color: var(--ochre); font-family: var(--sym); }
.balance { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0 1.5rem; margin-top: 0.5rem; }
.balance h3 { font-size: 1rem; margin: 1rem 0 0.4rem; }
.bal-row { display: grid; grid-template-columns: 5.5rem 1fr 1.5rem; gap: 0.6rem; align-items: center; font-size: 0.95rem; padding: 0.15rem 0; }
.bal-bar { height: 0.55rem; border-radius: 999px; background: linear-gradient(90deg, var(--plum) var(--w), var(--line) var(--w)); }
.bal-row span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .placements-table thead, table.aspects thead { display: none; }
  .placements-table tr, table.aspects tr { display: grid; grid-template-columns: auto 1fr auto; gap: 0.15rem 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
  .placements-table th, .placements-table td, table.aspects td { border: 0; padding: 0; }
  .placements-table .pl-line { grid-column: 1 / -1; min-width: 0; }
  table.aspects tr { grid-template-columns: 1fr auto; }
  table.aspects td:last-child { grid-column: 1 / -1; color: var(--muted); font-size: 0.92rem; }
}

/* ---------- Moon ---------- */
.moon-svg { max-width: 220px; height: auto; }
@media (min-width: 760px) { .moon-grid { grid-template-columns: 240px minmax(0, 1fr); } }
.ph-icon svg { width: 22px; height: 22px; vertical-align: -5px; margin-right: 0.35rem; }
table.moon-cal tr.ph-full td, table.moon-cal tr.ph-new td { font-weight: 600; }
table.moon-cal tr.ph-first td, table.moon-cal tr.ph-last td { color: var(--muted); }
.moon-now { display: flex; align-items: center; gap: 0.9rem; margin-top: 0.75rem; }
.moon-now .moon-svg { width: 56px; height: 56px; flex: none; }

/* ---------- Synastry ---------- */
.syn-form { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1.25rem; }
.person { border: 1.5px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem 1.1rem; margin: 0; display: grid; gap: 0.8rem; min-width: 0; }
.person legend { font: 700 1.05rem/1 var(--body); padding: 0 0.4rem; }
.person input[type="date"], .person input[type="time"], .person input[type="text"] { width: 100%; }
.syn-actions, .syn-form .form-error { grid-column: 1 / -1; }
.syn-tally { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.syn-tally div { background: var(--panel); border-radius: 14px; padding: 0.8rem; display: grid; gap: 0.2rem; font-size: 0.9rem; color: var(--muted); }
.syn-tally .n { font: 400 2rem/1 var(--display); color: var(--ink); }
.syn-list { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.syn-list li { padding: 0.75rem 0 0.75rem 0.9rem; border-left: 3px solid var(--line); margin-top: 0.5rem; }
.syn-list li.syn-easy { border-left-color: var(--plum); }
.syn-list li.syn-hard { border-left-color: var(--ochre); }
.syn-list h3 { margin: 0; font-size: 1.02rem; }

/* ---------- Zodiac compatibility ---------- */
.zc-big, .zc-pair { font-family: var(--sym); }
.zc-pair { color: var(--ochre); margin-right: 0.35rem; letter-spacing: 0.05em; }
table.zc-matrix td a { display: block; width: 100%; height: 100%; border-radius: inherit; }
table.zc-matrix td a:hover { box-shadow: inset 0 0 0 2px var(--ink); }
table.zc-matrix td.cur { box-shadow: 0 0 0 3px var(--ink); }
table.zc-matrix thead th { font-family: var(--sym); color: var(--ochre); font-size: 1.15rem; }
.zc-guides, .zc-more { columns: 2 15rem; column-gap: 2rem; }
.zc-guides li, .zc-more li { break-inside: avoid; }
.zc-best li { margin: 0 0 0.6rem; }

/* ---------- Horoscope pages ---------- */
.hs-date { margin: 0; color: var(--muted); font-weight: 600; }
.hs-headline { margin-top: 0.3rem; }
.hs-body { max-width: var(--measure); padding: 0; }
.hs-body h2 { font: 700 1.17rem/1.3 var(--body); letter-spacing: 0; margin-top: 1.5rem; }
.hs-grid .t { white-space: normal; }
.hs-dates { padding-left: 1.1rem; }
.hs-dates li { margin-bottom: 0.6rem; }
.hs-share { margin-top: 1.25rem; }
.hs-year { list-style: none; padding-left: 0; }
.hs-year > li { border-top: 1px solid var(--line); padding: 0.6rem 0; }
.hs-year ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }

/* ---------- Sign facts, seasons, traits ---------- */
.sfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.1rem 1.5rem; margin: 0; }
.headline-result + .sfacts { margin-top: 1.25rem; }
.sfacts div { border-left: 3px solid var(--el-ink); padding-left: 0.8rem; }
.sfacts dt { font-size: 0.85rem; color: var(--muted); }
.sfacts dd { margin: 0.1rem 0 0; font-weight: 650; }
.season-signs li { margin: 0 0 0.7rem; }
.trait-list { padding-left: 1.1rem; }
.trait-list li { margin: 0 0 0.55rem; }
.year-table { margin: 1rem 0; }
.year-table summary { cursor: pointer; font-weight: 600; color: var(--plum); }

/* ---------- Cookie consent (Europe only) ---------- */
.consent { position: fixed; z-index: 50; left: 1rem; right: 1rem; bottom: 1rem; max-width: 40rem; margin-inline: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1rem 1.1rem; box-shadow: var(--shadow), 0 12px 40px rgba(27, 22, 66, 0.25); display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; justify-content: space-between; }
.consent[hidden] { display: none; }
.consent p { margin: 0; font-size: 0.95rem; flex: 1 1 18rem; }
.consent-actions { display: flex; gap: 0.5rem; }
