/* Neeka stylesheet, v1.0 (October 2026)
   One file for app.neeka.ai and neeka.ai. No framework, no external requests.
   Tokens first, then base, layout, components, pages.
   Layout responds to the width of .page (container queries), so the same rules
   work in the browser, in an AI app's 500 px pop-up and in design previews. */

/* ---------- Fonts: four files, 91 KB in total ---------- */
@font-face { font-family: "Neeka Sans"; src: url("fonts/neeka-sans-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Neeka Sans"; src: url("fonts/neeka-sans-semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Neeka Serif"; src: url("fonts/neeka-serif-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Neeka Serif"; src: url("fonts/neeka-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* ---------- Tokens ---------- */
:root, [data-theme="light"] {
  color-scheme: light;
  --page: #FAF8F9;
  --surface: #FFFFFF;
  --surface-sunk: #F1EDF0;
  --text: #1E1A20;
  --text-muted: #5E5662;
  --border: #E2DCE1;
  --border-strong: #8A808C;
  --ink: #1E1A20;
  --on-ink: #FAF8F9;
  --accent: #4A2648;
  --accent-field: #3A1E39;
  --on-accent: #FAF8F9;
  --on-accent-muted: #D9C6D7;
  --accent-soft: #EFE6EE;
  --focus: #7C3E79;
  --connected: #1D6B41;
  --connected-soft: #E5F1E9;
  --waiting: #8A4E00;
  --waiting-soft: #FAF0DF;
  --broken: #AE2430;
  --broken-soft: #FAE7E7;
  --on-broken: #FFFFFF;
  --hover: color-mix(in oklab, var(--text) 6%, transparent);
}
[data-theme="dark"] {
  color-scheme: dark;
  --page: #151216;
  --surface: #1E1A1F;
  --surface-sunk: #29232A;
  --text: #EFEAEF;
  --text-muted: #ADA4AF;
  --border: #342D35;
  --border-strong: #7D747F;
  --ink: #EFEAEF;
  --on-ink: #151216;
  --accent: #D9B8D6;
  --accent-field: #2F1E30;
  --on-accent: #FAF8F9;
  --on-accent-muted: #C9B5C7;
  --accent-soft: #2F2330;
  --focus: #E2C3DF;
  --connected: #76D19D;
  --connected-soft: #16291D;
  --waiting: #EBB65E;
  --waiting-soft: #2D2312;
  --broken: #F2918E;
  --broken-soft: #33191A;
  --on-broken: #151216;
  --hover: color-mix(in oklab, var(--text) 8%, transparent);
  --arch-edge: #6E4A6C;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #151216; --surface: #1E1A1F; --surface-sunk: #29232A;
    --text: #EFEAEF; --text-muted: #ADA4AF; --border: #342D35; --border-strong: #7D747F;
    --ink: #EFEAEF; --on-ink: #151216; --accent: #D9B8D6; --accent-field: #2F1E30;
    --on-accent: #FAF8F9; --on-accent-muted: #C9B5C7; --accent-soft: #2F2330; --focus: #E2C3DF;
    --connected: #76D19D; --connected-soft: #16291D; --waiting: #EBB65E; --waiting-soft: #2D2312;
    --broken: #F2918E; --broken-soft: #33191A; --on-broken: #151216;
    --hover: color-mix(in oklab, var(--text) 8%, transparent);
    --arch-edge: #6E4A6C;
  }
}
:root {
  --sans: "Neeka Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: "Neeka Serif", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --r-control: 10px; --r-panel: 14px; --r-bubble: 18px;
  --reading: 640px; --wide: 1180px;
  --gutter: 16px;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --ease-arrive: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 400 17px/1.55 var(--sans); font-kerning: normal; -webkit-font-smoothing: antialiased; }
.page { background: var(--page); color: var(--text); font: 400 17px/1.55 var(--sans); min-height: 100vh; display: flex; flex-direction: column; container: page / inline-size; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd, blockquote, figure { margin: 0; }
ul, ol { padding: 0; }
a { color: inherit; text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in oklab, currentColor 45%, transparent); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
strong, b { font-weight: 600; }
::selection { background: var(--accent-soft); color: var(--text); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }

/* ---------- Type ---------- */
.t-display { font-size: 40px; line-height: 1.04; font-weight: 600; letter-spacing: -0.028em; text-wrap: balance; }
h1, .t-h1 { font-size: 30px; line-height: 1.12; font-weight: 600; letter-spacing: -0.018em; text-wrap: balance; }
h2, .t-h2 { font-size: 21px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h3, .t-h3 { font-size: 18px; line-height: 1.35; font-weight: 600; letter-spacing: -0.004em; }
.lead { font-size: 18px; line-height: 1.5; color: var(--text-muted); text-wrap: pretty; }
.small { font-size: 15px; line-height: 1.5; }
.label { font-size: 14px; line-height: 1.4; font-weight: 600; letter-spacing: 0.004em; }
code, .code { font-family: var(--mono); font-size: 0.9em; }
.words { font-family: var(--serif); font-size: 18px; line-height: 1.55; font-weight: 400; color: var(--text); text-wrap: pretty; overflow-wrap: anywhere; }
.words--lg { font-size: 21px; line-height: 1.42; letter-spacing: -0.005em; }
.words em, .words i { font-style: italic; }
@container page (min-width: 880px) {
  .t-display { font-size: 60px; }
  h1, .t-h1 { font-size: 36px; }
  h2, .t-h2 { font-size: 23px; }
  .lead { font-size: 20px; }
  .words { font-size: 19px; }
  .words--lg { font-size: 26px; }
}

/* ---------- Layout ---------- */
.main { flex: 1; padding: var(--s6) var(--gutter) var(--s8); }
.col { max-width: var(--reading); margin: 0 auto; }
.col--wide { max-width: var(--wide); }
.col--narrow { max-width: 440px; }
.stack > * + * { margin-top: var(--s4); }
.stack-lg > * + * { margin-top: var(--s7); }
.section + .section { margin-top: var(--s7); }
.section > h2 + * { margin-top: var(--s3); }
.section > h2 + .lead, .section > h2 + p { margin-top: var(--s2); }
.page-head { margin-bottom: var(--s6); }
.page-head h1 + * { margin-top: var(--s3); }
.page-head .back { display: inline-block; margin-bottom: var(--s4); font-size: 15px; }
.row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.split { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s3); }
@container page (min-width: 560px) { :root, .page { --gutter: 24px; } .main { padding-left: 24px; padding-right: 24px; } }
@container page (min-width: 880px) { .main { padding: var(--s7) 40px var(--s9); } }

/* ---------- Header and navigation ---------- */
.site-header { border-bottom: 1px solid var(--border); background: var(--page); }
.site-header__inner { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "brand . end" "nav nav nav"; align-items: center; column-gap: var(--s5); }
.brand { grid-area: brand; display: inline-flex; align-items: center; color: var(--accent); min-height: 56px; text-decoration: none; }
.brand svg { height: 23px; width: auto; }
.site-header__end { grid-area: end; display: flex; align-items: center; gap: var(--s4); font-size: 15px; }
.site-nav { grid-area: nav; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--border); }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav ul { list-style: none; display: flex; gap: var(--s5); white-space: nowrap; }
.site-nav a { display: inline-flex; align-items: center; min-height: 46px; font-size: 15px; color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent; padding-top: 2px; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.site-nav--operator a[aria-current="page"] { border-bottom-color: var(--text); }
.role-tag { font-size: 13px; font-weight: 600; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; }
.link-button { background: none; border: 0; padding: 0; min-height: 44px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: color-mix(in oklab, currentColor 45%, transparent); }
@container page (min-width: 720px) {
  .site-header__inner { grid-template-columns: auto 1fr auto; grid-template-areas: "brand nav end"; padding: 0 40px; }
  .brand { min-height: 64px; }
  .site-nav { margin: 0; padding: 0 0 0 var(--s5); border-top: 0; align-self: stretch; display: flex; }
  .site-nav ul { align-items: stretch; }
  .site-nav a { min-height: 64px; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); }
.site-footer__inner { max-width: var(--wide); margin: 0 auto; padding: var(--s5) var(--gutter); display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); justify-content: space-between; align-items: center; font-size: 15px; color: var(--text-muted); }
.site-footer__inner .mark { width: 24px; height: 24px; }
.site-footer nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s4); }
@container page (min-width: 720px) { .site-footer__inner { padding: var(--s5) 40px; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 48px; padding: 0 20px; border-radius: var(--r-control); border: 1.5px solid transparent; font: 600 16px/1.2 var(--sans); text-decoration: none; cursor: pointer; transition: background-color 120ms var(--ease), border-color 120ms var(--ease), color 120ms var(--ease); white-space: nowrap; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--primary { background: var(--ink); color: var(--on-ink); }
.btn--primary:hover { background: color-mix(in oklab, var(--ink) 84%, var(--page)); }
.btn--primary:active { background: color-mix(in oklab, var(--ink) 74%, var(--page)); }
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface-sunk); }
.btn--danger { background: var(--broken); color: var(--on-broken); }
.btn--danger:hover { background: color-mix(in oklab, var(--broken) 86%, var(--text)); }
.btn--danger-quiet { background: var(--surface); color: var(--broken); border-color: currentColor; }
.btn--danger-quiet:hover { background: var(--broken-soft); }
.btn--small { min-height: 44px; padding: 0 14px; font-size: 15px; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { cursor: default; opacity: 0.55; }
.btn--busy { cursor: progress; }
.btn--done { color: var(--connected); border-color: currentColor; background: var(--surface); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.on-field .btn--primary { background: var(--on-accent); color: var(--accent-field); }
.on-field .btn--primary:hover { background: color-mix(in oklab, var(--on-accent) 88%, var(--accent-field)); }
.on-field .btn--secondary { background: transparent; color: var(--on-accent); border-color: color-mix(in oklab, var(--on-accent) 55%, transparent); }
.on-field .btn--secondary:hover { background: color-mix(in oklab, var(--on-accent) 10%, transparent); }
.on-field :focus-visible { outline-color: var(--on-accent); }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--s5); }
.field { display: grid; gap: var(--s2); align-content: start; }
.field > label, .field > .field__label, fieldset > legend { font-size: 15px; font-weight: 600; line-height: 1.35; }
.field__hint { font-size: 15px; color: var(--text-muted); }
.input { width: 100%; min-height: 50px; padding: 0 14px; border-radius: var(--r-control); border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 17px; transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease); }
.input::placeholder { color: var(--text-muted); }
.input:hover { border-color: var(--text-muted); }
.input:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 2px var(--focus); }
.input[aria-invalid="true"] { border-color: var(--broken); border-width: 2px; }
.input--code { width: 10ch; min-width: 9.2em; font-size: 26px; font-weight: 600; letter-spacing: 0.32em; padding: 0 0 0 0.6em; font-variant-numeric: tabular-nums; min-height: 60px; }
textarea.input { min-height: 160px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
select.input { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field__error { display: flex; gap: var(--s2); align-items: flex-start; color: var(--broken); font-size: 15px; font-weight: 600; }
.field__error svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.choice { display: flex; gap: var(--s3); align-items: flex-start; min-height: 44px; padding: 10px 0; cursor: pointer; }
.choice input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.choice__text { display: grid; gap: 2px; }
.choice__text small { font-size: 15px; color: var(--text-muted); }
.choice--box { padding: 14px 16px; border: 1.5px solid var(--border-strong); border-radius: var(--r-control); background: var(--surface); }
.choice--invalid { border-color: var(--broken); border-width: 2px; }
.form__actions { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid color-mix(in oklab, currentColor 30%, transparent); border-top-color: currentColor; animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

/* ---------- Icons ---------- */
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--16 { width: 16px; height: 16px; }
.icon--24 { width: 24px; height: 24px; }

/* ---------- Notes and callouts ---------- */
.note { display: grid; grid-template-columns: 24px 1fr; gap: var(--s3); padding: 16px 18px; border-radius: var(--r-panel); background: var(--surface-sunk); color: var(--text); font-size: 16px; line-height: 1.5; }
.note > .icon { width: 24px; height: 24px; margin-top: -1px; color: var(--text-muted); }
.note__body > * + * { margin-top: var(--s2); }
.note__title { font-weight: 600; }
.note--connected { background: var(--connected-soft); }
.note--connected > .icon { color: var(--connected); }
.note--waiting { background: var(--waiting-soft); }
.note--waiting > .icon { color: var(--waiting); }
.note--broken { background: var(--broken-soft); }
.note--broken > .icon { color: var(--broken); }
.note--outline { background: transparent; border: 1px solid var(--border); }
.note .say { margin-top: var(--s3); }

/* ---------- State labels (colour plus icon plus words) ---------- */
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.state .icon { width: 18px; height: 18px; stroke-width: 2; }
.state--connected { color: var(--connected); }
.state--waiting { color: var(--waiting); }
.state--broken { color: var(--broken); }
.state--off { color: var(--text-muted); font-weight: 400; }

/* ---------- People ---------- */
.person { --size: 32px; width: var(--size); height: var(--size); border-radius: 50%; flex: none; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 600 calc(var(--size) * 0.38)/1 var(--sans); letter-spacing: 0.02em; }
.person--you { background: var(--ink); color: var(--on-ink); }
.person--lg { --size: 48px; }
.byline { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.byline__text { display: grid; min-width: 0; line-height: 1.35; }
.byline__name { font-weight: 600; overflow-wrap: anywhere; }
.byline__meta { font-size: 15px; color: var(--text-muted); }

/* ---------- Connection line: the app's signature ---------- */
.connection { margin: var(--s5) 0 var(--s2); padding: 20px; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface); }
.bleed { position: relative; }
@container page (min-width: 960px) { .bleed { width: min(900px, calc(100cqw - 80px)); left: 50%; transform: translateX(-50%); } }
.connection__track { list-style: none; display: grid; }
.cnode, .clink { display: grid; grid-template-columns: 52px 1fr; column-gap: var(--s4); }
.cnode__token { grid-column: 1; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--border); color: var(--text); font: 600 18px/1 var(--sans); position: relative; z-index: 1; }
.cnode__token--you { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.cnode__token--agent { border-radius: 14px; }
.cnode__token--agent .icon { width: 26px; height: 26px; }
.cnode__token--neeka { border-radius: 14px; background: var(--accent); border-color: var(--accent); color: var(--page); }
.cnode__token--neeka svg { width: 30px; height: 30px; }
.cnode__token--empty { border-style: dashed; border-color: var(--border-strong); background: var(--surface); color: var(--text-muted); }
.cnode__text { grid-column: 2; align-self: center; display: grid; line-height: 1.3; min-width: 0; }
.cnode__name { font-weight: 600; font-size: 17px; overflow-wrap: anywhere; }
.cnode__role { font-size: 15px; color: var(--text-muted); }
.clink__line { grid-column: 1; grid-row: 1 / span 2; justify-self: center; width: 2px; min-height: 76px; margin: 4px 0; position: relative; background: var(--connected); color: var(--connected); }
.clink__badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid currentColor; }
.clink__badge .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.clink__text { grid-column: 2; grid-row: 1; align-self: end; display: grid; gap: 2px; padding-top: var(--s3); font-size: 15px; line-height: 1.35; }
.clink__label { font-weight: 600; color: var(--connected); }
.clink__detail { color: var(--text-muted); }
.wake { grid-column: 2; grid-row: 2; align-self: start; display: flex; align-items: center; gap: 6px; padding-bottom: var(--s3); font-size: 14px; line-height: 1.35; color: var(--text-muted); }
.wake .state { font-size: 14px; }
.wake .state .icon { width: 16px; height: 16px; }
.clink--waiting .clink__line { color: var(--waiting); background: repeating-linear-gradient(to bottom, var(--waiting) 0 6px, transparent 6px 12px); }
.clink--waiting .clink__label { color: var(--waiting); }
.clink--broken .clink__line { color: var(--broken); background: linear-gradient(to bottom, var(--broken) 0 30%, transparent 30% 70%, var(--broken) 70%); }
.clink--broken .clink__label { color: var(--broken); }
.clink--off .clink__line { color: var(--text-muted); background: repeating-linear-gradient(to bottom, var(--border-strong) 0 2px, transparent 2px 8px); }
.clink--off .clink__label { color: var(--text-muted); }
@container page (min-width: 720px) {
  .connection { margin-top: var(--s6); padding: 32px 24px 28px; }
  .connection__track { display: flex; align-items: flex-start; }
  .cnode { display: flex; flex-direction: column; align-items: center; text-align: center; width: 144px; flex: none; gap: var(--s2); }
  .cnode__text { align-self: auto; }
  .clink { flex: 1 1 0; min-width: 0; display: grid; grid-template-columns: 1fr; grid-template-rows: 52px auto auto; margin: 0 -46px; }
  .clink__line { grid-row: 1; grid-column: 1; align-self: center; justify-self: stretch; width: auto; height: 2px; min-height: 0; margin: 0; }
  .clink__text { grid-row: 2; grid-column: 1; align-self: start; text-align: center; padding: var(--s2) 54px 0; }
  .wake { grid-row: 3; grid-column: 1; justify-content: center; text-align: center; padding: 6px 54px 0; }
  .clink--waiting .clink__line { background: repeating-linear-gradient(to right, var(--waiting) 0 8px, transparent 8px 14px); }
  .clink--broken .clink__line { background: linear-gradient(to right, var(--broken) 0 38%, transparent 38% 62%, var(--broken) 62%); }
  .clink--off .clink__line { background: repeating-linear-gradient(to right, var(--border-strong) 0 2px, transparent 2px 8px); }
}

/* ---------- Details lists and stats ---------- */
.kv { display: grid; border-top: 1px solid var(--border); }
.kv > div { display: grid; gap: 2px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.kv dt { font-size: 15px; color: var(--text-muted); }
.kv dd { overflow-wrap: anywhere; }
.kv dd > * + * { margin-top: var(--s2); }
@container page (min-width: 560px) { .kv > div { grid-template-columns: 180px 1fr; gap: var(--s4); } }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.stat { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface); }
.stat__n { display: block; font-size: 30px; line-height: 1.1; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat__label { font-size: 15px; color: var(--text-muted); }
@container page (min-width: 560px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 9px; min-height: 32px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 14px; line-height: 1.3; color: var(--text); }
.chip .icon { width: 16px; height: 16px; color: var(--text-muted); }
.chip--inferred { border-style: dashed; background: transparent; }
.chip--plain { padding-left: 12px; }

/* ---------- Say this to your agent ---------- */
.say { display: grid; gap: var(--s2); justify-items: end; }
.say__label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text-muted); }
.say__label .icon { width: 18px; height: 18px; }
.say__row { display: flex; align-items: flex-end; gap: var(--s2); max-width: 100%; justify-content: flex-end; }
.say__bubble { background: var(--surface-sunk); color: var(--text); border-radius: var(--r-bubble) var(--r-bubble) 6px var(--r-bubble); padding: 11px 16px; font-size: 17px; line-height: 1.45; max-width: 34em; overflow-wrap: anywhere; white-space: pre-line; }
.say__bubble--long { font-size: 16px; max-height: 16.5em; overflow: auto; text-align: left; }
.say--left { justify-items: start; }
.say--left .say__row { justify-content: flex-start; }
.copy { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: var(--r-control); border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); font: 600 15px/1 var(--sans); cursor: pointer; flex: none; }
.copy .icon { width: 18px; height: 18px; }
.copy:hover { background: var(--surface-sunk); }
.copy--done { color: var(--connected); border-color: currentColor; }
.say-group { display: grid; gap: var(--s4); }

/* ---------- Do this in your AI app ---------- */
.elsewhere { border: 1.5px dashed var(--border-strong); border-radius: var(--r-panel); background: transparent; overflow: hidden; }
.elsewhere__bar { display: flex; align-items: center; gap: var(--s2); padding: 10px 16px; border-bottom: 1.5px dashed var(--border-strong); font-size: 15px; font-weight: 600; }
.elsewhere__bar .icon { width: 20px; height: 20px; color: var(--text-muted); }
.elsewhere__bar span { color: var(--text-muted); font-weight: 400; }
.elsewhere__body { padding: 16px; }
.elsewhere__foot { padding: 12px 16px; border-top: 1px solid var(--border); font-size: 15px; color: var(--text-muted); }
.ui { font-weight: 600; white-space: nowrap; padding: 1px 6px; border-radius: 6px; background: var(--surface-sunk); border: 1px solid var(--border); font-size: 0.94em; }

/* ---------- Do this here: numbered steps ---------- */
.steps { list-style: none; counter-reset: step; display: grid; gap: var(--s4); }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; gap: var(--s3); }
.steps > li::before { content: counter(step); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-sunk); font: 600 14px/1 var(--sans); font-variant-numeric: tabular-nums; margin-top: -1px; }
.steps > li > * + * { margin-top: var(--s2); }

/* ---------- Journey: where each step happens ---------- */
.journey { list-style: none; display: grid; gap: 0; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface); overflow: hidden; }
.journey--4 { --count: 4; }
.journey--5 { --count: 5; }
.journey > li { display: grid; grid-template-columns: 36px 1fr; gap: var(--s3); align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); }
.journey > li:first-child { border-top: 0; }
.journey__where { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-sunk); color: var(--text-muted); }
.journey__where--here { background: var(--accent-soft); color: var(--accent); }
.journey__where--here svg { width: 16px; height: 18px; }
.journey__where--app { background: transparent; border: 1.5px dashed var(--border-strong); }
.journey__what { display: grid; line-height: 1.35; }
.journey__what b { font-size: 16px; }
.journey__what span { font-size: 14px; color: var(--text-muted); }
.journey__n { font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 600; margin-right: 4px; }
@container page (min-width: 880px) {
  .journey { grid-template-columns: repeat(var(--count, 4), minmax(0, 1fr)); }
  .journey > li { grid-template-columns: 1fr; align-content: start; gap: var(--s2); border-top: 0; border-left: 1px solid var(--border); padding: 16px; }
  .journey > li:first-child { border-left: 0; }
}

/* ---------- Connector address ---------- */
.address { border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface); padding: 16px; display: grid; gap: var(--s3); }
.address__label { font-size: 15px; font-weight: 600; }
.address__row { display: grid; gap: var(--s3); }
.address__value { font-family: var(--mono); font-size: 16px; line-height: 1.4; padding: 12px 14px; border-radius: var(--r-control); background: var(--surface-sunk); overflow-wrap: anywhere; user-select: all; }
.address__note { font-size: 15px; color: var(--text-muted); }
.address .copy { width: 100%; min-height: 48px; }
@container page (min-width: 560px) {
  .address__row { grid-template-columns: 1fr auto; align-items: stretch; }
  .address .copy { width: auto; padding: 0 18px; }
}

/* ---------- App chooser ---------- */
.apps { list-style: none; display: grid; gap: var(--s3); }
.app-card { display: grid; grid-template-columns: 44px 1fr auto; gap: var(--s3); align-items: center; padding: 14px 16px; min-height: 76px; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface); text-decoration: none; transition: border-color 120ms var(--ease), background-color 120ms var(--ease); }
.app-card:hover { border-color: var(--border-strong); background: color-mix(in oklab, var(--surface) 70%, var(--surface-sunk)); }
.app-card__initial { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-sunk); font: 600 17px/1 var(--sans); color: var(--text); }
.app-card__name { font-weight: 600; font-size: 18px; line-height: 1.3; }
.app-card__where { font-size: 15px; color: var(--text-muted); }
.app-card__go { font-size: 15px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in oklab, currentColor 45%, transparent); }
@container page (min-width: 560px) { .apps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Answers, threads and people's words ---------- */
.question-card { padding: 20px 22px; border-radius: var(--r-panel); background: var(--surface); border: 1px solid var(--border); }
.question-card .words { margin-top: var(--s3); }
.thread { display: grid; gap: var(--s5); }
.thread__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.msg { display: grid; gap: var(--s3); padding: 18px 20px; border-radius: var(--r-panel); background: var(--surface); border: 1px solid var(--border); }
.msg--mine { background: var(--surface-sunk); border-color: transparent; }
.msg__followup { font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.5; }
.msg__followup span { font-family: var(--sans); font-style: normal; font-size: 14px; font-weight: 600; color: var(--text-muted); margin-right: 6px; }
.msg--erased { background: transparent; border: 1.5px dashed var(--border-strong); }
.msg--erased p { color: var(--text-muted); font-size: 16px; }
.answers > * + * { margin-top: var(--s6); }
.privacy-line { display: flex; gap: var(--s2); align-items: flex-start; font-size: 15px; color: var(--text-muted); }
.privacy-line .icon { margin-top: 2px; }

/* ---------- Lists of conversations ---------- */
.list { list-style: none; border-top: 1px solid var(--border); }
.list > li { border-bottom: 1px solid var(--border); }
.list__link { display: grid; gap: var(--s2); padding: 18px 4px; text-decoration: none; }
.list__link:hover { background: var(--hover); }
.list__q { font-family: var(--serif); font-size: 18px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list__meta { display: flex; flex-wrap: wrap; gap: 4px var(--s4); align-items: center; font-size: 15px; color: var(--text-muted); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--surface-sunk); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }

/* ---------- Empty states ---------- */
.empty { display: grid; grid-template-columns: 56px 1fr; gap: var(--s4); align-items: start; padding: 20px; border-radius: var(--r-panel); border: 1px solid var(--border); background: var(--surface); }
.empty__art { width: 56px; height: 64px; color: var(--accent); }
.empty__body > * + * { margin-top: var(--s2); }
.empty__body h3 { font-size: 17px; }
.empty__body p { color: var(--text-muted); font-size: 16px; }
.empty .say { justify-items: start; margin-top: var(--s3); }
.empty .say__row { justify-content: flex-start; }

/* ---------- Operator tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 14px; font-weight: 600; color: var(--text-muted); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--hover); }
.table .person { --size: 28px; }
.table .cell-person { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.table .cell-person b { display: block; font-weight: 600; }
.table .cell-person span { display: block; color: var(--text-muted); font-size: 14px; overflow-wrap: anywhere; }
.table .nowrap { white-space: nowrap; }
.table .right { text-align: right; }
.table .q { font-family: var(--serif); font-size: 16px; min-width: 260px; max-width: 420px; }
.table code { font-size: 14px; }
.table .row--selected td { background: var(--broken-soft); }
.table-caption { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.table-caption p { font-size: 15px; color: var(--text-muted); }

/* ---------- Operator cards ---------- */
.cards { display: grid; gap: var(--s4); }
@container page (min-width: 880px) { .cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card { border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface); padding: 20px; display: grid; gap: var(--s4); align-content: start; }
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); flex-wrap: wrap; }
.card__title { font-size: 19px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.card__sub { font-size: 15px; color: var(--text-muted); }
.people-row { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); list-style: none; }
.people-row li { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.people-row .person { --size: 26px; }
.card--off { background: transparent; border-style: dashed; border-color: var(--border-strong); }

/* ---------- Drafts (operator) ---------- */
.draft { display: grid; gap: var(--s2); }
.draft__head { display: flex; flex-wrap: wrap; gap: 4px var(--s3); align-items: baseline; font-size: 15px; }
.draft__head b { font-weight: 600; }
.draft__head span { color: var(--text-muted); }
.draft__body { padding: 14px 16px; border-radius: var(--r-control); background: var(--surface-sunk); }
.draft--superseded .draft__body { background: transparent; border: 1.5px dashed var(--border-strong); color: var(--text-muted); }
.draft--superseded .words { color: var(--text-muted); }
.version { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; }
.version--published { color: var(--connected); }
.version--pending { color: var(--waiting); }
.version--dropped { color: var(--text-muted); }
.branch { border-left: 2px solid var(--border); padding-left: var(--s5); display: grid; gap: var(--s5); }
.events { list-style: none; display: grid; gap: var(--s2); font-size: 15px; }
.events li { display: grid; grid-template-columns: 116px 1fr; gap: var(--s3); }
.events time { color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ---------- Messages and errors ---------- */
.message { max-width: 520px; margin: 0 auto; padding-top: var(--s5); display: grid; gap: var(--s4); justify-items: start; }
.message__art { width: 56px; height: 64px; color: var(--accent); }
.message__art--broken { color: var(--broken); }
.message p { color: var(--text-muted); }
.message .btn-row { margin-top: var(--s2); }
.code-hint { font-size: 14px; color: var(--text-muted); }

/* ---------- Consent ---------- */
.consent { display: grid; gap: var(--s5); }
.consent__summary { font-size: 17px; }
.consent__then { display: grid; gap: var(--s3); padding: 16px 18px; border-radius: var(--r-panel); background: var(--accent-soft); }
.consent__then .say__bubble { background: var(--surface); }
.consent__then .say { justify-items: start; }
.consent__then .say__row { justify-content: flex-start; }
.consent__actions { display: grid; gap: var(--s3); }
.consent__actions .btn { width: 100%; }
@container page (min-width: 560px) { .consent__actions { display: flex; } .consent__actions .btn { width: auto; min-width: 140px; } }
.can-list { list-style: none; display: grid; gap: var(--s2); }
.can-list li { display: grid; grid-template-columns: 20px 1fr; gap: var(--s3); font-size: 16px; }
.can-list .icon { margin-top: 3px; color: var(--text-muted); }
.signed-as { font-size: 15px; color: var(--text-muted); }
.signed-as b { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Disclosure (works without JavaScript) ---------- */
details.more { border-top: 1px solid var(--border); }
details.more:last-of-type { border-bottom: 1px solid var(--border); }
details.more > summary { list-style: none; cursor: pointer; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); font-weight: 600; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: ""; width: 9px; height: 9px; border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform 220ms var(--ease); flex: none; }
details.more[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
details.more > div { padding: 0 0 var(--s5); }
details.more > div > * + * { margin-top: var(--s3); }

/* ---------- Home (app.neeka.ai, signed out) ---------- */
.home { display: grid; gap: var(--s6); }
.home__mark { width: 56px; height: 56px; }
.home__paths { display: grid; gap: var(--s3); }
.path-card { display: grid; gap: var(--s2); padding: 20px; border-radius: var(--r-panel); border: 1px solid var(--border); background: var(--surface); }
.path-card .btn { justify-self: start; margin-top: var(--s2); }
@container page (min-width: 560px) { .home__paths { grid-template-columns: 1fr 1fr; } }

/* ---------- Front door (neeka.ai) ---------- */
.fd-field { background: var(--accent-field); color: var(--on-accent); }
.fd-header { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: var(--s4); }
.fd-header .brand { color: var(--on-accent); }
.fd-header a:not(.brand) { color: var(--on-accent); font-size: 16px; min-height: 44px; display: inline-flex; align-items: center; }
.fd-hero { max-width: var(--wide); margin: 0 auto; padding: var(--s5) var(--gutter) 0; display: grid; gap: var(--s6); }
.fd-hero__copy { display: grid; gap: var(--s5); align-content: start; }
.fd-hero__copy .t-display { color: var(--on-accent); }
.fd-hero__copy p { font-size: 18px; line-height: 1.5; color: var(--on-accent-muted); max-width: 30em; text-wrap: pretty; }
.fd-hero__fine { font-size: 15px !important; }
.fd-hero__fine a { color: var(--on-accent); }
.arch { display: flex; flex-direction: column; gap: 10px; padding-bottom: var(--s5); color: var(--text); }
.arch .say { justify-items: end; }
.arch .say__label { font-size: 13px; color: var(--on-accent-muted); }
.arch .say__bubble { font-size: 15px; padding: 9px 13px; background: var(--on-accent); color: var(--accent-field); }
.arch__answer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); padding: 12px 14px; display: grid; gap: 8px; }
.arch__answer .words { font-size: 15.5px; line-height: 1.45; }
.arch__answer .byline__text { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
.arch__answer .byline__meta { font-size: 13px; }
.arch__answer .byline__name { font-size: 15px; }
.arch__answer .person { --size: 28px; }
.arch__answer .chip { font-size: 12.5px; min-height: 26px; padding: 2px 10px 2px 7px; }
.arch__answer .chip .icon { width: 14px; height: 14px; }
.approved-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--connected); }
.approved-tag .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.fd-main { flex: 1; width: 100%; max-width: var(--wide); margin: 0 auto; padding: var(--s6) var(--gutter) var(--s7); }
.fd-points { display: grid; gap: var(--s6); }
.fd-points h2 { margin-bottom: var(--s2); }
.fd-points p { color: var(--text-muted); max-width: 34em; text-wrap: pretty; }
@container page (min-width: 720px) {
  .fd-header { padding: 0 40px; min-height: 64px; }
  .fd-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: var(--s4) 40px 0; align-items: end; column-gap: var(--s7); }
  .fd-hero__copy { padding-bottom: var(--s6); }
  /* The arch: the example sits in a doorway on wider screens; on a phone it's straight on the field. */
  /* A flattened arch (elliptical top), so the doorway frames the example without a tall empty crown. */
  .arch { justify-self: end; width: min(100%, 520px); border-radius: 50% 50% 0 0 / 130px 130px 0 0; border: 1.5px solid var(--arch-edge, transparent); border-bottom: 0; background: var(--page); padding: 0 22px 22px; }
  .arch::before { content: ""; display: block; flex: none; height: 60px; }
  .arch .say__label { color: var(--text-muted); }
  .arch .say__bubble { background: var(--ink); color: var(--on-ink); }
  .fd-main { padding: var(--s5) 40px var(--s6); }
}
@container page (min-width: 880px) {
  .fd-points { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s7); }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Action lists (settings) ---------- */
.actions-list { list-style: none; display: grid; border-top: 1px solid var(--border); }
.actions-list li { display: grid; grid-template-columns: 24px 1fr; gap: var(--s3); align-items: start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.actions-list li > .icon { margin-top: 12px; color: var(--text-muted); }
.actions-list .act { display: grid; }
.actions-list .act a, .actions-list .act .link-button { justify-self: start; min-height: 44px; display: inline-flex; align-items: center; font-weight: 600; }
.actions-list .act small { font-size: 15px; color: var(--text-muted); margin-top: -6px; }
.actions-list .act--danger a, .actions-list .act--danger .link-button { color: var(--broken); }

/* ---------- Long message for your agent ---------- */
.say-block { border-radius: var(--r-panel); background: var(--surface-sunk); overflow: hidden; }
.say-block__bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--border); }
.say-block__bar .say__label { color: var(--text-muted); }
.say-block__text { padding: 14px 16px 16px; font-size: 16px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.say-block .copy { background: var(--surface); }

/* ---------- Footer mark ---------- */
.foot-brand { display: inline-flex; align-items: center; gap: 10px; }
.foot-brand svg { width: 20px; height: 22px; color: var(--accent); }

/* ---------- Utilities (kept few, so pages need no inline styles under a strict CSP) ---------- */
.mt-0 { margin-top: 0 !important; } .mt-2 { margin-top: var(--s2); } .mt-3 { margin-top: var(--s3); }
.mt-4 { margin-top: var(--s4); } .mt-5 { margin-top: var(--s5); } .mt-7 { margin-top: var(--s7); }
.pt-0 { padding-top: 0 !important; }
.spacer-6 { height: var(--s6); } .spacer-7 { height: var(--s7); }
.grid-gap-4 { display: grid; gap: var(--s4); } .grid-gap-6 { display: grid; gap: var(--s6); } .grid-gap-7 { display: grid; gap: var(--s7); }
.fw-normal { font-weight: 400; } .text-strong { color: var(--text); }
.cell-wide { min-width: 140px; } .cell-180 { min-width: 180px; }
.cards--1 { grid-template-columns: 1fr; }
.card--danger { border-color: var(--broken); margin-bottom: var(--s5); }
.form-grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.alert-disc { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--broken-soft); color: var(--broken); }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Added in the build ---------- */
/* Copy buttons start hidden and neeka.js reveals them, so a page without the script shows no dead button. */
.copy[hidden] { display: none; }
