.moon-shell {
  width: min(1050px,calc(100% - 32px));
  margin-inline: auto;
}

.reading-shell {
  width: min(900px,calc(100% - 32px));
  margin-inline: auto;
}

.moon-hero {
  padding: 58px 0 70px;
  overflow: hidden;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.06fr .94fr;
  gap: 52px;
  align-items: center;
}

.hero-copy h1,.hero-layout h1 {
  margin: 18px 0 20px;
  font-size: clamp(3rem,7vw,5.4rem);
  line-height: .94;
  letter-spacing: -.065em;
}

.hero-lead {
  max-width: 650px;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-proof span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.hero-preview {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.preview-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.preview-moons {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 7px;
}

.preview-moons button {
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 27px;
}

.preview-combo {
  width: 100%;
  margin-top: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
}

.preview-combo strong,.preview-combo span {
  display: block;
}

.studio-section {
  padding: 22px 0 84px;
}

.studio-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
  margin-bottom: 16px;
}

.studio-heading h2 {
  margin: 0;
  font-size: clamp(2rem,4vw,3rem);
}

.studio-heading>p {
  max-width: 350px;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
}

.studio {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.studio-sticky-controls {
  position: sticky;
  top: var(--header-height,72px);
  z-index: 30;
  border-bottom: 1px solid var(--line);
  border-radius: 26px 26px 0 0;
  background: color-mix(in srgb,var(--surface) 96%,transparent);
  backdrop-filter: blur(16px);
}

.studio-controls {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 10px;
  padding: 13px;
}

.search-field {
  position: relative;
}

.search-field input {
  width: 100%;
  min-height: 48px;
  padding: 11px 68px 11px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
}

.search-field button {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
}

.view-buttons {
  display: flex;
  gap: 7px;
}

.view-buttons button,.category-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.view-buttons button {
  min-height: 48px;
  border-radius: 14px;
  padding: 8px 11px;
}

.category-pills {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 13px 13px;
}

.category-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 10px;
}

.category-pill.active {
  background: var(--text);
  color: var(--bg);
}

.studio-body {
  display: grid;
  grid-template-columns: minmax(0,1fr) 300px;
}

.results-pane {
  padding: 18px;
  border-right: 1px solid var(--line);
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 12px;
}

.results-head span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.results-head h3 {
  margin: 4px 0 0;
}

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

.moon-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.moon-copy {
  width: 100%;
  min-height: 105px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 14px 8px 27px;
  border: 0;
  background: transparent;
  color: var(--text);
}

.moon-glyph {
  font-size: 24px;
  overflow-wrap: anywhere;
}

.moon-label {
  color: var(--muted);
  font-size: 12px;
}

.copy-state {
  position: absolute;
  left: 8px;
  bottom: 7px;
  color: var(--primary);
  font-size: 12px;
  opacity: 0;
}

.moon-card:hover .copy-state {
  opacity: 1;
}

.moon-actions {
  position: absolute;
  right: 7px;
  bottom: 6px;
  display: flex;
  gap: 4px;
}

.moon-actions button {
  width: 27px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
}

.moon-actions .is-favorite {
  color: var(--accent);
}

.builder-panel {
  position: sticky;
  top: calc(var(--header-height,72px) + 116px);
  padding: 18px;
  background: var(--surface-2);
}

.builder-head {
  display: flex;
  justify-content: space-between;
}

.builder-panel label {
  display: flex;
  justify-content: space-between;
  margin: 13px 0 6px;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.builder-panel input[type=text] {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
}

.builder-panel input[type=range] {
  width: 100%;
  accent-color: var(--primary);
}

.moon-picks {
  display: grid;
  grid-template-columns: repeat(6,1fr);
  gap: 5px;
}

.moon-picks button,.layout-switcher button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
}

.moon-picks button {
  height: 34px;
}

.moon-picks button.active,.layout-switcher button.active {
  background: var(--text);
  color: var(--bg);
}

.layout-switcher {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 5px;
}

.layout-switcher button {
  padding: 7px 4px;
  font-size: 12px;
}

.builder-preview {
  min-height: 86px;
  display: grid;
  place-items: center;
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 18px;
  text-align: center;
}

.builder-copy {
  width: 100%;
  margin-top: 9px;
}

.category-guide-section {
  padding: 76px 0;
  background: var(--surface-3);
  border-block: 1px solid var(--line);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 10px;
}

.guide-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.guide-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--surface-2);
}

.guide-card strong,.guide-card small {
  display: block;
}

.guide-card small {
  color: var(--primary);
  font-size: 12px;
}

.how-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 34px;
}

.steps {
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.compat-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 10px;
}

.related-tool-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.related-tool-card strong,.related-tool-card small {
  display: block;
}

.related-tool-card small {
  color: var(--muted);
  font-size: 12px;
}

.empty-results {
  text-align: center;
  padding: 60px 20px;
}

@media (max-width:900px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }
  .studio-body {
    grid-template-columns: 1fr;
  }
  .results-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .builder-panel {
    position: relative;
    top: auto;
  }
  .guide-grid {
    grid-template-columns: repeat(2,1fr);
  }
}

@media (max-width:700px) {
  .moon-shell,.reading-shell {
    width: min(100% - 20px,1050px);
  }
  .studio-heading {
    flex-direction: column;
    align-items: flex-start;
  }
  .studio-heading>p {
    text-align: left;
  }
  .studio-controls {
    grid-template-columns: 1fr;
  }
  .moon-grid {
    grid-template-columns: repeat(3,1fr);
  }
  .how-grid,.related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width:480px) {
  .moon-grid {
    grid-template-columns: repeat(2,1fr);
  }
  .guide-grid {
    grid-template-columns: 1fr;
  }
  .moon-picks {
    grid-template-columns: repeat(3,1fr);
  }
}
