@import url("fonts.css");

:root {
  --bg: #100a1f;
  --bg-2: #1a1230;
  --surface: #211739;
  --surface-2: #2c2050;
  --border: #3b2d63;
  --border-soft: rgba(155, 109, 255, .18);
  --text: #f3eefc;
  --muted: #b9acd8;
  --gold: #e8c46a;
  --gold-2: #f6dea0;
  --purple: #9b6dff;
  --danger: #ff8a8a;
  --ok: #9fd9b4;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(5, 2, 15, .45);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 85% -8%, rgba(120, 66, 214, .45) 0%, transparent 62%),
    radial-gradient(700px 480px at -10% 30%, rgba(232, 196, 106, .07) 0%, transparent 60%),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--gold); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0 0 .6em; letter-spacing: .005em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.3rem; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.section { padding: 56px 16px; }
.section-head { max-width: 640px; margin-bottom: 28px; }
.section-head p { color: var(--muted); margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--border-soft); background: rgba(16, 10, 31, .82); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; }
.logo { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap; }
.logo-mark { color: var(--gold); }
nav { display: flex; align-items: center; gap: 20px; }
nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
nav a:hover { color: var(--text); }
select, input, textarea {
  font: inherit; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; width: 100%;
}
select { max-width: 100%; }
textarea { resize: vertical; min-height: 140px; }
.lang-picker select { width: auto; padding: 6px 10px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, .chip:focus-visible, .palace:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.lang-suggest { background: var(--surface-2); font-size: .9rem; }
.lang-suggest .wrap { display: flex; justify-content: space-between; align-items: center; padding: 6px 16px; }
.lang-suggest button { background: none; border: 0; color: var(--muted); font-size: 1.3rem; cursor: pointer; }

/* Buttons */
.btn {
  display: inline-block; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #2a1747;
  font: 600 1rem var(--sans); padding: 13px 26px; text-decoration: none; text-align: center;
  box-shadow: 0 6px 22px rgba(232, 196, 106, .22); transition: transform .15s, filter .15s;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn-ghost { background: transparent; color: var(--gold); border: 1px solid var(--gold); box-shadow: none; }
.btn-small { padding: 8px 16px; font-size: .9rem; }
.btn-block { display: block; width: 100%; }

/* Hero + form */
.hero { padding: 52px 0 28px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; grid-template-areas: "text form" "sample form"; gap: 28px 48px; align-items: start; }
.hero-text { grid-area: text; }
.hero-sample { grid-area: sample; }
.hero .form { grid-area: form; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 600; }
.lead { color: var(--muted); font-size: 1.12rem; margin-bottom: 18px; max-width: 34em; }
.trust { display: flex; gap: 8px; align-items: center; color: var(--gold-2); font-size: .9rem; margin: 0; }
.card { background: linear-gradient(180deg, rgba(44, 32, 80, .55), rgba(33, 23, 57, .9)); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.form { display: grid; gap: 14px; }
.hero .form { box-shadow: var(--shadow); }
.form label { display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
.form label.check, .form label.radio { display: flex; gap: 8px; align-items: flex-start; color: var(--text); }
.form .check input, .form .radio input { width: auto; margin-top: 4px; accent-color: var(--gold); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .field { display: grid; gap: 6px; }
.field-label { font-size: .9rem; color: var(--muted); }
/* Date of birth: calendar icon, then three dropdowns in the language's order (month first in English). */
.date-pick { display: flex; align-items: center; gap: 8px; }
.date-pick select { flex: 1 1 0; min-width: 0; padding-left: 10px; padding-right: 6px; }
.date-pick select[name=month] { flex-grow: 1.7; }
.date-pick select[name=year] { flex-grow: 1.2; }
.cal-icon { flex: none; }
.time-field { gap: 8px; }
.exact-time { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.exact-time .tz-label { grid-column: 1 / -1; }
.exact-toggle { justify-self: start; font-size: .9rem; }
.cal-icon { width: 22px; height: 22px; color: var(--gold); }
input[type=date], input[type=time] { color-scheme: dark; min-height: 46px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
legend { font-size: .9rem; color: var(--muted); margin-bottom: 6px; padding: 0; }
fieldset small, .form small { flex-basis: 100%; color: var(--muted); font-size: .8rem; }
.error { color: var(--danger); margin: 0; }
.thanks { color: var(--gold-2); margin: 0; }

/* Animated sample chart (home hero) */
.mini-board {
  position: relative; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr);
  gap: 3px; aspect-ratio: 1.45; max-width: 520px; padding: 3px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(232, 196, 106, .35), rgba(155, 109, 255, .3));
  box-shadow: var(--shadow);
}
.mini-palace {
  background: var(--surface); border-radius: 8px; padding: 6px 8px; font-size: .68rem; line-height: 1.25;
  display: flex; flex-direction: column; gap: 2px; overflow: hidden;
  opacity: 0; transform: scale(.94); animation: tile-in .55s ease-out forwards; animation-delay: calc(var(--i) * 90ms);
}
.mini-palace b { color: var(--gold-2); font-weight: 600; font-size: .72rem; }
.mini-palace span { color: var(--text); }
.mini-palace.is-self { background: linear-gradient(160deg, #432873, var(--surface)); box-shadow: inset 0 0 0 1.5px var(--gold); animation: tile-in .55s ease-out forwards, glow 3.2s ease-in-out 1.6s infinite; animation-delay: calc(var(--i) * 90ms), 1.6s; }
.mini-centre {
  grid-row: 2 / 4; grid-column: 2 / 4; border-radius: 8px; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 45%, #2e1d55, var(--bg-2) 70%); color: var(--muted); font-size: .78rem; overflow: hidden; position: relative;
}
.mini-centre strong { display: block; font-family: var(--serif); font-size: 1.5rem; color: var(--gold); line-height: 1; }
.mini-centre b { display: block; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--gold-2); margin: 4px 0 2px; }
.mini-centre span { display: block; }
.mini-centre .spark { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--gold-2); opacity: 0; animation: twinkle 3s ease-in-out infinite; }
.sample-caption { color: var(--muted); font-size: .8rem; margin: 8px 0 0; }
@keyframes tile-in { to { opacity: 1; transform: none; } }
@keyframes glow { 0%, 100% { box-shadow: inset 0 0 0 1.5px var(--gold), 0 0 0 rgba(232, 196, 106, 0); } 50% { box-shadow: inset 0 0 0 1.5px var(--gold), 0 0 22px rgba(232, 196, 106, .45); } }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.6); } 50% { opacity: .9; transform: scale(1.3); } }

/* Steps + FAQ */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; counter-increment: s; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--gold); font-weight: 600; margin-bottom: 10px; }
.steps p { color: var(--muted); margin: 0; }

/* Pricing cards */
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.product { position: relative; display: flex; flex-direction: column; gap: 10px; }
.product h3 { margin: 0; }
.product p { color: var(--muted); margin: 0; }
.product.featured { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow); background: linear-gradient(180deg, rgba(72, 46, 120, .7), rgba(33, 23, 57, .95)); }
.ribbon { position: absolute; top: -12px; left: 20px; background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #2a1747; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 3px 12px; }
.features { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 6px; font-size: .92rem; }
.features li { display: flex; gap: 8px; }
.features li::before { content: "✦"; color: var(--gold); font-size: .8rem; line-height: 1.6; }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 8px; }
.price { font-family: var(--serif); font-size: 2.2rem; color: var(--gold); line-height: 1; }
.price-note { color: var(--muted); font-size: .85rem; }
/* "≈ €31 · charged in USD": filled once /api/status gives the country; the reserved line keeps the card from jumping. */
.price-approx { color: var(--muted); font-size: .85rem; margin: 4px 0 0; min-height: 1.4em; }
.trust-row { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 24px; padding: 0; margin: 18px 0 0; color: var(--muted); font-size: .9rem; }
.trust-row li { display: flex; align-items: center; gap: 8px; }
.trust-row svg { width: 18px; height: 18px; flex: none; stroke: var(--ok); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Chart page */
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.chart-head h1 { margin: 0; }
.note { background: var(--surface-2); border-left: 3px solid var(--gold); padding: 10px 14px; border-radius: 8px; color: var(--muted); font-size: .9rem; }
.chart-hint { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; color: var(--muted); font-size: .88rem; margin: 18px 0 8px; }
.swipe-hint { display: none; color: var(--gold-2); white-space: nowrap; }
.chart { overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; border-radius: var(--radius); scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.board {
  display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); grid-template-rows: repeat(4, minmax(140px, auto));
  gap: 3px; padding: 3px; border-radius: var(--radius); min-width: 640px;
  background: linear-gradient(135deg, rgba(232, 196, 106, .3), rgba(155, 109, 255, .28));
}
.palace {
  background: var(--surface); padding: 10px; display: flex; flex-direction: column; gap: 6px; font-size: .85rem;
  border-radius: 10px; cursor: pointer; scroll-snap-align: start; position: relative; transition: background .15s, box-shadow .15s, opacity .2s;
}
.palace:hover { background: #291d48; }
.palace.is-self { background: linear-gradient(160deg, #452a78, var(--surface) 75%); box-shadow: inset 0 0 0 2px var(--gold), 0 0 24px rgba(232, 196, 106, .18); }
.palace.is-self .palace-name::before { content: "✦"; color: var(--gold); }
.board.has-active .palace:not(.is-active):not(.is-linked) { filter: brightness(.6) saturate(.7); }
.palace.is-active { box-shadow: inset 0 0 0 2px var(--gold-2), 0 0 28px rgba(246, 222, 160, .3); }
.palace.is-linked { box-shadow: inset 0 0 0 1px rgba(246, 222, 160, .55); }
.palace-name { font-weight: 600; color: var(--gold-2); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: .9rem; }
.tag { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; background: var(--gold); color: #2a1747; border-radius: 4px; padding: 1px 5px; }
.stars { list-style: none; padding: 0; margin: 0; flex: 1; display: grid; gap: 3px; align-content: start; }
.star-main { color: var(--text); font-weight: 600; font-size: 1rem; }
.star-none { color: var(--muted); font-style: italic; }
.palace-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: .74rem; }
.centre {
  grid-row: 2 / 4; grid-column: 2 / 4; background: radial-gradient(circle at 50% 40%, #2a1b4e, var(--bg-2) 72%); padding: 18px; border-radius: 10px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: var(--muted);
}
.centre p { margin: 2px 0; }
/* Tam phương tứ chính lines from the centre to the chosen palace and its three linked palaces (chart-view drawLinks). */
.board { position: relative; }
.links { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; overflow: visible; filter: drop-shadow(0 0 3px rgba(246, 222, 160, .7)); }
.link { stroke: var(--gold); stroke-width: 1.2; stroke-opacity: .75; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: link-draw .45s ease-out forwards; }
.link-self { stroke: var(--gold-2); stroke-width: 1.8; stroke-opacity: .95; }
.link-inner { stroke-opacity: .45; } /* about 40% fainter across the centre text */
.centre > * { position: relative; z-index: 2; text-shadow: 0 0 4px var(--bg-2), 0 0 8px var(--bg-2); } /* the birth details stay readable above the lines */
.link-hub { fill: var(--gold-2); animation: link-pulse 2.4s ease-in-out infinite; }
@keyframes link-draw { to { stroke-dashoffset: 0; } }
@keyframes link-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .link { animation: none; stroke-dashoffset: 0; } .link-hub { animation: none; } }
/* Tuần / Triệt: a small tab hanging from the top edge of the palace; Tràng Sinh stage above the foot. */
.palace.has-mark { padding-top: 22px; }
.marks { position: absolute; top: 0; right: 8px; display: flex; gap: 3px; }
.mark { font-size: .64rem; letter-spacing: .04em; color: #2a1747; background: #b9a6e8; border-radius: 0 0 5px 5px; padding: 1px 6px 2px; line-height: 1.3; }
.mark-triet { background: #e8a6b4; }
.palace-stage { color: var(--muted); font-size: .72rem; font-style: italic; }
/* Extra stars: folded away until the "Other stars" chip adds <html class="show-extra">. */
.stars-extra { display: none; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; gap: 1px 7px; font-size: .7rem; color: var(--muted); }
.show-extra .stars-extra { display: flex; }
.star-extra.kind-lucky { color: #9fc9b0; }
.star-extra.kind-malefic { color: #c99aa6; }
.chart-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.panel-extra { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.panel-extra strong { color: var(--text); font-weight: 600; }
.star-borrowed { color: var(--muted); font-size: .74rem; line-height: 1.3; }
.centre-name { font-family: var(--serif); font-size: 1.7rem; color: var(--text); }
.centre dl { display: grid; grid-template-columns: auto auto; gap: 4px 12px; margin: 12px 0 0; text-align: left; }
.centre dt { color: var(--muted); }
.centre dd { margin: 0; color: var(--text); }

/* Tap-a-palace panel */
.palace-panel { margin-top: 14px; border-color: var(--gold); background: linear-gradient(180deg, #2d2052, #1f1637); position: relative; animation: rise .25s ease-out; }
.palace-panel h3 { margin: 0 40px 4px 0; color: var(--gold-2); }
.palace-panel .vi { color: var(--muted); font-size: .8em; font-family: var(--sans); font-weight: 400; }
.palace-panel p { margin: 8px 0; }
.panel-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font-size: 1.2rem; cursor: pointer; }
.panel-stars { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.panel-stars li { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.panel-stars strong { color: var(--text); }
.panel-stars small { display: block; color: var(--muted); }
.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Reading + pricing beside it */
.reading-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; margin-top: 32px; }
.reading-grid aside { display: grid; gap: 20px; position: sticky; top: 80px; }
/* Grid children may shrink below long words (German compounds) instead of widening the page. */
.reading-grid > *, .products > *, .hero-grid > * { min-width: 0; }
.card { overflow-wrap: break-word; hyphens: auto; }
#ai, .palace-panel, #full, #readings { scroll-margin-top: 80px; }
.reading-grid aside .products { grid-template-columns: 1fr; gap: 24px; }
.summary { font-size: 1.05rem; }
.summary h3 { margin-top: 1em; color: var(--gold-2); }
.locked { list-style: none; padding: 0; margin: 20px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.locked li { position: relative; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 34px 10px 12px; display: grid; gap: 2px; font-size: .9rem; }
.locked .blur { font-size: .78rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.blur { filter: blur(4px); user-select: none; color: var(--muted); font-size: .9rem; }
.lock { position: absolute; right: 10px; top: 10px; font-size: .85rem; }

dialog { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; max-width: 420px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog form[method=dialog] { margin-top: 12px; }
dialog h2 { margin-top: 0; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.buy-item { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 14px; background: var(--surface-2); border-radius: 8px; }
.buy-item .price { color: var(--gold); font-weight: 600; white-space: nowrap; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold); text-decoration: underline; font: inherit; cursor: pointer; }
.link-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.correct-note { margin: 0 0 14px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border-soft); color: var(--muted); font-size: .85rem; padding: 24px 0; margin-top: 40px; }

/* Language chooser */
.chooser main { text-align: center; }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 24px; }
.lang-card { text-decoration: none; color: var(--text); display: grid; gap: 4px; }
.lang-card span { color: var(--muted); font-size: .9rem; }
.lang-card.suggested { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }

/* Star details */
.palace-name .vi, .star-main .vi { font-weight: 400; color: var(--muted); font-size: .75em; }
.star-main small { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; }
.stars-minor { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: .72rem; color: var(--muted); }
.stars-minor .kind-lucky { color: var(--ok); }
.stars-minor .kind-malefic { color: #f0a0a0; }
.stars-minor .kind-romance { color: #f5b5dc; }
.hoa { font-size: .66rem; font-weight: 600; line-height: 1.5; border-radius: 4px; padding: 0 4px 1px; vertical-align: 1px; color: #1a1030; display: inline-block; }
.hoa-hoa_loc { background: var(--ok); }
.hoa-hoa_quyen { background: var(--gold); }
.hoa-hoa_khoa { background: #9cc7ff; }
.hoa-hoa_ky { background: #f0a0a0; }
.bright { font-size: .62rem; font-weight: 600; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 3px; vertical-align: 1px; cursor: help; }
.bright-mieu, .bright-vuong { color: var(--gold-2); border-color: var(--gold); }
.bright-ham { color: #f0a0a0; border-color: #7a4050; }

/* AI astrologer: the centrepiece under the chart */
.ai-chat { margin-top: 28px; }
.ai-chat .card { border-color: rgba(232, 196, 106, .55); box-shadow: 0 0 0 1px rgba(232, 196, 106, .15), var(--shadow); background: radial-gradient(600px 240px at 0% 0%, rgba(155, 109, 255, .25), transparent 70%), linear-gradient(180deg, #2a1d4c, #1d1434); }
.ai-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.ai-head h2 { margin: 0; }
.ai-orb { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; color: #2a1747; background: radial-gradient(circle at 35% 30%, #fff3cf, var(--gold) 55%, #b58a2d); box-shadow: 0 0 24px rgba(232, 196, 106, .5); }
.ai-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip { background: rgba(16, 10, 31, .5); color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .9rem; cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--gold); }
.chip:disabled { opacity: .5; cursor: default; }
.ai-log { display: grid; gap: 12px; margin: 16px 0; max-height: 560px; overflow-y: auto; }
.ai-log:empty { display: none; }
.msg { padding: 12px 14px; border-radius: 14px; max-width: 88%; }
.msg .who { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 4px; }
.msg .text p { margin: 0 0 .6em; }
.msg .text p:last-child, .msg .text ul:last-child, .msg .text ol:last-child { margin-bottom: 0; }
.msg .text ul, .msg .text ol { margin: 0 0 .6em; padding-left: 1.2em; }
.msg .text strong, .ai-reading strong { color: var(--gold-2); }
.msg-user { background: var(--surface-2); justify-self: end; border-bottom-right-radius: 4px; }
.msg-assistant { background: rgba(16, 10, 31, .6); border: 1px solid var(--border); justify-self: start; border-bottom-left-radius: 4px; }
.msg-error .text { color: var(--danger); }
.msg-pending .text { color: var(--muted); font-style: italic; }
.ai-form { display: flex; gap: 10px; }
.ai-form input { flex: 1; min-width: 0; }
.ai-form input:disabled { opacity: .5; }
.ai-gate { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; background: rgba(16, 10, 31, .45); border: 1px dashed var(--border); border-radius: 12px; padding: 14px; margin: 12px 0; }
.ai-gate p { grid-column: 1 / -1; margin: 0; }
.ai-gate .check { grid-column: 1 / -1; font-size: .85rem; display: flex; gap: 8px; align-items: flex-start; color: var(--muted); }
.ai-gate .check input { width: auto; margin-top: 3px; accent-color: var(--gold); }
.ai-reading { background: var(--bg-2); border: 1px solid var(--gold); border-radius: 12px; padding: 16px 18px; margin: 16px 0; }
.ai-reports { display: grid; gap: 12px; margin: 12px 0; }
.ai-report > .btn { justify-self: start; }
.ai-report .ai-reading { margin: 8px 0 0; }
.full-reading { margin-top: 24px; }
.pay-note { margin-top: 24px; }
.session-note { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center; }
.session-note p { grid-column: 1 / -1; margin: 0; }
@media (max-width: 480px) { .session-note { grid-template-columns: 1fr; } }
#full-sections section { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
#ai-reading-btn { margin: 8px 0 12px; }

/* FAQ and articles */
.faq details { margin-bottom: 10px; padding: 16px 20px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { color: var(--muted); margin: 10px 0 0; }
.article { max-width: 760px; }
.article h1 { margin-bottom: .8em; }
.article h2 { margin-top: 1.6em; }
.article p, .article li { color: #ddd5f0; }
.article blockquote { border-left: 3px solid var(--gold); margin: 1em 0; padding: 4px 16px; color: var(--muted); }
.table-wrap { overflow-x: auto; margin: 1em 0; }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.table-wrap th, .table-wrap td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.table-wrap th { background: var(--surface-2); }
@media (max-width: 680px) { .table-wrap table { min-width: 600px; font-size: .85rem; } .table-wrap { border: 1px solid var(--border); border-radius: 8px; } .table-wrap th:first-child, .table-wrap td:first-child { position: sticky; left: 0; background: var(--surface); } .table-wrap th:first-child { background: var(--surface-2); } }
.article-cta { margin-top: 2em; }
.article-card { text-decoration: none; color: var(--text); }

/* Traditional names: hidden unless the visitor turns them on */
.vi, .vi-only { display: none; }
.show-vi .vi, .show-vi .vi-only { display: inline; }
.show-vi .tr { display: none; }
.chart-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-top: 10px; }
.chart-tools .bright-legend { margin: 0; }
.chip-small { font-size: .78rem; padding: 5px 12px; }
.chip[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-2); }
.bright .tr { letter-spacing: -1px; font-size: .55rem; }

/* Legend, current cycle */
.bright-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; color: var(--muted); font-size: .8rem; margin: 10px 0 0; }
.bright-legend .legend-title { color: var(--text); }
.palace.is-now .palace-foot .now { color: var(--gold-2); font-weight: 600; }
/* The running 10-year cycle (engine currentDecade): a dashed gold outline inside the tile and a one-line label. */
.palace.is-now { outline: 1px dashed rgba(246, 222, 160, .6); outline-offset: -3px; }
.now-label { color: var(--gold-2); font-size: .72rem; font-weight: 600; line-height: 1.3; }
.cycle-now { color: var(--gold-2); font-size: .9rem; }

/* Disclaimer under pricing */
.price-disclaimer { color: var(--muted); font-size: .8rem; margin: 10px 0 0; }

/* Privacy page */
.privacy { max-width: 900px; }
.privacy-list { margin: 8px 0 28px; color: var(--muted); }
.privacy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.privacy-grid .card { display: grid; gap: 12px; align-content: start; }
.privacy-grid h2 { font-size: 1.5rem; margin: 0; }
.privacy-grid p { margin: 0; }
.danger-card { border-color: #7a4050; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); box-shadow: none; }
#privacy-status { margin-top: 18px; }
.privacy-legal { margin-top: 28px; }
.privacy-legal dl { display: grid; grid-template-columns: minmax(160px, 1fr) 3fr; gap: 10px 20px; margin: 0; }
.privacy-legal dt { color: var(--gold-2); font-weight: 600; }
.privacy-legal dd { margin: 0; color: var(--muted); }
@media (max-width: 680px) { .privacy-legal dl { grid-template-columns: 1fr; gap: 2px; } .privacy-legal dd { margin-bottom: 10px; } }
.site-footer a { color: var(--muted); }

/* Free tools (zodiac finder, compatibility) */
.tool > section { margin-top: 36px; }
.tool-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: end; max-width: 720px; }
.tool-form label { display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
.tool-result { margin-top: 20px; max-width: 720px; border-color: var(--gold); }
.tool-result h2 { margin-bottom: .3em; }
.tool-big { font-size: 3rem; line-height: 1; margin: 0 0 10px; }
.tool-score { display: inline-block; font-weight: 600; border-radius: 999px; padding: 4px 14px; margin: 4px 0 10px; }
.tool-signs { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tool-sign h3 { margin-bottom: 4px; }
.tool-sign p { margin: 4px 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 12px; }
.tool-table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.tool-table th, .tool-table td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; white-space: nowrap; }
.tool-table thead th { background: var(--surface-2); position: sticky; top: 0; }
.tool-matrix th, .tool-matrix td { text-align: center; padding: 6px; min-width: 34px; border: 1px solid var(--border); }
.tool-matrix tbody th { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; white-space: nowrap; }
.rel-same { background: rgba(155, 109, 255, .3); }
.rel-trine { background: rgba(110, 200, 140, .45); }
.rel-harmony { background: rgba(110, 200, 140, .25); }
.rel-neutral { background: rgba(185, 172, 216, .1); }
.rel-harm { background: rgba(240, 160, 120, .3); }
.rel-clash { background: rgba(240, 110, 120, .45); }
.tool-legend { list-style: none; padding: 0; display: grid; gap: 8px; }
.tool-legend span[class^="rel-"] { display: inline-grid; place-items: center; min-width: 28px; border-radius: 6px; padding: 0 6px; }
.tool-cta { margin-top: 36px; text-align: center; border-color: var(--gold); }

/* Phone menu: button and nav id come from the header markup in build.mjs (web thread). */
.site-nav-links { display: flex; align-items: center; gap: 20px; }
.menu-btn { display: none; background: none; border: 1px solid var(--border); border-radius: 10px; color: var(--text); width: 42px; height: 38px; font-size: 1.2rem; cursor: pointer; }

@media (max-width: 900px) {
  .menu-btn { display: inline-grid; place-items: center; }
  .bar { flex-wrap: wrap; }
  .site-nav-links { display: none; flex-basis: 100%; order: 3; flex-direction: column; gap: 0; padding: 4px 0 10px; }
  .site-nav-links.open { display: flex; }
  .site-nav-links a { display: block; padding: 10px 2px; border-top: 1px solid var(--border-soft); color: var(--text); }
  .hero-grid { grid-template-columns: 1fr; grid-template-areas: "text" "form" "sample"; gap: 24px; }
  .reading-grid, .steps { grid-template-columns: 1fr; }
  nav { display: contents; }
}
@media (max-width: 680px) {
  .section { padding-top: 36px; padding-bottom: 36px; }
  .hero { padding-top: 32px; }
  .swipe-hint { display: inline; }
  .chart { margin: 0 -16px; padding: 0 16px; border-radius: 0; scroll-padding: 0 16px; }
  .board { grid-template-columns: repeat(4, 150px); grid-template-rows: repeat(4, minmax(118px, auto)); min-width: 0; width: max-content; }
  .palace { padding: 8px; gap: 4px; font-size: .78rem; }
  .palace-name { font-size: .8rem; }
  .star-main { font-size: .9rem; }
  .star-main small, .stars-minor .extra, .centre-extra { display: none; }
  .centre { padding: 10px; }
  .centre-name { font-size: 1.3rem; }
  .centre dl { margin-top: 6px; }
  .locked { grid-template-columns: 1fr 1fr; }
  .tool-matrix tbody th { font-size: .8rem; }
  .mini-board { aspect-ratio: 1.2; }
  .mini-palace { font-size: .6rem; padding: 4px 5px; }
  .mini-palace b { font-size: .62rem; }
  .ai-gate { grid-template-columns: 1fr; }
  .ai-form .btn { padding: 12px 18px; }
  .msg { max-width: 94%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .mini-palace { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
.hero-sample { margin: 0; }
