/* Signed-in pages start hidden until js/core/require-session.js confirms the session. */
html[data-auth-pending] body { visibility: hidden; }

:root {
      color-scheme: light;
      --ink: #252523;
      --muted: #827f77;
      --paper: #f4f0e9;
      --white: #fffefa;
      --yellow: #f5d653;
      --yellow-deep: #e5bf39;
      --line: #e9e4dc;
      --green: #6c9b78;
      --blue: #7491bd;
      --rose: #ce7b78;
      --shadow: 0 18px 50px rgb(44 39 28 / 8%);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-synthesis: none;
      text-rendering: optimizeLegibility;
    }

    * { box-sizing: border-box; }
    [hidden] { display: none !important; }
    html { scroll-behavior: smooth; scroll-padding-top: 28px; }
    body {
      min-width: 320px;
      margin: 0;
      background: var(--paper);
      color: var(--ink);
    }
    button, input { font: inherit; }
    button, a { -webkit-tap-highlight-color: transparent; }
    a { color: inherit; text-decoration: none; }

    .page-shell {
      width: min(100% - 40px, 1140px);
      margin: 28px auto 48px;
    }
    .topbar-label, .eyebrow, .tiny-label {
      font-size: 10px;
      font-weight: 800;
      letter-spacing: .12em;
      text-transform: uppercase;
    }
    .eyebrow-icon { font-size: 17px; }
    .privacy-note { display: flex; align-items: center; gap: 7px; margin-top: 12px; color: var(--gold-ink); font-size: 10.5px; }
    /* Page header: css/header.css. Chart controls (Saved / Search / New chart): css/chart-controls.css.
       Login, Sign up, Profile, Account, Subscriptions: css/account-pages.css. Plans and checkout: css/billing.css. */
    h1 {
      max-width: none;
      margin: 11px 0 8px;
      font-size: clamp(32px, 3.2vw, 44px);
      line-height: .98;
      letter-spacing: -.075em;
    }
    .bottom-nav a:focus-visible, summary:focus-visible {
      outline: 2px solid var(--gold-ink);
      outline-offset: 3px;
    }
    .section-heading {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      margin: 42px 8px 16px;
    }
    .section-heading h2 {
      margin: 0;
      font-size: 13px;
      font-weight: 850;
      letter-spacing: .13em;
      text-transform: uppercase;
    }
    @keyframes person-action-spin { to { transform: rotate(360deg); } }

    /* Blocking wait spinner (js/ui/feedback.js) */
    .busy-overlay {
      position: fixed;
      z-index: 60;
      inset: 0;
      display: grid;
      place-items: center;
      padding: 16px;
      background: rgb(244 240 233 / 62%);
      backdrop-filter: blur(2px);
      animation: feedback-fade .18s ease-out;
    }
    .busy-overlay[hidden] { display: none; }
    .busy-card {
      position: relative;
      display: flex;
      overflow: hidden;
      align-items: center;
      gap: 13px;
      max-width: min(380px, 100%);
      padding: 15px 20px 15px 15px;
      border: 1px solid var(--surface-dark-border);
      border-radius: 18px;
      background: var(--surface-dark-bg);
      box-shadow: 0 22px 50px -10px rgb(37 37 35 / 50%);
      color: var(--white);
      font-size: 12px;
      font-weight: 700;
      line-height: 1.45;
    }
    .busy-card::before { position: absolute; inset: 0 16px auto; height: 2px; border-radius: 0 0 2px 2px; background: var(--gold-edge); content: ""; }
    .busy-spinner {
      display: grid;
      width: 38px;
      height: 38px;
      flex: 0 0 38px;
      place-items: center;
      border-radius: 50%;
      background: var(--gold-coin);
      box-shadow: inset 0 0 0 1px rgb(255 255 255 / 55%), 0 3px 10px rgb(0 0 0 / 35%);
    }
    .busy-spinner span {
      width: 20px;
      height: 20px;
      border: 2.5px solid rgb(37 37 35 / 22%);
      border-top-color: var(--ink);
      border-radius: 50%;
      animation: person-action-spin .8s linear infinite;
    }

    /* Toasts (js/ui/feedback.js) */
    .toast-host {
      position: fixed;
      z-index: 70;
      top: 16px;
      left: 50%;
      display: grid;
      gap: 8px;
      width: min(420px, calc(100% - 32px));
      transform: translateX(-50%);
      pointer-events: none;
    }
    /* Every toast (create, re-process, delete) is brand yellow; only errors are dark. */
    .toast {
      display: flex;
      align-items: center;
      gap: 11px;
      padding: 10px 10px 10px 11px;
      border: 1px solid var(--yellow-deep);
      border-radius: 16px;
      background: linear-gradient(180deg, #fae58a, var(--yellow) 60%, #efcb45);
      color: var(--ink);
      box-shadow: inset 0 1px 0 rgb(255 255 255 / 55%), 0 14px 34px -6px rgb(160 120 20 / 45%);
      font-size: 12px;
      font-weight: 700;
      pointer-events: auto;
      animation: toast-in .22s ease-out;
    }
    .toast > span:nth-child(2) { flex: 1; line-height: 1.4; }
    .toast-icon {
      display: grid;
      width: 26px;
      height: 26px;
      flex: 0 0 26px;
      place-items: center;
      border-radius: 50%;
      background: var(--ink);
      color: var(--yellow);
      font-size: 12px;
      font-weight: 900;
    }
    .toast-close {
      width: 28px;
      height: 28px;
      border: 0;
      border-radius: 50%;
      background: transparent;
      color: #54470f;
      cursor: pointer;
      font-size: 16px;
      line-height: 1;
    }
    .toast-close:hover { background: rgb(37 37 35 / 12%); color: var(--ink); }
    .toast-close:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
    .toast-error {
      border-color: #6b3d38;
      background: radial-gradient(70% 150% at 100% 0%, rgb(206 123 120 / 26%), transparent 60%), linear-gradient(135deg, #2b2a26 0%, #252523 60%, #352523 100%);
      color: var(--white);
      box-shadow: 0 16px 36px -8px rgb(37 37 35 / 55%);
    }
    .toast-error .toast-icon { background: #ce7b78; color: #2b1715; }
    .toast-error .toast-close { color: #d9d3c2; }
    .toast-error .toast-close:hover { background: rgb(255 255 255 / 12%); color: var(--white); }
    .toast-error .toast-close:focus-visible { outline-color: var(--yellow); }
    .toast.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .2s; }
    @keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
    @keyframes feedback-fade { from { opacity: 0; } }
    @media (prefers-reduced-motion: reduce) {
      .busy-overlay, .toast { animation: none; }
      .busy-spinner span { animation-duration: 2.4s; }
    }
    .count-pill {
      padding: 4px 7px;
      border: 1px solid #e3ddd2;
      border-radius: 7px;
      color: #766f61;
      font-size: 10px;
      font-weight: 750;
    }
    /* Reading section (tabs and panels): css/reading.css; shared card/header look: css/surfaces.css. */

    .detail-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
      margin-top: 15px;
    }
    .detail-item {
      padding: 13px;
      border-radius: 12px;
      background: #f7f4ee;
    }
    .detail-item span { display: block; margin-bottom: 7px; color: #89847b; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
    .detail-item strong { font-size: 12px; }
    /* Home / reading bar (birth chart page; fixed at the bottom on phones): gold frame, coin for the current one. */
    .bottom-nav {
      display: flex;
      width: fit-content;
      align-items: center;
      gap: 6px;
      margin: 28px auto 0;
      padding: 6px;
      border: 1px solid var(--gold-border);
      border-radius: 999px;
      background: linear-gradient(160deg, rgb(255 254 250 / 95%), rgb(248 241 223 / 95%));
      box-shadow: inset 0 1px 0 rgb(255 255 255 / 90%), 0 10px 26px -8px rgb(120 95 20 / 40%);
      backdrop-filter: blur(12px);
    }
    .bottom-nav a {
      display: grid;
      min-width: 50px;
      min-height: 42px;
      place-items: center;
      border: 1px solid transparent;
      border-radius: 999px;
      color: var(--gold-ink);
      font-size: 18px;
      transition: background .18s, border-color .18s, color .18s;
    }
    .bottom-nav a:hover { border-color: var(--gold-line); background: var(--gold-100); color: var(--ink); }
    .bottom-nav a.active { border: 2px solid var(--yellow); background: #252523; box-shadow: 0 6px 14px -6px rgb(37 37 35 / 60%); color: var(--yellow); }
    .bottom-nav a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
    @media (max-width: 780px) {
      .page-shell { width: min(100% - 24px, 560px); margin: 12px auto 106px; }
      .section-heading { margin: 30px 6px 13px; }
      .section-heading { align-items: flex-start; flex-wrap: wrap; }
      .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .bottom-nav {
        position: fixed;
        z-index: 10;
        right: 50%;
        bottom: max(12px, env(safe-area-inset-bottom));
        justify-content: space-around;
        width: min(100% - 28px, 390px);
        margin: 0;
        padding: 7px;
        transform: translateX(50%);
      }
      .bottom-nav a { flex: 1; min-height: 44px; }
    }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
    }
