:root {
  --page-top: #30466a;
  --page-bottom: #0b0f16;
  --text: #9999b0;
  --text-strong: #ffffff;
  --text-soft: #aaaab0;
  --blue: #7a90b7;
  --blue-soft: #889dbc;
  --panel: rgba(0, 0, 0, 0.28);
  --panel-strong: rgba(0, 0, 0, 0.44);
  --line: rgba(153, 153, 176, 0.22);
  --dashboard-columns: minmax(420px, 1.35fr) minmax(260px, 0.85fr) minmax(260px, 0.85fr);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  color: var(--text);
  font-family: sans-serif, "Helvetica Neue", Tahoma, Arial;
  font-size: 12pt;
  line-height: 1.2em;
  background: var(--page-bottom);
}

#backgrounds {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.bg-layer {
  position: absolute;
  inset: 0;
  transform: translateZ(0);
}

#layer0 {
  z-index: 0;
  background: linear-gradient(to bottom, var(--page-top) 0%, var(--page-bottom) 100%);
}

#layer1 {
  z-index: 1;
  background-image: url("../images/stars1.png");
  background-repeat: repeat;
  background-position: 0 0;
  animation: stars-slide 90s linear infinite;
}

#layer2 {
  z-index: 2;
  background-image: url("../images/stars2.png");
  background-repeat: repeat;
  background-position: 0 0;
  animation: stars-slide 70s linear infinite reverse;
}

#layer3 {
  z-index: 3;
  background-image: url("../images/grid.png");
  background-repeat: repeat;
  background-size: contain;
  opacity: 0.62;
}

#layer4 {
  z-index: 4;
  background-image: url("../images/circles.png");
  background-repeat: repeat;
  background-size: cover;
  opacity: 0.92;
}

@keyframes stars-slide {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 1000px 0;
  }
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  color: var(--text-strong);
}

.app-nav {
  min-height: 54px;
  background: rgba(11, 15, 22, 0.18);
  border-bottom: 1px solid rgba(153, 153, 176, 0.16);
  backdrop-filter: blur(4px);
}

.navbar-brand {
  color: var(--text);
  font-weight: 500;
  letter-spacing: 0;
}

.navbar-brand:hover,
.nav-link,
.nav-link:hover,
.navbar-nav .nav-link.show {
  color: var(--text);
}

.navbar-brand:hover,
.nav-link:hover {
  color: var(--text-strong);
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-link.active:hover,
.navbar-nav .nav-link.active:focus {
  color: var(--text-strong);
}

.app-shell {
  max-width: 1440px;
  padding: 18px 24px 28px;
}

.app-footer {
  padding: 8px 0 0;
  color: var(--text-soft);
  font-size: 0.78rem;
  text-align: center;
}

.moon-dashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.control-bar {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, minmax(120px, 0.8fr)) auto;
  gap: 10px;
  align-items: end;
  min-width: 0;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 20px;
}

.control-bar label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.control-bar span {
  color: var(--text-soft);
  font-size: 0.76rem;
}

.control-bar input {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 32px;
  padding: 0 10px;
  color: #0b0f16;
  background: #d8dfe8;
  border: 0;
  border-radius: 20px;
  outline: none;
}

.control-bar input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
}

.control-bar input:focus {
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.42);
}

.control-bar button {
  height: 32px;
  padding: 0 18px;
  color: var(--text-strong);
  background: rgba(122, 144, 183, 0.4);
  border: 1px solid rgba(122, 144, 183, 0.72);
  border-radius: 20px;
}

.control-bar button:hover {
  background: rgba(122, 144, 183, 0.62);
}

.summary-grid {
  display: grid;
  grid-template-columns: var(--dashboard-columns);
  gap: 16px;
}

.moon-visual-panel,
.data-panel,
.day-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.calendar-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.calendar-day {
  border-radius: 0;
}

.moon-visual-panel {
  position: relative;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 22px;
  align-items: center;
  min-height: 300px;
  padding: 22px;
  overflow: hidden;
}

.moon-visual-media {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.moon-image-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
}

.moon-image-wrap::before {
  content: "";
  position: absolute;
  inset: -18px;
  border: 1px solid rgba(153, 153, 176, 0.28);
  border-radius: 50%;
}

.moon-image-wrap img {
  width: 210px;
  height: 210px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.25));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--blue);
  font-weight: 500;
  letter-spacing: 0;
}

h1 {
  color: var(--text-strong);
  font-size: clamp(2.2rem, 4vw, 4.4rem);
  line-height: 1;
}

h2 {
  font-size: 1.15rem;
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(150px, 230px);
  gap: 8px;
  width: 100%;
  margin-top: 0;
}

.metric-row div {
  min-height: 64px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(153, 153, 176, 0.12);
  border-radius: 20px;
  overflow: hidden;
  text-align: left;
}

.metric-row span {
  display: block;
  color: var(--text-strong);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.metric-row small,
.data-list dt,
.section-header span,
.day-phase {
  color: var(--text-soft);
}

.metric-row small {
  display: block;
  width: 100%;
  line-height: 1.15;
}

.metric-row .moon-illumination-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.moon-illumination-trend {
  display: inline-block;
  color: var(--blue);
  font-size: 1.05rem;
  line-height: 1.1;
}

.moon-illumination-trend.waning {
  color: var(--text-soft);
}

.data-panel {
  padding: 18px;
}

.data-list {
  display: grid;
  gap: 6px;
  margin: 14px 0 0;
}

.data-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(153, 153, 176, 0.13);
}

.data-list dt,
.data-list dd {
  margin: 0;
}

.data-list dd {
  color: var(--text-strong);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sun-data-panel .data-list dt {
  color: #EBD6A8;
}

.phase-events {
  margin-top: 16px;
  padding-top: 14px;
}

.moon-visual-events {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(153, 153, 176, 0.13);
}

.phase-events h2 {
  margin-bottom: 10px;
}

.phase-event-list {
  display: grid;
  gap: 8px;
}

.phase-event-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  min-height: 32px;
}

.phase-event-item img {
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
}

.phase-event-item span {
  color: var(--text);
}

.phase-event-item time {
  grid-column: 2;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.dashboard-tabs {
  display: grid;
  gap: 12px;
}

.app-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid rgba(153, 153, 176, 0.16);
}

.app-tab {
  min-height: 34px;
  padding: 0 14px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
}

.app-tab:hover,
.app-tab.active {
  color: var(--text-strong);
  border-bottom-color: var(--blue);
}

.tab-pane:focus {
  outline: none;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.calendar-panel,
.day-panel {
  padding: 18px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

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

.weekday {
  height: 30px;
  color: var(--text-strong);
  font-size: 0.78rem;
  text-align: center;
}

.calendar-day {
  position: relative;
  min-height: 112px;
  padding: 8px;
  display: grid;
  grid-template-rows: 20px 56px 36px;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  border: 1px solid rgba(153, 153, 176, 0.08);
  overflow: hidden;
}

.calendar-day:hover {
  color: var(--text-strong);
}

.calendar-day:hover img {
  border-radius: 50%;
  box-shadow: 0 0 8px 0 var(--text-strong);
}

.calendar-day.today::before {
  content: "";
  position: absolute;
  top: calc(8px + 20px + 28px);
  left: 50%;
  width: 100px;
  height: 100px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.calendar-day.selected::after,
.calendar-day.event-day::after {
  content: "";
  position: absolute;
  top: calc(8px + 20px + 28px);
  left: 50%;
  width: 100px;
  height: 100px;
  background: url("../images/gr3.png") top left no-repeat;
  z-index: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.calendar-day.event-day::after {
  background-position: -10px -10px;
  opacity: 0.65;
}

.calendar-day.selected::after {
  background-position: -10px -122px;
  opacity: 0.82;
}

.calendar-day.muted {
  background: rgba(0, 0, 0, 0.08);
}

.day-number,
.day-phase,
.calendar-day img {
  position: relative;
  z-index: 1;
}

.day-number {
  justify-self: end;
  color: var(--text-strong);
  font-weight: 400;
}

.calendar-day img {
  align-self: center;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  object-fit: contain;
}

.day-phase {
  align-self: end;
  min-height: 32px;
  max-height: 36px;
  width: 100%;
  display: -webkit-box;
  padding: 1px 3px;
  overflow: hidden;
  font-size: 0.875rem;
  line-height: 1.15;
  text-align: center;
  background: transparent;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.calendar-day.event-day .day-phase {
  color: var(--text-strong);
}

.day-phase.event-phase {
  display: block;
  max-height: 40px;
  -webkit-line-clamp: unset;
}

.day-phase-time {
  display: block;
  color: var(--text-strong);
  font-size: 0.82em;
  line-height: 1.1;
}

.day-timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(153, 153, 176, 0.13);
}

.timeline-item time {
  color: var(--blue-soft);
  font-variant-numeric: tabular-nums;
}

.timeline-item strong {
  display: block;
  color: var(--text-strong);
  font-weight: 400;
  line-height: 1.2;
}

.timeline-item span {
  display: block;
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.8rem;
  line-height: 1.15;
}

.timeline-item-sun time,
.timeline-item-sun strong,
.timeline-item-sun span {
  color: #EBD6A8;
}

.calendar-grid .calendar-day {
  border-radius: 0;
}

.moonphases-panel {
  display: grid;
  gap: 18px;
}

.moonphases-comparison {
  display: grid;
  grid-template-columns: var(--dashboard-columns);
  gap: 16px;
  align-items: start;
  justify-items: stretch;
}

.moonphases-visual {
  display: grid;
  gap: 14px;
  justify-items: center;
  min-width: 0;
}

.phase-wheel {
  --phase-radius: 171px;
  --marker-radius: var(--phase-radius);
  --phase-node-size: 58px;
  --phase-center-size: 132px;
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 1;
  margin: 0 auto;
  isolation: isolate;
}

.phase-wheel-arcs,
.phase-wheel-marker,
.phase-wheel-node {
  position: absolute;
  top: 50%;
  left: 50%;
}

.phase-wheel-arcs {
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: translate(-50%, -50%);
}

.phase-wheel-arcs path {
  fill: none;
  stroke: rgba(136, 157, 188, 0.52);
  stroke-linecap: round;
  stroke-width: 2.4;
  filter: drop-shadow(0 0 8px rgba(122, 144, 183, 0.2));
}

.phase-wheel-marker {
  z-index: 5;
  width: 13px;
  height: 13px;
  background: var(--text-strong);
  border: 2px solid rgba(122, 144, 183, 0.95);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.44);
  cursor: default;
  outline: none;
  transform:
    translate(-50%, -50%)
    rotate(var(--current-angle))
    translateX(var(--marker-radius))
    rotate(calc(-1 * var(--current-angle)));
}

.phase-wheel-marker-popup {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 9;
  min-width: 190px;
  padding: 9px 11px;
  color: var(--text-strong);
  background: rgba(11, 15, 22, 0.82);
  border: 1px solid rgba(136, 157, 188, 0.66);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.phase-wheel-marker-popup div {
  display: grid;
  gap: 2px;
}

.phase-wheel-marker-popup div + div {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(136, 157, 188, 0.18);
}

.phase-wheel-marker-popup span {
  color: var(--text-soft);
  font-size: 0.68rem;
  line-height: 1;
}

.phase-wheel-marker-popup strong {
  color: var(--text-strong);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.15;
}

.phase-wheel-marker:hover .phase-wheel-marker-popup,
.phase-wheel-marker:focus .phase-wheel-marker-popup,
.phase-wheel-marker:focus-within .phase-wheel-marker-popup {
  opacity: 1;
  transform: translate(-50%, 0);
}

.phase-wheel-node {
  z-index: 3;
  width: var(--phase-node-size);
  height: var(--phase-node-size);
  display: grid;
  place-items: center;
  cursor: default;
  transform:
    translate(-50%, -50%)
    rotate(var(--phase-angle))
    translateX(var(--phase-radius))
    rotate(calc(-1 * var(--phase-angle)));
}

.phase-wheel-node img {
  width: var(--phase-node-size);
  height: var(--phase-node-size);
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.18));
}

.phase-wheel-node::after {
  content: attr(data-phase-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 8;
  width: max-content;
  max-width: 160px;
  padding: 6px 9px;
  color: var(--text-strong);
  background: rgba(11, 15, 22, 0.78);
  border: 1px solid rgba(136, 157, 188, 0.62);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  font-size: 0.76rem;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.phase-wheel-node:hover::after,
.phase-wheel-node:focus-within::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.phase-wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: var(--phase-center-size);
  height: var(--phase-center-size);
  transform: translate(-50%, -50%);
}

.phase-wheel-center img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.24));
}

.lunar-cycle-note {
  width: min(100%, 430px);
  padding: 15px 16px;
  color: var(--text);
  background: rgba(11, 15, 22, 0.44);
  border: 1px solid rgba(136, 157, 188, 0.46);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.lunar-cycle-note h3 {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.1;
}

.lunar-cycle-note p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.42;
}

.lunar-cycle-note strong {
  font-weight: 600;
}

.lunar-cycle-note p + p {
  margin-top: 8px;
}

.moonphases-table-wrap {
  grid-column: 2 / 4;
  min-width: 0;
  overflow-x: auto;
}

.moonphases-table {
  width: 100%;
  border-collapse: collapse;
}

.moonphases-table th,
.moonphases-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(153, 153, 176, 0.13);
  text-align: left;
  vertical-align: middle;
}

.moonphases-table th {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 500;
}

.moonphases-table td {
  color: var(--text-strong);
}

.moonphases-table time {
  font-variant-numeric: tabular-nums;
}

.moonphase-name {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.moonphase-name img {
  width: 30px;
  height: 30px;
}

.moon-zodiac-panel {
  display: grid;
  gap: 18px;
}

.zodiac-comparison {
  display: grid;
  grid-template-columns: var(--dashboard-columns);
  gap: 16px;
  align-items: start;
  justify-items: stretch;
}

.zodiac-visual {
  display: grid;
  gap: 14px;
  justify-items: center;
  min-width: 0;
}

.zodiac-position-list,
.zodiac-tables {
  display: grid;
  gap: 10px;
  justify-self: start;
  width: 100%;
}

.zodiac-tables {
  grid-column: 2 / 4;
  gap: 18px;
}

.zodiac-note {
  width: min(100%, 430px);
  padding: 15px 16px;
  color: var(--text);
  background: rgba(11, 15, 22, 0.44);
  border: 1px solid rgba(136, 157, 188, 0.46);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.zodiac-current-box {
  width: min(100%, 430px);
  padding: 14px;
  color: var(--text);
  background: rgba(11, 15, 22, 0.58);
  border: 1px solid rgba(136, 157, 188, 0.52);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.zodiac-current-time {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(153, 153, 176, 0.16);
}

.zodiac-current-time span,
.zodiac-current-system dt {
  color: var(--text-soft);
  font-size: 0.76rem;
}

.zodiac-current-time time {
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.zodiac-current-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.zodiac-current-system {
  min-width: 0;
}

.zodiac-current-system h3 {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.1;
}

.zodiac-current-system dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.zodiac-current-system div {
  display: grid;
  gap: 2px;
}

.zodiac-current-system dt,
.zodiac-current-system dd {
  margin: 0;
}

.zodiac-current-system dd {
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.zodiac-current-arc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(153, 153, 176, 0.2);
}

.zodiac-current-arc span {
  color: #EBD6A8;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.1;
}

.zodiac-current-arc strong {
  color: var(--text-strong);
  font-size: 1rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.zodiac-note h3 {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.1;
}

.zodiac-note p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.42;
}

.zodiac-note strong {
  font-weight: 600;
}

.zodiac-note p + p {
  margin-top: 8px;
}

.zodiac-table-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.zodiac-table-section.is-loading {
  opacity: 0.68;
  pointer-events: none;
}

.section-header.compact {
  margin-bottom: 0;
}

.sidereal-selector {
  display: flex;
  gap: 10px;
  align-items: end;
  justify-content: space-between;
}

.sidereal-selector label {
  display: grid;
  gap: 5px;
  min-width: min(100%, 260px);
}

.sidereal-selector span {
  color: var(--text-soft);
  font-size: 0.76rem;
}

.sidereal-selector select {
  height: 32px;
  padding: 0 10px;
  color: #0b0f16;
  background: #d8dfe8;
  border: 0;
  border-radius: 20px;
}

.sidereal-selector button {
  height: 32px;
  padding: 0 14px;
  color: var(--text-strong);
  background: rgba(122, 144, 183, 0.4);
  border: 1px solid rgba(122, 144, 183, 0.72);
  border-radius: 20px;
}

.zodiac-position-item {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(153, 153, 176, 0.13);
}

.zodiac-position-item strong {
  display: block;
  color: var(--text-strong);
  font-weight: 400;
}

.zodiac-position-item span {
  display: block;
  margin-top: 3px;
  color: var(--text-soft);
}

.zodiac-wheel {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.zodiac-wheel-bg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.zodiac-wheel-moon,
.zodiac-wheel-sun {
  --moon-left: 50%;
  --moon-top: 50%;
  position: absolute;
  top: var(--moon-top);
  left: var(--moon-left);
  object-fit: contain;
  transform: translate(-50%, -50%);
  transform-origin: center;
}

.zodiac-wheel-moon {
  z-index: 3;
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.42));
}

.zodiac-wheel-sun {
  z-index: 2;
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 0 12px rgba(235, 214, 168, 0.48));
}

.zodiac-changes-table {
  margin-top: 4px;
}

.rise-set-panel {
  display: grid;
  gap: 18px;
}

.rise-set-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.18fr) minmax(320px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.rise-set-sky-panel,
.rise-set-table-section {
  min-width: 0;
}

.rise-set-sky {
  position: relative;
  width: 100%;
  min-height: 560px;
  aspect-ratio: 1.12;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(153, 153, 176, 0.13);
  border-radius: 8px;
}

.rise-set-body-switches {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  gap: 7px;
  padding: 5px;
  background: rgba(11, 15, 22, 0.58);
  border: 1px solid rgba(136, 157, 188, 0.38);
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

.rise-set-hemisphere-switches {
  position: absolute;
  top: 58px;
  left: 10px;
  z-index: 2;
  display: flex;
  gap: 7px;
  padding: 5px;
  background: rgba(11, 15, 22, 0.58);
  border: 1px solid rgba(136, 157, 188, 0.38);
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

.rise-set-zoom-controls {
  position: absolute;
  top: 50%;
  left: 10px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 5px;
  background: rgba(11, 15, 22, 0.58);
  border: 1px solid rgba(136, 157, 188, 0.38);
  border-radius: 8px;
  transform: translateY(-50%);
  backdrop-filter: blur(4px);
}

.rise-set-body-switch,
.rise-set-mode-switch,
.rise-set-zoom-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(153, 153, 176, 0.18);
  border-radius: 8px;
  opacity: 0.45;
}

.rise-set-body-switch.active,
.rise-set-mode-switch.active,
.rise-set-zoom-button.active {
  background: rgba(122, 144, 183, 0.26);
  border-color: rgba(136, 157, 188, 0.7);
  opacity: 1;
}

.rise-set-zoom-button {
  color: #f3f5fb;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
}

.rise-set-body-switch img,
.rise-set-mode-switch img,
.rise-set-zoom-button img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.rise-set-mode-switch img {
  border-radius: 4px;
  filter: brightness(1.55) contrast(1.18) saturate(1.08);
}

.rise-set-sky canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.rise-set-sky-tooltip {
  position: absolute;
  z-index: 4;
  max-width: 190px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-line;
  pointer-events: none;
  background: rgba(11, 15, 22, 0.88);
  border: 1px solid rgba(136, 157, 188, 0.54);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
  opacity: 0;
  transform: translate3d(0, 2px, 0);
  transition: opacity 120ms ease, transform 120ms ease;
}

.rise-set-sky-tooltip.visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.rise-set-table td:first-child {
  color: var(--blue-soft);
}

.rise-set-table .rise-set-row-sun td {
  color: #EBD6A8;
}

.rise-set-table .rise-set-row-event td {
  color: var(--rise-set-event-color);
}

.rise-set-table .rise-set-row-moon.rise-set-event-rise {
  --rise-set-event-color: #86b9ff;
}

.rise-set-table .rise-set-row-moon.rise-set-event-set {
  --rise-set-event-color: #456ca8;
}

.rise-set-table .rise-set-row-sun.rise-set-event-rise {
  --rise-set-event-color: #ff8a26;
}

.rise-set-table .rise-set-row-sun.rise-set-event-set {
  --rise-set-event-color: #d3322d;
}

.rise-set-parameters-header {
  margin-top: 18px;
}

.rise-set-table td:last-child {
  font-variant-numeric: tabular-nums;
}

.nav-link.active {
  color: var(--text-strong);
}

.news-page {
  display: grid;
  gap: 16px;
}

.news-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.news-header h1 {
  font-size: clamp(2.5rem, 5vw, 5rem);
}

.news-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 8px;
}

.news-stats div {
  min-height: 64px;
  padding: 10px 12px;
  display: grid;
  align-content: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(153, 153, 176, 0.12);
  border-radius: 20px;
}

.news-stats span {
  color: var(--text-strong);
  font-size: 1.3rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.news-stats small {
  color: var(--text-soft);
  line-height: 1.15;
}

.news-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.news-sidebar,
.news-main {
  display: grid;
  gap: 16px;
}

.news-panel,
.news-featured,
.news-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.news-panel {
  padding: 18px;
}

.news-filter-list,
.news-source-list {
  display: grid;
  gap: 8px;
}

.news-filter,
.news-source-list a {
  min-height: 36px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 11px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(153, 153, 176, 0.12);
  border-radius: 20px;
}

.news-filter:hover,
.news-filter.active,
.news-source-list a:hover,
.news-source-list a.active {
  color: var(--text-strong);
  background: rgba(122, 144, 183, 0.28);
  border-color: rgba(122, 144, 183, 0.52);
}

.news-source-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-source-list small {
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.news-source-list em {
  color: var(--blue-soft);
  font-size: 0.68rem;
  font-style: normal;
}

.news-featured {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1fr);
  min-height: 320px;
  overflow: hidden;
}

.news-featured-image,
.news-card-image {
  display: block;
  min-width: 0;
  background: rgba(0, 0, 0, 0.24);
}

.news-featured-image img,
.news-card-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.news-featured-body {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 24px;
}

.news-featured h2,
.news-card h2 {
  margin: 0;
  color: var(--text-strong);
  line-height: 1.12;
}

.news-featured h2 {
  font-size: clamp(1.7rem, 3vw, 3rem);
}

.news-featured h2 a,
.news-card h2 a {
  color: inherit;
}

.news-featured p,
.news-card p,
.news-empty p {
  margin: 0;
  color: var(--text);
  line-height: 1.42;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--text-soft);
  font-size: 0.76rem;
  line-height: 1.1;
}

.news-meta span,
.news-meta time {
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(153, 153, 176, 0.12);
  border-radius: 20px;
}

.news-stream {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.news-card {
  min-height: 190px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  overflow: hidden;
}

.news-featured.news-featured-text,
.news-card.news-card-text {
  grid-template-columns: 1fr;
}

.news-card-body {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 16px;
}

.news-card h2 {
  font-size: 1rem;
}

.news-card p {
  font-size: 0.9rem;
}

.news-empty {
  padding: 24px;
}

.news-empty h2 {
  margin-bottom: 8px;
}

.apps-page {
  display: grid;
  gap: 16px;
}

.apps-header,
.apps-video-section,
.apps-gallery-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.apps-header {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(420px, 1.14fr);
  gap: 24px;
  align-items: center;
  padding: 24px;
  overflow: hidden;
}

.apps-header h1 {
  font-size: clamp(3rem, 6vw, 6.5rem);
}

.apps-header p:not(.eyebrow) {
  max-width: 560px;
  margin: 16px 0 0;
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1.45;
}

.apps-header-preview {
  position: relative;
  min-height: 330px;
}

.apps-header-preview img {
  position: absolute;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 24px 44px rgba(0, 0, 0, 0.45));
}

.apps-preview-mac {
  right: 0;
  bottom: 0;
  width: min(88%, 720px);
  border: 1px solid rgba(153, 153, 176, 0.28);
  border-radius: 8px;
}

.apps-preview-phone {
  left: 0;
  bottom: 0;
  z-index: 2;
  width: min(26%, 176px);
  border: 1px solid rgba(153, 153, 176, 0.28);
  border-radius: 18px;
}

.apps-video-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.86fr) minmax(260px, 1.14fr);
  gap: 24px;
  align-items: center;
  padding: 22px;
}

.apps-video-copy h2 {
  color: var(--text-strong);
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.apps-video-frame {
  justify-self: center;
  width: min(100%, 360px);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(153, 153, 176, 0.2);
  border-radius: 20px;
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.32);
}

.apps-video-frame iframe {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 20;
  height: auto;
}

.apps-gallery-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.apps-device-tabs {
  overflow-x: auto;
}

.apps-gallery-content {
  min-width: 0;
}

.apps-shot-grid {
  display: grid;
  gap: 16px;
  align-items: start;
}

.apps-shot-grid-phone {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.apps-shot-grid-wide {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.apps-shot-grid-tablet {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.apps-shot-grid-watch {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.apps-shot {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(153, 153, 176, 0.12);
  border-radius: 8px;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.apps-shot:hover {
  background: rgba(122, 144, 183, 0.2);
  border-color: rgba(122, 144, 183, 0.58);
  transform: translateY(-2px);
}

.apps-shot img {
  display: block;
  max-width: 100%;
  object-fit: contain;
}

.apps-shot-phone img {
  width: min(100%, 220px);
  border-radius: 18px;
}

.apps-shot-wide img {
  width: 100%;
  border-radius: 6px;
}

.apps-shot-tablet img {
  width: min(100%, 360px);
  border-radius: 8px;
}

.apps-shot-watch img {
  width: min(100%, 210px);
  border-radius: 18px;
}

@media (max-width: 1100px) {
  .control-bar,
  .summary-grid,
  .work-grid,
  .moon-visual-panel,
  .zodiac-comparison,
  .moonphases-comparison,
  .rise-set-grid {
    grid-template-columns: 1fr;
  }

  .rise-set-sky {
    min-height: 460px;
  }

  .moon-image-wrap {
    margin: 0 auto;
  }

  .zodiac-tables {
    grid-column: auto;
  }

  .moonphases-table-wrap {
    grid-column: auto;
  }

  .zodiac-position-list,
  .zodiac-tables,
  .moonphases-table-wrap {
    justify-self: center;
    width: min(100%, 620px);
  }

  .news-header,
  .news-layout,
  .news-featured,
  .news-stream,
  .apps-header,
  .apps-video-section {
    grid-template-columns: 1fr;
  }

  .apps-header-preview {
    min-height: 290px;
  }

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

@media (max-width: 720px) {
  body {
    font-size: 11pt;
  }

  .app-shell {
    padding: 12px;
  }

  .control-bar {
    overflow: hidden;
  }

  .control-bar input {
    font-size: 1rem;
  }

  .control-bar input[type="date"] {
    text-align: center;
  }

  .metric-row {
    grid-template-columns: 1fr;
  }

  .calendar-day {
    min-height: 88px;
    padding: 6px;
    grid-template-rows: 18px 42px 26px;
  }

  .calendar-day.selected::after,
  .calendar-day.event-day::after,
  .calendar-day.today::before {
    top: calc(6px + 18px + 21px);
    transform: translate(-50%, -50%) scale(0.72);
  }

  .calendar-day img {
    width: 40px;
    height: 40px;
  }

  .day-phase {
    display: -webkit-box;
    min-height: 24px;
    max-height: 26px;
    font-size: 0.78rem;
    -webkit-line-clamp: 1;
  }

  .day-phase.event-phase {
    display: block;
    max-height: 30px;
  }

  .moonphases-table th,
  .moonphases-table td {
    padding: 8px;
  }

  .moonphase-name img {
    width: 24px;
    height: 24px;
  }

  .phase-wheel {
    --phase-radius: 135px;
    --phase-node-size: 42px;
    --phase-center-size: 96px;
    width: min(100%, 340px);
  }

  .zodiac-wheel-moon {
    width: 21px;
    height: 21px;
  }

  .zodiac-wheel-sun {
    width: 34px;
    height: 34px;
  }

  .zodiac-comparison {
    grid-template-columns: 1fr;
  }

  .zodiac-position-list,
  .zodiac-tables,
  .moonphases-table-wrap {
    justify-self: center;
    width: 100%;
  }

  .sidereal-selector {
    align-items: stretch;
    flex-direction: column;
  }

  .zodiac-current-time {
    align-items: start;
    flex-direction: column;
  }

  .zodiac-current-time time {
    text-align: left;
  }

  .zodiac-current-grid {
    grid-template-columns: 1fr;
  }

  .zodiac-current-arc {
    grid-template-columns: 1fr;
  }

  .rise-set-sky {
    min-height: 340px;
  }

  .news-header,
  .news-panel,
  .news-featured-body,
  .news-card-body,
  .apps-header,
  .apps-video-section,
  .apps-gallery-panel {
    padding: 14px;
  }

  .news-stats,
  .news-sidebar,
  .news-card {
    grid-template-columns: 1fr;
  }

  .news-card-image {
    height: 170px;
  }

  .apps-header {
    min-height: auto;
  }

  .apps-header-preview {
    min-height: 230px;
  }

  .apps-preview-phone {
    width: min(30%, 128px);
  }

  .apps-shot-grid-phone {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  }

  .apps-shot-grid-wide,
  .apps-shot-grid-tablet {
    grid-template-columns: 1fr;
  }
}

/* Legacy Deluxe Moon app page. Scoped to /Apps so the dashboard/news UI keeps its current style. */
.apps-deluxemoon-page {
  display: block;
  width: 100vw;
  min-height: calc(100vh - 54px);
  margin: -18px calc(50% - 50vw) -28px;
  padding: 54px 0 52px;
  overflow: hidden;
  color: #ffffff;
  background: transparent;
  /*
    To restore the legacy page background, replace the transparent background above with:
    background-color: #0a0e15;
    background-image: url("../images/apps/legacy/deluxemoon/space_bg_60.jpg"), url("../images/apps/legacy/deluxemoon/space_bg_strip.png");
    background-repeat: no-repeat, repeat-y;
    background-position: center 0, center 0;
    background-size: 1920px auto, 1920px auto;
  */
}

.apps-deluxemoon-page .apps-content {
  width: min(1080px, 90vw);
  margin: 0 auto;
  position: relative;
}

.apps-sprite {
  display: block;
  background-image: url("../images/apps/legacy/deluxemoon/sprites.png");
  background-repeat: no-repeat;
}

.apps-bg-moon-big { width: 600px; height: 600px; background-position: -10px -10px; }
.apps-bg-astro { width: 428px; height: 428px; background-position: -10px -620px; }
.apps-bg-devices { width: 423px; height: 309px; background-position: -10px -1058px; }
.apps-bg-iwatch { width: 140px; height: 255px; background-position: -448px -620px; }
.apps-bg-astronaut { width: 271px; height: 236px; background-position: -10px -1377px; }
.apps-bg-video-play { width: 88px; height: 88px; background-position: -443px -1058px; }
.apps-bg-appstore { width: 225px; height: 78px; background-position: -291px -1377px; }
.apps-bg-winstore { width: 248px; height: 78px; background-position: -10px -1623px; }
.apps-bg-googleplay { width: 225px; height: 78px; background-position: -268px -1623px; }
.apps-bg-macappstore { width: 260px; height: 78px; background-position: -10px -1711px; }
.apps-bg-app-icon { width: 64px; height: 64px; background-position: -541px -1058px; }
.apps-bg-arrow-left-b { width: 24px; height: 61px; background-position: -526px -1377px; }
.apps-bg-arrow-right-b { width: 24px; height: 61px; background-position: -560px -1377px; }
.apps-bg-arrow-right-w { width: 24px; height: 60px; background-position: -503px -1623px; }
.apps-bg-astro-pics { width: 402px; height: 51px; background-position: -10px -1799px; }
.apps-bg-ipad-pic { width: 40px; height: 50px; background-position: -537px -1623px; }
.apps-bg-imac-pic { width: 54px; height: 44px; background-position: -280px -1711px; }
.apps-bg-up-arrow-circle { width: 36px; height: 36px; background-position: -344px -1711px; }
.apps-bg-twitt { width: 36px; height: 36px; background-position: -390px -1711px; }
.apps-bg-facebook { width: 36px; height: 36px; background-position: -436px -1711px; }
.apps-bg-gplus { width: 36px; height: 36px; background-position: -482px -1711px; }
.apps-bg-iphone-pic { width: 18px; height: 34px; background-position: -587px -1623px; }
.apps-bg-left-arrow-triangle { width: 12px; height: 30px; background-position: -598px -620px; }
.apps-bg-five-stars { width: 106px; height: 18px; background-position: -422px -1799px; }
.apps-bg-page-dot { width: 12px; height: 12px; background-position: -594px -1377px; }

.apps-hero-section {
  padding: 0 0 76px;
}

.apps-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 48%) minmax(0, 52%);
  align-items: start;
  min-height: 600px;
}

.apps-hero-copy {
  z-index: 1;
  min-width: 0;
  padding-top: 28px;
}

.apps-hero-copy h1 {
  max-width: 450px;
  margin: 0 0 28px;
  color: #ffffff;
  font-size: 2.75rem;
  font-weight: 400;
  line-height: 1.03;
}

.apps-hero-copy p {
  max-width: 460px;
  margin: 0;
  color: #ffffff;
  font-size: 1rem;
  line-height: 1.2;
}

.apps-hero-copy p + p,
.apps-intro-copy p + p,
.apps-watch-copy p + p {
  margin-top: 20px;
}

.apps-deluxemoon-page .apps-blue-text,
.apps-watch-copy {
  color: #ffffff;
}

.apps-bg-devices {
  margin-top: 20px;
}

.apps-hero-moon {
  position: relative;
  min-height: 600px;
}

.apps-bg-moon-big {
  position: absolute;
  top: 0;
  right: -52px;
}

.apps-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 50%) minmax(0, 50%);
  gap: 30px;
  align-items: start;
  margin-top: 22px;
}

.apps-intro-copy {
  min-width: 0;
  max-width: 460px;
  padding-top: 36px;
  color: var(--blue);
  font-size: 1rem;
  line-height: 1.2;
}

.apps-large-copy {
  font-size: inherit;
  line-height: inherit;
}

.apps-watch-copy {
  min-width: 0;
  display: grid;
  grid-template-columns: 140px minmax(0, 270px);
  gap: 28px;
  align-items: start;
  padding-top: 36px;
  font-size: 1rem;
  line-height: 1.2;
}

.apps-watch-copy p {
  margin: 0;
}

.apps-screens-section {
  padding: 46px 0 0;
}

.apps-screens-panel {
  padding: 18px 20px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.apps-screens-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: end;
}

.apps-screens-title {
  grid-column: 1;
}

.apps-screens-title h2 {
  max-width: 100%;
  margin: 0;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.2;
}

.apps-screens-title p {
  margin: 0;
  color: var(--blue);
  font-size: 14px;
  line-height: 1.2;
}

.apps-device-types {
  grid-column: 2;
  display: flex;
  gap: 42px;
  align-items: end;
  justify-content: center;
}

.apps-device-type {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 58px;
  padding: 0;
  color: #ffffff;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.apps-device-icon-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
}

.apps-device-type .apps-sprite {
  opacity: 0.48;
}

.apps-device-type:hover .apps-sprite {
  opacity: 0.7;
}

.apps-device-type.active .apps-sprite {
  opacity: 1;
}

.apps-device-type span:last-child {
  color: #ffffff;
  font-size: 14px;
  line-height: 1.2;
}

.apps-screens-body {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 86px;
  gap: 22px;
  align-items: center;
  margin: 40px 0 20px;
}

.apps-screen-arrow {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  opacity: 0.82;
  cursor: pointer;
}

.apps-screen-arrow:hover {
  opacity: 1;
}

.apps-screen-arrow .apps-sprite {
  width: 38px;
  height: 38px;
  background: none;
  border-color: var(--blue);
  border-style: solid;
  border-width: 0 0 7px 7px;
}

.apps-screen-arrow-left .apps-sprite {
  transform: rotate(45deg);
}

.apps-screen-arrow-right .apps-sprite {
  transform: rotate(225deg);
}

.apps-screens-window {
  min-width: 0;
}

.apps-screens-track {
  display: none;
  gap: 56px;
  align-items: center;
  height: 350px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 6px 22px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(122, 144, 183, 0.72) rgba(0, 0, 0, 0.2);
}

.apps-screens-track::-webkit-scrollbar {
  height: 10px;
}

.apps-screens-track::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 20px;
}

.apps-screens-track::-webkit-scrollbar-thumb {
  background: rgba(122, 144, 183, 0.72);
  border-radius: 20px;
}

.apps-screens-track::-webkit-scrollbar-thumb:hover {
  background: var(--blue);
}

.apps-screens-track.active {
  display: flex;
}

.apps-screenshot {
  flex: 0 0 auto;
  position: relative;
  display: grid;
  place-items: center;
  height: 320px;
  max-width: 100%;
  scroll-snap-align: center;
}

.apps-screenshot img {
  display: block;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.45));
}

.apps-screenshot-phone {
  width: 148px;
}

.apps-screenshot-tablet {
  width: 240px;
}

.apps-screenshot-mac {
  width: 420px;
}

.apps-screenshot-video {
  width: 148px;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.45);
}

.apps-screenshot-video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.apps-screenshot-video .apps-bg-video-play {
  position: absolute;
  inset: 0;
  margin: auto;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55));
}

.apps-screen-pager {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.apps-screen-pager span {
  width: 12px;
  height: 12px;
  background: var(--blue-soft);
  border-radius: 50%;
  opacity: 0.46;
}

.apps-screen-pager span.active {
  background: var(--blue);
  opacity: 1;
}

.apps-feature-section {
  margin-top: 64px;
  padding: 58px 0 74px;
  background: rgba(0, 0, 0, 0.18);
}

.apps-feature-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.58fr) minmax(320px, 0.42fr);
  gap: 76px;
  align-items: center;
}

.apps-feature-copy {
  max-width: 470px;
}

.apps-feature-copy h2 {
  margin: 0 0 24px;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.16;
}

.apps-feature-copy p {
  margin: 0;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.2;
}

.apps-feature-copy p + p {
  margin-top: 34px;
}

.apps-feature-copy .apps-feature-highlight {
  color: var(--blue);
  font-weight: 400;
}

.apps-feature-copy .apps-bg-astro-pics {
  margin-top: 52px;
}

.apps-store-section {
  padding: 76px 0 70px;
}

.apps-store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  justify-content: center;
}

.apps-store-links a {
  display: block;
  padding: 0;
  border-radius: 8px;
  transition: opacity 140ms ease, transform 140ms ease;
}

.apps-store-links a:hover {
  opacity: 0.86;
  transform: translateY(-2px);
}

@media (max-width: 1160px) {
  .apps-bg-moon-big {
    right: -120px;
    transform: scale(0.86);
    transform-origin: top right;
  }

  .apps-bg-devices {
    transform: scale(0.88);
    transform-origin: left top;
  }
}

@media (max-width: 900px) {
  .apps-deluxemoon-page {
    padding-top: 32px;
  }

  .apps-hero-grid,
  .apps-intro-grid,
  .apps-screens-head {
    grid-template-columns: 1fr;
  }

  .apps-hero-grid {
    min-height: auto;
  }

  .apps-hero-copy {
    padding-top: 0;
  }

  .apps-hero-copy h1 {
    font-size: 38px;
  }

  .apps-hero-moon {
    display: none;
  }

  .apps-bg-devices {
    transform: scale(0.82);
    transform-origin: left top;
    margin-bottom: -56px;
  }

  .apps-intro-grid {
    margin-top: 12px;
  }

  .apps-watch-copy {
    grid-template-columns: 140px minmax(0, 1fr);
  }

  .apps-device-types {
    justify-content: center;
  }

  .apps-screens-body {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 8px;
  }

  .apps-screens-panel {
    padding: 14px 12px 12px;
  }

  .apps-screen-arrow {
    min-height: 220px;
  }

  .apps-screens-track {
    gap: 28px;
  }

  .apps-feature-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    justify-items: center;
  }

  .apps-feature-copy {
    width: min(100%, 520px);
  }
}

@media (max-width: 560px) {
  .apps-deluxemoon-page {
    margin-top: -12px;
  }

  .apps-hero-copy h1 {
    width: 100%;
    max-width: 100%;
    font-size: 32px;
  }

  .apps-hero-copy p,
  .apps-intro-copy,
  .apps-watch-copy {
    width: 100%;
    max-width: 100%;
    font-size: 16px;
  }

  .apps-large-copy {
    font-size: inherit;
  }

  .apps-watch-copy {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .apps-watch-copy div:last-child {
    width: min(100%, 280px);
  }

  .apps-device-types {
    gap: 18px;
  }

  .apps-bg-devices {
    transform: scale(0.7);
    margin-bottom: -86px;
  }

  .apps-screens-body {
    grid-template-columns: 1fr;
  }

  .apps-screen-arrow {
    display: none;
  }

  .apps-screens-track {
    height: 330px;
  }

  .apps-feature-section {
    margin-top: 42px;
    padding: 40px 0 52px;
  }

  .apps-bg-astro {
    transform: scale(0.72);
    transform-origin: center;
    margin: -58px 0;
  }

  .apps-feature-copy h2 {
    font-size: 22px;
  }

  .apps-feature-copy p {
    font-size: 16px;
  }

  .apps-feature-copy .apps-bg-astro-pics {
    transform: scale(0.72);
    transform-origin: left top;
    margin-bottom: -14px;
  }

  .apps-store-links {
    gap: 16px;
  }

  .apps-store-links .apps-sprite {
    transform: scale(0.86);
    transform-origin: center;
  }
}
