/* Page chrome for the 07G Noodle component library pages (the components style themselves). */

.lib-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.lib-cats a {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 13px;
  border-radius: 999px; font-size: 13.5px; text-decoration: none; color: var(--muted);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.lib-cats a:hover { color: var(--ink); }
.lib-cats a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); box-shadow: none; }

.lib-brands { margin-top: 14px; }

.lib-item { margin-block: clamp(36px, 6vw, 72px); }
.lib-item-head {
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 6px 16px;
  margin-bottom: 16px;
}
.lib-num {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--ink); color: var(--bg); font-weight: 700; font-variant-numeric: tabular-nums;
}
.lib-item-head h2 { margin: 0; font-size: clamp(20px, 2.2vw, 26px); letter-spacing: -0.02em; line-height: 1.2; }
.lib-item-head p { margin: 4px 0 0; color: var(--muted); font-size: 15px; max-width: 60ch; }
.lib-item-head code {
  padding: 6px 10px; border-radius: 8px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px; white-space: nowrap;
}
@media (max-width: 640px) {
  .lib-item-head { grid-template-columns: auto 1fr; }
  .lib-item-head code { grid-column: 1 / -1; justify-self: start; }
}

/* The demo follows the page theme, like the components on it do: light paper in the light theme, the
   page surface in the dark one. (A light panel under dark-theme components put light text on light
   paper.) Framing written on a page reads the page tokens (--ink, --muted, --surface, --line). */
.lib-demo {
  position: relative;
  padding: clamp(16px, 3vw, 32px);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}
:root[data-theme$="dark"] .lib-demo:not(.dark) { background: var(--surface); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .lib-demo:not(.dark) { background: var(--surface); }
}
.lib-demo.bleed { padding: 0; overflow: clip; }
.lib-demo.dark { background: #121116; color: #f1f0f4; }

.lib-code { margin-top: 10px; }
.lib-code summary { cursor: pointer; font-size: 13.5px; color: var(--muted); width: max-content; }
.lib-code pre {
  margin: 10px 0 0; padding: 16px 18px; border-radius: 14px; overflow: auto; max-height: 360px;
  background: #16151a; color: #e9e7ef; font-size: 12.5px; line-height: 1.55; tab-size: 2;
}

/* Export: the component as a castomUI package (js/export/panel.js). */
.lib-export-body { display: grid; gap: 10px; margin-top: 10px; font-size: 13.5px; }
.lib-export-body p { margin: 0; color: var(--muted); }
.lib-export-body pre { margin: 0; }
.lib-export-tabs, .lib-export-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-export-body button, .lib-export-body select {
  min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; font: inherit; font-size: 13px;
  color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer;
}
.lib-export-body button:is(:hover, :focus-visible) { box-shadow: inset 0 0 0 1.5px var(--ink); }
.lib-export-body [role="tab"][aria-selected="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.lib-export-drawings { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.lib-export-drawings li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lib-export-variant { color: var(--muted); }

/* Library index */
.lib-cat { margin-block: 40px; }
.lib-cat h2 { margin: 0 0 14px; font-size: 22px; letter-spacing: -0.02em; }
.lib-cat h2 a { text-decoration: none; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.lib-card {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center;
  padding: 12px; border-radius: 16px; background: var(--surface); text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.2s, translate 0.2s;
}
.lib-card:hover { box-shadow: inset 0 0 0 1.5px var(--ink); translate: 0 -2px; }
.lib-card noodle-art { width: 64px; border-radius: 12px; background: var(--paper); }
.lib-card b { display: block; font-size: 15px; }
.lib-card span { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; }
.lib-card small { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Two versions of one component on a demo (pricing with a billing switch, and with static prices):
   each gets a small label. .versions puts them side by side where there is room; .stack keeps wide
   components one under the other. The label follows the demo panel's theme (the page's --muted); a
   .dark panel stays dark in every theme, so its label is a fixed light grey. */
.version-label { margin: 0 0 12px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.lib-demo.dark .version-label { color: #a3a1ad; }
* + .version-label { margin-top: 44px; }
.versions { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 28px; max-width: 980px; margin: 0 auto; }
.versions.stack { grid-template-columns: 1fr; max-width: 800px; }
