@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/ibm-plex-mono-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/ibm-plex-mono-500.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/ibm-plex-sans-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/ibm-plex-sans-500.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/ibm-plex-sans-600.woff2') format('woff2'); }

/* Rosen Console — design system stylesheet (NORMATIVE).
   One file, three layers: tokens → base → components. Every artboard and the
   flow harness embed this verbatim; the management application ships it. */

/* ============================== 1. TOKENS ============================== */
:root {
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* neutrals — cool, low-chroma */
  --ink: #1B2230;            /* primary text */
  --ink-2: #3A4356;          /* headings on panels, strong secondary */
  --text-2: #5A6475;         /* secondary text, table headers */
  --text-3: #7C8697;         /* placeholder, captions, disabled-ish */
  --text-disabled: #A5ADBB;
  --bg-app: #F4F5F7;         /* application background */
  --bg-surface: #FFFFFF;     /* panels, tables, cards, inputs */
  --bg-subtle: #F8F9FA;      /* table header, dialog footer, code chips */
  --bg-hover: #F1F3F6;       /* row / item hover */
  --bg-active: #E7EAEF;      /* pressed, default button */
  --bg-selected: #E9F0FC;    /* selected row, active nav */
  --line: #E1E4EA;           /* hairlines, dividers */
  --line-strong: #C7CDD8;    /* input borders, table outer border */
  --line-dark: #AEB6C4;      /* input hover border */

  /* one interactive hue */
  --primary: #1F5ED6;
  --primary-hover: #1A51BA;
  --primary-active: #163F94;
  --primary-wash: #E9F0FC;
  --primary-text: #1A51BA;   /* links, active tab, active nav */
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px #5B8DEF;

  /* status hues at matched lightness */
  --success: #1E7A47; --success-wash: #E5F3EA; --success-line: #A9D6BB;
  --warning: #9A5E06; --warning-wash: #FBF1DF; --warning-line: #E8CB92;
  --danger: #C0302E;  --danger-wash: #FBE9E8;  --danger-line: #EFB1AF;
  --info-line: #B9CDF3;

  /* brand — the lockup only */
  --brand: #6E3AD6;

  --radius: 3px;
  --radius-l: 4px;
  --shadow-1: 0 1px 2px rgba(27,34,48,.08);
  --shadow-2: 0 4px 16px rgba(27,34,48,.14), 0 0 0 1px rgba(27,34,48,.06);

  --control-h: 32px;
  --control-h-sm: 28px;
  --row-h: 40px;
  --row-h-compact: 34px;
  --topbar-h: 48px;
  --sidenav-w: 232px;
}

/* ============================== 2. BASE ============================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg-app);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
h1 { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 16px; line-height: 24px; font-weight: 600; }
h3 { font-size: 14px; line-height: 20px; font-weight: 600; }
p { text-wrap: pretty; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { color: var(--primary-active); text-decoration: underline; }
a:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 2px; }
code, kbd, samp, .mono { font-family: var(--font-mono); font-size: 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.small { font-size: 12px; line-height: 16px; }
.caption { font-size: 11px; line-height: 16px; color: var(--text-3); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* icon: stroke-based 16px grid, currentColor */
.icon { width: 16px; height: 16px; flex: 0 0 16px; display: inline-block; vertical-align: -3px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-20 { width: 20px; height: 20px; flex-basis: 20px; }

/* ============================== 3. COMPONENTS ============================== */

/* --- code chip: entity codes, addresses, function names --- */
.code {
  font-family: var(--font-mono); font-size: 12px; line-height: 16px;
  background: var(--bg-subtle); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1px 5px; color: var(--ink-2); white-space: nowrap;
}
.code-plain { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--control-h); padding: 0 12px; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--bg-active); color: var(--ink);
  font-size: 13px; font-weight: 500; line-height: 20px; white-space: nowrap;
  cursor: pointer; user-select: none; text-decoration: none;
}
.btn:hover { background: #DDE1E8; text-decoration: none; color: var(--ink); }
.btn:active { background: #D0D5DE; }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn[disabled], .btn.is-disabled { background: var(--bg-hover); color: var(--text-disabled); cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-primary:active { background: var(--primary-active); }
.btn-primary[disabled], .btn-primary.is-disabled { background: var(--bg-hover); color: var(--text-disabled); }
.btn-subtle { background: transparent; color: var(--ink-2); }
.btn-subtle:hover { background: var(--bg-hover); }
.btn-subtle:active { background: var(--bg-active); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #A82826; color: #fff; }
.btn-link { background: transparent; color: var(--primary-text); padding: 0 4px; height: auto; }
.btn-link:hover { background: transparent; text-decoration: underline; color: var(--primary-active); }
.btn-sm { height: var(--control-h-sm); padding: 0 10px; font-size: 12px; }
.btn-icon { width: var(--control-h); padding: 0; }
.btn-icon.btn-sm { width: var(--control-h-sm); }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: 8px; align-items: center; }
.btn .spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.btn:not(.btn-primary) .spinner { border-color: rgba(27,34,48,.2); border-top-color: var(--ink-2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- inputs --- */
.input, .textarea, .select {
  display: block; width: 100%; height: var(--control-h); padding: 0 10px;
  background: var(--bg-surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--ink); font-size: 13px; line-height: 20px;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--line-dark); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.input[disabled], .textarea[disabled], .select[disabled] { background: var(--bg-subtle); color: var(--text-disabled); border-color: var(--line); cursor: not-allowed; }
.input.is-invalid, .textarea.is-invalid, .select.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.input.mono, .textarea.mono { font-family: var(--font-mono); font-size: 12.5px; }
.textarea { height: auto; min-height: 84px; padding: 6px 10px; resize: vertical; line-height: 20px; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%235A6475' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6l4 4 4-4'/></svg>");
  background-repeat: no-repeat; background-position: right 8px center;
}
.input-sm, .select-sm { height: var(--control-h-sm); font-size: 12px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .icon { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; }
.input-group .input { padding-left: 32px; }
.input-group .btn { position: absolute; right: 4px; }
.input-group .btn ~ .input { padding-right: 60px; }

/* field: label + control + help/error */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-2); }
.field-label .req { color: var(--danger); margin-left: 2px; }
.field-label .opt { color: var(--text-3); font-weight: 400; margin-left: 4px; }
.field-help { font-size: 12px; line-height: 16px; color: var(--text-3); }
.field-error { font-size: 12px; line-height: 16px; color: var(--danger); display: flex; align-items: center; gap: 4px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }

/* checkbox / radio */
.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 2px 0 0; flex: 0 0 16px; border: 1px solid var(--line-dark); border-radius: 3px; background: var(--bg-surface); cursor: pointer; display: grid; place-content: center; }
.check input[type="radio"] { border-radius: 50%; }
.check input:hover { border-color: var(--text-2); }
.check input:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.check input:checked { background: var(--primary); border-color: var(--primary); }
.check input[type="checkbox"]:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.check input[type="radio"]:checked::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.check input[disabled] { background: var(--bg-subtle); border-color: var(--line); cursor: not-allowed; }
.check-label { font-size: 13px; line-height: 20px; }
.check-help { font-size: 12px; line-height: 16px; color: var(--text-3); }

/* choice card: a radio with a title and description, for decisions */
.choice { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-l); background: var(--bg-surface); cursor: pointer; }
.choice:hover { border-color: var(--line-dark); background: var(--bg-subtle); }
.choice.is-selected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--bg-surface); }
.choice input { margin-top: 2px; }
.choice-title { font-weight: 600; }
.choice-desc { font-size: 12px; line-height: 16px; color: var(--text-2); }

/* --- tags (status lozenges) --- */
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px;
  border-radius: var(--radius); font-size: 11px; line-height: 16px; font-weight: 600;
  letter-spacing: .02em; text-transform: uppercase; white-space: nowrap;
  background: var(--bg-active); color: var(--ink-2);
}
.tag-success { background: var(--success-wash); color: var(--success); }
.tag-warning { background: var(--warning-wash); color: var(--warning); }
.tag-danger { background: var(--danger-wash); color: var(--danger); }
.tag-info { background: var(--primary-wash); color: var(--primary-text); }
.tag-brand { background: #F1ECFD; color: var(--brand); }
.tag-outline { background: transparent; border: 1px solid var(--line-strong); color: var(--text-2); }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* --- callouts --- */
.callout { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--bg-subtle); }
.callout .icon { margin-top: 2px; }
.callout-title { font-weight: 600; }
.callout-body { color: var(--ink-2); }
.callout-body p + p { margin-top: 4px; }
.callout-actions { display: flex; gap: 8px; margin-top: 8px; }
.callout-info { background: var(--primary-wash); border-color: var(--info-line); }
.callout-info .icon { color: var(--primary); }
.callout-success { background: var(--success-wash); border-color: var(--success-line); }
.callout-success .icon { color: var(--success); }
.callout-warning { background: var(--warning-wash); border-color: var(--warning-line); }
.callout-warning .icon { color: var(--warning); }
.callout-danger { background: var(--danger-wash); border-color: var(--danger-line); }
.callout-danger .icon { color: var(--danger); }

/* --- tabs --- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-2); font-weight: 500; cursor: pointer; }
.tab:hover { color: var(--ink); background: var(--bg-hover); border-radius: var(--radius) var(--radius) 0 0; }
.tab.is-active { color: var(--primary-text); border-bottom-color: var(--primary); }
.tab .count { font-size: 11px; line-height: 16px; padding: 0 5px; border-radius: 8px; background: var(--bg-active); color: var(--text-2); font-weight: 600; }
.tab.is-active .count { background: var(--primary-wash); color: var(--primary-text); }

/* --- breadcrumbs --- */
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; color: var(--text-3); }
.crumbs a { color: var(--text-2); }
.crumbs .icon { width: 14px; height: 14px; color: var(--line-dark); }

/* --- toolbar --- */
.toolbar { display: flex; align-items: center; gap: 8px; }
.toolbar .grow { flex: 1 1 auto; }
.toolbar .input-group { width: 280px; }
.toolbar .select { width: auto; }

/* --- table --- */
.table-wrap { background: var(--bg-surface); border: 1px solid var(--line-strong); border-radius: var(--radius-l); overflow: hidden; }
.table-wrap.is-scroll { overflow-x: auto; }
.table th, .table td { text-align: left; padding: 0 12px; height: var(--row-h); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { height: 36px; background: var(--bg-subtle); font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.table th.sortable { cursor: pointer; }
.table th .sort { display: inline-flex; align-items: center; gap: 4px; }
.table th .sort .icon { width: 12px; height: 12px; color: var(--line-dark); }
.table th.is-sorted { color: var(--ink); }
.table th.is-sorted .sort .icon { color: var(--ink); }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr.is-selected { background: var(--bg-selected); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table .cell-title { font-weight: 500; }
.table .cell-sub { font-size: 12px; line-height: 16px; color: var(--text-3); }
.table .cell-stack { display: flex; flex-direction: column; gap: 1px; padding: 8px 0; }
.table-compact th, .table-compact td { height: var(--row-h-compact); }
.table .check { display: inline-flex; }
.table td.w-check, .table th.w-check { width: 40px; padding-right: 0; }

/* pagination footer */
.pager { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-top: 1px solid var(--line); background: var(--bg-surface); font-size: 12px; color: var(--text-2); }
.pager .grow { flex: 1 1 auto; }
.pager .select { width: auto; height: var(--control-h-sm); font-size: 12px; }
.pager .range { font-variant-numeric: tabular-nums; }
.pager .btn-icon { width: 28px; height: 28px; }

/* --- panel (modular container) --- */
.panel { background: var(--bg-surface); border: 1px solid var(--line-strong); border-radius: var(--radius-l); display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.panel-head h3 { flex: 1 1 auto; }
.panel-body { padding: 16px; }
.panel-body.is-flush { padding: 0; }
.panel-foot { padding: 10px 16px; border-top: 1px solid var(--line); background: var(--bg-subtle); border-radius: 0 0 var(--radius-l) var(--radius-l); font-size: 12px; color: var(--text-2); }
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* key–value list */
.kv { display: grid; grid-template-columns: minmax(140px, 200px) minmax(0, 1fr); row-gap: 0; column-gap: 16px; }
.kv dt, .kv dd { padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--text-2); }
.kv dd { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.kv dt:nth-last-of-type(1), .kv dd:last-child { border-bottom: 0; }

/* --- empty state --- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 24px; color: var(--text-2); }
.empty .icon { width: 24px; height: 24px; color: var(--line-dark); }
.empty-title { font-weight: 600; color: var(--ink); }
.empty .btn { margin-top: 8px; }

/* --- dialog --- */
.dialog-backdrop { position: absolute; inset: 0; background: rgba(27,34,48,.45); display: flex; align-items: flex-start; justify-content: center; padding-top: 96px; }
.dialog { width: 480px; max-width: calc(100% - 32px); background: var(--bg-surface); border-radius: var(--radius-l); box-shadow: var(--shadow-2); display: flex; flex-direction: column; }
.dialog-head { display: flex; align-items: center; gap: 8px; padding: 16px 20px 12px; }
.dialog-head h2 { flex: 1 1 auto; }
.dialog-body { padding: 0 20px 16px; display: flex; flex-direction: column; gap: 12px; color: var(--ink-2); }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--bg-subtle); border-radius: 0 0 var(--radius-l) var(--radius-l); }

/* --- menu (dropdown) --- */
.menu { min-width: 180px; background: var(--bg-surface); border-radius: var(--radius-l); box-shadow: var(--shadow-2); padding: 4px; display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: var(--radius); color: var(--ink); cursor: pointer; }
.menu-item:hover { background: var(--bg-hover); }
.menu-item.is-danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }

/* --- toast --- */
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--ink); color: #fff; border-radius: var(--radius-l); box-shadow: var(--shadow-2); font-size: 13px; }
.toast .icon { color: #7FD4B8; }
.toast .btn-link { color: #B9CDF3; }

/* ============================== 4. APPLICATION SHELL ============================== */
.shell { display: grid; grid-template-rows: var(--topbar-h) minmax(0, 1fr); grid-template-columns: var(--sidenav-w) minmax(0, 1fr); width: 100%; height: 100%; min-height: 0; background: var(--bg-app); }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 16px; background: var(--bg-surface); border-bottom: 1px solid var(--line-strong); }
.topbar .lockup { display: flex; align-items: center; gap: 10px; width: calc(var(--sidenav-w) - 16px); }
.topbar .lockup img { height: 18px; width: auto; display: block; }
.topbar .lockup .sep { width: 1px; height: 18px; background: var(--line-strong); }
.topbar .lockup .app { font-weight: 600; color: var(--ink-2); }
.topbar .repo { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12px; }
.topbar .grow { flex: 1 1 auto; }
.topbar .who { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.topbar .who .code { color: var(--ink); }
.sidenav { display: flex; flex-direction: column; gap: 2px; padding: 12px 8px; background: var(--bg-surface); border-right: 1px solid var(--line); }
.sidenav .nav-group { font-size: 11px; line-height: 16px; font-weight: 600; color: var(--text-3); padding: 12px 10px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: var(--radius); color: var(--ink-2); font-weight: 500; cursor: pointer; text-decoration: none; }
.nav-item:hover { background: var(--bg-hover); color: var(--ink); text-decoration: none; }
.nav-item.is-active { background: var(--bg-selected); color: var(--primary-text); }
.nav-item .icon { color: var(--text-2); }
.nav-item.is-active .icon { color: var(--primary-text); }
.nav-item .count { margin-left: auto; font-size: 11px; color: var(--text-3); }
.sidenav .nav-foot { margin-top: auto; padding: 8px 10px; font-size: 11px; line-height: 16px; color: var(--text-3); }
.main { min-width: 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.page { display: flex; flex-direction: column; gap: 16px; padding: 20px 32px 32px; }
.page-head { display: flex; flex-direction: column; gap: 6px; }
.page-head .title-row { display: flex; align-items: center; gap: 12px; }
.page-head .title-row h1 { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; }
.page-head .lede { color: var(--text-2); max-width: 72ch; }
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; }

/* ============================== 5. AUTH LAYOUT (claim, sign-in) ============================== */
.auth { position: relative; width: 100%; height: 100%; min-height: 0; display: flex; flex-direction: column; background: var(--bg-app); }
.auth-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; }
.auth-top .lockup { display: flex; align-items: center; gap: 10px; }
.auth-top .lockup img { height: 18px; width: auto; display: block; }
.auth-top .lockup .sep { width: 1px; height: 18px; background: var(--line-strong); }
.auth-top .lockup .app { font-weight: 600; color: var(--ink-2); }
.auth-top .repo { font-size: 12px; color: var(--text-3); display: flex; gap: 8px; align-items: center; }
.auth-center { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 48px 24px 24px; gap: 16px; }
.auth-card { width: 440px; max-width: 100%; background: var(--bg-surface); border: 1px solid var(--line-strong); border-radius: var(--radius-l); box-shadow: var(--shadow-1); display: flex; flex-direction: column; }
.auth-card .card-body { padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 16px; }
.auth-card .card-foot { padding: 12px 28px; border-top: 1px solid var(--line); background: var(--bg-subtle); border-radius: 0 0 var(--radius-l) var(--radius-l); font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.auth-card h1 { font-size: 18px; line-height: 24px; }
.auth-card .lede { color: var(--text-2); }
.auth-foot { text-align: center; font-size: 12px; color: var(--text-3); padding-bottom: 8px; }
.steps { display: flex; flex-direction: column; gap: 6px; }
.steps .label { font-size: 12px; line-height: 16px; color: var(--text-2); }
.steps .label b { color: var(--ink); font-weight: 600; }
.steps .bar { display: flex; gap: 4px; }
.steps .bar span { flex: 1 1 0; height: 3px; border-radius: 2px; background: var(--line); }
.steps .bar span.is-done { background: var(--primary); }

/* mnemonic word grid */
.words { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.word { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; background: var(--bg-subtle); border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--font-mono); font-size: 13px; }
.word .n { width: 16px; text-align: right; color: var(--text-3); font-size: 11px; }
.words.is-hidden .word { color: transparent; text-shadow: 0 0 8px rgba(27,34,48,.5); }
.words.is-hidden .word .n { color: var(--text-3); text-shadow: none; }

/* --- responsive: the auth layout and shell below 720px --- */
@media (max-width: 720px) {
  .auth-center { padding: 16px 16px 24px; }
  .auth-card { width: 100%; }
  .auth-card .card-body { padding: 20px; gap: 14px; }
  .auth-card .card-foot { padding: 10px 20px; }
  .words { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidenav { display: none; }
  .page { padding: 16px; }
  .page-grid { grid-template-columns: minmax(0, 1fr); }
  .panel-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar .input-group { width: 100%; }
}

/* ============================== 6. PROTOTYPE HARNESS (not part of the app) ============================== */
.harness { position: fixed; right: 12px; bottom: 12px; z-index: 50; display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; background: var(--ink); color: #fff; border-radius: var(--radius-l); box-shadow: var(--shadow-2); font-size: 12px; }
.harness .lbl { color: #B9C2D0; margin-right: 4px; }
.harness .btn { height: 26px; padding: 0 8px; font-size: 12px; background: #3A4356; color: #fff; }
.harness .btn:hover { background: #4A5468; }
.harness .btn.is-on { background: var(--primary); }

/* generic screens */
.json { font-family: var(--font-mono); font-size: 12px; line-height: 18px; color: var(--ink-2); background: var(--bg-subtle); border: 1px solid var(--line); border-radius: var(--radius-m, 6px); padding: 12px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
.btn-mono span { font-family: var(--font-mono); font-size: 12px; }
.table a.code-plain { color: var(--primary-text, var(--ink)); text-decoration: none; }
.table a.code-plain:hover { text-decoration: underline; }
.param-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.param-row > span:first-child { flex: 1 1 auto; }
.param-history { flex-basis: 100%; }
.board { display: grid; gap: 12px; align-items: start; }
.board-col { background: var(--bg-subtle); border: 1px solid var(--line); border-radius: var(--radius-l); min-height: 200px; }
.board-col-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--text-2); }
.board-col-head .count { margin-left: auto; color: var(--text-3); font-weight: 400; }
.board-col-body { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.board-card { background: var(--bg-surface); border: 1px solid var(--line-strong); border-radius: var(--radius-m, 6px); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.board-card-head { display: flex; align-items: baseline; gap: 8px; }
.board-label { color: var(--ink); font-weight: 500; }
.board-actions { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 4px; }
.board-empty { color: var(--text-3); font-size: 12px; padding: 12px; text-align: center; }
/* feed panel: a live timeline of messages and system lines, then the composer */
.feed-log { max-height: 560px; overflow-y: auto; padding: 8px 0; }
.feed-item + .feed-item, .feed-sys + .feed-item, .feed-item + .feed-sys { border-top: 1px solid var(--line); }
.feed-msg { padding: 8px 16px; }
.feed-meta { display: flex; align-items: baseline; gap: 8px; }
.feed-meta .btn-link { height: auto; padding: 0 2px; margin-left: auto; }
.feed-author { font-weight: 600; color: var(--ink); }
.feed-body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.feed-msg.is-deleted .feed-body { color: var(--text-3); font-style: italic; }
.feed-mention { font-weight: 600; color: var(--primary-text); }
.feed-thread { margin: 0 16px 8px 24px; border-left: 2px solid var(--line); }
.feed-thread .feed-msg { padding: 4px 0 4px 12px; }
.feed-sys { display: flex; align-items: baseline; gap: 8px; padding: 4px 16px; font-size: 12px; line-height: 16px; color: var(--text-3); }
.feed-empty { padding: 24px 16px; text-align: center; font-size: 12px; color: var(--text-3); }
.feed-composer { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--bg-subtle); border-radius: 0 0 var(--radius-l) var(--radius-l); }
.feed-composer .textarea { min-height: 64px; }
.feed-replying { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--text-2); }
.feed-replying .btn-link { height: auto; margin-left: auto; }
.feed-send { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.nav-group { margin-top: 12px; }
.nav-group-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); padding: 6px 12px 4px; }

/* Rosen Console — app-only additions to the design system (app.css). */
html, body { height: 100%; }
#app { position: relative; width: 100%; height: 100%; min-height: 0; }
.textarea.is-masked { -webkit-text-security: disc; }
.boot { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-3); gap: 10px; }
.boot .spinner { width: 16px; height: 16px; border: 2px solid rgba(27,34,48,.15); border-top-color: var(--text-2); border-radius: 50%; animation: spin .8s linear infinite; }
.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40; }
.auth-card .link-row { display: flex; justify-content: center; font-size: 12px; color: var(--text-3); }
