/* The Zubra UI site. Everything under the header is drawn with the theme's variables (shadcn/ui's
   names), so the theme picker restyles the page you're reading as well as the components. The
   header is the brand: Zubra's ink and indigo, the same in every theme. */

@font-face { font-family: "Instrument Sans"; src: url("fonts/instrument-sans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

/* Accent presets, as shadcn's theme picker offers them: only the primary colours change. */
.theme-blue { --primary: oklch(0.546 0.245 262.881); --primary-foreground: oklch(0.97 0.014 254.604); --ring: oklch(0.623 0.214 259.815); }
.dark.theme-blue { --primary: oklch(0.623 0.214 259.815); --primary-foreground: oklch(0.21 0.006 285.885); }
.theme-rose { --primary: oklch(0.645 0.246 16.439); --primary-foreground: oklch(0.969 0.015 12.422); --ring: oklch(0.645 0.246 16.439); }
.dark.theme-rose { --primary: oklch(0.645 0.246 16.439); --primary-foreground: oklch(0.969 0.015 12.422); }
.theme-green { --primary: oklch(0.527 0.154 150.069); --primary-foreground: oklch(0.982 0.018 155.826); --ring: oklch(0.527 0.154 150.069); }
.dark.theme-green { --primary: oklch(0.696 0.17 162.48); --primary-foreground: oklch(0.21 0.006 285.885); }
.theme-orange { --primary: oklch(0.646 0.222 41.116); --primary-foreground: oklch(0.98 0.016 73.684); --ring: oklch(0.646 0.222 41.116); }
.dark.theme-orange { --primary: oklch(0.705 0.213 47.604); --primary-foreground: oklch(0.21 0.006 285.885); }

:root {
  --brand-ink: #14161f;
  --brand-line: #2c3040;
  --brand-text: #f2f3f8;
  --brand-accent: #8b95ff;
  --bar-height: 3.75rem;
  --side-width: 15rem;
  --font: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Code colours on --muted, readable in both modes. */
  --tok-c: var(--muted-foreground);
  --tok-s: oklch(0.5 0.13 150);
  --tok-k: oklch(0.5 0.2 285);
  --tok-n: oklch(0.55 0.17 45);
  --tok-t: oklch(0.52 0.19 0);
  --tok-a: oklch(0.55 0.13 70);
  --tok-p: oklch(0.5 0.15 245);
}
.dark {
  --tok-s: oklch(0.8 0.13 150);
  --tok-k: oklch(0.78 0.13 285);
  --tok-n: oklch(0.8 0.13 55);
  --tok-t: oklch(0.78 0.15 0);
  --tok-a: oklch(0.82 0.11 75);
  --tok-p: oklch(0.78 0.11 240);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-padding-top: calc(var(--bar-height) + 1rem); }
html.dark { color-scheme: dark; }
body { margin: 0; background: var(--background); color: var(--foreground); font: 400 1rem/1.6 var(--font-body, var(--font)); -webkit-font-smoothing: antialiased; }
/* Element defaults in the base layer, so a component's own styles (the components layer) win:
   an action-button with href is an <a>, and draws its own colour and focus. */
@layer base {
  a { color: inherit; text-underline-offset: 0.18em; text-decoration-color: color-mix(in oklch, currentColor 40%, transparent); }
  a:hover { text-decoration-color: currentColor; }
  :focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
}
code { font-family: var(--mono); font-size: 0.86em; }
:not(pre) > code { padding: 0.1em 0.35em; border-radius: calc(var(--radius) - 6px); background: var(--muted); color: var(--foreground); }
.skip { position: absolute; left: -999px; top: 0.5rem; z-index: 20; padding: 0.5rem 0.75rem; background: var(--background); color: var(--foreground); }
.skip:focus { left: 0.5rem; }
@media (prefers-reduced-motion: reduce) { *, ::before, ::after { transition-duration: 0s !important; animation-duration: 0s !important; } }

/* ---- the bar */
.bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem;
  height: var(--bar-height); padding: 0 1rem; background: var(--brand-ink); color: var(--brand-text); border-bottom: 1px solid var(--brand-line);
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: inherit; font-weight: 650; font-size: 1.05rem; letter-spacing: -0.01em; text-decoration: none; }
.mark { width: 1.75rem; height: 1.75rem; }
.mark-accent { fill: var(--brand-accent); }
.stack-switch { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; font-size: 0.88rem; color: #b9bdd0; }
/* The stack switch is a Zubra UI segmented-control on the brand's colours. */
.stack-switch segmented-control {
  --muted: #232738; --background: #353a52; --foreground: #f2f3f8; --muted-foreground: #b9bdd0; --border: #2c3040; --card: #444b6e; --primary: #8b95ff; --accent: #2c3040;
}
.bar-tools { display: flex; align-items: center; gap: 0.25rem; }
.tool { padding: 0.35rem 0.6rem; border: 1px solid transparent; border-radius: 0.45rem; background: none; color: inherit; font: inherit; font-size: 0.88rem; text-decoration: none; cursor: pointer; }
.tool:hover { border-color: var(--brand-line); background: #1c1f2b; }
.tool[aria-pressed=true] { border-color: var(--brand-line); }

/* ---- layout */
.layout { display: grid; grid-template-columns: var(--side-width) minmax(0, 1fr); }
.site-nav { position: sticky; top: var(--bar-height); align-self: start; height: calc(100dvh - var(--bar-height)); overflow-y: auto; padding: 1.25rem 0.75rem 2rem 1rem; border-right: 1px solid var(--border); font-size: 0.92rem; }
.site-nav h2 { margin: 1.25rem 0 0.35rem; padding-left: 0.5rem; color: var(--muted-foreground); font-size: 0.8rem; font-weight: 600; }
.site-nav ul { margin: 0; padding: 0; list-style: none; }
.site-nav a { display: block; padding: 0.28rem 0.5rem; border-radius: calc(var(--radius) - 4px); color: var(--foreground); text-decoration: none; }
.site-nav a:hover { background: var(--accent); }
.site-nav a[aria-current=page] { background: var(--secondary); font-weight: 600; box-shadow: inset 2px 0 0 var(--primary); }
.site-nav-home { font-weight: 600; }
main { min-width: 0; padding: 2.5rem clamp(1rem, 4vw, 3.5rem) 5rem; outline: none; }
main > * { max-width: 48rem; }

/* ---- type */
/* The site's own headings only: a component's headings keep their own styles. */
:is(.component, .home) > h1 { margin: 0 0 0.6rem; font-size: clamp(2rem, 4.5vw, 2.9rem); font-weight: 650; line-height: 1.08; letter-spacing: -0.03em; }
.component > h1 { font-family: var(--mono); font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 600; letter-spacing: -0.02em; }
:is(.component, .home) > h2 { margin: 2.75rem 0 0.75rem; font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; }
.lead { max-width: 38rem; margin: 0 0 1.75rem; color: var(--muted-foreground); font-size: 1.12rem; line-height: 1.55; }
.note, .hint { color: var(--muted-foreground); font-size: 0.92rem; }

/* ---- the preview stage: the component on the theme's background, with room around it */
.stage {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem;
  min-height: 12rem; padding: 2.5rem 1.5rem; border: 1px solid var(--border); border-radius: var(--radius);
  background-color: var(--background);
  background-image: radial-gradient(color-mix(in oklch, var(--foreground) 9%, transparent) 1px, transparent 1px);
  background-size: 14px 14px;
}
.stage > :not(button) { max-width: 100%; }
.event { min-height: 1.6em; margin: 0.5rem 0 0; color: var(--muted-foreground); font-size: 0.88rem; }
.event output { color: var(--foreground); font-family: var(--mono); font-size: 0.85em; }

/* ---- code */
.code { --code-dim: color-mix(in oklab, var(--muted-foreground) 72%, var(--foreground)); overflow: hidden; margin: 0.75rem 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--muted); }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 0.35rem 0.5rem 0.35rem 0.9rem; border-bottom: 1px solid var(--border); color: var(--code-dim); font-size: 0.8rem; }
.code pre { overflow-x: auto; margin: 0; padding: 0.9rem 1rem; font-size: 0.8125rem; line-height: 1.6; tab-size: 2; }
.copy { padding: 0.2rem 0.55rem; border: 1px solid var(--border); border-radius: calc(var(--radius) - 4px); background: var(--background); color: var(--foreground); font: inherit; font-size: 0.78rem; cursor: pointer; }
.copy:hover { border-color: var(--ring); }
.code pre code { font-size: inherit; }
.tok-c { color: var(--code-dim); font-style: italic; } .tok-s { color: var(--tok-s); } .tok-k { color: var(--tok-k); } .tok-n { color: var(--tok-n); }
.tok-t { color: var(--tok-t); } .tok-a { color: var(--tok-a); } .tok-p { color: var(--tok-p); }
/* One stack's code at a time: the one chosen in the bar. */
.stack-only { display: none; }
html[data-stack=html] .stack-only[data-stack=html], html[data-stack=react] .stack-only[data-stack=react], html[data-stack=vue] .stack-only[data-stack=vue],
html[data-stack=svelte] .stack-only[data-stack=svelte], html[data-stack=angular] .stack-only[data-stack=angular] { display: block; }
.install { margin: 0.5rem 0 1rem; }
.install > span { font-size: 0.9rem; font-weight: 600; }

/* ---- tables */
.table { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
caption { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--border); font-weight: 600; text-align: left; }
th, td { padding: 0.5rem 0.9rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted-foreground); font-weight: 500; }
tr:last-child td { border-bottom: 0; }
.none { color: var(--muted-foreground); }

/* ---- home */
.home h1 { max-width: 15ch; }
.showcase { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.75rem; max-width: 60rem; margin: 2rem 0 0.5rem; }
.tile { display: flex; flex-direction: column; min-width: 0; }
.tile .stage { flex: 1; min-height: 9rem; padding: 1.5rem 1rem; }
.tile .event { display: none; }
.tile-name { align-self: flex-start; margin-bottom: 0.35rem; font-family: var(--mono); font-size: 0.82rem; color: var(--muted-foreground); }
.steps { margin: 0; padding-left: 1.25rem; }
.steps li { margin-bottom: 1.25rem; padding-left: 0.25rem; }
.steps li p { margin: 0 0 0.25rem; }
.all { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.all li { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 0.93rem; }
.all a { font-family: var(--mono); font-size: 0.88rem; }
.all span { color: var(--muted-foreground); }

/* ---- buttons and the theme dialog */
.button { padding: 0.5rem 0.9rem; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); background: var(--background); color: var(--foreground); font: inherit; font-size: 0.92rem; font-weight: 500; cursor: pointer; }
.button:hover { background: var(--accent); }
a.button { display: inline-block; text-decoration: none; }
.button.primary { border-color: var(--primary); background: var(--primary); color: var(--primary-foreground); }
.button.primary:hover { opacity: 0.9; }
#theme textarea { display: block; width: 100%; margin: 0.35rem 0 0; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); background: var(--background); color: var(--foreground); font: 0.82rem/1.5 var(--mono); resize: vertical; }
.paste-label { display: block; margin-top: 1.25rem; font-size: 0.9rem; font-weight: 600; }
.actions { display: flex; justify-content: flex-end; gap: 0.5rem; }

/* ---- narrow screens: the components list folds above the page */
@media (max-width: 52rem) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  /* The nav becomes one scrolling row under the bar. */
  .site-nav { position: static; display: flex; min-width: 0; gap: 0.25rem; height: auto; padding: 0.5rem 1rem; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
  .site-nav section, .site-nav ul { display: contents; }
  .site-nav h2 { display: none; }
  .site-nav a { white-space: nowrap; font-size: 0.85rem; }
  .site-nav a[aria-current=page] { box-shadow: inset 0 -2px 0 var(--primary); }
  .stack-switch > span { display: none; }
  /* The bar wraps: brand and tools on top, the stack switch across the full width below. */
  .bar { flex-wrap: wrap; height: auto; min-height: var(--bar-height); gap: 0.25rem 0.5rem; padding: 0.5rem 0.75rem; }
  .bar-tools { margin-left: auto; }
  .stack-switch { order: 3; flex: 1 0 100%; margin-left: 0; }
  .stack-switch segmented-control { flex: 1; }
  .bar { position: static; }
  .all li { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
}


/* The demo's kanban cards (any elements the reader puts in a column). */
kanban-column article { padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); background: var(--card); color: var(--card-foreground); font-size: 0.9rem; cursor: grab; }
.cta { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: -0.5rem 0 1rem; }
caption small { color: var(--muted-foreground); font-weight: 400; }
td small { color: var(--muted-foreground); }

/* A long event detail wraps rather than widening the page. */
.event { overflow-wrap: anywhere; }
/* The narrowest phones: the stack switch's buttons tighten so all five fit. */
@media (max-width: 24rem) {
  .stack-switch segmented-control button { padding-inline: 0.45rem; font-size: 0.85rem; }
  .brand { gap: 0.35rem; }
}
.source { margin: 0 0 1.5rem; color: var(--muted-foreground); font-size: 0.9rem; }
/* The demo dialog's action buttons, in the site's button style. */
modal-dialog button[slot=actions] { padding: 0.5rem 0.9rem; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); background: var(--background); color: var(--foreground); font: inherit; font-size: 0.92rem; font-weight: 500; cursor: pointer; }
modal-dialog button[slot=actions]:last-child { border-color: var(--destructive); background: var(--destructive); color: #fff; }
modal-dialog p { margin: 0; }
/* The demo's notes in the masonry grid. */
.stage masonry-grid { inline-size: 100%; }
masonry-grid article { padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); background: var(--card); color: var(--card-foreground); }
masonry-grid article h3 { margin: 0 0 0.3rem; font-size: 0.95rem; }
masonry-grid article p { margin: 0; color: var(--muted-foreground); font-size: 0.9rem; line-height: 1.45; }
/* Placeholder content for the layout demos. */
.demo-box { padding: 0.75rem 0.9rem; border: 1px dashed color-mix(in oklab, var(--primary) 45%, var(--border)); border-radius: calc(var(--radius) - 2px); background: color-mix(in oklab, var(--primary) 6%, var(--card)); color: var(--foreground); font-size: 0.9rem; }
.demo-chip { padding: 0.3rem 0.75rem; border-radius: 999px; background: var(--secondary); color: var(--secondary-foreground); font-size: 0.875rem; font-weight: 500; }
.stage :is(stack-layout, cluster-layout, auto-grid, sidebar-layout, switcher-layout, reel-layout, backdrop-pattern) { inline-size: 100%; }
.stage :is(signin-block, settings-block, pricing-block, dashboard-shell, nav-bar, hero-section, feature-grid, site-footer, faq-list, bar-chart, progress-bar, logo-cloud, newsletter-signup, data-table, testimonial-card, empty-state, file-drop) { inline-size: 100%; }
.demo-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 0.75rem; }
.demo-stats strong { display: block; font-size: 1.5rem; }

/* ---- the themes page */
.themes-page .look { margin: 1.5rem 0 2.5rem; border: 1px solid var(--border); border-radius: calc(var(--radius) + 6px); overflow: hidden; }
.look backdrop-pattern { border-radius: inherit; }
.look-inner { padding: clamp(1rem, 3vw, 2rem); }
.look-head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.look-head h2 { margin: 0; font-size: 1.5rem; }
.look-description { margin: 0.35rem 0 1.25rem; color: var(--muted-foreground); max-width: 60ch; }
.look-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1rem; align-items: start; }
.look-grid content-card p { margin: 0 0 0.75rem; }
.look-grid content-card text-field, .look-grid content-card toggle-switch { margin-top: 0.75rem; }
.look-side { display: grid; gap: 1rem; }
.look-people { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.look-install { margin: 0; padding: 0.75rem 1rem; border-top: 1px solid var(--border); background: var(--background); }
.editor { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1rem 1.25rem; align-items: end; margin: 1rem 0; }
.editor-colour, .editor-range { display: grid; gap: 0.4rem; font-weight: 600; font-size: 0.925rem; }
.editor-colour input { width: 100%; height: 2.5rem; padding: 0.15rem; border: 1px solid var(--input); border-radius: calc(var(--radius) - 2px); background: var(--background); }
.editor-range input { width: 100%; accent-color: var(--primary); }
.editor-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; }
.editor-out pre { max-height: 22rem; overflow: auto; }

/* ---- package manager tabs on install commands */
.pm-only { display: none; }
html[data-pm=npm] .pm-only[data-pm=npm], html[data-pm=pnpm] .pm-only[data-pm=pnpm], html[data-pm=yarn] .pm-only[data-pm=yarn], html[data-pm=bun] .pm-only[data-pm=bun] { display: inline; }
.pm-tabs { display: inline-flex; gap: 0.15rem; }
.pm-tab { padding: 0.1rem 0.5rem; border: 0; border-radius: calc(var(--radius) - 4px); background: none; color: color-mix(in oklab, var(--muted-foreground) 60%, var(--foreground)); font: inherit; font-size: 0.8rem; cursor: pointer; }
.pm-tab[aria-pressed=true] { background: var(--background); color: var(--foreground); box-shadow: 0 0 0 1px var(--border); }
.pm-tab:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }

/* ---- nav search */
.nav-search { margin: 0 0 0.75rem; }
.nav-search input { width: 100%; box-sizing: border-box; padding: 0.45rem 0.65rem; border: 1px solid var(--input); border-radius: calc(var(--radius) - 2px); background: var(--background); color: var(--foreground); font: inherit; font-size: 0.9rem; }
.nav-search input:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.nav-none { margin: 0.4rem 0 0; font-size: 0.85rem; color: var(--muted-foreground); }
.nav-none:empty { display: none; }
.site-nav li[hidden], .site-nav section[hidden] { display: none; }
@media (max-width: 52rem) {
  /* The nav is one sideways row on a phone: search stays at its start while the row scrolls. */
  .nav-search { position: sticky; left: 0; z-index: 1; flex: 0 0 9.5rem; margin: 0; padding-right: 0.4rem; background: var(--background); }
  .nav-none { display: none; }
}
.site-nav li.nav-best a { box-shadow: inset 0 0 0 1px var(--ring); }
.dialog-label { margin: 0.75rem 0 0.35rem; font-weight: 600; font-size: 0.9rem; }
#theme segmented-control { display: block; }
.variants { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem 1rem; margin: 0.75rem 0 0; padding: 1.25rem; border: 1px dashed var(--border); border-radius: var(--radius); }
.variants-label { margin: 1.25rem 0 0; font-weight: 600; }


/* ---- the home page's theme strip */
.theme-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr)); gap: 0.75rem; margin: 1rem 0 0.5rem; }
.theme-chip { display: grid; gap: 0.6rem; padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; transition: transform var(--duration-fast) var(--ease-out); }
.theme-chip:hover { transform: translateY(-2px); }
.theme-chip strong { font-family: var(--font-heading, inherit); }
.theme-swatches { display: flex; gap: 0.3rem; }
.theme-swatches span { width: 1.1rem; height: 1.1rem; border-radius: calc(var(--radius) * 0.5); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--foreground) 15%, transparent); }
.theme-chip small { color: var(--muted-foreground); }
@media (prefers-reduced-motion: reduce) { .theme-chip { transition: none; } }

.demo-hero { padding: 3rem 1.5rem; text-align: center; }
.demo-hero h2 { margin: 0; }

/* ---- the theme studio */
.studio-layout { display: grid; grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; margin-top: 1rem; }
@media (max-width: 64rem) { .studio-layout { grid-template-columns: minmax(0, 1fr); } }
.studio-controls { display: grid; gap: 1rem; position: sticky; top: calc(var(--bar-height) + 1rem); max-height: calc(100dvh - var(--bar-height) - 2rem); overflow: auto; padding-right: 0.25rem; }
/* A scrolling column says there's more below: a fade over the bottom edge, with nothing under it at the end. */
@media (min-width: 64.01rem) { .studio-controls::after { content: ""; position: sticky; bottom: 0; display: block; height: 2.5rem; margin-top: -1.5rem; background: linear-gradient(to bottom, transparent, var(--background)); pointer-events: none; } }
.studio-css[aria-invalid=true] { border-color: var(--destructive); }
.studio-warning { margin: 0.5rem 0; color: var(--destructive); font-weight: 600; }
.studio-warning:empty { display: none; }
@media (max-width: 40rem) { #studio-contrast { min-width: 0; } #studio-contrast td { white-space: normal; } }
@media (max-width: 64rem) { .studio-controls { position: static; max-height: none; } }
.studio-controls fieldset { display: grid; gap: 0.85rem; margin: 0; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); }
.studio-controls legend { padding: 0 0.35rem; font-weight: 700; }
.studio-group { display: grid; gap: 0.35rem; }
.studio-group-name { margin: 0.4rem 0 0; font-size: 0.8rem; font-weight: 700; color: var(--muted-foreground); }
.studio-colour { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) minmax(0, 11rem); align-items: center; gap: 0.5rem; font-size: 0.875rem; }
.studio-colour input[type=color] { width: 2.25rem; height: 1.9rem; padding: 0.1rem; border: 1px solid var(--input); border-radius: calc(var(--radius) * 0.5); background: var(--background); cursor: pointer; }
.studio-css { min-width: 0; padding: 0.3rem 0.45rem; border: 1px solid var(--input); border-radius: calc(var(--radius) * 0.5); background: var(--background); color: var(--foreground); font: 0.75rem/1.2 var(--mono); }
.studio-changed > span { font-weight: 700; }
.studio-changed > span::after { content: "\00a0·"; color: var(--primary); }
.studio-previews { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 1rem; }
.studio-look { margin: 0 !important; }
.studio-tag { margin: 0 0 0.75rem; font-size: 0.8rem; font-weight: 700; color: var(--muted-foreground); }
.studio-sample { display: grid; gap: 1rem; }
.studio-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 0.75rem; align-items: start; }
.studio-buttons { display: flex; flex-wrap: wrap; gap: 0.4rem; grid-column: 1 / -1; }
.studio-swatch { display: inline-grid; place-items: center; width: 1.9rem; height: 1.5rem; border-radius: calc(var(--radius) * 0.4); font-weight: 700; font-size: 0.8rem; box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--foreground) 12%, transparent); }
.studio-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
#studio-contrast td { white-space: nowrap; }
main > .studio, main > .composer { max-width: 96rem; }
#studio-contrast { min-width: 34rem; }
#studio-contrast th[scope=row] { white-space: normal; min-width: 9rem; }

/* ---- the page composer */
.composer-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem 1.25rem; margin: 0 0 1rem; }
.composer-bar select-field { width: 14rem; }
.composer-layout { display: grid; grid-template-columns: 14rem minmax(0, 1fr) 18rem; gap: 1rem; align-items: start; }
@media (max-width: 72rem) { .composer-layout { grid-template-columns: 12rem minmax(0, 1fr); } }
@media (max-width: 48rem) { .composer-layout { grid-template-columns: minmax(0, 1fr); } }
.composer-library, .composer-inspector { position: sticky; top: calc(var(--bar-height) + 1rem); max-height: calc(100dvh - var(--bar-height) - 2rem); overflow: auto; padding: 0.9rem; border: 1px solid var(--border); border-radius: var(--radius); }
@media (max-width: 72rem) {
  .composer-library { position: static; max-height: 28rem; }
  /* Narrower, the settings are a sheet from the bottom while a block is being changed. */
  .composer-inspector { display: none; }
  .composer[data-editing] .composer-inspector { display: grid; position: fixed; inset: auto 0 0 0; z-index: 40; max-height: 60dvh; border-radius: var(--radius) var(--radius) 0 0; background: var(--background); box-shadow: 0 -8px 30px color-mix(in oklab, var(--foreground) 18%, transparent); }
  .composer[data-editing] { padding-bottom: 60dvh; }
}
@media (min-width: 72.01rem) { .composer-done { display: none; } }
.composer-inspector-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.composer-inspector-head h2 { margin: 0; }
.composer-status { margin: 0 0 0 auto; align-self: center; }
.composer-problem { margin: 0; color: var(--destructive); font-size: 0.85rem; }
.composer-problem:empty { display: none; }
.composer-field [aria-invalid=true] { border-color: var(--destructive); }
/* The composer needs the room: its own lists replace the component list at the side. */
.layout:has(> main > .composer) { grid-template-columns: minmax(0, 1fr); }
.layout:has(> main > .composer) > .site-nav { display: none; }
.composer-library h2, .composer-inspector h2 { margin: 0 0 0.6rem; font-size: 1rem; }
.composer-library h3 { margin: 0.9rem 0 0.3rem; font-size: 0.775rem; color: var(--muted-foreground); }
.composer-library ul { margin: 0; padding: 0; list-style: none; }
#compose-search { width: 100%; box-sizing: border-box; padding: 0.4rem 0.6rem; border: 1px solid var(--input); border-radius: calc(var(--radius) - 2px); background: var(--background); color: var(--foreground); font: inherit; font-size: 0.875rem; }
.composer-add { display: flex; gap: 0.4rem; width: 100%; padding: 0.3rem 0.45rem; border: 0; border-radius: calc(var(--radius) * 0.5); background: none; color: var(--foreground); font: inherit; font-size: 0.85rem; text-align: left; cursor: pointer; }
.composer-add span { color: var(--muted-foreground); font-weight: 700; }
.composer-add:hover { background: var(--accent); }
.composer-add:focus-visible, .composer-item:focus-visible, .composer-tools button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.composer-frame { margin: 0 auto; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: max-width var(--duration-slow) var(--ease-out); }
.composer-canvas { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; min-height: 24rem; padding: 1rem; background: var(--background); color: var(--foreground); container-type: inline-size; }
.composer-item { position: relative; grid-column: span 6; min-width: 0; padding-top: 1.9rem; border-radius: calc(var(--radius) * 0.6); outline: 1px dashed transparent; outline-offset: 4px; }
.composer-half { grid-column: span 3; }
.composer-third { grid-column: span 2; }
@container (max-width: 34rem) { .composer-half, .composer-third { grid-column: span 6; } }
.composer-item:hover { outline-color: color-mix(in oklab, var(--foreground) 25%, transparent); }
.composer-selected, .composer-selected:hover { outline: 2px solid var(--primary); }
.composer-tools { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 0.2rem; height: 1.5rem; font-size: 0.75rem; }
.composer-tools button { opacity: 0.6; }
.composer-item:hover .composer-tools button, .composer-selected .composer-tools button, .composer-item:focus-within .composer-tools button { opacity: 1; }
.composer-name { margin-right: auto; font-family: var(--mono); color: color-mix(in oklab, var(--muted-foreground) 70%, var(--foreground)); }
.composer-tools button { width: 1.75rem; height: 1.5rem; padding: 0; border: 1px solid var(--border); border-radius: calc(var(--radius) * 0.4); background: var(--background); color: var(--foreground); font-size: 0.8rem; line-height: 1; cursor: pointer; }
.composer-tools button:disabled { opacity: 0.35; cursor: default; }
.composer-empty { grid-column: 1 / -1; display: grid; place-content: center; text-align: center; color: var(--muted-foreground); }
.composer-inspector { display: grid; gap: 0.7rem; }
#compose-inspector { display: grid; gap: 0.75rem; }
.composer-picked { display: flex; justify-content: space-between; margin: 0; }
.composer-field { display: grid; gap: 0.3rem; font-size: 0.85rem; font-weight: 600; }
.composer-field small { font-weight: 400; color: var(--muted-foreground); }
.composer-field input, .composer-field textarea, .composer-field select { width: 100%; box-sizing: border-box; padding: 0.4rem 0.55rem; border: 1px solid var(--input); border-radius: calc(var(--radius) - 2px); background: var(--background); color: var(--foreground); font: 400 0.85rem/1.4 var(--font); }
.composer-field textarea { font-family: var(--mono); font-size: 0.775rem; resize: vertical; }
.composer-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; font-weight: 600; }
.composer-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#compose-code { white-space: pre; }
.composer .code pre { max-height: 26rem; overflow: auto; }
@media (pointer: coarse) { .composer-item { padding-top: 3.1rem; } .composer-tools { height: 2.75rem; } .composer-tools button { width: 2.75rem; height: 2.75rem; } }
@media (prefers-reduced-motion: reduce) { .composer-frame { transition: none; } }
