/* Moonverse design system — semantic components + carefully scoped legacy refinements. */
:root {
  --mv-page: 1280px;
  --mv-serif: "Literata", Georgia, serif;
  --mv-radius: 20px;
  --mv-space: clamp(20px, 3vw, 40px);
  --foreground: #e6e8f1;
  --muted-foreground: #a5afc5;
  --mv-surface: color-mix(in srgb, var(--card) 88%, var(--background));
  --mv-shadow: 0 8px 30px #0000000a;
  color-scheme: dark;
  scroll-padding-top: 96px;
}
:root.theme-light,
:root.light {
  --background: #f7f7fb;
  --foreground: #252638;
  --card: #ffffff;
  --muted: #eeedf5;
  --muted-foreground: #62657a;
  --primary: #6553bd;
  --primary-hover: #5240aa;
  --border: #dad9e7;
  --mv-shadow: 0 8px 30px #37305a06;
  color-scheme: light;
}
:root.theme-sepia {
  --foreground: #352d28;
  --muted-foreground: #6b5b4e;
  color-scheme: light;
}
:root.theme-midnight {
  --foreground: #e9eaf2;
  --muted-foreground: #a3aec5;
  color-scheme: dark;
}
body {
  font-feature-settings: "ss01" on;
}
#root {
  min-height: 100dvh;
  isolation: isolate;
}
#root > .stars-bg {
  background-image: radial-gradient(
    ellipse at 90% 0%,
    color-mix(in srgb, var(--primary) 5%, transparent),
    transparent 50%
  );
}
header.celestial-glass {
  background: color-mix(in srgb, var(--background) 94%, transparent);
  border-width: 0 0 1px;
  box-shadow: none;
  backdrop-filter: blur(20px);
}
header > div:first-child {
  height: 76px;
  max-width: var(--mv-page);
  gap: 16px;
}
header a[href="/"] {
  min-height: 40px;
}
header a[href="/"] > div:last-child > span:first-child {
  font-size: 15px;
  letter-spacing: 0.17em;
}
header a[href="/"] > div:last-child > span:last-child {
  font-size: 8px;
  letter-spacing: 0.18em;
}
header button {
  min-height: 38px;
  border-radius: 12px;
}
header button[title="Daily Dewdrop Gathering"] {
  display: none !important;
}
header nav[aria-label="Primary"] {
  gap: 4px;
}
header nav[aria-label="Primary"] a {
  font-size: 13px;
  padding: 10px 12px;
  white-space: nowrap;
}
header nav[aria-label="Primary"] a:nth-child(3),
header nav[aria-label="Primary"] a:nth-child(5),
header nav[aria-label="Primary"] a:nth-child(6),
header nav[aria-label="Primary"] a:nth-child(7) {
  display: none !important;
}
header nav[aria-label="Primary"] a[aria-current] {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}
header button[aria-label="Toggle navigation menu"] {
  display: flex !important;
}
#moonverse-navigation-drawer {
  display: block !important;
  max-height: calc(100dvh - 78px);
  overflow-y: auto;
  padding: 24px max(24px, calc((100vw - 1216px) / 2));
}
#moonverse-navigation-drawer > .grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
#moonverse-navigation-drawer a {
  min-height: 44px;
  font-size: 13px;
}
#moonverse-navigation-drawer > button {
  min-height: 44px;
}
#root main:not([data-reader="true"]) {
  max-width: var(--mv-page);
  padding: 32px var(--mv-space) 40px;
}
#root main[data-reader="true"] {
  max-width: none;
  padding: 0;
}
main > div:not(.mv-home) > h1,
main > div:not(.mv-home) > div > h1,
main > div:not(.mv-home) h1 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.25;
  letter-spacing: -0.035em;
}
main > div:not(.mv-home) > div > p.text-muted-foreground {
  max-width: 70ch;
}
main > div:not(.mv-home) {
  min-width: 0;
}
main[data-route="/stories"] > div {
  padding-left: 0;
  padding-right: 0;
}
main :where([class~="text-[9px]"]) {
  font-size: 11px;
}
main :where([class~="text-[10px]"]) {
  font-size: 11px;
}
main :where([class~="text-[11px]"]) {
  font-size: 12px;
}
main
  :where(
    input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
    textarea,
    select
  ) {
  font-size: 14px;
}
:where(
  input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
  select
) {
  min-height: 42px;
}
:where(button):not([role="switch"]) {
  min-height: 32px;
}
main :where(button):not([role="switch"]):not(.mv-icon-button) {
  min-height: 36px;
}
button[role="switch"] {
  position: relative;
}
button[role="switch"]::after {
  content: "";
  position: absolute;
  inset: -10px -4px;
}
:where(button, a, input, textarea, select) {
  -webkit-tap-highlight-color: transparent;
}
:where(button, a) {
  touch-action: manipulation;
}
main :where(h1, h2, h3, h4, p, a, span) {
  overflow-wrap: break-word;
}
main :where(.min-w-0) {
  min-width: 0;
}
main[data-route="/settings"] [role="tablist"] {
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
}
main[data-route="/settings"] [role="tab"] {
  padding: 10px 18px;
  font-size: 13px;
}
main[data-route="/settings"] :where(label) {
  font-size: 13px;
}
main[data-route="/settings"] :where(input, textarea, select) {
  border-color: var(--border);
}
main nav[aria-label="Breadcrumb"] {
  margin-bottom: 18px;
  font-size: 12px;
}
main nav[aria-label="Breadcrumb"] a {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
}
/* Fixed surfaces scroll within the viewport, leaving their close action reachable. */
[role="dialog"][aria-modal="true"] {
  z-index: 80;
  padding: max(16px, env(safe-area-inset-top)) 16px
    max(16px, env(safe-area-inset-bottom));
}
[role="dialog"][aria-modal="true"] > div {
  max-height: calc(100dvh - 32px);
  border-radius: 24px;
  box-shadow: 0 24px 90px #0005;
}
[role="dialog"] button {
  min-height: 38px;
}
[role="dialog"] input {
  font-size: 16px;
}
[role="dialog"] :where(h2, h3) {
  text-wrap: balance;
}
/* Deliberate typography and spacious cards on the home page. */
.mv-home {
  display: flex;
  flex-direction: column;
  gap: 44px;
}
.mv-home h1,
.mv-home h2,
.mv-home h3,
.mv-home p {
  margin: 0;
}
.mv-welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 4px 0 0;
}
.mv-eyebrow {
  color: var(--primary);
  font-size: 10px;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
}
.mv-welcome h1 {
  margin-top: 12px;
  font-size: clamp(30px, 3.2vw, 45px);
  letter-spacing: -0.045em;
  line-height: 1.2;
  font-weight: 600;
}
.mv-welcome h1 em {
  color: var(--primary);
  font-family: var(--mv-serif);
  font-weight: 400;
  font-size: 0.9em;
}
.mv-welcome-note {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted-foreground);
  white-space: pre-line;
  flex-shrink: 0;
  padding-bottom: 3px;
}
.mv-feature-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 254px;
  gap: 20px;
  margin-top: -16px;
}
.mv-feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  min-height: 375px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--mv-radius);
  background: linear-gradient(
    120deg,
    color-mix(in srgb, var(--primary) 7%, var(--card)),
    var(--card)
  );
}
.mv-feature-copy {
  min-width: 0;
  padding: 32px 0 24px 32px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.mv-feature-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.mv-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--primary) 10%, var(--card));
  color: var(--primary);
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.mv-feature h2 {
  font-family: var(--mv-serif);
  font-size: clamp(23px, 2.2vw, 31px);
  line-height: 1.28;
  font-weight: 500;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.mv-feature-author {
  margin-top: 12px !important;
  color: var(--muted-foreground);
  font-size: 12px;
}
.mv-feature-synopsis {
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 1.8;
  margin-top: 14px !important;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.mv-feature-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 22px;
}
.mv-button {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.15s;
}
.mv-button:hover {
  transform: translateY(-1px);
}
.mv-button-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}
.mv-button-primary:hover {
  background: var(--primary-hover);
}
.mv-button-secondary {
  color: var(--foreground);
  background: var(--card);
}
.mv-button-secondary:hover {
  background: var(--muted);
}
.mv-text-link {
  color: var(--primary);
  font-size: 12px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}
.mv-text-link:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}
.mv-feature-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
  padding-top: 22px;
}
.mv-count {
  color: var(--muted-foreground);
  font-size: 10px;
  letter-spacing: 0.15em;
}
.mv-feature-pagination > div {
  display: flex;
  gap: 6px;
}
.mv-icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px !important;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--foreground);
  background: var(--card);
  font-size: 16px;
  cursor: pointer;
}
.mv-icon-button:hover {
  background: var(--muted);
  border-color: var(--primary);
  color: var(--primary);
}
.mv-feature-art {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 20px;
  isolation: isolate;
  overflow: hidden;
}
.mv-feature-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    ellipse at 50% 50%,
    color-mix(in srgb, var(--primary) 17%, transparent),
    transparent 70%
  );
}
.mv-feature-cover {
  display: block;
  width: 157px;
  max-width: 85%;
  aspect-ratio: 2/3;
  border-radius: 4px 10px 10px 4px;
  overflow: hidden;
  transform: rotate(6deg);
  box-shadow:
    12px 22px 28px #0004,
    -4px 0 0 color-mix(in srgb, var(--foreground) 10%, var(--card));
  transition: transform 0.3s;
}
.mv-feature-cover:hover {
  transform: rotate(2deg) translateY(-4px);
}
.mv-feature-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mv-orbit {
  position: absolute;
  width: 290px;
  height: 290px;
  border: 1px solid color-mix(in srgb, var(--primary) 17%, transparent);
  border-radius: 50%;
  z-index: -1;
}
.mv-orbit-two {
  width: 370px;
  height: 370px;
}
.mv-art-star {
  position: absolute;
  top: 25px;
  right: 28px;
  font-size: 24px;
  color: var(--primary);
}
.mv-art-caption {
  margin-top: 28px;
  color: var(--muted-foreground);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.mv-ritual {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 25px 24px;
  border-radius: var(--mv-radius);
  border: 1px solid var(--border);
  background: var(--card);
}
.mv-ritual-symbol {
  color: var(--primary);
  font-size: 42px;
  line-height: 1;
  margin-bottom: 22px;
}
.mv-ritual h2 {
  font-family: var(--mv-serif);
  font-weight: 400;
  font-size: 25px;
  line-height: 1.35;
  margin-top: 12px;
  letter-spacing: -0.035em;
}
.mv-ritual > p:not(.mv-eyebrow) {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.9;
  margin: 12px 0 22px;
}
.mv-ritual .mv-button {
  width: 100%;
  margin-top: auto;
  font-size: 11px;
}
.mv-ritual .mv-text-link {
  margin-top: 9px;
  align-self: center;
  font-size: 11px;
}
.mv-genres {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: -20px;
}
.mv-genre {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  transition:
    border-color 0.15s,
    transform 0.15s;
}
.mv-genre:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.mv-genre-symbol {
  font-size: 26px;
  color: var(--primary);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.mv-genre > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.mv-genre strong {
  display: block;
  font-size: 12px;
  font-weight: 650;
}
.mv-genre > span:nth-child(2) > span {
  display: block;
  color: var(--muted-foreground);
  font-size: 10px;
  margin-top: 5px;
  line-height: 1.5;
}
.mv-genre > span:last-child {
  color: var(--muted-foreground);
  font-size: 13px;
}
.mv-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.mv-section-heading h2 {
  font-size: 23px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.035em;
  margin-top: 6px;
}
.mv-section-description {
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.7;
  margin-top: 7px !important;
}
.mv-heading-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.mv-heading-actions .mv-text-link {
  margin-left: 10px;
}
.mv-story-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 90px) / 6);
  gap: 18px;
  overflow-x: auto;
  padding: 2px 0 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.mv-story-rail > article {
  scroll-snap-align: start;
}
.mv-story-card {
  border-radius: 12px;
  box-shadow: none !important;
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  transition: border-color 0.2s !important;
  min-width: 0;
}
.mv-story-card::after {
  display: none;
}
.mv-story-card:hover {
  transform: none !important;
  border-color: color-mix(
    in srgb,
    var(--primary) 60%,
    var(--border)
  ) !important;
}
.mv-story-card > .book-spine {
  border-radius: 0;
}
.mv-story-card > .book-spine > .absolute:first-of-type {
  max-width: calc(100% - 48px);
}
.mv-story-card
  > .book-spine
  > .absolute:first-of-type
  > span:first-child
  > span:nth-child(n + 2) {
  display: none;
}
.mv-story-card > .book-spine > .absolute:first-of-type > span:first-child {
  font-size: 10px;
  padding: 4px 7px;
}
.mv-story-card > .book-spine button {
  width: 30px;
  height: 30px;
  min-height: 30px !important;
  display: grid;
  place-items: center;
  padding: 6px;
}
.mv-story-card > div:last-child {
  padding: 13px 12px;
  gap: 10px;
}
.mv-story-card > div:last-child > div:first-child > a {
  font-size: 12px;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  min-height: 3em;
  font-weight: 650;
}
.mv-story-card > div:last-child > div:first-child > p {
  font-size: 10px;
  line-height: 1.6;
}
.mv-story-card > div:last-child > div:first-child > p:first-of-type {
  display: none;
}
.mv-story-card > div:last-child > div:last-child {
  font-size: 10px;
}
.mv-story-card .group-hover\:scale-104 {
  transform: none !important;
}
.mv-filter-tabs {
  display: flex;
  gap: 6px;
  margin: -5px 0 18px;
}
.mv-filter {
  border-radius: 9px;
  padding: 7px 16px;
  font-size: 12px;
  color: var(--muted-foreground);
  background: var(--muted);
  cursor: pointer;
}
.mv-filter.is-active {
  background: var(--primary);
  color: var(--primary-foreground);
}
.mv-release-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.mv-release {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  transition: border-color 0.15s;
}
.mv-release:hover {
  border-color: var(--primary);
}
.mv-release > div {
  min-width: 0;
  flex: 1;
}
.mv-release-series {
  font-size: 10px;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mv-release h3 {
  font-size: 13px;
  line-height: 1.6;
  font-weight: 600;
  margin: 5px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mv-release-meta {
  color: var(--muted-foreground);
  font-size: 10px;
}
.mv-free {
  color: var(--foreground);
  background: var(--muted);
}
.mv-empty {
  padding: 24px;
  color: var(--muted-foreground);
}
.mv-collection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.mv-collection {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  padding: 0 22px 20px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: border-color 0.15s;
}
.mv-collection:hover {
  border-color: var(--primary);
}
.mv-collection-art {
  width: calc(100% + 44px);
  margin: 0 -22px 22px;
  height: 175px;
  display: flex;
  justify-content: center;
  align-items: center;
  isolation: isolate;
  background: radial-gradient(
    ellipse at 50% 100%,
    color-mix(in srgb, var(--primary) 16%, var(--muted)),
    var(--muted)
  );
}
.mv-collection-art img {
  height: 130px;
  width: 87px;
  border-radius: 5px;
  object-fit: cover;
  box-shadow: 0 8px 16px #0003;
}
.mv-collection-art img:first-child {
  transform: rotate(-12deg) translate(12px, 6px);
  z-index: -1;
}
.mv-collection-art img:last-child {
  transform: rotate(12deg) translate(-12px, 6px);
  z-index: -1;
}
.mv-collection-art img:nth-child(2) {
  z-index: 1;
}
.mv-collection h3 {
  font-family: var(--mv-serif);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.4;
  margin: 11px 0;
  letter-spacing: -0.03em;
}
.mv-collection > p {
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.8;
  margin-bottom: 16px;
}
.mv-collection > .mv-text-link {
  margin-top: auto;
  font-size: 11px;
}
.mv-collection .mv-eyebrow {
  font-size: 9px;
}
.mv-themes {
  padding: 30px;
  display: flex;
  align-items: center;
  gap: 30px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(
    120deg,
    color-mix(in srgb, var(--primary) 6%, var(--card)),
    var(--card)
  );
}
.mv-themes h2 {
  font-family: var(--mv-serif);
  font-weight: 400;
  font-size: 23px;
  line-height: 1.4;
  margin-top: 10px;
  width: 220px;
}
.mv-theme-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.mv-theme-link {
  padding: 9px 14px;
  border-radius: 30px;
  border: 1px solid var(--border);
  color: var(--foreground);
  font-size: 11px;
  background: var(--card);
}
.mv-theme-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.mv-footer {
  margin-top: 36px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.mv-footer-inner {
  max-width: var(--mv-page);
  padding: 38px var(--mv-space) 22px;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.mv-footer-brand > a {
  font-size: 14px;
  letter-spacing: 0.16em;
  font-weight: 750;
}
.mv-footer-brand p {
  white-space: pre-line;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.9;
  margin-top: 12px;
}
.mv-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 12px 24px;
  font-size: 12px;
}
.mv-footer a:hover {
  color: var(--primary);
}
.mv-footer-bottom {
  grid-column: 1/-1;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  font-size: 10px;
  color: var(--muted-foreground);
}
.mv-demo-note {
  margin-left: auto;
}
nav[aria-label="Mobile"] {
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 24px #00000008;
}
nav[aria-label="Mobile"] a {
  min-width: 0;
  flex: 1;
  min-height: 52px;
}
nav[aria-label="Mobile"] a[aria-current] {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}
.mv-not-found {
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.mv-not-found > span {
  font-size: 90px;
  color: var(--primary);
}
.mv-not-found h1 {
  font-family: var(--mv-serif);
  font-weight: 400;
}
.mv-not-found > p:not(.mv-eyebrow) {
  color: var(--muted-foreground);
  max-width: 45ch;
  font-size: 14px;
  line-height: 1.8;
}
header .animate-pulse,
header .animate-ping {
  animation: none;
}
@media (min-width: 1024px) {
  header nav.hidden.lg\:flex {
    display: flex !important;
  }
}
@media (max-width: 1199px) {
  .mv-feature-layout {
    grid-template-columns: minmax(0, 1fr) 220px;
  }
  .mv-feature {
    grid-template-columns: minmax(0, 1fr) 200px;
  }
  .mv-feature-copy {
    padding-left: 24px;
  }
  .mv-feature-art {
    padding-inline: 12px;
  }
  .mv-ritual {
    padding: 24px 20px;
  }
  .mv-story-rail {
    grid-auto-columns: calc((100% - 60px) / 4.4);
    gap: 15px;
  }
  .mv-genre {
    gap: 9px;
    padding: 16px 12px;
  }
  .mv-genre > span:nth-child(2) > span {
    display: none;
  }
  header nav[aria-label="Primary"] a {
    padding-inline: 8px;
    font-size: 12px;
  }
  header button[title^="Search"] > span {
    display: none;
  }
}
@media (max-width: 959px) {
  .mv-feature-layout {
    grid-template-columns: 1fr;
  }
  .mv-feature {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
  .mv-ritual {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 6px 18px;
    align-items: center;
    padding: 20px;
  }
  .mv-ritual-symbol {
    grid-row: 1/4;
    margin: 0;
  }
  .mv-ritual .mv-eyebrow {
    grid-column: 2;
  }
  .mv-ritual h2 {
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
  }
  .mv-ritual > p:not(.mv-eyebrow) {
    grid-column: 2;
    margin: 0;
    font-size: 11px;
  }
  .mv-ritual .mv-button {
    grid-column: 3;
    grid-row: 1/3;
    margin: 0;
  }
  .mv-ritual .mv-text-link {
    grid-column: 3;
    grid-row: 3;
    margin: 0;
    min-height: 24px;
    justify-content: center;
  }
  .mv-welcome-note {
    display: none;
  }
  .mv-collection-grid {
    gap: 12px;
  }
  .mv-collection {
    padding-inline: 16px;
  }
  .mv-collection-art {
    width: calc(100% + 32px);
    margin-inline: -16px;
  }
  .mv-collection-art img {
    width: 65px;
    height: 98px;
  }
  .mv-collection-art {
    height: 145px;
  }
}
@media (max-width: 767px) {
  header > div:first-child {
    height: 66px;
    gap: 10px;
  }
  #moonverse-navigation-drawer {
    max-height: calc(100dvh - 130px);
    padding: 16px;
  }
  #moonverse-navigation-drawer > .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #root main:not([data-reader="true"]) {
    padding-top: 24px;
  }
  .mv-home {
    gap: 34px;
  }
  .mv-welcome {
    padding: 0 0 6px;
  }
  .mv-welcome h1 {
    font-size: 32px;
    line-height: 1.3;
  }
  .mv-welcome h1 em {
    display: block;
  }
  .mv-welcome .mv-eyebrow {
    font-size: 9px;
  }
  .mv-feature {
    grid-template-columns: minmax(0, 1fr) 180px;
    min-height: 360px;
  }
  .mv-feature-copy {
    padding: 26px 0 20px 24px;
  }
  .mv-feature h2 {
    font-size: 25px;
  }
  .mv-feature-cover {
    width: 120px;
  }
  .mv-feature-kicker {
    gap: 8px;
  }
  .mv-feature-kicker .mv-eyebrow {
    font-size: 8px;
  }
  .mv-feature-kicker .mv-pill {
    font-size: 9px;
  }
  .mv-art-caption {
    font-size: 8px;
    letter-spacing: 0.05em;
  }
  .mv-feature-actions {
    gap: 10px;
  }
  .mv-feature-actions .mv-text-link {
    display: none;
  }
  .mv-genres {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: -14px;
    gap: 10px;
  }
  .mv-genre {
    padding: 16px 12px;
  }
  .mv-genre > span:nth-child(2) > span {
    display: block;
    font-size: 9px;
  }
  .mv-section-heading {
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 18px;
  }
  .mv-section-heading h2 {
    font-size: 21px;
  }
  .mv-section-description {
    font-size: 11px;
    max-width: 45ch;
  }
  .mv-heading-actions .mv-icon-button {
    display: none;
  }
  .mv-heading-actions .mv-text-link {
    margin: 0;
    font-size: 10px;
    white-space: nowrap;
  }
  .mv-section-heading > .mv-text-link {
    font-size: 10px;
    white-space: nowrap;
  }
  .mv-story-rail {
    grid-auto-columns: calc((100% - 30px) / 3.3);
    gap: 12px;
  }
  .mv-release-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .mv-release {
    padding: 16px;
  }
  .mv-collection-grid {
    grid-template-columns: 1fr;
  }
  .mv-collection {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 8px 18px;
    padding: 16px;
    align-items: start;
  }
  .mv-collection-art {
    grid-column: 1;
    grid-row: 1/5;
    width: 120px;
    height: 170px;
    margin: 0;
    border-radius: 10px;
    overflow: hidden;
  }
  .mv-collection-art img {
    width: 66px;
    height: 100px;
    margin: 0 -20px;
    flex-shrink: 0;
  }
  .mv-collection h3 {
    margin: 0;
    font-size: 18px;
  }
  .mv-collection > p {
    margin: 0;
    font-size: 11px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .mv-collection > .mv-eyebrow {
    font-size: 8px;
  }
  .mv-collection > .mv-text-link {
    margin: 0;
    font-size: 10px;
  }
  .mv-themes {
    padding: 22px;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .mv-themes h2 {
    width: auto;
    font-size: 22px;
  }
  .mv-footer {
    margin-top: 16px;
    padding-bottom: 80px;
  }
  .mv-footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .mv-footer nav {
    justify-content: flex-start;
  }
  .mv-demo-note {
    width: 100%;
    margin: 0;
  }
  .mv-footer-bottom {
    gap: 14px;
  }
}
@media (max-width: 519px) {
  header > div:first-child {
    padding-inline: 16px;
    gap: 8px;
  }
  header > div:first-child > div:last-child {
    gap: 6px;
  }
  header button {
    min-height: 36px;
  }
  .mv-feature {
    grid-template-columns: minmax(0, 1fr) 115px;
    min-height: 0;
  }
  .mv-feature-copy {
    padding: 22px 0 18px 20px;
  }
  .mv-feature h2 {
    font-size: 22px;
  }
  .mv-feature-kicker {
    margin-bottom: 12px;
  }
  .mv-feature-kicker .mv-pill {
    display: none;
  }
  .mv-feature-author {
    font-size: 10px;
    line-height: 1.7;
  }
  .mv-feature-synopsis {
    font-size: 11px;
    -webkit-line-clamp: 3;
    line-height: 1.8;
  }
  .mv-feature-actions {
    margin-top: 16px;
  }
  .mv-feature-actions .mv-button {
    font-size: 10px;
    padding: 10px 12px;
  }
  .mv-feature-art {
    padding: 20px 6px 20px 0;
    justify-content: flex-start;
    padding-top: 68px;
  }
  .mv-feature-cover {
    width: 87px;
    max-width: 85%;
  }
  .mv-orbit {
    width: 180px;
    height: 180px;
    top: 54px;
  }
  .mv-orbit-two {
    width: 240px;
    height: 240px;
    top: 24px;
  }
  .mv-art-star {
    top: 24px;
    right: 22px;
    font-size: 18px;
  }
  .mv-art-caption {
    display: none;
  }
  .mv-feature-pagination {
    padding-top: 18px;
  }
  .mv-feature-pagination .mv-icon-button {
    width: 30px;
    height: 30px;
    min-height: 30px !important;
  }
  .mv-ritual {
    grid-template-columns: 1fr auto;
    gap: 8px 14px;
    padding: 18px;
  }
  .mv-ritual-symbol {
    display: none;
  }
  .mv-ritual .mv-eyebrow,
  .mv-ritual h2,
  .mv-ritual > p:not(.mv-eyebrow) {
    grid-column: 1;
  }
  .mv-ritual h2 {
    font-size: 14px;
    line-height: 1.5;
  }
  .mv-ritual > p:not(.mv-eyebrow) {
    display: none;
  }
  .mv-ritual .mv-button {
    grid-column: 2;
    grid-row: 1/3;
    font-size: 9px;
    padding: 10px;
  }
  .mv-ritual .mv-text-link {
    display: none;
  }
  .mv-genre strong {
    font-size: 11px;
  }
  .mv-genre > span:nth-child(2) > span {
    font-size: 8px;
  }
  .mv-genre-symbol {
    font-size: 22px;
    width: 22px;
  }
  .mv-story-rail {
    grid-auto-columns: calc((100% - 18px) / 2.35);
    gap: 12px;
  }
  .mv-section-heading h2 {
    font-size: 20px;
  }
  .mv-section-heading .mv-eyebrow {
    font-size: 8px;
  }
  .mv-section-description {
    display: none;
  }
  .mv-collection {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 6px 14px;
  }
  .mv-collection-art {
    width: 88px;
    height: 160px;
  }
  .mv-collection h3 {
    font-size: 16px;
  }
  .mv-collection > .mv-eyebrow {
    font-size: 8px;
    letter-spacing: 0.08em;
  }
  .mv-collection > .mv-text-link {
    font-size: 9px;
    min-height: 30px;
  }
  .mv-filter {
    flex: 1;
    padding-inline: 10px;
  }
  main[data-route="/stories"] h1 {
    font-size: 28px;
  }
  main[data-reader="true"] aside[aria-label="Chapter reading dock"] > div {
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  main[data-reader="true"]
    aside[aria-label="Chapter reading dock"]
    :where(button, a) {
    flex-shrink: 0;
  }
}
@media (pointer: coarse) {
  :where(
    input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
    select
  ) {
    font-size: 16px !important;
  }
  .mv-button {
    min-height: 44px;
  }
  .mv-icon-button {
    width: 40px;
    height: 40px;
    min-height: 40px !important;
  }
  .mv-story-card > .book-spine button {
    width: 34px;
    height: 34px;
    min-height: 34px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Maintain primary library access at intermediate desktop breakpoints. */
@media (min-width: 1024px) {
  header nav.hidden.lg\:flex a:nth-child(8) {
    display: inline-flex !important;
  }
}
/* Small icon controls get a usable hit area without widening decorative badges. */
main button:not([role="switch"]):not(.mv-icon-button):has(> svg:only-child) {
  min-width: 30px;
  min-height: 32px;
}
.mv-story-card > div:last-child > div:last-child {
  gap: 4px;
  flex-wrap: wrap;
}
.mv-story-card > div:last-child > div:last-child > span {
  white-space: nowrap;
}
@media (max-width: 519px) {
  .mv-genre > span:nth-child(2) > span {
    display: none;
  }
}
.mv-home > *,
.mv-release,
.mv-release-grid,
.mv-section-heading > div {
  min-width: 0;
}
@media (max-width: 767px) {
  .mv-release-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
#moonverse-navigation-drawer {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 18px 35px #0002;
}
header .absolute.right-0 {
  max-height: calc(100dvh - 96px);
  overflow-y: auto;
}
@media (max-width: 380px) {
  .mv-feature {
    grid-template-columns: minmax(0, 1fr) 92px;
  }
  .mv-feature-cover {
    width: 74px;
  }
  .mv-feature-art {
    padding-top: 76px;
  }
  .mv-feature h2 {
    font-size: 21px;
  }
  .mv-ritual {
    grid-template-columns: 1fr;
  }
  .mv-ritual .mv-button {
    grid-column: 1;
    grid-row: auto;
    margin-top: 6px;
    width: auto;
  }
}
.mv-preview-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 14px 18px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 6%, var(--card));
  font-size: 12px;
  color: var(--muted-foreground);
}
.mv-preview-notice strong {
  color: var(--primary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
main button:not([role="switch"]) {
  min-width: 28px;
}
[role="dialog"][data-mv-panel] {
  padding: 0;
}
[role="dialog"][data-mv-panel] > div {
  max-height: 100dvh;
  height: 100dvh;
  border-radius: 24px 0 0 24px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
#moonverse-notifications {
  max-height: calc(100dvh - 100px);
}
@media (max-width: 639px) {
  #moonverse-notifications {
    position: fixed;
    top: 74px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
  }
}
