/* Scroll of Fire — Remnant 13 Moons
   Sunset boundary + Shabbat alignment + Daily Mirror + Astrology layer
   Complete UI refresh with restored calendars and richer interaction
 */

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

:root {
  --bg: #05070d;
  --bg-soft: #090d14;
  --card: rgba(14, 18, 28, 0.88);
  --card-strong: rgba(9, 13, 21, 0.96);
  --card-hover: rgba(18, 24, 38, 0.94);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.22);
  --ink: #f4f1e8;
  --muted: #aeb7c8;
  --accent: #7af3ff;
  --accent-soft: rgba(122, 243, 255, 0.12);
  --gold: #f3c97a;
  --gold-soft: rgba(243, 201, 122, 0.12);
  --violet: #c4a3ff;
  --green: #9ff7c8;
  --danger: #ff9aaa;
  --shabbat: #c7b6ff;
  --shabbat-deep: #7d67d8;
  --radius-sm: 14px;
  --radius: 20px;
  --radius-lg: 30px;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.24);
  --shadow-glow: 0 0 0 1px rgba(122, 243, 255, 0.08), 0 16px 40px rgba(0, 0, 0, 0.3);
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

html,
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  overflow-x: clip;
  overflow-y: auto;
  touch-action: pan-y;
}

button,
a,
.tab,
[role="button"] {
  touch-action: manipulation;
}

.page-head,
.card,
.notice,
.moon-badge,
.ring,
.ring svg,
.hero-sigil,
.tabPanel,
.current-moon-art,
.current-moon-art img,
.panel-banner,
.panel-banner img,
.gate-art-card,
.gate-art-card img {
  touch-action: pan-y;
}

body {
  color: var(--ink);
  background:
    radial-gradient(900px 620px at 50% -8%, rgba(122, 243, 255, 0.12), transparent 70%),
    radial-gradient(760px 560px at 90% 18%, rgba(243, 201, 122, 0.09), transparent 72%),
    radial-gradient(720px 520px at 8% 52%, rgba(196, 163, 255, 0.07), transparent 74%),
    linear-gradient(180deg, var(--bg), var(--bg-soft) 75%, var(--bg));
  font: 400 16px/1.6 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 78%);
}

body[data-shabbat-state="active"] {
  background:
    radial-gradient(950px 650px at 50% -10%, rgba(196, 163, 255, 0.18), transparent 70%),
    radial-gradient(760px 560px at 90% 18%, rgba(243, 201, 122, 0.10), transparent 72%),
    linear-gradient(180deg, #05070d, #0b0c16 75%, #05070d);
}

body[data-remnant-boundary="sunset"] #statBoundary,
body[data-remnant-boundary="manual"] #statBoundary {
  color: var(--gold);
}

::selection {
  color: #05070d;
  background: var(--gold);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

#skyBg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

.wrap,
.footer {
  width: min(100% - 28px, 1280px);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.wrap {
  padding: 22px 0 56px;
}

.footer {
  padding: 0 0 34px;
  color: var(--muted);
  text-align: center;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0 0 0.65rem;
  line-height: 1.08;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(2.4rem, 9vw, 5.4rem);
  background: linear-gradient(180deg, #fff, #d8f9ff 52%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  font-size: clamp(1.45rem, 5.8vw, 2.35rem);
}

h3 {
  color: var(--gold);
}

p {
  margin: 0.45rem 0 1rem;
  overflow-wrap: anywhere;
}

img,
svg,
canvas {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

/* Shared surfaces */

.page-head,
.card,
.notice,
.savedEntry,
.hum-card,
.log-card,
.mirror-card,
.meter-card,
.pattern-memory-card,
.astro-card,
.planet-card,
.aspect-card {
  background: linear-gradient(180deg, var(--card), var(--card-strong));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: clamp(18px, 4vw, 26px);
  overflow: hidden;
}

.card,
.savedEntry,
.hum-card,
.log-card,
.mirror-card,
.meter-card,
.pattern-memory-card,
.astro-card,
.planet-card,
.aspect-card {
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}

.card:hover,
.savedEntry:hover,
.hum-card:hover,
.log-card:hover,
.mirror-card:hover,
.meter-card:hover,
.pattern-memory-card:hover,
.astro-card:hover,
.planet-card:hover,
.aspect-card:hover {
  transform: translateY(-2px);
  border-color: rgba(122, 243, 255, 0.22);
  background: linear-gradient(180deg, var(--card-hover), var(--card-strong));
  box-shadow: var(--shadow-glow);
}

/* Today hero actions — primary daily card shown first in todayPanel */
.today-hero-actions {
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
}

.today-hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 0%, rgba(243, 201, 122, 0.15), transparent 58%),
    radial-gradient(circle at 85% 100%, rgba(122, 243, 255, 0.09), transparent 54%);
}

.today-hero-actions .eyebrow,
.today-hero-actions h2,
.today-hero-movement,
.today-hero-secondary,
.share-today-primary {
  position: relative;
  z-index: 1;
}

.today-hero-movement {
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  line-height: 1.58;
  margin: 0.5rem 0 1.25rem;
  max-width: 72ch;
}

.share-today-primary {
  display: flex;
  width: 100%;
  min-height: 52px;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  border-color: rgba(243, 201, 122, 0.72);
  background: linear-gradient(135deg, rgba(243, 201, 122, 0.17), rgba(122, 243, 255, 0.08));
  color: #ffe3a3;
  box-shadow: 0 0 24px rgba(243, 201, 122, 0.12);
  margin-bottom: 0.85rem;
}

.share-today-primary:hover,
.share-today-primary:focus-visible {
  border-color: rgba(243, 201, 122, 0.96);
  background: linear-gradient(135deg, rgba(243, 201, 122, 0.26), rgba(122, 243, 255, 0.14));
  box-shadow: 0 0 36px rgba(243, 201, 122, 0.22);
  color: #fff8e6;
  outline: none;
  transform: translateY(-1px);
}

.share-today-primary:active {
  transform: translateY(1px) scale(0.99);
}

.today-hero-secondary.btnrow {
  gap: 8px;
}

.today-calendar-summary {
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
}

/* Loading / ready / error state classes */
.today-calendar-summary.is-loading .today-summary-stats,
.today-calendar-summary.is-loading .today-summary-grid {
  opacity: 0.4;
  pointer-events: none;
}

.today-calendar-summary.is-loading::before {
  content: "Loading calendar…";
  display: block;
  padding: 0.5rem 0.85rem;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.today-calendar-summary.is-ready::before {
  display: none;
}

.today-calendar-summary.has-error::before {
  display: none;
}

.calendar-error-msg {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(255, 100, 80, 0.35);
  border-radius: 12px;
  background: rgba(255, 80, 60, 0.08);
  color: var(--muted);
  font-size: 0.88rem;
}

.today-summary-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 0%, rgba(122, 243, 255, 0.12), transparent 54%),
    radial-gradient(circle at 90% 0%, rgba(243, 201, 122, 0.11), transparent 56%);
}

.today-summary-head,
.today-summary-stats {
  position: relative;
  z-index: 1;
}

.today-summary-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
}

.today-summary-date h2 {
  margin-bottom: 0.45rem;
}

.today-summary-controls {
  margin-top: 0;
  justify-content: flex-end;
  /* Ensure the three nav buttons never use absolute positioning */
  position: static;
}

/* Explicit grid layout for the three calendar nav buttons on mobile —
   prevents any button from accidentally overlapping the others or adjacent text. */
@media (max-width: 760px) {
  .today-summary-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.75rem;
  }

  .today-summary-controls .lab-btn {
    width: 100%;
    min-height: 44px;
    flex: none;
    text-align: center;
    justify-content: center;
  }
}

.today-summary-stats {
  margin-top: 1rem;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.today-summary-stat {
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.today-summary-stat .label {
  display: block;
  position: static;
  font-size: 0.69rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.today-summary-stat strong {
  display: block;
  margin-top: 0.35rem;
}

.today-summary-day strong {
  font-size: clamp(2rem, 7vw, 2.7rem);
  line-height: 0.95;
}

.today-summary-grid {
  position: relative;
  z-index: 1;
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.today-summary-grid-day {
  display: grid;
  place-items: center;
  gap: 0.16rem;
  min-height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
}

.today-summary-grid-day small {
  font-size: 0.58rem;
  color: var(--muted);
}

.today-summary-grid-day.today {
  border-color: rgba(243, 201, 122, 0.45);
  background: rgba(243, 201, 122, 0.12);
}

.today-summary-grid-day.selected {
  border-color: rgba(122, 243, 255, 0.66);
  box-shadow: inset 0 0 0 1px rgba(122, 243, 255, 0.22);
}

.today-summary-grid-day.shabbat small {
  color: #dccfff;
}

.today-summary-grid-day.preparation,
.today-summary-grid-day.return {
  border-style: dashed;
}

.today-summary-grid-day.has-log::after {
  content: "●";
  font-size: 0.62rem;
  color: var(--green);
  line-height: 1;
}

.page-head {
  margin-top: 0;
}

.card,
.notice {
  margin-top: 16px;
}

.subtitle,
.meta,
.fine,
.hint {
  color: var(--muted);
}

.subtitle {
  max-width: 930px;
}

.app-install-note {
  margin-top: 0.35rem;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 900;
}

.crumbs,
.btnrow,
.tabs,
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.crumbs {
  margin-bottom: 18px;
}

.app-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 1.2rem;
}

.app-status-grid > div {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.app-status-grid dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-status-grid dd {
  margin: 0.38rem 0 0;
  overflow-wrap: anywhere;
}

.lab-btn,
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.68rem 0.95rem;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.026));
  text-decoration: none;
  cursor: pointer;
  font-weight: 850;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.lab-btn:hover,
.lab-btn:focus-visible,
.tab:hover,
.tab:focus-visible {
  border-color: rgba(122, 243, 255, 0.58);
  background: rgba(122, 243, 255, 0.09);
  box-shadow: 0 0 20px rgba(122, 243, 255, 0.10);
  outline: none;
  transform: translateY(-1px);
}

.lab-btn:active,
.tab:active {
  transform: translateY(1px) scale(0.99);
}

.lab-btn.ghost {
  background: rgba(255, 255, 255, 0.025);
}

.lab-btn.danger {
  border-color: rgba(255, 127, 145, 0.55);
}

.lab-btn.green {
  border-color: rgba(159, 247, 200, 0.55);
}

.tab.active,
.lab-btn.active {
  border-color: rgba(243, 201, 122, 0.88);
  background: rgba(243, 201, 122, 0.12);
  color: #ffe3a3;
  box-shadow: 0 0 18px rgba(243, 201, 122, 0.10);
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  gap: 0.42rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.42rem 0.7rem;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.86rem;
  font-weight: 850;
  white-space: normal;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-12 { grid-column: span 12; }

label {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

input,
select,
textarea,
.lab-input {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0.72rem 0.8rem;
  background: rgba(5, 8, 14, 0.86);
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:hover,
select:hover,
textarea:hover,
.lab-input:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(7, 11, 18, 0.95);
}

input:focus,
select:focus,
textarea:focus,
.lab-input:focus {
  outline: none;
  border-color: rgba(122, 243, 255, 0.58);
  box-shadow: 0 0 0 3px rgba(122, 243, 255, 0.08);
}

textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.55;
}

.formrow,
.log-grid,
.hum-grid,
.practice-grid,
.mirror-grid,
.meter-grid,
.pattern-memory-grid,
.astrology-grid,
.planet-grid,
.aspect-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.formrow {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.log-grid,
.hum-grid,
.practice-grid,
.mirror-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mirror-grid.single {
  grid-template-columns: 1fr;
}

.tabs {
  position: static;
  z-index: 60;
  margin: 12px 0 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 0 0.15rem;
  scrollbar-width: thin;
  background: rgba(5, 7, 13, 0.72);
  border-radius: 16px;
}

.tab {
  flex: 0 0 auto;
}

.tabPanel {
  display: none;
  opacity: 0;
  transform: translateY(8px);
}

.tabPanel.active {
  display: block;
  animation: panelIn 0.28s ease forwards;
}

/* Header compatibility */

.sof-topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  backdrop-filter: blur(18px);
}

.sof-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  text-decoration: none;
}

.sof-brand .mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  color: var(--gold);
  border: 1px solid rgba(243, 201, 122, 0.28);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 35px rgba(243, 201, 122, 0.08);
  font-size: 1.25rem;
  font-weight: 900;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sof-brand:hover .mark {
  transform: rotate(-4deg) scale(1.04);
  box-shadow: 0 0 42px rgba(243, 201, 122, 0.18);
}

.sof-brand strong {
  display: block;
  color: var(--ink);
  line-height: 1.05;
}

.sof-brand small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.sof-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.sof-nav a {
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.035);
  color: inherit;
  font-size: 0.92rem;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.sof-nav a:hover,
.sof-nav a:focus-visible,
.sof-nav a[aria-current="page"] {
  background: rgba(122, 243, 255, 0.09);
  border-color: rgba(122, 243, 255, 0.22);
  outline: none;
  transform: translateY(-1px);
}

/* Hero */

.page-head {
  position: relative;
  overflow: hidden;
  margin: 1rem 0 1.2rem;
  padding: clamp(1.2rem, 4vw, 2.2rem);
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 18%, rgba(122, 243, 255, 0.18), transparent 34%),
    radial-gradient(circle at 78% 18%, rgba(243, 201, 122, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.018));
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.38);
}

.page-head::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 180deg, transparent, rgba(122, 243, 255, 0.08), transparent, rgba(243, 201, 122, 0.08), transparent);
  animation: sofOrbit 28s linear infinite;
  pointer-events: none;
}

.page-head > * {
  position: relative;
  z-index: 1;
}

.page-head::after {
  content: "";
  position: absolute;
  inset: auto 2rem 0 2rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(243, 201, 122, 0.55), rgba(122, 243, 255, 0.45), transparent);
  pointer-events: none;
}

@media (hover: none) and (pointer: coarse) {
  .page-head {
    overflow: clip;
  }
}

.page-head h1 {
  font-size: clamp(2.6rem, 8vw, 5.8rem);
  line-height: 0.9;
  margin: 0.25rem 0 0.8rem;
  letter-spacing: -0.06em;
}

.hero-sigil {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin: 1.1rem auto;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-shadow: 0 0 18px rgba(243, 201, 122, 0.45);
  animation: sigilBreath 6s ease-in-out infinite;
}

.notice {
  border-color: rgba(243, 201, 122, 0.3);
  background: linear-gradient(180deg, rgba(243, 201, 122, 0.1), rgba(243, 201, 122, 0.035));
  color: #ffe7ad;
}

/* Command center */

.command {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  gap: 1rem;
  align-items: center;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.stat {
  min-width: 0;
  padding: 0.85rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.035);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.stat:hover {
  transform: translateY(-2px);
  border-color: rgba(122, 243, 255, 0.24);
  background: rgba(122, 243, 255, 0.05);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.stat strong {
  display: block;
  color: var(--gold);
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

#statShabbat {
  color: var(--shabbat);
}

.moon-badge {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 2rem);
  align-items: center;
}

.moon-badge::before {
  content: "";
  position: absolute;
  inset: -28%;
  background:
    radial-gradient(circle at 30% 30%, rgba(122, 243, 255, 0.10), transparent 38%),
    radial-gradient(circle at 70% 60%, rgba(243, 201, 122, 0.09), transparent 42%);
  opacity: 0.65;
  filter: blur(18px);
  animation: moonAura 9s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

.ring {
  position: relative;
  width: clamp(155px, 32vw, 220px);
  height: clamp(155px, 32vw, 220px);
  display: grid;
  place-items: center;
  overflow: visible;
}

.ring svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.10);
  stroke-width: 10;
}

.ring-fg {
  fill: none;
  stroke: var(--gold);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  filter: drop-shadow(0 0 14px rgba(243, 201, 122, 0.5));
  animation: ringPulse 5.5s ease-in-out infinite;
}

.ring .label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.18em;
  line-height: 1;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}

.label .big,
#dayInMoon.big {
  font-size: clamp(2.5rem, 9vw, 4.2rem);
  font-weight: 950;
  color: var(--gold);
  letter-spacing: -0.07em;
}

.label .small,
#moonLength.small {
  margin-top: 0.42em;
  font-size: clamp(0.95rem, 3vw, 1.35rem);
  font-weight: 850;
  color: var(--muted);
}

.weekrow {
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.week {
  display: grid;
  grid-template-columns: repeat(28, minmax(8px, 1fr));
  gap: 5px;
  max-width: 620px;
  margin-top: 8px;
}

.dot,
.week span {
  position: relative;
  aspect-ratio: 1;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.dot:hover,
.week span:hover {
  transform: scale(1.18);
}

.dot.done {
  background: rgba(122, 243, 255, 0.18);
  border-color: rgba(122, 243, 255, 0.38);
}

.dot.preparation {
  box-shadow: inset 0 0 0 2px rgba(243, 201, 122, 0.28);
}

.dot.shabbat {
  border-color: rgba(196, 163, 255, 0.72);
  background: rgba(196, 163, 255, 0.18);
  box-shadow: 0 0 10px rgba(196, 163, 255, 0.24);
}

.dot.today,
.week span.active {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(243, 201, 122, 0.7);
}

.dot.today.shabbat {
  background: linear-gradient(135deg, var(--gold), var(--shabbat));
  box-shadow: 0 0 22px rgba(196, 163, 255, 0.52);
}

/* Boundary controls */

#boundaryMode,
#sunsetInput {
  border-color: rgba(243, 201, 122, 0.26);
}

#boundaryStatus {
  margin: 0.85rem 0 0;
  padding: 0.72rem 0.82rem;
  border-radius: 14px;
  border: 1px solid rgba(243, 201, 122, 0.18);
  background: rgba(243, 201, 122, 0.05);
}

/* Shabbat layer */

.shabbat-summary {
  position: relative;
  overflow: hidden;
  border-color: rgba(196, 163, 255, 0.34);
  background:
    radial-gradient(circle at 8% 0%, rgba(196, 163, 255, 0.16), transparent 34%),
    radial-gradient(circle at 94% 20%, rgba(243, 201, 122, 0.10), transparent 34%),
    linear-gradient(180deg, rgba(20, 18, 36, 0.94), rgba(10, 11, 22, 0.94));
}

.shabbat-summary::after {
  content: "שבת";
  position: absolute;
  right: 1.2rem;
  top: 0.35rem;
  font-size: clamp(3rem, 10vw, 7rem);
  line-height: 1;
  color: rgba(196, 163, 255, 0.06);
  font-weight: 950;
  pointer-events: none;
}

.shabbat-summary .command-grid {
  margin: 1rem 0;
}

.shabbat-summary .stat {
  border-color: rgba(196, 163, 255, 0.18);
  background: rgba(196, 163, 255, 0.04);
}

.shabbat-summary .stat strong {
  color: var(--shabbat);
}

.shabbat-summary .pill {
  color: #ece5ff;
  border-color: rgba(196, 163, 255, 0.26);
  background: rgba(196, 163, 255, 0.07);
}

.shabbat-hero {
  border-color: rgba(196, 163, 255, 0.30);
  background:
    radial-gradient(circle at 12% 16%, rgba(196, 163, 255, 0.22), transparent 34%),
    radial-gradient(circle at 82% 10%, rgba(243, 201, 122, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(18, 16, 34, 0.92), rgba(8, 10, 18, 0.94));
}

.shabbat-hero .moon-core {
  background:
    radial-gradient(circle at 38% 34%, #fff 0 9%, #e9dcff 10% 28%, rgba(196, 163, 255, 0.28) 29% 44%, rgba(255, 255, 255, 0.04) 45% 100%);
  color: #120d23;
  border-color: rgba(196, 163, 255, 0.48);
  box-shadow: 0 0 34px rgba(196, 163, 255, 0.42), 0 0 84px rgba(243, 201, 122, 0.16);
}

#shabbatPanel .card {
  border-color: rgba(196, 163, 255, 0.20);
}

#shabbatPanel .card h2,
#shabbatPanel .card h3 {
  color: var(--shabbat);
}

body[data-shabbat-state="active"] .site-header,
body[data-shabbat-state="active"] .sof-topbar {
  box-shadow: 0 10px 40px rgba(196, 163, 255, 0.08);
}

body[data-shabbat-state="active"] .page-head {
  border-color: rgba(196, 163, 255, 0.22);
}

body[data-shabbat-state="active"] .hero-sigil {
  color: var(--shabbat);
  text-shadow: 0 0 18px rgba(196, 163, 255, 0.46);
}

/* Daily flow */

.ritual-hero {
  position: relative;
  overflow: hidden;
  margin: 1rem 0;
  padding: clamp(1.1rem, 4vw, 2rem);
  border-radius: 30px;
  border: 1px solid rgba(243, 201, 122, 0.22);
  background:
    radial-gradient(circle at 12% 16%, rgba(243, 201, 122, 0.18), transparent 34%),
    radial-gradient(circle at 82% 10%, rgba(122, 243, 255, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ritual-hero::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent, rgba(243, 201, 122, 0.12), transparent, rgba(122, 243, 255, 0.10), transparent);
  animation: sofOrbit 18s linear infinite;
  opacity: 0.7;
  pointer-events: none;
}

.ritual-hero > * {
  position: relative;
  z-index: 1;
}

.ritual-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  align-items: stretch;
}

.ritual-title {
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: 0.92;
  margin: 0.2rem 0 0.8rem;
  letter-spacing: -0.06em;
}

.ritual-line {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--muted);
  max-width: 820px;
}

.daily-sigil {
  display: grid;
  place-items: center;
  min-height: 250px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at center, rgba(243, 201, 122, 0.18), transparent 42%),
    rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 0 80px rgba(122, 243, 255, 0.08);
}

.daily-sigil .moon-core {
  width: min(46vw, 190px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(243, 201, 122, 0.35);
  background:
    radial-gradient(circle at 38% 34%, #fff7d8 0 11%, #f3c97a 12% 28%, rgba(243, 201, 122, 0.25) 29% 44%, rgba(255, 255, 255, 0.04) 45% 100%);
  box-shadow: 0 0 34px rgba(243, 201, 122, 0.35), 0 0 78px rgba(122, 243, 255, 0.18);
  animation: moonFloat 5.5s ease-in-out infinite;
  color: #05070d;
  font-weight: 950;
  font-size: clamp(2.8rem, 9vw, 4.8rem);
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  margin: 1rem 0;
}

.flow-step {
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
  color: var(--muted);
  font-weight: 850;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  min-width: 0;
  overflow-wrap: anywhere;
}

.flow-step strong {
  display: block;
  color: var(--gold);
}

.flow-step:hover {
  transform: translateY(-2px);
  border-color: rgba(122, 243, 255, 0.35);
  background: rgba(122, 243, 255, 0.06);
}

.meter-grid {
  grid-template-columns: repeat(5, 1fr);
  gap: 0.85rem;
}

.meter-card {
  padding: 0.9rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
}

.meter-card span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 900;
}

.meter-bar {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 0.6rem 0;
}

.meter-fill {
  height: 100%;
  width: 42%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  box-shadow: 0 0 16px rgba(122, 243, 255, 0.28);
  animation: meterBreath 4s ease-in-out infinite;
}

.meter-card strong {
  color: var(--gold);
}

.practice-card {
  border-color: rgba(159, 247, 200, 0.22);
  background:
    radial-gradient(circle at 8% 0%, rgba(159, 247, 200, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
}

.practice-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.practice-list div {
  padding: 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.16);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.practice-list div:hover {
  transform: translateY(-2px);
  border-color: rgba(159, 247, 200, 0.28);
}

.pattern-memory-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.pattern-memory-card {
  padding: 1rem;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.16);
}

.pattern-memory-card h3 {
  margin: 0 0 0.35rem;
  color: var(--gold);
}

/* Calendars */

.calendar,
.gregorian {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
  margin-top: 1rem;
}

.calDay,
.gregDay,
.gregHead,
.gregPad {
  min-width: 0;
}

.calDay,
.gregDay {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  isolation: isolate;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.calDay::before,
.gregDay::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 50% 0%, rgba(122, 243, 255, 0.12), transparent 58%);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.calDay:hover::before,
.gregDay:hover::before,
.calDay:focus-visible::before,
.gregDay:focus-visible::before {
  opacity: 1;
}

.calDay {
  min-height: 118px;
  padding: 0.78rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
}

.calDay:hover,
.calDay:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(122, 243, 255, 0.46);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28), 0 0 18px rgba(122, 243, 255, 0.08);
  outline: none;
}

.calDay strong,
.gregDay strong {
  display: block;
  color: var(--ink);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.calDay strong {
  font-size: 0.92rem;
}

.calDay small,
.gregDay small {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.calDay small {
  font-size: 0.72rem;
}

.calDay.today,
.gregDay.today {
  border-color: rgba(243, 201, 122, 0.86);
  background:
    radial-gradient(circle at 50% 0%, rgba(243, 201, 122, 0.19), transparent 60%),
    linear-gradient(180deg, rgba(243, 201, 122, 0.10), rgba(255, 255, 255, 0.025));
  box-shadow: 0 0 0 1px rgba(243, 201, 122, 0.10), 0 0 26px rgba(243, 201, 122, 0.14);
}

.calDay.today::after,
.gregDay.today::after {
  content: "TODAY";
  position: absolute;
  right: 0.45rem;
  top: 0.4rem;
  color: var(--gold);
  font-size: 0.52rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.calDay.shabbat,
.gregDay.shabbat {
  border-color: rgba(196, 163, 255, 0.5);
  background:
    radial-gradient(circle at 50% 0%, rgba(196, 163, 255, 0.16), transparent 60%),
    rgba(196, 163, 255, 0.045);
}

.calDay.shabbat::after,
.gregDay.shabbat::after {
  content: "שבת";
  position: absolute;
  right: 0.45rem;
  bottom: 0.35rem;
  color: rgba(199, 182, 255, 0.75);
  font-size: 0.62rem;
  font-weight: 900;
}

.calDay.preparation,
.gregDay.preparation {
  box-shadow: inset 0 0 0 1px rgba(243, 201, 122, 0.18);
}

.calDay.today.shabbat,
.gregDay.today.shabbat {
  border-color: rgba(223, 197, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(243, 201, 122, 0.16), 0 0 28px rgba(196, 163, 255, 0.22);
}

.gregHead {
  padding: 0.45rem 0.2rem;
  color: var(--gold);
  text-align: center;
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gregDay {
  min-height: 98px;
  padding: 0.68rem;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.018));
}

.gregDay:hover,
.gregDay:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(122, 243, 255, 0.42);
  background: rgba(122, 243, 255, 0.055);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  outline: none;
}

.gregDay strong {
  font-size: 0.96rem;
}

.gregDay small {
  font-size: 0.68rem;
}

.gregDay.effective,
.calDay.effective,
.calDay.selected,
.gregDay.selected,
.calDay[aria-selected="true"],
.gregDay[aria-selected="true"] {
  border-color: rgba(122, 243, 255, 0.72);
  background:
    radial-gradient(circle at 50% 0%, rgba(122, 243, 255, 0.16), transparent 64%),
    rgba(122, 243, 255, 0.045);
  box-shadow: inset 0 0 0 1px rgba(122, 243, 255, 0.12), 0 0 22px rgba(122, 243, 255, 0.10);
}

.gregPad {
  min-height: 98px;
  border-radius: 15px;
  border: 1px dashed rgba(255, 255, 255, 0.045);
  background: rgba(255, 255, 255, 0.012);
}

.calendar-card,
.calendar-wrap {
  overflow-x: hidden;
}

#yearMapBody td,
#yearMapBody th {
  overflow-wrap: anywhere;
}

/* Mirror */

.reading-focus {
  display: grid;
  grid-template-columns: minmax(240px, 0.55fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: end;
  margin-top: 1rem;
}

.mirror-card {
  padding: 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
}

.output,
.copy-scroll {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#simMoon {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 520 / 340;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(18px);
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(243, 201, 122, 0.35);
  background: rgba(8, 12, 20, 0.96);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 120;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1100px) {
  .command {
    grid-template-columns: 1fr;
  }

  .ritual-layout,
  .reading-focus {
    grid-template-columns: 1fr;
  }

  .meter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .col-3,
  .col-4,
  .col-5,
  .col-6,
  .col-7,
  .col-8,
  .col-9,
  .col-12 {
    grid-column: span 12;
  }

  .command-grid,
  .practice-list,
  .pattern-memory-grid,
  .log-grid,
  .hum-grid,
  .practice-grid,
  .mirror-grid,
  .astrology-grid,
  .planet-grid,
  .aspect-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .wrap,
  .footer {
    width: min(100% - 16px, 1280px);
  }

  .wrap {
    padding: 14px 0 42px;
  }

  .page-head,
  .card,
  .notice,
  .savedEntry,
  .hum-card,
  .log-card,
  .mirror-card,
  .meter-card,
  .pattern-memory-card,
  .astro-card,
  .planet-card,
  .aspect-card,
  .ritual-hero {
    padding: 16px;
    border-radius: 22px;
  }

  .page-head {
    margin: 0.6rem 0 1rem;
    height: auto;
    min-height: 0;
  }

  .page-head::after {
    inset: auto 1rem 0 1rem;
  }

  .crumbs,
  .tabs,
  .btnrow,
  .row {
    gap: 8px;
  }

  .crumbs .lab-btn {
    width: auto;
    min-height: 40px;
    flex: 0 1 auto;
    padding-inline: 0.8rem;
  }

  .tabs {
    margin: 12px 0;
    padding-top: 0.35rem;
    flex-wrap: nowrap;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
  }

  .tabs .tab {
    width: auto;
    min-height: 40px;
    flex: 0 0 auto;
    padding: 0.62rem 0.85rem;
    font-size: 0.92rem;
    scroll-snap-align: center;
  }

  .btnrow .lab-btn,
  .btnrow button,
  .btnrow input,
  .btnrow select {
    width: 100%;
    min-height: 48px;
    flex: 1 1 100%;
  }

  .formrow,
  .command-grid,
  .practice-list,
  .pattern-memory-grid,
  .log-grid,
  .hum-grid,
  .practice-grid,
  .mirror-grid,
  .meter-grid,
  .astrology-grid,
  .planet-grid,
  .aspect-grid,
  .flow-steps,
  .reading-focus {
    grid-template-columns: 1fr;
  }

  .app-status-grid {
    grid-template-columns: 1fr;
  }

  .moon-badge,
  .ritual-layout {
    grid-template-columns: 1fr;
  }

  .ring {
    margin-inline: auto;
  }

  .ritual-title {
    font-size: clamp(2rem, 12vw, 3.6rem);
    line-height: 0.96;
  }

  .ritual-line,
  .subtitle,
  .fine,
  .meta,
  p {
    font-size: 0.98rem;
  }

  .flow-step {
    min-height: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 0.85rem;
  }

  .flow-step strong {
    margin-bottom: 0.2rem;
    font-size: 1.9rem;
    line-height: 1;
  }

  .daily-sigil {
    min-height: 200px;
    border-radius: 22px;
  }

  .daily-sigil .moon-core {
    width: min(56vw, 190px);
    font-size: clamp(2.4rem, 12vw, 3.6rem);
  }

  .shabbat-summary::after {
    font-size: clamp(2.4rem, 16vw, 4.8rem);
    right: 0.8rem;
    top: 0.5rem;
  }

  .calendar,
  .gregorian {
    gap: 4px;
  }

  .calDay {
    min-height: 84px;
    padding: 0.48rem 0.38rem;
    border-radius: 12px;
  }

  .calDay strong {
    font-size: 0.75rem;
  }

  .calDay small {
    font-size: 0.6rem;
    line-height: 1.22;
  }

  .gregHead {
    padding-inline: 0;
    font-size: 0.62rem;
    letter-spacing: 0.02em;
  }

  .gregDay,
  .gregPad {
    min-height: 72px;
    padding: 0.42rem 0.28rem;
    border-radius: 11px;
  }

  .gregDay strong {
    font-size: 0.78rem;
  }

  .gregDay small {
    font-size: 0.56rem;
    line-height: 1.2;
  }

  .calDay.today::after,
  .gregDay.today::after {
    display: none;
  }

  .toast {
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: min(calc(100% - 24px), 420px);
    text-align: center;
  }

  .today-summary-head {
    grid-template-columns: 1fr;
  }

  .today-summary-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-summary-grid-day {
    min-height: 58px;
    padding: 0.32rem 0.2rem;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: clamp(2rem, 12vw, 3rem);
  }

  h2 {
    font-size: clamp(1.35rem, 8vw, 2rem);
  }

  .eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
  }

  .flow-step {
    min-height: 72px;
    padding: 0.65rem 0.75rem;
  }

  .flow-step strong {
    font-size: 1.75rem;
  }

  .daily-sigil {
    min-height: 184px;
  }

  .daily-sigil .moon-core {
    width: min(54vw, 170px);
    font-size: clamp(2.1rem, 11vw, 3.1rem);
  }

  .calendar,
  .gregorian {
    gap: 3px;
  }

  .calDay {
    min-height: 68px;
    padding: 0.38rem 0.25rem;
    border-radius: 9px;
  }

  .calDay strong {
    font-size: 0.68rem;
  }

  .calDay small {
    font-size: 0.52rem;
    max-height: 2.5em;
    overflow: hidden;
  }

  .gregHead {
    font-size: 0.56rem;
  }

  .gregDay,
  .gregPad {
    min-height: 58px;
    padding: 0.32rem 0.2rem;
    border-radius: 9px;
  }

  .gregDay strong {
    font-size: 0.72rem;
  }

  .gregDay small {
    font-size: 0.5rem;
    max-height: 2.4em;
    overflow: hidden;
  }

  .calDay.shabbat::after,
  .gregDay.shabbat::after {
    font-size: 0.5rem;
    right: 0.22rem;
    bottom: 0.18rem;
  }

  .today-summary-stats {
    grid-template-columns: 1fr;
  }

  .today-summary-grid-day {
    min-height: 54px;
  }
}

@keyframes sofOrbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes moonFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes moonAura {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@keyframes ringPulse {
  0%,
  100% {
    filter: drop-shadow(0 0 14px rgba(243, 201, 122, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(243, 201, 122, 0.72));
  }
}

@keyframes sigilBreath {
  0%,
  100% {
    opacity: 0.82;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes meterBreath {
  0%,
  100% {
    opacity: 0.88;
  }
  50% {
    opacity: 1;
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
     }

/* =========================================================
   REMNANT 13 MOONS — IMAGE INTEGRATION
   ========================================================= */
body[data-remnant-boundary]{background:linear-gradient(rgba(5,7,13,.82),rgba(5,7,13,.95)),url("../img/moons/app/app-bg-dark.webp") center top/cover fixed,var(--bg)}
.moons-app-hero,.panel-banner,.current-moon-art,.gate-art-card,.saved-empty-state{margin:0}
.moons-app-hero{position:relative;width:min(100%,980px);margin:1.6rem auto 1.3rem;overflow:hidden;border:1px solid rgba(243,201,122,.28);border-radius:28px;background:rgba(5,7,13,.76);box-shadow:0 30px 80px rgba(0,0,0,.48),0 0 44px rgba(122,243,255,.08)}
.moons-app-hero::after,.panel-banner::after{content:"";position:absolute;inset:0;pointer-events:none}
.moons-app-hero::after{background:linear-gradient(to bottom,transparent 60%,rgba(5,7,13,.78)),radial-gradient(circle at 50% 42%,transparent 34%,rgba(5,7,13,.22))}
.moons-app-hero img{display:block;width:100%;aspect-ratio:1;object-fit:cover}
.current-moon-art{display:flex;justify-content:center;align-items:center;width:100%;max-width:100%;padding-inline:12px;margin-inline:auto;overflow:hidden;border:1px solid rgba(243,201,122,.25);border-radius:22px;background:rgba(3,7,13,.72);box-shadow:0 18px 44px rgba(0,0,0,.32)}
.current-moon-art img{display:block;width:100%;max-width:min(96%,660px);height:auto;min-height:0;aspect-ratio:1;object-fit:contain;margin-inline:auto}
.moon-badge.has-moon-art{grid-template-columns:1fr;grid-template-areas:"art" "ring" "details"}
.moon-badge.has-moon-art .current-moon-art{grid-area:art}
.moon-badge.has-moon-art .ring{grid-area:ring;margin-inline:auto}
.moon-badge.has-moon-art>div:last-child{grid-area:details}
.panel-banner{position:relative;width:100%;max-height:460px;margin:0 0 1.5rem;overflow:hidden;border:1px solid rgba(243,201,122,.2);border-radius:24px;background:rgba(5,7,13,.82);box-shadow:0 22px 58px rgba(0,0,0,.34)}
.panel-banner::after{background:linear-gradient(to bottom,rgba(5,7,13,.01),rgba(5,7,13,.12) 56%,rgba(5,7,13,.86))}
.panel-banner img{display:block;width:100%;height:clamp(260px,44vw,460px);object-fit:cover;object-position:center}
.gate-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;margin:1.5rem 0}
.gate-art-card{position:relative;overflow:hidden;border:1px solid rgba(243,201,122,.22);border-radius:22px;background:rgba(5,7,13,.82);box-shadow:0 18px 42px rgba(0,0,0,.3)}
.gate-art-card img{display:block;width:100%;aspect-ratio:1;object-fit:cover;transition:transform .4s ease}
.gate-art-card:hover img{transform:scale(1.025)}
.gate-art-card figcaption{position:absolute;right:0;bottom:0;left:0;padding:1rem;color:var(--gold);font-family:"Cinzel",serif;text-align:center;letter-spacing:.06em;background:linear-gradient(transparent,rgba(5,7,13,.97))}
.saved-empty-state{padding:1.4rem;text-align:center;border:1px dashed rgba(243,201,122,.24);border-radius:22px;background:rgba(255,255,255,.025)}
.saved-empty-state img{display:block;width:min(100%,420px);margin:0 auto 1rem;border-radius:18px;opacity:.9}
@media(max-width:980px){.moon-badge.has-moon-art{grid-template-columns:1fr}.current-moon-art{padding-inline:10px}.current-moon-art img{max-width:95%}}
@media(max-width:760px){
body::before,#skyBg{display:none}
.wrap{padding-bottom:42px}
body[data-remnant-boundary]{background:linear-gradient(rgba(5,7,13,.84),rgba(5,7,13,.96)),url("../img/moons/app/app-bg-dark.webp") center top/cover no-repeat scroll,var(--bg)}
.moons-app-hero{margin-top:1rem;border-radius:18px}
.panel-banner,.gate-art-card,.current-moon-art{border-radius:18px}
.gate-gallery{grid-template-columns:1fr}
.panel-banner img{height:auto;aspect-ratio:1}
}





/* Hide the duplicate upper calendar navigation on mobile only */
@media (max-width: 768px) {
  .moons-tabs,
  .section-tabs,
  .calendar-tabs,
  .tab-strip:not(.mobile-bottom-nav):not(.moons-mobile-nav) {
    display: none !important;
  }
}

/* ── Compact install shortcut row ────────────────────────────────────────── */

.app-shortcuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 14px;
  width: 100%;
}

@media (max-width: 350px) {
  .app-shortcuts {
    grid-template-columns: 1fr;
  }
}

.install-shortcut-btn {
  min-height: 44px;
  font-size: 0.86rem;
  padding: 0.52rem 0.9rem;
  text-align: center;
  white-space: normal;
  border-color: rgba(255, 255, 255, 0.12);
}
