/* Astra Tarot — web client. Palette and type follow the mobile app (lib/theme/astral_theme.dart). */

@font-face { font-family: "Forum"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/forum-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Forum"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/forum-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/cormorant-garamond-cyrillic-500-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap;
  src: url("/fonts/cormorant-garamond-cyrillic-500-italic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap;
  src: url("/fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/cormorant-garamond-cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fonts/cormorant-garamond-cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fonts/cormorant-garamond-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --midnight: #060814;
  --midnight-soft: #0d1223;
  --panel: rgba(17, 24, 45, 0.8);
  --panel-strong: rgba(21, 28, 52, 0.92);
  --stroke: rgba(214, 186, 122, 0.4);
  --stroke-soft: rgba(214, 186, 122, 0.18);
  --gold: #e3c988;
  --gold-soft: #b39a65;
  --gold-btn: #b89c63;
  --ink: #0b1020;
  --text: #efe7d6;
  --mist: #b8c7e4;
  --mist-dim: rgba(184, 199, 228, 0.72);
  --violet: #6c5ba7;
  --rose: #8f5c90;
  --success: #8ac8a7;
  --danger: #e58b8b;

  --display: "Forum", "Cormorant Garamond", Georgia, serif;
  --body: "Cormorant Garamond", Georgia, "Times New Roman", serif;

  --radius: 24px;
  --radius-sm: 16px;
  --pad: 16px;
  --wrap: 1120px;
  --top-h: 64px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 12px); }
html.large-text { font-size: 125%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--midnight);
  color: var(--text);
  font-family: var(--body);
  font-weight: 500;
  line-height: 1.45;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
p { margin: 0 0 .7em; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .02em; margin: 0; line-height: 1.15; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--gold); color: var(--ink); padding: 8px 14px; border-radius: 12px; }
.skip:focus { top: 12px; }
.noscript { padding: 40px var(--pad); text-align: center; color: var(--mist); }

/* ---------- sky ---------- */
.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 40% at 70% 18%, rgba(227, 201, 136, .09), transparent 70%),
    linear-gradient(180deg, rgba(6, 8, 20, .2), rgba(6, 8, 20, .75) 70%, var(--midnight)),
    url("/img/bg.webp") center top / cover no-repeat,
    var(--midnight);
}
.sky::before, .sky::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255, 241, 191, .9), transparent 60%),
    radial-gradient(1px 1px at 28% 68%, rgba(255, 241, 191, .7), transparent 60%),
    radial-gradient(1.5px 1.5px at 47% 12%, rgba(184, 199, 228, .9), transparent 60%),
    radial-gradient(1px 1px at 63% 44%, rgba(255, 241, 191, .7), transparent 60%),
    radial-gradient(2px 2px at 81% 30%, rgba(255, 241, 191, .8), transparent 60%),
    radial-gradient(1px 1px at 90% 76%, rgba(184, 199, 228, .7), transparent 60%),
    radial-gradient(1.5px 1.5px at 8% 88%, rgba(255, 241, 191, .6), transparent 60%),
    radial-gradient(1px 1px at 55% 90%, rgba(184, 199, 228, .7), transparent 60%);
  animation: twinkle 7s ease-in-out infinite alternate;
}
.sky::after { transform: translate(3%, 9%) scale(1.1); animation-delay: -3.5s; opacity: .7; }
@keyframes twinkle { from { opacity: .25; } to { opacity: 1; } }

/* ---------- header / nav ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  height: var(--top-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 max(var(--pad), calc((100vw - var(--wrap)) / 2));
  background: linear-gradient(180deg, rgba(6, 8, 20, .92), rgba(6, 8, 20, .72));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--stroke-soft);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--gold); text-decoration: none; font-family: var(--display); font-size: 1.25rem; letter-spacing: .06em; }
.brand img { border-radius: 8px; }
.top__nav { display: flex; gap: 6px; margin-left: 12px; }
.top__nav a, .top__profile {
  color: var(--mist); text-decoration: none; padding: 8px 14px; border-radius: 999px;
  transition: color .2s, background-color .2s;
}
.top__nav a:hover, .top__profile:hover { color: var(--gold); }
.top__nav a[aria-current="page"] { color: var(--gold); background: rgba(227, 201, 136, .1); }
.top__profile { margin-left: auto; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; }
.top__profile[aria-current="page"] { color: var(--gold); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: none;
  padding: 6px 8px calc(6px + var(--safe-b));
  background: linear-gradient(180deg, rgba(13, 18, 35, .88), rgba(6, 8, 20, .97));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--stroke-soft);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px; border-radius: 14px; color: var(--mist-dim); text-decoration: none; font-size: .8rem;
}
.tabbar svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--gold); background: rgba(227, 201, 136, .08); }

@media (max-width: 760px) {
  :root { --top-h: 56px; }
  .top { gap: 12px; }
  .top__nav, .top__profile-name { display: none; }
  .tabbar:not([hidden]) { display: flex; }
  body.has-tabbar main { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); }
}

/* ---------- layout ---------- */
main { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 20px var(--pad) 64px; outline: none; }
main.view-enter > * { animation: rise .45s var(--ease) both; }
main.view-enter > *:nth-child(2) { animation-delay: .05s; }
main.view-enter > *:nth-child(3) { animation-delay: .1s; }
main.view-enter > *:nth-child(n+4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-head { text-align: center; margin: 12px auto 24px; max-width: 640px; }
.page-head h1 { color: var(--gold); font-size: clamp(2rem, 5vw, 2.8rem); }
.page-head p { color: var(--mist); margin-top: 8px; font-size: 1.05rem; }
.page-head__back { display: inline-flex; align-items: center; gap: 6px; color: var(--mist); text-decoration: none; margin-bottom: 12px; }
.page-head__back svg { width: 18px; height: 18px; }
.page-head__back:hover { color: var(--gold); }

.section { margin: 36px 0 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section__head h2 { color: var(--gold); font-size: 1.6rem; }
.section__head a { color: var(--mist); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.section__head a svg { width: 16px; height: 16px; }
.section__head a:hover { color: var(--gold); }
.section__lead { color: var(--mist); margin: -6px 0 16px; }

.ornament { display: flex; align-items: center; gap: 12px; color: var(--gold-soft); margin: 4px auto 0; width: min(220px, 60%); }
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--stroke), transparent); }
.ornament svg { width: 14px; height: 14px; }

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}
.panel + .panel { margin-top: 16px; }
.panel h2, .panel h3 { color: var(--gold); }
.panel h2 { font-size: 1.45rem; margin-bottom: 6px; }
.panel h3 { font-size: 1.2rem; margin-bottom: 6px; }
.panel__lead { color: var(--mist); margin-bottom: 16px; }
.panel--center { text-align: center; }
.stack > * + * { margin-top: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; }
.muted { color: var(--mist-dim); }
.small { font-size: .9rem; }
.gold { color: var(--gold); }
.prose p { font-size: 1.1rem; }
.prose p:last-child { margin-bottom: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px;
  border-radius: 18px; border: 1px solid transparent;
  background: var(--gold-btn); color: var(--ink);
  font-weight: 700; font-size: 1.08rem; letter-spacing: .02em; text-decoration: none;
  cursor: pointer; transition: transform .15s var(--ease), background-color .2s, box-shadow .2s, opacity .2s;
  box-shadow: 0 8px 24px rgba(184, 156, 99, .22);
}
.btn:hover { background: var(--gold); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { width: 20px; height: 20px; }
.btn--ghost { background: transparent; color: var(--gold); border-color: var(--stroke); box-shadow: none; }
.btn--ghost:hover { background: rgba(227, 201, 136, .08); }
.btn--quiet { background: transparent; color: var(--mist); box-shadow: none; padding-inline: 12px; }
.btn--quiet:hover { background: transparent; color: var(--gold); }
.btn--danger { background: transparent; color: var(--danger); border-color: rgba(229, 139, 139, .45); box-shadow: none; }
.btn--danger:hover { background: rgba(229, 139, 139, .08); }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--ink); border-right-color: transparent; animation: spin .8s linear infinite;
}
.btn--ghost.is-busy::after { border-color: var(--gold); border-right-color: transparent; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.actions--center { justify-content: center; }
@keyframes spin { to { transform: rotate(360deg); } }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 12px; border-radius: 999px;
  border: 1px solid var(--stroke); color: var(--gold); font-size: .85rem; letter-spacing: .03em;
}
.chip--mist { color: var(--mist); border-color: rgba(184, 199, 228, .3); }
.chip--ok { color: var(--success); border-color: rgba(138, 200, 167, .4); }
.chip--warn { color: var(--danger); border-color: rgba(229, 139, 139, .4); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field__label { display: block; color: var(--gold); margin-bottom: 6px; font-size: 1rem; }
.field__hint { display: block; color: var(--mist-dim); font-size: .88rem; margin-top: 6px; }
.field__error { display: block; color: var(--danger); font-size: .9rem; margin-top: 6px; }
.input, .textarea, .select {
  width: 100%; min-height: 50px; padding: 12px 16px;
  background: rgba(6, 8, 20, .55); border: 1px solid var(--stroke-soft); border-radius: 18px;
  color: var(--text); font-size: 1.1rem; transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.4; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227, 201, 136, .15); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input::placeholder, .textarea::placeholder { color: rgba(184, 199, 228, .45); }
.input[type="date"], .input[type="time"] { color-scheme: dark; }
.row-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .row-2 { grid-template-columns: 1fr; } }
.counter { display: block; text-align: right; color: var(--mist-dim); font-size: .85rem; margin-top: 4px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--stroke-soft); cursor: pointer; }
.switch:first-of-type { border-top: 0; }
.switch input { width: 22px; height: 22px; accent-color: var(--gold-btn); }
.segmented { display: inline-flex; border: 1px solid var(--stroke); border-radius: 999px; padding: 3px; }
.segmented button { border: 0; background: transparent; color: var(--mist); padding: 6px 16px; border-radius: 999px; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--gold-btn); color: var(--ink); font-weight: 700; }

/* ---------- boot / welcome ---------- */
.boot { min-height: 60vh; display: grid; place-items: center; align-content: center; gap: 16px; color: var(--mist); }
.boot__seal { width: 72px; height: 72px; border-radius: 50%; border: 1px solid var(--stroke); border-top-color: var(--gold); animation: spin 1.6s linear infinite; }

.welcome { min-height: calc(100dvh - 40px); display: grid; place-items: center; padding: 24px 0; }
.welcome__card {
  width: min(100%, 520px); text-align: center; padding: 34px 26px 28px;
  background: linear-gradient(180deg, rgba(13, 18, 35, .6), rgba(13, 18, 35, .9)), url("/img/splash.webp") center / cover;
  border: 1px solid var(--stroke); border-radius: 32px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.welcome__seal { width: 92px; height: 92px; margin: 0 auto 18px; border-radius: 24px; box-shadow: 0 0 40px rgba(227, 201, 136, .25); }
.welcome h1 { color: var(--gold); font-size: clamp(2.2rem, 8vw, 3rem); }
.welcome__lead { color: var(--mist); font-size: 1.15rem; margin: 10px auto 24px; max-width: 380px; }
.welcome .stack { text-align: left; }
.steps { display: flex; justify-content: center; gap: 8px; margin: 0 0 18px; }
.steps span { width: 8px; height: 8px; border-radius: 50%; background: rgba(184, 199, 228, .3); transition: background-color .3s, width .3s; }
.steps span.is-on { background: var(--gold); width: 22px; border-radius: 6px; }
.welcome__foot { margin-top: 18px; color: var(--mist-dim); font-size: .9rem; }

/* ---------- home ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 32px; border: 1px solid var(--stroke-soft);
  min-height: 420px; display: flex; flex-direction: column; justify-content: flex-end; padding: 28px;
  background: url("/img/hero.webp") center 30% / cover no-repeat;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 8, 20, .05) 0%, rgba(6, 8, 20, .45) 45%, rgba(6, 8, 20, .92) 100%); }
.hero > * { position: relative; }
.hero__kicker { color: var(--mist); letter-spacing: .1em; text-transform: uppercase; font-size: .85rem; }
.hero h1 { color: var(--gold); font-size: clamp(2.2rem, 6vw, 3.4rem); margin: 6px 0 10px; }
.hero p { color: var(--text); max-width: 520px; font-size: 1.15rem; }
@media (min-width: 900px) {
  .home-top { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: stretch; }
  .home-top .hero { min-height: 480px; }
}

.zodiac-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  text-decoration: none; color: inherit; cursor: pointer; height: 100%;
  transition: border-color .2s, transform .2s var(--ease);
}
.zodiac-card:hover { border-color: var(--stroke); transform: translateY(-2px); }
.zodiac-card__seal { width: 92px; height: 92px; filter: drop-shadow(0 0 18px rgba(227, 201, 136, .35)); }
.zodiac-card h2 { font-size: 1.5rem; }
.zodiac-card p { color: var(--mist); margin: 4px 0 0; }
.zodiac-card > svg { width: 22px; height: 22px; color: var(--gold); }
@media (min-width: 900px) {
  .zodiac-card { grid-template-columns: 1fr; justify-items: center; text-align: center; align-content: center; }
  .zodiac-card__seal { width: 150px; height: 150px; }
  .zodiac-card > svg { display: none; }
}

.portals { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .portals { grid-template-columns: repeat(2, 1fr); } }
.portal {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 22px;
  min-height: 160px; padding: 18px; border-radius: var(--radius); text-decoration: none; color: var(--text);
  background: linear-gradient(160deg, rgba(108, 91, 167, .28), rgba(13, 18, 35, .9) 60%);
  border: 1px solid var(--stroke-soft); transition: transform .25s var(--ease), border-color .2s;
}
.portal:nth-child(2) { background: linear-gradient(160deg, rgba(143, 92, 144, .3), rgba(13, 18, 35, .9) 60%); }
.portal:nth-child(3) { background: linear-gradient(160deg, rgba(184, 199, 228, .16), rgba(13, 18, 35, .9) 60%); }
.portal:nth-child(4) { background: linear-gradient(160deg, rgba(227, 201, 136, .16), rgba(13, 18, 35, .9) 60%); }
.portal:hover { transform: translateY(-3px); border-color: var(--stroke); }
.portal svg { width: 34px; height: 34px; color: var(--gold); }
.portal strong { display: block; font-family: var(--display); font-weight: 400; font-size: 1.3rem; color: var(--gold); line-height: 1.1; }
.portal span { color: var(--mist); font-size: .95rem; }
.portal .chip { position: absolute; top: 14px; right: 14px; font-size: .75rem; }

.feed { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: var(--stroke) transparent; }
@media (min-width: 1000px) { .feed { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; } }
.tile {
  scroll-snap-align: start; display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--stroke-soft); border-radius: var(--radius);
  transition: transform .25s var(--ease), border-color .2s;
}
.tile:hover { transform: translateY(-3px); border-color: var(--stroke); }
.tile__img { aspect-ratio: 16 / 8; background: url("/img/learning.webp") center / cover; position: relative; }
.tile:nth-child(3n+2) .tile__img { background-image: url("/img/profile.webp"); }
.tile:nth-child(3n) .tile__img { background-image: url("/img/numerology.webp"); }
.tile__img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(13, 18, 35, .9)); }
.tile__body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tile__body strong { font-family: var(--display); font-weight: 400; color: var(--gold); font-size: 1.2rem; line-height: 1.15; }
.tile__body span { color: var(--mist); font-size: .98rem; }
.tile .chip { align-self: flex-start; }

/* ---------- daily forecast ---------- */
.forecast { display: grid; gap: 20px; grid-template-columns: minmax(220px, 320px) 1fr; align-items: start; }
@media (max-width: 760px) { .forecast { grid-template-columns: 1fr; } }
.forecast__card { position: sticky; top: calc(var(--top-h) + 16px); text-align: center; }
@media (max-width: 760px) { .forecast__card { position: static; } }
.forecast__card .tarot { margin: 0 auto 14px; }
.forecast__date { color: var(--mist); letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; }

/* ---------- tarot card ---------- */
.tarot {
  width: min(100%, 260px); aspect-ratio: 7 / 12; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--stroke); background: var(--midnight-soft);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 50px rgba(227, 201, 136, .12);
}
.tarot img { width: 100%; height: 100%; object-fit: cover; }
.tarot--empty { display: grid; place-items: center; color: var(--gold-soft); }
.tarot--empty svg { width: 40%; height: auto; }

/* ---------- reading ---------- */
.reading { max-width: 760px; margin: 0 auto; }
.limits { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 0; }

.stage { text-align: center; padding: 26px 18px 28px; }
.stage h2 { font-size: 1.5rem; }
.stage__text { color: var(--mist); max-width: 520px; margin: 8px auto 0; }

.deck { position: relative; width: 150px; height: 250px; margin: 26px auto 22px; }
.deck__card {
  position: absolute; inset: 0; border-radius: 14px; border: 1px solid var(--stroke);
  background: var(--midnight-soft) center / cover no-repeat;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
}
.deck.is-shuffling .deck__card:nth-child(odd) { animation: shuffle-l 1.1s var(--ease) 2; }
.deck.is-shuffling .deck__card:nth-child(even) { animation: shuffle-r 1.1s var(--ease) 2; }
.deck.is-shuffling .deck__card:nth-child(3) { animation-delay: .08s; }
.deck.is-shuffling .deck__card:nth-child(4) { animation-delay: .16s; }
.deck.is-shuffling .deck__card:nth-child(5) { animation-delay: .24s; }
@keyframes shuffle-l { 0%, 100% { transform: none; } 45% { transform: translateX(-70%) rotate(-12deg); } }
@keyframes shuffle-r { 0%, 100% { transform: none; } 45% { transform: translateX(70%) rotate(12deg); } }
.deck .deck__card:nth-child(2) { transform: rotate(-3deg); }
.deck .deck__card:nth-child(3) { transform: rotate(2deg); }
.deck .deck__card:nth-child(4) { transform: rotate(-1deg); }

.picker { margin: 22px auto 0; max-width: 460px; }
.picker__num { font-family: var(--display); font-size: 4rem; color: var(--gold); line-height: 1; text-shadow: 0 0 30px rgba(227, 201, 136, .35); }
.picker__row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.picker__step {
  flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--stroke); background: transparent; color: var(--gold);
  cursor: pointer; display: grid; place-items: center;
}
.picker__step:hover { background: rgba(227, 201, 136, .08); }
.picker__step svg { width: 20px; height: 20px; }
.range { flex: 1; accent-color: var(--gold-btn); height: 32px; }
.picker__manual { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; color: var(--mist); }
.picker__manual .input { width: 96px; min-height: 42px; text-align: center; padding: 6px 10px; }
.fan { position: relative; height: 120px; margin: 18px auto 0; max-width: 520px; }
.fan__card {
  position: absolute; bottom: 0; left: 50%; width: 52px; height: 88px; margin-left: -26px; border-radius: 8px;
  background: var(--midnight-soft) center / cover; border: 1px solid var(--stroke-soft);
  transform-origin: 50% 260%; transition: transform .35s var(--ease), border-color .2s, box-shadow .2s;
}
.fan__card.is-on { border-color: var(--gold); box-shadow: 0 0 22px rgba(227, 201, 136, .55); }

.flip { perspective: 1400px; width: min(78vw, 280px); aspect-ratio: 7 / 12; margin: 10px auto 0; }
.flip__inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1s var(--ease); }
.flip.is-open .flip__inner { transform: rotateY(180deg); }
.flip__face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--stroke); background: var(--midnight-soft) center / cover;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 50px rgba(227, 201, 136, .14);
}
.flip__face--front { transform: rotateY(180deg); }
.flip__face img { width: 100%; height: 100%; object-fit: cover; }
.flip.is-waiting .flip__face--back { animation: glow 1.6s ease-in-out infinite alternate; }
@keyframes glow { from { box-shadow: 0 0 20px rgba(227, 201, 136, .1); } to { box-shadow: 0 0 60px rgba(227, 201, 136, .45); } }

.result { display: grid; gap: 20px; grid-template-columns: minmax(200px, 280px) 1fr; align-items: start; text-align: left; }
@media (max-width: 760px) { .result { grid-template-columns: 1fr; } .result .flip { margin-bottom: 4px; } }
.result h2 { font-size: 1.9rem; color: var(--gold); }
.quote { border-left: 2px solid var(--gold-soft); padding: 4px 0 4px 14px; color: var(--mist); font-style: italic; margin: 0 0 16px; }
.reading-block + .reading-block { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--stroke-soft); }
.reading-block h3 { font-size: 1.15rem; color: var(--gold); margin-bottom: 8px; letter-spacing: .04em; }

/* ---------- history / accordion ---------- */
.list { display: grid; gap: 12px; }
.entry { background: var(--panel); border: 1px solid var(--stroke-soft); border-radius: 20px; overflow: hidden; }
.entry summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 54px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; }
.entry summary::-webkit-details-marker { display: none; }
.entry summary img, .entry__thumb { width: 54px; height: 92px; border-radius: 8px; object-fit: cover; border: 1px solid var(--stroke-soft); background: var(--midnight-soft); }
.entry summary strong { display: block; color: var(--gold); font-family: var(--display); font-weight: 400; font-size: 1.2rem; }
.entry summary span { color: var(--mist); }
.entry summary time { color: var(--mist-dim); font-size: .85rem; white-space: nowrap; }
.entry summary::after { content: "+"; color: var(--gold); font-size: 1.4rem; grid-column: 3; grid-row: 1; justify-self: end; align-self: start; }
.entry[open] summary::after { content: "−"; }
.entry summary time { grid-column: 3; align-self: end; }
.entry__body { padding: 4px 18px 18px; border-top: 1px solid var(--stroke-soft); }
.entry__body .reading-block:first-child { margin-top: 14px; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.empty { text-align: center; color: var(--mist); padding: 34px 18px; }
.empty svg { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--gold-soft); }

/* ---------- chat ---------- */
.experts { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.expert {
  display: flex; flex-direction: column; gap: 12px; padding: 18px; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--stroke-soft); border-radius: var(--radius);
  transition: transform .25s var(--ease), border-color .2s;
}
.expert:hover { transform: translateY(-2px); border-color: var(--stroke); }
.expert__head { display: flex; gap: 14px; align-items: center; }
.expert__name { font-family: var(--display); font-size: 1.3rem; color: var(--gold); line-height: 1.1; }
.expert__meta { color: var(--mist); font-size: .95rem; }
.expert__spec { color: var(--text); }
.expert__foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; }
.expert__preview { color: var(--mist-dim); font-style: italic; font-size: .95rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mist-dim); display: inline-block; }
.dot--on { background: var(--success); box-shadow: 0 0 10px var(--success); }
.badge-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--rose); color: #fff; font-size: .8rem; display: inline-grid; place-items: center; font-family: system-ui, sans-serif; font-weight: 600; }

.avatar {
  flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 30% 25%, rgba(227, 201, 136, .45), rgba(108, 91, 167, .5) 55%, rgba(13, 18, 35, 1));
  border: 1px solid var(--stroke); color: var(--gold); font-family: var(--display); font-size: 1.35rem;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 34px; height: 34px; font-size: .95rem; }
.avatar--lg { width: 96px; height: 96px; font-size: 2.4rem; }

.convo {
  display: grid; grid-template-rows: auto 1fr auto; max-width: 820px; margin: 0 auto;
  height: calc(100dvh - var(--top-h) - 40px); min-height: 480px;
  background: var(--panel); border: 1px solid var(--stroke-soft); border-radius: var(--radius); overflow: hidden;
}
@media (max-width: 760px) { .convo { height: calc(100dvh - var(--top-h) - var(--tab-h) - var(--safe-b) - 28px); border-radius: 20px; } body.in-convo main { padding-bottom: 12px; } }
.convo__head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--stroke-soft); background: rgba(6, 8, 20, .35); }
.convo__head a.back { color: var(--mist); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; }
.convo__head a.back:hover { color: var(--gold); }
.convo__head a.back svg { width: 22px; height: 22px; }
.convo__title { min-width: 0; }
.convo__title strong { display: block; font-family: var(--display); font-weight: 400; color: var(--gold); font-size: 1.2rem; }
.convo__title span { color: var(--mist); font-size: .88rem; }
.convo__list { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; overscroll-behavior: contain; }
.msg { max-width: min(82%, 560px); padding: 10px 14px 8px; border-radius: 18px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg time { display: block; font-size: .75rem; color: var(--mist-dim); margin-top: 4px; text-align: right; font-family: system-ui, sans-serif; }
.msg--them { align-self: flex-start; background: rgba(108, 91, 167, .22); border: 1px solid rgba(108, 91, 167, .4); border-bottom-left-radius: 6px; }
.msg--me { align-self: flex-end; background: rgba(184, 156, 99, .2); border: 1px solid rgba(227, 201, 136, .32); border-bottom-right-radius: 6px; }
.msg--failed { border-color: var(--danger); }
.msg--pending { opacity: .65; }
.msg__retry { background: none; border: 0; color: var(--danger); cursor: pointer; padding: 0; margin-top: 4px; text-decoration: underline; font-size: .9rem; }
.divider { align-self: center; color: var(--gold-soft); font-size: .85rem; letter-spacing: .06em; padding: 4px 12px; border: 1px solid var(--stroke-soft); border-radius: 999px; }
.typing { align-self: flex-start; color: var(--mist); font-style: italic; display: flex; align-items: center; gap: 8px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.convo__note { padding: 10px 16px; color: var(--mist); font-size: .92rem; border-top: 1px solid var(--stroke-soft); background: rgba(6, 8, 20, .3); }
.convo__note--warn { color: var(--danger); }
.composer { display: flex; gap: 10px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--stroke-soft); background: rgba(6, 8, 20, .4); }
.composer .textarea { min-height: 48px; max-height: 160px; resize: none; padding: 12px 14px; }
.composer .btn { flex: none; width: 50px; padding: 0; }
.composer__wrap { flex: 1; }
.composer .counter { margin-top: 2px; }

/* ---------- profile ---------- */
.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-head h1 { color: var(--gold); font-size: clamp(1.7rem, 4vw, 2.3rem); }
.profile-head p { margin: 4px 0 0; color: var(--mist); }
.profile-cover { border-radius: 28px; padding: 26px; background: linear-gradient(90deg, rgba(6, 8, 20, .88), rgba(6, 8, 20, .5)), url("/img/profile.webp") center / cover; border: 1px solid var(--stroke-soft); }
.profile-cover .chips { margin-top: 14px; }
.menu { display: grid; gap: 10px; }
.menu a, .menu button {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: left; text-decoration: none; cursor: pointer;
  background: var(--panel); border: 1px solid var(--stroke-soft); border-radius: 18px; color: var(--text);
  transition: border-color .2s, transform .2s var(--ease);
}
.menu a:hover, .menu button:hover { border-color: var(--stroke); transform: translateX(2px); }
.menu svg { width: 24px; height: 24px; color: var(--gold); flex: none; }
.menu strong { display: block; color: var(--gold); font-family: var(--display); font-weight: 400; font-size: 1.15rem; }
.menu span { color: var(--mist); font-size: .95rem; }
.menu .menu__arrow { margin-left: auto; width: 18px; height: 18px; color: var(--mist-dim); }
.menu .btn--danger { justify-content: center; color: var(--danger); }
.faq details { border-top: 1px solid var(--stroke-soft); padding: 12px 0; }
.faq details:first-child { border-top: 0; }
.faq summary { cursor: pointer; color: var(--gold); font-size: 1.08rem; }
.faq p { margin: 8px 0 0; color: var(--mist); }

/* ---------- shop ---------- */
.products { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.product { display: flex; flex-direction: column; gap: 10px; }
.product strong { font-family: var(--display); font-weight: 400; color: var(--gold); font-size: 1.25rem; }
.product__price { font-family: var(--display); font-size: 1.5rem; color: var(--text); margin-top: auto; }

/* ---------- learn ---------- */
.article { max-width: 760px; margin: 0 auto; }
.article__cover { aspect-ratio: 16 / 7; border-radius: 28px; background: url("/img/learning.webp") center / cover; border: 1px solid var(--stroke-soft); margin-bottom: 20px; }

/* ---------- numerology ---------- */
.soon { text-align: center; padding: 0; overflow: hidden; }
.soon__img { aspect-ratio: 16 / 7; background: url("/img/numerology.webp") center / cover; }
.soon__body { padding: 24px; }

/* ---------- toast / dialog ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: calc(var(--top-h) + 10px); display: grid; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast {
  pointer-events: auto; padding: 12px 16px; border-radius: 16px; background: var(--panel-strong); border: 1px solid var(--stroke);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5); animation: rise .3s var(--ease) both;
}
.toast strong { display: block; color: var(--gold); font-family: var(--display); font-weight: 400; font-size: 1.1rem; }
.toast span { color: var(--mist); }
.toast--error { border-color: rgba(229, 139, 139, .6); }
.toast--error strong { color: var(--danger); }
.toast.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s; }

dialog.dialog {
  border: 1px solid var(--stroke); border-radius: 24px; padding: 24px; width: min(92vw, 420px);
  background: var(--panel-strong); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
dialog.dialog::backdrop { background: rgba(6, 8, 20, .7); backdrop-filter: blur(4px); }
dialog.dialog h2 { color: var(--gold); font-size: 1.4rem; margin-bottom: 8px; }
dialog.dialog p { color: var(--mist); }

.error-box { text-align: center; padding: 30px 20px; }
.error-box h2 { color: var(--gold); font-size: 1.4rem; margin-bottom: 8px; }
.error-box p { color: var(--mist); }

.footer { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--stroke-soft); display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; color: var(--mist-dim); font-size: .9rem; }
.footer a { color: var(--mist); }

.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, rgba(184, 199, 228, .05), rgba(184, 199, 228, .12), rgba(184, 199, 228, .05)); background-size: 200% 100%; animation: shimmer 1.4s infinite; min-height: 120px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

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

/* ---------- legal pages (static, no JS) ---------- */
.legal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 820px; margin: 0 auto; padding: 18px var(--pad) 0; }
.legal { max-width: 820px; margin: 0 auto; padding: 12px var(--pad) 64px; }
.legal .panel h2 { font-size: 1.3rem; margin: 22px 0 8px; }
.legal .panel h2:first-child { margin-top: 0; }
.legal ul { margin: 0 0 .7em; padding-left: 1.2em; }
.legal li { margin: 4px 0; }
.legal li::marker { color: var(--gold-soft); }
.legal p, .legal li { font-size: 1.08rem; }
.legal__date { color: var(--mist-dim); text-align: center; margin: -8px 0 20px; }
