/* ============================================================
   SERALUNE — design system  ·  "the moonlit almanac"
   One quiet, editorial design in two lights (data-theme on <html>):
     · night — ink sky, moonlight type, an apricot ember      (default)
     · dawn  — warm paper, ink type, terracotta
   "auto" follows the device and resolves to one of the two (theme.js).

   Principles
     · One serif voice (Instrument Serif) for anything the sky "says",
       one grotesque (Hanken Grotesk) for anything you do.
     · Hairlines, not glows. Colour is rare, so it means something.
     · The moon is drawn, never an emoji (MoonArt in theme.js).
     · Motion loops slowly and stops for prefers-reduced-motion.

   The atmosphere lives in .skydome (injected by theme.js). Icons are
   generated into css/icons.css (npm run build:icons). The marketing
   page adds css/landing.css on top of this file.
   ============================================================ */
@import url("icons.css");

/* ---------------------------------------------------------------
   1. TOKENS
   Palettes are declared on a theme selector AND a scope class, so a
   section can wear the other light (.dawn inside a night page).
   Aliases are repeated inside each block on purpose: a custom
   property that references another is resolved where it is declared.
   --------------------------------------------------------------- */
:root {
  --r-xl: 32px;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --spring: cubic-bezier(.16, 1, .3, 1);
  /* the symbol fonts sit before the system fallbacks so ♈ ☽ ℞ print as text glyphs, not colour emoji */
  --font-display: "Instrument Serif", "Cormorant Garamond", "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", "Iowan Old Style", Georgia, serif;
  --font-body: "Hanken Grotesk", "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --sidebar-w: 252px;
  /* "Continue with Google / Apple": the colours both brands' guidelines
     require (white button, neutral outline, near-black label) in every light */
  --sso-bg: #ffffff;
  --sso-fg: #1f1f1f;
  --sso-line: #747775;
}

:root, .night {
  color-scheme: dark;
  --bg: #0a0c14;
  --bg-2: #0e111b;
  --bg-3: #161a28;
  --surface: #131724;
  --text: #f3eee2;
  --muted: #a9adba;
  --faint: #747a8a;
  --accent: #f0b48c;
  --accent-2: #e39a76;
  --accent-soft: #f7d3b8;
  --rose: #e89ba8;
  --lavender: #a9b6ea;
  --good: #9ccaa9;
  --btn-bg: #f3eee2;
  --btn-ink: #0e111b;
  --card: color-mix(in srgb, #1a1f30 58%, transparent);
  --line: color-mix(in srgb, #f3eee2 10%, transparent);
  --line-bright: color-mix(in srgb, #f3eee2 24%, transparent);
  --tint: color-mix(in srgb, #f3eee2 5%, transparent);
  --shadow: 0 30px 80px -24px rgba(0, 0, 0, .65);
  --shadow-sm: 0 14px 34px -16px rgba(0, 0, 0, .55);

  /* the moon */
  --moon-hi: #fffaf0;
  --moon: #ece5d3;
  --moon-lo: #b8b09c;
  --moon-shade: color-mix(in srgb, #f3eee2 8%, transparent);
  --moon-glow: color-mix(in srgb, #fbe9cf 34%, transparent);

  /* the sky */
  --sky-top: #151c3c;
  --sky-mist: #6f7fd0;
  --sky-glow: #f0b48c;
  --star: #fff8ea;
  --grain: .05;

  /* astrology colour keys */
  --el-fire: #f0a07a;
  --el-earth: #9ccaa9;
  --el-air: #a9c8ea;
  --el-water: #b3a9ea;
  --asp-conjunction: #f0b48c;
  --asp-sextile: #9ccaa9;
  --asp-square: #e89ba8;
  --asp-trine: #a9c8ea;
  --asp-opposition: #b3a9ea;

  /* legacy names still used across page markup */
  --gold: var(--accent);
  --gold-2: var(--accent-2);
  --gold-soft: var(--accent-soft);
  --card-solid: var(--surface);
}

[data-theme="dawn"], .dawn {
  color-scheme: light;
  --bg: #f5f0e6;
  --bg-2: #efe8db;
  --bg-3: #e7decd;
  --surface: #fffdf8;
  --text: #1a1d2a;
  --muted: #5b5f6e;
  --faint: #8b8d99;
  --accent: #bd5f3c;
  --accent-2: #a44e2e;
  --accent-soft: #a44e2e;
  --rose: #b34a5e;
  --lavender: #4f5fa6;
  --good: #44775a;
  --btn-bg: #1a1d2a;
  --btn-ink: #f5f0e6;
  --card: color-mix(in srgb, #fffdf8 74%, transparent);
  --line: color-mix(in srgb, #1a1d2a 11%, transparent);
  --line-bright: color-mix(in srgb, #1a1d2a 26%, transparent);
  --tint: color-mix(in srgb, #1a1d2a 4%, transparent);
  --shadow: 0 30px 70px -28px rgba(70, 50, 20, .32);
  --shadow-sm: 0 14px 30px -18px rgba(70, 50, 20, .28);

  --moon-hi: #fffdf7;
  --moon: #f3ead8;
  --moon-lo: #c7ba9f;
  --moon-shade: color-mix(in srgb, #1a1d2a 24%, transparent);
  --moon-glow: color-mix(in srgb, #f0b48c 38%, transparent);

  --sky-top: #fdf8ee;
  --sky-mist: #b9c4ee;
  --sky-glow: #f2a986;
  --star: #1a1d2a;
  --grain: .07;

  --el-fire: #c0623f;
  --el-earth: #4f7d62;
  --el-air: #4a79ad;
  --el-water: #6a5fb5;
  --asp-conjunction: #bd5f3c;
  --asp-sextile: #44775a;
  --asp-square: #b34a5e;
  --asp-trine: #4a79ad;
  --asp-opposition: #6a5fb5;

  --gold: var(--accent);
  --gold-2: var(--accent-2);
  --gold-soft: var(--accent-soft);
  --card-solid: var(--surface);
}
.night, .dawn { color: var(--text); }

/* ---------------------------------------------------------------
   2. BASE
   --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: lining-nums;
  transition: background .5s var(--ease), color .3s var(--ease);
}
img, svg { max-width: 100%; }
button { font-family: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------------------------------------------------------------
   3. THE SKY  (.skydome is prepended to <body> by theme.js)
   wash → drifting mist → stars (canvas, night only) → horizon → grain
   --------------------------------------------------------------- */
.skydome { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; animation: sky-in 1.2s var(--ease) both; }
.skydome > * { position: absolute; inset: 0; }
@keyframes sky-in { from { opacity: 0; } to { opacity: 1; } }

.sky-wash {
  background:
    radial-gradient(120% 78% at 50% -12%, var(--sky-top), transparent 64%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 58%);
}
/* a huge soft cloud of colour that wanders on a long loop */
.sky-mist {
  inset: -20%;
  background:
    radial-gradient(34% 30% at 78% 22%, color-mix(in srgb, var(--sky-mist) 20%, transparent), transparent 70%),
    radial-gradient(30% 26% at 16% 62%, color-mix(in srgb, var(--rose) 9%, transparent), transparent 72%);
  filter: blur(30px);
  animation: mist-drift 48s ease-in-out infinite alternate;
}
@keyframes mist-drift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1); }
  50%  { transform: translate3d(3%, 2%, 0) scale(1.08); }
  100% { transform: translate3d(-1%, 4%, 0) scale(1.03); }
}
.sky-stars { width: 100%; height: 100%; display: block; }
[data-theme="dawn"] .sky-stars { display: none; }
/* first light along the bottom edge: the one warm thing in a night sky */
.sky-horizon {
  top: auto; bottom: -26vh; height: 70vh;
  background: radial-gradient(62% 100% at 50% 100%,
    color-mix(in srgb, var(--sky-glow) 20%, transparent),
    color-mix(in srgb, var(--rose) 7%, transparent) 46%, transparent 72%);
  animation: horizon-breathe 14s ease-in-out infinite;
}
[data-theme="dawn"] .sky-horizon {
  top: -30vh; bottom: auto;
  background: radial-gradient(60% 100% at 80% 0%,
    color-mix(in srgb, var(--sky-glow) 34%, transparent),
    color-mix(in srgb, var(--sky-glow) 10%, transparent) 46%, transparent 72%);
}
@keyframes horizon-breathe { 0%, 100% { opacity: .7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
.sky-grain {
  opacity: var(--grain); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dawn"] .sky-grain { mix-blend-mode: multiply; }

/* ---------------------------------------------------------------
   4. TYPOGRAPHY
   --------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -.012em;
  line-height: 1.06;
  margin: 0 0 .45em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 5vw, 3.7rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.5rem; line-height: 1.15; }
h4 { font-size: 1.2rem; }
h1 em, h2 em, h3 em, .hl { font-style: italic; color: var(--accent-soft); }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--accent-soft); text-decoration: none; text-underline-offset: 3px; transition: color .18s var(--ease); }
a:hover { text-decoration: underline; }
b, strong { font-weight: 600; }

.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: .86rem; }
.gold { color: var(--accent-soft); }
.rose { color: var(--rose); }
.danger { color: var(--rose); }
.serif-i { font-family: var(--font-display); font-style: italic; font-size: 1.18em; line-height: 1.35; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }

/* a small-caps label that opens a page or a section */
.eyebrow {
  display: inline-flex; align-items: center; gap: .7em;
  font-family: var(--font-body); font-weight: 600;
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; flex: 0 0 auto;
  background: var(--accent); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.eyebrow.plain::before { display: none; }
.divider { height: 1px; background: var(--line); margin: 22px 0; border: 0; }

/* ---------------------------------------------------------------
   5. THE MOON  (MoonArt.svg() from theme.js)
   --------------------------------------------------------------- */
.moonart { display: block; overflow: visible; }
.moonart .m-shade { fill: var(--moon-shade); }
.moonart .m-rim { fill: none; stroke: var(--line-bright); stroke-width: .6; }
.moonart .m-mare { fill: var(--moon-lo); opacity: .34; }
.moon-glow { filter: drop-shadow(0 0 14px var(--moon-glow)); }
/* on paper the moon needs an edge and a little weight to read as a body */
[data-theme="dawn"] .moonart .m-rim, .dawn .moonart .m-rim { stroke: color-mix(in srgb, var(--text) 34%, transparent); stroke-width: 1; }
[data-theme="dawn"] .moonart:not(.moon-glow), .dawn .moonart:not(.moon-glow) { filter: drop-shadow(0 3px 7px rgba(70, 50, 20, .2)); }
.night .moonart .m-rim { stroke: var(--line-bright); stroke-width: .6; }
.moon-float { animation: moon-float 9s ease-in-out infinite; }
@keyframes moon-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* ---------------------------------------------------------------
   6. APP SHELL
   --------------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  padding: 20px 14px 14px; display: flex; flex-direction: column;
  border-inline-end: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 50%, transparent);
  backdrop-filter: blur(22px);
  overflow-y: auto; scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 1.75rem; line-height: 1;
  letter-spacing: -.015em; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand .mark { width: 24px; height: 24px; flex: 0 0 auto; color: var(--accent-soft); }
.sidebar .brand { padding: 8px 12px 14px; }

.nav-group {
  padding: 18px 14px 6px; font-size: .64rem; font-weight: 600;
  letter-spacing: .17em; text-transform: uppercase; color: var(--faint);
}
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 12px;
  color: var(--muted); font-weight: 500; font-size: .93rem;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav-link .ico { --ico-size: 18px; opacity: .8; transition: color .18s var(--ease), opacity .18s var(--ease); }
.nav-link:hover { color: var(--text); background: var(--tint); text-decoration: none; }
.nav-link.active { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.nav-link.active .ico { color: var(--accent); opacity: 1; }
.nav-link.active::after {
  content: ""; margin-inline-start: auto; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent);
}
.nav-spacer { flex: 1; min-height: 14px; }

/* tonight's moon, bottom of the sidebar */
.moon-mini {
  display: flex; align-items: center; gap: 12px; margin: 0 2px 8px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card);
  color: var(--muted); font-size: .8rem; line-height: 1.35;
  transition: border-color .2s var(--ease);
}
.moon-mini:hover { text-decoration: none; border-color: var(--line-bright); }
.moon-mini b { display: block; color: var(--text); font-family: var(--font-display); font-weight: 400; font-size: 1.12rem; line-height: 1.15; }
.moon-mini .moonart { flex: 0 0 auto; }
.nav-foot { border-top: 1px solid var(--line); padding-top: 8px; }
.nav-link.plus .ico { color: var(--accent); opacity: 1; }

.main {
  flex: 1; min-width: 0; max-width: 940px; margin: 0 auto;
  padding: 48px clamp(18px, 4vw, 56px) 120px;
}
.main > .eyebrow { display: flex; margin-bottom: 14px; }
.main > h1 { margin-bottom: .22em; }
.main > h1 + p { font-size: 1.08rem; max-width: 62ch; margin-bottom: 30px; }

/* content rises in on load, one piece after another */
.main > * { animation: rise .8s var(--spring) both; }
.main > *:nth-child(1) { animation-delay: .02s; }
.main > *:nth-child(2) { animation-delay: .07s; }
.main > *:nth-child(3) { animation-delay: .12s; }
.main > *:nth-child(4) { animation-delay: .17s; }
.main > *:nth-child(5) { animation-delay: .22s; }
.main > *:nth-child(6) { animation-delay: .27s; }
.main > *:nth-child(n+7) { animation-delay: .32s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---- small screens: a top bar, a floating dock, and a "more" sheet ---- */
.topbar, .tabbar, .sheet-bg { display: none; }
@media (max-width: 860px) {
  .sidebar { display: none; }
  /* width: in the stacked shell .main's auto margins would otherwise size it
     to its widest content, and one wide table pushes the whole page sideways */
  .main { padding: 18px 18px 140px; width: 100%; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50; padding: 12px 18px;
    background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
  }
  .topbar .brand { font-size: 1.5rem; }
  .topbar .brand .mark { width: 21px; height: 21px; }
  .topbar-actions { display: flex; align-items: center; gap: 4px; }
  .icon-btn {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    color: var(--muted); background: none; border: 0; cursor: pointer;
  }
  .icon-btn:hover { color: var(--text); background: var(--tint); text-decoration: none; }
  .icon-btn .ico { --ico-size: 20px; }

  .shell { flex-direction: column; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    position: fixed; z-index: 60; left: 12px; right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom)); height: 66px; padding: 0 6px;
    border-radius: 26px; border: 1px solid var(--line-bright);
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    backdrop-filter: blur(24px) saturate(1.3);
    box-shadow: var(--shadow);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: 100%; background: none; border: 0; cursor: pointer; padding: 0;
    color: var(--faint); font-size: .64rem; font-weight: 600; letter-spacing: .02em;
    transition: color .18s var(--ease);
  }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .ico { --ico-size: 21px; }
  .tabbar .active { color: var(--text); }
  .tabbar .active .ico { color: var(--accent); }
  /* Luna sits centre-dock as a living orb */
  .tabbar .dock-luna { position: relative; gap: 0; }
  .tabbar .dock-luna .orb { transform: translateY(-14px); }
}

/* Luna's orb: a slow aura turning behind a moonlit disc */
.orb {
  position: relative; display: grid; place-items: center;
  width: var(--orb, 54px); height: var(--orb, 54px); border-radius: 50%; flex: 0 0 auto;
  background: radial-gradient(circle at 34% 30%, var(--moon-hi), var(--moon) 58%, var(--moon-lo));
  color: #14161f;
  box-shadow: 0 8px 26px -6px color-mix(in srgb, var(--accent) 60%, transparent), inset 0 -6px 12px rgba(0, 0, 0, .14);
}
.orb::before {
  content: ""; position: absolute; inset: -5px; border-radius: 50%; z-index: -1;
  background: conic-gradient(from 0deg, var(--accent), var(--lavender), var(--rose), var(--accent));
  filter: blur(7px); opacity: .75;
  animation: orb-turn 9s linear infinite;
}
.orb .ico { --ico-size: 44%; }
@keyframes orb-turn { to { transform: rotate(360deg); } }
.orb.thinking::before { animation-duration: 2.4s; opacity: 1; }

/* the "more" sheet */
.sheet-bg {
  position: fixed; inset: 0; z-index: 70; display: block;
  background: color-mix(in srgb, #05060a 62%, transparent); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
}
.sheet-bg.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow-y: auto;
  padding: 10px 18px calc(26px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line-bright);
  border-radius: 28px 28px 0 0;
  transform: translateY(102%); transition: transform .45s var(--spring);
}
.sheet-bg.open .sheet { transform: none; }
.sheet .grab { width: 38px; height: 4px; border-radius: 4px; background: var(--line-bright); margin: 4px auto 12px; }
.sheet h4 { font-family: var(--font-body); font-size: .64rem; font-weight: 600; letter-spacing: .17em; text-transform: uppercase; color: var(--faint); margin: 18px 4px 10px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sheet-grid a {
  display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--tint); color: var(--text); font-weight: 500; font-size: .86rem;
}
.sheet-grid a:hover { text-decoration: none; border-color: var(--line-bright); }
.sheet-grid a .ico { --ico-size: 20px; color: var(--accent); }
.sheet-grid a.active { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

/* right-hand ad rail (desktop only) */
.ad-rail { display: none; }
@media (min-width: 1280px) {
  .ad-rail { display: block; width: 200px; flex-shrink: 0; padding: 48px 18px 36px 0; }
  .ad-rail .ad-slot { position: sticky; top: 48px; margin: 0; }
  .ad-rail .ad-ext-ph, .ad-rail .adsbygoogle { min-height: max(340px, calc(100vh - 220px)); }
  .ad-rail .house-ad { flex-direction: column; text-align: center; padding: 22px 16px; min-height: 280px; justify-content: center; }
  .ad-rail .house-ad .cta { margin-inline-start: 0; }
}

/* ---------------------------------------------------------------
   7. COMPONENTS
   --------------------------------------------------------------- */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 30px; margin-bottom: 20px;
  backdrop-filter: blur(18px) saturate(1.15);
  transition: transform .3s var(--spring), border-color .25s var(--ease), box-shadow .3s var(--ease);
}
@media (max-width: 560px) { .card { padding: 22px 20px; border-radius: 22px; } }
/* the featured card on a page: a wash of first light in one corner */
.card.glow {
  border-color: var(--line-bright);
  background:
    radial-gradient(90% 130% at 0% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 56%),
    radial-gradient(80% 120% at 100% 0%, color-mix(in srgb, var(--lavender) 8%, transparent), transparent 58%),
    var(--card);
}
.card.glow::before {
  content: ""; position: absolute; top: -1px; left: 14%; right: 14%; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent-soft) 70%, transparent), transparent);
}
.card h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.card h3 .ico, .card h3 .ic { color: var(--accent); --ico-size: 20px; flex: 0 0 auto; }
.card > :last-child { margin-bottom: 0; }
.grid .card { margin-bottom: 0; }
.grid .card:hover, .card.hoverable:hover { transform: translateY(-3px); border-color: var(--line-bright); box-shadow: var(--shadow-sm); }

.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.card .grid { margin-bottom: 0; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row2, .row3 { grid-template-columns: 1fr; } }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--btn-bg); color: var(--btn-ink);
  font-family: var(--font-body); font-weight: 600; font-size: .95rem; line-height: 1.2;
  border: 1px solid transparent; border-radius: 999px; padding: 13px 24px; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: transform .2s var(--spring), box-shadow .25s var(--ease), background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); text-decoration: none; box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--btn-bg) 55%, transparent); }
.btn:active { transform: translateY(0) scale(.98); }
.btn .ico { --ico-size: 17px; }
.btn.hero { background: var(--accent); color: #17100b; }
[data-theme="dawn"] .btn.hero, .dawn .btn.hero { color: #fffaf3; }
.btn.hero:hover { box-shadow: 0 14px 34px -12px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-bright); }
.btn.ghost:hover { background: var(--tint); border-color: var(--text); box-shadow: none; }
.btn.soft { background: var(--tint); color: var(--text); }
.btn.soft:hover { background: color-mix(in srgb, var(--text) 10%, transparent); box-shadow: none; }
.btn.small { padding: 9px 17px; font-size: .86rem; }
.btn.danger { color: var(--rose); border-color: color-mix(in srgb, var(--rose) 50%, transparent); }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
/* a quiet text link with an arrow that leans forward on hover */
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--text); }
.link-arrow .ico { --ico-size: 16px; transition: transform .25s var(--spring); }
.link-arrow:hover { text-decoration: none; color: var(--accent-soft); }
.link-arrow:hover .ico { transform: translateX(4px); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  background: var(--tint); border: 1px solid var(--line);
  color: var(--muted); font-size: .78rem; font-weight: 600; line-height: 1.5;
}
.pill.gold { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 32%, transparent); }
.pill.rose { background: color-mix(in srgb, var(--rose) 13%, transparent); color: var(--rose); border-color: color-mix(in srgb, var(--rose) 32%, transparent); }
.pill .ico { --ico-size: 13px; }
button.pill, .pill[data-g], .pill[data-a], .pill[data-p] { cursor: pointer; transition: all .16s var(--ease); }
button.pill:hover { color: var(--text); border-color: var(--line-bright); }
.pill.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

/* ---- forms ---- */
label { display: block; font-weight: 600; font-size: .84rem; color: var(--muted); margin: 16px 0 7px; }
input, select, textarea {
  width: 100%; padding: 13px 15px; border-radius: var(--r-sm); font-family: var(--font-body);
  background: var(--tint); border: 1px solid var(--line); color: var(--text); font-size: .96rem; line-height: 1.4;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--line-bright); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}
input[type="checkbox"] { width: 18px; height: 18px; padding: 0; accent-color: var(--accent); flex: 0 0 auto; }
input:disabled { opacity: .45; }
select { appearance: none; padding-inline-end: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888c99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
html.rtl select { background-position: left 12px center; }
select option { background: var(--surface); color: var(--text); }
textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--text); cursor: pointer; }

.city-results { background: var(--surface); border: 1px solid var(--line-bright); border-radius: var(--r-sm); margin-top: 6px; overflow: hidden; box-shadow: var(--shadow-sm); }
.city-results button { display: block; width: 100%; text-align: start; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text); padding: 12px 15px; cursor: pointer; font-size: .92rem; }
.city-results button:last-child { border-bottom: 0; }
.city-results button:hover { background: var(--tint); }

/* segmented control (used for page tabs, durations, theme) */
.tabs, .seg-ctl {
  display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 22px; max-width: 100%;
  border: 1px solid var(--line); border-radius: 999px; background: var(--tint);
}
.tabs button, .seg-ctl button {
  background: none; border: 0; color: var(--muted); padding: 8px 18px; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: .88rem; transition: color .18s var(--ease), background .25s var(--ease);
}
.tabs button:hover, .seg-ctl button:hover { color: var(--text); }
.tabs button.active, .seg-ctl button.on { background: var(--btn-bg); color: var(--btn-ink); }
.seg-ctl { margin-bottom: 0; }
.seg-ctl button { display: inline-flex; align-items: center; gap: 7px; }
.seg-ctl .ico { --ico-size: 15px; }

/* a wrap of selectable chips (flow, moods, prompts…) */
.seg { display: flex; gap: 7px; flex-wrap: wrap; }
.seg button {
  background: var(--tint); border: 1px solid var(--line); color: var(--muted); border-radius: 999px;
  padding: 8px 15px; cursor: pointer; font-size: .85rem; font-weight: 600; transition: all .16s var(--ease);
}
.seg button:hover { border-color: var(--line-bright); color: var(--text); }
.seg button.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

table.placements { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.placements td, table.placements th { padding: 11px 8px; border-bottom: 1px solid var(--line); text-align: start; }
table.placements tr:last-child td { border-bottom: 0; }
table.placements th { color: var(--faint); font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; }
table.placements .glyph { font-size: 1.15rem; width: 34px; color: var(--accent-soft); font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", var(--font-body); }
/* on a phone the five columns have to fit: tighter cells, and long words may break */
@media (max-width: 560px) {
  table.placements { font-size: .86rem; }
  table.placements td, table.placements th { padding: 9px 4px; }
  table.placements td:first-child, table.placements th:first-child { padding-inline-start: 0; }
  table.placements td:last-child, table.placements th:last-child { padding-inline-end: 0; overflow-wrap: anywhere; }
  table.placements .glyph { width: 24px; }
}

/* a ruled list row (settings, logs, lunations) */
.acct-row, .list-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.acct-row:last-child, .list-row:last-child { border-bottom: 0; padding-bottom: 0; }
.acct-row b { font-weight: 600; }

/* ---- premium lock ---- */
.locked-card { position: relative; overflow: hidden; min-height: 320px; }
.lock-skel { position: absolute; inset: 28px 30px; display: flex; flex-direction: column; gap: 15px; pointer-events: none; }
.lock-skel i {
  height: 12px; border-radius: 7px; display: block;
  background: linear-gradient(100deg, var(--tint) 30%, color-mix(in srgb, var(--accent) 16%, transparent) 50%, var(--tint) 70%);
  background-size: 220% 100%; animation: skel-sheen 3.2s ease-in-out infinite;
}
.lock-skel i:nth-child(2n) { animation-delay: .5s; }
.lock-skel i:nth-child(3n) { animation-delay: 1.1s; }
@keyframes skel-sheen { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
.lock-panel {
  position: relative; z-index: 2; margin: 26px auto; max-width: 380px; text-align: center;
  background: var(--surface); border: 1px solid var(--line-bright); border-radius: var(--r-lg);
  padding: 30px 28px 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.lock-orb {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.lock-panel h3 { margin: 6px 0 0; font-size: 1.5rem; justify-content: center; }
.lock-panel p { margin: 0; color: var(--muted); font-size: .93rem; max-width: 300px; }
.lock-panel .btn { margin-top: 10px; }
.lock-price { color: var(--faint); font-size: .76rem; }

.bar { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--text) 9%, transparent); overflow: hidden; margin: 8px 0 2px; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--lavender), var(--accent)); transform-origin: left; animation: bar-in 1.2s var(--spring) both; }
html.rtl .bar i { transform-origin: right; }
@keyframes bar-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.banner {
  display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: var(--r-md);
  background: var(--card); border: 1px solid var(--line); margin-bottom: 12px; font-size: .94rem;
  color: var(--text); backdrop-filter: blur(14px);
  transition: border-color .18s var(--ease), transform .25s var(--spring);
}
a.banner:hover { border-color: var(--line-bright); text-decoration: none; transform: translateX(3px); }
.banner > .ico, .banner > .moonart { flex: 0 0 auto; color: var(--accent); --ico-size: 20px; }
.banner .pill { margin-inline-start: auto; }
.banner.account-nudge { flex-wrap: wrap; margin: 4px 0 22px; }
.banner.account-nudge > span { flex: 1 1 260px; color: var(--muted); }
.banner.account-nudge > span b { color: var(--text); font-weight: 600; }
.banner.account-nudge > button {
  background: none; border: 0; color: var(--faint); cursor: pointer; padding: 6px;
  display: grid; place-items: center; border-radius: 8px;
}
.banner.account-nudge > button:hover { color: var(--text); background: var(--tint); }

/* sync status dot (Account) */
.sync-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-inline-end: 6px; vertical-align: middle; }
.sync-dot.synced { background: var(--good); }
.sync-dot.syncing { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.sync-dot.error, .sync-dot.offline { background: var(--rose); }
@keyframes pulse { 50% { opacity: .35; } }

.toast {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%) translateY(16px); opacity: 0;
  background: var(--btn-bg); color: var(--btn-ink);
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: .9rem; max-width: calc(100vw - 32px);
  box-shadow: var(--shadow); transition: all .4s var(--spring); z-index: 100; pointer-events: none; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Luna ---- */
.chat-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.chat-head h1 { margin: 0; }
.chat-head p { margin: 2px 0 0; }
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 250px); min-height: 440px; padding: 18px 20px 16px; }
.chat-log { flex: 1; overflow-y: auto; padding: 8px 4px 18px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; }
.msg { max-width: min(78%, 620px); padding: 13px 18px; border-radius: 20px; font-size: .96rem; line-height: 1.6; white-space: pre-wrap; animation: msg-in .5s var(--spring) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.msg.luna { background: var(--tint); border: 1px solid var(--line); border-end-start-radius: 6px; align-self: flex-start; }
.msg.me { background: var(--btn-bg); color: var(--btn-ink); border-end-end-radius: 6px; align-self: flex-end; }
.msg.typing { color: var(--faint); font-style: italic; }
.chat-input { display: flex; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; border-radius: 999px; padding-inline: 20px; }
.chat-input .btn { padding: 0; width: 48px; height: 48px; flex: 0 0 auto; }

/* ---- modal ---- */
.modal-bg { position: fixed; inset: 0; background: color-mix(in srgb, #05060a 66%, transparent); backdrop-filter: blur(6px); z-index: 80; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-bg.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--line-bright); border-radius: var(--r-lg); padding: 30px; width: 100%; max-width: 480px; box-shadow: var(--shadow); max-height: 88vh; overflow-y: auto; }

/* ---- share sheet (js/share.js) ---- */
.share-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto;
  margin-inline-start: auto; border-radius: 50%; cursor: pointer;
  color: var(--muted); background: none; border: 1px solid var(--line);
  transition: color .18s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.share-btn:hover, .share-btn:focus-visible { color: var(--text); background: var(--tint); border-color: var(--line-bright); }
.card h3 .share-btn .ico { --ico-size: 16px; color: inherit; }
/* a card without a header carries the button in its corner */
.card.has-share { position: relative; }
.card.has-share > .share-btn { position: absolute; top: 16px; inset-inline-end: 16px; z-index: 1; }
.share-btn .ico { --ico-size: 16px; }
.share-bg { z-index: 90; }
.share-modal { max-width: 860px; padding: 22px 26px 26px; }
.share-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.share-head h3 { display: flex; align-items: center; gap: 10px; margin: 0; }
.share-head h3 .ico { color: var(--accent); --ico-size: 20px; }
.share-x { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 0; background: none; color: var(--muted); cursor: pointer; }
.share-x:hover, .share-x:focus-visible { color: var(--text); background: var(--tint); }
.share-body { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 26px; align-items: start; }
.share-preview {
  position: relative; aspect-ratio: 9 / 16; border-radius: var(--r-md); overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.share-preview[data-fmt="post"] { aspect-ratio: 4 / 5; }
.share-preview img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .3s var(--ease); }
.share-preview img:not([src]) { visibility: hidden; }
.share-wait { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: .86rem; opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
.share-preview.busy img { opacity: .35; }
.share-preview.busy .share-wait { opacity: 1; }
.share-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.share-opts { display: flex; flex-wrap: wrap; gap: 10px; }
.share-opts .seg-ctl button { padding: 7px 15px; }
.share-opts .seg-ctl .ico { --ico-size: 15px; }
.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-actions .btn { justify-content: center; padding-inline: 14px; }
.share-actions .btn[data-act="share"] { grid-column: 1 / -1; }
.share-actions .btn[hidden] { display: none; }
.share-apps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .9rem; }
.share-apps a { color: var(--text); font-weight: 600; border-bottom: 1px solid var(--line-bright); }
.share-apps a:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.share-apps a[hidden] { display: none; }
.share-hint { display: flex; gap: 9px; align-items: flex-start; margin: 0; font-size: .86rem; line-height: 1.5; }
.share-hint .ico { --ico-size: 16px; flex: 0 0 auto; margin-top: 2px; }
@media (max-width: 700px) {
  .share-bg { align-items: flex-end; padding: 0; }
  .share-modal { max-height: 94vh; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 16px 18px calc(20px + env(safe-area-inset-bottom)); }
  .share-body { grid-template-columns: 1fr; gap: 16px; }
  .share-preview { width: auto; height: min(52vh, 460px); margin-inline: auto; }
  .share-opts { gap: 8px; }
  .share-opts .seg-ctl button { padding: 7px 11px; }
}

/* ---- pricing ---- */
.price-card { padding: 34px 30px; display: flex; flex-direction: column; }
.price-card h3 { font-size: 1.7rem; margin-bottom: 0; }
.price-card .amount { font-family: var(--font-display); font-size: 3.6rem; line-height: 1; margin: 14px 0 6px; letter-spacing: -.02em; }
.price-card .amount small, .price-card .amount span { font-family: var(--font-body); font-size: .95rem; color: var(--muted); letter-spacing: 0; margin-inline-start: 4px; }
.price-card ul { list-style: none; padding: 0; margin: 20px 0 26px; }
.price-card li { display: flex; gap: 11px; align-items: flex-start; padding: 8px 0; font-size: .94rem; border-top: 1px solid var(--line); }
.price-card li::before {
  content: ""; flex: 0 0 auto; width: 16px; height: 16px; margin-top: 4px; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.price-card .btn { margin-top: auto; }
.price-card.featured {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    var(--card);
}

/* ---- chart wheel ---- */
.wheel-wrap { display: flex; justify-content: center; padding: 6px 0 22px; }
.wheel-wrap svg { max-width: 480px; width: 100%; height: auto; overflow: visible; }
.wheel-wrap text, .reveal-wheel text { font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", var(--font-body); }
.wheel-ring { transform-origin: center; transform-box: fill-box; }
.aspect-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 8px; }

/* the big three, set like a masthead */
.big3 { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.big3 > div { padding: 18px 8px 2px; text-align: center; }
.big3 > div + div { border-inline-start: 1px solid var(--line); }
.big3 .g { display: block; font-size: 1.5rem; line-height: 1; color: var(--accent-soft); font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", var(--font-body); }
.big3 b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; line-height: 1.15; margin-top: 8px; }
.big3 small { color: var(--faint); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; }

.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 22px; margin-bottom: 18px; }
.fact-grid > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.fact-grid .faint { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; }

.journal-entry { border-inline-start: 1px solid var(--line-bright); padding: 2px 0 2px 18px; margin-bottom: 22px; }
.journal-entry .date { font-size: .68rem; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; }

.score-ring { font-family: var(--font-display); font-size: 4.6rem; line-height: 1; color: var(--accent-soft); letter-spacing: -.02em; }

.affirm-card {
  position: relative; padding: clamp(38px, 7vw, 68px) clamp(24px, 6vw, 60px); text-align: center;
  font-family: var(--font-display); font-style: italic; font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.18;
  color: var(--text); border: 1px solid var(--line-bright); border-radius: var(--r-xl); margin-bottom: 20px;
  background:
    radial-gradient(70% 90% at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 62%),
    var(--card);
  backdrop-filter: blur(18px);
}

footer.site { text-align: center; color: var(--faint); font-size: .82rem; padding: 40px 20px 30px; position: relative; z-index: 1; }
footer.site a { color: var(--muted); }

.legal { max-width: 700px; margin: 0 auto; padding: 56px 22px 80px; position: relative; z-index: 1; }
.legal h1 { margin-top: 28px; }
.legal h2 { margin-top: 40px; font-size: 1.7rem; }
.legal p { color: var(--muted); }

/* dev-only Plus toggle (shown on localhost) */
.dev-pill {
  position: fixed; bottom: 14px; right: 14px; z-index: 90;
  display: inline-flex; align-items: center; gap: 7px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px);
  border: 1px dashed var(--line-bright); color: var(--faint);
  font-size: .7rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer;
}
.dev-pill:hover { color: var(--text); }
.dev-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.dev-pill.on .dot { background: var(--good); box-shadow: 0 0 8px var(--good); }
@media (max-width: 860px) { .dev-pill { bottom: auto; top: 62px; } }

/* ---- ads ---- */
.ad-slot { margin: 0 0 20px; }
.ad-slot:empty { display: none; }
.house-ad {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px;
  border-radius: var(--r-md); color: var(--text); position: relative;
  background: var(--card); border: 1px solid var(--line); transition: border-color .18s var(--ease);
}
.house-ad:hover { border-color: var(--line-bright); text-decoration: none; }
.house-ad .tag { position: absolute; top: 8px; inset-inline-end: 12px; font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.house-ad .ico { --ico-size: 22px; color: var(--accent); }
.house-ad .sub { color: var(--muted); font-size: .86rem; }
.house-ad .cta { margin-inline-start: auto; font-weight: 600; font-size: .88rem; white-space: nowrap; }
.ad-frame { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px 12px; }
.ad-label { display: block; font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.ad-label a { color: var(--faint); text-decoration: underline; }
.ad-ext-ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  min-height: 96px; border: 1px dashed var(--line-bright); border-radius: var(--r-sm);
  color: var(--faint); font-size: .8rem; text-align: center; padding: 14px;
}
.ad-ext-ph b { color: var(--muted); font-weight: 600; }

.consent-bar {
  position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 95;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line-bright); border-radius: var(--r-md);
  padding: 14px 20px; font-size: .9rem; box-shadow: var(--shadow);
}
.consent-bar .consent-actions { display: flex; gap: 10px; }
@media (max-width: 860px) { .consent-bar { bottom: 92px; } }

/* ---------------------------------------------------------------
   8. TODAY
   --------------------------------------------------------------- */
/* the masthead: a greeting set large, tonight's moon beside it */
.today-hero { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; margin-bottom: 26px; }
.today-hero h1 { margin: 12px 0 .2em; }
.today-hero .moon-stage { position: relative; width: 148px; height: 148px; display: grid; place-items: center; }
/* on a phone the moon stays, smaller, beside the greeting (as on iOS) */
@media (max-width: 620px) {
  .today-hero { gap: 12px; margin-bottom: 20px; }
  .today-hero .moon-stage { width: 74px; height: 74px; margin-inline-end: 8px; }
  .today-hero .moon-stage .moonart { width: 56px; height: 56px; }
}

/* thin rings with a bead travelling each one */
.orbit { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line); animation: orbit-turn 40s linear infinite; }
.orbit::after { content: ""; position: absolute; top: -3px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.orbit.o2 { inset: -16%; animation-duration: 70s; animation-direction: reverse; border-style: dashed; }
.orbit.o2::after { background: var(--lavender); box-shadow: 0 0 10px var(--lavender); width: 4px; height: 4px; }
.orbit.o3 { inset: -34%; animation-duration: 110s; opacity: .6; }
.orbit.o3::after { background: var(--text); box-shadow: none; width: 3px; height: 3px; top: -2px; }
@keyframes orbit-turn { to { transform: rotate(360deg); } }

/* the facts of the day, set as a ruled strip */
.skyline { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 20px; background: var(--card); backdrop-filter: blur(14px); overflow: hidden; }
.skyline > div { flex: 1 1 150px; padding: 14px 18px; border-inline-end: 1px solid var(--line); margin-inline-end: -1px; border-bottom: 1px solid var(--line); margin-bottom: -1px; }
.skyline small { display: block; font-size: .64rem; letter-spacing: .15em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.skyline b { font-family: var(--font-display); font-weight: 400; font-size: 1.22rem; line-height: 1.25; }

.reading p { font-size: 1.03rem; }
.reading .lede { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.22; letter-spacing: -.005em; }
@media (max-width: 560px) { .reading .lede { font-size: 1.42rem; } }
.reading-more { animation: rise .5s var(--spring) both; }
.reading-more[hidden] { display: none; }
.more-toggle { background: none; border: 0; padding: 4px 0; margin: 2px 0 0; cursor: pointer; font-family: var(--font-body); }
.more-toggle .ico { transition: transform .3s var(--spring); }
.more-toggle:hover .ico { transform: translateX(3px); }
.more-toggle[aria-expanded="true"] .ico { transform: rotate(-90deg); }
html.rtl .more-toggle .ico { transform: scaleX(-1); }
html.rtl .more-toggle[aria-expanded="true"] .ico { transform: rotate(-90deg); }

/* the daily check-in: five mood-moons, then the week they've drawn */
.checkin .mood-pick { margin-top: 4px; }
.week-moons { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.wm-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.wm-title { font-size: .66rem; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.wm-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wm-day {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 9px 0 8px; border-radius: var(--r-sm); border: 1px solid transparent;
}
.wm-day .moonart, .wm-empty { width: 24px; height: 24px; flex: 0 0 auto; }
.wm-empty { display: block; border-radius: 50%; border: 1px dashed var(--line-bright); }
.wm-dow { font-size: .66rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); line-height: 1; }
.wm-num { font-size: .78rem; color: var(--muted); line-height: 1; }
.wm-day.today { background: color-mix(in srgb, var(--accent) 9%, transparent); border-color: color-mix(in srgb, var(--accent) 34%, transparent); }
.wm-day.today .wm-dow, .wm-day.today .wm-num { color: var(--accent-soft); }
.wm-day.today .wm-empty { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }

/* three shortcuts under the reading (journal, Luna, tarot) */
.quick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.quick-tile {
  display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px 16px 15px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); color: var(--text);
  backdrop-filter: blur(14px);
  transition: transform .3s var(--spring), border-color .2s var(--ease);
}
.quick-tile:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--line-bright); }
.quick-tile .ico { --ico-size: 21px; color: var(--accent); margin-bottom: 6px; }
.quick-tile b { font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; line-height: 1.1; }
.quick-tile small {
  color: var(--faint); font-size: .8rem; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 560px) {
  .quick-row { gap: 8px; }
  .quick-tile { padding: 14px 12px 13px; }
  .quick-tile b { font-size: 1.12rem; }
  .quick-tile small { font-size: .74rem; }
}

/* a quiet closing row: turn on reminders */
.notify-row { flex-wrap: wrap; }
.notify-row > span { flex: 1 1 220px; display: flex; flex-direction: column; line-height: 1.4; }
.notify-row > span b { font-weight: 600; }
.notify-row > span .muted { font-size: .86rem; }
.lucky { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.flow3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; border-top: 1px solid var(--line); margin-top: 6px; }
.flow3 > div { padding: 16px 18px 6px 0; }
.flow3 > div + div { border-inline-start: 1px solid var(--line); padding-inline-start: 18px; }
@media (max-width: 660px) { .flow3 > div + div { border-inline-start: 0; padding-inline-start: 0; border-top: 1px solid var(--line); } }
.flow3 b { display: flex; align-items: center; gap: 8px; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.flow3 b .ico { color: var(--accent); --ico-size: 16px; }
.flow3 p { font-size: .94rem; margin: 8px 0 0; }

.quick { display: flex; flex-direction: column; gap: 6px; }
.quick .ico { color: var(--accent); --ico-size: 22px; margin-bottom: 8px; }
.quick b { font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; line-height: 1.15; }
.quick .link-arrow, .quick .btn { margin-top: auto; align-self: flex-start; }

/* insights + mood */
.insight {
  display: flex; gap: 14px; align-items: flex-start; color: var(--text);
  padding: 16px 0; border-top: 1px solid var(--line);
  transition: transform .25s var(--spring);
}
.insight:hover { text-decoration: none; transform: translateX(4px); }
.insight .i-ic { flex: 0 0 auto; color: var(--accent); --ico-size: 20px; margin-top: 3px; }
.insight .i-body { min-width: 0; }
.insight .i-body p { margin: 0; font-size: .98rem; line-height: 1.55; }
.insight .i-tag { display: block; font-size: .62rem; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; margin-bottom: 4px; color: var(--accent-soft); }
.insight .i-tag.nudge { color: var(--lavender); }
.insight .i-cta { display: inline-block; margin-top: 8px; font-size: .86rem; font-weight: 600; color: var(--muted); }
.insight:hover .i-cta { color: var(--accent-soft); }

/* mood is picked as a moon: new (low) to full (bright) */
.mood-pick { display: flex; gap: 8px; margin-top: 6px; }
.mood-pick button {
  flex: 1 1 0; min-width: 0; cursor: pointer; background: none;
  border: 1px solid transparent; border-radius: var(--r-md); padding: 14px 4px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .3s var(--spring);
}
.mood-pick button .moonart { transition: transform .35s var(--spring), filter .3s var(--ease); }
.mood-pick button .l { font-size: .7rem; color: var(--faint); font-weight: 600; }
.mood-pick button:hover { background: var(--tint); }
.mood-pick button:hover .moonart { transform: scale(1.12); }
.mood-pick button.on { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.mood-pick button.on .moonart { filter: drop-shadow(0 0 10px var(--moon-glow)); }
.mood-pick button.on .l { color: var(--accent-soft); }
.mood-saved { color: var(--accent-soft); font-size: .9rem; margin-top: 12px; }

/* ---------------------------------------------------------------
   9. THEME + LANGUAGE CONTROLS
   --------------------------------------------------------------- */
.lang-switch { position: relative; display: inline-block; }
.lang-switch .ls-trigger {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: none; border: 1px solid var(--line); color: var(--muted);
  font-size: .76rem; font-weight: 600; letter-spacing: .08em;
  padding: 8px 13px; border-radius: 999px; transition: all .16s var(--ease);
}
.lang-switch .ls-trigger:hover { color: var(--text); border-color: var(--line-bright); }
.lang-switch .ls-trigger .ico { --ico-size: 15px; }
/* a language switch is fetching its translations before the page reloads */
.lang-switch.busy .ls-trigger { pointer-events: none; color: var(--text); border-color: var(--line-bright); }
.lang-switch.busy .ls-trigger .ico { animation: spin 1.1s linear infinite; }
.lang-switch .ls-panel {
  position: absolute; inset-inline-end: 0; top: calc(100% + 10px); z-index: 97;
  width: 276px; padding: 8px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line-bright); box-shadow: var(--shadow);
  display: none; flex-direction: column; gap: 4px; text-align: start;
}
.lang-switch.up .ls-panel { top: auto; bottom: calc(100% + 10px); }
.lang-switch.open .ls-panel { display: flex; animation: pop-in .25s var(--spring) both; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.lang-switch .ts-head { font-size: .64rem; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 4px; }
.lang-switch .ls-search { margin: 2px 0 4px; padding: 10px 12px; font-size: .88rem; }
.lang-switch .ls-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.ls-opt {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; cursor: pointer;
  border: 0; background: none; text-align: start; transition: background .15s var(--ease);
}
.ls-opt:hover { background: var(--tint); }
.ls-opt.on { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ls-opt .ls-n { line-height: 1.25; min-width: 0; }
.ls-opt .ls-n b { display: block; font-size: .9rem; color: var(--text); font-weight: 600; }
.ls-opt .ls-n small { color: var(--faint); font-size: .74rem; }
.ls-opt .chk { margin-inline-start: auto; color: var(--accent); opacity: 0; }
.ls-opt.on .chk { opacity: 1; }

/* ---------------------------------------------------------------
   10. MOTION UTILITIES + POLISH
   --------------------------------------------------------------- */
/* [data-reveal] fades up when it scrolls into view (observer in theme.js) */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--spring), transform .9s var(--spring); transition-delay: var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* Luna "thinking": three beads rising in turn */
.dots { display: inline-flex; gap: 5px; align-items: center; height: 1em; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .4; animation: dot-bob 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot-bob { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-5px); opacity: 1; } }

/* a breathing ring: in 4 · hold · out 6 */
@keyframes breathe { 0% { transform: scale(.72); } 40% { transform: scale(1.06); } 55% { transform: scale(1.06); } 100% { transform: scale(.72); } }
@keyframes pulse-soft { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes spin { to { transform: rotate(360deg); } }

::selection { background: color-mix(in srgb, var(--accent) 38%, transparent); color: var(--text); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 16%, transparent); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--text) 30%, transparent); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
