/* nico · Chart — component stylesheet. Every color, length and shadow is a token from tokens.css; classes are prefixed nc-. */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; font-family: var(--font-sans); font-size: 14px; line-height: 20px; background: var(--surface); color: var(--ink); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
p { margin: 0; }
a { color: var(--accent); }

/* preview stages (layout only) */
.nc-stage { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-4); }
.nc-stack { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-3); padding: var(--space-4); }
.nc-stage-note { width: 100%; font-size: 12px; line-height: 16px; color: var(--ink-faint); }

/* icons: 16-unit stroke glyphs, 1.5px, round caps */
.nc-icon { width: var(--icon); height: var(--icon); flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* focus: one ring everywhere */
.nc-btn:focus-visible, .nc-issue-row:focus-visible, .nc-mention:focus-visible, .nc-link:focus-visible, .nc-palette-item:focus-visible, .nc-related a:focus-visible, .nc-kbd:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.nc-input:focus-within, .nc-composer-box:focus-within { box-shadow: var(--focus-ring); border-color: var(--accent); }

/* ---- controls ---- */
.nc-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--control); padding: 0 var(--space-4); border-radius: var(--radius-sm); border: 1px solid var(--line-control); background: var(--surface-raised); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; }
.nc-btn:hover { background: var(--surface-sunken); }
.nc-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.nc-btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.nc-btn-danger { color: var(--state-failed); border-color: var(--state-failed); }
.nc-btn-danger:hover { background: var(--state-failed-soft); }
.nc-btn-quiet { border-color: transparent; background: transparent; color: var(--ink-muted); }
.nc-btn-quiet:hover { background: var(--surface-sunken); color: var(--ink); }
.nc-btn-sm { height: 26px; padding: 0 var(--space-3); font-size: 13px; }
.nc-btn[disabled], .nc-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.nc-btn .nc-kbd { margin-left: var(--space-1); }

.nc-kbd { display: inline-block; font-family: var(--font-mono); font-size: 11px; line-height: 16px; padding: 0 5px; border: 1px solid var(--line-control); border-bottom-width: 2px; border-radius: var(--radius-sm); color: var(--ink-muted); background: var(--surface); }

.nc-field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.nc-field > label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-muted); }
.nc-input { display: flex; align-items: center; gap: var(--space-2); height: var(--control); padding: 0 var(--space-3); border: 1px solid var(--line-control); border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--ink); font: inherit; }
.nc-input input { flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; font: inherit; outline: none; padding: 0; }
.nc-input input::placeholder { color: var(--ink-faint); }
.nc-input .nc-icon { color: var(--ink-faint); }
.nc-input.is-invalid { border-color: var(--state-failed); }
.nc-input.is-readonly { background: var(--surface-sunken); }
.nc-help { font-size: 13px; line-height: 18px; color: var(--ink-faint); }
.nc-error { font-size: 13px; line-height: 18px; color: var(--state-failed); }

/* ---- actors ---- */
.nc-avatar { width: var(--avatar); height: var(--avatar); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; line-height: 1; font-weight: 700; flex: none; }
.nc-avatar-agent { background: var(--actor-agent); color: var(--on-accent); border-radius: var(--radius-md); }
.nc-avatar-human { background: var(--actor-human); color: var(--ink-muted); border: 1px solid var(--line); border-radius: var(--radius-full); }
.nc-avatar-sm { width: 20px; height: 20px; font-size: 10px; }
.nc-avatar-sm.nc-avatar-agent { border-radius: var(--radius-sm); }

/* ---- status: badges and provenance tags ---- */
.nc-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; line-height: 18px; font-weight: 600; letter-spacing: .01em; padding: 0 var(--space-2); border-radius: var(--radius-full); border: 1px solid transparent; white-space: nowrap; }
.nc-badge .nc-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.nc-badge .nc-icon { width: 10px; height: 10px; stroke-width: 2; }
.nc-badge-open { color: var(--state-open); border-color: var(--line-control); }
.nc-badge-working { color: var(--state-working); background: var(--state-working-soft); }
.nc-badge-working .nc-dot { animation: nc-pulse 1.6s ease-in-out infinite; }
.nc-badge-waiting { color: var(--state-waiting); background: var(--state-waiting-soft); border-color: var(--line); }
.nc-badge-needs-you { color: var(--state-needs-you); background: var(--state-needs-you-soft); }
.nc-badge-done { color: var(--state-done); padding-left: 0; }
.nc-badge-failed { color: var(--state-failed); background: var(--state-failed-soft); }
@keyframes nc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .nc-badge-working .nc-dot { animation: none; } }

.nc-prov { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; line-height: 18px; font-weight: 600; padding: 0 var(--space-2); border-radius: var(--radius-full); border: 1px solid currentColor; white-space: nowrap; }
.nc-prov-verified { color: var(--provenance-verified); }
.nc-prov-extracted { color: var(--provenance-extracted); }
.nc-prov-inferred { color: var(--provenance-inferred); border-style: dashed; border-color: var(--line-control); }

/* ---- objects: mentions and the preview card ---- */
.nc-mention { display: inline-flex; align-items: center; gap: 5px; padding: 0 var(--space-2) 0 5px; border-radius: var(--radius-full); background: var(--accent-soft); color: var(--accent); font-weight: 500; line-height: 20px; text-decoration: none; cursor: pointer; vertical-align: baseline; white-space: nowrap; }
.nc-mention:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
.nc-mention .nc-icon { width: 12px; height: 12px; }
.nc-mention .code { font-family: var(--font-mono); font-size: 13px; }

.nc-popcard { width: 300px; max-width: 100%; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }
.nc-popcard-type { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); display: flex; align-items: center; gap: var(--space-1); }
.nc-popcard-title { font-weight: 600; }
.nc-popcard-foot { display: flex; justify-content: space-between; gap: var(--space-2); font-size: 12px; line-height: 16px; color: var(--ink-faint); border-top: 1px solid var(--line); padding-top: var(--space-2); }

/* ---- issue list ---- */
.nc-site { display: flex; align-items: center; gap: var(--space-3); height: var(--space-12); padding: 0 var(--space-3); border-bottom: 1px solid var(--line); }
.nc-mark { width: 22px; height: 22px; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.nc-site-name { font-weight: 600; line-height: 18px; }
.nc-site-sub { font-size: 11px; line-height: 14px; color: var(--ink-faint); }
.nc-site .nc-kbd { margin-left: auto; }
.nc-section { padding: var(--space-3) var(--space-2) var(--space-1); display: flex; flex-direction: column; }
.nc-section-h { display: flex; align-items: center; gap: var(--space-2); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); padding: 0 var(--space-2) var(--space-2); }
.nc-count { margin-left: auto; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0; color: var(--ink-faint); }
.nc-issue-row { display: grid; grid-template-columns: var(--icon) minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; min-height: var(--row); padding: 5px var(--space-2); border-radius: var(--radius-md); color: var(--ink); text-decoration: none; }
.nc-issue-row:hover { background: var(--surface-sunken); }
.nc-issue-row.is-selected { background: var(--surface-raised); box-shadow: 0 0 0 1px var(--line); }
.nc-issue-row > .nc-icon { color: var(--ink-faint); }
.nc-issue-row-title { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-issue-row-sub { display: block; font-size: 13px; line-height: 18px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-issue-key { font-family: var(--font-mono); font-size: 12px; line-height: 16px; color: var(--ink-faint); }

/* ---- issue header ---- */
.nc-issue-header { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); background: var(--surface-raised); }
.nc-issue-header-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.nc-issue-title { font-size: 16px; line-height: 22px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.nc-props { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.nc-props b { color: var(--ink); font-weight: 500; }
.nc-due { margin-left: auto; font-size: 13px; line-height: 18px; color: var(--ink-faint); }

/* ---- thread ---- */
.nc-thread { display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-4); background: var(--surface-raised); }
.nc-event { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; line-height: 18px; color: var(--actor-system); }
.nc-event::before { content: ""; width: 6px; height: 6px; border: 1px solid currentColor; transform: rotate(45deg); flex: none; }
.nc-entry { display: grid; grid-template-columns: var(--avatar) minmax(0, 1fr); gap: 0 var(--space-3); }
.nc-entry > .nc-avatar { grid-row: 1 / span 2; }
.nc-entry-head { display: flex; align-items: baseline; gap: var(--space-2); font-size: 13px; line-height: 18px; margin-bottom: var(--space-1); }
.nc-entry-name { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); }
.nc-entry-role { color: var(--ink-faint); }
.nc-entry-time { margin-left: auto; color: var(--ink-faint); font-family: var(--font-mono); font-size: 12px; }
.nc-entry-body { grid-column: 2; display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.nc-prose { margin: 0; max-width: var(--measure); }
.nc-prose strong { font-weight: 600; }

/* ---- action block (result card) ---- */
.nc-result { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-sunken); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-sm); }
.nc-result-head { display: flex; align-items: center; gap: var(--space-2); padding: 7px var(--space-3); background: var(--surface-raised); font-size: 13px; line-height: 18px; font-weight: 600; }
.nc-result-head + .nc-fields, .nc-result-head + .nc-result-body { border-top: 1px solid var(--line); }
.nc-result-status { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-sunken); color: var(--state-done); flex: none; }
.nc-result-status .nc-icon { width: 10px; height: 10px; stroke-width: 2; }
.nc-result.is-running .nc-result-status { background: var(--state-working-soft); color: var(--state-working); }
.nc-result.is-running .nc-result-status .nc-icon { animation: nc-pulse 1.6s ease-in-out infinite; }
.nc-result.is-failed .nc-result-status { background: var(--state-failed-soft); color: var(--state-failed); }
.nc-result.is-waiting .nc-result-status { background: var(--state-needs-you-soft); color: var(--state-needs-you); }
.nc-result-head .nc-badge, .nc-result-head .nc-prov, .nc-result-head .nc-clock { margin-left: auto; }
.nc-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: var(--space-2) var(--space-4); padding: var(--space-3); margin: 0; }
.nc-fields > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nc-fields dt { font-size: 11px; line-height: 14px; color: var(--ink-faint); }
.nc-fields dd { margin: 0; font-size: 13px; line-height: 18px; color: var(--ink); overflow-wrap: anywhere; }
.nc-fields dd.is-flag { color: var(--state-needs-you); font-weight: 600; }
.nc-fields .code, .nc-kv .code, .nc-banner .code, .nc-prose .code { font-family: var(--font-mono); font-size: 13px; }
.nc-result-body { padding: var(--space-3); font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.nc-result-foot { padding: 6px var(--space-3); font-size: 12px; line-height: 16px; color: var(--ink-faint); border-top: 1px dashed var(--line); }
@media (prefers-reduced-motion: reduce) { .nc-result.is-running .nc-result-status .nc-icon { animation: none; } }

/* ---- approval gate: a band, not a rail ---- */
.nc-gate { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-raised); box-shadow: var(--shadow-md); overflow: hidden; }
.nc-gate-head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); background: var(--state-needs-you-soft); color: var(--state-needs-you); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.nc-gate-head .nc-clock { margin-left: auto; letter-spacing: 0; text-transform: none; }
.nc-gate-body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4) var(--space-4); }
.nc-gate-title { font-size: 16px; line-height: 22px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.nc-gate-detail { font-size: 13px; line-height: 18px; color: var(--ink-muted); margin: 0; }
.nc-gate-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-1); }
.nc-gate-note { margin-left: auto; font-size: 12px; line-height: 16px; color: var(--ink-faint); }
.nc-gate.is-decided { box-shadow: none; }
.nc-gate.is-decided .nc-gate-head { background: var(--surface-sunken); color: var(--ink-muted); }
.nc-gate-decision { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; line-height: 18px; color: var(--ink-muted); }

/* ---- composer ---- */
.nc-composer { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line); background: var(--surface-raised); }
.nc-composer-box { display: flex; align-items: center; gap: var(--space-2); border: 1px solid var(--line-control); border-radius: var(--radius-lg); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3); background: var(--surface); }
.nc-composer-box textarea, .nc-composer-box input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); resize: none; outline: none; padding: 0; }
.nc-composer-box ::placeholder { color: var(--ink-faint); }
.nc-composer-hint { display: flex; align-items: center; gap: var(--space-2); font-size: 12px; line-height: 16px; color: var(--ink-faint); padding-top: var(--space-2); }

/* ---- inspector sheet ---- */
.nc-sheet { display: flex; flex-direction: column; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.nc-sheet-head { display: flex; align-items: center; gap: var(--space-2); min-height: var(--space-12); padding: 0 var(--space-3); background: var(--accent-soft); color: var(--ink-muted); font-size: 13px; line-height: 18px; border-bottom: 1px solid var(--line); }
.nc-crumb { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.nc-crumb b { color: var(--ink); font-weight: 600; }
.nc-crumb .nc-issue-key { color: var(--ink-muted); }
.nc-sheet-actions { display: flex; gap: var(--space-2); color: var(--ink-muted); }
.nc-sheet-body { flex: 1; min-height: 0; overflow: auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); }
.nc-banner { display: flex; flex-direction: column; gap: var(--space-1); }
.nc-banner-name { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.nc-banner-ids { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.nc-banner-flags { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1); }
.nc-card { border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3); background: var(--surface); display: flex; flex-direction: column; gap: var(--space-2); box-shadow: var(--shadow-sm); }
.nc-card-h { display: flex; align-items: center; gap: var(--space-2); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); }
.nc-card-h .nc-link { margin-left: auto; font-size: 13px; line-height: 18px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.nc-link { color: var(--accent); text-decoration: none; }
.nc-link:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
.nc-kv { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--space-1) var(--space-3); font-size: 13px; line-height: 18px; margin: 0; }
.nc-kv dt { color: var(--ink-faint); }
.nc-kv dd { margin: 0; color: var(--ink); min-width: 0; }
.nc-bar { height: 6px; border-radius: 3px; background: var(--surface-sunken); border: 1px solid var(--line); overflow: hidden; margin-top: var(--space-1); }
.nc-bar > i { display: block; height: 100%; background: var(--ink-muted); }
.nc-related { display: flex; flex-direction: column; gap: var(--space-1); }
.nc-related a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; min-height: 26px; color: var(--ink); text-decoration: none; font-size: 13px; line-height: 18px; border-radius: var(--radius-sm); }
.nc-related a:hover { color: var(--accent-strong); }
.nc-related a > span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- series timeline ---- */
.nc-series { display: flex; flex-direction: column; gap: var(--space-1); }
.nc-series-track { display: flex; align-items: center; gap: var(--space-1); }
.nc-series-dose { flex: 1; height: 4px; border-radius: 2px; background: var(--ink-muted); }
.nc-series-dose.is-next { background: var(--accent); }
.nc-series-dose.is-future { background: var(--surface-sunken); border: 1px solid var(--line); }
.nc-series-dose.is-held { background: var(--state-needs-you-soft); border: 1px solid var(--state-needs-you); }
.nc-series-labels { display: flex; justify-content: space-between; font-size: 12px; line-height: 16px; color: var(--ink-faint); }

/* ---- payer clock ---- */
.nc-clock { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; line-height: 16px; color: var(--ink-muted); white-space: nowrap; }
.nc-clock-track { width: 56px; height: 4px; border-radius: 2px; background: var(--surface-sunken); border: 1px solid var(--line); overflow: hidden; }
.nc-clock-track > i { display: block; height: 100%; background: var(--ink-muted); }
.nc-clock.is-urgent { color: var(--state-needs-you); }
.nc-clock.is-urgent .nc-clock-track > i { background: var(--state-needs-you); }
.nc-clock.is-overdue { color: var(--state-failed); }
.nc-clock.is-overdue .nc-clock-track > i { background: var(--state-failed); }

/* ---- command palette ---- */
.nc-palette { width: 560px; max-width: 100%; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.nc-palette-input { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); font-size: 16px; line-height: 22px; color: var(--ink); }
.nc-palette-input input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: inherit; outline: none; padding: 0; }
.nc-palette-input input::placeholder { color: var(--ink-faint); }
.nc-palette-input .nc-icon { color: var(--ink-faint); }
.nc-palette-list { padding: var(--space-2); display: flex; flex-direction: column; }
.nc-palette-section { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); padding: var(--space-2) var(--space-2) var(--space-1); }
.nc-palette-item { display: grid; grid-template-columns: var(--icon) minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; min-height: var(--row); padding: 0 var(--space-2); border-radius: var(--radius-md); color: var(--ink); text-decoration: none; }
.nc-palette-item > .nc-icon { color: var(--ink-faint); }
.nc-palette-item.is-active { background: var(--accent-soft); }
.nc-palette-item.is-active > .nc-icon { color: var(--accent); }
.nc-palette-item-sub { display: block; font-size: 13px; line-height: 18px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-palette-hint { display: flex; gap: var(--space-3); padding: var(--space-2) var(--space-4); border-top: 1px solid var(--line); font-size: 12px; line-height: 16px; color: var(--ink-faint); }

/* ---- shell ---- */
.nc-shell { display: grid; grid-template-columns: var(--pane-list) minmax(0, 1fr) var(--pane-inspector); height: 100%; background: var(--surface); color: var(--ink); }
.nc-pane { min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.nc-pane-list { background: var(--surface); border-right: 1px solid var(--line); }
.nc-pane-thread { background: var(--surface-raised); }
.nc-pane-inspector { background: var(--surface); padding: var(--space-2) var(--space-2) var(--space-2) 0; }
.nc-pane-inspector > .nc-sheet { height: 100%; }
.nc-scroll { flex: 1; min-height: 0; overflow: auto; }

/* ---- additions declared by component authors ---- */
.nc-btn-icon { padding: 0; aspect-ratio: 1; }
.nc-kbd-group { display: inline-flex; align-items: center; gap: var(--space-1); }
.nc-input .code { font-family: var(--font-mono); font-size: 13px; }
.nc-mention.is-open { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
.nc-popcard-facts { display: flex; flex-direction: column; gap: var(--space-1); color: var(--ink-muted); }
.nc-site-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nc-site-text > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-section-empty { display: flex; align-items: center; min-height: var(--row); padding: 0 var(--space-2); font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.nc-entry-agent, .nc-entry-human { scroll-margin-top: var(--space-4); }
.nc-entry-human .nc-prose { white-space: pre-line; }
.nc-gate:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-md); }
.nc-kv dd.is-flag { color: var(--state-needs-you); font-weight: 600; }
.nc-kv dd .nc-prov { vertical-align: middle; }
/* ---- additions 2026-11-08: the components the agent-first notes asked for, and the rail the demo tells its story with ---- */

/* freshness chip: where an EMR-sourced fact stands (PatientBanner, CoverageSummary). The word carries the state; a stale copy wears the Needs you pair because someone should re-read before acting. */
.nc-fresh { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; line-height: 18px; font-weight: 600; letter-spacing: .01em; padding: 0 var(--space-2); border-radius: var(--radius-full); border: 1px solid var(--line-control); color: var(--ink-muted); white-space: nowrap; }
.nc-fresh .nc-icon { width: 10px; height: 10px; }
.nc-fresh.is-stale { color: var(--state-needs-you); background: var(--state-needs-you-soft); border-color: transparent; }
.nc-fresh.is-unknown { border-style: dashed; }

/* grouped Needs you row: a native queue in Triage (unrouted inbound, a connection outage) over the issues it blocks. Dashed, because it is not an issue and has no thread. */
.nc-group-row { display: grid; grid-template-columns: var(--icon) minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; min-height: var(--row); padding: 5px var(--space-2); border-radius: var(--radius-md); border: 1px dashed var(--line-control); color: var(--ink); text-decoration: none; }
.nc-group-row:hover { background: var(--surface-sunken); }
.nc-group-row:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.nc-group-row > .nc-icon { color: var(--ink-faint); }
.nc-group-row .nc-issue-row-title { font-weight: 500; }

/* list notice: the banner that accompanies a connection row, at the top of the list pane */
.nc-list-notice { display: flex; align-items: flex-start; gap: var(--space-2); margin: var(--space-2) var(--space-2) 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--state-needs-you-soft); color: var(--state-needs-you); font-size: 13px; line-height: 18px; }
.nc-list-notice .nc-icon { margin-top: 2px; }
.nc-list-notice > span { min-width: 0; overflow-wrap: anywhere; }
.nc-list-notice a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ledger: money in a card (ClaimSummary, AccountSummary), figures in mono, right-aligned so decimals line up */
.nc-ledger { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-3); font-size: 13px; line-height: 18px; margin: 0; }
.nc-ledger dt { color: var(--ink-faint); }
.nc-ledger dd { margin: 0; font-family: var(--font-mono); text-align: right; color: var(--ink); white-space: nowrap; }
.nc-ledger dd.is-flag { color: var(--state-needs-you); font-weight: 600; }
.nc-ledger .is-total { border-top: 1px solid var(--line); padding-top: var(--space-1); }
.nc-ledger dt.is-total { color: var(--ink); font-weight: 600; }
.nc-ledger dd.is-total { font-weight: 600; }

/* lots: on-hand or allocated vials by lot, serial and expiry (StockSummary, the Visit card) */
.nc-lots { display: flex; flex-direction: column; gap: var(--space-1); margin: 0; }
.nc-lots > div { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-2); align-items: baseline; font-size: 13px; line-height: 18px; color: var(--ink); }
.nc-lots > div > span:nth-child(2) { color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-lots > div > span:last-child { color: var(--ink-faint); font-size: 12px; }

/* spark: twelve weeks of consumption as columns (StockSummary); the current week is the one accent column, a pointer, not a status */
.nc-spark { display: flex; align-items: flex-end; gap: 2px; height: 28px; }
.nc-spark > i { flex: 1; min-height: 2px; background: var(--ink-muted); border-radius: 1px; }
.nc-spark > i.is-now { background: var(--accent); }

/* people and agents (SiteSummary): a row per person or agent with a role word and, for an agent, its autonomy badge */
.nc-people { display: flex; flex-direction: column; gap: var(--space-1); }
.nc-people > div { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; min-height: 24px; font-size: 13px; line-height: 18px; }
.nc-people > div > span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-people > div > span:nth-child(2) small { color: var(--ink-faint); font-size: 12px; }

/* scene rail: the chapter rail and the caption for a scripted walkthrough. Never in the product shell. */
.nc-rail { display: flex; align-items: stretch; gap: var(--space-5); padding: 0 var(--space-4); min-height: var(--space-12); border-bottom: 1px solid var(--line); background: var(--surface); overflow-x: auto; scrollbar-width: none; }
.nc-rail::-webkit-scrollbar { display: none; }
.nc-rail-chapter { display: flex; flex-direction: column; justify-content: center; gap: 5px; flex: none; }
.nc-rail-chapter-name { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }
.nc-rail-chapter.is-current .nc-rail-chapter-name { color: var(--ink); }
.nc-rail-dots { display: flex; gap: var(--space-1); }
.nc-rail-dot { width: 22px; height: 6px; padding: 0; border-radius: 3px; border: 1px solid var(--line); background: var(--surface-sunken); cursor: pointer; }
.nc-rail-dot.is-seen { background: var(--ink-muted); border-color: var(--ink-muted); }
.nc-rail-dot.is-current { background: var(--accent); border-color: var(--accent); }
.nc-rail-dot:hover { border-color: var(--line-control); }
.nc-rail-dot:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.nc-rail-caption { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-4); align-items: center; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line); background: var(--surface-raised); }
.nc-rail-caption-head { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.nc-rail-caption-title { font-size: 16px; line-height: 22px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.nc-rail-caption-date { font-family: var(--font-mono); font-size: 12px; line-height: 16px; color: var(--ink-faint); }
.nc-rail-caption-lines { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-1) var(--space-3); margin: var(--space-1) 0 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); max-width: 92ch; }
.nc-rail-caption-lines dt { font-size: 11px; line-height: 18px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); }
.nc-rail-caption-lines dd { margin: 0; }
.nc-rail-caption-lines dd .nc-kbd { vertical-align: middle; }
.nc-rail-caption .nc-btn .nc-icon { margin: 0; }

/* the Setup type's inspector lead: a site in place of a patient */
.nc-banner-site .nc-banner-name { font-size: 20px; line-height: 28px; }

/* document pages: outlined page marks in the inspector; the pages themselves open on demand, never inline in a thread */
.nc-pages { display: flex; gap: var(--space-2); }
.nc-page { width: 36px; height: 48px; border: 1px solid var(--line-control); border-radius: 2px; background: var(--surface-raised); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 2px; font-family: var(--font-mono); font-size: 10px; line-height: 12px; color: var(--ink-faint); }
.nc-card .nc-fresh { align-self: flex-start; }
.nc-list-rows { display: flex; flex-direction: column; gap: var(--space-1); }
.nc-list-rows a { display: grid; grid-template-columns: var(--icon) minmax(0, 1fr); gap: var(--space-2); align-items: start; padding: 3px 0; color: var(--ink); text-decoration: none; font-size: 13px; line-height: 18px; border-radius: var(--radius-sm); }
.nc-list-rows a > .nc-icon { color: var(--ink-faint); margin-top: 2px; }
.nc-list-rows a:hover { color: var(--accent-strong); }
.nc-list-rows a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.nc-list-rows a small { display: block; color: var(--ink-faint); font-size: 12px; line-height: 16px; }
.nc-list-rows a small .nc-prov, .nc-list-rows a small .nc-fresh { vertical-align: middle; }
