/* Docs layout only. Everything shown in demos comes from momo.css. */
.docs-skip { border-radius: var(--momo-radius); position: absolute; inset-inline-start: 8px; top: 8px; translate: 0 -300%; z-index: 50; padding: .5rem .75rem; background: var(--momo-yellow); color: var(--momo-on-fill); border: var(--momo-border); }
.docs-skip:focus { translate: 0 0; }   /* moved up out of view, not far to the left: that made right-to-left pages scroll sideways */

.docs-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .75rem;
  height: 64px; padding: 0 16px;
  background: var(--momo-paper);
  border-bottom: var(--momo-border);
}
.docs-logo { display: inline-flex; align-items: center; gap: .6rem; color: var(--momo-ink); text-decoration: none; }
.docs-logo:hover { color: var(--momo-ink); }
.docs-logo .momo-mark { display: block; width: 40px; height: auto; }   /* the logo takes the text color: ink in light, cream in dark */
.docs-version { font-family: var(--momo-font-mono); font-size: .8rem; padding: 1px 6px; border: var(--momo-border); background: var(--momo-yellow); color: var(--momo-on-fill); border-radius: var(--momo-radius); }
.docs-mode-btn { margin-left: auto; }

.docs-icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  background: var(--momo-surface); color: var(--momo-ink);
  border: var(--momo-border); box-shadow: var(--momo-shadow);
  font-size: 1.25rem; border-radius: var(--momo-radius);
  transition: transform var(--momo-speed), box-shadow var(--momo-speed);
}
.docs-icon-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.docs-menu-btn { display: none; }

.docs-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.docs-nav {
  position: sticky; top: 64px; height: calc(100dvh - 64px); overflow-y: auto; overflow-x: hidden;
  padding: 1.25rem 1rem 2rem;
  border-right: var(--momo-border);
  background: var(--momo-paper);
}
.docs-nav ul { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.docs-nav-title { margin: 0 0 .4rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.docs-nav a, .docs-nav-soon {
  display: flex; align-items: center; justify-content: space-between;
  padding: .4rem .6rem; color: var(--momo-ink); text-decoration: none; font-weight: 500;
  border: var(--momo-border-width) solid transparent; border-radius: var(--momo-radius);
}
.docs-nav a:hover { border-color: var(--momo-line); background: var(--momo-surface); }
.docs-nav a[aria-current="page"] { background: var(--momo-brand); color: var(--momo-brand-on); border-color: var(--momo-line); font-weight: 700; }
.docs-nav-soon { color: var(--momo-muted); }
.docs-nav-soon small { font-size: .7rem; font-family: var(--momo-font-mono); border: 1px dashed currentColor; padding: 0 4px; }

.docs-main { padding: 2rem clamp(16px, 4vw, 3rem) 5rem; max-width: 1040px; min-width: 0; }
.docs-main > h1 { margin-bottom: .5rem; }
.docs-main > h2 { margin-top: 3rem; padding-top: 1rem; border-top: var(--momo-border); }
.docs-main > h3 { margin-top: 2rem; }
.docs-main > p, .docs-main > ul { max-width: 68ch; }

.docs-example { margin: 1rem 0 2rem; border: var(--momo-border); background: var(--momo-surface); border-radius: var(--momo-radius); overflow: hidden; }
.docs-demo { padding: 1.5rem; min-width: 0; overflow-x: auto; }
.docs-demo-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.docs-demo-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.docs-demo-paper { background: var(--momo-paper); }
.docs-code { font-size: .85rem; }
.docs-example > .docs-code-block { margin: 0; border: 0; border-top: var(--momo-border); border-radius: 0; }
.docs-code-block.box { box-shadow: none; }

.docs-table-wrap { overflow-x: auto; margin: 1rem 0 2rem; border: var(--momo-border); background: var(--momo-surface); border-radius: var(--momo-radius); }
.docs-table { width: 100%; margin: 0; font-size: .925rem; }
.docs-table th, .docs-table td { padding: .6rem .9rem; text-align: left; border-bottom: 1px solid var(--momo-line); vertical-align: top; }
.docs-table tr:last-child td { border-bottom: 0; }
.docs-table th { background: var(--momo-ink); color: var(--momo-paper); font-weight: 700; }

/* Demo helpers */
.docs-swatch { border: var(--momo-border); background: var(--momo-surface); border-radius: var(--momo-radius); overflow: hidden; }
.docs-swatch-color { height: 72px; border-bottom: var(--momo-border); }
.docs-swatch-soft { height: 28px; border-bottom: var(--momo-border); }
.docs-swatch-body { padding: .5rem .65rem; font-size: .8rem; }
.docs-swatch-body b { display: block; font-size: .95rem; }
.docs-swatch-body code { font-size: .75rem; color: var(--momo-muted); }
.docs-tile { padding: 1.25rem; min-width: 140px; font-weight: 500; }

/* Overview hero */
.docs-hero { padding: 1rem 0 1.5rem; }
.docs-hero .display { margin-bottom: 1rem; }
.docs-hero .docs-moey { max-width: 44rem; margin-top: 1rem; color: var(--momo-muted); }
.docs-hero .docs-moey .mi { margin-inline-end: .35rem; color: var(--momo-ink); }
.docs-features { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 2rem 0; }
.docs-features .box { padding: 1.25rem; }
.docs-features h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.docs-features p { margin: 0; font-size: .95rem; }
.docs-features i { font-size: 1.5rem; display: inline-grid; place-items: center; width: 44px; height: 44px; border: var(--momo-border); margin-bottom: .75rem; }

@media (max-width: 860px) {
  .docs-menu-btn { display: inline-grid; }
  .docs-shell { display: block; }
  .docs-nav {
    position: fixed; top: 64px; left: 0; bottom: 0; z-index: 15; width: min(300px, 85vw); height: auto;
    transform: translateX(-105%); transition: transform 180ms var(--momo-ease);
    box-shadow: var(--momo-drawer-shadow);
  }
  .docs-nav.is-open { transform: none; }
  /* the page behind dims while the menu is open */
  .docs-shell::before {
    content: ""; position: fixed; inset: 64px 0 0; z-index: 14; background: var(--momo-backdrop);
    opacity: 0; visibility: hidden; transition: opacity 180ms var(--momo-ease), visibility 0s linear 180ms;
  }
  .docs-shell:has(.docs-nav.is-open)::before { opacity: 1; visibility: visible; transition-delay: 0s; }
  .docs-version { display: none; }
}

/* Overview preview */
.docs-stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.docs-stat { display: flex; flex-direction: column; padding: 1rem; min-height: 150px; }
.docs-stat i { font-size: 1.6rem; margin-bottom: auto; }
.docs-stat .h2 { margin: .15rem 0 0; }
.docs-list { display: grid; gap: .85rem; }
.docs-row { display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; }
.docs-row > div { flex: 1; min-width: 0; line-height: 1.35; }
.docs-row > i { display: grid; place-items: center; width: 42px; height: 42px; font-size: 1.25rem; flex: none; }

/* Card page helpers (demo layout only) */
.docs-mt { margin-top: .6rem; }
.docs-media { height: 120px; display: grid; place-items: center; font-size: 2.25rem; }
.card-row > .docs-media { height: auto; min-height: 120px; }
.docs-media-row { display: flex; gap: 1rem; align-items: flex-start; }
.docs-media-row > div { flex: 1; min-width: 0; }
.docs-icon-tile { display: grid; place-items: center; flex: none; width: 44px; height: 44px; font-size: 1.3rem; background: var(--momo-surface); color: var(--momo-ink); border: var(--momo-border); border-radius: var(--momo-radius); }
.docs-title-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; }
.docs-title-row .card-title { margin: 0; }
.docs-checks { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.docs-checks li { display: flex; align-items: center; gap: .5rem; }
.docs-checks .mi { font-size: 1.15rem; }
.docs-center { display: grid; place-items: center; text-align: center; min-height: 120px; }
.docs-big-icon { font-size: 2rem; }

/* Forms page */
.docs-form { max-width: 560px; }

/* Checks page */
.docs-indent { margin: 0 0 0 1.85rem; }

/* Demo canvas: a light dot grid */
.docs-demo {
  background-image: radial-gradient(color-mix(in oklab, var(--momo-line) 22%, transparent) 1px, transparent 1.4px);
  background-size: 16px 16px;
  background-position: -4px -4px;
}

/* Previous / next */
.docs-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: var(--momo-border); }
.docs-pager a {
  display: flex; flex-direction: column; gap: .15rem; min-width: 0; max-width: 48%;
  padding: .7rem 1rem; color: var(--momo-ink); text-decoration: none;
  background: var(--momo-surface); border: var(--momo-border); border-radius: var(--momo-radius);
  transition: transform var(--momo-speed) var(--momo-ease), box-shadow var(--momo-speed) var(--momo-ease);
}
.docs-pager a small { font-size: .75rem; color: var(--momo-muted); }
.docs-pager a span { display: flex; align-items: center; gap: .4rem; font-weight: 700; }
.docs-pager-next { margin-inline-start: auto; text-align: end; align-items: flex-end; }
@media (hover: hover) {
  .docs-pager a:hover { transform: translate(-2px, -2px); box-shadow: var(--momo-shadow-lg); }
}

/* Customize page */
.docs-custom { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; margin: 1rem 0 2rem; }
.docs-custom-panel .section-title { margin-bottom: 1rem; }
.docs-custom-grid { --form-min: 150px; }
.docs-custom-preview { display: grid; gap: 1rem; }
.docs-custom-preview .card-body > * + * { margin-top: .85rem; }
.docs-custom-preview .check, .docs-custom-preview .switch { display: flex; }

/* Live example frames */
.docs-frame-wrap { margin: 1rem 0 1.5rem; border: var(--momo-border); box-shadow: var(--momo-shadow-lg); background: var(--momo-paper); overflow: hidden; }
.docs-frame { display: block; width: 100%; height: 720px; border: 0; }
.docs-frame-phone { width: 390px; max-width: 100%; border-radius: var(--momo-radius-2xl); }
.docs-frame-phone .docs-frame { height: 760px; }

/* Inbox page */
.docs-inbox { height: 620px; }
@media (max-width: 767.98px) { .docs-inbox { height: 560px; } }

/* Scrollbar demo */
.docs-scroll { height: 9rem; overflow-y: auto; overflow-x: hidden; padding: 1rem 1.25rem; }

/* Header search */
.docs-search-btn { margin-left: auto; min-width: 13rem; }
.docs-search-btn + .docs-mode-btn { margin-left: 0; }
@media (max-width: 640px) {
  .docs-search-btn { min-width: 0; width: 40px; height: 40px; padding: 0; justify-content: center; }
  .docs-search-btn span, .docs-search-btn kbd { display: none; }
}
/* Skeleton demo */
.docs-skel { max-width: 26rem; padding: 1rem; }
.docs-nav-new { flex: none; min-height: 1.25rem; padding-block: calc(var(--momo-nudge) * 2) 0; font-size: .6875rem; }
.docs-nav a[aria-current="page"] .docs-nav-new { border-color: currentColor; }
/* Utility reference tables: long ones scroll in place */
.docs-util-wrap { max-height: 24rem; overflow-y: auto; overscroll-behavior: contain; }
.docs-util-table thead th { position: sticky; top: 0; z-index: 1; }
.docs-util-table td:first-child { white-space: nowrap; }
.docs-util-table td code { font-size: .8125rem; }
.docs-mega-space { height: 23rem; }
/* a demo you can drag narrower (nav overflow) */
.docs-resize { resize: horizontal; overflow: hidden; min-width: 14rem; max-width: 100%; padding: 1rem; background: var(--momo-surface); border: var(--momo-border-width) dashed color-mix(in oklab, var(--momo-line) 45%, transparent); border-radius: var(--momo-radius); }
.docs-resize > .tabs:last-child { margin-bottom: 0; }
