/* Generated from packages/tokens/src/tokens.json. Do not edit by hand. */
:root {
  --font-serif: "IBM Plex Serif", "Iowan Old Style", Charter, Georgia, Cambria, serif;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
  --text-display-1: 46px; --leading-display-1: 56px;
  --text-display-2: 36px; --leading-display-2: 48px;
  --text-display-3: 28px; --leading-display-3: 36px;
  --text-title: 20px; --leading-title: 24px;
  --text-section: 17px; --leading-section: 24px;
  --text-body: 15px; --leading-body: 24px;
  --text-interface: 14px; --leading-interface: 20px;
  --text-caption: 13px; --leading-caption: 16px;
  --text-footnote: 12px; --leading-footnote: 16px;
  --text-micro: 11px; --leading-micro: 16px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --motion-fast: 100ms;
  --motion-base: 150ms;
  --motion-slow: 250ms;
  --layout-reading: 720px;
  --layout-frame: 1100px;
  --layout-gutter: 16px;
  --space: 4px;
  --z-canvas: 0;
  --z-window: 200;
  --z-dock: 300;
  --z-popover: 400;
  --z-modal: 500;
  --z-notice: 650;
  --z-tooltip: 700;
  --surface-base: #fbfbf9;
  --surface-inset: #f5f4f2;
  --surface-raised: #ffffff;
  --surface-overlay: #ffffff;
  --text-primary: #1a1917;
  --text-secondary: #595855;
  --text-subtle: #706e6b;
  --line-control: #888683;
  --accent: #af4803;
  --accent-hover: #8b3906;
  --on-accent: #ffffff;
  --accent-ink: #af4803;
  --ok: #196632;
  --warn: #7e4f04;
  --bad: #a92321;
  --info: #225899;
  --agent: #007048;
  --proposal: #6c44a4;
  --line-hairline: rgb(26 25 23 / 0.07);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface-base: #0e0d0b;
    --surface-inset: #090807;
    --surface-raised: #141211;
    --surface-overlay: #21201e;
    --text-primary: #f5f4f2;
    --text-secondary: #a09e9b;
    --text-subtle: #888683;
    --line-control: #706e6b;
    --accent: #f18848;
    --accent-hover: #f6a97a;
    --on-accent: #090807;
    --accent-ink: #f18848;
    --ok: #75d78d;
    --warn: #f4c352;
    --bad: #ff958d;
    --info: #8cc3fc;
    --agent: #65d49e;
    --proposal: #c3a5f9;
    --line-hairline: rgb(245 244 242 / 0.07);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface-base: #0e0d0b;
  --surface-inset: #090807;
  --surface-raised: #141211;
  --surface-overlay: #21201e;
  --text-primary: #f5f4f2;
  --text-secondary: #a09e9b;
  --text-subtle: #888683;
  --line-control: #706e6b;
  --accent: #f18848;
  --accent-hover: #f6a97a;
  --on-accent: #090807;
  --accent-ink: #f18848;
  --ok: #75d78d;
  --warn: #f4c352;
  --bad: #ff958d;
  --info: #8cc3fc;
  --agent: #65d49e;
  --proposal: #c3a5f9;
  --line-hairline: rgb(245 244 242 / 0.07);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --surface-base: #fbfbf9;
  --surface-inset: #f5f4f2;
  --surface-raised: #ffffff;
  --surface-overlay: #ffffff;
  --text-primary: #1a1917;
  --text-secondary: #595855;
  --text-subtle: #706e6b;
  --line-control: #888683;
  --accent: #af4803;
  --accent-hover: #8b3906;
  --on-accent: #ffffff;
  --accent-ink: #af4803;
  --ok: #196632;
  --warn: #7e4f04;
  --bad: #a92321;
  --info: #225899;
  --agent: #007048;
  --proposal: #6c44a4;
  --line-hairline: rgb(26 25 23 / 0.07);
  color-scheme: light;
}

/* The public site: a neutral page, one accent, an editorial serif over a sans interface, a 720 px reading
   column inside a frame of at most 1,100 px, hairline cards (X1, X2). All values come from the tokens. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface-base); color: var(--text-primary); min-height: 100svh; display: flex; flex-direction: column;
  font: 400 var(--text-body)/var(--leading-body) var(--font-sans);
}
main { flex: 1; display: flex; flex-direction: column; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-sm); }
h1, h2, h3 { margin: 0; font-weight: 300; letter-spacing: -0.01em; }
h1 { font: 300 var(--text-display-2)/var(--leading-display-2) var(--font-serif); letter-spacing: -0.02em; }
h2 { font: 300 var(--text-display-3)/var(--leading-display-3) var(--font-serif); margin-bottom: calc(var(--space) * 4); }
h3 { font: 600 var(--text-section)/var(--leading-section) var(--font-sans); letter-spacing: 0; }
p { margin: 0 0 calc(var(--space) * 4); }

.frame { max-width: var(--layout-frame); margin: 0 auto; padding: 0 var(--layout-gutter); }
.reading { max-width: var(--layout-reading); margin: 0 auto; padding: 0 var(--layout-gutter); }
.frame .reading { padding: 0; margin: 0 auto; max-width: calc(var(--layout-reading) - 2 * var(--layout-gutter)); }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: var(--layout-gutter); top: calc(var(--space) * 2); z-index: var(--z-modal); background: var(--surface-raised); padding: calc(var(--space) * 2) calc(var(--space) * 3); }

.notice {
  text-align: center; font: 500 var(--text-caption)/var(--leading-caption) var(--font-sans);
  padding: calc(var(--space) * 2) var(--layout-gutter); background: var(--surface-inset); color: var(--text-secondary);
  box-shadow: inset 0 -1px 0 var(--line-hairline);
}

.top { box-shadow: inset 0 -1px 0 var(--line-hairline); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: calc(var(--space) * 4); min-height: 64px; flex-wrap: wrap; }
.brand { display: block; width: 104px; color: var(--text-primary); }
.brand-slot { display: block; width: 1px; }
.top-right { display: flex; align-items: center; gap: calc(var(--space) * 3); }

.theme-toggle {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; cursor: pointer;
  border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-secondary);
  transition: background-color var(--motion-base) ease-out, color var(--motion-base) ease-out;
}
.theme-toggle:hover { background: var(--surface-inset); color: var(--text-primary); }
.theme-toggle[hidden] { display: none; }
/* Show the icon that leads to the other theme: the moon on light, the sun on dark. */
.theme-toggle .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
}
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }

.wordmark { display: block; color: inherit; }
/* Optical size for the small header logo: at about 100 px the N's thin diagonal is under a pixel and the logo's joints
   clump, so the small logo carries a little extra weight (3 units of the logo's 1,059). The animated pieces carry the
   same weight, so the logo does not change when a replay ends. The large logo on the home page is the exact master. */
.brand .zena-wordmark .master,
.brand .zena-wordmark .piece path { stroke: currentColor; stroke-width: 3; stroke-linejoin: miter; stroke-miterlimit: 3; }
.wordmark svg { display: block; width: 100%; height: auto; }

.hero { margin: auto 0; padding: calc(var(--space) * 16) 0 calc(var(--space) * 12); }
.hero-mark { display: block; width: min(560px, 100%); margin: 0 auto calc(var(--space) * 14); color: var(--text-primary); }
.hero h1 { font-size: var(--text-display-1); line-height: var(--leading-display-1); margin-bottom: calc(var(--space) * 5); }
.lead { font-size: var(--text-title); line-height: 30px; color: var(--text-secondary); }
.actions { display: flex; flex-wrap: wrap; gap: calc(var(--space) * 3); align-items: center; margin-top: calc(var(--space) * 6); }

.button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 calc(var(--space) * 5);
  border-radius: var(--radius-md); font: 500 var(--text-interface)/var(--leading-interface) var(--font-sans);
  text-decoration: none; transition: background-color var(--motion-base) ease-out, color var(--motion-base) ease-out;
}
.button-quiet { box-shadow: inset 0 0 0 1px var(--line-control); color: var(--text-primary); }
.button-quiet:hover { color: var(--text-primary); background: var(--surface-inset); }

.section { padding: calc(var(--space) * 12) 0; box-shadow: inset 0 1px 0 var(--line-hairline); }
.page-head { padding: calc(var(--space) * 14) 0 calc(var(--space) * 6); }
.page-head h1 { margin-bottom: calc(var(--space) * 4); }

.ticks { padding-left: calc(var(--space) * 5); margin: calc(var(--space) * 4) 0; }
.ticks li { margin: calc(var(--space) * 2) 0; }

.foot { box-shadow: inset 0 1px 0 var(--line-hairline); margin-top: calc(var(--space) * 8); }
.foot-inner { display: flex; justify-content: space-between; gap: calc(var(--space) * 4); padding-top: calc(var(--space) * 6); padding-bottom: calc(var(--space) * 8); color: var(--text-secondary); font-size: var(--text-caption); }

@media (max-width: 640px) {
  .hero { padding-top: calc(var(--space) * 10); }
  .hero-mark { margin-bottom: calc(var(--space) * 10); }
  .hero h1 { font-size: var(--text-display-3); line-height: var(--leading-display-3); }
  h1 { font-size: var(--text-display-3); line-height: var(--leading-display-3); }
  .lead { font-size: var(--text-section); line-height: var(--leading-section); }
  .top-inner { min-height: 56px; padding-top: calc(var(--space) * 3); padding-bottom: var(--space); gap: var(--space) calc(var(--space) * 4); }
  /* Phone: the toggle joins the logo's row. */
  .top-right { display: contents; }
  .theme-toggle { order: 2; margin-left: auto; margin-right: calc(var(--space) * -2); }
  .brand-slot { display: none; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }


    .zena-wordmark .pieces { transform-box: view-box; transform-origin: 529.0px 87.0px; animation: zw_grow 0.45s cubic-bezier(.2,.7,.2,1) 0s both, zw_hide 0.01s linear 1.95s both; }
    .zena-wordmark .piece { transform-box: view-box; fill: currentColor; animation-duration: 0.8s; animation-timing-function: cubic-bezier(.3,.6,.2,1); animation-fill-mode: both; }
    .zena-wordmark .fillet { transform-box: view-box; animation: zw_fillet 0.56s cubic-bezier(.3,.6,.2,1) both; }
    @keyframes zw_fillet { from { transform: scale(0); } to { transform: scale(1); } }
    @keyframes zw_grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
    .zena-wordmark .master { fill: currentColor; opacity: 0; animation: zw_reveal 0.01s linear 1.95s both; }
    @keyframes zw_reveal { from { opacity: 0; } to { opacity: 1; } }
    @keyframes zw_hide { from { opacity: 1; } to { opacity: 0; } }
    @keyframes zw_z_top { from { transform: translate(-62.42px, 77.00px) scale(0.5, 0.6250) rotate(-0.000deg); } to { transform: translate(0px, 0px) scale(1, 1) rotate(0deg); } }
    @keyframes zw_z_diagonal { from { transform: translate(50.55px, 0.50px) scale(0.5, 0.2907) rotate(44.153deg); } to { transform: translate(0px, 0px) scale(1, 1) rotate(0deg); } }
    @keyframes zw_z_bottom { from { transform: translate(164.20px, -77.00px) scale(0.5, 0.5000) rotate(-0.000deg); } to { transform: translate(0px, 0px) scale(1, 1) rotate(0deg); } }
    @keyframes zw_e_top { from { transform: translate(-10.17px, 74.00px) scale(0.5, 0.3571) rotate(-0.000deg); } to { transform: translate(0px, 0px) scale(1, 1) rotate(0deg); } }
    @keyframes zw_e_middle { from { transform: translate(87.58px, 1.00px) scale(0.5, 0.3571) rotate(-0.000deg); } to { transform: translate(0px, 0px) scale(1, 1) rotate(0deg); } }
    @keyframes zw_e_bottom { from { transform: translate(156.83px, -75.00px) scale(0.5, 0.3571) rotate(-0.000deg); } to { transform: translate(0px, 0px) scale(1, 1) rotate(0deg); } }
    @keyframes zw_n_left { from { transform: translate(55.33px, -0.50px) scale(0.5, 0.2857) rotate(90.000deg); } to { transform: translate(0px, 0px) scale(1, 1) rotate(0deg); } }
    @keyframes zw_n_diagonal { from { transform: translate(66.88px, -1.35px) scale(0.5, 0.7042) rotate(-40.347deg); } to { transform: translate(0px, 0px) scale(1, 1) rotate(0deg); } }
    @keyframes zw_n_right { from { transform: translate(78.43px, -0.50px) scale(0.5, 0.2857) rotate(90.000deg); } to { transform: translate(0px, 0px) scale(1, 1) rotate(0deg); } }
    @keyframes zw_a_left { from { transform: translate(19.18px, -1.00px) scale(0.5, 0.2941) rotate(55.700deg); } to { transform: translate(0px, 0px) scale(1, 1) rotate(0deg); } }
    @keyframes zw_a_right { from { transform: translate(21.18px, -1.00px) scale(0.5, 0.2941) rotate(-55.700deg); } to { transform: translate(0px, 0px) scale(1, 1) rotate(0deg); } }
    .zena-wordmark #zw-z-top { transform-origin: 105.0px 10.0px; animation-name: zw_z_top; animation-delay: 0.45s; }
    .zena-wordmark #zw-z-diagonal-f0 { transform-origin: 150.86px 29.53px; animation-delay: 0.76s; }
    .zena-wordmark #zw-z-diagonal-f1 { transform-origin: 56.55px 141.68px; animation-delay: 0.76s; }
    .zena-wordmark #zw-z-diagonal { transform-origin: 102.78px 86.5px; animation-name: zw_z_diagonal; animation-delay: 0.52s; }
    .zena-wordmark #zw-z-bottom { transform-origin: 101.25px 164.0px; animation-name: zw_z_bottom; animation-delay: 0.59s; }
    .zena-wordmark #zw-e-top { transform-origin: 373.5px 13px; animation-name: zw_e_top; animation-delay: 0.66s; }
    .zena-wordmark #zw-e-middle { transform-origin: 359px 86px; animation-name: zw_e_middle; animation-delay: 0.73s; }
    .zena-wordmark #zw-e-bottom { transform-origin: 373px 162px; animation-name: zw_e_bottom; animation-delay: 0.80s; }
    .zena-wordmark #zw-n-left { transform-origin: 565.25px 87.5px; animation-name: zw_n_left; animation-delay: 0.87s; }
    .zena-wordmark #zw-n-diagonal-f0 { transform-origin: 591.14px 41.23px; animation-delay: 1.18s; }
    .zena-wordmark #zw-n-diagonal-f1 { transform-origin: 707.31px 134.98px; animation-delay: 1.18s; }
    .zena-wordmark #zw-n-diagonal { transform-origin: 649.5px 88.35px; animation-name: zw_n_diagonal; animation-delay: 0.94s; }
    .zena-wordmark #zw-n-right { transform-origin: 733.75px 87.5px; animation-name: zw_n_right; animation-delay: 1.01s; }
    .zena-wordmark #zw-a-left { transform-origin: 889px 88px; animation-name: zw_a_left; animation-delay: 1.08s; }
    .zena-wordmark #zw-a-right { transform-origin: 991.5px 88px; animation-name: zw_a_right; animation-delay: 1.15s; }
    @media (prefers-reduced-motion: reduce) { .zena-wordmark .pieces { display: none; } .zena-wordmark .master { animation: none !important; opacity: 1; } }
    .zena-wordmark .zw-idle .pieces, .zena-wordmark.zw-idle .pieces { display: none; }
    .zena-wordmark .zw-idle .master, .zena-wordmark.zw-idle .master { animation: none !important; opacity: 1; }
  
/* The portal's own styles, on top of the site's base (tokens, type, frame, buttons): the entry page, forms, the
   portal's header and navigation, lists, messages, comments. Every colour is a token that the contrast gate checks
   against the three surfaces; links use accent-ink, never the accent itself, for text. */

/* ---- entry page ---- */
.entry { flex: 1; display: flex; align-items: center; padding: calc(var(--space) * 12) 0; }
.entry-grid { display: grid; gap: calc(var(--space) * 10); align-items: start; width: 100%; }
.kicker { margin: 0 0 calc(var(--space) * 3); font: 500 var(--text-caption)/var(--leading-caption) var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.entry-intro h1 { margin-bottom: calc(var(--space) * 5); }
.card { background: var(--surface-raised); border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--line-hairline); padding: calc(var(--space) * 6); }
.card-title { font: 600 var(--text-section)/var(--leading-section) var(--font-sans); margin: 0 0 calc(var(--space) * 4); letter-spacing: 0; }
.note { margin: calc(var(--space) * 5) 0 0; color: var(--text-secondary); font-size: var(--text-caption); line-height: var(--leading-caption); }
@media (min-width: 880px) {
  .entry-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: calc(var(--space) * 16); }
  .entry-card { padding: calc(var(--space) * 8); }
}

/* ---- forms ---- */
.field { margin: 0 0 calc(var(--space) * 4); }
.field label, .label { display: block; margin: 0 0 var(--space); font: 500 var(--text-interface)/var(--leading-interface) var(--font-sans); }
.field input[type="text"], .field input[type="password"], .field input[type="file"], .field textarea, .field select {
  display: block; width: 100%; min-height: 44px; padding: calc(var(--space) * 2) calc(var(--space) * 3); border: 0; border-radius: var(--radius-md);
  background: var(--surface-base); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--line-control);
  font: 400 var(--text-body)/var(--leading-body) var(--font-sans);
}
.field textarea { min-height: 112px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hint { margin: var(--space) 0 0; color: var(--text-secondary); font-size: var(--text-caption); line-height: var(--leading-caption); }
.choices { border: 0; padding: 0; margin: 0 0 calc(var(--space) * 4); display: flex; gap: calc(var(--space) * 5); flex-wrap: wrap; }
.choices legend { padding: 0; margin: 0 0 var(--space); font: 500 var(--text-interface)/var(--leading-interface) var(--font-sans); }
.choices label { display: inline-flex; align-items: center; gap: calc(var(--space) * 2); min-height: 44px; cursor: pointer; }
.choices input { width: 20px; height: 20px; accent-color: var(--accent); }

.button { cursor: pointer; border: 0; background: transparent; }
.button-primary { background: var(--accent); color: var(--on-accent); }
.button-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.button[disabled], .button[aria-busy="true"] { background: var(--surface-inset); color: var(--text-secondary); box-shadow: inset 0 0 0 1px var(--line-control); cursor: not-allowed; }
.button[aria-busy="true"] { cursor: progress; }
.button-row { display: flex; gap: calc(var(--space) * 3); flex-wrap: wrap; align-items: center; }

.alert { display: none; margin: 0 0 calc(var(--space) * 4); padding: calc(var(--space) * 3); border-radius: var(--radius-md); background: var(--surface-inset); color: var(--bad); box-shadow: inset 0 0 0 1px var(--line-control); font-size: var(--text-interface); line-height: var(--leading-interface); }
.alert:target, .alert.show { display: block; }
.status { color: var(--text-secondary); font-size: var(--text-caption); min-height: 1.5em; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }
.loading, .empty { color: var(--text-secondary); padding: calc(var(--space) * 8) 0; }

/* ---- the portal ---- */
body.portal { display: block; }
.portal-top { box-shadow: inset 0 -1px 0 var(--line-hairline); }
.portal-bar { display: flex; align-items: center; gap: calc(var(--space) * 4); min-height: 64px; flex-wrap: wrap; padding-top: calc(var(--space) * 2); padding-bottom: calc(var(--space) * 2); }
.portal-bar .brand { width: 88px; flex: none; }
.portal-title { font: 600 var(--text-interface)/var(--leading-interface) var(--font-sans); color: var(--text-secondary); margin-right: auto; min-width: 0; overflow-wrap: anywhere; }
.nav { display: flex; gap: calc(var(--space) * 1); flex-wrap: wrap; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 calc(var(--space) * 3); border-radius: var(--radius-md); text-decoration: none; color: var(--text-secondary); font: 500 var(--text-interface)/var(--leading-interface) var(--font-sans); }
.nav a:hover { color: var(--text-primary); background: var(--surface-inset); }
.nav a[aria-current="page"] { color: var(--text-primary); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.page { padding: calc(var(--space) * 10) 0 calc(var(--space) * 16); min-height: 60vh; }
/* the site's main is a flex column, where a centred frame would shrink to its text; keep it the frame's width, and the reading column readable */
.page > .frame { width: 100%; }
.page > .frame > * { max-width: 760px; }
.page h1 { margin-bottom: calc(var(--space) * 3); outline: none; }
.page h2 { font: 600 var(--text-section)/var(--leading-section) var(--font-sans); letter-spacing: 0; margin: calc(var(--space) * 10) 0 calc(var(--space) * 3); }
.page .lead { margin-bottom: calc(var(--space) * 6); }
.stack { display: grid; gap: calc(var(--space) * 3); }

.list { list-style: none; margin: 0; padding: 0; box-shadow: inset 0 1px 0 var(--line-hairline); }
.list > li { box-shadow: inset 0 -1px 0 var(--line-hairline); }
.row { display: flex; gap: calc(var(--space) * 4); align-items: baseline; justify-content: space-between; flex-wrap: wrap; padding: calc(var(--space) * 4) 0; }
.row a.row-main { font: 500 var(--text-body)/var(--leading-body) var(--font-sans); color: var(--text-primary); }
.meta { color: var(--text-secondary); font-size: var(--text-caption); line-height: var(--leading-caption); }
.badge { display: inline-block; padding: 0 calc(var(--space) * 2); border-radius: var(--radius-sm); font: 500 var(--text-caption)/22px var(--font-sans); background: var(--surface-inset); box-shadow: inset 0 0 0 1px var(--line-control); }
.badge.ok { color: var(--ok); }
.badge.bad { color: var(--bad); }
.badge.warn { color: var(--warn); }
.back { display: inline-block; margin-bottom: calc(var(--space) * 4); color: var(--accent-ink); }

.thread { display: grid; gap: calc(var(--space) * 3); margin: calc(var(--space) * 4) 0 calc(var(--space) * 6); }
.msg { max-width: 640px; padding: calc(var(--space) * 3) calc(var(--space) * 4); border-radius: var(--radius-lg); background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--line-hairline); overflow-wrap: anywhere; }
.msg.mine { justify-self: end; background: var(--surface-inset); }
.msg p { margin: 0; white-space: pre-wrap; }
.msg .meta { margin-top: var(--space); }
.msg.gone p { color: var(--text-subtle); font-style: italic; }

.comment { padding: calc(var(--space) * 4) 0; overflow-wrap: anywhere; }
.comment p { margin: 0 0 var(--space); white-space: pre-wrap; }
.anchor { display: inline-block; margin-bottom: var(--space); color: var(--text-secondary); font-size: var(--text-caption); }
.decision { padding: calc(var(--space) * 4); border-radius: var(--radius-lg); background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--line-hairline); }
.decision p { margin: 0 0 var(--space); }
.form-card { max-width: 640px; }

@media (max-width: 640px) {
  .entry { padding: calc(var(--space) * 8) 0; }
  .card { padding: calc(var(--space) * 5); }
  .portal-bar { gap: calc(var(--space) * 2) calc(var(--space) * 3); }
  .portal-bar { min-height: 0; flex-wrap: wrap; row-gap: 0; padding-block: var(--space); }
  .portal-title { order: 2; flex: 1 1 0; min-width: 0; margin-right: 0; font-size: var(--text-caption); }   /* the client's name beside the wordmark, not on a row of its own */
  .nav { order: 4; flex-basis: 100%; margin: 0 calc(var(--space) * -3); display: flex; justify-content: space-between; }   /* the five pages in one row */
  .nav a { padding-inline: calc(var(--space) * 2); }
  .page { padding-top: calc(var(--space) * 6); }
  .msg { max-width: 100%; }
}

/* the wordmark in the portal's header: the logo's shape as a mask, so it takes the text colour in both themes */
.wm { display: block; width: 100%; aspect-ratio: 1059 / 176; background: currentColor; -webkit-mask: url(/assets/zena-wordmark.svg) center / contain no-repeat; mask: url(/assets/zena-wordmark.svg) center / contain no-repeat; }

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
dl { margin: 0; }
.def { margin: 0; }
.signout { margin-top: calc(var(--space) * 6); }

/* ---- the stage: the view on the left, Krites at the side (the layout of a canvas with an assistant) ---- */
.stage-page { flex: 1; display: flex; min-height: 0; outline: none; }
.stage-layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; }
@media (min-width: 960px) { .stage-layout { grid-template-columns: minmax(0, 1fr) clamp(340px, 26vw, 440px); } }
/* the portal is a column the height of the window; on the stage nothing scrolls but the sidecar's own conversation (a workspace, not a page), and the bar spans the window as the stage does */
.portal-shell { display: flex; flex-direction: column; min-height: 100dvh; }
@media (min-width: 960px) { .portal-shell.is-stage { height: 100dvh; overflow: hidden; } }
.portal-shell.is-stage .portal-bar { max-width: none; padding-inline: calc(var(--space) * 4); }
.portal-bar { min-height: 56px; }
.stage-main { display: flex; flex-direction: column; gap: calc(var(--space) * 2); min-width: 0; min-height: 0; padding: calc(var(--space) * 3) calc(var(--space) * 4) calc(var(--space) * 4); }
.stage-views { display: flex; flex-wrap: wrap; align-items: center; gap: calc(var(--space) * 2) calc(var(--space) * 4); margin-block: calc(var(--space) * 2); }
.stage-views-group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space); }
.stage-views-name { font: 600 var(--text-small)/var(--leading-small) var(--font-sans); color: var(--ink-soft, inherit); text-transform: uppercase; letter-spacing: 0.04em; }
.stage-views .button[aria-pressed='true'] { outline: 2px solid var(--accent, currentColor); outline-offset: 1px; }
.stage-elsewhere { margin-block: var(--space); }
.stage-bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: calc(var(--space) * 3); }
.stage-title { font: 600 var(--text-section)/var(--leading-section) var(--font-sans); }
.stage-rev, .stage-off, .stage-age { color: var(--text-secondary); font-size: var(--text-caption); }
.stage-link { font-size: var(--text-caption); color: var(--text-secondary); }
.stage-link::before { content: ''; display: inline-block; inline-size: 0.5em; block-size: 0.5em; border-radius: 50%; margin-inline-end: 0.4em; background: var(--text-secondary); }
.stage-link[data-online='true'] { color: var(--text-primary); }
.stage-link[data-online='true']::before { background: var(--accent, currentColor); }
.stage-canvas { position: relative; flex: 1; background: var(--surface-raised); border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--line-hairline); min-height: 0; overflow: hidden; color: var(--text-primary); background-image: radial-gradient(var(--line-hairline) 1px, transparent 1px); background-size: 22px 22px; }
.stage-canvas[data-tool="hand"] { cursor: grab; }
@media (max-width: 959px) { .stage-main .stage-canvas { min-height: 52dvh; } .stage-side { overflow: visible; } .stage-run { max-height: 30dvh; } .stage-side .thread-compact { flex: none; min-height: 120px; max-height: 46dvh; } }   /* below the drawing the sidebar has no height of its own: the conversation takes what it needs, and scrolls inside itself past that */
.stage-svg { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; }
.stage-paper { fill: var(--surface-base); }
.stage-svg polyline, .stage-svg polygon { vector-effect: non-scaling-stroke; }
.stage-svg [data-owner] { cursor: pointer; }
.stage-svg .st-picked { stroke: var(--accent); fill-opacity: 1; }
.stage-svg text.st-picked { fill: var(--accent); stroke: none; }
.stage-empty { margin: 0; padding: calc(var(--space) * 10) calc(var(--space) * 6); color: var(--text-secondary); }
.stage-palette { position: absolute; z-index: 2; left: calc(var(--space) * 3); top: calc(var(--space) * 3); display: flex; flex-direction: column; gap: var(--space); padding: var(--space); background: var(--surface-base); border-radius: var(--radius-md); box-shadow: 0 0 0 1px var(--line-control); }
.stage-palette button { cursor: pointer; border: 0; background: transparent; color: var(--text-primary); padding: var(--space) calc(var(--space) * 2); border-radius: var(--radius-sm, 6px); font: 500 var(--text-caption)/1.2 var(--font-sans); min-height: 32px; }
.stage-palette button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.stage-palette button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* ---- the project browser (a dock at the left) and the inspector (in the sidecar): what a client opens and looks at ---- */
@media (min-width: 1200px) { .stage-layout.has-browser { grid-template-columns: clamp(220px, 15vw, 280px) minmax(0, 1fr) clamp(340px, 26vw, 440px); } .stage-dock-toggle { display: none; } }
.stage-dock { min-height: 0; overflow-y: auto; background: var(--surface-raised); box-shadow: inset -1px 0 0 var(--line-hairline); padding: calc(var(--space) * 3); }
@media (max-width: 1199px) {
  .stage-layout.has-browser { position: relative; }
  .stage-dock { position: absolute; z-index: 15; inset-block: 0; inset-inline-start: 0; inline-size: min(300px, 86vw); box-shadow: 0 0 0 1px var(--line-control); }
  .stage-dock[data-open='false'] { display: none; }
}
.stage-browser details { margin-block: var(--space); }
.stage-browser summary { cursor: pointer; font: 600 var(--text-caption)/1.4 var(--font-sans); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); padding-block: var(--space); }
.stage-browser ul { list-style: none; margin: 0; padding: 0; }
.stage-browser h3 { font: 600 var(--text-caption)/1.4 var(--font-sans); color: var(--text-secondary); margin: calc(var(--space) * 2) 0 var(--space); }
.browser-count { color: var(--text-secondary); font-weight: 400; margin-inline-start: 0.4em; }
.browser-item { display: block; inline-size: 100%; text-align: start; padding: calc(var(--space) * 1.5) calc(var(--space) * 2); border: 0; border-radius: var(--radius-sm, 6px); background: transparent; color: var(--text-primary); font: 400 var(--text-interface)/var(--leading-interface) var(--font-sans); cursor: pointer; overflow-wrap: anywhere; }
.browser-item:hover:not(:disabled) { background: var(--surface-base); }
.browser-item[aria-current='true'], .browser-item[aria-pressed='true'] { background: var(--surface-base); box-shadow: inset 2px 0 0 var(--accent); }
.browser-item:disabled { color: var(--text-secondary); cursor: default; }
.browser-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.browser-row { display: flex; justify-content: space-between; gap: calc(var(--space) * 2); padding: calc(var(--space) * 1.5) calc(var(--space) * 2); }
.browser-quiet, .browser-none { color: var(--text-secondary); font-size: var(--text-caption); }
.browser-none { margin: var(--space) calc(var(--space) * 2); }
.stage-inspect { display: flex; flex-direction: column; gap: var(--space); padding: calc(var(--space) * 3); background: var(--surface-base); border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--line-hairline); flex: none; }
.stage-inspect header { display: flex; align-items: center; justify-content: space-between; gap: var(--space); }
.stage-inspect dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px calc(var(--space) * 3); }
.stage-inspect dl > div { display: contents; }
.stage-inspect dt { color: var(--text-secondary); }
.stage-inspect dd { margin: 0; text-align: end; overflow-wrap: anywhere; }
.stage-canvas svg { cursor: grab; }
.stage-canvas[data-dragging='true'] svg { cursor: grabbing; }
.stage-canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.stage-pointer { transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 1.2s ease-out; pointer-events: none; }
/* the agent's pointer: a small plain arrow, the mark and two small eyes, in one ink; no outline, no colour, no words */
.stage-pointer path, .stage-pointer .stage-mark path { fill: var(--text-primary); stroke: none; }
.stage-pointer .stage-pupil { fill: var(--surface-base); stroke: none; }
.stage-pointer-wig { transform-box: fill-box; transform-origin: 0% 0%; }
.stage-pointer-idle .stage-pointer-wig { animation: pointer-wiggle 2.6s ease-in-out infinite; }   /* when she is done it wiggles slowly ... */
.stage-pointer-fading { opacity: 0; }                                                              /* ... then fades, and goes */
@keyframes pointer-wiggle { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@media (prefers-reduced-motion: reduce) { .stage-pointer-idle .stage-pointer-wig { animation: none; } .stage-pointer { transition: opacity 1.2s ease-out; } }
.stage-elements summary { cursor: pointer; color: var(--text-secondary); font-size: var(--text-caption); }
.stage-elements ul { display: flex; flex-wrap: wrap; gap: var(--space); list-style: none; margin: calc(var(--space) * 2) 0 0; padding: 0; }
.stage-elements button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.stage-side { display: flex; flex-direction: column; gap: calc(var(--space) * 3); background: var(--surface-raised); box-shadow: inset 1px 0 0 var(--line-hairline); padding: calc(var(--space) * 3) calc(var(--space) * 4); overflow: visible; min-height: 0; }
.stage-side-head { display: flex; align-items: center; gap: calc(var(--space) * 2); }
.stage-side-head .stage-state { margin-right: auto; }
/* the one menu: a small button, the pages in a short list under it */
.portal-menu { position: relative; flex: none; }
.portal-menu-button { display: inline-flex; align-items: center; justify-content: center; inline-size: 32px; block-size: 32px; padding: 0; border: 0; border-radius: var(--radius-sm, 6px); background: transparent; color: var(--text-secondary); cursor: pointer; }
.portal-menu-button:hover, .portal-menu-button[aria-expanded='true'] { color: var(--text-primary); background: var(--surface-base); }
.portal-menu-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.portal-menu-list { position: absolute; z-index: 20; inset-inline-end: 0; inset-block-start: calc(100% + 4px); min-inline-size: 168px; margin: 0; padding: var(--space); list-style: none; background: var(--surface-raised); border-radius: var(--radius-lg); box-shadow: 0 0 0 1px var(--line-control); }
.portal-menu-list a { display: block; padding: calc(var(--space) * 2) calc(var(--space) * 3); border-radius: var(--radius-sm, 6px); color: var(--text-primary); text-decoration: none; }
.portal-menu-list a:hover, .portal-menu-list a:focus-visible { background: var(--surface-base); outline: none; }
.portal-menu-action { display: block; inline-size: 100%; padding: calc(var(--space) * 2) calc(var(--space) * 3); border: 0; border-radius: var(--radius-sm, 6px); background: transparent; color: var(--text-primary); font: inherit; text-align: start; cursor: pointer; }
.portal-menu-action:hover:not(:disabled), .portal-menu-action:focus-visible { background: var(--surface-base); outline: none; }
.portal-menu-action:disabled { color: var(--text-secondary); cursor: default; }
.portal-menu-danger { color: var(--bad); font-weight: 600; }
.portal-menu-confirm { display: grid; gap: calc(var(--space) * 2); max-inline-size: 232px; padding: calc(var(--space) * 2) calc(var(--space) * 3); color: var(--text-primary); }
.portal-menu-confirm-row { display: flex; gap: var(--space); }
.portal-menu-confirm-row .portal-menu-action { inline-size: auto; flex: 1; text-align: center; box-shadow: 0 0 0 1px var(--line-control); }
.portal-menu-rule { block-size: 1px; margin: var(--space) 0; background: var(--line-control); }
.stage-name { font: 600 var(--text-section)/var(--leading-section) var(--font-sans); }
.stage-state { font-size: var(--text-caption); padding: 2px calc(var(--space) * 2); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-control); color: var(--text-secondary); }
.stage-state.stage-busy { color: var(--text-primary); box-shadow: inset 0 0 0 1.5px var(--accent); }
.stage-state.stage-wait { color: var(--text-primary); box-shadow: inset 0 0 0 1.5px var(--text-secondary); }
.stage-hello { margin: 0; font: 500 var(--text-interface)/var(--leading-interface) var(--font-sans); color: var(--text-secondary); }
.stage-run { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space); flex: 1 1 0; min-height: 0; overflow-y: auto; }   /* the conversation takes the room between the head and the box, which stays at the foot */
.stage-run li { padding-left: calc(var(--space) * 3); border-left: 2px solid var(--line-control); color: var(--text-secondary); }
.stage-run li:last-child { color: var(--text-primary); border-left-color: var(--accent); }
.stage-run li[data-state="done"] { border-left-color: var(--text-secondary); }
.stage-picked { margin: 0; font-size: var(--text-caption); }
.stage-note { margin: 0; color: var(--text-secondary); font-size: var(--text-caption); line-height: var(--leading-caption); }
.thread-compact { flex: 1 1 0; min-height: 0; overflow-y: auto; max-height: none; display: flex; flex-direction: column; gap: var(--space); }   /* the conversation takes the room, and scrolls inside itself */
.msg.krites { align-self: flex-start; padding: calc(var(--space) * 2) calc(var(--space) * 3); background: transparent; box-shadow: none; border-left: 2px solid var(--accent); border-radius: 0; color: var(--text-primary); }
.msg.krites p { margin: 0; }
/* What Krites is doing, as a chat shows it: three dots, a word, how long; and the run's tasks with their times. */
.msg.activity { display: flex; align-items: center; gap: calc(var(--space) * 2); color: var(--text-secondary); }
.msg.activity .activity-word { color: var(--text-primary); }
.msg.activity .activity-time { margin-inline-start: auto; font-variant-numeric: tabular-nums; color: var(--text-subtle); }
.dots { display: inline-flex; gap: 4px; align-items: center; }
.dots i { display: block; inline-size: 6px; block-size: 6px; border-radius: 50%; background: var(--text-secondary); animation: dot-pulse 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.18s; }
.dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes dot-pulse { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: 0.6; } }
.tasks { align-self: stretch; font: 400 var(--text-interface)/var(--leading-interface) var(--font-sans); color: var(--text-secondary); }
.tasks summary { cursor: pointer; padding: var(--space) 0; color: var(--text-secondary); }
.tasks summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tasks ol { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space); }
.tasks li { display: flex; align-items: baseline; gap: calc(var(--space) * 2); }
.tasks .task-mark { flex: none; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--ok); }
.tasks li[data-state='active'] .task-mark { background: var(--accent); animation: dot-pulse 1.2s infinite ease-in-out; }
.tasks li[data-state='waiting'] .task-mark { background: var(--text-subtle); }
.tasks li[data-state='failed'] .task-mark { background: var(--bad); }
.tasks .task-text { flex: 1; min-inline-size: 0; overflow-wrap: anywhere; color: var(--text-primary); }
.tasks .task-time { flex: none; font-variant-numeric: tabular-nums; color: var(--text-subtle); }
@media (prefers-reduced-motion: reduce) { .tasks li[data-state='active'] .task-mark { animation: none; } }
.form-compact { padding: 0; box-shadow: none; background: transparent; }
.form-compact .field textarea { min-height: 72px; }

/* the viewports (ADR 0057): the project in three dimensions, four linked views or one, each with its own camera */
.stage-canvas[hidden] { display: none; }
.stage-mode { display: inline-flex; gap: var(--space); margin-inline-start: auto; }
.stage-mode .button[aria-pressed='true'] { box-shadow: inset 0 0 0 1px var(--accent); color: var(--text-primary); }
.viewports { position: relative; flex: 1; display: flex; flex-direction: column; gap: calc(var(--space) * 2); min-height: 0; }
.vp-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space); font: 400 var(--text-interface)/var(--leading-interface) var(--font-sans); color: var(--text-secondary); }
.vp-spacer { flex: 1; }
.vp-picked { display: inline-flex; flex-wrap: wrap; align-items: center; gap: calc(var(--space) * 2); color: var(--text-primary); }
.vp-hint { color: var(--text-secondary); }
.vp-button { padding: var(--space) calc(var(--space) * 2); border: 0; border-radius: var(--radius-sm, 6px); background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--line-control); color: var(--text-primary); font: inherit; cursor: pointer; }
.vp-button:hover { background: var(--surface-base); }
.vp-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.vp-button[aria-pressed='true'] { box-shadow: inset 0 0 0 1px var(--accent); }
.vp-grid { flex: 1; display: grid; gap: calc(var(--space) * 1.5); min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.vp-grid.vp-four { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.vp { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; border-radius: var(--radius-sm, 6px); background: var(--surface-inset); overflow: hidden; }   /* the viewport is dark whatever the page's theme: the drawing paints all of it */
.vp-bar { position: absolute; inset-block-start: var(--space); inset-inline-end: var(--space); z-index: 2; display: flex; align-items: center; gap: var(--space); }
.vp-name { padding: 0 calc(var(--space) * 2); font: 600 var(--text-interface)/var(--leading-interface) var(--font-sans); color: var(--text-primary); }
.vp-bar .vp-button { padding: 0 calc(var(--space) * 1.5); opacity: 0.85; }
.vp-canvas { position: relative; flex: 1; min-height: 0; cursor: crosshair; touch-action: none; }
.vp-canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.vp-canvas canvas { display: block; }
.vp-tip { position: absolute; inset-block-end: calc(var(--space) * 2); inset-inline-start: calc(var(--space) * 2); z-index: 3; padding: var(--space) calc(var(--space) * 2); border-radius: var(--radius-sm, 6px); background: var(--surface-raised); box-shadow: 0 0 0 1px var(--line-control); color: var(--text-primary); font: 500 var(--text-interface)/var(--leading-interface) var(--font-sans); pointer-events: none; }
@media (max-width: 959px) { .viewports { min-height: 62dvh; } }
