:root {
  color-scheme: dark;
  --bg: #090b14;
  --bg-deep: #05070d;
  --panel: rgba(10, 16, 30, 0.82);
  --panel-border: rgba(120, 204, 255, 0.14);
  --text: #f6f3eb;
  --muted: #9dafcb;
  --accent: #ff9b54;
  --accent-soft: rgba(255, 155, 84, 0.16);
  --accent-cool: #70d8ff;
  --gold: #ffd27d;
  --success: #87f7c8;
  --danger: #ffb4b4;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 40px rgba(112, 216, 255, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(255, 155, 84, 0.2), transparent 26%),
    radial-gradient(circle at 80% 0%, rgba(112, 216, 255, 0.14), transparent 24%),
    linear-gradient(180deg, #101425 0%, var(--bg) 45%, var(--bg-deep) 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 210, 125, 0.08), transparent 35%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: auto, 42px 42px, 42px 42px;
}

.shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4.5rem;
}

.panel {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(112, 216, 255, 0.08), transparent 28%, rgba(255, 155, 84, 0.06) 70%, transparent 100%);
}

.hero {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.2fr 0.8fr;
  padding: 2.25rem;
}

.hero-copy,
.hero-visual,
.metrics-grid > .panel {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  font-size: 0.8rem;
}

.hero-copy {
  display: grid;
  align-content: start;
  gap: 0.35rem;
}

.hero-badges {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.badge,
.countdown-pill {
  border-radius: 999px;
  border: 1px solid rgba(112, 216, 255, 0.22);
  background: rgba(112, 216, 255, 0.08);
  color: #d7f5ff;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  line-height: 1.01;
  margin-bottom: 0.85rem;
  text-wrap: balance;
  max-width: 12ch;
}

h2 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.6rem, 2.4vw, 2.15rem);
  line-height: 1.08;
}

h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.lede,
.section-heading p,
.status,
.meta-line,
.stat-label,
#timeZoneLabel {
  color: var(--muted);
}

.lede {
  max-width: 60ch;
  font-size: 1.08rem;
  line-height: 1.5;
}

.actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}

.terminal-note {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  max-width: 100%;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(135, 247, 200, 0.16);
  background: rgba(5, 10, 18, 0.7);
  color: #caf7e5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.35;
  flex-wrap: wrap;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.prompt {
  color: var(--success);
  font-weight: 700;
}

.primary {
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.4rem;
  background: linear-gradient(135deg, var(--gold), var(--accent), #ff6b6b);
  color: #211407;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
  box-shadow: 0 12px 24px rgba(255, 155, 84, 0.28), 0 0 24px rgba(255, 155, 84, 0.16);
}

.primary:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
}

.primary:disabled {
  cursor: progress;
  opacity: 0.7;
}

.hero-visual {
  display: grid;
  gap: 1.5rem;
  align-items: stretch;
}

.altar,
.stat-card,
.candle-card,
.location-bar {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  background-clip: padding-box;
}

.altar {
  min-height: 320px;
  display: grid;
  place-items: center;
  overflow: visible;
  padding: 2.2rem 1.5rem 1.5rem;
  position: relative;
}

.altar-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(112, 216, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 216, 255, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
}

.big-candle-wrap {
  position: relative;
  width: 100%;
  min-height: 220px;
  display: grid;
  place-items: center;
  transform: translateY(-14px);
}

.orbit-ring {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(112, 216, 255, 0.15);
  box-shadow: var(--shadow-glow);
}

.orbit-ring-1 {
  width: 220px;
  height: 220px;
}

.orbit-ring-2 {
  width: 290px;
  height: 290px;
  border-color: rgba(255, 155, 84, 0.14);
}

.big-candle,
.mini-candle {
  position: relative;
  background: linear-gradient(180deg, #f3efe6 0%, #d4cab7 100%);
  border-radius: 18px 18px 10px 10px;
}

.big-candle {
  width: 110px;
  height: 220px;
  box-shadow: inset 0 -18px 30px rgba(0, 0, 0, 0.08), 0 18px 40px rgba(0, 0, 0, 0.25);
  z-index: 1;
}

.big-candle::after,
.mini-candle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -16px;
  width: 4px;
  height: 18px;
  background: #2b2117;
  transform: translateX(-50%);
  border-radius: 999px;
}

.big-flame,
.mini-flame {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 60% 60% 60% 60% / 80% 80% 40% 40%;
  animation: flicker 1.8s ease-in-out infinite;
}

.big-flame {
  top: -62px;
  width: 34px;
  height: 60px;
  background: radial-gradient(circle at 50% 30%, #fff7d1 0%, #ffd27d 35%, #ff9b54 68%, rgba(255, 155, 84, 0.18) 100%);
  box-shadow: 0 0 30px rgba(255, 155, 84, 0.5);
}

.altar-readout {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(112, 216, 255, 0.15);
  background: rgba(5, 10, 18, 0.66);
  backdrop-filter: blur(10px);
}

.readout-label {
  color: var(--accent-cool);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.stat-card {
  padding: 1.25rem 1.4rem;
  display: grid;
  gap: 0.5rem;
  min-height: 152px;
  align-content: center;
  justify-items: center;
  min-width: 0;
  height: 100%;
  text-align: center;
}

.stat-primary {
  background: linear-gradient(180deg, rgba(255, 155, 84, 0.18), rgba(255, 255, 255, 0.04));
}

.stat-card strong {
  font-size: clamp(1.3rem, 4vw, 3rem);
  line-height: 1.05;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stat-card span:last-child {
  font-size: 0.96rem;
  line-height: 1.35;
}

.metrics-grid {
  margin-top: 1.75rem;
  display: grid;
  gap: 1.75rem;
  grid-template-columns: 1fr;
  align-items: start;
}

.metrics-grid > .panel {
  padding: 1.6rem;
}

.section-heading {
  margin-bottom: 1.15rem;
}

.section-heading-compact {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.calendar-arrow {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid rgba(112, 216, 255, 0.2);
  background: rgba(112, 216, 255, 0.08);
  color: #e8f8ff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.calendar-arrow:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(255, 210, 125, 0.32);
}

.calendar-arrow:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.calendar-month-label {
  min-width: 9.5rem;
  text-align: center;
  color: var(--text);
}

.sub-section-heading {
  margin-top: 1.65rem;
}

.section-heading p,
.sub-section-heading p {
  margin-bottom: 0;
  max-width: 44ch;
  line-height: 1.45;
}

.candle-wall,
.location-chart {
  display: grid;
  gap: 0.9rem;
}

.candle-wall {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  padding-top: 0.9rem;
}

.candle-card {
  position: relative;
  overflow: visible;
  padding: 1rem;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
  min-height: 102px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.candle-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 210, 125, 0.18);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.candle-card > div:last-child {
  min-width: 0;
}

.candle-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(112, 216, 255, 0.05), transparent 40%, rgba(255, 155, 84, 0.07));
  pointer-events: none;
}

.mini-candle {
  width: 34px;
  height: 70px;
  margin-inline: auto;
  transform: translateY(-10px);
  z-index: 2;
}

.mini-flame {
  top: -24px;
  width: 18px;
  height: 30px;
  background: radial-gradient(circle at 50% 30%, #fff7d1 0%, #ffd27d 35%, #ff9b54 70%, rgba(255, 155, 84, 0.16) 100%);
  box-shadow: 0 0 16px rgba(255, 155, 84, 0.35);
}

.card-heading-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.35rem;
}

.location-label {
  display: block;
  margin-bottom: 0;
  flex: 1 1 150px;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.18;
}

.countdown-pill {
  background: rgba(255, 210, 125, 0.12);
  border-color: rgba(255, 210, 125, 0.2);
  color: #fff0c6;
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: 0.72rem;
  padding: 0.3rem 0.55rem;
}

.meta-line {
  margin-bottom: 0;
  line-height: 1.4;
  font-size: 0.96rem;
}

.location-bar {
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, rgba(112, 216, 255, 0.08), rgba(255, 255, 255, 0.03));
  overflow: hidden;
}

.location-bar header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.location-bar header strong,
.location-bar header span {
  min-width: 0;
}

.location-bar header strong {
  overflow-wrap: anywhere;
}

.location-bar-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.location-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-cool), var(--gold), var(--accent));
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.calendar-weekdays span {
  padding: 0.2rem 0.15rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  letter-spacing: 0.05em;
}

.calendar-grid {
  gap: 0.65rem;
  align-content: start;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.calendar-legend-swatch {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(112, 216, 255, 0.16);
  background: linear-gradient(180deg, rgba(8, 13, 24, 0.92), rgba(16, 25, 42, 0.72));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.calendar-legend-swatch-active {
  border-color: rgba(255, 210, 125, 0.18);
  background: linear-gradient(180deg, rgba(8, 13, 24, 0.92), rgba(40, 52, 78, 0.92));
}

.calendar-legend-swatch-peak {
  border-color: rgba(255, 210, 125, 0.3);
  background: linear-gradient(180deg, rgba(66, 48, 26, 0.92), rgba(130, 72, 40, 0.92));
  box-shadow: inset 0 0 0 1px rgba(255, 210, 125, 0.12), 0 0 0 1px rgba(255, 210, 125, 0.08);
}

.calendar-day {
  position: relative;
  overflow: hidden;
  min-height: 88px;
  border-radius: 16px;
  border: 1px solid rgba(112, 216, 255, 0.1);
  background: linear-gradient(
    180deg,
    rgba(8, 13, 24, 0.92),
    rgba(16, 25, 42, calc(0.72 + (var(--calendar-intensity, 0) * 0.18)))
  );
  isolation: isolate;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  padding: 0.7rem;
  display: grid;
  place-items: center;
  gap: 0.35rem;
}

.calendar-day::before {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  z-index: 0;
}

.calendar-day::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: calc(var(--calendar-intensity, 0) * 100%);
  background: linear-gradient(180deg, rgba(112, 216, 255, 0), rgba(255, 155, 84, 0.16));
  z-index: 1;
}

.calendar-day--active {
  border-color: rgba(255, 210, 125, 0.18);
}

.calendar-day--peak {
  box-shadow: inset 0 0 0 1px rgba(255, 210, 125, 0.1), 0 0 0 1px rgba(255, 210, 125, 0.08);
}

.calendar-day--empty {
  min-height: 88px;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.015);
}

.calendar-day-number,
.calendar-day-count,
.calendar-day-label {
  position: absolute;
  z-index: 2;
}

.calendar-day-number {
  top: 0.65rem;
  left: 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.calendar-day-count {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -40%);
  color: var(--text);
  font-size: clamp(1rem, 2vw, 1.4rem);
  line-height: 1;
  text-align: center;
}

.calendar-day-label {
  left: 50%;
  bottom: 0.65rem;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
}

.empty-state {
  padding: 1rem;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--text);
}

.status {
  min-height: 1.4em;
  max-width: 40ch;
  line-height: 1.35;
}

.status[data-tone='error'] {
  color: var(--danger);
}

.status[data-tone='success'] {
  color: var(--success);
}

.status[data-tone='notice'] {
  color: var(--muted);
}

@keyframes flicker {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.95;
  }

  25% {
    transform: translateX(-53%) scale(0.98, 1.04);
  }

  50% {
    transform: translateX(-48%) scale(1.03, 0.98);
    opacity: 1;
  }

  75% {
    transform: translateX(-51%) scale(0.99, 1.02);
  }
}

@media (max-width: 900px) {
  .hero,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 1.5rem;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .section-heading-compact,
  .card-heading-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .calendar-controls {
    width: 100%;
    justify-content: space-between;
  }

  .shell {
    width: min(100% - 1rem, 1180px);
  }
}

@media (max-width: 640px) {
  .hero {
    gap: 1.35rem;
  }

  .metrics-grid > .panel {
    padding: 1.2rem;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 0.4rem;
  }

  .calendar-day,
  .calendar-day--empty {
    min-height: 76px;
  }

  .calendar-day-count {
    font-size: 1rem;
  }

  .terminal-note {
    width: 100%;
  }
}
