:root { color-scheme: light dark; font-family: Inter, ui-sans-serif, system-ui, sans-serif; --cre8-page-max-width: 1440px; --cre8-page-gutter-x: 24px; --cre8-page-gutter-y: 20px; --cre8-sidebar-width: 240px; --cre8-sidebar-collapsed-width: 52px; }
/* App-view palette tokens.
   Distinct from the `--cre8-*` set emitted by `style_tokens.rs`: those are the
   SITE-template system and carry flat single-hex values, because a site template
   picks one palette. App document views adapt to the viewer's light/dark mode,
   so these carry light-dark() pairs and must never be conflated with them —
   hence the `-view-` infix.
   Values are exactly the literals the app `*_PAGE_STYLE` blocks already used, so
   adopting a token is a no-op for rendering; it only removes a repeated literal.
   Safe to reference from any app view: PageShell emits this stylesheet by
   default (`base_theme: true`), and only `without_base_theme()` opts out. */
:root {
  --cre8-view-fg: light-dark(#16201c, #eef2f7);
  --cre8-view-fg-muted: light-dark(#6b7770, #94a0ae);
  --cre8-view-fg-faint: light-dark(#8a938e, #7c857f);
  --cre8-view-fg-soft: light-dark(#60706a, #9eb3aa);
  --cre8-view-border: light-dark(rgba(16,24,20,0.10), rgba(255,255,255,0.06));
  --cre8-view-border-subtle: light-dark(rgba(16,24,20,0.08), rgba(255,255,255,0.05));
  --cre8-view-border-strong: light-dark(rgba(16,24,20,0.16), rgba(255,255,255,0.12));
  --cre8-view-surface: light-dark(#f6faf8, rgba(255,255,255,0.03));
  --cre8-view-surface-alt: light-dark(#fafcfb, rgba(255,255,255,0.02));
  --cre8-view-chip-bg: light-dark(rgba(16,24,20,0.06), rgba(255,255,255,0.08));
  --cre8-view-accent: light-dark(#0f5c40, #51d88a);
  --cre8-view-on-accent: light-dark(#ffffff, #081b14);
  --cre8-view-danger: light-dark(#a32d2d, #f0a0a0);
  /* Status and ground. The dark halves are the literals apps already used; the
     light halves were darkened to clear 4.5:1 as text, both on the body ground
     and on a 9% tint of themselves (success 5.06 / 4.50, warning 5.53 / 4.90,
     info 5.77 / 5.10, measured 2026-10-27). `bg` is the body ground, for an
     inset that reads as the page beneath a surface. */
  --cre8-view-success: light-dark(#18794e, #47d7a0);
  --cre8-view-warning: light-dark(#8a5a12, #e1a852);
  --cre8-view-info: light-dark(#1f63a8, #6bbcff);
  --cre8-view-bg: light-dark(#f6f8f4, #0b0c10);
  /* Link ink: a lighter green than `accent`, so a link reads apart from an
     accent fill (5.21:1 on the light body, 9.01:1 on the dark). */
  --cre8-view-link: light-dark(#0f765d, #5fc1a8);
  /* The error hint reads danger here. A fixed #ef4444 was 3.5:1 on the light
     body; danger is 6.62 / 9.53. */
  --cre8-error-fg: var(--cre8-view-danger);
}

/* ── Error hint (shared "Connection failed" / inline error text) ────────── */
/* Mirrors the rule in `render_html::section_styles::SECTION_BASE_CSS`. Both
   stylesheets must carry it: SECTION_BASE_CSS is only injected for authored
   site templates, while app *document* pages (breath, channel, claim, court,
   market, meditation, shop, item, site, conduit, onboard, capitalstrategy)
   load `base_theme.css` alone. Without this rule the class those apps emit —
   `class="hint cre8-error-hint"` — resolved to nothing and their "Connection
   failed:" text rendered in inherited body color instead of red. */
.cre8-error-hint {
  color: var(--cre8-error-fg);
  font-weight: 500;
}

body { margin: 0; min-height: 100vh; background: var(--cre8-view-bg); color: var(--cre8-view-fg); }
#cre8-continuous-view { display: contents; }
a { color: var(--cre8-view-link); font-weight: 760; }
code { font-family: "SFMono-Regular", Consolas, ui-monospace, monospace; font-size: 0.95em; }

/* ── scrollbars: themed thin scrollbars across every SSR scroll surface ─── */
* { scrollbar-width: thin; scrollbar-color: light-dark(#c4ccc2, #3a3f47) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { border-radius: 999px; background: light-dark(#c4ccc2, #3a3f47); border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: light-dark(#9fb3a9, #5b6870); background-clip: padding-box; }
::-webkit-scrollbar-thumb:active { background: light-dark(#0f765d, #5fc1a8); background-clip: padding-box; }

/* ── page layout: AppShell / Nav / Sidebar / Drawer / Footer ───────────── */
.primitive-app-shell { display: flex; flex-direction: column; height: 100vh; min-height: 100vh; overflow: hidden; }
.primitive-app-shell__body { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.primitive-app-shell__content { flex: 1; min-width: 0; width: 100%; max-width: none; box-sizing: border-box; margin: 0; padding: var(--cre8-page-gutter-y) var(--cre8-page-gutter-x); overflow: auto; }
/* AppShell content owns the canonical outer padding. Direct child page
   containers share one width contract, while legacy <main> wrappers have
   their padding/margin/max-width neutralized so we don't double up. */
.primitive-app-shell__content > .primitive-page,
.primitive-app-shell__content > .primitive-attention-scope,
.primitive-app-shell__content > .primitive-room-scope,
.primitive-app-shell__content > main { width: min(var(--cre8-page-max-width), 100%); box-sizing: border-box; margin: 0 auto; max-width: none; padding: 0; }
/* A band (the app hero, the app's tab bar) spans the whole content region at
   any window width while the column under it stays capped: it bleeds by
   `--cre8-shell-half - 50%`, the distance from its centered column to the
   region's padding edge. The half width is taken once, as a length, by the
   region's own children, so a container an app declares further down cannot
   change it. The gutter is held stable because Chrome otherwise counts a
   classic scrollbar inside 100cqw and the band overruns into it.
   --cre8-shell-pad-x names the region's inline padding for a page that zeroes
   that padding without zeroing the gutter. */
@property --cre8-shell-half { syntax: "<length>"; inherits: true; initial-value: 0px; }
@supports (width: 1cqw) {
  .primitive-app-shell__content { container-type: inline-size; scrollbar-gutter: stable; }
  .primitive-app-shell__content > * { --cre8-shell-half: calc(50cqw + var(--cre8-shell-pad-x, var(--cre8-page-gutter-x, 24px))); }
}

.primitive-nav { position: sticky; top: 0; z-index: 39; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: light-dark(#ffffff, #16181d); border-bottom: 1px solid light-dark(#e3e7e0, #2a2c33); color: light-dark(#17201d, #e8e8ec); }
.primitive-nav__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.primitive-nav__menu { display: none; appearance: none; align-items: center; justify-content: center; flex: none; width: 36px; height: 32px; padding: 0; border: 1px solid light-dark(#cdd3cb, #2a2c33); border-radius: 6px; background: light-dark(#ffffff, #1a1d22); color: inherit; cursor: pointer; }
/* The hamburger belongs to the shell's own bar, and only when there is a
   sidebar for it to open: a nav nested in the page, or a shell with no sidebar
   (minimal-chrome commerce pages), would ship a dead or duplicate button. */
.primitive-app-shell:has(.primitive-sidebar) > .primitive-nav > .primitive-nav__menu { display: inline-flex; }
.primitive-nav__menu:hover { background: light-dark(#eef2ec, #1f2126); }
.primitive-nav__menu:focus-visible { outline: 2px solid light-dark(#0f765d, #5fc1a8); outline-offset: 2px; }
.primitive-nav__menu-bars { display: inline-grid; gap: 3px; width: 16px; }
.primitive-nav__menu-bars span { display: block; height: 2px; border-radius: 999px; background: currentColor; }
.primitive-nav__right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.cre8-nav-account { flex: none; }
.cre8-nav-account__trigger { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 3px 8px 3px 3px; border-radius: 999px; color: inherit; text-decoration: none; font-size: 13px; font-weight: 600; }
.cre8-nav-account__trigger:hover { background: light-dark(#eef2ec, #252a30); }
.cre8-nav-account__trigger:focus-visible, .cre8-account-drawer :is(a, button):focus-visible { outline: 2px solid light-dark(#0f765d, #5fc1a8); outline-offset: 3px; }
.cre8-nav-account__avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; overflow: hidden; border-radius: 50%; background: light-dark(#e3eee7, #2b3b35); color: light-dark(#226048, #b5dfca); font-size: 12px; }
.cre8-nav-account__avatar svg { width: 20px; height: 20px; }
.cre8-nav-account__avatar img { width: 100%; height: 100%; object-fit: cover; }
.cre8-nav-account__label { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cre8-account-drawer { position: fixed; inset: 0 0 0 auto; box-sizing: border-box; width: min(380px, 92vw); height: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 24px; border: 0; border-left: 1px solid light-dark(#e3e7e0, #2a2c33); background: light-dark(#fff, #16181d); color: light-dark(#17201d, #e8e8ec); box-shadow: -12px 0 40px #0002; overflow-y: auto; }
.cre8-account-drawer::backdrop { background: #0f161366; }
.cre8-account-drawer__header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; }
.cre8-account-drawer__header h2 { margin: 0; font-size: 20px; }
.cre8-account-drawer__header button { padding: 8px 12px; border: 1px solid light-dark(#cdd3cb, #3c434b); border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.cre8-account-drawer__identity { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; overflow-wrap: anywhere; }
.cre8-account-drawer__identity .cre8-nav-account__avatar { width: 48px; height: 48px; font-size: 16px; }
.cre8-account-drawer__identity p { margin: 4px 0 0; font-size: 13px; opacity: .75; }
.cre8-account-drawer__links { display: grid; gap: 8px; }
.cre8-account-drawer__links a { display: block; padding: 12px; border-radius: 8px; color: inherit; text-decoration: none; background: light-dark(#f1f4ef, #22262b); font-size: 14px; }
.cre8-account-drawer__links a:hover { background: light-dark(#e3eee7, #2b3b35); }
.cre8-account-switcher { margin: 0 0 20px; padding: 12px; border-radius: 10px; background: light-dark(#f6f8f5, #1e2228); border: 1px solid light-dark(#e3e7e0, #2a2c33); display: grid; gap: 8px; }
.cre8-account-switcher__heading { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; opacity: .75; }
.cre8-account-switcher__list { display: grid; gap: 6px; }
.cre8-account-switcher__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 6px; background: light-dark(#fff, #16181d); font-size: 13px; }
.cre8-account-switcher__account { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, monospace; font-size: 12px; }
.cre8-account-switcher__badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: light-dark(#e3eee7, #2b3b35); color: light-dark(#226048, #b5dfca); }
.cre8-account-switcher__switch { padding: 4px 10px; border-radius: 6px; border: 1px solid light-dark(#cdd3cb, #3c434b); background: transparent; color: inherit; font-size: 12px; cursor: pointer; }
.cre8-account-switcher__switch:hover { background: light-dark(#e3eee7, #2b3b35); }
.cre8-account-switcher__status { margin: 0; font-size: 12px; opacity: .8; }
.cre8-account-switcher__add { display: inline-block; font-size: 13px; font-weight: 600; color: light-dark(#0f765d, #5fc1a8); text-decoration: none; }
.cre8-account-switcher__add:hover { text-decoration: underline; }
@media (max-width: 760px) {
  .primitive-nav:has(.cre8-nav-account) { gap: 8px; padding: 10px 12px; }
  .primitive-nav__right:has(.cre8-nav-account) { min-width: 0; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .primitive-nav:has(.cre8-nav-account) .runtime-search__trigger > span { display: none; }
  .cre8-nav-account__trigger { gap: 5px; padding-right: 5px; }
  .cre8-nav-account__label { max-width: 64px; font-size: 12px; }
}
.primitive-nav__brand { font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; font-size: 14px; padding: 4px 8px; border-radius: 6px; text-decoration: none; color: inherit; }
.primitive-nav__brand:hover { background: light-dark(#eef2ec, #1f2126); }
.primitive-nav__items { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.primitive-nav__item { display: inline-flex; }
.primitive-nav__link { padding: 6px 10px; border-radius: 6px; font-weight: 600; font-size: 13px; text-decoration: none; color: inherit; }
.primitive-nav__link:hover { background: light-dark(#eef2ec, #1f2126); }
.primitive-nav__item--active .primitive-nav__link { background: light-dark(#0f765d, #2a3550); color: #ffffff; }

/* On narrow shells the same destinations remain in the navigation drawer. */
@media (max-width: 640px) {
  .primitive-app-shell:has(.primitive-sidebar) > .primitive-nav .primitive-nav__items { display: none; }
}

.primitive-sidebar { flex: 0 0 var(--cre8-sidebar-width); width: var(--cre8-sidebar-width); min-width: var(--cre8-sidebar-width); max-width: var(--cre8-sidebar-width); height: 100%; max-height: 100vh; box-sizing: border-box; padding: 16px 12px; background: light-dark(#fbfcfa, #14161a); border-right: 1px solid light-dark(#e3e7e0, #2a2c33); overflow: auto; color: light-dark(#17201d, #e8e8ec); }
.primitive-sidebar__header { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: light-dark(#6c7572, #8e9591); padding: 4px 8px 12px; }
.primitive-sidebar__group { display: flex; flex-direction: column; gap: 1px; padding: 6px 0; }
.primitive-sidebar__group-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: light-dark(#8e9591, #6c7572); padding: 6px 8px 4px; }
.primitive-sidebar__item { appearance: none; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; padding: 6px 10px; border-radius: 6px; font: inherit; font-size: 13px; font-weight: 500; line-height: 1.25; text-decoration: none; color: inherit; background: transparent; border: 0; cursor: pointer; text-align: left; width: 100%; }
.primitive-sidebar__item:hover { background: light-dark(#eef2ec, #1f2126); }
.primitive-sidebar__item--active { background: light-dark(#0f765d, #2a3550); color: #ffffff; }
.primitive-sidebar__item--active:hover { background: light-dark(#0f765d, #2a3550); }
.primitive-sidebar__badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 9px; background: light-dark(#0f765d, #2a3550); color: #ffffff; font-size: 10px; font-weight: 700; }
.primitive-sidebar__item--active .primitive-sidebar__badge { background: #ffffff; color: light-dark(#0f765d, #2a3550); }

/* Sidebar `collapsed` state (Sidebar ComponentSpec: states = active|collapsed,
   stateAttribute = data-collapsed). The rail is the SSR mirror of the React
   sidebar's collapsed rail: labels and group headings drop out, the per-item
   glyph (its initial) takes over, and the `title` attribute carries the full
   name. Only sidebars built with `.collapsible(true)` emit the attribute or
   the glyph/label spans, so every other sidebar is untouched by this block. */
.primitive-sidebar__collapse { appearance: none; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.primitive-sidebar__collapse:hover { background: light-dark(#eef2ec, #1f2126); }
.primitive-sidebar__collapse-glyph { display: inline-flex; font-size: 13px; line-height: 1; transition: transform 160ms ease; }
.primitive-sidebar__item-glyph { display: none; flex: 0 0 auto; align-items: center; justify-content: center; width: 20px; font-weight: 700; text-transform: uppercase; }
.primitive-sidebar__item-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.primitive-sidebar[data-collapsed="true"] { flex-basis: var(--cre8-sidebar-collapsed-width); width: var(--cre8-sidebar-collapsed-width); min-width: var(--cre8-sidebar-collapsed-width); max-width: var(--cre8-sidebar-collapsed-width); padding-left: 6px; padding-right: 6px; overflow-x: hidden; }
.primitive-sidebar[data-collapsed="true"] .primitive-sidebar__header { justify-content: center; padding-left: 0; padding-right: 0; }
.primitive-sidebar[data-collapsed="true"] .primitive-sidebar__header-label,
.primitive-sidebar[data-collapsed="true"] .primitive-sidebar__group-label,
.primitive-sidebar[data-collapsed="true"] .primitive-sidebar__item-label { display: none; }
.primitive-sidebar[data-collapsed="true"] .primitive-sidebar__collapse-glyph { transform: rotate(180deg); }
.primitive-sidebar[data-collapsed="true"] .primitive-sidebar__item { justify-content: center; padding-left: 6px; padding-right: 6px; }
.primitive-sidebar[data-collapsed="true"] .primitive-sidebar__item-glyph { display: inline-flex; }
/* At rail width a badge would overflow the 40px item, so it rides the glyph's
   top-right corner instead of sitting in the flex row. */
.primitive-sidebar[data-collapsed="true"] .primitive-sidebar__item { position: relative; }
.primitive-sidebar[data-collapsed="true"] .primitive-sidebar__badge { position: absolute; top: 2px; right: 2px; min-width: 14px; height: 14px; padding: 0 3px; font-size: 9px; }
.primitive-sidebar[data-collapsed="true"] .primitive-sidebar__group { padding: 4px 0; }
/* Every property the hamburger and the collapse button change, so the rail
   slides instead of snapping. `visibility` holds it visible until the slide ends. */
.primitive-sidebar { transition: flex-basis var(--cre8-motion-slide) var(--cre8-ease-slide), width var(--cre8-motion-slide) var(--cre8-ease-slide), min-width var(--cre8-motion-slide) var(--cre8-ease-slide), max-width var(--cre8-motion-slide) var(--cre8-ease-slide), padding var(--cre8-motion-slide) var(--cre8-ease-slide), border-right-width var(--cre8-motion-slide) var(--cre8-ease-slide), visibility var(--cre8-motion-slide); }

.primitive-drawer-wrap { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.primitive-drawer-wrap[data-open="false"] { visibility: hidden; }
.primitive-drawer-wrap[data-open="true"] { visibility: visible; pointer-events: auto; }
.primitive-drawer__backdrop { position: absolute; inset: 0; background: rgba(15, 22, 19, 0.4); opacity: 0; transition: opacity var(--cre8-motion-base) ease; }
.primitive-drawer-wrap[data-open="true"] .primitive-drawer__backdrop { opacity: 1; }
.primitive-drawer { position: absolute; top: 0; bottom: 0; width: min(420px, 92vw); background: light-dark(#ffffff, #16181d); color: light-dark(#17201d, #e8e8ec); box-shadow: 0 12px 40px rgba(15, 22, 19, 0.18); display: flex; flex-direction: column; transition: transform var(--cre8-motion-slide) var(--cre8-ease-slide); }
.primitive-drawer-wrap--right .primitive-drawer { right: 0; transform: translateX(100%); }
.primitive-drawer-wrap--left .primitive-drawer { left: 0; transform: translateX(-100%); }
.primitive-drawer-wrap[data-open="true"] .primitive-drawer { transform: translateX(0); }
.primitive-drawer__header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid light-dark(#e3e7e0, #2a2c33); }
.primitive-drawer__title { margin: 0; font-size: 16px; font-weight: 700; }
.primitive-drawer__body { flex: 1; padding: 16px 18px; overflow: auto; }

.primitive-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 20px; background: light-dark(#fbfcfa, #14161a); border-top: 1px solid light-dark(#e3e7e0, #2a2c33); font-size: 12px; color: light-dark(#6c7572, #8e9591); }
.primitive-footer__item { display: inline-flex; align-items: center; gap: 4px; }
.primitive-footer__item-label { font-weight: 600; color: light-dark(#4f5854, #a8a8b0); }
.primitive-footer__item-label::after { content: ":"; }
.primitive-footer__item-value { font-variant-numeric: tabular-nums; }
.primitive-footer-attention { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; margin-left: auto; padding: 3px 8px; border: 1px solid light-dark(#d7ddd5, #30343a); border-radius: 999px; color: inherit; text-decoration: none; background: light-dark(#ffffff, #191c22); font-variant-numeric: tabular-nums; }
.primitive-footer-attention:hover { color: light-dark(#17201d, #f0f4ef); border-color: light-dark(#9fb3a9, #5b6870); }
.primitive-footer-attention__menu { display: inline-grid; gap: 2px; width: 12px; }
.primitive-footer-attention__menu span { display: block; height: 1px; border-radius: 999px; background: currentColor; opacity: .82; }
.primitive-footer-attention__label { font-weight: 650; color: light-dark(#4f5854, #a8a8b0); }
.primitive-footer-attention__value { font-weight: 760; color: light-dark(#17201d, #f0f4ef); }
.primitive-footer-attention__threads:not(:empty) { color: light-dark(#6c7572, #9ba4a0); }

/* Expanded footer: brand and link columns over the status row. It closes the
   page inside the scrolling content, bleeding through the content gutters;
   `top: 100%` rests it on the foot of the viewport when the page is short. */
.primitive-footer--expanded { display: block; position: sticky; top: 100%; padding: 0; font-size: 13px; border-top: 0; background-image: radial-gradient(90% 120% at 0% 0%, light-dark(rgba(15, 118, 93, 0.07), rgba(95, 193, 168, 0.08)), transparent 60%); }
/* A hairline in place of the flat border, brightest above the brand. */
.primitive-footer--expanded::before { content: ""; display: block; height: 1px; background: linear-gradient(90deg, light-dark(rgba(15, 118, 93, 0.5), rgba(95, 193, 168, 0.55)), light-dark(#e3e7e0, #2a2c33) 40%, transparent); }
.primitive-app-shell__content > .primitive-footer--expanded { margin: clamp(32px, 6vh, 72px) calc(-1 * var(--cre8-page-gutter-x)) calc(-1 * var(--cre8-page-gutter-y)); }
.primitive-footer__inner { width: min(var(--cre8-page-max-width), 100%); box-sizing: border-box; margin: 0 auto; padding: 32px var(--cre8-page-gutter-x) 14px; }
.primitive-footer__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 28px 24px; }
.primitive-footer__brand { grid-column: span 2; min-width: 0; }
.primitive-footer__brand-link { display: inline-flex; align-items: center; gap: 14px; color: light-dark(#17201d, #f0f4ef); text-decoration: none; }
/* The original CRE8 mark follows the text color in either viewer theme. */
.primitive-footer__mark { display: block; flex: none; width: 48px; height: 48px; background: currentColor; -webkit-mask: url("/view/local/assets/brand/cre8/logo.svg") center / contain no-repeat; mask: url("/view/local/assets/brand/cre8/logo.svg") center / contain no-repeat; }
.primitive-footer__brand-name { font-size: 24px; font-weight: 800; letter-spacing: 0.01em; }
/* The tagline is a statement, not a caption: larger, brighter, balanced. */
.primitive-footer__tagline { margin: 16px 0 0; max-width: 26ch; font-size: 17px; font-weight: 600; line-height: 1.35; letter-spacing: -0.005em; color: light-dark(#26302c, #dfe5ec); text-wrap: balance; }
.primitive-footer__column { min-width: 0; }
.primitive-footer__heading { margin: 0 0 12px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: light-dark(#8a938f, #6c7787); }
.primitive-footer__links { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.primitive-footer__link { color: light-dark(#3d4743, #aeb7c3); font-weight: 500; text-decoration: none; transition: color 0.15s ease; }
.primitive-footer__link:hover { color: light-dark(#0f765d, #5fc1a8); }
.primitive-footer__link:focus-visible, .primitive-footer__brand-link:focus-visible { outline: 2px solid light-dark(#0f765d, #5fc1a8); outline-offset: 2px; border-radius: 4px; }
.primitive-footer__status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 36px; padding-top: 16px; border-top: 1px solid light-dark(#e9ece7, #1f2228); font-size: 12px; }
/* Each status entry is a chip: a small tracked label over a monospace value. */
.primitive-footer__status .primitive-footer__item { min-width: 0; gap: 7px; padding: 4px 11px; border: 1px solid light-dark(#dfe4dc, #262a31); border-radius: 999px; background: light-dark(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.025)); color: light-dark(#2f3935, #c9d1db); }
.primitive-footer__status .primitive-footer__item-label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: light-dark(#8a938f, #6c7787); }
.primitive-footer__status .primitive-footer__item-label::after { content: none; }
.primitive-footer__status .primitive-footer__item-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: min(46ch, 60vw); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }
/* A dot marks the network that served the page. */
.primitive-footer__status a.primitive-footer__item-value[href="/network"]::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #2fbf8f; box-shadow: 0 0 0 3px rgba(47, 191, 143, 0.18); vertical-align: 1px; }
.primitive-footer__status .primitive-footer-attention { border-color: light-dark(#dfe4dc, #262a31); background: light-dark(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.025)); }
@media (max-width: 760px) {
  .primitive-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .primitive-footer__brand { grid-column: 1 / -1; }
}

/* canonical primitive defaults: intentionally low specificity for page overrides */
:where(button, input, select, textarea) { font: inherit; }
/* Page text is often a record's own text: an unbroken id or URL breaks inside
   its line rather than widening the column past a 390px viewport (PS-C-13). */
:where(.primitive-text, .primitive-page__title) { overflow-wrap: anywhere; }
:where(.primitive-page) { display: flex; flex-direction: column; gap: 18px; }
/* Row lays its children out inline, as the client Row does. SSR carries no
   per-node `gap` (page_shapes §6), so every Row takes this one base gap. */
:where(.primitive-row) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
:where(.primitive-page__header) { margin: 0 0 2px; }
:where(.primitive-page__title) { margin: 0; font-size: clamp(1.4rem, 2.2vw, 2.1rem); font-weight: 800; line-height: 1.12; letter-spacing: -0.015em; }
:where(.primitive-container, .primitive-live-slot, .primitive-attention-scope, .primitive-room-scope) { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
:where(.primitive-room-scope) { position: relative; }
:where(.primitive-room-scope__viewers) { position: absolute; top: 10px; right: 10px; z-index: 30; display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; background: rgba(15, 23, 42, 0.82); color: #ffffff; font-size: 11px; font-weight: 760; line-height: 1.2; pointer-events: none; }
:where(.primitive-room-scope__cursor-layer) { position: absolute; inset: 0; z-index: 29; overflow: hidden; pointer-events: none; }
:where(.primitive-room-scope__cursor) { position: absolute; left: 0; top: 0; transform: translate(-2px, -2px); color: #38bdf8; font: 12px/1.2 system-ui, sans-serif; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
:where(.primitive-container__header) { margin-bottom: 2px; }
:where(.primitive-container__title) { margin: 0; font-size: 16px; line-height: 1.25; }
:where(.primitive-live-slot__status) { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 22px; color: light-dark(#6c7572, #8e9591); font-size: 11px; font-weight: 700; line-height: 1.2; }
:where(.primitive-live-slot__status-dot) { width: 6px; height: 6px; border-radius: 999px; background: light-dark(#a4aca8, #5f6662); }
:where(.primitive-live-slot__status[data-state="open"] .primitive-live-slot__status-dot, .primitive-live-slot__status[data-state="patch"] .primitive-live-slot__status-dot) { background: light-dark(#0f765d, #5fc1a8); }
:where(.primitive-live-slot__status[data-state="connecting"] .primitive-live-slot__status-dot, .primitive-live-slot__status[data-state="polling"] .primitive-live-slot__status-dot) { background: light-dark(#a76500, #e8b75a); }
:where(.primitive-live-slot__status[data-state="error"] .primitive-live-slot__status-dot, .primitive-live-slot__status[data-state="unsupported"] .primitive-live-slot__status-dot) { background: light-dark(#b03030, #f08080); }
:where(.primitive-live-slot__noscript) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: light-dark(#6c7572, #8e9591); font-size: 12px; }
:where(.primitive-live-slot__refresh) { font-size: 12px; }
:where(.primitive-card, .primitive-banner, .primitive-stat, .primitive-keyvalue, .primitive-table, .primitive-list, .primitive-accordion) { box-sizing: border-box; border: 1px solid light-dark(#e3e7e0, #2a2c33); border-radius: 12px; background: light-dark(#ffffff, #14161a); box-shadow: 0 1px 2px light-dark(rgba(16, 24, 20, 0.05), rgba(0, 0, 0, 0.22)), 0 10px 24px -18px light-dark(rgba(16, 24, 20, 0.2), rgba(0, 0, 0, 0.5)); transition: border-color var(--cre8-motion-base, 180ms) ease, box-shadow var(--cre8-motion-base, 180ms) ease, transform var(--cre8-motion-base, 180ms) var(--cre8-ease-out, ease); }
:where(.primitive-card__header) { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid light-dark(#e3e7e0, #2a2c33); background: light-dark(#fbfcfa, #191b20); border-radius: 12px 12px 0 0; }
:where(.primitive-card__title) { margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 740; letter-spacing: -0.006em; line-height: 1.25; }
:where(.primitive-card__badge) { color: light-dark(#6c7572, #8e9591); font-size: 12px; font-weight: 650; }
:where(.primitive-card__body) { padding: 16px; min-width: 0; }
/* Navigable card tile (ItemCard with an href) — the whole card is a deep link. */
:where(.primitive-card__link) { display: block; text-decoration: none; color: inherit; }
:where(.primitive-card__link:hover .primitive-card) { border-color: color-mix(in srgb, var(--cre8-view-accent) 55%, var(--cre8-view-border-strong)); box-shadow: 0 1px 2px light-dark(rgba(16, 24, 20, 0.05), rgba(0, 0, 0, 0.22)), 0 16px 34px -16px color-mix(in srgb, var(--cre8-view-accent) 34%, transparent); transform: translateY(-2px); }
:where(.primitive-card__link:focus-visible) { outline: 2px solid light-dark(#0f765d, #5fc1a8); outline-offset: 2px; border-radius: 12px; }
/* A linked card with controls of its own links its title. The hit area covers
   the card and sits under those controls, so both stay pressable. */
:where(.primitive-card--stretched) { position: relative; transition: border-color var(--cre8-motion-quick, 120ms) ease, box-shadow var(--cre8-motion-base, 180ms) ease; }
:where(.primitive-card--stretched:hover) { border-color: var(--cre8-view-accent); box-shadow: 0 10px 28px light-dark(rgba(15, 118, 93, 0.12), rgba(0, 0, 0, 0.32)); }
:where(.primitive-card__title-link) { color: inherit; font-weight: inherit; text-decoration: none; }
:where(.primitive-card__title-link)::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
:where(.primitive-card__title-link:focus-visible) { outline: none; }
:where(.primitive-card__title-link:focus-visible)::after { outline: 2px solid var(--cre8-view-accent); outline-offset: 2px; }
.primitive-card--stretched .primitive-card__body :is(a, button, input, select, textarea, summary, label) { position: relative; z-index: 1; }
/* Interactive tile: the one hover for a card a crate keeps under its own class.
   Add `cre8-lift` beside that class. Only a link, a button, a `[data-href]` or a focusable `[tabindex]`
   tile lifts, so a static card that carries the class stays still and never
   reads as clickable. The lift is `translate`, which leaves a crate's own
   `transform` alone; a linked stat tile and a catalog tile take it too. The
   selector outranks a crate's base `.x-card` rule so the accent border shows. */
.cre8-lift:is(a[href], button, [data-href], [tabindex]:not([tabindex="-1"])), :is(a[href], button, [data-href], [tabindex]:not([tabindex="-1"])):is(.primitive-stat, .primitive-catalog-tile) { cursor: pointer; text-decoration: none; color: inherit; transition: border-color var(--cre8-motion-quick, 120ms) var(--cre8-ease-out, ease), box-shadow var(--cre8-motion-base, 180ms) var(--cre8-ease-out, ease), translate var(--cre8-motion-base, 180ms) var(--cre8-ease-out, ease); }
.cre8-lift:is(a[href], button, [data-href], [tabindex]:not([tabindex="-1"])):hover, :is(a[href], button, [data-href], [tabindex]:not([tabindex="-1"])):is(.primitive-stat, .primitive-catalog-tile):hover { border-color: color-mix(in srgb, var(--cre8-view-accent) 55%, var(--cre8-view-border-strong)); box-shadow: 0 1px 2px light-dark(rgba(16, 24, 20, 0.05), rgba(0, 0, 0, 0.22)), 0 16px 34px -16px color-mix(in srgb, var(--cre8-view-accent) 34%, transparent); translate: 0 -2px; }
.cre8-lift:is(a[href], button, [data-href], [tabindex]:not([tabindex="-1"])):active, :is(a[href], button, [data-href], [tabindex]:not([tabindex="-1"])):is(.primitive-stat, .primitive-catalog-tile):active { translate: 0 0; box-shadow: 0 1px 2px light-dark(rgba(16, 24, 20, 0.08), rgba(0, 0, 0, 0.3)); transition-duration: var(--cre8-motion-quick, 120ms); }
.cre8-lift:is(a[href], button, [data-href], [tabindex]:not([tabindex="-1"])):focus-visible, :is(a[href], button, [data-href], [tabindex]:not([tabindex="-1"])):is(.primitive-stat, .primitive-catalog-tile):focus-visible { outline: 2px solid var(--cre8-view-accent); outline-offset: 2px; }
/* A linked list row tints under the pointer and darkens while pressed. */
:where(.primitive-listitem__link) { transition: background-color var(--cre8-motion-quick, 120ms) ease; }
:where(.primitive-listitem__link:hover) { background: color-mix(in srgb, var(--cre8-view-accent) 6%, transparent); }
:where(.primitive-listitem__link:active) { background: color-mix(in srgb, var(--cre8-view-accent) 11%, transparent); }
@media (prefers-reduced-motion: reduce) {
  .cre8-lift:is(a[href], button, [data-href], [tabindex]:not([tabindex="-1"])), :is(a[href], button, [data-href], [tabindex]:not([tabindex="-1"])):is(.primitive-stat, .primitive-catalog-tile) { transition: border-color var(--cre8-motion-quick, 120ms) ease, box-shadow var(--cre8-motion-quick, 120ms) ease; }
  .cre8-lift:is(a[href], button, [data-href], [tabindex]:not([tabindex="-1"])):is(:hover, :active), :is(a[href], button, [data-href], [tabindex]:not([tabindex="-1"])):is(.primitive-stat, .primitive-catalog-tile):is(:hover, :active) { translate: none; }
  :where(.primitive-card__link:hover .primitive-card) { transform: none; }
}
@media (forced-colors: active) {
  .cre8-lift:is(a[href], button, [data-href], [tabindex]:not([tabindex="-1"])):focus-visible, :is(a[href], button, [data-href], [tabindex]:not([tabindex="-1"])):is(.primitive-stat, .primitive-catalog-tile):focus-visible { outline-color: Highlight; }
}
/* Destructive zone (EditorPage danger actions) — separated from the main form
   by color and a heavier rule, with text beside it; color never carries the
   status alone (PS-C-15). */
:where(.primitive-card--danger) { border-color: light-dark(#e0b6b6, #6b3a3a); }
:where(.primitive-card--danger > .primitive-card__header) { border-bottom-color: light-dark(#e0b6b6, #6b3a3a); background: light-dark(#fdf4f4, #1e1414); }
:where(.primitive-card--danger > .primitive-card__header > .primitive-card__title) { color: var(--cre8-view-danger); }
/* Section: a titled group inside a page. The base keeps block flow (the
   client has no base rule either); only `min-width` stops a wide child from
   widening a grid or flex parent. `--card` gives it the Card surface. The
   variants below restate `display`, so this rule must stay above them. */
:where(.primitive-section) { min-width: 0; }
:where(.primitive-section--card) { box-sizing: border-box; padding: 14px 16px; border: 1px solid light-dark(#e3e7e0, #2a2c33); border-radius: 10px; background: light-dark(#ffffff, #14161a); }
/* Grid section variant (ItemList) — responsive tile grid; the header spans full width. */
:where(.primitive-section--grid) { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
:where(.primitive-section--grid > .primitive-section__header) { grid-column: 1 / -1; margin: 0; }
:where(.primitive-section--grid > .primitive-section__header > .primitive-section__title) { margin: 0; font-size: 13px; font-weight: 740; }
/* Workspace archetype (WorkspaceView) — toolbar / rail|main split / status. */
:where(.primitive-section--workspace) { display: grid; gap: 16px; }
:where(.primitive-row--workspace-body, .primitive-row--workspace-body-inspector, .primitive-row--workspace-body-triple) { display: grid; gap: 16px; align-items: start; }
:where(.primitive-row--workspace-body) { grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); }
:where(.primitive-row--workspace-body-inspector) { grid-template-columns: minmax(0, 1fr) minmax(220px, 320px); }
:where(.primitive-row--workspace-body-triple) { grid-template-columns: minmax(200px, 280px) minmax(0, 1fr) minmax(220px, 320px); }
:where(.primitive-section--workspace-main) { min-width: 0; }
/* Compact workspace is opt-in; ordinary workspace pages retain their spacing. */
:where(.primitive-section--workspace-compact){display:grid;gap:0;min-width:0}
:where(.primitive-section--workspace-compact) > :where(.primitive-row--workspace-body,.primitive-row--workspace-body-inspector,.primitive-row--workspace-body-triple){gap:0;align-items:stretch}
:where(.primitive-section--workspace-compact) > :where(.primitive-section--workspace-toolbar,.primitive-section--workspace-status),
:where(.primitive-section--workspace-compact) > .primitive-row > :where(.primitive-section--workspace-rail,.primitive-section--workspace-main,.primitive-section--workspace-inspector){padding:0;min-width:0;border:0;border-radius:0}
@media (max-width: 880px) { :where(.primitive-row--workspace-body, .primitive-row--workspace-body-inspector, .primitive-row--workspace-body-triple) { grid-template-columns: 1fr; } }
/* A banner is a compact callout: an intent mark in a narrow first column, the title and body beside it. The
   intent sets one tone that tints the border, the wash and the mark. */
:where(.primitive-banner) { --cre8-banner-tone: light-dark(#0f765d, #5fc1a8); display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 10px; align-items: start; padding: 10px 14px; font-size: 13px; border-color: color-mix(in srgb, var(--cre8-banner-tone) 38%, transparent); background: color-mix(in srgb, var(--cre8-banner-tone) 7%, light-dark(#ffffff, #14161a)); box-shadow: none; }
:where(.primitive-banner)::before { content: "i"; grid-row: 1 / span 9; display: grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--cre8-banner-tone); color: light-dark(#ffffff, #111214); font: 800 11px/1 system-ui, sans-serif; }
:where(.primitive-banner) > * { grid-column: 2; }
:where(.primitive-banner__title) { margin: 0; font-size: 13.5px; font-weight: 650; line-height: 1.4; }
:where(.primitive-banner__body) { margin: 0; color: light-dark(#4f5854, #a8a8b0); line-height: 1.45; }
:where(.primitive-banner__title + .primitive-banner__body) { margin-top: 1px; }
:where(.primitive-banner--warning) { --cre8-banner-tone: light-dark(#a76500, #e8b75a); }
:where(.primitive-banner--warning)::before { content: "!"; }
:where(.primitive-banner--info) { --cre8-banner-tone: light-dark(#0f765d, #5fc1a8); }
:where(.primitive-banner--error) { --cre8-banner-tone: light-dark(#b03030, #f08080); }
:where(.primitive-banner--error)::before { content: "!"; }
:where(.primitive-banner--success) { --cre8-banner-tone: light-dark(#0f765d, #5fc1a8); }
:where(.primitive-banner--success)::before { content: "\2713"; }
:where(.primitive-stat) { margin: 0; padding: 12px 14px; }
/* The value and detail are <dd>s; without this they keep the browser's 40px indent. */
:where(.primitive-stat__value, .primitive-stat__detail) { margin-inline-start: 0; }
:where(.primitive-stat__label) { color: light-dark(#6c7572, #8e9591); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
:where(.primitive-stat__value) { margin-top: 4px; color: light-dark(#17201d, #f2f4f0); font-size: clamp(1.25rem, 2vw, 1.75rem); font-variant-numeric: tabular-nums; font-weight: 760; letter-spacing: -0.012em; line-height: 1.1; overflow-wrap: anywhere; }
:where(.primitive-stat__detail) { margin-top: 4px; color: light-dark(#6c7572, #8e9591); font-size: 12px; line-height: 1.35; }
:where(.primitive-badge) { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 22px; padding: 2px 8px; border-radius: 999px; background: light-dark(#eef2ec, #1f2126); color: light-dark(#4f5854, #a8a8b0); font-size: 11px; font-weight: 700; line-height: 1.2; }
/* A Badge intent is a tone, and the label beside it says the same thing in
   words (PS-C-15). Mirrors the client Badge's `primitive-badge--{intent}`. */
:where(.primitive-badge--success, .primitive-badge--positive, .primitive-badge--good) { background: light-dark(#e3f3ec, #13261f); color: light-dark(#0f5c40, #7fd8b6); }
:where(.primitive-badge--info) { background: light-dark(#e6eff9, #16202e); color: light-dark(#1f5da8, #8db9ef); }
:where(.primitive-badge--warning) { background: light-dark(#fbf0db, #2a2112); color: light-dark(#8a5300, #eec27a); }
:where(.primitive-badge--error, .primitive-badge--danger, .primitive-badge--negative) { background: light-dark(#fbe8e8, #2b1718); color: light-dark(#a32d2d, #f4a3a3); }
/* Neutral is the base chip, named so an explicit `intent: neutral` is a
   declared tone rather than an unstyled class. */
:where(.primitive-badge--neutral) { background: light-dark(#eef2ec, #1f2126); color: light-dark(#4f5854, #a8a8b0); }
/* Stat intent washes the tile in its tone and tints the value. The label and
   detail stay neutral, so the number's meaning is still in words. */
:where(.primitive-stat--success, .primitive-stat--positive, .primitive-stat--good, .primitive-stat--info, .primitive-stat--warning, .primitive-stat--error, .primitive-stat--danger, .primitive-stat--negative, .primitive-stat--neutral) { border-color: color-mix(in srgb, var(--cre8-stat-tone) 34%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--cre8-stat-tone) 10%, transparent), transparent 64%), light-dark(#ffffff, #14161a); }
:where(.primitive-stat--success, .primitive-stat--positive, .primitive-stat--good) { --cre8-stat-tone: light-dark(#0f765d, #5fc1a8); }
:where(.primitive-stat--success, .primitive-stat--positive, .primitive-stat--good) :where(.primitive-stat__value) { color: light-dark(#0f5c40, #7fd8b6); }
:where(.primitive-stat--info) { --cre8-stat-tone: light-dark(#1f5da8, #8db9ef); }
:where(.primitive-stat--warning) { --cre8-stat-tone: light-dark(#a76500, #e8b75a); }
:where(.primitive-stat--warning) :where(.primitive-stat__value) { color: light-dark(#8a5300, #eec27a); }
:where(.primitive-stat--error, .primitive-stat--danger, .primitive-stat--negative) { --cre8-stat-tone: light-dark(#b03030, #f08080); }
:where(.primitive-stat--error, .primitive-stat--danger, .primitive-stat--negative) :where(.primitive-stat__value) { color: light-dark(#a32d2d, #f4a3a3); }
:where(.primitive-stat--neutral) { --cre8-stat-tone: var(--cre8-view-border-strong); }
/* StatGrid recipe (`StatGridBuilder` = Section{variant:"stat-grid"} + Stat) on
   app pages: the dashboard form of the stat-row grid. Site templates restyle
   the same variant as big centered counters in SECTION_BASE_CSS. The header
   spans the full row. `--cre8-stat-grid-min` sets the narrowest column. */
:where(.primitive-section--stat-grid) { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--cre8-stat-grid-min, 130px), 1fr)); gap: 12px; align-items: stretch; }
:where(.primitive-section--stat-grid > .primitive-section__header) { grid-column: 1 / -1; margin: 0; }
/* Code: `code` is an inline token; `pre` is a block that scrolls inside its
   own box rather than widening the page (PS-C-13). */
:where(.primitive-text[data-variant="code"]) { padding: 1px 5px; border-radius: 4px; background: var(--cre8-view-chip-bg); font-family: "SFMono-Regular", Consolas, ui-monospace, monospace; font-size: 0.9em; }
:where(pre.primitive-text) { max-width: 100%; margin: 0; padding: 12px 14px; overflow: auto; box-sizing: border-box; border: 1px solid var(--cre8-view-border); border-radius: 8px; background: light-dark(#f4f6f2, #0e1013); font-family: "SFMono-Regular", Consolas, ui-monospace, monospace; font-size: 12px; line-height: 1.6; white-space: pre; overflow-wrap: normal; tab-size: 2; }
:where(.primitive-text[data-variant="caption"]) { display: block; color: var(--cre8-view-fg-muted); font-size: 12px; line-height: 1.45; }
:where(.primitive-list) { padding: 12px 14px; }
:where(.primitive-list__title, .primitive-keyvalue__title, .primitive-table__title) { margin-bottom: 10px; font-size: 13px; font-weight: 740; }
:where(.primitive-list__items) { display: flex; flex-direction: column; gap: 8px; margin: 0; padding-left: 18px; }
:where(.primitive-list--ordered .primitive-list__items) { list-style-position: outside; }
:where(.primitive-listitem) { padding: 0; }
/* Prose: markdown compiled to primitives. Its headings sit inside a message,
   so they stay below page-title scale. */
:where(.cre8-prose) { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 0; line-height: 1.6; }
:where(.cre8-prose p.primitive-text) { margin: 0; white-space: pre-line; }
:where(.cre8-prose h1.primitive-text, .cre8-prose h2.primitive-text, .cre8-prose h3.primitive-text, .cre8-prose h4.primitive-text) { margin: 6px 0 0; font-weight: 720; line-height: 1.3; }
:where(.cre8-prose h1.primitive-text) { font-size: 18px; }
:where(.cre8-prose h2.primitive-text) { font-size: 16px; }
:where(.cre8-prose h3.primitive-text) { font-size: 14px; }
:where(.cre8-prose h4.primitive-text) { font-size: 13px; }
:where(.cre8-prose blockquote.primitive-text) { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--cre8-view-border); color: var(--cre8-view-fg-muted); }
:where(.cre8-prose .primitive-list) { padding: 0; }
:where(.cre8-prose .primitive-list__items) { gap: 4px; }
:where(.cre8-prose__code[aria-label])::before { content: attr(aria-label); display: block; margin-bottom: 6px; color: var(--cre8-view-fg-muted); font-size: 11px; }
:where(.primitive-listitem__content) { display: inline-flex; flex-direction: column; gap: 2px; }
:where(.primitive-listitem__icon) { margin-inline-end: 6px; color: light-dark(#6c7572, #8e9591); }
:where(.primitive-listitem__title) { font-weight: 650; }
:where(.primitive-listitem__subtitle, .primitive-listitem__body, .primitive-list__empty) { color: light-dark(#6c7572, #8e9591); font-size: 12px; line-height: 1.4; }
/* Navigable list row (ListItem with a navigation action) — the anchor sits
   inside the <li>, since a list may only hold list items. */
:where(.primitive-listitem__link) { display: block; text-decoration: none; color: inherit; border-radius: 8px; }
:where(.primitive-listitem__link:hover .primitive-listitem__title) { text-decoration: underline; }
:where(.primitive-listitem__link:focus-visible) { outline: 2px solid light-dark(#0f765d, #5fc1a8); outline-offset: 2px; }
.primitive-list--flush { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.primitive-list--flush > .primitive-list__items { gap: 0; padding: 0; list-style: none; }
.primitive-list--flush > .primitive-list__items > .primitive-listitem { border-bottom: 1px solid var(--cre8-view-border, light-dark(#e3e7e0, #2a2c33)); }
.primitive-list--flush .primitive-listitem__link { padding: 14px 0; border-radius: 0; overflow-wrap: anywhere; }
.primitive-list--flush .primitive-listitem__content { min-width: 0; }
.primitive-list--flush > .primitive-list__items > .primitive-listitem:not(:has(.primitive-listitem__link)) { padding: 14px 0; overflow-wrap: anywhere; }
.app-reference__disclosure { border-top: 1px solid var(--cre8-view-border, light-dark(#e3e7e0, #2a2c33)); padding: 16px 0; }
.app-reference__disclosure > summary { cursor: pointer; font-weight: 700; }
.app-reference__disclosure > summary:focus-visible { outline: 2px solid var(--cre8-view-accent); outline-offset: 4px; }
.app-reference__disclosure[open] > summary { margin-bottom: 16px; }
:where(.primitive-keyvalue) { padding: 12px 14px; }
/* The label column takes at most two fifths of the list and wraps past it, so a
   list in a narrow dashboard card keeps room for its figures. */
:where(.primitive-keyvalue__list) { display: grid; grid-template-columns: fit-content(min(40%, 18rem)) minmax(0, 1fr); gap: 8px 14px; margin: 0; }
:where(.primitive-keyvalue__item) { display: contents; }
:where(.primitive-keyvalue__key) { color: light-dark(#6c7572, #8e9591); font-size: 12px; font-weight: 700; }
:where(.primitive-keyvalue__value) { min-width: 0; margin: 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
:where(.primitive-keyvalue__hint) { display: block; margin-top: 2px; color: light-dark(#6c7572, #8e9591); font-size: 11px; line-height: 1.35; }
:where(.primitive-table) { overflow: hidden; }
:where(.primitive-table__title, .primitive-table__count, .primitive-table__empty) { padding: 10px 12px; }
:where(.primitive-table__count) { border-top: 1px solid light-dark(#e9ede7, #24272e); color: light-dark(#6c7572, #8e9591); font-size: 11px; font-weight: 650; }
:where(.primitive-table__scroll) { overflow: auto; }
:where(.primitive-table__grid) { width: 100%; border-collapse: collapse; font-size: 12px; }
:where(.primitive-table__head) { position: relative; z-index: 1; }
:where(.primitive-table__body) { background: transparent; }
:where(.primitive-table__heading, .primitive-table__cell) { padding: 8px 10px; border-top: 1px solid light-dark(#e9ede7, #24272e); text-align: left; vertical-align: top; }
:where(.primitive-table__heading) { color: light-dark(#4f5854, #a8a8b0); background: light-dark(#fbfcfa, #191b20); font-size: 11px; font-weight: 760; letter-spacing: 0.03em; text-transform: uppercase; }
:where(.primitive-table__heading--sortable) { cursor: pointer; }
:where(.primitive-table__row:hover) { background: light-dark(#f5f7f3, #171a1f); }
:where(.primitive-table__pagination) { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid light-dark(#e3e7e0, #2a2c33); }
:where(.primitive-table__cell[data-align="right"], .primitive-table__heading[data-align="right"]) { text-align: right; }
:where(.primitive-table__cell[data-align="center"], .primitive-table__heading[data-align="center"]) { text-align: center; }
:where(.primitive-form) { display: flex; flex-direction: column; gap: 12px; }
:where(.primitive-form__header) { margin-bottom: 2px; }
:where(.primitive-form__title) { margin: 0; font-size: 16px; line-height: 1.25; }
:where(.primitive-form__fields) { display: grid; gap: 10px; }
:where(.primitive-form__actions) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
:where(.primitive-form__result) { max-height: 240px; overflow: auto; padding: 10px; border-radius: 6px; background: light-dark(#eef2ec, #111318); color: inherit; font-size: 12px; }
:where(.primitive-form-report) { min-width: 0; padding: 16px; border: 1px solid light-dark(#c8d2c7, #39413c); border-radius: 8px; }
:where(.primitive-form-report h3) { margin-top: 0; }
:where(.primitive-form-report details) { margin-top: 12px; }
:where(.primitive-form-report summary) { cursor: pointer; font-weight: 600; }
:where(.primitive-form-report dl) { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 3fr); gap: 10px 16px; }
:where(.primitive-form-report dt) { font-weight: 600; }
:where(.primitive-form-report dd) { margin: 0; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 540px) { :where(.primitive-form-report dl) { grid-template-columns: minmax(0, 1fr); gap: 5px; } :where(.primitive-form-report dd) { margin-bottom: 10px; } }
:where(.primitive-field) { display: flex; flex-direction: column; gap: 5px; }
:where(.primitive-dynamic-form) { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
:where(.primitive-dynamic-form__fields) { display: grid; gap: 10px; }
:where(.primitive-dynamic-form__field) { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
:where(.primitive-dynamic-form__field) > :is(input:not([type="checkbox"]):not([type="hidden"]),select,textarea) { box-sizing: border-box; width: 100%; font: inherit; }
:where(.primitive-dynamic-form__check) { display: flex; flex-direction: row; align-items: center; gap: 8px; }
:where(.primitive-dynamic-form__label) { color: light-dark(#4f5854, #a8a8b0); font-size: 12px; font-weight: 700; }
:where(.primitive-dynamic-form__help) { color: var(--cre8-view-fg-muted); font-size: 12px; }
:where(.primitive-dynamic-form__error) { color: light-dark(#b03030, #f08080); font-size: 12px; }
:where(.primitive-dynamic-form__footer) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
:where(.primitive-enable-push) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.primitive-form .primitive-field { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; }
.primitive-form .primitive-field > :is(input:not([type="checkbox"]):not([type="hidden"]),select,textarea) { box-sizing: border-box; width: 100%; font: inherit; }
.primitive-page > .primitive-form { padding: 20px; border: 1px solid var(--cre8-view-border); border-radius: 10px; background: var(--cre8-view-surface); }
.cre8-audio-capture-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cre8-audio-capture-controls label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--cre8-view-fg-muted); }
.cre8-audio-capture-controls :is(button,select) { min-height: 40px; padding: 8px 12px; border: 1px solid var(--cre8-view-border); border-radius: 6px; font: inherit; color: var(--cre8-view-fg); background: var(--cre8-view-surface); }
:where(.primitive-field--text, .primitive-field--email, .primitive-field--select) { min-width: 0; }
:where(.primitive-field__label) { color: light-dark(#4f5854, #a8a8b0); font-size: 12px; font-weight: 700; }
:where(.primitive-field__required) { color: light-dark(#b03030, #f08080); }
:where(.primitive-field__hint) { color: light-dark(#6c7572, #8e9591); font-size: 11px; line-height: 1.35; }
:where(.primitive-field > input:not([type="checkbox"]), .primitive-field > select, .primitive-field > textarea) { min-width: 0; padding: 8px 10px; border: 1px solid light-dark(#cdd3cb, #2a2c33); border-radius: 6px; background: light-dark(#ffffff, #16181d); color: inherit; }
:where(.primitive-field > textarea) { min-height: 88px; resize: vertical; }
/* A form projected from a Connection schema (`data-record-form`): short fields
   share a row, and prose, JSON and fieldsets span it. Fields align to the top
   of their row, so a hint under one control never pushes its neighbour's down.
   One column on a narrow container. */
.primitive-form[data-record-form] { gap: 16px; }
.primitive-form[data-record-form] > .primitive-form__header { padding-bottom: 10px; border-bottom: 1px solid var(--cre8-view-border); }
.primitive-form[data-record-form] > .primitive-form__fields { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 14px 16px; align-items: start; }
.primitive-form[data-record-form] > .primitive-form__fields > :is(.primitive-field:has(> textarea), fieldset) { grid-column: 1 / -1; }
.primitive-form[data-record-form] > .primitive-form__actions { padding-top: 12px; border-top: 1px solid var(--cre8-view-border); }
:where(.primitive-field > input[type="checkbox"]) { width: 16px; height: 16px; accent-color: light-dark(#0f765d, #5fc1a8); }
/* The find form is one wrapping row; `collection_filters.css` lays out its
   search box, Filters button, chips and drawer. */
.primitive-form#collection-filters { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.primitive-form#collection-filters > .primitive-form__header { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.primitive-form#collection-filters > .primitive-form__fields { flex: 1 1 16rem; min-width: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.primitive-form#collection-filters > .primitive-form__actions { flex: 0 0 auto; }
.primitive-form#collection-filters > a.primitive-action { order: 2; }
:where(button.primitive-action, a.primitive-action, .primitive-button, .primitive-tabs-button, .primitive-accordion__trigger, .primitive-modal__close, .primitive-drawer__close, .primitive-toast__close) { appearance: none; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 7px 13px; border: 1px solid light-dark(#cdd3cb, #2a2c33); border-radius: 8px; background: light-dark(#ffffff, #1a1d22); color: inherit; font: inherit; font-size: 13px; font-weight: 680; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color var(--cre8-motion-quick, 120ms) ease, border-color var(--cre8-motion-quick, 120ms) ease, color var(--cre8-motion-quick, 120ms) ease, box-shadow var(--cre8-motion-base, 180ms) ease, translate var(--cre8-motion-quick, 120ms) var(--cre8-ease-out, ease); }
:where(button.primitive-action:active:not(:disabled), a.primitive-action:active, .primitive-button:active:not(:disabled)) { translate: 0 1px; }
/* Primary is the accent filled with dark ink in dark mode, the same pairing
   as the stepper's current step and the landing CTA. `--cre8-action-fill` is the
   one colour a surface overrides to recast it; the reader's accent reaches it. */
.primitive-action-primary, .primitive-button-primary { --cre8-action-fill: var(--cre8-view-accent); border-color: transparent; background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent) border-box var(--cre8-action-fill); color: var(--cre8-view-on-accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px light-dark(rgba(16, 24, 20, 0.2), rgba(0, 0, 0, 0.3)), 0 8px 16px -10px color-mix(in srgb, var(--cre8-action-fill) 60%, transparent); }
/* The page-wide `a` rule colors and weights every link. An Action anchor takes
   both from the button it looks like: (0,0,1) outranks `a`, and every intent
   class below (0,1,0) still outranks this. */
:where(.primitive-action):is(a) { color: inherit; font-weight: 680; }
.primitive-action-danger, .primitive-button-danger { border-color: light-dark(#b03030, #8d3c3c); color: light-dark(#b03030, #f08080); }
:where(.primitive-action-danger:hover:not(:disabled), .primitive-button-danger:hover:not(:disabled)) { background: light-dark(#fbeaea, #2a1a1c); }
.primitive-action-success { border-color: light-dark(#8cc7b3, #2f6b58); color: light-dark(#0f765d, #5fc1a8); }
.primitive-action-warning { border-color: light-dark(#e2c08a, #6b5325); color: light-dark(#8a5300, #e8b75a); }
.primitive-action-secondary, .primitive-button-secondary { color: light-dark(#4f5854, #a8a8b0); }
.primitive-action-ghost, .primitive-action-subtle, .primitive-button-ghost { border-color: transparent; background: transparent; color: light-dark(#4f5854, #a8a8b0); }
.primitive-action-ghost:hover:not(:disabled), .primitive-action-subtle:hover:not(:disabled), .primitive-button-ghost:hover:not(:disabled) { background: light-dark(#eef2ec, #1f2126); color: light-dark(#17201d, #e8e8ec); }
/* An anchor has no disabled state of its own; the writer mirrors it as aria-disabled. */
:where(a.primitive-action[aria-disabled="true"]) { opacity: 0.55; pointer-events: none; }
:where(button.primitive-action:hover:not(:disabled), a.primitive-action:hover, .primitive-button:hover:not(:disabled), .primitive-tabs-button:hover:not(:disabled), .primitive-accordion__trigger:hover:not(:disabled)) { background: light-dark(#eef2ec, #1f2126); }
/* A class of specificity on purpose: under :where() this loses to the fill above. */
.primitive-action-primary:hover:not(:disabled), .primitive-button-primary:hover:not(:disabled) { background-color: color-mix(in srgb, var(--cre8-action-fill) 86%, light-dark(#000000, #ffffff)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px light-dark(rgba(16, 24, 20, 0.2), rgba(0, 0, 0, 0.3)), 0 10px 20px -10px color-mix(in srgb, var(--cre8-action-fill) 75%, transparent); }
:where(button.primitive-action:disabled, .primitive-button:disabled, .primitive-tabs-button:disabled, .primitive-accordion__trigger:disabled) { opacity: 0.55; cursor: not-allowed; }
:where(button.primitive-action:focus-visible, a.primitive-action:focus-visible, .primitive-button:focus-visible, .primitive-tabs-button:focus-visible, .primitive-accordion__trigger:focus-visible, .primitive-sidebar__item:focus-visible, .primitive-modal__close:focus-visible, .primitive-drawer__close:focus-visible, .primitive-toast__close:focus-visible, .primitive-field > input:focus-visible, .primitive-field > select:focus-visible, .primitive-field > textarea:focus-visible) { outline: 2px solid light-dark(#0f765d, #5fc1a8); outline-offset: 2px; }
:where(.primitive-tabs) { overflow: hidden; border: 1px solid light-dark(#e3e7e0, #2a2c33); border-radius: 12px; background: light-dark(#ffffff, #14161a); }
:where(.primitive-tabs-strip) { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid light-dark(#e3e7e0, #2a2c33); background: light-dark(#f3f5f1, #191b20); }
:where(.primitive-tabs-button) { min-height: 30px; border-color: transparent; background: transparent; color: light-dark(#4f5854, #a8a8b0); }
:where(.primitive-tabs-button--active, .primitive-tabs-button[aria-selected="true"]) { border-color: transparent; background: light-dark(#ffffff, #2a2e36); color: var(--cre8-view-fg); box-shadow: 0 1px 3px light-dark(rgba(16, 24, 20, 0.14), rgba(0, 0, 0, 0.4)); }
:where(.primitive-tabs-panels) { padding: 14px; }
:where(.primitive-tab[hidden]) { display: none; }
:where(.primitive-accordion) { overflow: hidden; }
:where(.primitive-accordion--multiple) { overflow: hidden; }
:where(.primitive-accordion__item + .primitive-accordion__item) { border-top: 1px solid light-dark(#e3e7e0, #2a2c33); }
:where(.primitive-accordion__trigger) { width: 100%; min-height: 40px; justify-content: flex-start; border: 0; border-radius: 0; background: transparent; text-align: left; }
:where(.primitive-accordion__chevron) { display: inline-flex; width: 1em; transition: transform 160ms ease; }
:where(.primitive-accordion__item[data-state="open"] .primitive-accordion__chevron) { transform: rotate(90deg); }
:where(.primitive-accordion__title) { font-weight: 700; }
:where(.primitive-accordion__panel) { padding: 12px 14px; border-top: 1px solid light-dark(#e9ede7, #24272e); }
:where(.primitive-switch) { display: flex; flex-direction: column; gap: 4px; }
:where(.primitive-switch__label) { display: inline-flex; align-items: center; gap: 8px; color: light-dark(#4f5854, #a8a8b0); font-size: 13px; font-weight: 700; }
:where(.primitive-switch__input) { width: 16px; height: 16px; accent-color: light-dark(#0f765d, #5fc1a8); }
:where(.primitive-switch__text) { user-select: none; }
:where(.primitive-switch__help, .primitive-switch__error) { font-size: 11px; line-height: 1.35; }
:where(.primitive-switch__help) { color: light-dark(#6c7572, #8e9591); }
:where(.primitive-switch__error) { color: light-dark(#b03030, #f08080); }
:where(.primitive-switch--disabled) { opacity: 0.55; }
:where(.primitive-switch--invalid .primitive-switch__input) { outline: 2px solid light-dark(#b03030, #f08080); outline-offset: 1px; }
:where(.primitive-checkbox--invalid .primitive-checkbox__control) { outline: 2px solid light-dark(#b03030, #f08080); outline-offset: 1px; }
:where(.primitive-modal__backdrop) { position: fixed; inset: 0; z-index: 70; background: rgba(15, 22, 19, 0.46); }
:where(.primitive-modal) { position: fixed; z-index: 71; top: 50%; left: 50%; width: min(560px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 32px)); transform: translate(-50%, -50%); overflow: hidden; border: 1px solid light-dark(#e3e7e0, #2a2c33); border-radius: 10px; background: light-dark(#ffffff, #14161a); box-shadow: 0 24px 70px rgba(15, 22, 19, 0.28); }
:where(.primitive-modal__header) { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid light-dark(#e3e7e0, #2a2c33); }
:where(.primitive-modal__title) { margin: 0; font-size: 16px; line-height: 1.25; }
:where(.primitive-modal__body) { max-height: calc(100vh - 140px); overflow: auto; padding: 14px; }
:where(.primitive-toast) { display: flex; align-items: flex-start; gap: 10px; max-width: min(420px, calc(100vw - 32px)); padding: 12px 14px; border: 1px solid light-dark(#e3e7e0, #2a2c33); border-radius: 8px; background: light-dark(#ffffff, #14161a); box-shadow: 0 12px 36px rgba(15, 22, 19, 0.18); }
:where(.primitive-toast__title) { font-weight: 750; }
:where(.primitive-toast__body) { color: light-dark(#4f5854, #a8a8b0); font-size: 13px; line-height: 1.4; }
:where(.primitive-toast__icon) { flex: none; }
/* Toast intent: a leading tone rule, as Banner does. `role`/`aria-live` carry
   the urgency to assistive tech; the color is for the eye only. */
:where(.primitive-toast--info) { border-inline-start: 4px solid light-dark(#1f5da8, #8db9ef); }
:where(.primitive-toast--success) { border-inline-start: 4px solid light-dark(#0f765d, #5fc1a8); }
:where(.primitive-toast--warning) { border-inline-start: 4px solid light-dark(#a76500, #e8b75a); }
:where(.primitive-toast--error) { border-inline-start: 4px solid light-dark(#b03030, #f08080); }
/* The writer emits only open modals (a closed one renders nothing), so `--open`
   is the whole look: header over a body that scrolls inside the max height. */
:where(.primitive-modal--open) { display: flex; flex-direction: column; }
:where(.primitive-page--workspace) { gap: 12px; }
/* Container placeholders for client-drawn surfaces (Canvas, VirtualWorldCanvas):
   what a reader sees before, or without, the renderer. */
:where(.primitive-container--canvas-placeholder, .primitive-container--virtual-canvas-preview) { align-items: center; justify-content: center; min-height: 160px; padding: 16px; border: 1px dashed light-dark(#cdd3cb, #2a2c33); border-radius: 8px; background: light-dark(#fbfcfa, #111318); color: var(--cre8-view-fg-muted); text-align: center; }
/* Icon: an inline glyph sized to the text around it (mirrors the client). */
:where(.primitive-icon) { display: inline-block; flex: none; width: 1em; height: 1em; vertical-align: -0.125em; }
/* Stepper (mirrors the client's primitives/stepper.css). */
:where(.primitive-stepper) { min-width: 0; }
:where(.primitive-stepper-list) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 4px; margin: 0; padding: 0; list-style: none; }
:where(.primitive-stepper-item) { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
:where(.primitive-stepper-item:not(:last-child))::after { content: ""; flex: none; width: 28px; height: 1px; background: var(--cre8-view-border-strong); }
:where(.primitive-stepper-circle) { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1px solid var(--cre8-view-border-strong); border-radius: 999px; color: var(--cre8-view-fg-muted); font-size: 12px; font-weight: 650; line-height: 1; }
:where(.primitive-stepper-label) { color: var(--cre8-view-fg-muted); font-size: 13px; white-space: nowrap; }
:where(.primitive-stepper-item--current) :where(.primitive-stepper-circle) { border-color: var(--cre8-view-accent); background: var(--cre8-view-accent); color: light-dark(#ffffff, #0b1410); }
:where(.primitive-stepper-item--current) :where(.primitive-stepper-label) { color: var(--cre8-view-fg); font-weight: 650; }
:where(.primitive-stepper-item--done) :where(.primitive-stepper-circle) { border-color: var(--cre8-view-accent); color: var(--cre8-view-accent); }
/* Router: a tab strip over panels; the page-shell router script shows one
   panel at a time (mirrors the client's Router rules). */
:where(.primitive-router) { display: flex; flex-direction: column; min-width: 0; }
:where(.primitive-router-nav) { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 12px; border-bottom: 1px solid var(--cre8-view-border); }
:where(.primitive-router-link) { padding: 8px 16px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--cre8-view-fg-muted); font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; }
:where(.primitive-router-link:hover) { color: var(--cre8-view-fg); }
:where(.primitive-router-link.active, .primitive-router-link[aria-current="page"]) { border-bottom-color: var(--cre8-view-accent); color: var(--cre8-view-accent); }
:where(.primitive-router-link:focus-visible) { outline: 2px solid light-dark(#0f765d, #5fc1a8); outline-offset: 2px; }
:where(.primitive-router-content, .primitive-router-panel) { min-width: 0; }
/* Scene and graph frames. The drawing inside carries its own presentation
   (SCENE_ISO_CSS, graph SVG attributes); these rules are the frame only. */
:where(.primitive-scene) { position: relative; display: flex; flex-direction: column; gap: 12px; box-sizing: border-box; width: 100%; min-width: 0; padding: 14px; border: 1px solid var(--cre8-view-border); border-radius: 8px; background: var(--cre8-view-surface); }
:where(.primitive-scene--iso) { overflow-x: auto; }
:where(.primitive-node-graph, .primitive-node-hypergraph) { display: flex; flex-direction: column; gap: 10px; box-sizing: border-box; min-width: 0; max-width: 100%; overflow-x: auto; }
/* Visually hidden: removed from the visual layout, kept for assistive tech.
   `:focus-within` brings it back for a focusable child such as a skip link. */
.cre8-visually-hidden:not(:focus-within) { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; }
/* Skip link: first focusable element on every shell page, visible on focus. */
:where(.cre8-skip-link) { position: absolute; top: 8px; left: 8px; z-index: 100; padding: 8px 14px; border-radius: 6px; background: var(--cre8-view-accent); color: light-dark(#ffffff, #0b1410); font-weight: 700; text-decoration: none; transform: translateY(-200%); }
:where(.cre8-skip-link:focus, .cre8-skip-link:focus-visible) { transform: none; outline: 2px solid var(--cre8-view-fg); outline-offset: 2px; }
:where(.primitive-progress) { display: flex; flex-direction: column; gap: 6px; }
:where(.primitive-progress--complete .primitive-progress__fill) { background: light-dark(#0f765d, #5fc1a8); }
:where(.primitive-progress--indeterminate .primitive-progress__fill) { width: 38%; min-width: 38%; }
:where(.primitive-progress__header) { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: light-dark(#6c7572, #8e9591); font-size: 12px; }
:where(.primitive-progress__label, .primitive-progress__percent) { font-weight: 700; }
:where(.primitive-progress__track) { overflow: hidden; height: 8px; border-radius: 999px; background: light-dark(#e3e7e0, #24272e); }
:where(.primitive-progress__fill) { height: 100%; border-radius: inherit; background: light-dark(#0f765d, #5fc1a8); }
:where(.primitive-skeleton) { display: flex; flex-direction: column; gap: 8px; }
:where(.primitive-skeleton__line) { min-height: 12px; border-radius: 999px; background: light-dark(#e3e7e0, #24272e); }
:where(.primitive-media-wrap) { display: grid; place-items: center; overflow: hidden; min-height: 160px; border: 1px solid light-dark(#e3e7e0, #2a2c33); border-radius: 8px; background: light-dark(#eef2ec, #08090b); }
:where(.primitive-media-wrap--video, .primitive-media-wrap--audio) { width: 100%; }
:where(.primitive-media-wrap > video, .primitive-media-wrap > audio) { width: 100%; max-width: 100%; }
:where(.primitive-media-placeholder) { padding: 12px; color: light-dark(#6c7572, #8e9591); font-size: 12px; text-align: center; }
/* ImgSlot — the same block SECTION_BASE_CSS gives site templates, in view
   tokens, so an app page does not render it as bare text (PS-C-18). */
:where(.cre8-img-slot) { position: relative; width: 100%; overflow: hidden; min-height: 120px; border: 1px solid var(--cre8-view-border); border-radius: 10px; background: var(--cre8-view-surface); }
:where(.cre8-img-slot img) { display: block; width: 100%; height: 100%; object-fit: cover; }
:where(.cre8-img-slot__placeholder) { width: 100%; height: 100%; min-height: 120px; background: repeating-linear-gradient(-45deg, transparent 0 8px, var(--cre8-view-border-strong) 8px 9px); }
:where(.cre8-img-slot__tag) { position: absolute; top: 12px; left: 12px; padding: 3px 9px; border-radius: 4px; background: light-dark(#0f765d, #2a3550); color: #ffffff; font-family: "SFMono-Regular", Consolas, ui-monospace, monospace; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
:where(.cre8-img-slot__dims) { position: absolute; right: 10px; bottom: 8px; color: var(--cre8-view-fg-muted); font-family: "SFMono-Regular", Consolas, ui-monospace, monospace; font-size: 11px; }
/* SectionEyebrow and Divider — the SECTION_BASE_CSS blocks in view tokens, so
   an app page renders them as a site template does (PS-C-18). The app hero
   restyles its own eyebrow on top of this. */
:where(.primitive-section-eyebrow) { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--cre8-view-fg-muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
:where(.primitive-section-eyebrow__sep) { color: light-dark(#0f765d, #5fc1a8); font-weight: 700; }
:where(.cre8-divider) { width: 100%; }
:where(.cre8-divider--line) { height: 1px; margin: 16px 0; background: var(--cre8-view-border-strong); }
:where(.cre8-divider--dots) { display: flex; justify-content: center; margin: 16px 0; color: var(--cre8-view-fg-faint); }
:where(.cre8-divider--dots)::before { content: "\00b7\00a0\00b7\00a0\00b7"; letter-spacing: 0.25em; }
:where(.cre8-divider--space) { height: 32px; }
:where(.primitive-client-island) { display: grid; place-items: center; min-width: 0; min-height: 120px; border: 1px dashed light-dark(#cdd3cb, #2a2c33); border-radius: 8px; background: light-dark(#fbfcfa, #111318); }
:where(.primitive-client-island__fallback) { color: light-dark(#6c7572, #8e9591); font-size: 12px; }
/* Sparkline and Chart (render_html write_sparkline / write_chart). The chart
   SVG carries its own presentation attributes; the sparkline line path and the
   legend swatches do not, so without these rules the line fills solid black
   and the swatches are empty zero-width spans. Mirrors the view-client's
   primitives/theming/chart.css. */
:where(.client-view-sparkline) { display: block; width: 100%; max-width: 132px; height: 36px; overflow: visible; }
:where(.client-view-sparkline--empty) { min-height: 36px; border-bottom: 1px dashed var(--cre8-view-border-strong); }
:where(.client-view-sparkline-line) { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
:where(.client-view-chart-container) { min-width: 0; }
:where(.client-view-chart) { display: block; width: 100%; height: auto; min-height: 120px; }
:where(.client-view-chart-legend) { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
:where(.client-view-chart-legend-item) { display: inline-flex; align-items: center; gap: 5px; color: var(--cre8-view-fg-muted); font-size: 11px; }
:where(.client-view-chart-swatch) { flex: none; width: 9px; height: 9px; border-radius: 999px; }

/* Wide viewports: the sidebar rail starts open, and the hamburger toggles it
   away (focus mode). `cre8-nav-open` = "the hamburger was pressed" at every
   width; each breakpoint applies it to its own default state. */
@media (min-width: 761px) {
  body.cre8-nav-open .primitive-sidebar { flex-basis: 0; width: 0; min-width: 0; max-width: 0; padding-left: 0; padding-right: 0; border-right-width: 0; overflow: hidden; visibility: hidden; }
}

@media (max-width: 760px) {
  :root { --cre8-page-gutter-x: 16px; --cre8-page-gutter-y: 14px; }
  .primitive-nav { z-index: 60; }
  /* The overlay slides in from the edge its toggle sits on and stays laid out
     while closed, so it can slide back out. Closed, it is hidden from pointer,
     keyboard and screen reader alike. */
  .primitive-sidebar { position: fixed; top: 52px; right: 0; bottom: 0; height: auto; max-height: none; flex-basis: auto; border-right: 0; border-left: 1px solid light-dark(#e3e7e0, #2a2c33); z-index: 50; visibility: hidden; transform: translateX(100%); transition: transform var(--cre8-motion-slide) var(--cre8-ease-slide), visibility var(--cre8-motion-slide); }
  body.cre8-nav-open .primitive-sidebar { visibility: visible; transform: none; box-shadow: 0 18px 50px rgba(15, 22, 19, 0.32); }
  /* The scrim is the body's own box: a press on it lands on the body, which
     `primitive_nav.js` reads as "close". */
  body::after { content: ""; position: fixed; inset: 52px 0 0; z-index: 49; background: rgba(15, 22, 19, 0.4); opacity: 0; pointer-events: none; transition: opacity var(--cre8-motion-slide) var(--cre8-ease-slide); }
  body.cre8-nav-open::after { opacity: 1; pointer-events: auto; }
  /* The narrow-viewport sidebar is already an overlay the nav toggle opens and
     closes, so a rail inside it would be a second, redundant collapse. Force
     the full-width form and hide the toggle regardless of the stored state. */
  .primitive-sidebar, .primitive-sidebar[data-collapsed="true"] { width: min(280px, 86vw); min-width: 0; max-width: 86vw; padding-left: 12px; padding-right: 12px; }
  .primitive-sidebar[data-collapsed="true"] .primitive-sidebar__header-label,
  .primitive-sidebar[data-collapsed="true"] .primitive-sidebar__group-label,
  .primitive-sidebar[data-collapsed="true"] .primitive-sidebar__item-label { display: revert; }
  .primitive-sidebar[data-collapsed="true"] .primitive-sidebar__item-glyph { display: none; }
  .primitive-sidebar[data-collapsed="true"] .primitive-sidebar__item { position: static; justify-content: space-between; padding-left: 10px; padding-right: 10px; }
  .primitive-sidebar[data-collapsed="true"] .primitive-sidebar__badge { position: static; min-width: 18px; height: 18px; padding: 0 6px; font-size: 10px; }
  .primitive-sidebar__collapse { display: none; }
}

/* ── form primitives: Input / Checkbox / Select ────────────────────────── */
.primitive-input, .primitive-select { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.primitive-input__label, .primitive-select__label { font-size: 12px; font-weight: 600; color: light-dark(#4f5854, #a8a8b0); }
.primitive-input__required, .primitive-select__required, .primitive-checkbox__required { color: light-dark(#b03030, #f08080); margin-left: 2px; }
.primitive-input__control, .primitive-select__control { padding: 8px 10px; border: 1px solid light-dark(#cdd3cb, #2a2c33); border-radius: 6px; background: light-dark(#ffffff, #16181d); color: inherit; font: inherit; font-size: 14px; min-width: 0; }
.primitive-input__control:focus, .primitive-select__control:focus, .primitive-checkbox__control:focus { outline: 2px solid light-dark(#0f765d, #5fc1a8); outline-offset: 1px; }
.primitive-input--invalid .primitive-input__control, .primitive-select--invalid .primitive-select__control { border-color: light-dark(#b03030, #f08080); }
.primitive-input--disabled, .primitive-select--disabled, .primitive-checkbox--disabled { opacity: 0.55; }
.primitive-input__description, .primitive-select__description, .primitive-checkbox__description { font-size: 11px; color: light-dark(#6c7572, #8e9591); }
.primitive-input__error, .primitive-select__error, .primitive-checkbox__error { font-size: 11px; color: light-dark(#b03030, #f08080); }
textarea.primitive-input__control { min-height: 80px; resize: vertical; font-family: inherit; }
.primitive-checkbox { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.primitive-checkbox__label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.primitive-checkbox--disabled .primitive-checkbox__label { cursor: not-allowed; }
.primitive-checkbox__control { width: 16px; height: 16px; accent-color: light-dark(#0f765d, #5fc1a8); cursor: inherit; }
.primitive-checkbox__text { user-select: none; }

/* ── Calendar primitive (SSR calendar.rs + React Calendar.tsx) ──────────── */
.primitive-calendar { border: 1px solid light-dark(#e3e7e0, #2a2c33); border-radius: 8px; overflow: hidden; background: light-dark(#ffffff, #16181d); }
.primitive-calendar__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid light-dark(#e3e7e0, #2a2c33); }
.primitive-calendar__title { font-size: 14px; font-weight: 740; color: light-dark(#17201d, #e8e8ec); }
.primitive-calendar__nav { display: inline-flex; align-items: center; gap: 6px; }
.primitive-calendar__month { font-size: 12px; font-weight: 640; color: light-dark(#4f5854, #a8a8b0); }
.primitive-calendar__weekdays { display: grid; grid-template-columns: repeat(7, 1fr); background: light-dark(#fbfcfa, #14161a); border-bottom: 1px solid light-dark(#e3e7e0, #2a2c33); }
.primitive-calendar__weekday { padding: 6px 8px; font-size: 11px; font-weight: 640; text-align: right; color: light-dark(#6c7572, #8e9591); }
.primitive-calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.primitive-calendar__cell { min-height: 78px; padding: 4px 6px; border-right: 1px solid light-dark(#eef1ec, #23252b); border-bottom: 1px solid light-dark(#eef1ec, #23252b); display: flex; flex-direction: column; gap: 3px; }
.primitive-calendar__cell:nth-child(7n) { border-right: none; }
.primitive-calendar__cell[data-in-month="false"] { background: light-dark(#fafbf9, #131519); }
.primitive-calendar__cell[data-in-month="false"] .primitive-calendar__daynum { color: light-dark(#b8c0bb, #565a61); }
.primitive-calendar__cell[data-today="true"] { background: light-dark(#eef7f3, #16241f); box-shadow: inset 0 0 0 2px light-dark(#0f765d, #5fc1a8); }
.primitive-calendar__daynum { font-size: 11px; font-weight: 600; text-align: right; color: light-dark(#4f5854, #a8a8b0); }
.primitive-calendar__cell[data-today="true"] .primitive-calendar__daynum { color: light-dark(#0f765d, #5fc1a8); font-weight: 760; }
.primitive-calendar__event { display: block; padding: 2px 6px; border-radius: 4px; font-size: 11px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: light-dark(#e7f1ed, #1c2a25); color: light-dark(#0f765d, #8fd9c5); border: 1px solid light-dark(#cfe5dd, #244038); cursor: default; }
.primitive-calendar__event[data-kind="deadline"] { background: light-dark(#fdeede, #2e241a); color: light-dark(#9a5b16, #e8b577); border-color: light-dark(#f0d6b0, #43331f); }
.primitive-calendar__event[data-status="gen"] { background: light-dark(#efe7fb, #241c33); color: light-dark(#6b3fb0, #c2a8e8); border-color: light-dark(#dccdf0, #382a4d); }
.primitive-calendar__event[data-status="cancelled"] { opacity: 0.55; text-decoration: line-through; }
.primitive-calendar__empty, .primitive-calendar__count { margin: 0; padding: 8px 12px; font-size: 11px; color: light-dark(#6c7572, #8e9591); }
/* Linked entries, month paging and day states (booking calendars). */
a.primitive-calendar__event { cursor: pointer; text-decoration: none; }
a.primitive-calendar__event:hover { border-color: light-dark(#0f765d, #5fc1a8); }
.primitive-calendar__step { display: inline-grid; place-items: center; min-width: 28px; min-height: 28px; border-radius: 6px; color: light-dark(#0f765d, #5fc1a8); font-size: 18px; line-height: 1; text-decoration: none; }
.primitive-calendar__step:hover { background: light-dark(#eef7f3, #16241f); }
a.primitive-calendar__daynum { align-self: flex-end; min-width: 24px; padding: 2px 4px; border-radius: 4px; color: light-dark(#0f765d, #5fc1a8); font-weight: 720; text-decoration: none; }
a.primitive-calendar__daynum:hover { background: light-dark(#e7f1ed, #1c2a25); }
.primitive-calendar__cell[data-day-state="open"] { background: light-dark(#f6fbf8, #141d1a); }
.primitive-calendar__cell[data-day-state="full"] .primitive-calendar__daynum,
.primitive-calendar__cell[data-day-state="closed"] .primitive-calendar__daynum { color: light-dark(#a3aba7, #5d6268); }
.primitive-calendar__cell[data-day-state="closed"] { background: repeating-linear-gradient(135deg, transparent 0 6px, light-dark(#f1f3f0, #1a1c21) 6px 12px); }
.primitive-calendar__event[data-status="held"], .primitive-calendar__event[data-status="pending_payment"] { background: light-dark(#fdf6e3, #2b2616); color: light-dark(#8a6212, #e3c27a); border-color: light-dark(#efdfb3, #463b1f); }
.primitive-calendar__event[data-status="past"] { opacity: 0.7; }

/* ── shared-layer refinements: stat grids + empty states + focus rings ───── */
/* Stat groups: a responsive grid of metric cards instead of a stacked column.
   Scoped via :has() to rows that directly hold stats, so other rows are untouched. */
:where(.primitive-row:has(> .primitive-stat)) { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; align-items: stretch; }
/* Zero-data states read as intentional, not forgotten: centered, breathing room.
   `.cre8-empty` is the app-facing name: the SSR audit found 33 distinct bespoke
   classes (`.shop-grid-empty`, `.brain-empty`, `.ckt-empty`, `.traffic-empty`,
   `.org-empty`, …) across 81 sites in 25 crates, all expressing this one "nothing
   here yet" concept and each needing its own per-app rule. Apps should emit
   `class="cre8-empty"` (optionally alongside their existing class during
   migration) and drop the bespoke rule. Listed in the same `:where()` so the
   primitive and app-facing spellings stay pixel-identical by construction. */
:where(.primitive-list__empty, .primitive-table__empty, .primitive-empty-state, .cre8-empty, .client-view-empty) { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 84px; padding: 24px 16px; text-align: center; color: light-dark(#8a938e, #7c857f); font-size: 13px; line-height: 1.45; }
/* A chart placeholder holds the height of the chart it stands in for. */
.client-view-empty { min-height: var(--cre8-view-chart-empty-height, 84px); }
/* EmptyState primitive: the same box (it also carries `cre8-empty`), with a
   title line, a body line and a row of next actions. */
:where(.primitive-empty-state--neutral) { gap: 6px; }
:where(.primitive-empty-state__title) { margin: 0; color: var(--cre8-view-fg); font-size: 14px; font-weight: 700; }
:where(.primitive-empty-state__body) { max-width: 52ch; margin: 0; }
:where(.primitive-empty-state__actions) { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
/* Refined focus: a soft accent halo accompanies the outline on interactive elements. */
:where(button.primitive-action, a.primitive-action, .primitive-button, .primitive-button-primary, .primitive-tabs-button, .primitive-accordion__trigger, .primitive-sidebar__item, .primitive-card__link, .primitive-nav__link, .primitive-nav__menu, .primitive-field > input, .primitive-field > select, .primitive-field > textarea, .primitive-input__control, .primitive-select__control, .primitive-checkbox__control):focus-visible { box-shadow: 0 0 0 4px light-dark(rgba(15, 118, 93, 0.18), rgba(95, 193, 168, 0.22)); }
/* Forced-colors modes (Windows High Contrast) remove box-shadows and flatten
   background colours to Canvas. The focus halo above is a box-shadow, a
   progress or meter fill is a background, a badge's tone is a background, and
   today's calendar cell is an inset shadow: each needs a system-colour
   outline, border or fill that survives the mode. */
@media (forced-colors: active) {
  :where(button.primitive-action, a.primitive-action, .primitive-button, .primitive-button-primary, .primitive-tabs-button, .primitive-accordion__trigger, .primitive-sidebar__item, .primitive-card__link, .primitive-nav__link, .primitive-nav__menu, .primitive-field > input, .primitive-field > select, .primitive-field > textarea, .primitive-input__control, .primitive-select__control, .primitive-checkbox__control):focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
  :where(.primitive-progress__track, .cre8-meter) { border: 1px solid CanvasText; }
  :where(.primitive-progress__fill, .cre8-meter__fill) { forced-color-adjust: none; background: Highlight; }
  :where(.primitive-badge) { border: 1px solid CanvasText; }
  .primitive-calendar__cell[data-today="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
}

/* Legacy workbench-fragment utility. Live-snapshot pill rows across several
   apps (capitalstrategy .cs-*, breath, meditation, studio) mark up a
   horizontal wrapping row as `class="row"` and carry an inline gap, but no
   global `.row` rule ever existed — so `display:flex` (and the gap) never
   applied and the pills fell back to bare inline flow. Define it once here, in
   the sheet every SSR page loads. Scoped overrides (`.shop-live-snapshot .row`,
   `.market-live-snapshot .row`) still win on specificity; per-use inline gaps
   (breath 12px/8px, meditation 8px) still layer on top. */
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row--tight { gap: 8px; }
.row--baseline { align-items: baseline; gap: 12px; }

/* ── App hero (Section{variant:"app-hero"}) ──────────────────────────────
   The one page top for app SSR documents: WorkbenchPageBuilder emits it, and so
   do Detail, List, dashboard and home. An app states what it wants through
   `AppHero` (scale, tone, tint, image, media, byline, progress); those arrive
   here as `data-scale`, `data-tone`, `--cre8-hero-tone` and `data-bg-image`, so
   no app needs a hero class of its own.

   Flush / full-bleed: the hero reaches the sidebar (left), the top bar and the
   window's right edge at any width, by the band bleed the app shell measures
   (--cre8-shell-half above). Its inline padding gives the bleed back, so the
   hero text still lines up with the capped column below it. Rows are spaced by
   margins and `row-gap` stays 0, because the media slot spans empty grid rows
   and a gap would count each of them. */
@keyframes cre8-hero-drift { from { scale: 1; } to { scale: 1.06; } }
.primitive-section--app-hero { --cre8-band-bleed-x: max(var(--cre8-shell-half) - 50%, 0px); --cre8-hero-tone: var(--cre8-view-accent); --cre8-hero-rule: color-mix(in srgb, var(--cre8-view-fg) 10%, transparent); position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; align-content: center; box-sizing: border-box; margin: calc(-1 * var(--cre8-page-gutter-y, 20px)) calc(-1 * var(--cre8-band-bleed-x)) 4px; padding: 34px var(--cre8-band-bleed-x) 30px; overflow: hidden; border: 0; border-bottom: 1px solid var(--cre8-hero-rule); border-radius: 0; background: radial-gradient(64% 180% at 100% -30%, color-mix(in srgb, var(--cre8-hero-tone) 28%, transparent), transparent 70%), radial-gradient(42% 120% at 58% 135%, color-mix(in srgb, var(--cre8-hero-tone) 12%, transparent), transparent 72%), linear-gradient(180deg, color-mix(in srgb, var(--cre8-hero-tone) 4%, light-dark(#ffffff, #101216)), light-dark(#ffffff, #0d0f12)); color: var(--cre8-view-fg); }
.primitive-section--app-hero[data-tone="good"] { --cre8-hero-tone: var(--cre8-view-success); }
.primitive-section--app-hero[data-tone="warn"] { --cre8-hero-tone: var(--cre8-view-warning); }
.primitive-section--app-hero[data-tone="bad"] { --cre8-hero-tone: var(--cre8-view-danger); }
.primitive-section--app-hero[data-tone="info"] { --cre8-hero-tone: var(--cre8-view-info); }
/* A named tone or tint fills the lead action too, deepened or lifted so either
   ink stays readable on a colour the app chose. */
.primitive-section--app-hero[data-tone] .primitive-action-primary { --cre8-action-fill: light-dark(color-mix(in srgb, var(--cre8-hero-tone) 76%, #000000), color-mix(in srgb, var(--cre8-hero-tone) 76%, #ffffff)); }
/* A dot field that fades in toward the glow, and a tone hairline along the foot. */
.primitive-section--app-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(color-mix(in srgb, var(--cre8-hero-tone) 38%, transparent) 1px, transparent 1.5px); background-size: 20px 20px; -webkit-mask-image: linear-gradient(100deg, transparent 54%, #000 104%); mask-image: linear-gradient(100deg, transparent 54%, #000 104%); pointer-events: none; }
.primitive-section--app-hero::after { content: ""; position: absolute; inset: auto 0 -1px; z-index: -1; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--cre8-hero-tone) 55%, transparent) 62%, transparent); pointer-events: none; }
/* Each line arrives a beat after the one above it. The reduced-motion layer in
   view_preferences.css stops these along with every other animation. */
.primitive-section--app-hero > * { margin-block: 0; animation: cre8-rise-in var(--cre8-motion-slide, 240ms) var(--cre8-ease-out, ease-out) backwards; }
.primitive-section--app-hero > * + * { margin-top: 10px; }
.primitive-section--app-hero > :nth-child(2) { animation-delay: 30ms; }
.primitive-section--app-hero > :nth-child(3) { animation-delay: 60ms; }
.primitive-section--app-hero > :nth-child(4) { animation-delay: 90ms; }
.primitive-section--app-hero > :nth-child(n + 5) { animation-delay: 120ms; }
.primitive-section--app-hero > .primitive-section-eyebrow, .app-hero__identity > .primitive-section-eyebrow { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--cre8-view-fg-muted); font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.primitive-section--app-hero > .primitive-section-eyebrow::before, .app-hero__identity > .primitive-section-eyebrow::before { content: ""; flex: none; width: 16px; height: 2px; border-radius: 2px; background: var(--cre8-hero-tone); }
.primitive-section--app-hero .primitive-section-eyebrow__sep { color: var(--cre8-hero-tone); font-weight: 700; }
.primitive-section--app-hero > h1 { max-width: 900px; color: inherit; font-size: clamp(1.75rem, 1.35rem + 1.5vw, 2.6rem); font-weight: 780; letter-spacing: -0.022em; line-height: 1.08; text-wrap: balance; }
/* The intro headline when the eyebrow slot is already the entity kind: a
   subhead under the h1, never larger than it. */
.primitive-section--app-hero > h2 { max-width: 760px; margin-top: 8px; color: inherit; font-size: 16px; font-weight: 680; letter-spacing: -0.008em; line-height: 1.3; }
.primitive-section--app-hero > p { max-width: 68ch; color: var(--cre8-view-fg-muted); font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.primitive-section--app-hero > .primitive-row + * { margin-top: 12px; }
.primitive-section--app-hero > * + .primitive-row { margin-top: 14px; }
/* The identity row above the h1 holds a link too, but it is not the action row. */
.primitive-section--app-hero > * + .primitive-row:not(.app-hero__identity):has(> .primitive-action) { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
/* The lead link says it goes somewhere. A button may submit, so it keeps none. */
.primitive-section--app-hero a.primitive-action-primary::after { content: "\2192" / ""; transition: translate var(--cre8-motion-quick, 120ms) var(--cre8-ease-out, ease-out); }
.primitive-section--app-hero a.primitive-action-primary:hover::after { translate: 3px 0; }
/* Hero stats read as one ribbon, not a wall of tiles: value over label inside a
   single frosted strip. The hairlines are shadows the strip clips, so a wrapped
   row never leaves a stray rule at its edge. Stats in the page body keep tiles. */
.primitive-section--app-hero > * + .primitive-row:has(> .primitive-stat) { display: flex; flex-wrap: wrap; gap: 0; width: fit-content; max-width: 100%; margin-top: 20px; overflow: hidden; border: 1px solid var(--cre8-hero-rule); border-radius: 12px; background: color-mix(in srgb, light-dark(#ffffff, #1a1d22) 68%, transparent); box-shadow: 0 1px 2px light-dark(rgba(16, 24, 20, 0.04), rgba(0, 0, 0, 0.2)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.primitive-section--app-hero .primitive-stat { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; padding: 10px 20px 11px; border: 0; border-radius: 0; background: none; box-shadow: -1px 0 0 var(--cre8-hero-rule), 0 -1px 0 var(--cre8-hero-rule); }
.primitive-section--app-hero .primitive-stat__value { order: -1; margin-top: 0; font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem); font-variant-numeric: tabular-nums; letter-spacing: -0.012em; }
.primitive-section--app-hero .primitive-stat__label { margin-top: 3px; max-width: 24ch; font-size: 10.5px; letter-spacing: 0.06em; }
.primitive-section--app-hero .primitive-stat__detail { margin-top: 2px; font-size: 11.5px; }
/* A progress bar lies along the hero's foot, in place of the tone hairline. */
.primitive-section--app-hero > .primitive-progress { position: absolute; inset: auto 0 0; margin: 0; }
.primitive-section--app-hero > .primitive-progress .primitive-progress__header { display: none; }
.primitive-section--app-hero > .primitive-progress .primitive-progress__track { height: 3px; border: 0; border-radius: 0; background: color-mix(in srgb, var(--cre8-view-fg) 12%, transparent); }
.primitive-section--app-hero > .primitive-progress .primitive-progress__fill { border-radius: 0; background: var(--cre8-hero-tone); }
.primitive-section--app-hero:has(> .primitive-progress)::after { content: none; }
.primitive-section--app-hero > [data-variant="hero-byline"] { color: var(--cre8-view-fg-soft); font-size: 13px; font-weight: 600; }

/* Feature: a landing or index page that earns one large statement. */
.primitive-section--app-hero[data-scale="feature"] { padding-block: clamp(44px, 6vw, 76px) clamp(36px, 4.5vw, 56px); }
.primitive-section--app-hero[data-scale="feature"] > h1 { max-width: 18ch; font-size: clamp(2.2rem, 1.5rem + 3vw, 3.5rem); letter-spacing: -0.03em; line-height: 1.03; }
.primitive-section--app-hero[data-scale="feature"] > p { max-width: 56ch; margin-top: 14px; font-size: clamp(15px, 14px + 0.3vw, 17px); }
/* Poster: the window's first screen, with the type set at its foot. It is dark
   in both themes, and `color-scheme` makes every light-dark() token inside it
   take its dark half, actions and stats included. A backdrop image implies the
   same ground, so its text never depends on what the image holds. */
.primitive-section--app-hero:is([data-scale="poster"], [data-bg-image="true"]) { color-scheme: dark; background: radial-gradient(70% 90% at 82% 8%, color-mix(in srgb, var(--cre8-hero-tone) 34%, transparent), transparent 70%), radial-gradient(60% 80% at 8% 100%, color-mix(in srgb, var(--cre8-hero-tone) 16%, transparent), transparent 72%), linear-gradient(170deg, #12161b, #0a0c0f); }
.primitive-section--app-hero[data-scale="poster"] { min-height: clamp(380px, 58vh, 640px); align-content: end; padding-block: 72px 40px; }
.primitive-section--app-hero[data-scale="poster"] > h1 { max-width: 16ch; font-size: clamp(2.5rem, 1.5rem + 4vw, 4.4rem); letter-spacing: -0.034em; line-height: 1; }
.primitive-section--app-hero[data-scale="poster"] > p { max-width: 54ch; margin-top: 16px; color: rgba(255, 255, 255, 0.78); font-size: clamp(15px, 14px + 0.4vw, 18px); }
.primitive-section--app-hero[data-scale="poster"] .primitive-action-primary { --cre8-action-fill: #ffffff; color: #101214; }
.primitive-section--app-hero:is([data-scale="poster"], [data-bg-image="true"]) .primitive-action-secondary { color: #e4e6e9; }
.primitive-section--app-hero[data-bg-image="true"]::before { z-index: -2; background: var(--cre8-section-bg-image) center / cover no-repeat; -webkit-mask-image: none; mask-image: none; transform-origin: 70% 40%; animation: cre8-hero-drift 26s ease-in-out infinite alternate; }
.primitive-section--app-hero[data-bg-image="true"]::after { inset: 0; height: auto; background: linear-gradient(to top, rgba(8, 10, 13, 0.94), rgba(8, 10, 13, 0.62) 46%, rgba(8, 10, 13, 0.3)); }
.primitive-section--app-hero[data-bg-image="true"]:has(> .primitive-progress)::after { content: ""; }

/* Media: art beside the copy, in a `hero-media` Section. The copy stays in the
   hero's own flow, so the h1 is still a direct child. Each line takes a numbered
   row between two `1fr` rows, which take whatever height the art adds and keep
   the copy centred against it; left to auto-placement, the first line would
   take the row after every other line. */
.primitive-section--app-hero:has(> .primitive-section--hero-media) { grid-template-columns: minmax(0, 1fr) minmax(0, clamp(240px, 36%, 460px)); grid-template-rows: 1fr repeat(9, auto) 1fr; column-gap: clamp(28px, 5vw, 72px); }
.primitive-section--app-hero:has(> .primitive-section--hero-media) > * { grid-column: 1; }
.primitive-section--app-hero:has(> .primitive-section--hero-media) > :nth-child(1) { grid-row: 2; }
.primitive-section--app-hero:has(> .primitive-section--hero-media) > :nth-child(2) { grid-row: 3; }
.primitive-section--app-hero:has(> .primitive-section--hero-media) > :nth-child(3) { grid-row: 4; }
.primitive-section--app-hero:has(> .primitive-section--hero-media) > :nth-child(4) { grid-row: 5; }
.primitive-section--app-hero:has(> .primitive-section--hero-media) > :nth-child(5) { grid-row: 6; }
.primitive-section--app-hero:has(> .primitive-section--hero-media) > :nth-child(6) { grid-row: 7; }
.primitive-section--app-hero:has(> .primitive-section--hero-media) > :nth-child(7) { grid-row: 8; }
.primitive-section--app-hero:has(> .primitive-section--hero-media) > :nth-child(8) { grid-row: 9; }
.primitive-section--app-hero:has(> .primitive-section--hero-media) > :nth-child(9) { grid-row: 10; }
.primitive-section--app-hero:has(> .primitive-section--hero-media) > .primitive-section--hero-media { grid-column: 2; grid-row: 1 / -1; align-self: center; margin: 0; min-width: 0; }
.primitive-section--hero-media :is(img, svg, video) { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: 0 18px 44px light-dark(rgba(16, 24, 20, 0.16), rgba(0, 0, 0, 0.5)); }

@media (max-width: 600px) {
  .primitive-section--app-hero { padding-block: 26px 22px; }
  .primitive-section--app-hero > * + .primitive-row:has(> .primitive-stat) { width: 100%; }
  .primitive-section--app-hero .primitive-stat { flex-basis: 40%; padding: 9px 14px 10px; }
  .primitive-section--app-hero .primitive-stat:last-child:nth-child(odd) { flex-basis: 100%; }
  /* Actions stack full-width; the strip keeps two across. */
  .primitive-section--app-hero > * + .primitive-row:not(.app-hero__identity):has(> .primitive-action) { flex-direction: column; align-items: stretch; }
  .primitive-section--app-hero[data-scale="feature"] { padding-block: 34px 28px; }
  .primitive-section--app-hero[data-scale="poster"] { min-height: min(72vh, 520px); padding-block: 56px 28px; }
  .primitive-section--app-hero:has(> .primitive-section--hero-media) { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .primitive-section--app-hero:has(> .primitive-section--hero-media) > :nth-child(n) { grid-row: auto; }
  .primitive-section--app-hero:has(> .primitive-section--hero-media) > .primitive-section--hero-media { grid-column: 1; grid-row: auto; margin-top: 18px; }
}
@media (pointer: coarse) { .primitive-section--app-hero .primitive-action { min-height: 44px; } }


/* ── Shared entity primitives: this sheet's alias bindings ───────────────
   The rules themselves live once, in `assets/shared_entities.css`, and are
   copied in below (this file is read as a plain file by `include_str!`, so it
   cannot reference the fragment — the byte-identity test in style_tokens.rs
   is what keeps the copy honest). The fragment names colors only through
   `--cre8-entity-*`; these bindings point them at the app-view palette, which
   is what the block resolved to when it was hand-mirrored. */
:root {
  --cre8-entity-rule: var(--cre8-view-border-subtle);
  --cre8-entity-border: var(--cre8-view-border);
  --cre8-entity-border-strong: var(--cre8-view-border-strong);
  --cre8-entity-fg: var(--cre8-view-fg);
  --cre8-entity-fg-muted: var(--cre8-view-fg-muted);
  --cre8-entity-surface: var(--cre8-view-surface);
  --cre8-entity-meter-track: var(--cre8-view-chip-bg);
  --cre8-entity-accent: var(--cre8-view-accent);
  --cre8-entity-danger: var(--cre8-error-fg);
  --cre8-entity-warning: light-dark(#8a5300, #eec27a);
  --cre8-entity-info: light-dark(#1f5da8, #8db9ef);
}

/* ── Shared entity primitives ─────────────────────────────────────────────
   THE definition of the canonical table / card / pill / empty-state / meter
   and the breadcrumb / pager / filter-chip navigation strips.
   Included verbatim by both SSR sheets — `base_theme.css` (loaded by app
   document routes) and `render_html::section_styles::SECTION_BASE_CSS`
   (injected for authored site templates) — so a class can never exist on one
   surface and not the other. App view_templates emit these classes instead of
   re-declaring the same rules per crate (measured at adoption: 29 files
   carried their own table reset, 31 their own pill radius, 5 the identical
   card).

   Colors resolve through the neutral `--cre8-entity-*` alias layer, which each
   sheet binds to its own palette: light-dark() `--cre8-view-*` tokens in
   base_theme.css, flat `--cre8-*` site-template tokens in SECTION_BASE_CSS.
   Rules here therefore reference no palette token directly. Two properties
   here are per-element, not aliases: `--tone` tints a pill or meter fill (apps
   set it inline from the accent token of whichever sheet they load) and
   `--cre8-meter-value` sets the meter fill width.

   `.cre8-empty--error` and `.cre8-empty` are both one class, so the modifier
   only wins while it stays after the base rule.

   `base_theme.css` is a plain file consumed by `include_str!`, so it carries a
   physical copy of this text rather than a reference to it; the byte-identity
   test in `style_tokens.rs` fails if the two ever differ. */
.cre8-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cre8-table th, .cre8-table td { padding: 6px 9px; border-bottom: 1px solid var(--cre8-entity-rule); text-align: left; vertical-align: top; }
.cre8-table thead th { color: var(--cre8-entity-fg-muted); font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.cre8-table caption { caption-side: top; padding: 0 0 8px; color: var(--cre8-entity-fg-muted); font-size: 12px; font-weight: 600; text-align: left; }
/* A grid table tints the row under the pointer so a wide row reads across;
   the record table (`--plain`) is read top to bottom and stays still. */
.cre8-table:not(.cre8-table--plain) tbody tr:hover { background: color-mix(in srgb, var(--cre8-entity-fg-muted) 6%, transparent); }
.cre8-table .num, .cre8-table td.cre8-table__num, .cre8-table th.cre8-table__num { text-align: right; font-variant-numeric: tabular-nums; }
.cre8-card { padding: 14px 16px; border: 1px solid var(--cre8-entity-border); border-radius: 16px; background: var(--cre8-entity-surface); }
.cre8-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid color-mix(in srgb, var(--tone, var(--cre8-entity-fg-muted)) 35%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--tone, var(--cre8-entity-fg-muted)) 12%, transparent); color: var(--tone, var(--cre8-entity-fg-muted)); font-size: 12px; font-weight: 600; white-space: nowrap; }
.cre8-pill--info { --tone: var(--cre8-entity-info); }
.cre8-pill--success { --tone: var(--cre8-entity-accent); }
.cre8-pill--warning { --tone: var(--cre8-entity-warning); }
.cre8-pill--error { --tone: var(--cre8-entity-danger); }
/* A label/value pill (`label <strong>value</strong>`, the live-status strip)
   keeps the value at full contrast. */
.cre8-pill strong { color: var(--cre8-entity-fg); }
.cre8-empty { padding: 18px; border: 1px dashed var(--cre8-entity-border-strong); border-radius: 12px; color: var(--cre8-entity-fg-muted); font-size: 13px; text-align: center; }
.cre8-empty--error { border-color: color-mix(in srgb, var(--cre8-entity-danger) 40%, transparent); color: var(--cre8-entity-danger); }
.cre8-meter { display: block; overflow: hidden; height: 8px; border-radius: 999px; background: var(--cre8-entity-meter-track); }
.cre8-meter__fill { display: block; height: 100%; border-radius: inherit; width: var(--cre8-meter-value, 0%); background: var(--tone, var(--cre8-entity-accent)); }
/* Navigation strips: `breadcrumb_html`, `pager_html` and `filter_chips_html`
   (cre8-util-view-html) and the Breadcrumb / Pager / FilterChips primitives
   emit these classes. The current item is marked with `aria-current`, so the
   selected state is announced and is never carried by color alone. */
.cre8-breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 12px; padding: 0; list-style: none; font-size: 13px; color: var(--cre8-entity-fg-muted); }
.cre8-breadcrumb li + li::before { content: "/"; margin-inline-end: 8px; opacity: 0.6; }
.cre8-breadcrumb a { color: inherit; }
.cre8-breadcrumb a:hover { color: var(--cre8-entity-fg); }
.cre8-breadcrumb [aria-current="page"] { color: var(--cre8-entity-fg); }
.cre8-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-block: 16px; font-size: 13px; }
.cre8-pager__page { color: var(--cre8-entity-fg-muted); font-variant-numeric: tabular-nums; }
.cre8-pager a { display: inline-flex; align-items: center; box-sizing: border-box; min-height: 32px; padding: 4px 12px; border: 1px solid var(--cre8-entity-border); border-radius: 999px; text-decoration: none; color: var(--cre8-entity-accent); }
.cre8-pager a:hover { border-color: var(--cre8-entity-accent); }
.cre8-filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; font-size: 12px; }
.cre8-filter-chips__label { margin-inline-end: 4px; color: var(--cre8-entity-fg-muted); font-weight: 600; }
.cre8-filter-chip { display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; min-height: 28px; padding: 4px 10px; border: 1px solid var(--cre8-entity-border); border-radius: 999px; color: var(--cre8-entity-fg-muted); text-decoration: none; white-space: nowrap; }
.cre8-filter-chip:hover { border-color: var(--cre8-entity-accent); color: var(--cre8-entity-fg); }
.cre8-filter-chip[aria-current] { border-color: var(--cre8-entity-accent); background: color-mix(in srgb, var(--cre8-entity-accent) 14%, transparent); color: var(--cre8-entity-fg); font-weight: 600; }
.cre8-filter-chip__count { font-variant-numeric: tabular-nums; opacity: 0.7; }
/* Layout atoms for string-built pages. `kv_html`, `links_html` and
   `table_wrap_html` (cre8-util-view-html) emit `.cre8-kv`, `.cre8-links` and
   `.cre8-table-wrap` ahead of the app hook class; the rest are written on the
   element they lay out. `.cre8-card--link` is the whole-card link tile and
   sits beside `.cre8-card`, so it stays after that rule. */
.cre8-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.cre8-kv dt { color: var(--cre8-entity-fg-muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.cre8-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.cre8-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.cre8-links a { color: var(--cre8-entity-accent); text-decoration: none; border-bottom: 1px dotted var(--cre8-entity-border-strong); }
.cre8-links a:hover { border-bottom-style: solid; border-bottom-color: currentColor; }
.cre8-table-wrap { overflow-x: auto; }
/* A table written without the wrapper scrolls in its own box at phone width,
   so it cannot widen the page. As a block it no longer stretches to its
   column there; a table that should keep the stretch goes in
   `.cre8-table-wrap`. `:where` holds the rule at one class of specificity. */
@media (max-width: 760px) { :where(:not(.cre8-table-wrap)) > .cre8-table { display: block; max-width: 100%; overflow-x: auto; } }
.cre8-list-plain { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cre8-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cre8-cluster--tight { gap: 6px; }
.cre8-cluster--loose { gap: 12px; }
.cre8-cluster--between { justify-content: space-between; }
.cre8-cluster--baseline { align-items: baseline; }
.cre8-card--link { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); text-decoration: none; transition: box-shadow 140ms ease, transform 140ms ease, border-color 140ms ease; }
.cre8-card--link:hover { border-color: color-mix(in srgb, var(--cre8-entity-accent) 45%, transparent); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16); transform: translateY(-2px); }
.cre8-card__title { color: var(--cre8-entity-fg); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.cre8-card__meta { color: var(--cre8-entity-fg-muted); font-size: 12px; line-height: 1.4; }
.cre8-doc-back { display: inline-block; margin-top: 4px; color: var(--cre8-entity-fg-muted); font-size: 13px; text-decoration: none; }
.cre8-doc-back:hover { color: var(--cre8-entity-fg); }
/* Reading atoms for string-built record pages. `.cre8-table--plain` is the
   record table: sentence-case column heads and quiet row heads, for tables
   read as a sheet of facts rather than scanned as a grid. `.cre8-sub` is the
   second line under a cell's value, `.cre8-note` a muted remark under a block,
   `.cre8-mono` an identifier that may wrap anywhere (a `code` in a table cell
   wraps the same way). `.cre8-lineage` is an
   ordered chain of steps (`__step`, its rank label in `em`, `__arrow` between
   steps, `__step--leaf` for the one the page is about); `.cre8-swatch` is a
   colour key. Both take their colour from `--tone`. `.cre8-legend` is the
   key under a figure, one `__item` per colour (a swatch and its label);
   `.cre8-tags` is a row of `.cre8-tag` labels that are not filters, tinted
   by `--tone` when the tag has one. */
.cre8-table code { overflow-wrap: anywhere; }
.cre8-table--plain th { color: var(--cre8-entity-fg-muted); font-weight: 500; white-space: nowrap; }
.cre8-table--plain thead th { font-size: 13px; font-weight: 500; letter-spacing: normal; text-transform: none; }
.cre8-sub { margin-top: 2px; color: var(--cre8-entity-fg-muted); font-size: 11px; }
.cre8-note { margin: 6px 0 0; color: var(--cre8-entity-fg-muted); font-size: 12px; }
.cre8-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; overflow-wrap: anywhere; }
.cre8-lineage { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; }
.cre8-lineage__step { padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--cre8-entity-fg-muted) 12%, transparent); }
.cre8-lineage__step--leaf { background: color-mix(in srgb, var(--tone, var(--cre8-entity-accent)) 22%, transparent); }
.cre8-lineage__step em { margin-right: 4px; color: var(--cre8-entity-fg-muted); font-size: 11px; font-style: normal; }
.cre8-lineage__arrow { color: var(--cre8-entity-fg-muted); opacity: 0.7; }
.cre8-swatch { display: inline-block; width: 12px; height: 12px; margin-right: 4px; border-radius: 3px; vertical-align: -1px; background: var(--tone, var(--cre8-entity-fg-muted)); }
.cre8-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; padding: 0; list-style: none; color: var(--cre8-entity-fg-muted); font-size: 12px; line-height: 1.5; }
.cre8-legend__item { display: inline-flex; align-items: center; }
.cre8-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cre8-tag { padding: 1px 8px; border-radius: 999px; font-size: 12px; background: color-mix(in srgb, var(--tone, var(--cre8-entity-fg-muted)) 14%, transparent); }
/* Every link and chip above shows the same keyboard focus ring, drawn in the
   sheet's accent so it follows the app palette, and in Highlight when the
   system forces colours. */
:where(.cre8-breadcrumb a, .cre8-pager a, .cre8-filter-chip, .cre8-links a, .cre8-card--link, .cre8-doc-back):focus-visible { outline: 2px solid var(--cre8-entity-accent); outline-offset: 2px; }
/* A label/value list stacks once the row is too narrow for two columns. */
@media (max-width: 520px) {
  .cre8-kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .cre8-kv dd + dt { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .cre8-card--link { transition: none; }
  .cre8-card--link:hover { transform: none; }
}
/* Forced colours drop backgrounds, so the meter keeps an outline and a
   Highlight fill, and the current chip is marked by a heavier border. */
@media (forced-colors: active) {
  :where(.cre8-breadcrumb a, .cre8-pager a, .cre8-filter-chip, .cre8-links a, .cre8-card--link, .cre8-doc-back):focus-visible { outline-color: Highlight; }
  .cre8-meter { border: 1px solid CanvasText; }
  .cre8-meter__fill { forced-color-adjust: none; background: Highlight; }
  .cre8-filter-chip[aria-current] { border-width: 2px; }
}
/* InfoCard / SummaryList / CatalogTile: SSR writers in render_html/info_cards.rs
   emit the same primitive-* DOM as the React primitives. */
.primitive-info-card { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid var(--cre8-view-border); border-radius: 8px; background: var(--cre8-view-surface-alt); }
.primitive-info-card__eyebrow { font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--cre8-view-fg-muted); }
.primitive-info-card__title { font-size: 13px; color: var(--cre8-view-fg); }
.primitive-info-card__body { font-size: 12px; color: var(--cre8-view-fg-soft); }
.primitive-summary-list { display: grid; gap: 4px; margin: 0; }
.primitive-summary-list__row { display: grid; grid-template-columns: var(--summary-label-width, 120px) minmax(0, 1fr); gap: 8px; font-size: 12px; }
.primitive-summary-list__label { color: var(--cre8-view-fg-muted); }
.primitive-summary-list__value { margin: 0; color: var(--cre8-view-fg); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.primitive-catalog-tile { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--cre8-view-border); border-radius: 10px; background: var(--cre8-view-surface); color: inherit; text-decoration: none; }
.primitive-catalog-tile--interactive:hover { border-color: var(--cre8-view-accent); }
.primitive-catalog-tile__badges, .primitive-catalog-tile__chips { display: flex; flex-wrap: wrap; gap: 4px; }
.primitive-catalog-tile__badge, .primitive-catalog-tile__chip { padding: 2px 6px; border-radius: 4px; background: var(--cre8-view-chip-bg); color: var(--cre8-view-fg-muted); font-size: 11px; }
.primitive-catalog-tile__title { font-weight: 600; color: var(--cre8-view-fg); }
.primitive-catalog-tile__subtitle { font-size: 12px; color: var(--cre8-view-fg-muted); }
.primitive-split-preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 720px) { .primitive-split-preview { grid-template-columns: minmax(0, 1fr); } }
.primitive-tree-view__group { margin: 0; padding-inline-start: 16px; list-style: none; }
.primitive-tree-view > .primitive-tree-view__group { padding-inline-start: 0; }
.primitive-tree-view__item { margin-block: 2px; font-size: 13px; }
.primitive-tree-view__item summary { cursor: pointer; }
.primitive-tree-view__label { color: var(--cre8-view-fg); }
.primitive-tree-view__empty { color: var(--cre8-view-fg-muted); font-size: 13px; }

/* EmptyState error: the `.cre8-empty--error` look for the primitive's own
   modifier. Outside the shared-entities copy above, and after its `.cre8-empty`
   rule, which it must follow to win. */
.primitive-empty-state--error { border-color: color-mix(in srgb, var(--cre8-entity-danger) 40%, transparent); color: var(--cre8-entity-danger); }
.primitive-empty-state--error .primitive-empty-state__title { color: inherit; }

/* A detail page's hero is the same flush band as every app hero; the record
   identity rides under the title as a quiet monospace line, visible while
   related-data panels change. */
.detail-hero .primitive-text[data-variant="record-identity"] { display: block; justify-self: start; max-width: 100%; padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--cre8-view-fg) 6%, transparent); color: var(--cre8-view-fg-muted); font-family: ui-monospace, monospace; font-size: 12px; overflow-wrap: anywhere; }
/* The owner's access explanation: what the reader may not see, marked as a
   boundary rather than as a failure. */
.detail-access-notice { border-inline-start: 4px solid var(--cre8-view-danger); }

/* Help (src/help.rs): explanation behind a `?` or a dotted term, opened as a
   native popover. The panel is hidden until opened; without popover support
   the trigger's aria-label still names the topic. */
.cre8-help { display: inline-flex; align-items: center; position: relative; vertical-align: middle; margin-inline-start: 4px; text-transform: none; letter-spacing: normal; font-weight: 400; }
.cre8-help__trigger { appearance: none; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0; border: 1px solid light-dark(#c3cbc6, #3a3e46); border-radius: 50%; background: transparent; color: light-dark(#6c7572, #8e9591); font: 700 10px/1 system-ui, sans-serif; cursor: help; }
.cre8-help__trigger:hover { border-color: light-dark(#0f765d, #5fc1a8); color: light-dark(#0f765d, #5fc1a8); }
.cre8-help__trigger:focus-visible { outline: 2px solid light-dark(#0f765d, #5fc1a8); outline-offset: 2px; }
.cre8-help--term { margin-inline-start: 0; }
.cre8-help--term .cre8-help__trigger { width: auto; height: auto; min-height: 24px; padding: 3px 10px; border-radius: 999px; border-color: light-dark(#e2c08a, #6b5325); background: light-dark(#fdf6ea, rgba(232, 183, 90, 0.08)); color: light-dark(#8a5300, #e8b75a); font: 650 12px/1.2 system-ui, sans-serif; }
.cre8-help__panel { max-width: min(36ch, calc(100vw - 32px)); margin: 0; padding: 10px 12px; border: 1px solid light-dark(#d9dfda, #2f333b); border-radius: 8px; background: light-dark(#ffffff, #1a1d22); color: light-dark(#17201d, #e8e8ec); box-shadow: 0 8px 24px light-dark(rgba(16, 24, 20, 0.14), rgba(0, 0, 0, 0.45)); font: 400 13px/1.45 system-ui, sans-serif; text-align: start; text-transform: none; letter-spacing: normal; white-space: normal; }
.cre8-help__panel:not(:popover-open) { display: none; }
/* A popover opened by `popovertarget` anchors to its invoker implicitly, so
   no anchor-name is shared between triggers. */
@supports (position-area: block-end) { .cre8-help__panel { position-area: block-end span-inline-end; position-try-fallbacks: flip-block, flip-inline; margin-top: 6px; } }
.cre8-help-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.primitive-section--association-group { min-width: 0; overflow-wrap: anywhere; padding-block: 12px; }
.primitive-tabs[data-tabs-progressive]:not([data-tabs-ready]) > .primitive-tabs-strip { display: none; }
.primitive-tabs[data-tabs-progressive]:not([data-tabs-ready]) > .primitive-tabs-panels > .primitive-tab + .primitive-tab { margin-block-start: 24px; }
.primitive-tabs[data-tabs-progressive] .primitive-tabs-strip { overflow-x: auto; }

/* Payload availability is a quiet status row, never an implementation log. */


.primitive-explanation{margin:8px 0 16px;font-size:13px;line-height:1.6;color:var(--cre8-view-fg-muted)}
.primitive-explanation>summary{display:list-item;cursor:pointer;color:var(--cre8-view-fg);font-size:13px;font-weight:600;padding:6px 0}
.primitive-explanation[open]>summary{margin-bottom:8px}
.primitive-explanation>summary:focus-visible{outline:2px solid var(--cre8-view-accent);outline-offset:3px}
.primitive-section--workspace-rail>.primitive-section>.primitive-text{display:block;font-size:13px;line-height:1.5;color:var(--cre8-view-fg-muted);padding-block:8px}

/* Shared sheets: bottom anchored on touch-sized screens, centered on desktop. */
.primitive-bottom-sheet-dialog { position: fixed; inset: 0; margin: 0; padding: 0; border: 0; max-width: none; max-height: none; width: 100%; height: 100%; overflow: hidden; background: transparent; color: var(--cre8-view-fg); }
.primitive-bottom-sheet-dialog::backdrop { background: rgb(0 0 0 / .48); }
.primitive-bottom-sheet-dialog[data-backdrop="false"]::backdrop { background: transparent; }
.primitive-bottom-sheet-dialog[open], .primitive-bottom-sheet__backdrop { display: flex; align-items: flex-end; justify-content: center; }
.primitive-bottom-sheet__backdrop { position: fixed; inset: 0; z-index: 70; background: rgb(0 0 0 / .48); }
.primitive-bottom-sheet-dialog .primitive-bottom-sheet__backdrop { background: transparent; }
.primitive-bottom-sheet { box-sizing: border-box; position: fixed; inset: auto 0 0; margin-inline: auto; width: min(100%, 640px); max-height: min(88dvh, 800px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--cre8-view-border-strong); border-radius: 24px 24px 0 0; background: light-dark(#fff, #16181d); color: var(--cre8-view-fg); box-shadow: 0 20px 80px rgb(0 0 0 / .3); padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 71; }
.primitive-bottom-sheet-dialog .primitive-bottom-sheet { position: relative; inset: auto; margin: 0; }
.primitive-bottom-sheet[hidden], .primitive-bottom-sheet--closed, .primitive-bottom-sheet__backdrop[hidden] { display: none; }
.primitive-bottom-sheet__handle { flex: none; height: 26px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.primitive-bottom-sheet__handle::after { content: ''; width: 36px; height: 4px; border-radius: 4px; background: var(--cre8-view-fg-faint); }
.primitive-bottom-sheet__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px 12px; flex: none; border-bottom: 1px solid var(--cre8-view-border); }
.primitive-bottom-sheet__title { margin: 0; font: 700 18px/1.3 system-ui, sans-serif; }
.primitive-bottom-sheet__close { min-width: 44px; min-height: 44px; border: 0; border-radius: 50%; background: var(--cre8-view-chip-bg); color: inherit; cursor: pointer; font: 20px/1 system-ui, sans-serif; }
.primitive-bottom-sheet__close:focus-visible { outline: 2px solid var(--cre8-view-accent); outline-offset: 2px; }
.primitive-bottom-sheet__body { padding: 20px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.primitive-bottom-sheet__actions { display: grid; gap: 8px; }
.primitive-bottom-sheet__actions > :is(a, button) { display: flex; align-items: center; gap: 12px; min-height: 48px; box-sizing: border-box; padding: 12px 16px; border: 1px solid var(--cre8-view-border); border-radius: 12px; background: var(--cre8-view-surface); color: inherit; text-align: start; text-decoration: none; font: inherit; cursor: pointer; }
.primitive-bottom-sheet__actions > :is(a, button):hover { background: var(--cre8-view-chip-bg); }
@media (min-width: 760px) {
  .primitive-bottom-sheet-dialog[open], .primitive-bottom-sheet__backdrop { align-items: center; }
  .primitive-bottom-sheet { width: min(640px, calc(100% - 48px)); border-radius: 24px; }
}
@media (prefers-reduced-motion: no-preference) {
  .primitive-bottom-sheet-dialog[open] .primitive-bottom-sheet { animation: cre8-sheet-enter 180ms ease-out; }
  @keyframes cre8-sheet-enter { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
}

/* Shared builder tokens; unknown values do not become per-node CSS. */
.primitive-row--gap-none, .primitive-container--gap-none { gap: 0px; }
.primitive-container--padding-none { padding: 0px; }
.primitive-row--gap-xs, .primitive-container--gap-xs { gap: 4px; }
.primitive-container--padding-xs { padding: 4px; }
.primitive-row--gap-sm, .primitive-container--gap-sm { gap: 8px; }
.primitive-container--padding-sm { padding: 8px; }
.primitive-row--gap-md, .primitive-container--gap-md { gap: 12px; }
.primitive-container--padding-md { padding: 12px; }
.primitive-row--gap-lg, .primitive-container--gap-lg { gap: 16px; }
.primitive-container--padding-lg { padding: 16px; }
.primitive-row--gap-xl, .primitive-container--gap-xl { gap: 24px; }
.primitive-container--padding-xl { padding: 24px; }
.primitive-row--align-start { align-items: flex-start; }
.primitive-row--align-center { align-items: center; }
.primitive-row--align-end { align-items: flex-end; }
.primitive-row--align-stretch { align-items: stretch; }
.primitive-row--align-baseline { align-items: baseline; }
.primitive-text--size-xs { font-size: 12px; }
.primitive-text--size-sm { font-size: 14px; }
.primitive-text--size-md { font-size: 16px; }
.primitive-text--size-lg { font-size: 20px; }
.primitive-text--size-xl { font-size: 24px; }
.primitive-text--weight-light { font-weight: 300; }
.primitive-text--weight-normal { font-weight: 400; }
.primitive-text--weight-medium { font-weight: 500; }
.primitive-text--weight-semibold { font-weight: 600; }
.primitive-text--weight-bold { font-weight: 700; }

/* The shared motion layer. Durations and curves are tokens, so a surface that
   moves takes them from here; `view_preferences.css` stops all of it for a
   reader who asked for less motion, by preference or by device setting. Every
   rule is an enhancement: a browser without the feature gets the same page,
   arriving at once. */
:root {
  --cre8-motion-quick: 120ms;
  --cre8-motion-base: 180ms;
  --cre8-motion-slide: 240ms;
  --cre8-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --cre8-ease-slide: cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes cre8-rise-in { from { opacity: 0; translate: 0 10px; } }
@keyframes cre8-fade-out { to { opacity: 0; } }

/* Moving between pages: the bar and the rail hold still and only the page
   changes, on a soft navigation and on a full load alike. The rail is named
   only where it is in the layout; below that it is an overlay. */
@view-transition { navigation: auto; }
.primitive-app-shell > .primitive-nav { view-transition-name: cre8-shell-bar; }
.primitive-app-shell__content { view-transition-name: cre8-shell-page; }
@media (min-width: 761px) {
  .primitive-app-shell__body > .primitive-sidebar { view-transition-name: cre8-shell-rail; }
}
::view-transition-group(cre8-shell-bar),
::view-transition-group(cre8-shell-rail) { animation: none; }
::view-transition-old(cre8-shell-bar),
::view-transition-old(cre8-shell-rail) { display: none; }
::view-transition-new(cre8-shell-bar),
::view-transition-new(cre8-shell-rail) { animation: none; }
::view-transition-old(cre8-shell-page) { animation: var(--cre8-motion-quick) ease both cre8-fade-out; }
::view-transition-new(cre8-shell-page) { animation: var(--cre8-motion-slide) var(--cre8-ease-out) both cre8-rise-in; }

/* Disclosures open to their real height. */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  details::details-content { block-size: 0; overflow: clip; transition: block-size var(--cre8-motion-base) var(--cre8-ease-out), content-visibility var(--cre8-motion-base) allow-discrete; }
  details[open]::details-content { block-size: auto; }
}

/* Dialogs and popovers enter and leave. `translate` is its own property, so a
   surface that centres itself with `transform` keeps its place. */
dialog, [popover] { transition: opacity var(--cre8-motion-base) ease, translate var(--cre8-motion-base) var(--cre8-ease-out), display var(--cre8-motion-base) allow-discrete, overlay var(--cre8-motion-base) allow-discrete; }
dialog:not([open]), [popover]:not(:popover-open) { opacity: 0; translate: 0 8px; }
dialog::backdrop { opacity: 1; transition: opacity var(--cre8-motion-base) ease, display var(--cre8-motion-base) allow-discrete, overlay var(--cre8-motion-base) allow-discrete; }
dialog:not([open])::backdrop { opacity: 0; }
@starting-style {
  dialog[open], [popover]:popover-open { opacity: 0; translate: 0 8px; }
  dialog[open]::backdrop { opacity: 0; }
}

/* A drawer is a dialog held to one edge of the window: the account drawer, or any dialog marked
   `data-cre8-drawer` (`start` for the left edge). It slides in from its edge and back out on the rail's
   duration and curve, so the rail and every drawer move alike; the fade and rise stay with centred dialogs. */
:is(.cre8-account-drawer, dialog[data-cre8-drawer]) { transition: translate var(--cre8-motion-slide) var(--cre8-ease-slide), display var(--cre8-motion-slide) allow-discrete, overlay var(--cre8-motion-slide) allow-discrete; }
:is(.cre8-account-drawer, dialog[data-cre8-drawer]):not([open]) { opacity: 1; translate: 100% 0; }
dialog[data-cre8-drawer="start"]:not([open]) { translate: -100% 0; }
:is(.cre8-account-drawer, dialog[data-cre8-drawer])::backdrop { transition-duration: var(--cre8-motion-slide); }
@starting-style {
  :is(.cre8-account-drawer, dialog[data-cre8-drawer])[open] { opacity: 1; translate: 100% 0; }
  dialog[data-cre8-drawer="start"][open] { translate: -100% 0; }
}

/* Cards and sections rise as they scroll into view. The range is a fixed
   distance, so a tall section is not half transparent on its way in. `backwards`
   lets go once the range ends: nothing is left holding a stacking context. */
@supports (animation-timeline: view()) {
  .primitive-app-shell__content .primitive-section,
  .primitive-app-shell__content .cre8-card { animation: cre8-rise-in linear backwards; animation-timeline: view(); animation-range: entry 0px entry 72px; }
}

/* App-local rhythm stays inside the runtime's chrome and shared token palette. */
.app-hero__identity { align-items: center; margin-bottom: 8px; }
.app-hero__identity .primitive-section-eyebrow { margin: 0; }
.app-hero__identity .app-hero__app-link { display: inline; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--cre8-view-fg-muted); font-size: 12px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
.app-hero__identity .app-hero__app-link:hover { color: var(--cre8-view-accent); text-decoration: underline; background: transparent; }
/* The surface keeps its own padding in a variable so a band can bleed past it to the content area's edges. --cre8-app-bleed-x is the shell's band bleed (base_theme.css): it resolves against the column of the element that uses it, so it holds for any centered column, capped or not. */
.primitive-section--app-surface { --cre8-app-surface-pad: clamp(12px, 2vw, 28px); --cre8-app-bleed-x: max(var(--cre8-shell-half) - 50%, 0px); --cre8-app-bleed-y: calc(var(--cre8-page-gutter-y, 20px) + var(--cre8-app-surface-pad)); box-sizing: border-box; width: min(100%, 1440px); min-width: 0; margin-inline: auto; padding: var(--cre8-app-surface-pad); }
/* Masthead: the page's hero, then the app's own tabs, as one full-width block at the top of the page. The masthead stays in the column and its bands bleed, because the bleed is measured from the column the band sits in. */
.primitive-section--app-masthead { display: block; margin: 0; }
.primitive-page > .primitive-section--app-masthead:first-child { margin-top: calc(-1 * var(--cre8-app-bleed-y, 0px)); }
.primitive-section--app-surface > .primitive-page:has(> .primitive-section--app-masthead:first-child) { padding-top: 0; }
/* A hero or tab bar that is the page's own child reaches the surface's edges, as a masthead does: the surface pads by more than the page gutter those two bleed by on their own. */
.primitive-section--app-surface > .primitive-page > .primitive-section--app-hero { margin-inline: calc(-1 * var(--cre8-app-bleed-x, 24px)); padding-inline: var(--cre8-app-bleed-x, 24px); }
.primitive-section--app-surface > .primitive-page > .primitive-section--app-identity { margin-inline: calc(-1 * var(--cre8-app-bleed-x, 0px)); padding-inline: var(--cre8-app-bleed-x, 24px); }
.primitive-section--app-masthead > .primitive-section--app-hero { margin: 0 calc(-1 * var(--cre8-app-bleed-x, var(--cre8-band-bleed-x))); padding-inline: var(--cre8-app-bleed-x, var(--cre8-band-bleed-x)); }
.primitive-section--app-masthead > .primitive-section--app-identity { --cre8-band-bleed-x: max(var(--cre8-shell-half) - 50%, 0px); margin: 0 calc(-1 * var(--cre8-app-bleed-x, var(--cre8-band-bleed-x))); padding-inline: var(--cre8-app-bleed-x, var(--cre8-band-bleed-x)); background: light-dark(#fbfcfb, #101216); }
/* A page with no hero opens on its tab bar: it meets the top bar and spans the surface, as a masthead does, instead of floating as an inset strip. */
.primitive-section--app-surface > .primitive-section--app-identity:first-child { margin: calc(-1 * var(--cre8-app-bleed-y, 0px)) calc(-1 * var(--cre8-app-bleed-x, 0px)) 20px; padding-inline: var(--cre8-app-bleed-x, 24px); background: light-dark(#fbfcfb, #101216); }
/* The app's own wayfinding: a label, underline tabs that scroll sideways instead of wrapping, and at most one small action. */
.primitive-section--app-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; margin: 0 0 20px; padding: 0; border-bottom: 1px solid light-dark(#e3e7e0, #2a2c33); }
/* z-index is reset because a flex item honours it even when static, which would let this in-page bar out-paint the sticky header's search popover. */
.primitive-section--app-identity .primitive-nav { position: static; z-index: auto; flex: 1 1 0; min-width: 0; min-height: 0; padding: 0; background: transparent; border: 0; box-shadow: none; }
.primitive-section--app-identity .primitive-nav__left { flex-wrap: nowrap; gap: 14px; min-width: 0; width: 100%; }
.primitive-section--app-identity .primitive-nav__right:empty { display: none; }
.primitive-section--app-identity [data-cre8-nav-menu] { display: none; }
.primitive-section--app-identity a.primitive-nav__brand { flex: 0 0 auto; min-height: 0; padding: 0; border-radius: 0; color: light-dark(#6c7572, #8e9591); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.primitive-section--app-identity .primitive-nav__items { display: flex; flex: 1 1 0; flex-wrap: nowrap; gap: 2px; min-width: 0; margin: 0; padding: 0 0 3px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--cre8-view-accent) transparent; }
.primitive-section--app-identity .primitive-nav__items::-webkit-scrollbar { height: 3px; }
.primitive-section--app-identity .primitive-nav__items::-webkit-scrollbar-thumb { background: var(--cre8-view-accent); border-radius: 3px; }
.primitive-section--app-identity a.primitive-nav__link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 0; border-bottom: 2px solid transparent; background: none; color: light-dark(#4e5754, #a9b0ac); font-size: 14px; font-weight: 600; white-space: nowrap; }
.primitive-section--app-identity a.primitive-nav__link:hover { color: light-dark(#101916, #f2f4f3); }
.primitive-section--app-identity a.primitive-nav__link[aria-current=page] { border-bottom-color: var(--cre8-view-accent, #5fc1a8); background: none; color: light-dark(#101916, #f2f4f3); font-weight: 700; }
.primitive-section--app-identity > a.primitive-action { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 34px; margin: 5px 0; padding: 0 12px; border-radius: 8px; font-size: 13px; }
.primitive-section--app-surface a:focus-visible, .primitive-section--app-surface button:focus-visible { outline: 2px solid var(--cre8-view-accent, #5fc1a8); outline-offset: 3px; }
.primitive-section--app-surface .primitive-page { width: 100%; max-width: 100%; padding-inline: 0; }
.primitive-section--app-surface .primitive-section--grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.primitive-section--app-surface .primitive-section--workspace, .primitive-section--app-surface .primitive-section--workspace-main { min-width: 0; max-width: 100%; }
.primitive-section--app-surface .primitive-section--workspace-main { overflow: auto; }
@media (max-width: 960px) {
  .primitive-section--app-surface .primitive-row--workspace-body-triple { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .primitive-section--app-identity a.primitive-nav__brand { display: none; }
  .primitive-section--app-surface .primitive-row--workspace-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  /* The fade advertises the rest of a long tab row even on platforms that
     hide overlay scrollbars. Extra end space lets the active tab scroll clear. */
  .primitive-section--app-identity .primitive-nav__items,
  .primitive-section--app-surface nav[aria-label="Editor modes"] { padding-inline-end: 28px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent); }
  .primitive-section--app-surface nav[aria-label="Editor modes"] { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--cre8-view-accent) transparent; }
}

.primitive-section--app-surface .page { width: 100%; min-width: 0; }
/* A workspace fills the runtime content area; only its panes own spacing. */
.primitive-app-shell__content:has([data-editor-chrome]) { --cre8-page-gutter-x: 0px; --cre8-page-gutter-y: 0px; padding: 0; scrollbar-gutter: auto; }
/* An editor page zeroes the page gutter for its own bars; the site footer under it keeps a gutter of its own. */
.primitive-app-shell__content:has([data-editor-chrome]) .primitive-footer__inner { padding-inline: clamp(16px, 4cqw, 28px); }
.primitive-section--app-surface:has([data-editor-chrome]) { --cre8-app-surface-pad: 0px; width: 100%; max-width: none; margin: 0; padding: 0; }
.primitive-section--app-surface:has([data-editor-chrome]) > .primitive-section--app-identity:first-child { margin: 0; padding-inline: 16px; }
.primitive-section--app-surface [data-editor-chrome] { margin: 0; max-width: none; border-radius: 0; }
/* Raw workspace controls use the same labelled, responsive form rhythm. */
#appWorkspaceControls { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,160px),1fr)); gap: 12px; align-items: end; padding: 16px; border: 1px solid var(--cre8-view-border); border-radius: 10px; background: var(--cre8-view-surface); }
#appWorkspaceControls[hidden] { display: none; }
#appWorkspaceControls label { display: grid; gap: 6px; min-width: 0; font-size: 12px; font-weight: 600; color: var(--cre8-view-fg-muted); }
#appWorkspaceControls :is(input,select,button) { box-sizing: border-box; width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid var(--cre8-view-border); border-radius: 6px; font: inherit; color: var(--cre8-view-fg); background: var(--cre8-view-surface-alt); }
#appWorkspaceControls button { font-size: 13px; font-weight: 600; cursor: pointer; }
#appWorkspaceStatus { color: var(--cre8-view-fg-muted); font-size: 13px; line-height: 1.5; }
.app-group-nav{display:flex;gap:8px;align-items:center;flex-wrap:wrap;position:relative}
.app-group-nav details{position:relative}.app-group-nav summary{cursor:pointer;padding:8px 12px;border:1px solid transparent;border-radius:8px;font-size:13px;list-style:none}
.app-group-nav .app-group-current>summary{border-color:var(--cre8-view-accent,#5fc1a8)}
.app-group-nav details>div{position:absolute;top:100%;left:0;z-index:30;min-width:190px;padding:8px;display:grid;gap:4px;border:1px solid light-dark(#d5ddd8,#354740);border-radius:8px;background:light-dark(#fff,#13201c);box-shadow:0 8px 24px #0003}
.app-group-nav a{display:block;padding:8px 10px;white-space:nowrap;text-decoration:none;color:inherit}.app-group-nav a[aria-current=page]{font-weight:750;background:light-dark(#e8f5ef,#234336)}
.app-group-nav :focus-visible{outline:2px solid var(--cre8-view-accent,#5fc1a8);outline-offset:2px}
@media(max-width:600px){.app-group-nav details>div{position:static;min-width:0}.app-group-nav{align-items:start}.app-group-nav summary{padding:8px}}

/* Runtime chrome: top bar and footer. */
/* The bar's right slot follows assets/main_apps.json: search, the Time and
   Attention plugins, then Settings. Settings is a nav link like its
   neighbours, not an accent. */
.primitive-nav .cre8-settings-link { display: inline-flex; align-items: center; min-height: 36px; padding: 0 10px; border-radius: 8px; color: light-dark(#17201d, #e8e8ec); font-size: 13px; font-weight: 600; text-decoration: none; }
.primitive-nav .cre8-settings-link:hover { background: light-dark(rgba(16, 24, 20, 0.06), rgba(255, 255, 255, 0.07)); }
.primitive-nav .cre8-settings-link[aria-current=page] { color: light-dark(#0f765d, #5fc1a8); }
/* Time: a pill naming the tracked work, with a dot for its state (green and
   pulsing while it runs, amber when paused, a ring for a draft, grey when
   idle) and a clock that counts while it runs. A signed-out reader has
   nothing to track, so the pill is not drawn for them. */
.cre8-nav-time { display: inline-flex; min-width: 0; }
:root[data-cre8-authenticated="false"] .cre8-nav-time { display: none; }
.cre8-nav-time__link { display: inline-flex; align-items: center; gap: 7px; box-sizing: border-box; min-height: 32px; max-width: 240px; padding: 0 11px; border: 1px solid light-dark(rgba(16, 24, 20, 0.14), rgba(255, 255, 255, 0.14)); border-radius: 999px; color: light-dark(#17201d, #e8e8ec); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.cre8-nav-time__link:hover { background: light-dark(rgba(16, 24, 20, 0.06), rgba(255, 255, 255, 0.07)); }
.cre8-nav-time__link:focus-visible, .cre8-nav-attention:focus-visible { outline: 2px solid light-dark(#0f765d, #5fc1a8); outline-offset: 2px; }
.cre8-nav-time__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: light-dark(#a3aba7, #5d6662); }
.cre8-nav-time__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cre8-nav-time__clock { flex: none; font-variant-numeric: tabular-nums; font-weight: 500; color: light-dark(#4f5854, #a8a8b0); }
.cre8-nav-time__clock[hidden] { display: none; }
.cre8-nav-time[data-state="running"] .cre8-nav-time__link { border-color: color-mix(in srgb, #1f9d6c 45%, transparent); background: color-mix(in srgb, #1f9d6c 10%, transparent); }
.cre8-nav-time[data-state="running"] .cre8-nav-time__dot { background: #1f9d6c; }
.cre8-nav-time[data-state="running"] .cre8-nav-time__clock { color: inherit; }
.cre8-nav-time[data-state="paused"] .cre8-nav-time__dot { background: #d09a1f; }
.cre8-nav-time[data-state="draft"] .cre8-nav-time__dot { background: transparent; box-shadow: inset 0 0 0 1.5px light-dark(#7d8682, #8b9490); }
.cre8-nav-time[data-state="unavailable"] .cre8-nav-time__link { opacity: 0.7; }
@keyframes cre8-nav-time-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, #1f9d6c 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }
@media (prefers-reduced-motion: no-preference) {
  .cre8-nav-time[data-state="running"] .cre8-nav-time__dot { animation: cre8-nav-time-pulse 2s ease-out infinite; }
}
/* Time's quick controls: a chevron beside the pill opens a panel showing only
   what the tracker's state allows (Start while idle, Pause while it runs,
   Continue while paused or a draft, Review for any open record). A reader
   the bar cannot track, signed out or with the status unavailable, gets no
   menu at all. */
.cre8-nav-time { position: relative; align-items: center; gap: 2px; }
.cre8-nav-time__menu { display: inline-flex; }
.cre8-nav-time:not([data-state="idle"], [data-state="running"], [data-state="paused"], [data-state="draft"]) .cre8-nav-time__menu { display: none; }
.cre8-nav-time__toggle { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 24px; height: 32px; border-radius: 8px; color: light-dark(#4f5854, #a8a8b0); cursor: pointer; list-style: none; }
.cre8-nav-time__toggle::-webkit-details-marker { display: none; }
.cre8-nav-time__toggle::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.cre8-nav-time__menu[open] > .cre8-nav-time__toggle::before { transform: translateY(2px) rotate(-135deg); }
.cre8-nav-time__toggle:hover, .cre8-nav-time__menu[open] > .cre8-nav-time__toggle { background: light-dark(rgba(16, 24, 20, 0.06), rgba(255, 255, 255, 0.07)); color: light-dark(#17201d, #e8e8ec); }
.cre8-nav-time__toggle:focus-visible { outline: 2px solid light-dark(#0f765d, #5fc1a8); outline-offset: 2px; }
.cre8-nav-time__panel { position: absolute; top: calc(100% + 6px); right: 0; z-index: 2; display: grid; gap: 10px; box-sizing: border-box; width: min(280px, calc(100vw - 32px)); padding: 12px; border: 1px solid light-dark(rgba(16, 24, 20, 0.14), rgba(255, 255, 255, 0.14)); border-radius: 12px; background: light-dark(#ffffff, #1d2026); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18); color: light-dark(#17201d, #e8e8ec); font-size: 13px; white-space: normal; }
.cre8-nav-time__start { display: grid; gap: 8px; margin: 0; }
.cre8-nav-time__field { display: grid; gap: 5px; font-weight: 600; }
.cre8-nav-time__field input { box-sizing: border-box; width: 100%; min-height: 34px; padding: 0 10px; border: 1px solid light-dark(rgba(16, 24, 20, 0.2), rgba(255, 255, 255, 0.2)); border-radius: 8px; background: transparent; color: inherit; font: inherit; font-weight: 400; }
.cre8-nav-time__field input:focus-visible, .cre8-nav-time__button:focus-visible, .cre8-nav-time__panel a:focus-visible { outline: 2px solid light-dark(#0f765d, #5fc1a8); outline-offset: 2px; }
.cre8-nav-time__button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: light-dark(#0f765d, #5fc1a8); color: light-dark(#ffffff, #0b1512); font: inherit; font-weight: 600; cursor: pointer; }
.cre8-nav-time__button:disabled { opacity: 0.6; cursor: progress; }
.cre8-nav-time__review { color: light-dark(#0f765d, #5fc1a8); font-weight: 600; text-decoration: none; }
.cre8-nav-time__open { color: light-dark(#4f5854, #a8a8b0); text-decoration: none; }
.cre8-nav-time__review:hover, .cre8-nav-time__open:hover { text-decoration: underline; }
.cre8-nav-time__message { margin: 0; color: light-dark(#a1361c, #f0937a); }
.cre8-nav-time__message:empty { display: none; }
.cre8-nav-time:not([data-state="idle"]) .cre8-nav-time__start,
.cre8-nav-time:not([data-state="running"]) [data-cre8-time-action="pause"],
.cre8-nav-time:not([data-state="paused"], [data-state="draft"]) [data-cre8-time-action="continue"],
.cre8-nav-time[data-state="idle"] .cre8-nav-time__review { display: none; }
/* Attention: the time this page has held the reader, the footer's counter in
   the bar, and the thread count once there is more than one. */
.cre8-nav-attention { display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; min-height: 32px; padding: 0 10px; border-radius: 999px; color: light-dark(#4f5854, #a8a8b0); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none; white-space: nowrap; }
.cre8-nav-attention:hover { background: light-dark(rgba(16, 24, 20, 0.06), rgba(255, 255, 255, 0.07)); color: light-dark(#17201d, #e8e8ec); }
.cre8-nav-attention__mark { flex: none; box-sizing: border-box; width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 50%; background: radial-gradient(circle, currentColor 0 1.5px, transparent 2px); }
.cre8-nav-attention__threads { font-weight: 500; }
.cre8-nav-attention__threads::before { content: "\00B7"; margin-right: 6px; opacity: 0.6; }
.cre8-nav-attention__threads:empty { display: none; }
/* Where the bar is tight, a long work name gives way first, and the main-app
   links scroll in their own row rather than running under search. */
.primitive-app-shell > .primitive-nav .primitive-nav__left > .primitive-nav__items { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.primitive-app-shell > .primitive-nav .primitive-nav__left > .primitive-nav__items > .primitive-nav__item { flex: none; }
/* A section's own link row inside the page scrolls in place too, so a long row
   never widens the page on a phone. */
.primitive-app-shell__content .primitive-nav .primitive-nav__left > .primitive-nav__items { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.primitive-app-shell__content .primitive-nav .primitive-nav__left > .primitive-nav__items > .primitive-nav__item { flex: none; }
@media (max-width: 1100px) {
  .cre8-nav-time__link { max-width: 140px; }
}
/* Below 760px the phone dock carries the main apps and Settings, so the bar
   drops its copies; Time keeps only its dot, clock and controls, and only
   while there is work open. */
@media (max-width: 760px) {
  :root:not([data-cre8-dock="hide"]) .primitive-app-shell:has(.cre8-mobile-dock) > .primitive-nav .primitive-nav__items,
  :root:not([data-cre8-dock="hide"]) .primitive-nav .cre8-settings-link { display: none; }
  .cre8-nav-time:not([data-state="running"], [data-state="paused"]) { display: none; }
  .cre8-nav-time__text, .cre8-nav-attention__threads { display: none; }
  .cre8-nav-time__link { gap: 6px; padding: 0 9px; }
  .cre8-nav-attention { padding: 0 6px; }
}
.primitive-footer a.primitive-footer__item-value { color: inherit; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.primitive-footer a.primitive-footer__item-value:hover { color: light-dark(#0f765d, #5fc1a8); text-decoration-color: currentColor; }
.primitive-footer-attention__viewers::before { content: "\00B7"; margin: 0 6px; opacity: 0.6; }

/* Collections: the find row and pagination. */
/* One row: the search box, Search, then the quieter Filters and Clear, all one height. */
.primitive-form#collection-filters > .primitive-form__actions > .primitive-button,
.primitive-form#collection-filters > .collection-filters__toggle-label,
.primitive-form#collection-filters > a.primitive-action { display: inline-flex; align-items: center; box-sizing: border-box; height: 40px; min-height: 40px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.primitive-form#collection-filters > .primitive-form__fields input[type=text] { box-sizing: border-box; height: 40px; min-height: 40px; }
/* Collapsed, the row is one search box beside a button that says Search, so the box needs no visible label. */

.primitive-form#collection-filters > a.primitive-action { border-color: transparent; background: none; color: light-dark(#6c7572, #8e9591); }
.primitive-form#collection-filters > a.primitive-action:hover { color: light-dark(#101916, #f2f4f3); }
/* Pagination: the count on the left, the page links on the right, a rule above. */
.primitive-row--collection-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 4px; padding-top: 14px; border-top: 1px solid light-dark(#e3e7e0, #2a2c33); }
.primitive-row--collection-pagination > .primitive-text { margin-inline-end: auto; color: light-dark(#6c7572, #8e9591); font-size: 13px; font-variant-numeric: tabular-nums; }
.primitive-row--collection-pagination > a.primitive-action { min-height: 36px; padding: 0 14px; border-radius: 8px; font-size: 13px; }
/* A list's collection block (ListPageBuilder): its toolbar (the list's title beside the find controls) and its pagination span the content area as the hero does, while the items stay in the column. Each bleeds from the block, which sits in the column. */
.primitive-section--collection { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.primitive-row--collection-toolbar,
.primitive-section--collection > .primitive-row--collection-pagination { --cre8-band-bleed-x: max(var(--cre8-shell-half) - 50%, 0px); margin-inline: calc(-1 * var(--cre8-band-bleed-x)); padding-inline: var(--cre8-band-bleed-x); }
.primitive-row--collection-toolbar { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); align-items: start; gap: 12px 32px; padding-block: 14px 16px; border-block: 1px solid light-dark(#e3e7e0, #2a2c33); background: light-dark(#fbfcfb, #101216); }
/* Under the hero or the masthead the toolbar continues that header, with no gap and no second rule. */
:is(.primitive-section--app-hero, .primitive-section--app-masthead) + .primitive-section--collection { margin-top: -18px; }
:is(.primitive-section--app-hero, .primitive-section--app-masthead) + .primitive-section--collection > .primitive-row--collection-toolbar { border-top: 0; }
.primitive-section--app-hero + .primitive-section--collection { margin-top: -22px; }
/* The title sits level with the first row of inputs, below their labels. */
.primitive-row--collection-toolbar > .primitive-text[data-variant="h2"] { margin: 0; padding-top: 28px; font-size: 15px; font-weight: 700; letter-spacing: -0.005em; line-height: 1.3; }
.primitive-row--collection-toolbar > .primitive-form#collection-filters { grid-column: -2; align-items: flex-end; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.primitive-row--collection-toolbar > .primitive-form#collection-filters:only-child { grid-column: 1 / -1; }
.primitive-row--collection-toolbar > .primitive-form#collection-filters > .primitive-form__fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.primitive-row--collection-toolbar > .primitive-form#collection-filters > .primitive-form__fields > .primitive-field { flex: 0 1 11rem; min-width: 8rem; gap: 4px; }
.primitive-row--collection-toolbar > .primitive-form#collection-filters > .primitive-form__fields > .primitive-field:has([name="q"]) { flex: 1 1 16rem; max-width: 26rem; }
.primitive-row--collection-toolbar .primitive-field__label { color: light-dark(#6c7572, #8e9591); font-size: 11px; font-weight: 650; letter-spacing: 0.02em; }
.primitive-row--collection-toolbar .primitive-form__result:empty { display: none; }
.primitive-section--collection > .primitive-row--collection-pagination { margin-top: 0; }
/* A page's own tabs (a Tabs widget the page holds directly) read like the app's tab bar: an underline strip across the content area under the hero, and panels with no frame around them. */
.primitive-page > .primitive-tabs { overflow: visible; border: 0; border-radius: 0; background: none; }
.primitive-page > .primitive-tabs > .primitive-tabs-strip { --cre8-band-bleed-x: max(var(--cre8-shell-half) - 50%, 0px); flex-wrap: nowrap; gap: 2px; margin-inline: calc(-1 * var(--cre8-band-bleed-x)); padding: 0 var(--cre8-band-bleed-x) 3px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--cre8-view-accent) transparent; background: light-dark(#fbfcfb, #101216); }
.primitive-page > .primitive-tabs > .primitive-tabs-strip::-webkit-scrollbar { height: 3px; }
.primitive-page > .primitive-tabs > .primitive-tabs-strip::-webkit-scrollbar-thumb { background: var(--cre8-view-accent); border-radius: 3px; }
.primitive-page > .primitive-tabs > .primitive-tabs-strip > .primitive-tabs-button { flex: 0 0 auto; min-height: 44px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: light-dark(#4e5754, #a9b0ac); font-size: 14px; font-weight: 600; white-space: nowrap; }
.primitive-page > .primitive-tabs > .primitive-tabs-strip > .primitive-tabs-button:hover { background: none; color: light-dark(#101916, #f2f4f3); }
.primitive-page > .primitive-tabs > .primitive-tabs-strip > :is(.primitive-tabs-button--active, .primitive-tabs-button[aria-selected="true"]) { border-bottom-color: var(--cre8-view-accent); background: none; box-shadow: none; color: light-dark(#101916, #f2f4f3); }
.primitive-page > .primitive-tabs > .primitive-tabs-panels { padding: 18px 0 0; }
.primitive-section--app-hero + .primitive-tabs { margin-top: -22px; }
/* A table alone in such a tab is that tab's content, not a card inside it: no frame, its rules running edge to edge, its cells in the column. */
.primitive-page > .primitive-tabs > .primitive-tabs-panels > .primitive-tab > .primitive-table:only-child { --cre8-band-bleed-x: max(var(--cre8-shell-half) - 50%, 0px); margin-inline: calc(-1 * var(--cre8-band-bleed-x)); padding-inline: var(--cre8-band-bleed-x); border-inline: 0; border-top: 0; border-radius: 0; background: none; box-shadow: none; }
.primitive-page > .primitive-tabs > .primitive-tabs-panels > .primitive-tab:has(> .primitive-table:only-child) { margin-top: -18px; }
@media (max-width: 720px) {
  .primitive-row--collection-toolbar { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .primitive-row--collection-toolbar > .primitive-text[data-variant="h2"] { padding-top: 0; }
  .primitive-row--collection-toolbar > .primitive-form#collection-filters { grid-column: 1; }
}

/* Cards that are links. */
/* A card that is a link reads as a card, not as one long link: only its title takes the link colour. */
a.primitive-card__link { color: inherit; font-weight: inherit; }
a.primitive-card__link .primitive-card__title,
.primitive-card--stretched .primitive-card__title { color: light-dark(#0f765d, #5fc1a8); }
a.primitive-card__link .primitive-card__body .primitive-text { color: light-dark(#3c4542, #c3c9c6); font-weight: 400; font-size: 14px; line-height: 1.5; }

/* Records that own a page: a value naming one links to it. */
a.primitive-record-link { color: inherit; text-decoration: underline; text-decoration-color: light-dark(#0f765d, #5fc1a8); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a.primitive-record-link:hover, a.primitive-record-link:focus-visible { color: light-dark(#0f765d, #5fc1a8); }

/* "On this page": jump links to a long page's sections. One row that scrolls
   sideways; a jump scrolls smoothly unless the reader asked for less motion. */
html:has(.cre8-page-index) { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html:has(.cre8-page-index) { scroll-behavior: auto; } }
:root[data-cre8-motion="reduced"]:has(.cre8-page-index) { scroll-behavior: auto; }
.cre8-page-index { display: flex; flex-wrap: nowrap; gap: 2px; padding: 6px; overflow-x: auto; scrollbar-width: none; border: 1px solid light-dark(#d9dedb, #2c3331); border-radius: 10px; background: light-dark(#f6f8f7, #171b1a); }
.cre8-page-index::-webkit-scrollbar { display: none; }
.cre8-page-index > a.primitive-action { flex: none; min-height: 28px; padding: 4px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.cre8-page-index > a.primitive-action:is(:hover, :focus-visible) { color: light-dark(#0f765d, #5fc1a8); }
:is(.primitive-card, .primitive-section):target { outline: 2px solid light-dark(#0f765d, #5fc1a8); outline-offset: 4px; border-radius: 10px; }


.app-group-nav{gap:4px;align-items:stretch}
.app-group-nav summary{display:flex;align-items:center;gap:8px;min-height:40px;border-radius:5px;color:var(--cre8-view-fg-muted);font-weight:600}
.app-group-nav summary::-webkit-details-marker{display:none}
.app-group-nav summary::after{content:'';flex:none;width:5px;height:5px;border-right:1.5px solid var(--cre8-view-fg-muted);border-bottom:1.5px solid var(--cre8-view-fg-muted);transform:translateY(-2px) rotate(45deg)}
.app-group-nav details[open]>summary::after{transform:translateY(1px) rotate(225deg)}
.app-group-nav .app-group-current>summary{border-color:transparent;border-bottom:2px solid var(--cre8-view-accent);border-radius:0;color:var(--cre8-view-fg)}
.app-group-nav details[open]>summary,.app-group-nav summary:hover{background:var(--cre8-view-surface)}
.app-group-nav details>div{min-width:190px;max-width:min(320px,calc(100vw - 32px));background:light-dark(#fff,#1a1f25);border-color:var(--cre8-view-border-strong);padding:4px}
.app-group-nav a{font-size:13px;font-weight:500;line-height:1.5;border-radius:4px;white-space:normal;overflow-wrap:anywhere}
.app-group-nav a:hover,.app-group-nav a[aria-current=page]{background:var(--cre8-view-chip-bg);color:var(--cre8-view-fg)}
/* The current group keeps its place among the groups, underlined like a tab, and its pages are a tab row across the bottom of the nav: the app's tabs in one row, the group's pages in the next, never the same set twice. The nav reserves that row's height so the row can scroll sideways instead of wrapping. */
.app-group-nav{flex:1 1 auto;min-width:0}
.app-group-nav:has(>.app-group-current[open]){padding-bottom:45px}
.app-group-nav .app-group-current{position:static}
.app-group-nav .app-group-current>summary{pointer-events:none;cursor:default}
.app-group-nav .app-group-current>summary::after{display:none}
.app-group-nav .app-group-current>div{position:absolute;top:auto;left:0;right:0;bottom:0;z-index:auto;display:flex;flex-wrap:nowrap;gap:2px;min-width:0;max-width:none;padding:0 0 1px;overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--cre8-view-accent) transparent;border:0;border-top:1px solid var(--cre8-view-border);border-radius:0;background:transparent;box-shadow:none}
.app-group-nav .app-group-current a{flex:none;display:inline-flex;align-items:center;min-height:43px;padding:0 12px;border-bottom:2px solid transparent;border-radius:0;background:none;color:var(--cre8-view-fg-muted);font-size:14px;font-weight:600;white-space:nowrap}
.app-group-nav .app-group-current a:hover{background:none;color:var(--cre8-view-fg)}
.app-group-nav .app-group-current a[aria-current=page]{border-bottom-color:var(--cre8-view-accent);background:none;color:var(--cre8-view-fg)}
/* On a phone another group's menu opens under the whole nav at its full width, over the page, instead of splitting the groups' row. */
@media(max-width:600px){.app-group-nav details{position:static}.app-group-nav details:not(.app-group-current)>div{position:absolute;top:100%;left:0;right:0;max-width:none}}
.app-group-nav details:not([open])>div{display:none}


.primitive-section--app-surface>.primitive-page>.primitive-section--app-hero:first-child,
.primitive-section--app-surface>.primitive-section--farm-crop-list>.primitive-page>.primitive-section--app-hero:first-child{margin-inline:calc(-1 * var(--cre8-app-bleed-x));padding-inline:var(--cre8-app-bleed-x)}


/* Full app workspaces own their inner spacing. */
.primitive-section--app-surface:has(.location-workspace, .voetr, .sale-prospects, .drone-workspace) { padding:0; max-width:none; }
.primitive-app-shell__content:has(.location-workspace, .voetr, .sale-prospects, .drone-workspace) { --cre8-app-content-gutter:0px; --cre8-app-surface-gutter:0px; --cre8-shell-pad-x:0px; padding:0; }
/* Editors fill the content pane; the shared rail keeps its normal responsive behavior. */
.primitive-app-shell__content:has(.vcomp-mount, [data-editor-workspace]) { --cre8-app-content-gutter:0px; --cre8-app-surface-gutter:0px; --cre8-shell-pad-x:0px; padding:0; scrollbar-gutter:auto; }
.primitive-app-shell__content:has(.vcomp-mount, [data-editor-workspace]) > .primitive-footer { display:none; }
.primitive-section--app-surface:has(.vcomp-mount, [data-editor-workspace]) { --cre8-app-surface-pad:0px; width:100%; max-width:none; margin:0; padding:0; }

/* A collection's find form (`CollectionQuery::form`, `collection::filters_form`): one row holding the
   search box, Search, a Filters button with the count of set filters, a chip
   per set filter and Clear; every other field sits in a drawer the Filters
   button opens. The drawer is a native popover inside the form, so Escape and
   a click outside close it and focus returns to the button. */
/* An owner's own filter form (`collection::filters_form`) carries another id, so the row's
   layout is stated here for every such form. `:is(#collection-filters, *)` matches any of
   them and weighs as an id, which lets these rules follow the older `#collection-filters`
   ones in `app_structure.css`. */
.primitive-form[data-find-drawer] { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.primitive-form[data-find-drawer] > .primitive-form__header { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.primitive-form[data-find-drawer] > .primitive-form__actions { flex: 0 0 auto; }
.primitive-form[data-find-drawer] > .primitive-form__actions > .primitive-button,
.primitive-form[data-find-drawer] > a.primitive-action { display: inline-flex; align-items: center; box-sizing: border-box; height: 40px; min-height: 40px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.primitive-form[data-find-drawer] > a.primitive-action { order: 2; border-color: transparent; background: none; color: light-dark(#6c7572, #8e9591); }
.primitive-form[data-find-drawer] > a.primitive-action:hover { color: light-dark(#101916, #f2f4f3); }
/* A form with no search box has only hidden scope in its fields slot. */
.primitive-form[data-find-drawer]:is(#collection-filters, *) > .primitive-form__fields:not(:has(.primitive-field)) { display: none; }
.primitive-row--collection-toolbar > .primitive-form[data-find-drawer] { grid-column: -2; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.primitive-row--collection-toolbar > .primitive-form[data-find-drawer]:only-child { grid-column: 1 / -1; }
@media (max-width: 720px) { .primitive-row--collection-toolbar > .primitive-form[data-find-drawer] { grid-column: 1; } }
.primitive-form[data-find-drawer]:is(#collection-filters, *) { align-items: center; }
.primitive-form[data-find-drawer]:is(#collection-filters, *) > .primitive-form__fields { display: flex; flex: 1 1 6rem; max-width: 26rem; min-height: 0; }
.primitive-row--collection-toolbar > .primitive-form[data-find-drawer]:is(#collection-filters, *) { align-items: center; }
.primitive-form[data-find-drawer]:is(#collection-filters, *) > .primitive-form__fields > .primitive-field:has([name="q"]),
.primitive-row--collection-toolbar > .primitive-form[data-find-drawer]:is(#collection-filters, *) > .primitive-form__fields > .primitive-field:has([name="q"]) { flex: 1 1 auto; max-width: none; min-width: 0; }
/* The box sits beside a button that says Search and carries a placeholder, so its label is for assistive technology only. */
.primitive-form[data-find-drawer]:is(#collection-filters, *) > .primitive-form__fields > .primitive-field:has([name="q"]) > .primitive-field__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.primitive-form[data-find-drawer]:is(#collection-filters, *) > .primitive-form__fields input[name="q"] { box-sizing: border-box; height: 40px; min-height: 40px; }
/* With no labels above the inputs, the list's title centres on the row. */
.primitive-row--collection-toolbar:has(.collection-filters__open) { align-items: center; }
.primitive-row--collection-toolbar:has(.collection-filters__open) > .primitive-text[data-variant="h2"] { padding-top: 0; }

.primitive-form[data-find-drawer]:is(#collection-filters, *) > .collection-filters__open { display: inline-flex; align-items: center; gap: 8px; box-sizing: border-box; height: 40px; min-height: 40px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.collection-filters__open:focus-visible, .collection-filters__close:focus-visible, .collection-filters__chip:focus-visible { outline: 2px solid light-dark(#0f765d, #5fc1a8); outline-offset: 2px; }
.collection-filters__count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: 10px; background: var(--cre8-view-accent); color: light-dark(#fff, #08130d); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }

/* A chip names one set filter; following it drops that filter alone. */
.primitive-form[data-find-drawer]:is(#collection-filters, *) > a.collection-filters__chip { order: 2; height: 28px; min-height: 28px; padding: 0 10px; border: 1px solid light-dark(#cdd3cb, #3c434b); border-radius: 14px; background: light-dark(#f1f4ef, #22262b); color: inherit; font-size: 13px; font-weight: 550; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.primitive-form[data-find-drawer]:is(#collection-filters, *) > a.collection-filters__chip::after { content: "\00D7"; margin-inline-start: 2px; font-size: 15px; line-height: 1; opacity: 0.65; }
.primitive-form[data-find-drawer]:is(#collection-filters, *) > a.collection-filters__chip:hover { border-color: light-dark(#9aa39c, #5a626b); background: light-dark(#e3eee7, #2b3b35); }
.primitive-form[data-find-drawer]:is(#collection-filters, *) > a.collection-filters__chip:hover::after { opacity: 1; }

/* The drawer keeps the account drawer's place, size and close corner. */
.collection-filters__drawer { position: fixed; inset: 0 0 0 auto; box-sizing: border-box; width: min(380px, 92vw); height: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 24px; border: 0; border-left: 1px solid light-dark(#e3e7e0, #2a2c33); background: light-dark(#fff, #16181d); color: light-dark(#17201d, #e8e8ec); box-shadow: -12px 0 40px #0002; overflow-y: auto; flex-direction: column; gap: 20px; }
.collection-filters__drawer:popover-open { display: flex; }
.collection-filters__drawer::backdrop { background: #0f161366; opacity: 1; transition: opacity var(--cre8-motion-base) ease, display var(--cre8-motion-base) allow-discrete, overlay var(--cre8-motion-base) allow-discrete; }
.collection-filters__drawer:not(:popover-open)::backdrop { opacity: 0; }
/* It slides in from the edge it rests against instead of rising (`motion.css`). */
.collection-filters__drawer { transition: translate var(--cre8-motion-slide) var(--cre8-ease-slide), display var(--cre8-motion-slide) allow-discrete, overlay var(--cre8-motion-slide) allow-discrete; }
.collection-filters__drawer:not(:popover-open) { opacity: 1; translate: 100% 0; }
@starting-style {
  .collection-filters__drawer:popover-open { opacity: 1; translate: 100% 0; }
  .collection-filters__drawer:popover-open::backdrop { opacity: 0; }
}
.collection-filters__drawer-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.collection-filters__drawer-title { margin: 0; font-size: 20px; font-weight: 700; }
.collection-filters__close { padding: 8px 12px; border: 1px solid light-dark(#cdd3cb, #3c434b); border-radius: 8px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.collection-filters__drawer-fields { display: grid; gap: 14px; }
.collection-filters__drawer-fields :is(input:not([type="checkbox"]), select) { box-sizing: border-box; min-height: 40px; }
.collection-filters__drawer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: auto; padding-top: 16px; border-top: 1px solid light-dark(#e3e7e0, #2a2c33); }
.collection-filters__drawer-actions > .primitive-button { height: 40px; min-height: 40px; padding: 0 18px; border-radius: 8px; font-size: 14px; }

/* Without popovers the drawer is plain fields under the row, and nothing needs opening or closing. */
@supports not selector(:popover-open) {
  .collection-filters__open, .collection-filters__close, .collection-filters__drawer-title { display: none; }
  .collection-filters__drawer { position: static; display: flex; flex: 1 0 100%; order: 3; width: auto; height: auto; padding: 0; border: 0; background: none; box-shadow: none; translate: none; }
  .collection-filters__drawer-fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
  .collection-filters__drawer-actions { margin-top: 0; padding-top: 0; border-top: 0; }
}

:root[data-cre8-theme="light"] { color-scheme: light; }
:root[data-cre8-theme="dark"] { color-scheme: dark; }
:root[data-cre8-accent="blue"] { --cre8-view-accent: light-dark(#185ac4,#8ab4ff); }
:root[data-cre8-accent="violet"] { --cre8-view-accent: light-dark(#7141b9,#c1a0ff); }
:root[data-cre8-density="compact"] { --cre8-page-gutter-x: 16px; --cre8-page-gutter-y: 12px; }
:root[data-cre8-contrast="high"] { --cre8-view-fg-muted: light-dark(#344039,#d7e0eb); --cre8-view-border: light-dark(#68746c,#a4b0be); --cre8-view-border-strong: light-dark(#46534b,#ccd5df); }
:root[data-cre8-motion="reduced"] *, :root[data-cre8-motion="reduced"] *::before, :root[data-cre8-motion="reduced"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
/* "system" is the default, so a page the preference script never touched (no
   attribute, JS off) follows the device setting too. */
@media (prefers-reduced-motion: reduce) { :root:is([data-cre8-motion="system"], :not([data-cre8-motion])) *, :root:is([data-cre8-motion="system"], :not([data-cre8-motion])) *::before, :root:is([data-cre8-motion="system"], :not([data-cre8-motion])) *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
/* A page transition draws on the root's pseudo-elements, which `*` never reaches. */
:root[data-cre8-motion="reduced"]::view-transition-group(*), :root[data-cre8-motion="reduced"]::view-transition-old(*), :root[data-cre8-motion="reduced"]::view-transition-new(*) { animation: none !important; }
@media (prefers-reduced-motion: reduce) { :root:is([data-cre8-motion="system"], :not([data-cre8-motion]))::view-transition-group(*), :root:is([data-cre8-motion="system"], :not([data-cre8-motion]))::view-transition-old(*), :root:is([data-cre8-motion="system"], :not([data-cre8-motion]))::view-transition-new(*) { animation: none !important; } }
/* The app surface owns the column width and gutters; settings only spaces its sections. */
.cre8-settings { display: grid; gap: 20px; width: 100%; min-width: 0; max-width: none; margin: 0; color: var(--cre8-view-fg); }
.cre8-settings h1 { font-size: clamp(2rem,5vw,3.4rem); letter-spacing: -.045em; margin: 12px 0; }
.cre8-settings p { line-height: 1.65; color: var(--cre8-view-fg-muted); }
.cre8-settings section, .cre8-settings details { border: 1px solid var(--cre8-view-border); border-radius: 18px; padding: 24px; margin: 24px 0; background: var(--cre8-view-surface); }
.cre8-settings > section { min-width: 0; margin: 0; padding: 20px; border-radius: 10px; }
.cre8-settings > section > h2 { margin: 0 0 12px; }
.cre8-settings-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),1fr)); gap: 20px; }
.cre8-settings label { display: grid; gap: 9px; font-weight: 600; }
.cre8-settings select, .cre8-settings input, .cre8-settings button { font: inherit; min-height: 44px; padding: 10px 14px; border: 1px solid var(--cre8-view-border-strong); border-radius: 10px; background: var(--cre8-view-surface-alt); color: var(--cre8-view-fg); }
.cre8-settings button[type=submit] { background: var(--cre8-view-accent); color: light-dark(#fff,#101b16); }
.cre8-settings-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 24px; }
/* Plain action buttons carry no primitive-* class, so dim them here: Save and Reset stay disabled until the owner authorizes the caller. */
.cre8-settings-actions button:disabled { opacity: 0.55; cursor: not-allowed; }
.cre8-settings a, .cre8-settings summary { color: var(--cre8-view-accent); }
.cre8-settings a { display: inline-block; padding: 10px 0; }
.cre8-settings-apps { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 4px 20px; max-height: min(540px,60vh); overflow: auto; padding-right: 8px; scrollbar-gutter: stable; }
.cre8-settings :focus-visible, .cre8-mobile-dock a:focus-visible { outline: 2px solid var(--cre8-view-accent); outline-offset: 4px; }
.cre8-mobile-dock { display: none; }
.primitive-section--runtime-footer { display: contents; }
.cre8-settings-link { color: var(--cre8-view-accent); padding: 10px; text-decoration: none; }
.primitive-nav__item--active .primitive-nav__link { background: var(--cre8-view-accent); color: light-dark(#fff,#101b16); }
@media (max-width: 760px) {
  :root:not([data-cre8-dock="hide"]) .cre8-mobile-dock { display: flex; justify-content: space-around; flex: none; gap: 4px; padding: 6px 8px max(6px,env(safe-area-inset-bottom)); border-top: 1px solid var(--cre8-view-border-strong); background: light-dark(#fff,#14161a); }
  .cre8-mobile-dock a { display: grid; place-items: center; gap: 2px; min-width: 44px; min-height: 48px; padding: 2px 6px; color: var(--cre8-view-fg-muted); text-decoration: none; font-size: 11px; }
  .cre8-mobile-dock a span { font-size: 20px; }
  .cre8-mobile-dock a[aria-current=page] { color: var(--cre8-view-accent); background: var(--cre8-view-chip-bg); border-radius: 10px; }
  .primitive-app-shell { height: 100dvh; min-height: 100dvh; }
  .cre8-settings section { padding: 18px; }
}

.cre8-settings input { width: 100%; min-width: 0; box-sizing: border-box; }
.cre8-settings-grid > label { min-width: 0; }
.cre8-settings label small { font-weight: 400; color: var(--cre8-view-fg-muted); line-height: 1.5; }

.cre8-settings [hidden] { display: none !important; }

/* Sidebar-apps fieldset: checkboxes, not the 44px selects the grid above styles. */
.cre8-settings fieldset { border: 0; padding: 0; margin: 28px 0 0; min-width: 0; }
.cre8-settings legend { font-size: 1.15rem; font-weight: 700; padding: 0; margin-bottom: 4px; }
.cre8-settings-check-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 12px 0 16px; }
.cre8-settings-check-tools .cre8-settings-search { flex: 1 1 240px; }
.cre8-settings-checks { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 6px 20px; max-height: min(420px,50vh); overflow: auto; padding-right: 8px; scrollbar-gutter: stable; }
.cre8-settings-checks label { display: flex; align-items: center; gap: 10px; font-weight: 500; min-height: 36px; cursor: pointer; }
.cre8-settings-checks input[type=checkbox] { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; flex: none; accent-color: var(--cre8-view-accent); }
/* Settings speaks the shared design language: sections are reached by chips,
   an app is a card, and a way to another page is an outlined action. No bare
   underlined links. */
.cre8-settings-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.cre8-settings-nav a, .cre8-settings a.cre8-settings-action, .cre8-settings a.cre8-settings-back {
  display: inline-flex; align-items: center; padding: 7px 14px; border: 1px solid var(--cre8-view-border);
  border-radius: 999px; background: var(--cre8-view-surface); color: var(--cre8-view-fg-muted);
  font-size: 13px; font-weight: 650; text-decoration: none;
}
.cre8-settings-nav a:hover, .cre8-settings a.cre8-settings-action:hover, .cre8-settings a.cre8-settings-back:hover {
  border-color: var(--cre8-view-accent); color: var(--cre8-view-fg);
}
.cre8-settings-nav a { box-sizing: border-box; min-height: 44px; }
.cre8-settings a.cre8-settings-back { border-color: transparent; background: transparent; padding-left: 0; }
.cre8-settings-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.cre8-settings-apps { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 14px; }
.cre8-settings a.cre8-settings-app {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--cre8-view-border);
  border-radius: 12px; background: var(--cre8-view-surface-alt); color: var(--cre8-view-fg);
  font-size: 14px; font-weight: 650; text-decoration: none; min-width: 0; overflow-wrap: anywhere;
}
.cre8-settings a.cre8-settings-app:hover { border-color: var(--cre8-view-accent); }
.cre8-settings a.cre8-settings-app > span {
  display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 9px;
  background: color-mix(in srgb, var(--cre8-view-accent) 16%, transparent); color: var(--cre8-view-accent);
  font-size: 12px; font-weight: 800; letter-spacing: 0.04em;
}

/* The runtime sidebar's first minute: a filter over the app list, the Pinned and
   Recent sections the preferences binder fills (served empty, so hidden until
   they hold something, and out of the way while filtering), letter headings,
   and a pin on each app group. The collapsed rail keeps none of the text. */
.primitive-sidebar__filter { display: block; width: 100%; min-width: 0; box-sizing: border-box; margin: 0 0 6px; padding: 6px 10px; font: inherit; font-size: 13px; border: 1px solid var(--cre8-view-border); border-radius: 8px; background: var(--cre8-view-surface-alt); color: var(--cre8-view-fg); }
.primitive-sidebar__filter:focus-visible { outline: 2px solid var(--cre8-view-accent); outline-offset: 1px; }
.primitive-sidebar[data-collapsed="true"] .primitive-sidebar__filter { display: none; }
.primitive-sidebar__group:is([data-cre8-sidebar-section="pinned"], [data-cre8-sidebar-section="recent"]):not([data-cre8-filled="true"]) { display: none; }
.primitive-sidebar[data-cre8-sidebar-filtering="true"] .primitive-sidebar__group:is([data-cre8-sidebar-section="pinned"], [data-cre8-sidebar-section="recent"]) { display: none; }
.primitive-sidebar__group[data-cre8-filtered="true"], .primitive-sidebar__item[hidden] { display: none; }
.primitive-sidebar__group[data-cre8-sidebar-section="band"] { padding: 10px 0 0; }
.primitive-sidebar__group[data-cre8-sidebar-section="band"] .primitive-sidebar__group-label { font-size: 11px; color: var(--cre8-view-fg); border-top: 1px solid var(--cre8-view-border); padding-top: 8px; }
.primitive-sidebar__group-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.primitive-sidebar__group[data-cre8-app] > .primitive-sidebar__group-label { justify-content: flex-start; }
.primitive-sidebar__expand { appearance: none; order: -1; flex: none; width: 18px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--cre8-view-fg-muted); cursor: pointer; }
.primitive-sidebar__expand::before { content: '›'; display: block; font-size: 18px; line-height: 1; transform: rotate(0deg); }
.primitive-sidebar__expand[aria-expanded="true"]::before { transform: rotate(90deg); }
.primitive-sidebar__expand:focus-visible { outline: 2px solid var(--cre8-view-accent); outline-offset: 1px; }
.primitive-sidebar[data-collapsed="false"]:not([data-cre8-sidebar-filtering="true"]) .primitive-sidebar__group[data-cre8-app][data-cre8-sidebar-open="false"] > .primitive-sidebar__item { display: none; }
.primitive-sidebar[data-collapsed="true"] .primitive-sidebar__expand { display: none; }
.primitive-sidebar__pin { appearance: none; flex: none; font: inherit; font-size: 11px; line-height: 1; padding: 2px 4px; border: 0; border-radius: 6px; background: transparent; color: var(--cre8-view-fg-muted); opacity: 0; cursor: pointer; }
.primitive-sidebar__group[data-cre8-app] > .primitive-sidebar__group-label .primitive-sidebar__pin { margin-left: auto; }
.primitive-sidebar__group:hover .primitive-sidebar__pin, .primitive-sidebar__pin:focus-visible, .primitive-sidebar__pin[aria-pressed="true"] { opacity: 1; }
.primitive-sidebar__pin[aria-pressed="true"] { color: var(--cre8-view-accent); }
.primitive-sidebar[data-collapsed="true"] .primitive-sidebar__pin { display: none; }

/* The runtime rail reads as a tree, not a list. The filter stays in reach
   while the list scrolls. The page's own sections and its app ("current")
   sit on cards above everything. Each catalog app is a row with its initials
   on a tile, and its views hang off a guide line. The active view is tinted
   with the accent and marked by a bar, not filled. While filtering, only the
   matches are left. */
.primitive-sidebar[data-cre8-sidebar] { scrollbar-width: thin; scrollbar-color: light-dark(#cfd6cc, #33363d) transparent; }
/* The held filter sits on the rail colour, under its own tint, so the rows that scroll beneath it do not show through. */
.primitive-sidebar[data-cre8-sidebar] .primitive-sidebar__filter { position: sticky; top: 6px; z-index: 1; margin-bottom: 10px; background: linear-gradient(var(--cre8-view-surface-alt), var(--cre8-view-surface-alt)), light-dark(#fbfcfa, #14161a); box-shadow: 0 0 0 6px light-dark(#fbfcfa, #14161a); }
.primitive-sidebar__item--active, .primitive-sidebar__item--active:hover { background: color-mix(in srgb, var(--cre8-view-accent) 14%, transparent); color: var(--cre8-view-accent); font-weight: 650; box-shadow: inset 2px 0 0 var(--cre8-view-accent); }
.primitive-sidebar__item--active .primitive-sidebar__badge { background: var(--cre8-view-accent); color: light-dark(#fff, #101b16); }
.primitive-sidebar__item:focus-visible { outline: 2px solid var(--cre8-view-accent); outline-offset: -2px; }
.primitive-sidebar__group-label[data-cre8-glyph] { font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; color: inherit; padding: 4px 6px; border-radius: 6px; min-height: 30px; box-sizing: border-box; justify-content: flex-start; }
.primitive-sidebar__group-label[data-cre8-glyph]::before { content: attr(data-cre8-glyph); display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 6px; background: color-mix(in srgb, var(--cre8-view-accent) 14%, transparent); color: var(--cre8-view-accent); font-size: 9.5px; font-weight: 800; letter-spacing: 0.02em; }
.primitive-sidebar__group[data-cre8-app] > .primitive-sidebar__group-label { cursor: pointer; }
.primitive-sidebar__group[data-cre8-app] > .primitive-sidebar__group-label:hover { background: light-dark(#eef2ec, #1f2126); }
.primitive-sidebar__group[data-cre8-app] { padding: 1px 0; }
.primitive-sidebar__group[data-cre8-app] > .primitive-sidebar__item { margin-left: 21px; width: calc(100% - 21px); border-radius: 0 6px 6px 0; box-shadow: inset 1px 0 0 var(--cre8-view-border); }
.primitive-sidebar__group[data-cre8-app] > .primitive-sidebar__item--active { box-shadow: inset 2px 0 0 var(--cre8-view-accent); }
.primitive-sidebar__group:is([data-cre8-sidebar-section="current"], [data-cre8-sidebar-section="page"]) { margin: 0 0 8px; padding: 4px; border: 1px solid var(--cre8-view-border); border-radius: 10px; background: light-dark(#fff, #191b20); }
.primitive-sidebar__group[data-cre8-sidebar-section="page"] > .primitive-sidebar__group-label { color: var(--cre8-view-accent); }
.primitive-sidebar__group[data-cre8-sidebar-section="catalog"] { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--cre8-view-border); }
.primitive-sidebar[data-cre8-sidebar-filtering="true"] .primitive-sidebar__group:is([data-cre8-sidebar-section="main"], [data-cre8-sidebar-section="current"], [data-cre8-sidebar-section="page"], [data-cre8-sidebar-section="catalog"]) { display: none; }
/* The main apps (assets/main_apps.json) head the rail with the phone dock's
   icons at every width. Their heading is for screen readers; a rule closes
   the section off from the rest of the list. */
.primitive-sidebar__group[data-cre8-sidebar-section="main"] { margin: 0 0 8px; padding: 0 0 8px; border-bottom: 1px solid var(--cre8-view-border); }
.primitive-sidebar__group[data-cre8-sidebar-section="main"] > .primitive-sidebar__group-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.primitive-sidebar__item-glyph[data-icon] { display: inline-flex; font-size: 15px; font-weight: 400; text-transform: none; color: var(--cre8-view-fg-muted); }
.primitive-sidebar__item--active .primitive-sidebar__item-glyph[data-icon] { color: inherit; }
.primitive-sidebar[data-collapsed="true"] .primitive-sidebar__group:is([data-cre8-sidebar-section="current"], [data-cre8-sidebar-section="page"]) { padding: 2px; border-radius: 8px; }
.primitive-sidebar[data-collapsed="true"] .primitive-sidebar__group[data-cre8-sidebar-section="catalog"] { padding-top: 4px; }
.primitive-sidebar[data-collapsed="true"] .primitive-sidebar__group[data-cre8-app] > .primitive-sidebar__item { margin-left: 0; width: 100%; border-radius: 6px; box-shadow: none; }
/* The narrow rail has no room for a badge's text beside the glyph, so the badge is a dot; the title still names the link. */
.primitive-sidebar[data-collapsed="true"] .primitive-sidebar__badge { top: 1px; right: 1px; min-width: 8px; width: 8px; height: 8px; padding: 0; font-size: 0; box-shadow: 0 0 0 2px light-dark(#fbfcfa, #14161a); }
@media (prefers-reduced-motion: no-preference) {
  .primitive-sidebar__expand::before { transition: transform 120ms ease; }
}

/* Home's first minute: the three starting actions in one row, and the recents
   row the binder fills from the sidebar (hidden until it holds a chip). */
.primitive-row--home-start { gap: 12px; margin: 4px 0 12px; }
.primitive-section--home-recents:not([data-cre8-filled="true"]) { display: none; }
.primitive-section--home-recents { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.primitive-section--home-recents > .primitive-section__header { flex: 1 1 100%; margin: 0; }
.primitive-section--home-recents .primitive-section__title { font-size: 1rem; margin: 0; }
a.cre8-home-recent { display: inline-flex; align-items: center; padding: 7px 14px; border: 1px solid var(--cre8-view-border); border-radius: 999px; background: var(--cre8-view-surface); color: var(--cre8-view-fg); font-size: 13px; font-weight: 650; text-decoration: none; }
a.cre8-home-recent:hover { border-color: var(--cre8-view-accent); }

/* Chart colour tokens.
   Every SSR chart builder (live_chart.rs, price_chart.rs, the grammar
   Chart/Sparkline in render_html) and the chart scripts reference these names
   as `var(--cre8-chart-*, #fallback)` / `var(--cre8-ribbon-*, #fallback)`.
   They ride the base theme bundle (page_shell::DEFAULT_BASE_THEME_CSS), so a
   chart follows the reader's light/dark scheme the same way the
   `--cre8-view-*` palette does: each token is one light-dark() pair resolved by
   the `color-scheme` that base_theme.css / view_preferences.css set on :root.
   The fallbacks inside the builders only apply where this sheet is absent.

   Categorical sets (ribbon, overlay, up/down) were checked with the dataviz
   palette validator (OKLCH lightness band, chroma floor, CVD separation under
   Machado 2009 protan/deutan, normal-vision floor, contrast) on 2026-09-23:
     ribbon 0..7   adjacent pairs pass in both schemes: worst CVD dE 8.4,
                   worst normal-vision dE 18.3 light / 19.3 dark.
     overlay 1..5  ordered so neighbours stay apart: worst CVD dE 13.4 light /
                   15.9 dark, worst normal-vision dE 27.0 / 26.5.
     up / down     CVD dE 9.8 light / 10.2 dark, normal-vision dE 28.7 / 28.6.
   The regime ribbon picks its slot by hashing the regime id, so two hashed
   neighbours are not order-controlled; segments carry inline labels and
   <title>s, which is the secondary channel that covers that case.

   WCAG contrast of each mark against --cre8-chart-surface
   (light #f8faf7 | dark #121418), measured 2026-09-23:
     ribbon-0 4.21 | 5.07   ribbon-1 3.05 | 4.75   ribbon-2 3.24 | 5.41
     ribbon-3 3.31 | 6.00   ribbon-4 3.76 | 4.67   ribbon-5 4.71 | 3.73
     ribbon-6 8.15 | 5.90   ribbon-7 3.77 | 5.71
     overlay-1 3.31 | 6.00  overlay-2 8.15 | 5.90  overlay-3 3.05 | 4.75
     overlay-4 4.21 | 5.07  overlay-5 3.76 | 4.67
     up 4.15 | 4.91   down 4.22 | 4.79   neutral 3.68 | 5.99
     drawing 14.12 | 15.29   crosshair 6.21 | 8.68   axis-label 5.42 | 7.21
     tooltip fg on tooltip bg 16.70 | 14.55
   Every series colour clears 3:1 against the surface in both schemes; drawn
   straight on the light page body (#f6f8f4) the lowest is ribbon-1 at 2.99:1,
   and on #ffffff cards 3.20:1.
   Grid (1.19 | 1.26) and axis (1.61 | 1.79) are hairlines and deliberately
   recessive. On-series text (labels printed inside a filled segment) is white
   on the light-scheme fills (3.20..8.56:1 on solid fills) and near-black on
   the dark-scheme fills (3.95..6.37:1). */
:root {
  /* The plane charts are read against; text halos and knock-outs use it. */
  --cre8-chart-surface: light-dark(#f8faf7, #121418);

  /* Direction: rising / falling bars, positive / negative flows. */
  --cre8-chart-up: light-dark(#0f8a5f, #12966a);
  --cre8-chart-down: light-dark(#d9412b, #e3502f);
  /* Folded "other" series and marks that carry no identity. */
  --cre8-chart-neutral: light-dark(#7a847f, #8b949e);

  /* Categorical series slots, assigned in order. */
  --cre8-ribbon-0: light-dark(#2a78d6, #3987e5);
  --cre8-ribbon-1: light-dark(#eb6834, #d95926);
  --cre8-ribbon-2: light-dark(#199e70, #199e70);
  --cre8-ribbon-3: light-dark(#bd7c00, #c98500);
  --cre8-ribbon-4: light-dark(#d55181, #d55181);
  --cre8-ribbon-5: light-dark(#008300, #008300);
  --cre8-ribbon-6: light-dark(#4a3aa7, #9085e9);
  --cre8-ribbon-7: light-dark(#e34948, #e66767);

  /* A lone series: the site accent when a site template declares one,
     otherwise the first categorical slot. */
  --cre8-chart-series: var(--cre8-accent, var(--cre8-ribbon-0));

  /* Indicator overlays drawn over up/down candles: no green or red slot. */
  --cre8-chart-overlay-1: light-dark(#bd7c00, #c98500);
  --cre8-chart-overlay-2: light-dark(#4a3aa7, #9085e9);
  --cre8-chart-overlay-3: light-dark(#eb6834, #d95926);
  --cre8-chart-overlay-4: light-dark(#2a78d6, #3987e5);
  --cre8-chart-overlay-5: light-dark(#d55181, #d55181);

  /* Reader drawings (trend lines, levels, notes): ink, not a series hue. */
  --cre8-chart-drawing: light-dark(#1f2a26, #e6ebe8);

  /* Chrome. */
  --cre8-chart-grid: light-dark(#e3e7e2, #252930);
  --cre8-chart-axis: light-dark(#c2c9c1, #3b414a);
  --cre8-chart-axis-label: light-dark(#5f6964, #9aa3ad);
  --cre8-chart-crosshair: light-dark(#56605b, #aab3bc);
  --cre8-chart-tooltip-bg: light-dark(#ffffff, #1c2026);
  --cre8-chart-tooltip-fg: light-dark(#16201c, #eef2f7);
  --cre8-chart-on-series: light-dark(#ffffff, #0b0c10);
}

/* The one checkout: pay sheet (inside purchase forms) + receipt.
 * Colours come from the page: a site's --cre8-* tokens first, then the app
 * shell's --cre8-view-* tokens, then neutral fallbacks. */
.cre8-pay, .cre8-receipt, .cre8-lens, .cre8-lens__more, .cre8-lens-pair {
  --pay-fg: var(--cre8-fg, var(--cre8-view-fg, #16161a));
  --pay-muted: var(--cre8-fg-muted, var(--cre8-view-fg-muted, #6b6b76));
  --pay-border: var(--cre8-border, var(--cre8-view-border, rgba(127, 127, 127, 0.28)));
  --pay-accent: var(--cre8-accent, var(--cre8-view-accent, #5b4cf0));
  --pay-accent-fg: var(--cre8-accent-fg, #fff);
  --pay-surface: var(--cre8-card-bg, var(--cre8-view-surface, transparent));
  --pay-error: var(--cre8-error-fg, var(--cre8-view-danger, #c2362f));
  --pay-radius: var(--cre8-radius, 12px);
  color: var(--pay-fg);
}
.cre8-pay {
  display: grid;
  gap: 0.875rem;
  margin: 0.25rem 0 0.75rem;
  padding: 1rem;
  border: 1px solid var(--pay-border);
  border-radius: var(--pay-radius);
  background: var(--pay-surface);
  min-width: 0;
}
.cre8-pay__title { margin: 0; font-size: 1rem; font-weight: 600; }
.cre8-pay__lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.cre8-pay__lines:empty { display: none; }
.cre8-pay__line { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.9375rem; }
.cre8-pay__line-label { min-width: 0; overflow-wrap: anywhere; }
.cre8-pay__line-note { display: block; font-size: 0.8125rem; color: var(--pay-muted); }
.cre8-pay__line-amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cre8-pay__total {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding-top: 0.75rem; border-top: 1px solid var(--pay-border);
}
.cre8-pay__total strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
/* The value lens: one sentence under a figure the page already shows, read
 * from prices open on the exchange. `__more` is the "See how" disclosure
 * beside it; `-pair` stacks a give line, a get line and their verdict. */
.cre8-lens { margin: 0.25rem 0 0; font-size: 0.8125rem; line-height: 1.4; color: var(--pay-muted); overflow-wrap: anywhere; }
.cre8-lens[hidden] { display: none; }
.cre8-lens a { color: inherit; font-weight: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
.cre8-lens a:hover, .cre8-lens a:focus-visible { color: var(--pay-accent); }
.cre8-lens__more { margin: 0.35rem 0 0; font-size: 0.8125rem; color: var(--pay-muted); min-width: 0; }
.cre8-lens__more > summary { width: fit-content; cursor: pointer; color: var(--pay-accent); }
.cre8-lens__more > summary:focus-visible { outline: 2px solid var(--pay-accent); outline-offset: 2px; }
.cre8-lens__more[open] > summary { margin-bottom: 0.5rem; }
.cre8-lens-pair {
  display: grid; gap: 0.25rem; margin: 0 0 0.75rem; padding: 0.75rem 1rem; min-width: 0;
  border: 1px solid var(--pay-border); border-radius: var(--pay-radius); background: var(--pay-surface);
}
.cre8-lens-pair .cre8-lens { margin: 0; }
/* On the pay sheet the line sits under the total, on the amount's side. */
.cre8-pay__lens { margin: -0.35rem 0 0; text-align: right; }
.cre8-pay__rails { border: 0; margin: 0; padding: 0; min-width: 0; }
.cre8-pay__legend, .cre8-pay__label {
  padding: 0; margin-bottom: 0.5rem; font-size: 0.75rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--pay-muted);
}
.cre8-pay__options { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.5rem; }
.cre8-pay__rail {
  position: relative; display: flex; align-items: center; gap: 0.7rem;
  padding: 0.7rem 0.8rem; border: 1px solid var(--pay-border); border-radius: calc(var(--pay-radius) - 4px);
  cursor: pointer; min-width: 0; transition: border-color 120ms ease, box-shadow 120ms ease;
}
.cre8-pay__rail:hover { border-color: var(--pay-accent); }
.cre8-pay__rail:has(.cre8-pay__radio:checked), .cre8-pay__rail.is-selected {
  border-color: var(--pay-accent);
  box-shadow: 0 0 0 1px var(--pay-accent) inset;
  background: color-mix(in srgb, var(--pay-accent) 7%, transparent);
}
.cre8-pay__rail:has(.cre8-pay__radio:focus-visible) { outline: 2px solid var(--pay-accent); outline-offset: 2px; }
.cre8-pay__radio { position: absolute; opacity: 0; pointer-events: none; }
.cre8-pay__mark {
  flex: none; display: inline-grid; place-items: center; width: 2.25rem; height: 1.6rem;
  border: 1px solid var(--pay-border); border-radius: 6px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.02em;
}
.cre8-pay__mark--wallet { background: var(--pay-accent); color: var(--pay-accent-fg); border-color: transparent; }
.cre8-pay__mark--apple { background: #000; color: #fff; border-color: #000; }
.cre8-pay__rail-text { display: grid; min-width: 0; }
.cre8-pay__rail-name { font-weight: 600; font-size: 0.9375rem; }
.cre8-pay__rail-detail { font-size: 0.8125rem; color: var(--pay-muted); overflow-wrap: anywhere; }
.cre8-pay__badge {
  margin-left: auto; flex: none; padding: 0.1rem 0.45rem; border-radius: 999px;
  font-size: 0.6875rem; letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid var(--pay-border); color: var(--pay-muted);
}
.cre8-pay__rail[data-state="soon"] .cre8-pay__rail-name { color: var(--pay-muted); }
.cre8-pay__panel { display: grid; gap: 0.6rem; }
.cre8-pay__panel[hidden] { display: none; }
.cre8-pay__note { margin: 0; font-size: 0.875rem; color: var(--pay-muted); }
.cre8-pay__wallet { margin: 0; font-size: 0.875rem; }
.cre8-pay__card { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.cre8-pay__ghost {
  padding: 0.65rem 0.75rem; border: 1px dashed var(--pay-border); border-radius: 8px;
  font-size: 0.875rem; color: var(--pay-muted); opacity: 0.8;
}
.cre8-pay__ghost--wide { grid-column: 1 / -1; }
.cre8-pay__apple-button {
  display: inline-grid; place-items: center; justify-self: start; min-width: 11rem; height: 2.75rem; padding: 0 1.25rem;
  border-radius: 8px; background: #000; color: #fff; font-weight: 600; font-size: 1.05rem; opacity: 0.55;
}
.cre8-pay__chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cre8-pay__chips li {
  padding: 0.25rem 0.6rem; border: 1px solid var(--pay-border); border-radius: 999px;
  font-size: 0.8125rem; color: var(--pay-muted);
}
.cre8-pay__switch, .cre8-pay__action {
  justify-self: start; padding: 0; border: 0; background: none; font: inherit; font-size: 0.875rem;
  color: var(--pay-accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.cre8-pay__email { display: grid; gap: 0.35rem; }
.cre8-pay__email .cre8-pay__label { margin: 0; }
.cre8-pay__input {
  width: 100%; padding: 0.65rem 0.75rem; border: 1px solid var(--pay-border); border-radius: 8px;
  background: transparent; color: inherit; font: inherit; box-sizing: border-box;
}
.cre8-pay__input:focus-visible { outline: 2px solid var(--pay-accent); outline-offset: 1px; }
.cre8-pay__fine { margin: 0; font-size: 0.8125rem; color: var(--pay-muted); }
.cre8-pay__status { margin: 0; font-size: 0.875rem; min-height: 0; }
.cre8-pay__status:empty { display: none; }
.cre8-pay__status.is-error { color: var(--pay-error); }
.cre8-pay__status.is-ok { color: var(--pay-accent); }
.cre8-pay__submit { width: 100%; }
.cre8-pay__submit[disabled], [data-cre8-pay-submit][disabled] { opacity: 0.55; cursor: not-allowed; }

/* Receipt */
.cre8-receipt {
  display: grid; gap: 0.6rem; justify-items: start; max-width: 36rem;
  padding: 1.5rem; border: 1px solid var(--pay-border); border-radius: var(--pay-radius); background: var(--pay-surface);
}
.cre8-receipt__seal {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 999px;
  background: var(--pay-accent); color: var(--pay-accent-fg); font-size: 1.2rem; font-weight: 700;
}
.cre8-receipt[data-status="pending"] .cre8-receipt__seal,
.cre8-receipt[data-status="requested"] .cre8-receipt__seal { background: transparent; color: var(--pay-accent); border: 2px solid var(--pay-accent); }
.cre8-receipt[data-status="refunded"] .cre8-receipt__seal,
.cre8-receipt[data-status="cancelled"] .cre8-receipt__seal { background: var(--pay-muted); }
.cre8-receipt__eyebrow { margin: 0; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pay-muted); }
.cre8-receipt__title { margin: 0; font-size: 1.5rem; line-height: 1.2; }
.cre8-receipt__subtitle { margin: 0; color: var(--pay-muted); }
.cre8-receipt__lines { width: 100%; padding-top: 0.5rem; }
.cre8-receipt__total { padding-top: 0.5rem; border-top: 1px solid var(--pay-border); font-weight: 600; }
.cre8-receipt__meta { width: 100%; margin: 0.25rem 0 0; display: grid; gap: 0.35rem; }
.cre8-receipt__meta div { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.875rem; }
.cre8-receipt__meta dt { color: var(--pay-muted); }
.cre8-receipt__meta dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.cre8-receipt__next { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.cre8-receipt__action {
  display: inline-flex; align-items: center; padding: 0.55rem 1rem; border-radius: 999px;
  border: 1px solid var(--pay-border); color: inherit; text-decoration: none; font-size: 0.9375rem;
}
.cre8-receipt__action--primary { background: var(--pay-accent); color: var(--pay-accent-fg); border-color: transparent; }
@media (max-width: 480px) {
  .cre8-pay { padding: 0.85rem; }
  .cre8-pay__options { grid-template-columns: 1fr; }
  .cre8-receipt { padding: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) { .cre8-pay__rail { transition: none; } }

/* Editor components: Toolbar, Inspector and SplitPane. Colours come from the
   view tokens, so an editor wearing [data-editor-chrome] and a plain page agree. */
:where(.cre8-toolbar){display:flex;flex-wrap:wrap;align-items:center;gap:4px;min-width:0}
:where(.cre8-toolbar[aria-orientation=vertical]){flex-direction:column;align-items:stretch}
:where(.cre8-toolbar__group){display:inline-flex;flex-wrap:wrap;align-items:center;gap:4px;min-width:0}
:where(.cre8-toolbar__group + .cre8-toolbar__group){padding-inline-start:6px;border-inline-start:1px solid var(--cre8-view-border,light-dark(#cbd5ce,#3b4941))}
:where(.cre8-toolbar__spacer){flex:1 1 auto}
:where(.cre8-toolbar) :is(button,a,select){min-height:30px}

:where(.cre8-inspector){display:flex;flex-direction:column;gap:12px;min-width:0;overflow:auto;padding:12px;
  color:var(--cre8-view-fg,inherit);background:var(--cre8-view-surface,transparent);font-size:13px;line-height:1.45}
:where(.cre8-inspector__section){display:flex;flex-direction:column;gap:8px;min-width:0;margin:0;padding:0 0 12px;
  border-bottom:1px solid var(--cre8-view-border,light-dark(#e3e7e0,#2a2c33))}
:where(.cre8-inspector__section:last-child){border-bottom:0;padding-bottom:0}
:where(.cre8-inspector__heading){margin:0;color:var(--cre8-view-fg-muted,light-dark(#536259,#a6b5ab));
  font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
:where(summary.cre8-inspector__heading){cursor:pointer}
:where(details.cre8-inspector__section[open] > summary.cre8-inspector__heading){margin-bottom:4px}
:where(.cre8-inspector__field){display:grid;grid-template-columns:minmax(72px,auto) minmax(0,1fr);align-items:center;gap:4px 10px;min-width:0}
:where(.cre8-inspector__label){color:var(--cre8-view-fg-muted,light-dark(#536259,#a6b5ab));font-size:12px}
:where(.cre8-inspector__field) > :is(input,select,textarea){min-width:0;width:100%;box-sizing:border-box}

:where(.cre8-split){display:flex;min-width:0;min-height:0}
:where(.cre8-split--x){flex-direction:row}
:where(.cre8-split--y){flex-direction:column}
:where(.cre8-split__pane){min-width:0;min-height:0;overflow:auto}
:where(.cre8-split__pane[data-cre8-split-pane=leading]){flex:1 1 0}
:where(.cre8-split__pane[data-cre8-split-pane=trailing]){flex:0 0 calc(var(--split-ratio,.32) * 100%)}
:where(.cre8-split__handle){flex:0 0 6px;position:relative;background:transparent;touch-action:none;outline-offset:-2px}
:where(.cre8-split--x > .cre8-split__handle){cursor:col-resize}
:where(.cre8-split--y > .cre8-split__handle){cursor:row-resize}
:where(.cre8-split__handle)::after{content:"";position:absolute;background:var(--cre8-view-border,light-dark(#cbd5ce,#3b4941))}
:where(.cre8-split--x > .cre8-split__handle)::after{inset:0 2px}
:where(.cre8-split--y > .cre8-split__handle)::after{inset:2px 0}
:where(.cre8-split__handle:hover,.cre8-split__handle[data-resizing=true],.cre8-split__handle:focus-visible)::after{
  background:var(--cre8-view-accent,light-dark(#0f5c40,#51d88a))}
:where(.cre8-split__handle[hidden],.cre8-split__pane[hidden]){display:none}
/* With the leading pane hidden, the trailing pane takes the whole split. */
:where(.cre8-split__pane[data-cre8-split-pane=leading][hidden] ~ .cre8-split__pane){flex:1 1 0}
/* A modal mounted closed and opened in place takes the open modal's layout. */
:where(.primitive-modal[data-cre8-modal][data-state=open]){display:flex;flex-direction:column}
