/* ---------- Font ----------
   Space Grotesk (SIL Open Font License, see ../fonts/OFL.txt), served from this site instead of
   Google Fonts so visitors' browsers don't contact a third party. One variable file covers 300–700. */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(../fonts/space-grotesk-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(../fonts/space-grotesk-latin.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;
}

/* ---------- Tokens ---------- */
:root {
  /* Safar palette (brandbook) */
  --galaxy: #422f9b;        /* Roxo Galáxia: primary */
  --cosmos: #14104b;        /* Azul Cosmos: text and dark surfaces */
  --violet: #402278;        /* Violeta Ascendente */
  --synergy: #7e76b7;       /* Azul Sinérgico */
  --pink: #f5b3ff;          /* Rosa de Apoio: highlights on dark */

  --bg: #f4f2fc;
  --bg-deep: #e9e5fa;
  --surface: #ffffff;
  --surface-tint: #f8f6ff;
  --ink: var(--cosmos);
  --ink-soft: #4a4478;
  --ink-faint: #6e67a8;     /* darker Sinérgico, readable on white */
  --line: #e2ddf5;
  --accent: var(--galaxy);
  --accent-deep: var(--violet);
  --accent-soft: #ece8fb;
  --night: var(--cosmos);
  --on-dark: #f6f3ff;
  --galaxy-gradient: linear-gradient(135deg, #574bb5 0%, #422f9b 45%, #14104b 100%);
  --error: #c2365f;
  --error-soft: #fde8ef;

  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 16, 75, 0.05), 0 14px 40px rgba(20, 16, 75, 0.08);
}

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

/* The hidden attribute must win over component display rules (e.g. .stack { display: grid }). */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg) url("../brand/texture-light.jpg") center top / cover fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.025em;
  color: var(--cosmos);
}
h2 { font-weight: 500; }

a { color: var(--accent-deep); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Subtle orbit lines behind everything */
.sky {
  position: fixed;
  inset: -20vh -20vw auto auto;
  width: 90vmax;
  height: 90vmax;
  pointer-events: none;
  z-index: -1;
  opacity: 0.55;
}
.sky svg { width: 100%; height: 100%; }
.sky circle { fill: none; stroke: var(--line); stroke-width: 1; }

/* ---------- Layout ---------- */
.site-header {
  /* Respect the iPhone notch / Dynamic Island when opened from the home screen. */
  padding: max(22px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.language-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.language-switch a {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  text-decoration: none;
}
.language-switch a:hover { color: var(--ink); }
.language-switch a.is-active { background: var(--night); color: var(--on-dark); }
.brand { display: inline-flex; align-items: center; line-height: 0; }
.brand img { height: 30px; width: auto; }

.page {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.site-footer {
  padding-bottom: max(32px, env(safe-area-inset-bottom)) !important;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 24px 16px 32px;
}
.site-footer p { margin: 0; }
.footer-tagline { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.68rem; font-weight: 600; color: var(--galaxy); margin-bottom: 6px !important; }
.footer-logout { margin-top: 10px !important; }
.footer-logout a { color: var(--ink-faint); }
.login-card { max-width: 420px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- App shell: dark hero, navigation ---------- */
.site-header { gap: 16px; flex-wrap: wrap; }
.main-nav { display: none; gap: 28px; font-size: 15px; font-weight: 600; }
.main-nav a { color: var(--ink-faint); text-decoration: none; padding: 8px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--ink); }
.main-nav a.is-active { color: var(--ink); border-bottom-color: var(--galaxy); }
.main-nav-dark a { color: rgba(246, 243, 255, 0.75); }
.main-nav-dark a:hover, .main-nav-dark a.is-active { color: var(--on-dark); }
.main-nav-dark a.is-active { border-bottom-color: var(--pink); }

.hero-dark {
  background: var(--cosmos) url("../brand/texture-dark.jpg") center / cover;
  color: var(--on-dark);
  border-radius: 0 0 32px 32px;
}
.hero-dark-inner { max-width: 1200px; margin: 0 auto; padding-bottom: 34px; }
.site-header-dark { max-width: none; }
.hero-dark .language-switch { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); }
.hero-dark .language-switch a { color: rgba(246, 243, 255, 0.7); }
.hero-dark .language-switch a.is-active { background: var(--on-dark); color: var(--cosmos); }
.hero-date {
  margin: 48px 20px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pink);
}
body.home .page { max-width: 1200px; }

.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 6px 8px max(6px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid #e2ddf5;
}
.tab-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  border-radius: 16px;
  color: var(--ink-faint);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}
.tab-bar a.is-active { background: var(--accent-soft); color: var(--galaxy); font-weight: 700; }
body.has-tab-bar { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

/* ---------- Home (Estudo D) ---------- */
.home-grid { display: grid; gap: 16px; }
.home-card { background: var(--surface); border: 1px solid #e8e6ef; border-radius: 20px; padding: 22px 20px; }
.home-eyebrow { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #6b6880; }
.daily-card h2 { margin: 0 0 12px; font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; }
.daily-text { margin: 0; font-size: 15px; line-height: 1.6; color: #3d3a52; }
.daily-keywords { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; }
.daily-keywords li { padding: 6px 12px; border: 1px solid #d9d6e3; border-radius: 999px; font-size: 13px; font-weight: 500; color: #4f4c63; }
.daily-loading { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: #6b6880; font-size: 14px; }
.daily-loading p { margin: 0; }
.daily-card .reading-error { padding: 8px 0; text-align: left; }
.day-card { display: flex; gap: 18px; align-items: flex-start; padding: 20px; }
.day-card-image { flex: 0 0 auto; width: 84px; }
.day-card-image img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid #d9d6e3; }
.day-card-image img.is-reversed { transform: rotate(180deg); }
.day-card-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.day-card-text .home-eyebrow { margin: 0; font-size: 11px; line-height: 1.4; color: #6b6880; }
.day-card-text h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.day-card-text p { margin: 0; font-size: 14px; line-height: 1.55; color: #3d3a52; }
.text-link { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--galaxy); text-decoration: none; }
.home .sky-card { margin-top: 16px; }
.home-new-mobile { margin-top: 26px; }
.chart-new { display: none; }

.sky-card { padding: 20px; border-color: #e8e6ef; box-shadow: none; }
.sky-card-head { display: flex; gap: 16px; align-items: center; }
.sky-card-head p, .sky-card-head h2 { margin: 0; }
.moon-phase { flex: 0 0 auto; width: 64px; height: 64px; }
.moon-disc { fill: #f3f2f6; }
.moon-lit { fill: var(--cosmos); }
.moon-outline { fill: none; stroke: #d9d6e3; stroke-width: 1.5; }
.sky-card-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #6b6880; }
.sky-card h2 { font-size: 22px; letter-spacing: -0.02em; margin: 2px 0 !important; }
.sky-card-signs { font-size: 14px; color: #4f4c63; }
.planet-grid {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
  border-top: 1px solid #efeef3;
}
.planet-grid li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid #efeef3;
  font-size: 13px;
}
.planet-grid .glyph { width: 16px; font-size: 0.95rem; color: var(--ink); }
.planet-grid .planet-glyph { color: #6b6880; }
.planet-degree { font-variant-numeric: tabular-nums; }
.planet-in { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planet-retro { margin-left: auto; font-size: 11px; font-weight: 600; color: #6b6880; text-decoration: none; }
.sky-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-top: 14px; }
.sky-card-foot span { font-size: 12px; color: #6b6880; }
.sky-card-foot a { font-size: 14px; font-weight: 600; color: var(--galaxy); text-decoration: none; }

.action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid #e8e6ef;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s;
}
.action-card:hover { border-color: var(--synergy); }
.action-icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #d9d6e3;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--ink);
}
.action-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.action-title { font-size: 16px; font-weight: 600; }
.action-sub { font-size: 13px; color: #6b6880; }
.action-chevron { flex: 0 0 auto; color: #6b6880; }

.button-outline {
  align-self: flex-start;
  margin-top: 4px;
  padding: 9px 16px;
  border: 1px solid var(--cosmos);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--cosmos);
  text-decoration: none;
}
.button-outline:hover { background: var(--cosmos); color: var(--on-dark); }

.home-charts { margin-top: 28px; }
.section-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.section-row h2 { font-size: 20px; letter-spacing: -0.02em; }
.section-row a { font-size: 14px; font-weight: 600; text-decoration: none; color: var(--galaxy); }
.chart-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}
.chart-list li + li { border-top: 1px solid #efecf9; }
.chart-list a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--ink); text-decoration: none; }
.chart-list a:hover { background: var(--surface-tint); }
.chart-initial {
  display: inline-flex;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--synergy), var(--galaxy));
  color: #ffffff;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex: 0 0 auto;
}
.chart-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.chart-name { font-size: 16px; font-weight: 600; }
.chart-meta { font-size: 12px; color: var(--ink-faint); }
.chart-chevron { flex: 0 0 auto; color: var(--synergy); }

.page-head { margin: 8px 0 20px; }
.page-head h1 { font-size: clamp(1.9rem, 6vw, 2.4rem); }
.page-head .lede { margin: 8px 0 0; max-width: none; text-align: left; }
.charts-all { margin-top: 20px; }
.page-alert { max-width: 520px; margin: 0 auto 16px; }
.sky-table { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid #efeef3; }
.sky-table li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto 1.2em;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid #efeef3;
  font-size: 14px;
}
.sky-table .glyph { width: 1.4rem; display: inline-block; color: #6b6880; }
.sky-table-sign { color: var(--ink-soft); }
.sky-table .planet-degree { font-weight: 600; text-align: right; }

@media (min-width: 900px) {
  .main-nav { display: flex; }
  .tab-bar { display: none; }
  body.has-tab-bar { padding-bottom: 0; }
  .hero-dark { border-radius: 0 0 40px 40px; }
  .hero-dark-inner { padding-bottom: 56px; }
  .hero-date { margin-top: 64px; font-size: 13px; }
  .home-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .home-card { border-radius: 24px; padding: 32px; }
  .daily-card h2 { font-size: 30px; line-height: 1.15; margin-bottom: 14px; }
  .daily-text { max-width: 62ch; font-size: 17px; line-height: 1.65; }
  .daily-keywords { margin-top: 20px; }
  .daily-keywords li { padding: 7px 14px; font-size: 14px; }
  .day-card { gap: 24px; padding: 28px; }
  .day-card-image { width: 108px; }
  .day-card-text { gap: 8px; }
  .day-card-text h2 { font-size: 24px; }
  .day-card-text p { font-size: 15px; line-height: 1.6; }
  .home .sky-card { margin-top: 24px; }
  .home-new-mobile { display: none; }
  .chart-new { display: block; }
  .home-charts .chart-list li.chart-new { background: rgba(255, 255, 255, 0.6); border: 1px dashed #c9c5d8; }
  .chart-initial-new { background: var(--surface); border: 1px solid #d9d6e3; color: var(--ink); }
  .sky-card { padding: 28px; }
  .moon-phase { width: 80px; height: 80px; }
  .sky-card h2 { font-size: 28px; }
  .planet-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .planet-grid li { font-size: 14px; padding: 12px 0; }
  .home-charts { margin-top: 48px; }
  .home-charts .chart-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; background: none; border: 0; border-radius: 0; overflow: visible; }
  .home-charts .chart-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
  .home-charts .chart-list li + li { border-top: 1px solid var(--line); }
  .home-charts .chart-list a { padding: 18px 20px; }
}

/* ---------- Landing ---------- */
.hero {
  max-width: 560px;
  margin: 24px auto 28px;
  text-align: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 14px;
}
.hero h1 { font-size: clamp(2.1rem, 7vw, 3.1rem); }
.lede {
  color: var(--ink-soft);
  margin: 16px auto 0;
  max-width: 460px;
}

.form-card {
  max-width: 520px;
  margin: 0 auto;
  padding: 28px 20px;
}

/* ---------- Form ---------- */
form { margin: 0; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

.field { margin-bottom: 24px; }

label, legend {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: 8px;
  padding: 0;
}
.sub-label {
  font-weight: 500;
  color: var(--ink-soft);
  font-size: 0.78rem;
  margin-bottom: 6px;
}
.optional { color: var(--ink-faint); font-weight: 400; margin-left: 4px; }

input, select {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  font: inherit;
  font-size: 16px; /* prevents iOS zoom on focus */
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%238f8697' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
input::placeholder { color: #a9a3cf; }
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.row { display: flex; gap: 10px; align-items: center; }
.row-date select:first-of-type { flex: 0 0 26%; }
.row-date select:nth-of-type(2) { flex: 1 1 auto; }
.row-date input { flex: 0 0 30%; }
.row-time select { flex: 1; }
.time-sep { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink-faint); }

.stack { display: grid; gap: 14px; }

.hint { font-size: 0.78rem; color: var(--ink-faint); margin: 8px 0 0; line-height: 1.45; }

/* Phone: compact flag + dial code, native select stretched invisibly over it */
.phone-input { display: flex; gap: 10px; }
.phone-country {
  position: relative;
  flex: 0 0 auto;
  min-width: 108px;
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 32px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%238f8697' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center;
  white-space: nowrap;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.phone-country:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.phone-country-display { font-size: 16px; pointer-events: none; }
.phone-country select {
  position: absolute;
  inset: 0;
  opacity: 0;
  height: 100%;
  cursor: pointer;
}
.phone-input input { flex: 1; min-width: 0; }

/* City autocomplete dropdown */
.combobox { position: relative; }
.combobox-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.combobox-list { list-style: none; margin: 0; padding: 4px 0; max-height: 280px; overflow-y: auto; }
.combobox-list:empty { display: none; }
.combobox-option {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 10px 14px;
  cursor: pointer;
}
.combobox-option:hover, .combobox-option[aria-selected="true"] { background: var(--accent-soft); }
.combobox-main { font-size: 0.95rem; color: var(--ink); }
.combobox-secondary { font-size: 0.78rem; color: var(--ink-faint); }
.combobox-status { margin: 0; padding: 12px 14px; font-size: 0.82rem; color: var(--ink-soft); }
.combobox-status:empty { display: none; }
.combobox-attribution {
  margin: 0;
  padding: 6px 14px;
  border-top: 1px solid var(--line);
  text-align: right;
  font-size: 0.68rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

/* Errors */
.has-error input, .has-error select, .has-error .phone-country { border-color: var(--error); }
.field-error { color: var(--error); font-size: 0.8rem; margin: 6px 0 0; }
.alert {
  background: var(--error-soft);
  color: var(--error);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.88rem;
  margin-bottom: 22px;
}

/* Button */
.button-primary {
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 999px;
  background: var(--galaxy-gradient);
  color: var(--on-dark);
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: filter 0.2s, transform 0.1s;
  margin-top: 4px;
  box-shadow: 0 8px 24px rgba(66, 47, 155, 0.25);
}
.button-primary:hover { filter: brightness(1.08); }
.button-primary:active { transform: scale(0.99); }
.button-primary:disabled { cursor: progress; opacity: 0.85; }
.button-primary.is-loading .button-label::before {
  content: "✦ ";
  display: inline-block;
  animation: twinkle 1.2s ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: 0.25; } }

.privacy-note {
  text-align: center;
  font-size: 0.76rem;
  color: var(--ink-faint);
  margin: 14px 0 0;
}

@media (min-width: 600px) {
  .form-card { padding: 40px 44px; }
  .hero { margin-top: 40px; margin-bottom: 36px; }
}

/* ---------- Results ---------- */
.chart-header {
  text-align: center;
  max-width: 640px;
  margin: 16px auto 28px;
}
.chart-header h1 { font-size: clamp(2.6rem, 10vw, 3.8rem); }
.birth-line { margin: 14px 0 6px; color: var(--ink); font-size: 0.98rem; }
.birth-line .dot { color: var(--accent); margin: 0 4px; }
.birth-meta { margin: 0; color: var(--ink-faint); font-size: 0.8rem; line-height: 1.6; }
.notice {
  display: inline-block;
  margin: 14px 0 0;
  padding: 10px 14px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  text-align: left;
}

.big-three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 760px;
  margin: 0 auto 28px;
}
.big-three-card {
  background: url("../brand/texture-dark.jpg") center / cover, var(--galaxy);
  background-blend-mode: normal;
  color: var(--on-dark);
  border-radius: var(--radius);
  padding: 18px 10px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.big-three-card::after {
  /* faint orbit arc */
  content: "";
  position: absolute;
  width: 180%;
  aspect-ratio: 1;
  border: 1px solid rgba(246, 243, 255, 0.08);
  border-radius: 50%;
  left: -40%;
  top: 55%;
}
.big-three-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--pink);
}
.big-three-label .glyph { width: auto; margin-right: 2px; font-size: 0.8rem; letter-spacing: 0; color: inherit; }
.big-three-sign {
  margin: 10px 0 2px;
  font-family: var(--font-display);
  font-weight: 500;
  /* Space Grotesk is wide: "Sagitário" / "Capricórnio" must fit a third of a phone screen. */
  font-size: clamp(1.05rem, 4.6vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.big-three-sign .sign-glyph { display: block; font-size: 0.8em; color: var(--pink); margin-bottom: 4px; }
.big-three-house { display: block; margin-top: 2px; font-size: 0.72rem; opacity: 0.8; }
.big-three-degree { margin: 0; font-size: 0.78rem; color: rgba(246, 243, 255, 0.7); font-variant-numeric: tabular-nums; }

.section {
  max-width: 760px;
  margin: 0 auto 18px;
  padding: 24px 18px;
}
.section-head { margin-bottom: 16px; }
.section-head h2 { font-size: 1.7rem; }
.section-sub { margin: 4px 0 0; color: var(--ink-faint); font-size: 0.84rem; }

.glyph, .sign-glyph, .aspect-glyph {
  display: inline-block;
  font-family: "Apple Symbols", "Segoe UI Symbol", "Noto Sans Symbols", serif;
  color: var(--accent);
}
.glyph { width: 1.7rem; font-size: 1.05rem; line-height: 1; vertical-align: -0.05em; }
.glyph-text { font-family: var(--font-body); font-size: 0.66rem; vertical-align: 0.1em; font-weight: 600; letter-spacing: 0.04em; }
.sign-glyph { margin-right: 6px; }

/* Placements table */
.placements { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.placements th, .placements td { padding: 11px 4px; text-align: left; border-bottom: 1px solid var(--line); }
.placements thead th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  font-weight: 600;
  padding-top: 0;
}
.placements tbody th, .placements td { font-weight: 500; white-space: nowrap; }
.placements td { font-weight: 400; }
.placements tbody tr:last-child th, .placements tbody tr:last-child td { border-bottom: 0; }
.placements .num { text-align: right; font-variant-numeric: tabular-nums; }
.angle-row th, .angle-row td { background: var(--surface-tint); }
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  vertical-align: 0.1em;
}

/* Houses */
.houses {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.house {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.house-number {
  grid-row: span 2;
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--accent);
  width: 1.4em;
  text-align: center;
  font-variant-numeric: lining-nums;
}
.house-sign { font-size: 0.88rem; font-weight: 500; white-space: nowrap; }
.house-sign .sign-glyph { margin-right: 4px; }
.house-degree { font-size: 0.78rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* Aspects */
.aspects { list-style: none; margin: 0; padding: 0; }
.aspect {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.aspect:last-child { border-bottom: 0; }
.aspect-body:nth-of-type(3) { text-align: right; }
.aspect-type {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-align: center;
  min-width: 7.5em;
}
.aspect-glyph { margin-right: 4px; font-size: 0.95rem; }
.aspect-orb { font-size: 0.76rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; text-align: right; min-width: 5.2em; }
.empty { color: var(--ink-faint); margin: 0; }

/* Actions */
.chart-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 32px auto 8px;
}
.button-secondary {
  height: 48px;
  padding: 0 24px;
  border: 1px solid var(--night);
  border-radius: 999px;
  background: transparent;
  color: var(--night);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.button-secondary:hover { background: var(--night); color: var(--on-dark); }
.button-link { color: var(--accent-deep); font-size: 0.9rem; }
.chart-footnote { text-align: center; color: var(--ink-faint); font-size: 0.74rem; margin: 18px 0 0; }

/* Chart wheel */
.wheel-frame { max-width: 600px; margin: 0 auto; }
.chart-wheel { display: block; width: 100%; height: auto; }
.chart-wheel .wheel-body, .chart-wheel .wheel-aspect { cursor: default; }
.chart-wheel .wheel-aspect:hover line { stroke-width: 3; stroke-opacity: 1; }
.wheel-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin: 18px 0 0;
  padding: 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.wheel-legend li { display: flex; align-items: center; gap: 7px; }
.swatch { display: inline-block; width: 22px; height: 0; border-top: 2px solid; }
.swatch-hard { border-color: #d9467a; }
.swatch-trine { border-color: #4b63d1; }
.swatch-sextile { border-color: #4b63d1; border-top-style: dashed; }
.swatch-conjunction { width: auto; border: 0; height: auto; color: var(--accent); font-family: "Apple Symbols", "Segoe UI Symbol", serif; }
.wheel-hint { text-align: center; font-size: 0.74rem; color: var(--ink-faint); margin: 8px 0 0; }

/* Synastry */
.subheading {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin: 4px 0 12px;
}
.comparison-list { list-style: none; margin: 0 0 20px; padding: 0; }
.comparison-list a {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.comparison-list a:hover { color: var(--accent-deep); }
.synastry-cta .button-inline { margin-top: 4px; }
.synastry-people { margin-top: 14px; font-size: 0.86rem; color: var(--ink-soft); }
.synastry-people p { margin: 4px 0; }
.person-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.person-dot.person-a { background: var(--cosmos); }
.person-dot.person-b { background: #b146c2; }
.wheel-people { margin-top: 14px; font-weight: 500; color: var(--ink); }
.synastry-big-three { grid-template-columns: repeat(2, 1fr); }
.big-three-card.person-b { background: var(--violet); }
.synastry-trio { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 0; font-family: var(--font-display); font-size: 1.15rem; }
.synastry-trio .glyph { color: var(--pink); width: 1.6rem; }
.synastry-trio .glyph-text { font-size: 0.6rem; }
.aspect-owner { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; }
.person-a-text { color: var(--ink-faint); }
.person-b-text { color: #b146c2; }
.overlay-columns { display: grid; gap: 24px; }
.button-link-style { display: inline-flex; align-items: center; text-decoration: none; }

/* AI reading */
.reading { font-size: 0.98rem; line-height: 1.7; color: var(--ink); }
.reading p { margin: 0 0 14px; }
.reading-headline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.35rem, 5vw, 1.7rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--galaxy);
  margin: 0 0 20px !important;
}
.reading-heading {
  font-size: 1.35rem;
  margin: 32px 0 14px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.reading h4 {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: 0.01em;
}
.reading-big-three { display: grid; gap: 20px; }
.reading-placement p:last-child, .reading-theme p:last-child { margin-bottom: 0; }
.reading-theme { padding: 18px; margin-bottom: 12px; border-radius: var(--radius-sm); background: var(--surface-tint); }
.reading-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; }
.reading-tags li {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 500;
}
.reading-columns { display: grid; gap: 0 32px; }
.reading-list { margin: 0; padding: 0; list-style: none; }
.reading-list li { position: relative; padding: 0 0 10px 22px; }
.reading-list li::before { content: "✦"; position: absolute; left: 0; color: var(--accent); font-size: 0.7rem; top: 0.35em; }
.reading-closing {
  margin: 28px 0 0;
  padding: 20px 22px;
  border-left: 3px solid var(--pink);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.5;
}
.reading-closing p:last-child { margin-bottom: 0; }
.reading-disclaimer { margin: 18px 0 0 !important; font-size: 0.74rem; color: var(--ink-faint); line-height: 1.5; }
.reading-loading, .reading-error { text-align: center; padding: 28px 8px; color: var(--ink-soft); font-size: 0.92rem; }
.reading-loading p, .reading-error p { margin: 10px 0 0; }
.reading-error .button-secondary { margin-top: 16px; }
.reading-spinner {
  display: inline-block;
  font-size: 1.6rem;
  color: var(--accent);
  animation: spin-twinkle 2.4s ease-in-out infinite;
}
@keyframes spin-twinkle {
  0% { transform: rotate(0) scale(1); opacity: 1; }
  50% { transform: rotate(180deg) scale(0.75); opacity: 0.45; }
  100% { transform: rotate(360deg) scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .reading-spinner, .button-primary.is-loading .button-label::before { animation: none; }
}

/* Transits */
.transit-title { font-size: clamp(2rem, 7vw, 3rem); }
.transit-date-form { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.transit-date-form input[type="date"] { width: auto; min-width: 170px; }
.transit-date-form .button-secondary { height: 50px; }
.transit-aspect { grid-template-columns: 1fr auto 1fr auto; row-gap: 4px; }
.transit-timing {
  grid-column: 1 / -1;
  font-size: 0.74rem;
  color: var(--ink-faint);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.transit-phase { padding: 1px 8px; border-radius: 999px; font-weight: 600; letter-spacing: 0.03em; }
.transit-phase.is-applying { background: var(--accent-soft); color: var(--accent-deep); }
.transit-phase.is-separating { background: #f6e4fb; color: #b146c2; }
.section-footnote { font-size: 0.74rem; color: var(--ink-faint); margin: 14px 0 0; line-height: 1.5; }
.transit-link { margin-top: 16px; }
.transit-summary-heading { margin-top: 28px; }

/* Tarot */
.tarot-back {
  display: block;
  aspect-ratio: 381 / 640;
  border-radius: 10px;
  background:
    url("../brand/symbol-white.svg") center / 46% no-repeat,
    url("../brand/texture-dark.jpg") center / cover;
  box-shadow: inset 0 0 0 5px #14104b, inset 0 0 0 6px rgba(245, 179, 255, 0.6), 0 8px 24px rgba(20, 16, 75, 0.18);
  position: relative;
}


.tarot-entry {
  max-width: 520px;
  margin: 28px auto 0;
  padding: 28px 20px;
  display: grid;
  gap: 22px;
}
.tarot-entry h2 { font-size: 2rem; margin-bottom: 6px; }
.tarot-entry .eyebrow { margin-bottom: 8px; }
.tarot-entry .lede { margin: 0 0 18px; text-align: left; max-width: none; }
.tarot-fan { position: relative; height: 150px; display: flex; justify-content: center; }
.tarot-fan .tarot-back { position: absolute; width: 86px; top: 4px; transform-origin: 50% 110%; }
.tarot-fan .tarot-back:nth-child(1) { transform: rotate(-14deg) translateX(-26px); }
.tarot-fan .tarot-back:nth-child(2) { transform: rotate(0deg); z-index: 1; }
.tarot-fan .tarot-back:nth-child(3) { transform: rotate(14deg) translateX(26px); }
.tarot-form textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  resize: vertical;
  min-height: 64px;
  outline: none;
}
.tarot-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tarot-button { width: 100%; margin-top: 14px; }

.tarot-draw {
  max-width: 760px;
  margin: 8px auto 24px;
  display: grid;
  gap: 24px;
  justify-items: center;
  text-align: center;
}
.tarot-stage { perspective: 1200px; width: min(62vw, 240px); }
.tarot-flip {
  position: relative;
  aspect-ratio: 381 / 640;
  transform-style: preserve-3d;
  animation: tarot-reveal 1.1s 0.35s cubic-bezier(0.3, 0.7, 0.2, 1) both;
}
.tarot-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.tarot-face-back .tarot-back { height: 100%; }
.tarot-face-front { transform: rotateY(180deg); }
.tarot-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(20, 16, 75, 0.22);
}
.tarot-image.is-reversed { transform: rotate(180deg); }
@keyframes tarot-reveal {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(180deg); }
}
@media (prefers-reduced-motion: reduce) {
  .tarot-flip { animation: none; transform: rotateY(180deg); }
}
.tarot-info h1 { font-size: clamp(2.2rem, 8vw, 3rem); }
.tarot-meta { margin: 8px 0 0; color: var(--ink-faint); font-size: 0.86rem; display: flex; gap: 10px; justify-content: center; align-items: center; }
.tarot-orientation {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--night);
  color: var(--on-dark);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tarot-orientation.is-reversed { background: #b146c2; }
.tarot-keywords { justify-content: center; margin-top: 14px; }
.tarot-question {
  margin: 20px auto 0;
  max-width: 460px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}
.tarot-question .subheading { display: block; margin: 0 0 4px; }
.tarot-question p { margin: 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; color: var(--galaxy); }
.tarot-meaning { font-size: 1.02rem; line-height: 1.7; margin: 0; }
.tarot-no-question { text-align: center; color: var(--ink-faint); font-size: 0.86rem; max-width: 460px; margin: 8px auto 0; }
.reading-closing .subheading { display: block; font-family: var(--font-body); margin-bottom: 6px; }

@media (min-width: 760px) {
  .tarot-draw { grid-template-columns: 260px 1fr; text-align: left; justify-items: start; align-items: center; gap: 40px; }
  .tarot-stage { width: 260px; }
  .tarot-meta, .tarot-keywords { justify-content: flex-start; }
  .tarot-question { margin-left: 0; }
}
@media (min-width: 600px) {
  .tarot-entry { grid-template-columns: 190px 1fr; column-gap: 28px; padding: 36px 40px; align-items: start; }
  .tarot-fan { height: 190px; }
}

/* Error page */
.error-card { max-width: 520px; margin: 48px auto; padding: 40px 24px; text-align: center; }
.error-card h1 { font-size: 1.9rem; margin-bottom: 24px; }
.button-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-height: 54px;
  padding: 12px 28px;
  text-align: center;
  line-height: 1.3;
  text-decoration: none;
}

@media (max-width: 420px) {
  /* The wheel is drawn at 640 units and shown ~330px wide: enlarge its small labels. */
  .wheel-frame { margin: 0 -12px; }
  .chart-wheel .wheel-degree { font-size: 13px; }
  .chart-wheel .wheel-house { font-size: 14px; }
  .chart-wheel .wheel-axis { font-size: 15px; }
  .chart-wheel .wheel-glyph { font-size: 23px; }
  .big-three-label { letter-spacing: 0.06em; font-size: 0.6rem; }
  .aspect { grid-template-columns: 1fr auto 1fr; }
  .aspect-orb { grid-column: 1 / -1; text-align: center; margin-top: -4px; }
  .placements { font-size: 0.84rem; }
  .placements th, .placements td { padding-left: 2px; padding-right: 2px; }
  .placements .glyph { width: 1.4rem; }
  .house { padding: 10px 8px; column-gap: 8px; }
  .house-sign { font-size: 0.82rem; }
}

@media (min-width: 600px) {
  .big-three { gap: 16px; }
  .big-three-card { padding: 26px 16px 22px; }
  .section { padding: 32px 36px; }
  .houses { grid-template-columns: repeat(3, 1fr); }
  .reading-columns { grid-template-columns: 1fr 1fr; }
  .overlay-columns { grid-template-columns: 1fr 1fr; }
  .chart-actions { flex-direction: row; justify-content: center; gap: 24px; }
}

/* ---------- Avatar and profile sheet ---------- */
.avatar-button {
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--cosmos);
  color: var(--on-dark);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}
.avatar-button:hover { color: var(--on-dark); }
.hero-dark .avatar-button { background: var(--on-dark); color: var(--cosmos); box-shadow: 0 0 0 3px rgba(245, 179, 255, 0.45); }

body.sheet-page { background: var(--cosmos) url("../brand/texture-dark.jpg") center / cover fixed; padding-bottom: 0; }
body.sheet-page .sky, body.sheet-page .site-footer, body.sheet-page .tab-bar { display: none; }
body.sheet-page .page { padding: 0; max-width: none; display: flex; flex-direction: column; }
.sheet {
  flex: 1;
  margin-top: max(64px, calc(env(safe-area-inset-top) + 40px));
  padding: 10px max(20px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -12px 40px rgba(10, 8, 40, 0.25);
  display: flex;
  flex-direction: column;
}
.sheet-handle { align-self: center; width: 40px; height: 5px; border-radius: 999px; background: #d9d6e3; }
.sheet-bar { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.sheet-bar .icon-button:first-child { margin-left: -10px; }
.sheet-bar .sheet-title { flex: 1; }
.sheet-bar-actions { display: flex; gap: 4px; margin: 0 -10px 0 auto; }
.sheet-bar > .icon-button:last-child:not(:first-child) { margin-right: -10px; }
.icon-button {
  position: relative;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  border-radius: 50%;
}
.icon-button:hover { background: var(--surface-tint); color: var(--ink); }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--galaxy); flex: 0 0 auto; }
.icon-button .unread-dot { position: absolute; top: 10px; right: 11px; }
.sheet-title { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.sheet-bar-text { min-height: 44px; padding: 0 4px; border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 600; color: var(--galaxy); cursor: pointer; }
.sheet-sub { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: #6b6880; }
.sheet-eyebrow { margin: 26px 0 2px; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #6b6880; }
.sheet-empty { margin: 32px 0; text-align: center; color: #6b6880; font-size: 15px; }
.sheet-saved { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--galaxy); font-size: 14px; font-weight: 600; }

.sheet-list { list-style: none; margin: 0; padding: 0; }
.sheet-list li > a, .sheet-list li > button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #efeef3;
  background: transparent;
  font: inherit;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.sheet-list-label { flex: 1; font-size: 15px; font-weight: 500; }
.sheet-list-value { font-size: 14px; color: #6b6880; }
.sheet-list .chevron, .profile-chart .chevron { flex: 0 0 auto; color: #9a97ab; }

.profile-id { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.profile-avatar {
  position: relative;
  display: inline-flex;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--cosmos);
  color: var(--on-dark);
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
}
.profile-avatar:hover { color: var(--on-dark); }
.profile-avatar-edit {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid #d9d6e3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
.profile-id-text { min-width: 0; }
.profile-name { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.profile-big-three { margin: 4px 0 0; font-size: 14px; color: #4f4c63; }
.profile-chart {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 20px;
  background: #f6f5fa;
  border: 1px solid #e8e6ef;
  color: var(--ink);
  text-decoration: none;
}
.profile-chart:hover { border-color: var(--synergy); color: var(--ink); }
.profile-chart > svg:first-child { flex: 0 0 auto; }
.profile-chart-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.profile-chart-title { font-size: 16px; font-weight: 600; }
.profile-chart-sub { font-size: 13px; color: #6b6880; }
.sheet-text-link { align-self: flex-start; margin-top: 10px; padding: 4px 2px; font-size: 14px; font-weight: 600; color: var(--galaxy); text-decoration: none; }
.sheet-quiet-action {
  margin-top: auto;
  align-self: center;
  padding: 24px 20px 4px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #4f4c63;
  cursor: pointer;
}

.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list a { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid #efeef3; color: var(--ink); text-decoration: none; }
.notice-list .unread-dot { margin-top: 6px; }
.notice-icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: #f3f2f6;
  color: #4f4c63;
  font-size: 17px;
}
.notice-icon.is-unread { background: var(--surface); border: 1px solid #d9d6e3; color: var(--ink); }
.notice-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.notice-head { display: flex; justify-content: space-between; gap: 8px; }
.notice-title { font-size: 15px; font-weight: 600; }
.notice-time { flex: 0 0 auto; font-size: 12px; color: #6b6880; }
.notice-body { font-size: 14px; line-height: 1.45; color: #4f4c63; }

.switch-row { display: flex; align-items: center; gap: 14px; min-height: 58px; border-bottom: 1px solid #efeef3; cursor: pointer; }
.switch-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.switch-hint { font-size: 12px; color: #6b6880; }
input.switch {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 46px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d9d6e3;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
input.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(20, 16, 75, 0.25);
  transition: left 0.15s;
}
input.switch:checked { background: var(--cosmos); }
input.switch:checked::after { left: 21px; }
input.switch:focus-visible { outline: 2px solid var(--galaxy); outline-offset: 2px; }
.switch-note { margin: 10px 0 0; font-size: 12px; line-height: 1.45; color: #6b6880; }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 24px; }
.danger-link { min-height: 44px; padding: 0; border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 600; color: #a3264a; cursor: pointer; }
.sheet-version { font-size: 12px; color: #6b6880; }

.sheet-form { display: flex; flex-direction: column; gap: 18px; margin-top: 22px; }
.sheet-form .button-primary { margin-top: 8px; }
.sheet .alert { margin-top: 16px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  margin: 0;
  padding: 12px 18px;
  max-width: calc(100% - 32px);
  border-radius: 999px;
  background: var(--cosmos);
  color: var(--on-dark);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(20, 16, 75, 0.25);
}

@media (min-width: 900px) {
  .sheet { flex: 0 1 auto; width: 100%; max-width: 480px; margin: 72px auto 72px; border-radius: 28px; min-height: 640px; }
}
.profile-big-three .glyph { display: inline; width: auto; margin: 0; }
.sheet-form .field { margin: 0; }

/* ---------- Sign-in pages ---------- */
.auth-hero .hero-dark-inner { padding-bottom: 56px; }
.auth-hero-text { padding: 40px 20px 0; max-width: 560px; }
.auth-eyebrow { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--pink); }
.auth-hero-text h1 { margin: 0; font-size: clamp(2rem, 8vw, 2.6rem); line-height: 1.05; letter-spacing: -0.035em; color: var(--on-dark); }
.auth-hero-text p:last-child { margin: 14px 0 0; font-size: 15px; line-height: 1.55; color: rgba(246, 243, 255, 0.82); }
.auth-card { max-width: 460px; margin: -32px auto 0; position: relative; padding: 24px 20px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 20px; background: var(--bg-deep); border-radius: 999px; }
.auth-tabs a { display: flex; align-items: center; justify-content: center; height: 40px; border-radius: 999px; color: var(--ink-soft); font-size: 14px; font-weight: 600; text-decoration: none; }
.auth-tabs a.is-active { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 2px 8px rgba(20, 16, 75, 0.12); }
.auth-title { margin: 0 0 12px; font-size: 22px; letter-spacing: -0.02em; }
.auth-text { margin: 0 0 18px; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.auth-form .field { margin-bottom: 18px; }
.auth-link { display: block; margin-top: 16px; text-align: center; font-size: 14px; font-weight: 600; color: var(--galaxy); text-decoration: none; }
.auth-card .alert, .auth-card .sheet-saved { margin: 0 0 16px; }
body.auth-page .site-footer { padding-top: 40px; }
@media (min-width: 900px) {
  .auth-hero-text { padding: 56px 0 0; }
  .auth-card { margin-top: -48px; padding: 32px; }
}

.button-quiet { width: 100%; height: 48px; margin-top: 4px; border: 0; background: transparent; font: inherit; font-size: 15px; font-weight: 600; color: #4f4c63; cursor: pointer; }
.button-danger { width: 100%; height: 54px; border: 0; border-radius: 999px; background: #a3264a; color: #ffffff; font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; }
.button-danger:hover { filter: brightness(1.08); }
.sheet-list-static { display: flex; align-items: center; gap: 14px; min-height: 54px; border-bottom: 1px solid #efeef3; }
.sheet-quiet-form { margin-top: auto; display: flex; justify-content: center; }
.daily-cta-button { display: inline-flex; align-items: center; justify-content: center; width: auto; padding: 0 24px; margin-top: 18px; text-decoration: none; height: 50px; }
.daily-cta-button:hover { color: var(--on-dark); }

/* Password field with show/hide eye button (static/js/password.js) */
.password-field { position: relative; }
.password-field input { padding-right: 52px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6b6880;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.password-toggle:hover { color: var(--ink); }
.password-toggle:focus-visible { outline: 2px solid var(--galaxy); outline-offset: -2px; }

/* "Your day today": today's transit wheel around the person's chart */
.daily-wheel { margin-top: 22px; padding-top: 20px; border-top: 1px solid #efeef3; display: flex; flex-direction: column; align-items: center; }
.daily-wheel .home-eyebrow { align-self: flex-start; }
.daily-wheel-frame { display: block; width: 100%; max-width: 440px; margin: 4px auto 0; }
.daily-wheel .wheel-people { margin-top: 10px; }
.daily-wheel .text-link { margin-top: 10px; }

/* Home top (Topo B): light header, big date, Moon and Sun line */
body.home .site-header { max-width: 1200px; }
.home-date { margin: 6px 4px 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.home-date-weekday { margin: 0; font-size: 13px; font-weight: 600; color: #6b6880; }
.home-date-day { margin: 2px 0 0; font-size: 40px; line-height: 1; font-weight: 600; letter-spacing: -0.04em; }
.home-date-sky { margin: 12px 0 0; font-size: 14px; color: #4f4c63; }
.home-date-sky .glyph { width: auto; font-size: 1em; color: inherit; }
@media (min-width: 900px) {
  .home-date { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin: 12px 0 32px; padding-bottom: 28px; }
  .home-date-weekday { font-size: 15px; }
  .home-date-day { margin-top: 4px; font-size: 64px; letter-spacing: -0.045em; }
  .home-date-sky { margin: 0 0 8px; font-size: 16px; }
}

/* Profile sheets: the light home header, dimmed behind the sheet */
body.sheet-page { background: linear-gradient(rgba(10, 8, 40, 0.55), rgba(10, 8, 40, 0.55)), var(--bg) url("../brand/texture-light.jpg") center top / cover fixed; }

/* ---------- Ask Safar (chat) ---------- */
.ask-card { margin-bottom: 16px; padding: 20px; }
.ask-card .home-eyebrow { display: block; margin-bottom: 12px; }
.ask-field { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 6px 6px 16px; border-radius: 26px; background: #f4f2fa; border: 1px solid #e8e6ef; }
.ask-field:focus-within { border-color: var(--synergy); }
.ask-field input { flex: 1; min-width: 0; height: 40px; padding: 0; border: 0; background: transparent; font-size: 16px; box-shadow: none; }
.ask-field input:focus { outline: none; box-shadow: none; }
.ask-continue { display: inline-block; margin-top: 12px; }
.chat-send {
  flex: 0 0 auto; width: 40px; height: 40px; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--cosmos); color: var(--on-dark); cursor: pointer;
}
.chat-send:disabled { opacity: 0.5; cursor: default; }
@media (min-width: 900px) { .ask-card { margin-bottom: 24px; padding: 24px 32px; } }

body.chat-page { background: #fbfaff; }
body.chat-page .sky, body.chat-page .site-footer, body.chat-page .tab-bar { display: none; }
body.chat-page.has-tab-bar { padding-bottom: 0; }
body.chat-page .page { max-width: none; padding: 0; }
.chat-shell { display: flex; min-height: 100vh; }
.chat-main { flex: 1; min-width: 0; }
.chat-header {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 2px;
  padding: max(8px, env(safe-area-inset-top)) 4px 8px 8px; background: rgba(251, 250, 255, 0.94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.chat-title { flex: 1; min-width: 0; margin: 0 0 0 44px; text-align: center; font-size: 16px; font-weight: 600; letter-spacing: 0; }
.chat-title-conversation { display: none; }
.chat { max-width: 760px; margin: 0 auto; padding: 0 20px; min-height: calc(100vh - 64px); display: flex; flex-direction: column; }

/* Conversation history: drawer on phones, sidebar on wide screens */
.chat-history {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: min(318px, 86vw); box-sizing: border-box;
  display: flex; flex-direction: column; padding: max(14px, env(safe-area-inset-top)) 12px max(20px, env(safe-area-inset-bottom));
  background: var(--surface); box-shadow: 12px 0 40px rgba(10, 8, 40, 0.18);
  transform: translateX(-105%); transition: transform 0.2s ease; visibility: hidden;
}
body.history-open .chat-history { transform: none; visibility: visible; }
.chat-history-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(10, 8, 40, 0.45); }
.chat-history-head { display: flex; align-items: center; justify-content: space-between; padding-left: 8px; }
.chat-history-brand, .chat-history-home { display: none; }
.chat-history-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; }
.chat-history-new { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 8px; padding: 0 12px; border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; }
.chat-history-new:hover { background: #f4f2fa; color: var(--ink); }
.chat-history-search { position: relative; margin-top: 10px; }
.chat-history-search svg { position: absolute; left: 14px; top: 14px; color: #6b6880; }
.chat-history-search input { height: 44px; padding: 0 14px 0 40px; border: 0; border-radius: 12px; background: #f4f2fa; font-size: 15px; box-shadow: none; }
.chat-history-list { flex: 1; overflow-y: auto; margin: 4px -4px 0; padding: 0 4px; }
.chat-history-group { margin: 18px 0 4px; padding: 0 12px; font-size: 12px; font-weight: 600; color: #6b6880; }
.chat-history-item { display: block; padding: 11px 12px; border-radius: 12px; font-size: 15px; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-history-item:hover { background: #f4f2fa; color: var(--ink); }
.chat-history-item.is-current { background: #ece8fb; font-weight: 600; }
.chat-history-empty { margin: 24px 12px; font-size: 14px; color: #6b6880; }
.chat-history-me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid #efeef3; color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; }
.chat-history-me .avatar-button { width: 36px; height: 36px; font-size: 15px; }
@media (min-width: 900px) {
  .chat-history {
    position: sticky; height: 100vh; width: 288px; flex: 0 0 auto; transform: none; visibility: visible; transition: none;
    padding: 16px 12px 18px; background: #f4f2fa; border-right: 1px solid #e8e6ef; box-shadow: none;
  }
  .chat-history-backdrop, .chat-history-title, .chat-history-close { display: none !important; }
  .chat-history-head { padding: 4px 8px 12px; }
  .chat-history-brand, .chat-history-home { display: block; }
  .chat-history-home { font-size: 13px; font-weight: 600; color: var(--galaxy); text-decoration: none; }
  .chat-history-new { margin-top: 0; background: var(--surface); border: 1px solid #e8e6ef; }
  .chat-history-search input { background: transparent; }
  .chat-history-item { padding: 10px 12px; font-size: 14px; }
  .chat-history-item:hover { background: #efedf7; }
  .chat-history-item.is-current { background: #e6e2f6; }
  .chat-header { padding: 18px 28px; }
  .chat-back, .chat-history-open, .chat-new-button, .chat-title-app { display: none; }
  .chat-title { margin: 0; text-align: left; font-size: 15px; }
  .chat-title-conversation { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chat { padding: 0 24px; }
}
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 22px; padding: 12px 0 24px; }
.chat-empty { margin: auto 0; padding: 40px 12px; text-align: center; color: #6b6880; }
.chat-empty p { margin: 14px auto 0; max-width: 32ch; font-size: 15px; line-height: 1.5; }
.chat-msg { max-width: 100%; }
.chat-user { align-self: flex-end; max-width: 80%; padding: 10px 16px; border-radius: 20px; background: #efeef3; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-ai { display: flex; flex-direction: column; gap: 12px; }
.chat-ai p { margin: 0; font-size: 16px; line-height: 1.6; color: #1f1c33; white-space: pre-line; }
.chat-error p { color: var(--error); }
.chat-figure { margin: 4px 0; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid #e8e6ef; }
.chat-wheel { max-width: 420px; margin: 0 auto; }
.chat-figure figcaption, .chat-tarot figcaption { margin-top: 8px; font-size: 13px; color: #6b6880; text-align: center; }
.chat-figure .wheel-people { margin-top: 8px; }
.chat-tarot { margin: 4px 0; display: flex; flex-direction: column; align-items: flex-start; }
.chat-tarot img { width: 120px; height: auto; border-radius: 8px; border: 1px solid #d9d6e3; }
.chat-tarot img.is-reversed { transform: rotate(180deg); }
.chat-actions { display: flex; gap: 2px; margin-left: -8px; }
.chat-action { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: #6b6880; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.chat-action:hover { background: #efeef3; color: var(--ink); }
.chat-typing { flex-direction: row; gap: 6px; padding: 10px 0; }
.chat-typing span { width: 8px; height: 8px; border-radius: 50%; background: #c9c5d8; animation: chat-dot 1.2s infinite ease-in-out; }
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .chat-typing span { animation: none; } }
.chat-composer {
  position: sticky; bottom: 0; display: flex; align-items: flex-end; gap: 8px; margin-top: 8px;
  padding: 8px 8px 8px 18px; border-radius: 26px; background: var(--surface); border: 1px solid #d9d6e3;
  box-shadow: 0 -8px 24px rgba(251, 250, 255, 0.9);
}
.chat-composer textarea {
  flex: 1; min-width: 0; height: 40px; max-height: 160px; padding: 9px 0; border: 0; background: transparent;
  font: inherit; font-size: 16px; line-height: 1.4; color: var(--ink); resize: none; box-shadow: none;
}
.chat-composer textarea:focus { outline: none; box-shadow: none; }
.chat-note { margin: 8px 0 max(16px, env(safe-area-inset-bottom)); text-align: center; font-size: 11px; color: #6b6880; }

/* ---------- Privacy Policy and Terms of Use ---------- */
.footer-legal { margin-top: 8px !important; }
.footer-legal a { color: var(--ink-faint); }
.legal-consent a { color: inherit; text-decoration: underline; }
.legal { max-width: 760px; margin: 0 auto; padding: 28px 24px 36px; line-height: 1.6; }
.legal h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 6px; }
.legal-updated { color: var(--ink-faint); font-size: 0.85rem; margin: 0 0 24px; }
.legal h2 { font-size: 1.08rem; margin: 28px 0 8px; }
.legal h3 { font-size: 0.95rem; margin: 18px 0 4px; }
.legal p, .legal li { font-size: 0.95rem; color: var(--ink-soft); }
.legal p { margin: 0 0 10px; }
.legal ul { margin: 0 0 12px; padding-left: 20px; }
.legal li { margin-bottom: 4px; }
.legal a { color: var(--galaxy); overflow-wrap: anywhere; }
