:root {
  --bg: #f5f4f2;
  --card: #ffffff;
  --card-soft: #f0efee;
  --text: #1d2230;
  --muted: #707484;
  --line: rgba(22, 29, 47, 0.08);
  --shadow: 0 18px 50px rgba(23, 27, 41, 0.08);
  --navy: #16245d;
  --surface-radius: 28px;
  --planet-main: #39447e;
  --planet-soft: rgba(57, 68, 126, 0.12);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--bg); }
body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top center, rgba(17, 32, 77, 0.04), transparent 30%),
    linear-gradient(180deg, #fbfaf8 0%, #f4f2ef 100%);
  color: var(--text);
}
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button {
  appearance: none;
  border: 0;
  border-radius: 18px;
  padding: 0.95rem 1.2rem;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow);
}
button.secondary {
  background: #ecebf0;
  color: var(--navy);
  box-shadow: none;
}
button.hidden, .hidden { display: none !important; }
input, select {
  width: 100%;
  border: 1px solid rgba(17, 32, 77, 0.08);
  border-radius: 18px;
  padding: 1rem 1rem;
  background: #fff;
  color: var(--text);
}
input::placeholder { color: #a1a3ad; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }

.app-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: calc(16px + var(--safe-top)) 16px calc(104px + var(--safe-bottom));
}
.main-stack {
  display: grid;
  gap: 18px;
}
.view-panel {
  display: block;
}
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.back-link,
.icon-button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(22, 36, 93, 0.06);
  color: var(--navy);
  box-shadow: none;
}
.back-link {
  overflow: hidden;
}
.back-link span:last-child {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.back-link__icon {
  font-size: 1.65rem;
  line-height: 1;
}
.topbar__title-wrap {
  text-align: center;
}
.topbar__eyebrow {
  margin: 0 0 2px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.topbar h1 {
  margin: 0;
  font-size: clamp(1.35rem, 5vw, 2rem);
  color: var(--navy);
}
.panel-soft,
.panel-glow,
.section-card,
.hero-card,
.description-card,
.guidance-card,
.status-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--surface-radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.hero-card,
.section-card,
.status-card,
.description-card,
.guidance-card {
  padding: 18px;
}
.hero-grid {
  display: grid;
  gap: 18px;
}
.chip-row {
  display: grid;
  gap: 12px;
}
.info-chip {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  background: #f2f1f1;
  border-radius: 20px;
  padding: 15px 16px;
}
.info-chip__icon {
  font-size: 1.2rem;
  color: var(--muted);
}
.info-chip__label,
.astro-inline-card__label,
.mini-label,
.section-kicker,
.small-label {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.info-chip strong {
  display: block;
  margin-top: 4px;
  color: var(--navy);
  font-size: 1.15rem;
}
.astro-inline-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.astro-inline-card {
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  border: 1px solid var(--line);
}
.astro-inline-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.08rem;
  color: var(--navy);
}
.planet-strip-wrap {
  overflow: hidden;
}
.planet-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(74px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.planet-chip {
  min-height: 116px;
  border: 0;
  padding: 12px 8px;
  border-radius: 22px;
  background: #ececf1;
  color: #c2c3ca;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.planet-chip strong {
  display: block;
  margin-top: 8px;
  font-size: 0.66rem;
  line-height: 1.1;
  font-weight: 700;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.planet-chip__symbol {
  font-size: 2.15rem;
  line-height: 1;
}
.planet-chip.active {
  background: var(--planet-soft);
  color: var(--planet-main);
}
.summary-shell {
  display: grid;
  gap: 16px;
}
.current-planet-card {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  padding: 22px;
  color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--planet-main) 86%, white 14%), #08112d 100%);
  box-shadow: 0 26px 60px rgba(16, 24, 48, 0.22);
}
.current-planet-card::before,
.current-planet-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.current-planet-card::before {
  width: 180px;
  height: 180px;
  right: -60px;
  top: -40px;
}
.current-planet-card::after {
  width: 90px;
  height: 90px;
  right: 24px;
  top: 24px;
}
.current-planet-card__header {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}
.current-planet-card h2 {
  margin: 4px 0 8px;
  font-size: clamp(2rem, 8vw, 3rem);
}
.current-planet-card__subtitle {
  margin: 0;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.78);
}
.current-planet-card__symbol {
  font-size: clamp(4.2rem, 18vw, 6rem);
  line-height: 1;
  opacity: 0.95;
}
.progress-card {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  padding: 18px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.progress-card__line {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.progress-card__line span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.9);
}
.progress-card__labels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 16px;
  margin-top: 16px;
}
.progress-card__labels strong,
.mini-stat strong {
  display: block;
  font-size: 1.2rem;
  margin-top: 4px;
}
.progress-card__center {
  text-align: center;
}
.mini-muted {
  display: block;
  margin-top: 3px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.72);
}
.next-change-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.mini-stat {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.mini-stat__label {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
}
.guidance-grid {
  display: grid;
  gap: 14px;
}
.guidance-card h3,
.description-card h3,
.section-card h2 {
  margin: 0 0 12px;
  font-size: 1.3rem;
  color: var(--navy);
}
.guidance-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 10px;
  color: var(--text);
}
.description-card p {
  margin: 0;
  line-height: 1.6;
  color: #3f4557;
}
.small-status {
  margin-top: 12px !important;
  color: var(--muted) !important;
  font-size: 0.92rem;
}
.section-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.section-day-badge {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: #eff0f3;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.88rem;
}
.section-note {
  margin: 8px 0 18px;
  color: var(--muted);
  line-height: 1.5;
}
.timeline-list,
.days-list,
.day-hours {
  display: grid;
  gap: 12px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  align-items: center;
}
.timeline-item__time-col {
  text-align: center;
  color: var(--text);
}
.timeline-item__time-col strong,
.timeline-item__time-col span {
  display: block;
}
.timeline-item__separator {
  color: #c2c6d0;
  margin: 2px 0;
}
.timeline-item__card,
.mini-hour {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  background: #f4f3f3;
  border-radius: 24px;
  padding: 16px 18px;
}
.timeline-item__symbol,
.day-card__symbol,
.mini-hour__symbol {
  font-size: 3rem;
  line-height: 1;
}
.timeline-item__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.timeline-item__top h3,
.mini-hour__title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
}
.timeline-item__index,
.mini-hour__index {
  font-size: 0.95rem;
  font-weight: 700;
  color: #b0b3bf;
}
.timeline-item__meta,
.mini-hour__meta,
.day-meta,
.day-stats {
  margin: 6px 0 0;
  color: var(--muted);
}
.timeline-item.active .timeline-item__card {
  background: color-mix(in srgb, var(--planet-soft) 55%, white 45%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--planet-main) 32%, transparent 68%);
}
.day-card {
  overflow: hidden;
  background: #f8f7f7;
  border-radius: 24px;
  border: 1px solid rgba(22, 36, 93, 0.05);
}
.day-card > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
}
.day-card__summary-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}
.day-card__summary-main h3,
.day-card__summary-main p {
  margin: 0;
}
.day-card[open] > summary {
  border-bottom: 1px solid rgba(22, 36, 93, 0.06);
}
.day-card__content {
  padding: 16px 18px 18px;
}
.day-stats {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.mini-hour {
  grid-template-columns: auto 1fr auto;
}
.actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.actions-row--settings {
  margin-bottom: 16px;
}
.grid-form {
  display: grid;
  gap: 14px;
}
.grid-form label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 600;
}
.form-actions {
  display: flex;
}
.status-card {
  margin-top: 16px;
}
.status,
.saved-location {
  margin: 0;
}
.saved-location {
  margin-top: 8px;
  color: var(--muted);
}
.panel-soft--nested {
  margin-top: 16px;
  background: #f3f4f7;
  box-shadow: none;
}
.install-hint h3 {
  margin: 0 0 8px;
  color: var(--navy);
}
.install-hint p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.bottom-nav {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 980px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px 16px calc(10px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(22, 36, 93, 0.08);
}
.nav-btn {
  background: transparent;
  color: #9ea2b1;
  box-shadow: none;
  padding: 10px 6px;
  border-radius: 18px;
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
}
.nav-btn__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.25rem;
  background: rgba(22, 36, 93, 0.04);
}
.nav-btn.active {
  color: var(--navy);
}
.nav-btn.active .nav-btn__icon {
  background: var(--navy);
  color: #fff;
}

@media (min-width: 760px) {
  .app-shell {
    padding-left: 24px;
    padding-right: 24px;
  }
  .chip-row {
    grid-template-columns: 1fr 1fr;
  }
  .hero-grid {
    grid-template-columns: 1.3fr 0.9fr;
    align-items: start;
  }
  .guidance-grid {
    grid-template-columns: 1fr 1fr;
  }
  .grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .astro-inline-row,
  .next-change-row,
  .progress-card__labels {
    grid-template-columns: 1fr;
  }
  .progress-card__center {
    text-align: left;
  }
  .planet-chip strong {
    display: none;
  }
  .timeline-item,
  .mini-hour {
    grid-template-columns: 1fr;
  }
  .timeline-item__time-col {
    text-align: left;
    display: flex;
    gap: 8px;
    align-items: center;
    padding-left: 6px;
  }
  .timeline-item__time-col strong,
  .timeline-item__time-col span {
    display: inline;
  }
  .timeline-item__card,
  .mini-hour {
    grid-template-columns: auto 1fr auto;
  }
}


@media (min-width: 1100px) {
  .planet-chip strong {
    font-size: 0.7rem;
  }
}

@media (max-width: 960px) {
  .planet-strip {
    grid-template-columns: repeat(7, minmax(66px, 1fr));
    gap: 10px;
  }
  .planet-chip {
    min-height: 104px;
  }
  .planet-chip strong {
    font-size: 0.6rem;
  }
}

@media (max-width: 680px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
  }
  .planet-strip {
    grid-template-columns: repeat(7, minmax(44px, 1fr));
    gap: 8px;
  }
}
