:root {
  color-scheme: dark;
  --ink: #eef6ed;
  --ink-soft: #cbd9cb;
  --muted: #91a897;
  --night: #06100c;
  --night-deep: #030806;
  --surface: #0b1711;
  --surface-raised: #112219;
  --surface-soft: #0e1c15;
  --line: rgba(165, 200, 173, 0.17);
  --line-strong: rgba(177, 215, 185, 0.34);
  --moss: #a8d197;
  --fern: #6ca978;
  --dew: #a9e1d2;
  --sun: #dfd39a;
  --ember: #d6aa77;
  --danger: #e1a59b;
  --focus: #f1e49b;
  --shadow: rgba(0, 0, 0, 0.34);
  --radius-small: 0.55rem;
  --radius-panel: 0.9rem;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-family: var(--sans);
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--night-deep);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 52% 22%, rgba(61, 115, 78, 0.16), transparent 29rem),
    linear-gradient(160deg, #08140e 0%, var(--night) 48%, var(--night-deep) 100%);
  font-size: 0.9375rem;
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(160, 201, 171, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 201, 171, 0.025) 1px, transparent 1px);
  background-size: 3.5rem 3.5rem;
  mask-image: linear-gradient(to bottom, black 35%, transparent 92%);
}

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

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

button {
  min-height: 2.75rem;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

h1,
h2,
h3,
p,
dl,
ol,
ul,
figure {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  text-wrap: balance;
}

h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(2.15rem, 5vw, 3.9rem);
  letter-spacing: -0.025em;
  line-height: 1;
}

h2 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.15;
}

h3 {
  margin-bottom: 0.6rem;
  font-size: 1rem;
  letter-spacing: 0.015em;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-small);
  color: var(--night-deep);
  background: var(--focus);
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.masthead,
#observatory,
footer {
  width: min(calc(100% - 2rem), 90rem);
  margin-inline: auto;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto minmax(12rem, 1fr);
  gap: 1rem;
  align-items: center;
  min-height: 5.25rem;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--moss);
  background: rgba(130, 185, 139, 0.07);
  font-size: 1.25rem;
  transform: rotate(-24deg);
}

.wordmark strong,
.wordmark small {
  display: block;
}

.wordmark strong {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.11em;
}

.wordmark small {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.phase-navigation {
  min-width: 0;
}

#phase-tabs {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.phase-tab {
  position: relative;
  min-width: 4.3rem;
  padding: 0.65rem 0.75rem;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.phase-tab::after {
  position: absolute;
  right: 0.85rem;
  bottom: 0.28rem;
  left: 0.85rem;
  height: 1px;
  content: "";
  background: var(--moss);
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity 160ms ease, transform 160ms ease;
}

.phase-tab:hover,
.phase-tab[aria-selected="true"] {
  color: var(--ink);
}

.phase-tab[aria-selected="true"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.masthead-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.local-light {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: var(--fern);
  box-shadow: 0 0 0 0.25rem rgba(108, 169, 120, 0.08);
}

#observatory {
  display: grid;
  grid-template-areas:
    "resources world actions"
    "memory memory memory"
    "status status status";
  grid-template-columns: minmax(14.5rem, 0.78fr) minmax(24rem, 1.42fr) minmax(18rem, 1fr);
  gap: 0.8rem;
  align-items: stretch;
  padding-block: 1.25rem;
}

.observatory-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background:
    linear-gradient(145deg, rgba(19, 39, 28, 0.74), rgba(7, 17, 12, 0.86)),
    var(--surface);
  box-shadow: 0 1.25rem 3.5rem var(--shadow);
}

.resource-panel {
  grid-area: resources;
  padding: 1.15rem;
}

.world-panel {
  display: grid;
  grid-area: world;
  grid-template-rows: auto minmax(18rem, 1fr) auto;
  padding: clamp(1rem, 2vw, 1.5rem);
  overflow: hidden;
}

.action-panel {
  grid-area: actions;
  padding: 1.15rem;
}

.memory-panel {
  grid-area: memory;
  padding: 1rem 1.15rem;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.section-label {
  margin-bottom: 0.3rem;
  color: var(--moss);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.3;
  text-transform: uppercase;
}

.flow-indicator,
.decision-mark {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.decision-mark {
  color: var(--sun);
  font-size: 0.95rem;
}

.resource-list,
.memory-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.resource-list {
  display: grid;
  gap: 0;
  padding-block: 0.45rem 1rem;
}

.resource-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 0.64rem;
  border-bottom: 1px solid rgba(165, 200, 173, 0.09);
}

.resource-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
}

.resource-values {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.resource-total {
  color: var(--dew);
  font-size: 0.95rem;
  font-weight: 500;
}

.resource-rate {
  color: var(--muted);
  font-size: 0.75rem;
}

.resource-rate[data-active="true"] {
  color: var(--moss);
}

.ecology-readout {
  padding-top: 0.5rem;
}

.ecology-readout dl {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0;
}

.ecology-readout dl > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.ecology-readout dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.ecology-readout dd {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.78rem;
  text-align: right;
}

.ecology-readout dd strong {
  color: var(--moss);
  font-size: 1.15rem;
  font-weight: 500;
}

.garden-copy {
  position: relative;
  z-index: 2;
  max-width: 34rem;
  margin-inline: auto;
  text-align: center;
}

.phase-description {
  max-width: 32rem;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.65;
}

.phase-objective {
  max-width: 30rem;
  margin: 0.35rem auto 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.5;
}

.opening-dew {
  margin: 0.55rem 0 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

#dew-count {
  color: var(--dew);
  font-family: var(--mono);
}

.living-world {
  position: relative;
  display: grid;
  width: min(100%, 31rem);
  min-height: 18rem;
  margin: 0 auto;
  place-items: center;
  isolation: isolate;
}

.world-caption {
  position: absolute;
  z-index: 4;
  bottom: 0.2rem;
  display: grid;
  max-width: 25rem;
  gap: 0.16rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(165, 200, 173, 0.12);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(5, 13, 9, 0.72);
  font-size: 0.75rem;
  line-height: 1.35;
  text-align: center;
  backdrop-filter: blur(0.5rem);
}

.world-caption strong {
  color: var(--moss);
  font-family: var(--serif);
  font-weight: 650;
}

.world-glow {
  position: absolute;
  width: min(75%, 19rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(103, 170, 111, 0.14);
  filter: blur(2.3rem);
  transform: scale(calc(0.7 + var(--growth, 0) * 0.03));
}

.world-body {
  position: relative;
  z-index: 2;
  width: clamp(10rem, 54%, 15.5rem);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(179, 215, 181, 0.34);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 30%, rgba(177, 216, 173, 0.18), transparent 17%),
    radial-gradient(circle at 52% 60%, #253e2c 0 21%, transparent 22%),
    linear-gradient(145deg, #1b3023, #0a1710 72%);
  box-shadow:
    0 0 4.5rem rgba(107, 167, 108, 0.17),
    inset -2.5rem -2.2rem 3.5rem rgba(1, 6, 3, 0.68),
    inset 1rem 1rem 2.5rem rgba(185, 215, 166, 0.08);
  transition: box-shadow 500ms ease, filter 500ms ease;
}

.living-world[data-phase="planet"] .world-body,
.living-world[data-phase="stellar"] .world-body,
.living-world[data-phase="infinite"] .world-body {
  background:
    radial-gradient(circle at 34% 31%, rgba(201, 226, 189, 0.24), transparent 15%),
    radial-gradient(circle at 48% 61%, #477455 0 23%, transparent 24%),
    linear-gradient(145deg, #315c43, #10271a 72%);
}

.world-continent {
  position: absolute;
  display: block;
  border-radius: 55% 45% 63% 37% / 52% 62% 38% 48%;
  background: #6b8f62;
  opacity: 0.2;
  transition: opacity 500ms ease, transform 500ms ease;
}

.continent-one {
  top: 25%;
  left: 22%;
  width: 29%;
  height: 38%;
  transform: rotate(23deg);
}

.continent-two {
  right: 20%;
  bottom: 18%;
  width: 24%;
  height: 31%;
  transform: rotate(-17deg);
}

.living-world[data-growth]:not([data-growth="0"]) .world-continent {
  opacity: 0.55;
}

.orbit {
  position: absolute;
  z-index: 1;
  border: 1px solid rgba(168, 209, 151, 0.13);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.orbit::before {
  position: absolute;
  top: 50%;
  left: -0.22rem;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  content: "";
  background: var(--dew);
  box-shadow: 0 0 0.9rem var(--dew);
}

.orbit-outer {
  width: 86%;
  aspect-ratio: 1.45;
  opacity: 0.5;
  animation: orbit-breathe 8s ease-in-out infinite alternate;
}

.orbit-inner {
  width: 68%;
  aspect-ratio: 1.25;
  opacity: 0.35;
  transform: rotate(35deg);
}

.root-thread,
.garden-stem,
.garden-leaf,
.garden-bloom {
  position: absolute;
  z-index: 3;
  display: block;
  opacity: 0;
  transition: opacity 500ms ease, transform 500ms ease;
}

.root-thread {
  top: 55%;
  left: 50%;
  width: 1px;
  height: 28%;
  background: linear-gradient(var(--sun), transparent);
  transform-origin: top;
}

.root-thread-one {
  transform: rotate(24deg);
}

.root-thread-two {
  transform: rotate(-28deg);
}

.garden-stem {
  bottom: 48%;
  left: calc(50% - 1px);
  width: 2px;
  height: 24%;
  background: linear-gradient(transparent, var(--moss));
  transform: translateY(1rem);
}

.garden-leaf {
  top: 36%;
  left: 50%;
  width: 15%;
  height: 8%;
  border-radius: 100% 0 100% 0;
  background: var(--moss);
}

.garden-leaf-left {
  transform: translateX(-100%) rotate(20deg);
}

.garden-leaf-right {
  border-radius: 0 100% 0 100%;
  transform: rotate(-20deg);
}

.garden-bloom {
  top: 24%;
  left: calc(50% - 0.42rem);
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50% 10% 50% 20%;
  background: var(--sun);
  box-shadow: 0 0 1.4rem rgba(223, 211, 154, 0.52);
  transform: rotate(45deg) scale(0.4);
}

.living-world[data-rooted="true"] .root-thread,
.living-world[data-rooted="true"] .garden-stem {
  opacity: 0.8;
  transform: translateY(0);
}

.living-world[data-rooted="true"] .root-thread-one {
  transform: rotate(24deg);
}

.living-world[data-rooted="true"] .root-thread-two {
  transform: rotate(-28deg);
}

.living-world[data-leafy="true"] .garden-leaf {
  opacity: 0.9;
}

.living-world[data-blooming="true"] .garden-bloom {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.living-world[data-networked="true"] .world-body {
  box-shadow:
    0 0 5rem rgba(107, 167, 108, 0.25),
    inset -2.5rem -2.2rem 3.5rem rgba(1, 6, 3, 0.62),
    inset 1rem 1rem 2.5rem rgba(185, 215, 166, 0.13);
}

.living-world[data-phase="stellar"] .orbit,
.living-world[data-phase="infinite"] .orbit {
  border-color: rgba(223, 211, 154, 0.3);
}

.living-world[data-phase="infinite"] .world-body {
  filter: saturate(1.28);
}

.threshold-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 0.7fr);
  gap: 1rem;
  align-items: end;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(5, 13, 9, 0.58);
}

.threshold-card h2 {
  margin-bottom: 0.2rem;
  font-size: 1.1rem;
}

#threshold-detail {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

progress {
  width: 100%;
  height: 0.36rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  color: var(--moss);
  background: #1c2a21;
}

progress::-webkit-progress-bar {
  background: #1c2a21;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--fern), var(--moss));
}

progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--fern), var(--moss));
}

.action-list {
  display: grid;
  gap: 0.65rem;
  max-height: 38rem;
  padding-top: 0.8rem;
  overflow-y: auto;
  scrollbar-color: var(--line-strong) transparent;
}

.action-card {
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(5, 13, 9, 0.48);
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.action-card[data-recommended="true"] {
  border-color: rgba(168, 209, 151, 0.56);
  background: linear-gradient(145deg, rgba(47, 86, 56, 0.35), rgba(5, 13, 9, 0.62));
}

.action-card[data-recommended="true"]:hover {
  transform: translateY(-1px);
}

.action-card[data-tone="prestige"] {
  border-color: rgba(223, 211, 154, 0.26);
}

.action-card[data-tone="choice"] {
  border-left-color: var(--dew);
}

.action-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.28rem;
}

.action-category,
.recommended-badge {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.recommended-badge {
  color: var(--sun);
}

.action-button {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-family: var(--serif);
  font-size: 1.04rem;
  text-align: left;
  cursor: pointer;
}

.action-button:hover {
  color: var(--moss);
}

.action-button[aria-disabled="true"] {
  color: var(--muted);
  cursor: not-allowed;
}

.action-detail,
.action-reason {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.action-effect-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
}

.action-effect-list li {
  padding: 0.2rem 0.42rem;
  border: 1px solid rgba(151, 193, 150, 0.2);
  border-radius: 999px;
  color: var(--moss);
  background: rgba(59, 96, 65, 0.18);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.action-effect-list li[data-tone="tradeoff"] {
  border-color: rgba(211, 155, 111, 0.22);
  color: var(--ember);
  background: rgba(112, 61, 38, 0.13);
}

.secondary-actions {
  margin-top: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.secondary-actions summary {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.8rem;
  list-style-position: inside;
}

#secondary-action-count {
  display: inline-grid;
  min-width: 1.55rem;
  min-height: 1.55rem;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--moss);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.action-list-secondary {
  max-height: 28rem;
  padding-top: 0.55rem;
}

.action-reason {
  margin-top: 0.42rem;
  color: var(--ember);
}

.memory-heading-row {
  align-items: center;
  padding-bottom: 0.7rem;
}

.memory-promise,
.memory-empty {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.memory-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  padding-top: 0.75rem;
}

.memory-entry {
  display: flex;
  min-width: 0;
  gap: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.memory-marker {
  width: 0.4rem;
  height: 0.4rem;
  flex: 0 0 auto;
  margin-top: 0.35rem;
  border: 1px solid var(--moss);
  border-radius: 50%;
}

.memory-empty {
  padding-top: 0.8rem;
  font-style: italic;
}

.earned-achievements {
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}

.earned-achievements summary {
  min-height: 2.75rem;
  padding-block: 0.65rem;
  color: var(--moss);
  cursor: pointer;
  font-size: 0.8rem;
}

.achievement-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.achievement-entry {
  display: grid;
  gap: 0.18rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(5, 13, 9, 0.4);
  font-size: 0.75rem;
}

.achievement-entry strong {
  color: var(--sun);
  font-family: var(--serif);
}

.achievement-entry span {
  color: var(--muted);
  line-height: 1.45;
}

.game-status {
  grid-area: status;
  min-height: 1.5rem;
  margin: 0;
  padding: 0.25rem 0.2rem 0;
  color: var(--dew);
  font-size: 0.8rem;
  text-align: center;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.5rem 2rem;
  color: var(--muted);
}

.footer-epigraph {
  margin: 0;
  font-family: var(--serif);
  font-size: 0.88rem;
}

.save-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: right;
}

.session-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.session-controls button {
  min-height: 2.5rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  color: var(--ink-soft);
  background: rgba(8, 20, 14, 0.72);
  cursor: pointer;
  font-size: 0.75rem;
}

.session-controls button:hover {
  border-color: var(--line-strong);
  color: var(--dew);
}

.garden-dialog {
  width: min(calc(100% - 2rem), 42rem);
  max-height: calc(100vh - 2rem);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-panel);
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 2rem 7rem rgba(0, 0, 0, 0.68);
}

.garden-dialog::backdrop {
  background: rgba(1, 5, 3, 0.78);
  backdrop-filter: blur(4px);
}

.dialog-shell {
  padding: clamp(1.25rem, 4vw, 2rem);
}

.dialog-reward {
  color: var(--sun);
  font-family: var(--mono);
  font-size: 1.1rem;
}

.renewal-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-block: 1.2rem;
}

.renewal-columns section {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

.renewal-columns ul {
  margin-bottom: 0;
  padding-left: 1.2rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.renewal-columns li + li {
  margin-top: 0.35rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
}

.dialog-actions button {
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  cursor: pointer;
}

.session-dialog-shell,
.onboarding-shell {
  display: grid;
  gap: 0.9rem;
}

.session-dialog-shell > *,
.onboarding-shell > * {
  margin-block: 0;
}

.session-dialog-shell label,
.settings-grid label {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.session-dialog-shell textarea,
.settings-grid select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  color: var(--ink);
  background: var(--night-deep);
}

.session-dialog-shell textarea {
  min-height: 8rem;
  padding: 0.75rem;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
}

.settings-grid select {
  min-height: 2.75rem;
  padding: 0.55rem 0.7rem;
}

.onboarding-steps,
.return-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0;
  list-style: none;
}

.onboarding-steps li,
.return-grid section,
.settings-grid section,
.import-preview,
.offline-tiers {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(5, 13, 9, 0.46);
}

.onboarding-steps li {
  display: grid;
  gap: 0.35rem;
}

.onboarding-steps strong,
.dialog-recommendation {
  color: var(--sun);
  font-family: var(--serif);
}

.onboarding-steps span,
.privacy-note,
.dialog-note,
.offline-tiers,
.return-grid li,
.settings-grid p {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

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

.return-grid h3,
.settings-grid h3,
.import-preview h3 {
  margin-top: 0;
  font-family: var(--serif);
}

.return-grid ul,
.offline-tiers ul,
.achievement-list {
  margin-bottom: 0;
  padding-left: 1.1rem;
}

.checkbox-setting {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  margin-top: 1rem;
}

.checkbox-setting input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--moss);
}

.session-stats,
.import-preview dl {
  display: grid;
  gap: 0.45rem;
}

.session-stats div,
.import-preview dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.session-stats dt,
.import-preview dt {
  color: var(--muted);
}

.session-stats dd,
.import-preview dd {
  margin: 0;
  color: var(--dew);
  text-align: right;
}

.dialog-error {
  padding: 0.75rem;
  border: 1px solid color-mix(in srgb, #d97c6c 60%, transparent);
  border-radius: var(--radius-small);
  color: #f2b1a5;
  background: rgba(95, 32, 25, 0.28);
}

.button-danger {
  border-color: #9e594d !important;
  color: #ffe0d9;
  background: #6f332a;
  font-weight: 750;
}

.button-quiet {
  color: var(--ink-soft);
  background: transparent;
}

.button-renew {
  border-color: var(--moss);
  color: var(--night-deep);
  background: var(--moss);
  font-weight: 750;
}

.button-renew[aria-disabled="true"] {
  border-color: var(--line);
  color: var(--muted);
  background: var(--surface-soft);
  cursor: not-allowed;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[hidden] {
  display: none !important;
}

@keyframes orbit-breathe {
  from {
    opacity: 0.32;
    transform: rotate(-18deg) scale(0.98);
  }
  to {
    opacity: 0.56;
    transform: rotate(-16deg) scale(1.02);
  }
}

@media (max-width: 66rem) {
  .masthead {
    grid-template-columns: 1fr auto;
  }

  .phase-navigation {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-bottom: 0.65rem;
    overflow-x: auto;
  }

  .masthead-status {
    grid-column: 2;
    grid-row: 1;
  }

  #observatory {
    grid-template-areas:
      "world world"
      "resources actions"
      "memory memory"
      "status status";
    grid-template-columns: minmax(15rem, 0.8fr) minmax(18rem, 1.2fr);
  }

  .world-panel {
    min-height: 38rem;
  }
}

@media (max-width: 46rem) {
  body {
    font-size: 0.9rem;
  }

  .masthead,
  #observatory,
  footer {
    width: min(calc(100% - 1rem), 90rem);
  }

  .masthead {
    min-height: 4.25rem;
  }

  .wordmark-mark {
    width: 2rem;
    height: 2rem;
  }

  .wordmark small,
  .masthead-status {
    display: none;
  }

  .phase-navigation {
    grid-column: 1 / -1;
  }

  #phase-tabs {
    justify-content: flex-start;
  }

  .phase-tab {
    flex: 0 0 auto;
  }

  #observatory {
    grid-template-areas:
      "resources"
      "world"
      "actions"
      "memory"
      "status";
    grid-template-columns: minmax(0, 1fr);
    gap: 0.6rem;
    padding-block: 0.65rem;
  }

  .resource-panel,
  .action-panel,
  .memory-panel,
  .world-panel {
    padding: 0.9rem;
  }

  .world-panel {
    min-height: 0;
    grid-template-rows: auto minmax(15rem, auto) auto;
  }

  .living-world {
    width: 100%;
    min-height: 15rem;
  }

  .world-body {
    width: min(52vw, 12.5rem);
  }

  .threshold-card {
    grid-template-columns: 1fr;
  }

  .action-list {
    max-height: none;
  }

  .memory-heading-row,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .memory-promise {
    max-width: 16rem;
  }

  .memory-list,
  .achievement-list {
    grid-template-columns: 1fr;
  }

  .save-status {
    text-align: left;
  }

  .session-controls {
    justify-content: flex-start;
  }

  .onboarding-steps,
  .return-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

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

  .dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

html[data-reduced-motion="true"] *,
html[data-reduced-motion="true"] *::before,
html[data-reduced-motion="true"] *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

@media (forced-colors: active) {
  :root {
    color-scheme: light dark;
  }

  body,
  .observatory-panel,
  .action-card,
  .threshold-card,
  .garden-dialog {
    background: Canvas;
  }

  .world-body,
  .orbit,
  .action-card,
  .observatory-panel,
  .threshold-card,
  .garden-dialog {
    border: 1px solid CanvasText;
  }

  .world-continent,
  .garden-leaf,
  .garden-stem,
  .garden-bloom,
  .root-thread,
  .local-light,
  .memory-marker {
    forced-color-adjust: none;
    background: Highlight;
  }

  .phase-tab[aria-selected="true"],
  .recommended-badge,
  .resource-rate[data-active="true"] {
    color: Highlight;
  }
}
