@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");
/* Braid UI. Braid's colours and Inter, as plain CSS on tokens.css.
   Every class starts with b-. UI text 13px, small text 12px, badges 11px. */

.b-root { font: 400 14px/1.5 var(--font-sans); color: var(--text); background: var(--panel); -webkit-font-smoothing: antialiased; }
.b-root *, .b-root *::before, .b-root *::after { box-sizing: border-box; }
.b-root [hidden] { display: none !important; }
.b-sm { font-size: 13px; } .b-xs { font-size: 12px; } .b-12 { font-size: 13px; }
.b-muted { color: var(--ink-muted); } .b-secondary { color: var(--ink-secondary); }
.b-heading { font: 700 15px/20px var(--font-sans); margin: 0; color: var(--text); }
.b-code { font: 400 13px/16px var(--font-mono); color: var(--ink-muted); }
.b-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.b-stack { display: flex; flex-direction: column; gap: var(--space-3); }
.b-tnum { font-variant-numeric: tabular-nums; }

/* Motion: menus 100ms in / 75ms out, modals and toasts 300ms in / 200ms out */
@keyframes b-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes b-fade-down { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes b-menu-in { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
@keyframes b-modal-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes b-toast-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
@keyframes b-spin { to { transform: rotate(360deg); } }
@keyframes b-pulse { 50% { opacity: .5; } }
.b-fade-in { animation: b-fade-in .5s ease-out; } .b-fade-down { animation: b-fade-down .5s ease-out; }
.b-skeleton { animation: b-pulse 2s cubic-bezier(.4,0,.6,1) infinite; background: var(--sunken); border-radius: var(--radius-md); }

/* Focus: the brand focus ring is Periwinkle */
.b-root :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.b-input:focus-visible, .b-select:focus-visible, .b-palette-input:focus-visible { outline: none; }

/* Button */
.b-btn { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; gap: 8px;
  border-radius: var(--radius-md); padding: 8px 12px; font: 600 13px/1.5 var(--font-sans); border: 1px solid transparent;
  box-shadow: var(--shadow-sm); cursor: pointer; text-decoration: none; color: var(--on-primary); background: var(--primary); }
.b-btn svg { width: 16px; height: 16px; flex: none; }
.b-btn:not(.b-btn--secondary):not(.b-btn--ghost):hover { filter: brightness(.94); }
.b-btn--secondary { background: var(--btn-secondary); color: var(--text); border-color: var(--line-button); }
.b-btn--secondary:hover { background: var(--hover); }
.b-btn--danger { background: var(--danger); color: var(--on-danger); border-color: var(--danger); }
.b-btn--ghost { background: none; color: var(--text); box-shadow: none; }
.b-btn--ghost:hover { background: var(--hover); }
.b-btn--xs { font-size: 12px; padding: 4px 8px; gap: 4px; } .b-btn--sm { font-size: 12px; } .b-btn--lg { padding-top: .65rem; padding-bottom: .65rem; }
.b-btn--icon { padding: 0; width: 36px; height: 36px; } .b-btn--icon.b-btn--xs { width: 24px; height: 24px; } .b-btn--icon.b-btn--sm { width: 32px; height: 32px; } .b-btn--icon.b-btn--lg { width: 40px; height: 40px; }
.b-btn--full { width: 100%; }
.b-btn[disabled], .b-btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.b-btn[aria-busy="true"] { position: relative; pointer-events: none; }
.b-btn[aria-busy="true"] > * { visibility: hidden; }
.b-btn[aria-busy="true"]::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: b-spin .75s linear infinite; }
/* Icon button (menu triggers, toolbar buttons) */
.b-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: var(--size-icon-btn); height: var(--size-icon-btn); border-radius: var(--radius-item); border: 0; background: none; color: var(--ink-muted); cursor: pointer; }
.b-icon-btn:hover { background: var(--hover); color: var(--text); }
.b-icon-btn svg { width: 18px; height: 18px; }

/* Input: ring, not border */
.b-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.b-field > label, .b-field-label { font: 500 13px/1.5 var(--font-sans); color: var(--text); display: flex; align-items: center; gap: 6px; }
.b-field-hint { font-size: 12px; color: var(--ink-muted); }
.b-field-error { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); }
.b-field-error::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--error); flex: none; }
.b-input-wrap { position: relative; display: flex; }
.b-input { display: block; width: 100%; border: 0; border-radius: var(--radius-md); background: var(--surface); padding: 6px 12px;
  font: 400 13px/24px var(--font-sans); color: var(--text); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line-control); }
.b-input::placeholder { color: var(--placeholder); }
.b-input:focus { box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--accent); }
.b-input[aria-invalid="true"] { box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--error); }
textarea.b-input { min-height: 70px; resize: vertical; }
.b-addon { display: flex; flex: none; align-items: center; padding: 0 12px; border: 1px solid var(--line-control); border-right: 0; border-radius: var(--radius-md) 0 0 var(--radius-md); font-size: 13px; color: var(--ink-muted); }
.b-addon + .b-input { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.b-addon--end { border: 1px solid var(--line-control); border-left: 0; border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.b-input:has(+ .b-addon--end) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.b-input-end { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--ink-muted); pointer-events: none; }
.b-input-wrap:has(.b-input-end) .b-input { padding-right: 40px; }
/* Number input (Braid): right-aligned tabular figures; a changed value gets the indigo ring and a dot */
.b-num .b-input { text-align: right; font-variant-numeric: tabular-nums; }
.b-num[data-changed] .b-input { box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.b-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: none; flex: none; }
.b-num[data-changed] .b-dot { display: inline-block; }
.b-reset { margin-left: auto; border: 0; background: none; padding: 0; font: 600 12px/1.5 var(--font-sans); color: var(--accent-text); text-decoration: underline 1.5px var(--accent); text-underline-offset: 3px; cursor: pointer; display: none; }
.b-num[data-changed] .b-reset { display: inline; }
/* Select */
.b-select-wrap { position: relative; }
.b-select { width: 100%; appearance: none; border: 0; border-radius: var(--radius-lg); background: var(--panel); padding: 8px 40px 8px 12px; font: 400 13px/1.5 var(--font-sans); color: var(--text); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); cursor: pointer; }
.b-select:focus { box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--accent); }
.b-select-wrap svg { position: absolute; right: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--ink-muted); pointer-events: none; }

/* Toggle: 24 x 16 track, indigo when on */
.b-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; color: var(--ink-muted); }
.b-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.b-toggle i { position: relative; display: inline-flex; flex: none; width: 24px; height: 16px; border-radius: var(--radius-full); border: 2px solid transparent; background: var(--track); transition: background-color .2s ease-in-out; }
.b-toggle i::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--knob); box-shadow: var(--shadow); transition: transform .2s ease-in-out; }
.b-toggle input:checked + i { background: var(--accent); }
.b-toggle input:checked + i::after { transform: translateX(8px); }
.b-toggle input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Checkbox */
.b-check { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text); cursor: pointer; }
.b-check input { appearance: none; margin: 0; width: 14px; height: 14px; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--line-strong); background: transparent; display: grid; place-content: center; cursor: pointer; flex: none; }
.b-check input:checked { background: var(--primary); box-shadow: none; }
.b-check input:checked::after { content: ""; width: 7px; height: 4px; border: solid var(--on-primary); border-width: 0 0 1.5px 1.5px; transform: rotate(-45deg) translate(1px, -1px); }

/* Segmented control, in the chip style */
.b-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--radius-md); background: var(--sunken); }
.b-seg button { border: 0; background: none; border-radius: var(--radius-item); padding: 4px 10px; font: 500 13px/1.5 var(--font-sans); color: var(--ink-secondary); cursor: pointer; }
.b-seg button:hover { color: var(--text); }
.b-seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }

/* Badge, count pill, category dot, status dot + label (brand: never colour alone) */
.b-badge { display: inline-flex; width: fit-content; align-items: center; gap: 6px; border-radius: var(--radius-full); padding: 4px 8px; font: 500 11px/1 var(--font-sans); color: var(--badge-ink); box-shadow: inset 0 0 0 1px var(--badge-ring); white-space: nowrap; }
.b-badge--accent { border-radius: var(--radius-md); background: var(--accent-soft); color: var(--accent-text); box-shadow: none; }
.b-badge--good, .b-badge--bad, .b-badge--warn { color: var(--text); box-shadow: inset 0 0 0 1px var(--c); }
.b-badge--good::before, .b-badge--bad::before, .b-badge--warn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.b-badge--good { --c: var(--good); } .b-badge--bad { --c: var(--bad); } .b-badge--warn { --c: var(--warn); }
.b-count { min-width: 20px; display: inline-block; border-radius: var(--radius-full); background: var(--count); padding: 2px 6px; font: 600 11px/16px var(--font-sans); text-align: center; color: var(--text); }
.b-label-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--c, var(--label-periwinkle)); }
.b-l-periwinkle { --c: var(--label-periwinkle); } .b-l-sky { --c: var(--label-sky); } .b-l-aqua { --c: var(--label-aqua); } .b-l-lime { --c: var(--label-lime); }
.b-l-marigold { --c: var(--label-marigold); } .b-l-coral { --c: var(--label-coral); } .b-l-orchid { --c: var(--label-orchid); } .b-l-slate { --c: var(--label-slate); }
/* Label tag: a tinted pill with its dot, in the style of card labels */
.b-tag { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-full); padding: 3px 8px 3px 7px; font: 500 12px/1.4 var(--font-sans); color: var(--text); background: color-mix(in srgb, var(--c, var(--label-slate)) 14%, transparent); }
.b-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--label-slate)); flex: none; }
.b-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.b-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.b-status--good { --c: var(--good-icon); } .b-status--info { --c: var(--info-icon); } .b-status--warn { --c: var(--warn-icon); } .b-status--bad { --c: var(--bad-icon); }

/* Avatar */
.b-avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--avatar); color: #fff; font: 500 13px/1 var(--font-sans); flex: none; overflow: hidden; }
.b-avatar img { width: 100%; height: 100%; object-fit: cover; }
.b-avatar--xs { width: 20px; height: 20px; font-size: 8px; } .b-avatar--sm { width: 24px; height: 24px; font-size: 11px; } .b-avatar--lg { width: 48px; height: 48px; font-size: 15px; }
.b-avatars { display: flex; } .b-avatars .b-avatar { box-shadow: 0 0 0 2px var(--panel); } .b-avatars .b-avatar + .b-avatar { margin-left: -6px; }

/* Tooltip: add data-tip to any element */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: 50;
  border-radius: var(--radius-md); border: 1px solid var(--line-float); background: var(--surface); padding: 4px 8px; font: 400 13px/1.5 var(--font-sans); color: var(--text);
  box-shadow: var(--shadow-lg); width: max-content; max-width: 240px; white-space: normal; text-align: left; pointer-events: none; animation: b-fade-in .1s ease-out; }

/* Spinner and circular progress */
.b-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--progress-track); border-top-color: var(--text); animation: b-spin .75s linear infinite; display: inline-block; }
.b-spinner--sm { width: 12px; height: 12px; } .b-spinner--lg { width: 20px; height: 20px; }
.b-progress { width: 20px; height: 20px; transform: rotate(-90deg); }
.b-progress circle { fill: none; stroke-width: 3; }
.b-progress .b-track { stroke: var(--progress-track); }
.b-progress .b-bar { stroke: var(--progress); stroke-linecap: round; transition: stroke-dashoffset .3s ease-in-out, stroke .3s; }
.b-progress[data-done] .b-bar { stroke: var(--progress-done); }

/* Menu */
.b-menu { position: relative; display: inline-block; text-align: left; }
.b-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 100; width: var(--size-menu); transform-origin: top right; padding: 4px;
  border-radius: var(--radius-md); border: 1px solid var(--line-menu); background: var(--surface); box-shadow: var(--shadow-lg), 0 0 0 1px rgba(16,24,43,.05); display: flex; flex-direction: column; animation: b-menu-in .1s ease-out; }
.b-menu[data-align="start"] .b-menu-list { right: auto; left: 0; transform-origin: top left; }
.b-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; border-radius: var(--radius-item); background: none; padding: 6px 10px; text-align: left; font: 400 13px/1.5 var(--font-sans); color: var(--ink-menu); cursor: pointer; text-decoration: none; }
.b-menu-item:hover, .b-menu-item:focus-visible { background: var(--hover-menu); outline: none; }
.b-menu-item svg { width: 16px; height: 16px; flex: none; color: var(--ink-muted); }
.b-menu-item kbd { margin-left: auto; font: 400 12px/1 var(--font-sans); color: var(--ink-subtle); }
.b-menu-item[disabled] { opacity: .6; cursor: not-allowed; }
.b-menu-item--danger { color: var(--danger-ink); } .b-menu-item--danger svg { color: var(--danger); }
.b-menu-sep { border-top: 1px solid var(--line-menu); margin: 4px 0; }
.b-menu-head { padding: 8px; font-size: 13px; color: var(--ink-muted); }

/* Modal: frosted panel over a light scrim */
.b-dialog { border: 1px solid var(--line-float); border-radius: var(--radius-lg); padding: 0; margin: 15vh auto auto; width: calc(100% - 32px); max-width: var(--size-modal-md);
  background: var(--float); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--text); box-shadow: var(--shadow-3xl); }
.b-dialog[open] { animation: b-modal-in .3s ease-out; }
.b-dialog--sm { max-width: var(--size-modal-sm); } .b-dialog--lg { max-width: var(--size-modal-lg); } .b-dialog--center { margin: auto; }
.b-dialog::backdrop { background: var(--scrim); animation: b-fade-in .3s ease-out; }
.b-dialog-body { padding: 20px 20px 0; }
.b-dialog-body h2 { margin: 0 0 4px; font: 500 15px/1.5 var(--font-sans); }
.b-dialog-body p { margin: 0; font-size: 13px; color: var(--ink-muted); }
.b-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 20px; }

/* Command palette */
.b-palette { max-width: var(--size-modal-md); margin-top: 25vh; overflow: hidden; }
.b-palette-search { display: grid; border-bottom: 1px solid var(--divide); }
.b-palette-search svg { grid-area: 1 / 1; margin-left: 16px; width: 20px; height: 20px; align-self: center; color: var(--ink-subtle); pointer-events: none; }
.b-palette-input { grid-area: 1 / 1; height: 48px; width: 100%; border: 0; background: transparent; padding: 0 16px 0 44px; font: 400 13px/1.5 var(--font-sans); color: var(--ink-muted); }
.b-palette-input::placeholder { color: var(--ink-subtle); }
.b-palette-list { max-height: 288px; overflow-y: auto; padding: 8px 0; margin: 0; list-style: none; }
.b-palette-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; cursor: pointer; }
.b-palette-item:hover, .b-palette-item[data-focus] { background: var(--hover); }
.b-palette-item svg { width: 16px; height: 16px; margin-top: 2px; color: var(--ink-subtle); flex: none; }
.b-palette-item b { display: block; font: 700 13px/1.5 var(--font-sans); color: var(--ink-muted); }
.b-palette-item small { display: block; font-size: 12px; color: var(--ink-subtle); }
.b-palette-empty { padding: 16px; font-size: 13px; color: var(--ink-secondary); }

/* Toast */
.b-toasts { position: fixed; inset: auto 12px calc(12px + env(safe-area-inset-bottom, 0px)) 12px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 16px; pointer-events: none; padding: 12px; }
.b-toast { pointer-events: auto; position: relative; display: flex; align-items: flex-start; width: 100%; max-width: var(--size-toast); overflow: hidden; padding: 16px; border-radius: var(--radius-xl); border: 1px solid var(--line-float); background: var(--surface); box-shadow: var(--shadow-lg); animation: b-toast-in .3s ease-out; }
.b-toast > svg { width: 20px; height: 20px; margin-top: 4px; flex: none; color: var(--good-icon); }
.b-toast--bad > svg { color: var(--bad-icon); }
.b-toast-text { margin-left: 12px; flex: 1; padding: 2px 24px 0 0; min-width: 0; }
.b-toast-text b { display: block; font: 700 13px/1.5 var(--font-sans); color: var(--ink-menu); }
.b-toast-text span { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-muted); }
.b-toast .b-icon-btn { position: absolute; right: 12px; top: 12px; width: 24px; height: 24px; }
.b-toast .b-icon-btn svg { width: 16px; height: 16px; }

/* App frame: sidebar on the frame, main content in an inset bordered panel */
.b-app { display: flex; flex-direction: column; height: 100%; min-height: 100%; background: var(--panel); }
.b-app-head { display: none; height: var(--size-header); align-items: center; justify-content: space-between; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.b-app-body { display: flex; flex: 1; min-height: 0; }
.b-side { width: var(--size-sidebar); flex: none; display: flex; flex-direction: column; justify-content: space-between; padding: 0 12px 0 0; background: var(--app); }
.b-ws { display: flex; align-items: center; gap: 4px; padding-bottom: 12px; }
.b-ws-btn { display: flex; align-items: center; flex: 1; min-width: 0; height: var(--size-control); padding: 6px; border: 0; border-radius: var(--radius-md); background: none; cursor: pointer; color: var(--text); }
.b-ws-btn:hover { background: var(--hover); }
.b-ws-mark { display: inline-flex; width: 24px; height: 24px; flex: none; color: var(--mark); }
.b-ws-mark svg { width: 100%; height: 100%; display: block; }
.b-logo { display: block; color: inherit; }
.b-logo--mark { aspect-ratio: 1; }
.b-logo--stacked { aspect-ratio: 135 / 156.58; }
.b-ws-name { margin-left: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 13px/1.5 var(--font-sans); text-align: left; }
.b-side-btn { width: var(--size-control); height: var(--size-control); flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 8px; border: 0; border-radius: var(--radius-lg); background: var(--sunken); color: var(--ink-muted); cursor: pointer; }
.b-side-btn:hover { background: var(--line); }
.b-side-rule { margin: 0 4px 16px; border-bottom: 1px solid var(--line-rule); }
.b-nav { display: flex; flex-direction: column; gap: 4px; }
.b-nav-label { padding: 12px 6px 4px; font: 600 12px/1.5 var(--font-sans); color: var(--ink-muted); }
.b-nav a { display: flex; align-items: center; gap: 8px; height: var(--size-control); padding: 6px; border-radius: var(--radius-md); font: 400 13px/24px var(--font-sans); color: var(--ink-secondary); text-decoration: none; }
.b-nav a svg { width: 18px; height: 18px; flex: none; }
.b-nav a:hover { background: var(--hover); color: var(--text); }
.b-nav a[aria-current="page"] { background: var(--selected); color: var(--text); }
.b-nav a .b-count { margin-left: auto; }
.b-user { display: flex; align-items: center; width: 100%; padding: 6px; border: 0; border-radius: var(--radius-md); background: none; color: var(--text); cursor: pointer; margin-bottom: 4px; }
.b-user:hover { background: var(--hover); }
.b-user span { margin: 0 8px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-frame { flex: 1; min-width: 0; display: flex; padding: 12px; background: var(--app); }
.b-frame > .b-side { padding-top: 0; }
.b-panel { position: relative; flex: 1; min-width: 0; min-height: 0; overflow: auto; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--panel); }
.b-page { max-width: 1100px; margin: 0 auto; padding: 24px 20px; display: flex; flex-direction: column; gap: 24px; }
.b-page--wide { max-width: none; padding: 24px 32px; }
.b-page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.b-page-title { margin: 0; font: 700 20px/2.3rem var(--font-sans); letter-spacing: -.025em; color: var(--text); }
.b-page-desc { margin: -16px 0 0; font-size: 13px; color: var(--ink-muted); max-width: 70ch; }
@media (min-width: 768px) { .b-page { padding: 48px 112px; } .b-page--wide { padding: 24px 32px; } }
@media (max-width: 767px) {
  .b-app-head { display: flex; }
  .b-frame { padding: 0; }
  .b-frame > .b-side { display: none; }
  .b-panel { border: 0; border-radius: 0; }
  .b-page, .b-page--wide { padding: 24px 16px; }
}

/* Tabs: underline */
.b-tabs { display: flex; gap: 32px; border-bottom: 1px solid var(--line-tabs); overflow-x: auto; scrollbar-width: none; }
.b-tabs [role="tab"] { white-space: nowrap; border: 0; border-bottom: 2px solid transparent; background: none; padding: 16px 4px; margin-bottom: -1px; font: 500 13px/1.5 var(--font-sans); color: var(--ink-muted); cursor: pointer; transition: color .15s, border-color .15s; }
.b-tabs [role="tab"]:hover { color: var(--text); }
.b-tabs [role="tab"][aria-selected="true"] { border-bottom-color: var(--text); color: var(--text); }
.b-tabs--compact [role="tab"] { padding: 10px 4px; }

/* Board column and card */
.b-board { display: flex; gap: 20px; overflow-x: auto; align-items: flex-start; padding-bottom: 8px; }
.b-column { width: var(--size-column); min-width: var(--size-column); flex: none; border-radius: var(--radius-md); border: 1px solid var(--line-column); background: var(--column); padding: 8px 4px 8px 8px; color: var(--text); }
.b-column-head { display: flex; align-items: center; gap: 8px; padding: 4px 8px 8px 8px; font: 500 13px/1.5 var(--font-sans); }
.b-column-head .b-icon-btn { margin-left: auto; width: 24px; height: 24px; }
.b-column-body { display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.b-card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-md); border: 1px solid var(--line-card); background: var(--card); padding: 8px 12px; font-size: 13px; color: var(--text); min-width: 0; }
a.b-card, button.b-card { text-align: left; text-decoration: none; cursor: pointer; font-family: inherit; }
a.b-card:hover, button.b-card:hover { background: var(--card-hover); }
.b-card-meta { margin-bottom: 4px; font-size: 12px; color: var(--ink-card-meta); }
.b-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }

/* Panel section (Braid): a titled block inside the main panel */
.b-section { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); min-width: 0; }
.b-section-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.b-section-head h3 { margin: 0; font: 700 13px/1.5 var(--font-sans); }
.b-section-head .b-row { margin-left: auto; }
.b-section-body { padding: 16px; }

/* Stat tiles, in the card style */
.b-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.b-stat { border-radius: var(--radius-md); border: 1px solid var(--line-card); background: var(--card); padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.b-stat-label { font-size: 12px; color: var(--ink-muted); }
.b-stat-value { font: 700 24px/28px var(--font-sans); letter-spacing: -.025em; color: var(--text); }
.b-stat-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
/* Variance chip */
.b-delta { display: inline-flex; align-items: center; gap: 2px; border-radius: var(--radius-full); padding: 2px 6px; font: 600 11px/16px var(--font-sans); font-variant-numeric: tabular-nums; }
.b-delta svg { width: 10px; height: 10px; }
.b-delta--good, .b-delta--bad { color: var(--text); }
.b-delta--good { background: var(--good-soft); } .b-delta--good svg { color: var(--good); }
.b-delta--bad { background: var(--bad-soft); } .b-delta--bad svg { color: var(--bad); }
.b-delta--flat { color: var(--ink-secondary); background: var(--count); }

/* Check rows (rulebook checks), in the list-row style */
.b-checks { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--panel); }
.b-checkrow { display: grid; grid-template-columns: 16px 34px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.b-checkrow:last-child { border-bottom: 0; }
.b-checkrow > svg { width: 16px; height: 16px; margin-top: 2px; }
.b-checkrow[data-state="pass"] > svg { color: var(--good); } .b-checkrow[data-state="warn"] > svg { color: var(--warn); } .b-checkrow[data-state="fail"] > svg { color: var(--bad); }
.b-checkrow code { font: 400 12px/20px var(--font-mono); color: var(--ink-muted); }
.b-checkrow strong { display: block; font-weight: 600; line-height: 20px; }
.b-checkrow p { margin: 0; color: var(--ink-muted); font-size: 12px; }
.b-checkrow-meta { font-size: 12px; color: var(--ink-muted); white-space: nowrap; line-height: 20px; }

/* Financial table: hairline rules, UI type, accounting figures */
.b-fin-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.b-fin { border-collapse: separate; border-spacing: 0; width: 100%; font: 400 13px/18px var(--font-sans); font-variant-numeric: tabular-nums; color: var(--text); }
.b-fin th, .b-fin td { padding: 6px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.b-fin th:first-child, .b-fin td:first-child { position: sticky; left: 0; z-index: 1; text-align: left; min-width: 210px; background: var(--panel); }
.b-fin thead th { position: sticky; top: 0; z-index: 2; background: var(--app); font: 600 12px/16px var(--font-sans); color: var(--ink-muted); }
.b-fin thead th:first-child { z-index: 3; background: var(--app); color: var(--text); }
.b-fin thead button { all: unset; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; color: var(--text); border-radius: var(--radius-sm); }
.b-fin thead button svg { width: 12px; height: 12px; color: var(--ink-muted); transition: transform .15s; }
.b-fin thead button[aria-expanded="true"] svg { transform: rotate(90deg); }
.b-fin thead button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.b-fin .b-fin-year { background: var(--app); }
.b-fin td.b-fin-month { color: var(--ink-secondary); }
.b-fin tbody tr:hover td { background: var(--hover); }
.b-fin tr.b-fin-section td { padding-top: 16px; font: 700 13px/1.5 var(--font-sans); color: var(--text); background: var(--panel); }
.b-fin tr.b-fin-section:hover td { background: var(--panel); }
.b-fin tr.b-fin-sub td { font-weight: 600; border-top: 1px solid var(--line-strong); }
.b-fin tr.b-fin-total td { font-weight: 700; border-top: 1px solid var(--line-strong); border-bottom: 3px double var(--line-strong); }
.b-fin tr.b-fin-ratio td { color: var(--ink-muted); font-style: italic; }
.b-fin td.b-zero { color: var(--ink-subtle); }
.b-fin .b-fin-cut { border-right: 1px dashed var(--line-strong); }
.b-fin .b-ind-1 { padding-left: 28px; } .b-fin .b-ind-2 { padding-left: 44px; }
.b-fin-unit { margin-left: 6px; font-weight: 500; color: var(--ink-muted); }
.b-fin-tag { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: var(--radius-sm); background: var(--count); font: 600 10px/14px var(--font-sans); color: var(--ink-secondary); }

/* Charts (Braid): brand Periwinkle, Aqua and Coral as series; three at most */
.b-chart { position: relative; min-width: 0; }
.b-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.b-chart .b-axis text { fill: var(--ink-muted); font: 400 12px var(--font-sans); font-variant-numeric: tabular-nums; }
.b-chart .b-gridline { stroke: var(--grid); }
.b-chart .b-baseline { stroke: var(--line-strong); }
.b-chart .b-cross { stroke: var(--ink-muted); stroke-dasharray: 3 3; }
.b-chart .b-marker-line { stroke: var(--ink-muted); stroke-dasharray: 2 3; }
.b-chart .b-marker-text { fill: var(--ink-secondary); font: 600 12px var(--font-sans); }
.b-chart .b-direct { fill: var(--ink-secondary); font: 600 12px var(--font-sans); }
.b-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 10px; font-size: 12px; color: var(--ink-secondary); }
.b-legend span { display: inline-flex; align-items: center; gap: 6px; }
.b-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.b-legend i.b-line { width: 14px; height: 2px; border-radius: 1px; }
.b-chart-tip { position: absolute; z-index: 10; pointer-events: none; min-width: 150px; padding: 6px 8px; border-radius: var(--radius-md); border: 1px solid var(--line-float); background: var(--surface); box-shadow: var(--shadow-lg); font-size: 13px; }
.b-chart-tip b { display: block; margin-bottom: 4px; font-weight: 700; color: var(--text); }
.b-chart-tip div { display: flex; align-items: center; gap: 6px; color: var(--ink-secondary); }
.b-chart-tip em { margin-left: auto; padding-left: 12px; font-style: normal; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.b-chart-tip i { width: 8px; height: 8px; border-radius: 50%; }
.b-s1 { --c: var(--series-1); } .b-s2 { --c: var(--series-2); } .b-s3 { --c: var(--series-3); } .b-smuted { --c: var(--series-muted); }

/* Calendar */
.b-cal { width: 252px; font-size: 13px; }
.b-cal-head { display: flex; align-items: center; color: var(--text); }
.b-cal-head b { flex: 1; text-align: center; font-weight: 600; }
.b-cal-head button { display: flex; padding: 6px; border: 0; background: none; color: var(--ink-subtle); cursor: pointer; } .b-cal-head button:hover { color: var(--ink-muted); }
.b-cal-head svg { width: 16px; height: 16px; }
.b-cal-days, .b-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.b-cal-days { margin-top: 24px; font-size: 12px; line-height: 24px; color: var(--ink-secondary); }
.b-cal-grid { margin-top: 8px; }
.b-cal-grid button { display: flex; aspect-ratio: 1; align-items: center; justify-content: center; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; }
.b-cal-grid span { display: flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; color: var(--ink-muted); }
.b-cal-grid button:hover span { background: var(--hover); color: var(--text); }
.b-cal-grid button[data-out] span { color: var(--ink-subtle); }
.b-cal-grid button[data-today] span { color: var(--accent); font-weight: 600; }
.b-cal-grid button[aria-pressed="true"] span { background: var(--primary); color: var(--on-primary); font-weight: 600; }

/* Scrollbars; the signal gradient (brand: logo symbol, hero details and agent visuals only) and a spinning border in it */
.b-scroll { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) var(--scroll-track); }
.b-scroll::-webkit-scrollbar { width: 8px; height: 8px; } .b-scroll::-webkit-scrollbar-track { background: var(--scroll-track); border-radius: 4px; } .b-scroll::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 4px; }
.b-glow { position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 1px; }
.b-glow::before { content: ""; position: absolute; inset: -50%; width: 200%; height: 200%; animation: b-spin 4s linear infinite;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 45deg, var(--signal-from) 85deg, var(--signal-to) 95deg, transparent 110deg, transparent 360deg); }
.b-signal { background: linear-gradient(135deg, var(--signal-from), var(--signal-to)); }
.b-glow > * { position: relative; border-radius: calc(var(--radius-lg) - 1px); background: var(--panel); }

@media (prefers-reduced-motion: reduce) { .b-root *, .b-root *::before, .b-root *::after, .b-root ::backdrop { animation: none !important; transition: none !important; } }
