/* Surfaces: the app's shared ivory-and-gold look, defined once.
   Each look below is applied to (a) its reusable surface-* class, for new markup, and (b) the existing
   component classes that use it. Listing the component classes here means the look never depends on
   the markup carrying the surface-* class (e.g. a browser still running older cached scripts).
   To give another component a look, add its class to that look's selector lists below.
   The looks only set background, border, shadow, accents and hover. Layout, padding and size stay
   with each component's own rules (css/reading.css etc.), which load later and can override.
   Selectors are plain comma lists (not :is()) so each keeps its own, low specificity.
   Load after styles.css (base tokens such as --ink, --yellow) and before page/component CSS. */

:root {
  /* Gold scale used across surfaces */
  --gold-50: #fffbef;
  --gold-100: #fbf2d2;
  --gold-200: #f7ebb8;
  --gold-line: #efe3bc;          /* hairlines and dividers */
  --gold-border: #ebe2cc;        /* card borders */
  --gold-border-strong: #e1d09b; /* hover and emphasis borders */
  --gold-pill-border: #e6d79f;
  --gold-label: #9a8433;         /* small uppercase labels */
  --gold-ink: #7a6726;           /* gold text and icons on light backgrounds */

  /* Gold accents */
  --gold-edge: linear-gradient(90deg, transparent, var(--yellow-deep), var(--yellow), var(--yellow-deep), transparent);
  --gold-bar: linear-gradient(180deg, var(--yellow), var(--yellow-deep));
  --gold-coin: radial-gradient(circle at 35% 30%, #fff3b8, var(--yellow) 45%, var(--yellow-deep));

  /* Backgrounds */
  --surface-card-bg:
    radial-gradient(120% 70% at 100% 0%, rgb(245 214 83 / 18%), transparent 55%),
    radial-gradient(90% 60% at 0% 100%, rgb(116 145 189 / 7%), transparent 60%),
    linear-gradient(160deg, #fffefa 0%, #fbf7ee 55%, #f6f0e2 100%);
  --surface-header-bg:
    radial-gradient(60% 140% at 100% 0%, rgb(245 214 83 / 24%), transparent 60%),
    linear-gradient(100deg, #fbf2d2 0%, #fffaf0 45%, #f8f1df 100%);
  --surface-dark-border: #3d3a2e;
  --surface-dark-bg:
    radial-gradient(70% 150% at 100% 0%, rgb(245 214 83 / 28%), transparent 60%),
    linear-gradient(135deg, #2b2a26 0%, #252523 60%, #34301f 100%);
  --surface-paper-bg: linear-gradient(180deg, #fffefa 0%, #fffbef 100%);

  /* Shadows */
  --surface-raise: inset 0 1px 0 rgb(255 255 255 / 90%), 0 1px 2px rgb(37 37 35 / 4%), 0 8px 18px -12px rgb(120 95 20 / 30%);
  --surface-raise-hover: inset 0 1px 0 rgb(255 255 255 / 90%), 0 2px 4px rgb(37 37 35 / 5%), 0 14px 26px -14px rgb(120 95 20 / 38%);
  --surface-paper-shadow: 0 1px 2px rgb(37 37 35 / 4%), 0 6px 12px -8px rgb(120 95 20 / 28%);
  --surface-panel-shadow: 0 8px 25px rgb(50 42 28 / 4%);
}

/* Panel: the plain white container that holds a whole tab's content. ------------------------- */
.surface-panel,
.yogas-panel,
.transits-panel,
.saved-list-panel,
.saved-charts-panel,
.intro,
.auth-layout {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--surface-panel-shadow);
}

/* Card: warm ivory, soft gold glow, fine gold top edge, layered shadow; lifts on hover. ---------
   Static cards (not things to pick, e.g. the stats strip) don't lift: surface-card--static. */
.surface-card,
.quick-stats,
.overview-life-area,
.chart-visualization,
.yoga-example-card,
.transit-current-card,
.transit-event,
.summary-tabs,
.chart-source-switch,
.saved-list-pager,
.saved-person-card,
.saved-search-card,
.entry-card,
.auth-card,
.account-card,
.overview-area-filter .transit-period-toggle {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  background: var(--surface-card-bg);
  box-shadow: var(--surface-raise);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.surface-card::before,
.quick-stats::before,
.overview-life-area::before,
.chart-visualization::before,
.yoga-example-card::before,
.transit-current-card::before,
.transit-event::before,
.summary-tabs::before,
.chart-source-switch::before,
.saved-list-pager::before,
.saved-person-card::before,
.saved-search-card::before,
.entry-card::before,
.auth-card::before,
.account-card::before,
.overview-area-filter .transit-period-toggle::before {
  position: absolute;
  inset: 0 14px auto;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--gold-edge);
  content: "";
  opacity: .75;
  pointer-events: none;
}
.surface-card:not(.surface-card--static):not(.quick-stats):hover,
.overview-life-area:hover,
.chart-visualization:hover,
.yoga-example-card:hover,
.transit-current-card:hover,
.transit-event:hover,
.saved-person-card:hover {
  border-color: var(--gold-border-strong);
  box-shadow: var(--surface-raise-hover);
  transform: translateY(-1px);
}

/* Header bar: a title with a gold bar down the left edge. --------------------------------------
   Inside: an optional coin, the heading (takes the free space) and an optional badge.
   On a <summary> or <button> it also shows it can be clicked. */
.surface-header,
.yoga-category-heading,
.overview-life-area-title,
.transits-section-heading,
.chart-visualization-title,
.account-card-heading {
  position: relative;
  display: flex;
  min-height: 42px;
  overflow: hidden;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 10px;
  border: 1px solid #ebdfb8;
  border-radius: 12px;
  background: var(--surface-header-bg);
  box-shadow: var(--surface-raise);
  color: var(--ink);
  list-style: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.surface-header::before,
.yoga-category-heading::before,
.overview-life-area-title::before,
.transits-section-heading::before,
.chart-visualization-title::before,
.account-card-heading::before {
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold-bar);
  content: "";
}
.surface-header::-webkit-details-marker,
.yoga-category-heading::-webkit-details-marker { display: none; }
.surface-header :where(h2, h3, h4, h5),
.yoga-category-heading :where(h2, h3, h4, h5),
.overview-life-area-title :where(h2, h3, h4, h5),
.transits-section-heading :where(h2, h3, h4, h5),
.chart-visualization-title :where(h2, h3, h4, h5),
.account-card-heading :where(h2, h3, h4, h5) { flex: 1; min-width: 0; margin: 0; color: var(--ink); font-size: 11.5px; letter-spacing: -.02em; }
summary.surface-header,
button.surface-header,
.yoga-category-heading { cursor: pointer; }
summary.surface-header:hover,
button.surface-header:hover,
.yoga-category-heading:hover { border-color: var(--gold-border-strong); box-shadow: var(--surface-raise-hover); }
summary.surface-header:focus-visible,
button.surface-header:focus-visible,
.yoga-category-heading:focus-visible { outline: 2px solid var(--yellow-deep); outline-offset: 2px; }

/* Coin: a small shiny gold disc for an icon, symbol or number. surface-coin--lg is larger. ----- */
.surface-coin,
.yoga-category-icon,
.overview-life-area-number,
.transit-planet-mark,
.chart-source-icon,
.saved-person-avatar,
.transits-period-icon {
  display: inline-grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-coin);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 55%), 0 2px 5px -1px rgb(160 120 20 / 45%);
  color: var(--ink);
  font-size: 11px;
  line-height: 1;
}
.surface-header .surface-coin,
.yoga-category-icon,
.overview-life-area-number { margin-left: 4px; }
.surface-coin--lg,
.transits-period-icon { width: 38px; height: 38px; flex-basis: 38px; font-size: 18px; }

/* Badge: a small outlined pill for a count or short status; hidden while empty. ---------------- */
.surface-badge,
.yoga-category-count,
.saved-list-count,
.private-pill,
.transits-section-heading > span[id] {
  padding: 2px 8px;
  border: 1px solid var(--gold-pill-border);
  border-radius: 999px;
  background: rgb(255 254 250 / 80%);
  color: var(--gold-ink);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}
.surface-badge:empty,
.transits-section-heading > span[id]:empty { display: none; }

/* Paper: a lighter framed panel sitting on a card, with a gold accent down the left edge. ------ */
.surface-paper,
.yoga-results,
.auth-signup-prompt,
.account-details,
.plan-status {
  border: 1px solid var(--gold-line);
  border-left: 2px solid var(--yellow-deep);
  border-radius: 0 8px 8px 0;
  background: var(--surface-paper-bg);
  box-shadow: var(--surface-paper-shadow);
}

/* Page heading: large coin, eyebrow, title and one line of text. -------------------------------- */
.account-page-heading,
.chat-page-heading > div { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 13px; min-width: 0; }
.account-page-heading > *,
.chat-page-heading > div > * { grid-column: 2; }
.account-page-heading > .page-heading-icon,
.chat-page-heading > div > .page-heading-icon { width: 44px; height: 44px; grid-row: 1 / span 3; grid-column: 1; align-self: start; margin-top: 2px; font-size: 21px; }
.account-page-heading h1,
.chat-page-heading h1 { margin: 5px 0 4px; font-size: 24px; line-height: 1.15; letter-spacing: -.045em; }
.account-page-heading p,
.chat-page-heading p { margin: 0; color: #6f6b63; font-size: 12px; line-height: 1.5; }

/* Input: text fields and selects; gold border, yellow ring on focus. ----------------------------- */
.field input,
.field select,
.auth-field input,
.saved-search-card input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #dccf9f;
  border-radius: 12px;
  outline: 0;
  background-color: var(--white);
  color: var(--ink);
  font-size: 13px;
  transition: border-color .18s, box-shadow .18s;
}
.field input:focus,
.field select:focus,
.auth-field input:focus,
.saved-search-card input:focus { border-color: #b39a30; box-shadow: 0 0 0 3px rgb(245 214 83 / 35%); }
.field input:disabled,
.field select:disabled { cursor: not-allowed; opacity: .6; }

/* Main button: a full-width dark pill. ----------------------------------------------------------- */
.submit-button,
.auth-submit {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 750;
  transition: transform .18s, box-shadow .18s, background .18s;
}
.submit-button:hover:not(:disabled),
.auth-submit:hover:not(:disabled) { background: linear-gradient(135deg, #2f2d28, #252523); box-shadow: 0 8px 18px -8px rgb(37 37 35 / 60%), 0 0 0 2px rgb(245 214 83 / 45%); transform: translateY(-1px); }
.submit-button:focus-visible,
.auth-submit:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 3px; }
.submit-button:disabled,
.auth-submit:disabled { cursor: progress; opacity: .6; }

/* Full-screen focus mode (js/ui/fullscreen.js) ------------------------------------------------------------------------
   The toggle: a gold pill. The element shown full screen covers the whole screen on the page's paper; its toggle floats at
   the top right ("Exit full screen") so the way back is always in view. The page behind doesn't scroll meanwhile. */
.fs-toggle {
  display: inline-flex;
  min-height: 30px;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 0 13px 0 10px;
  border: 1px solid var(--yellow-deep);
  border-radius: 999px;
  background: linear-gradient(180deg, #fae58a, var(--yellow) 60%, #efcb45);
  box-shadow: 0 4px 10px -6px rgb(120 95 20 / 55%);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.fs-toggle:hover { border-color: var(--ink); background: var(--ink); color: var(--white); }
.fs-toggle:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 2px; }
.fs-toggle svg { width: 14px; height: 14px; flex: 0 0 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.fs-toggle.is-floating {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 1001;
  min-height: 38px;
  padding: 0 16px 0 13px;
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: 0 10px 24px -10px rgb(37 37 35 / 70%), 0 0 0 3px rgb(245 214 83 / 55%);
  color: var(--white);
  font-size: 12px;
}
.fs-toggle.is-floating:hover { background: #3a3832; }
.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000 !important;
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  /* Content starts right at the top (the floating Exit button sits over its top right corner). */
  padding: max(10px, env(safe-area-inset-top)) max(16px, 3vw) max(28px, env(safe-area-inset-bottom)) !important;
  overflow: auto !important;
  overscroll-behavior: contain;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--paper, #f4f0e9) !important;
  box-shadow: none !important;
}
/* No leading gap above the first thing in the view (e.g. the reading heading's page margin). */
.is-fullscreen > :first-child { margin-top: 0 !important; }
/* A view whose button stays in place (the chat workspace): edge to edge. */
.is-fullscreen.is-fullscreen-bare { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left) !important; }
body.has-fullscreen { overflow: hidden; }
/* Messages and the wait spinner still show over a full-screen view. */
body.has-fullscreen :is(.toast-host, .busy-overlay) { z-index: 1002; }
@media (max-width: 780px) {
  .fs-toggle:not(.is-floating) { min-height: 30px; padding: 0 9px; }
  /* Phones: just the icon to go full screen; "Exit full screen" always spelled out. */
  .fs-toggle:not(.is-floating):not([aria-pressed="true"]) .fs-toggle-label { display: none; }
  .is-fullscreen { padding-right: 12px !important; padding-left: 12px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .fs-toggle { transition: none; }
  .submit-button:hover:not(:disabled), .auth-submit:hover:not(:disabled) { transform: none; }
  .surface-card, .quick-stats, .overview-life-area, .chart-visualization, .yoga-example-card, .transit-current-card, .transit-event,
  .surface-header, .yoga-category-heading, .overview-life-area-title, .transits-section-heading, .chart-visualization-title { transition: none; }
  .surface-card:hover, .overview-life-area:hover, .chart-visualization:hover, .yoga-example-card:hover, .transit-current-card:hover, .transit-event:hover, .saved-person-card:hover { transform: none; }
}
