/* Provenance: design-system/components.css @ M10 copy (2026-10-08), unmodified below this line. Edit the source in design-system/, not here. */
/*
 * Bulletin Design System — Components (draft v0.1, pending Owner review)
 * Requires tokens.css. Class prefix: .b-
 * Modifiers use double-dash (.b-btn--primary); state uses aria/data attributes
 * where one exists (aria-selected, aria-current, aria-pressed, data-state).
 */

/* ── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

[hidden] { display: none !important; }

body {
  background: var(--b-bg);
  color: var(--b-text);
  font-family: var(--b-font-sans);
  font-size: var(--b-text-md);
  line-height: var(--b-leading-body);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; border-radius: var(--b-radius); }

a { color: var(--b-brand-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--b-border-focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}

/* ── Typography roles ──────────────────────────────────────────────────── */
.b-headline {
  font-family: var(--b-font-serif);
  font-weight: var(--b-weight-regular);
  font-size: var(--b-text-3xl);
  line-height: var(--b-leading-tight);
  letter-spacing: -0.01em;
  margin: 0;
}
.b-headline--xl { font-size: var(--b-text-4xl); }
.b-headline--md { font-size: var(--b-text-2xl); }

.b-title {
  font-family: var(--b-font-sans);
  font-weight: var(--b-weight-semibold);
  font-size: var(--b-text-xl);
  line-height: var(--b-leading-snug);
  margin: 0;
}
.b-title--sm { font-size: var(--b-text-lg); }

.b-body { font-size: var(--b-text-md); line-height: var(--b-leading-body); color: var(--b-text); }
.b-body--reading { font-size: var(--b-text-lg); max-width: var(--b-reading-max); }
.b-secondary { color: var(--b-text-secondary); font-size: var(--b-text-sm); }
.b-muted { color: var(--b-text-muted); }

/* Mono roles: datelines, statuses, operational metadata, identifiers */
.b-eyebrow,
.b-dateline,
.b-meta {
  font-family: var(--b-font-mono);
  font-size: var(--b-text-xs);
  letter-spacing: var(--b-tracking-mono);
  text-transform: uppercase;
  color: var(--b-text-muted);
  margin: 0;
}
.b-dateline { color: var(--b-text-secondary); }
.b-id {
  font-family: var(--b-font-mono);
  font-size: var(--b-text-xs);
  color: var(--b-text-secondary);
  word-break: break-all;
}
.b-kbd {
  font-family: var(--b-font-mono);
  font-size: var(--b-text-2xs);
  border: var(--b-border-width) solid var(--b-border-strong);
  padding: 1px var(--b-space-1);
  color: var(--b-text-secondary);
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.b-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--b-space-2);
  height: var(--b-control-md);
  padding: 0 var(--b-space-4);
  border: var(--b-border-width) solid var(--b-border-strong);
  background: var(--b-surface);
  color: var(--b-text);
  font-size: var(--b-text-md);
  font-weight: var(--b-weight-medium);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--b-duration-fast) var(--b-ease), border-color var(--b-duration-fast) var(--b-ease), color var(--b-duration-fast) var(--b-ease);
}
.b-btn:hover { background: var(--b-surface-hover); border-color: var(--b-text-muted); }
.b-btn:active { background: var(--b-surface-sunken); }
.b-btn:disabled, .b-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

.b-btn--primary { background: var(--b-brand); border-color: var(--b-brand); color: var(--b-brand-fg); }
.b-btn--primary:hover { background: var(--b-brand-hover); border-color: var(--b-brand-hover); }

.b-btn--ghost { background: transparent; border-color: transparent; color: var(--b-text-secondary); }
.b-btn--ghost:hover { background: var(--b-surface-hover); border-color: transparent; color: var(--b-text); }

.b-btn--danger { color: var(--b-danger-fg); border-color: var(--b-danger-fg); background: transparent; }
.b-btn--danger:hover { background: var(--b-danger-bg); border-color: var(--b-danger-fg); }

.b-btn--link { height: auto; padding: 0; border: 0; background: none; color: var(--b-brand-text); text-decoration: underline; text-underline-offset: 3px; }
.b-btn--link:hover { background: none; }

.b-btn--sm { height: var(--b-control-sm); padding: 0 var(--b-space-3); font-size: var(--b-text-sm); }
.b-btn--lg { height: var(--b-control-lg); padding: 0 var(--b-space-5); }
.b-btn--icon { width: var(--b-control-md); padding: 0; }
.b-btn--icon.b-btn--sm { width: var(--b-control-sm); }
.b-btn--block { width: 100%; }

.b-btn-group { display: inline-flex; }
.b-btn-group > .b-btn + .b-btn { margin-left: calc(-1 * var(--b-border-width)); }

/* ── Form fields ───────────────────────────────────────────────────────── */
.b-field { display: grid; gap: var(--b-space-1); }
.b-field__label { font-size: var(--b-text-sm); font-weight: var(--b-weight-medium); color: var(--b-text); }
.b-field__hint { font-size: var(--b-text-sm); color: var(--b-text-muted); }
.b-field__error { font-size: var(--b-text-sm); color: var(--b-danger-fg); }

.b-input,
.b-select,
.b-textarea {
  width: 100%;
  height: var(--b-control-md);
  padding: 0 var(--b-space-3);
  background: var(--b-surface);
  border: var(--b-border-width) solid var(--b-border-strong);
  color: var(--b-text);
  font-size: var(--b-text-md);
  transition: border-color var(--b-duration-fast) var(--b-ease);
}
.b-input::placeholder, .b-textarea::placeholder { color: var(--b-text-muted); }
.b-input:hover, .b-select:hover, .b-textarea:hover { border-color: var(--b-text-muted); }
.b-input:focus, .b-select:focus, .b-textarea:focus { outline: none; border-color: var(--b-border-focus); box-shadow: inset 0 0 0 1px var(--b-border-focus); }
.b-input[aria-invalid="true"], .b-textarea[aria-invalid="true"] { border-color: var(--b-danger-fg); }
.b-input:disabled, .b-select:disabled, .b-textarea:disabled { background: var(--b-surface-sunken); color: var(--b-text-muted); cursor: not-allowed; }
.b-input--mono { font-family: var(--b-font-mono); font-size: var(--b-text-sm); }

.b-textarea { height: auto; min-height: 96px; padding: var(--b-space-2) var(--b-space-3); line-height: var(--b-leading-body); resize: vertical; }

.b-select {
  appearance: none;
  padding-right: var(--b-space-8);
  background-image: linear-gradient(45deg, transparent 50%, var(--b-text-secondary) 50%), linear-gradient(135deg, var(--b-text-secondary) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.b-check { display: inline-flex; align-items: center; gap: var(--b-space-2); font-size: var(--b-text-md); cursor: pointer; }
.b-check input { appearance: none; width: 16px; height: 16px; margin: 0; border: var(--b-border-width) solid var(--b-border-strong); background: var(--b-surface); display: grid; place-content: center; cursor: pointer; }
.b-check input[type="radio"] { border-radius: var(--b-radius-dot); }
.b-check input:checked { background: var(--b-brand); border-color: var(--b-brand); }
.b-check input[type="checkbox"]:checked::after { content: ""; width: 8px; height: 4px; border-left: 2px solid var(--b-brand-fg); border-bottom: 2px solid var(--b-brand-fg); transform: rotate(-45deg) translate(1px, -1px); }
.b-check input[type="radio"]:checked::after { content: ""; width: 6px; height: 6px; border-radius: var(--b-radius-dot); background: var(--b-brand-fg); }

.b-search { position: relative; }
.b-search .b-input { padding-left: var(--b-space-8); }
.b-search::before { content: "⌕"; position: absolute; left: var(--b-space-3); top: 50%; transform: translateY(-52%); color: var(--b-text-muted); }

/* ── Tabs (underline) & segmented control ──────────────────────────────── */
.b-tabs { display: flex; gap: var(--b-space-1); border-bottom: var(--b-border-width) solid var(--b-border); overflow-x: auto; scrollbar-width: none; }
.b-tab {
  position: relative;
  height: var(--b-control-lg);
  padding: 0 var(--b-space-3);
  border: 0;
  background: none;
  color: var(--b-text-secondary);
  font-size: var(--b-text-md);
  font-weight: var(--b-weight-medium);
  white-space: nowrap;
  cursor: pointer;
}
.b-tab:hover { color: var(--b-text); }
.b-tab[aria-selected="true"] { color: var(--b-text); }
.b-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: calc(-1 * var(--b-border-width)); height: var(--b-border-width-strong); background: var(--b-brand-text); }
.b-tab__count { margin-left: var(--b-space-1); font-family: var(--b-font-mono); font-size: var(--b-text-2xs); color: var(--b-text-muted); }

.b-segmented { display: inline-flex; border: var(--b-border-width) solid var(--b-border-strong); }
.b-segmented button { height: var(--b-control-sm); padding: 0 var(--b-space-3); border: 0; border-right: var(--b-border-width) solid var(--b-border-strong); background: var(--b-surface); color: var(--b-text-secondary); font-size: var(--b-text-sm); font-weight: var(--b-weight-medium); cursor: pointer; }
.b-segmented button:last-child { border-right: 0; }
.b-segmented button:hover { background: var(--b-surface-hover); color: var(--b-text); }
.b-segmented button[aria-pressed="true"] { background: var(--b-text); color: var(--b-bg); }

/* ── Menu ──────────────────────────────────────────────────────────────── */
.b-menu {
  min-width: 200px;
  padding: var(--b-space-1) 0;
  background: var(--b-surface);
  border: var(--b-border-width) solid var(--b-border-strong);
  box-shadow: var(--b-shadow-float);
  z-index: var(--b-z-menu);
}
.b-menu__item { display: flex; align-items: center; gap: var(--b-space-3); width: 100%; height: var(--b-control-md); padding: 0 var(--b-space-3); border: 0; background: none; text-align: left; font-size: var(--b-text-md); cursor: pointer; }
.b-menu__item:hover, .b-menu__item:focus-visible { background: var(--b-surface-hover); outline: none; }
.b-menu__item .b-kbd { margin-left: auto; }
.b-menu__item--danger { color: var(--b-danger-fg); }
.b-menu__label { padding: var(--b-space-2) var(--b-space-3) var(--b-space-1); }
.b-menu__sep { height: 1px; margin: var(--b-space-1) 0; background: var(--b-border); }

/* ── Panel & card ──────────────────────────────────────────────────────── */
.b-panel { background: var(--b-surface); border: var(--b-border-width) solid var(--b-border); }
.b-panel__header { display: flex; align-items: center; justify-content: space-between; gap: var(--b-space-3); padding: var(--b-space-3) var(--b-space-4); border-bottom: var(--b-border-width) solid var(--b-border); min-height: var(--b-control-lg); }
.b-panel__body { padding: var(--b-space-4); }
.b-panel__footer { display: flex; justify-content: flex-end; gap: var(--b-space-2); padding: var(--b-space-3) var(--b-space-4); border-top: var(--b-border-width) solid var(--b-border); }
.b-panel--sunken { background: var(--b-surface-sunken); }

.b-card {
  display: grid;
  gap: var(--b-space-2);
  padding: var(--b-space-4);
  background: var(--b-surface);
  border: var(--b-border-width) solid var(--b-border);
  text-align: left;
  transition: border-color var(--b-duration-fast) var(--b-ease), box-shadow var(--b-duration-fast) var(--b-ease), transform var(--b-duration-fast) var(--b-ease);
}
.b-card--interactive { cursor: pointer; width: 100%; }
.b-card--interactive:hover { border-color: var(--b-border-strong); box-shadow: var(--b-shadow-hover); transform: translateY(-1px); }
.b-card[aria-current="true"], .b-card[aria-selected="true"] { border-color: var(--b-brand-text); box-shadow: inset 3px 0 0 var(--b-brand-text); }
.b-card__rule { border-top: var(--b-border-width-strong) solid var(--b-rule, var(--b-border-strong)); margin: calc(-1 * var(--b-space-4)) calc(-1 * var(--b-space-4)) 0; }

/* ── Status pills: thin, rectangular, mono, dot prefix ─────────────────── */
.b-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 var(--b-space-2);
  border: var(--b-border-width) solid currentColor;
  font-family: var(--b-font-mono);
  font-size: var(--b-text-2xs);
  font-weight: var(--b-weight-semibold);
  letter-spacing: var(--b-tracking-pill);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--b-neutral-fg);
  background: var(--b-neutral-bg);
}
.b-pill::before { content: ""; width: 5px; height: 5px; border-radius: var(--b-radius-dot); background: currentColor; flex-shrink: 0; }
.b-pill--plain::before { display: none; }
.b-pill--positive { color: var(--b-positive-fg); background: var(--b-positive-bg); }
.b-pill--progress { color: var(--b-progress-fg); background: var(--b-progress-bg); }
.b-pill--info { color: var(--b-info-fg); background: var(--b-info-bg); }
.b-pill--danger { color: var(--b-danger-fg); background: var(--b-danger-bg); }
.b-pill--special { color: var(--b-special-fg); background: var(--b-special-bg); }
.b-pill--brand { color: var(--b-brand-pill-fg); background: var(--b-brand-pill-bg); }
.b-pill--outline { background: transparent; }

.b-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 var(--b-space-1); background: var(--b-brand); color: var(--b-brand-fg); font-family: var(--b-font-mono); font-size: var(--b-text-2xs); font-weight: var(--b-weight-semibold); }

/* Availability marker: what is specified vs. live on Railway (reference & Office use) */
.b-availability { display: inline-flex; align-items: center; gap: var(--b-space-1); font-family: var(--b-font-mono); font-size: var(--b-text-2xs); letter-spacing: var(--b-tracking-pill); text-transform: uppercase; color: var(--b-text-muted); border: 1px dashed var(--b-border-strong); padding: 1px var(--b-space-2); }

/* ── Feedback: banner, toast, empty, skeleton, progress ────────────────── */
.b-banner { display: grid; grid-template-columns: auto 1fr auto; gap: var(--b-space-3); align-items: start; padding: var(--b-space-3) var(--b-space-4); border: var(--b-border-width) solid var(--b-border); border-left: 3px solid var(--b-tone, var(--b-neutral-fg)); background: var(--b-surface); font-size: var(--b-text-sm); }
.b-banner__icon { color: var(--b-tone, var(--b-neutral-fg)); font-family: var(--b-font-mono); font-weight: var(--b-weight-bold); line-height: var(--b-leading-body); }
.b-banner strong { display: block; font-size: var(--b-text-md); }
.b-banner--info { --b-tone: var(--b-info-fg); }
.b-banner--positive { --b-tone: var(--b-positive-fg); }
.b-banner--warning { --b-tone: var(--b-progress-fg); }
.b-banner--danger { --b-tone: var(--b-danger-fg); }

.b-toast { display: flex; align-items: center; gap: var(--b-space-3); min-width: 280px; max-width: 420px; padding: var(--b-space-3) var(--b-space-4); background: var(--b-text); color: var(--b-bg); font-size: var(--b-text-sm); box-shadow: var(--b-shadow-float); z-index: var(--b-z-toast); }
.b-toast .b-btn--link { color: inherit; margin-left: auto; }

.b-empty { display: grid; justify-items: start; gap: var(--b-space-2); padding: var(--b-space-8) var(--b-space-6); border: 1px dashed var(--b-border-strong); background: transparent; }
.b-empty__title { font-family: var(--b-font-serif); font-size: var(--b-text-xl); margin: 0; }
.b-empty p { margin: 0; color: var(--b-text-secondary); max-width: 52ch; }

.b-skeleton { display: block; height: 12px; background: linear-gradient(90deg, var(--b-surface-sunken), var(--b-surface-hover), var(--b-surface-sunken)); background-size: 200% 100%; animation: b-shimmer 1.4s linear infinite; }
@keyframes b-shimmer { to { background-position: -200% 0; } }

.b-progress { height: 2px; background: var(--b-border); overflow: hidden; }
.b-progress span { display: block; height: 100%; background: var(--b-brand-text); }

/* ── Dialog ────────────────────────────────────────────────────────────── */
.b-dialog { width: min(520px, calc(100vw - var(--b-space-8))); padding: 0; border: var(--b-border-width) solid var(--b-border-strong); background: var(--b-surface); color: var(--b-text); box-shadow: var(--b-shadow-float); }
.b-dialog::backdrop { background: var(--b-overlay-scrim); }
.b-dialog__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--b-space-3); padding: var(--b-space-4) var(--b-space-5); border-bottom: var(--b-border-width) solid var(--b-border); }
.b-dialog__body { display: grid; gap: var(--b-space-4); padding: var(--b-space-5); }
.b-dialog__footer { display: flex; justify-content: flex-end; gap: var(--b-space-2); padding: var(--b-space-3) var(--b-space-5); border-top: var(--b-border-width) solid var(--b-border); background: var(--b-surface-sunken); }
.b-dialog--static { position: static; display: block; margin: 0; box-shadow: var(--b-shadow-float); }

/* ── Lists, rows, definition lists, tables ─────────────────────────────── */
.b-list { list-style: none; margin: 0; padding: 0; border-top: var(--b-border-width) solid var(--b-border); }
.b-row { display: grid; grid-template-columns: auto 1fr auto; gap: var(--b-space-3); align-items: start; width: 100%; padding: var(--b-space-3) var(--b-space-4); border: 0; border-bottom: var(--b-border-width) solid var(--b-border); background: var(--b-surface); text-align: left; }
button.b-row, a.b-row { cursor: pointer; color: inherit; text-decoration: none; }
button.b-row:hover, a.b-row:hover { background: var(--b-surface-hover); }
.b-row[aria-current="true"] { background: var(--b-surface-selected); box-shadow: inset 3px 0 0 var(--b-brand-text); }
.b-row--unread .b-row__title { font-weight: var(--b-weight-semibold); }
.b-row--unread .b-row__mark { background: var(--b-brand-text); }
.b-row__mark { width: 6px; height: 6px; margin-top: 8px; border-radius: var(--b-radius-dot); background: transparent; }
.b-row__title { display: block; font-size: var(--b-text-md); }
.b-row__text { display: block; font-size: var(--b-text-sm); color: var(--b-text-secondary); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.b-row__aside { display: grid; justify-items: end; gap: var(--b-space-1); }

.b-dl { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; margin: 0; }
.b-dl dt, .b-dl dd { margin: 0; padding: var(--b-space-3) 0; border-bottom: var(--b-border-width) solid var(--b-border); }
.b-dl dt { font-size: var(--b-text-sm); color: var(--b-text-secondary); padding-right: var(--b-space-4); }
.b-dl dd { font-size: var(--b-text-md); min-width: 0; }

.b-table { width: 100%; border-collapse: collapse; font-size: var(--b-text-sm); }
.b-table th { text-align: left; font-family: var(--b-font-mono); font-size: var(--b-text-2xs); font-weight: var(--b-weight-semibold); letter-spacing: var(--b-tracking-mono); text-transform: uppercase; color: var(--b-text-muted); padding: var(--b-space-2) var(--b-space-3); border-bottom: var(--b-border-width) solid var(--b-border-strong); }
.b-table td { padding: var(--b-space-3); border-bottom: var(--b-border-width) solid var(--b-border); vertical-align: top; }

.b-avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; background: var(--b-brand-soft); color: var(--b-brand-text); font-weight: var(--b-weight-semibold); font-size: var(--b-text-sm); flex-shrink: 0; }
.b-avatar--lg { width: 64px; height: 64px; font-size: var(--b-text-xl); font-family: var(--b-font-serif); font-weight: var(--b-weight-regular); }
.b-avatar--agent { background: var(--b-surface-sunken); color: var(--b-text-secondary); border: 1px dashed var(--b-border-strong); }

.b-divider { height: 1px; border: 0; background: var(--b-border); margin: var(--b-space-4) 0; }
.b-rule { height: 0; border: 0; border-top: var(--b-border-width-strong) solid var(--b-text); margin: 0; }

.b-chip { display: inline-flex; align-items: center; gap: var(--b-space-1); height: 24px; padding: 0 var(--b-space-2); border: var(--b-border-width) solid var(--b-border); background: var(--b-surface); font-size: var(--b-text-sm); color: var(--b-text-secondary); }
.b-swatch { width: 8px; height: 8px; flex-shrink: 0; background: var(--b-swatch, var(--b-neutral-fg)); }

/* ══════════════════════════════════════════════════════════════════════
   Desk shell: rail | section nav | main | details
   ══════════════════════════════════════════════════════════════════════ */
.b-shell {
  display: grid;
  grid-template-columns: var(--b-rail-width) var(--b-section-width) minmax(0, 1fr) var(--b-details-width);
  grid-template-areas: "rail section main details";
  min-height: 100vh;
  min-height: 100dvh;
}
.b-shell[data-details="closed"] { grid-template-columns: var(--b-rail-width) var(--b-section-width) minmax(0, 1fr) 0; }
.b-shell[data-details="closed"] .b-details { display: none; }

.b-rail { grid-area: rail; position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: var(--b-space-1); padding: var(--b-space-3) var(--b-space-2); background: var(--b-surface); border-right: var(--b-border-width) solid var(--b-border); }
.b-brand { display: flex; align-items: center; gap: var(--b-space-2); height: var(--b-control-lg); padding: 0 var(--b-space-2); margin-bottom: var(--b-space-3); font-family: var(--b-font-serif); font-size: var(--b-text-xl); color: var(--b-text); text-decoration: none; }
.b-brand__mark { display: inline-grid; place-items: center; width: 28px; height: 28px; background: var(--b-brand); color: var(--b-brand-fg); font-size: var(--b-text-lg); font-family: var(--b-font-serif); font-weight: var(--b-weight-bold); }
.b-rail__item { display: flex; align-items: center; gap: var(--b-space-3); height: var(--b-control-md); padding: 0 var(--b-space-3); border: 0; background: none; color: var(--b-text-secondary); font-size: var(--b-text-md); font-weight: var(--b-weight-medium); text-decoration: none; cursor: pointer; text-align: left; width: 100%; }
.b-rail__item:hover { background: var(--b-surface-hover); color: var(--b-text); }
.b-rail__item[aria-current="page"] { background: var(--b-brand); color: var(--b-brand-fg); }
.b-rail__icon { width: 18px; text-align: center; font-size: var(--b-text-lg); line-height: 1; }
.b-rail__spacer { flex: 1; }

.b-section { grid-area: section; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; padding: var(--b-space-4) 0; background: var(--b-bg); border-right: var(--b-border-width) solid var(--b-border); }
.b-section__header { padding: 0 var(--b-space-4) var(--b-space-4); }
.b-section__group { padding: var(--b-space-3) var(--b-space-4) var(--b-space-1); }
.b-section__item { display: grid; grid-template-columns: 20px 1fr auto; gap: var(--b-space-2); align-items: center; width: 100%; min-height: var(--b-control-md); padding: var(--b-space-1) var(--b-space-4); border: 0; background: none; color: var(--b-text-secondary); text-align: left; font-size: var(--b-text-md); cursor: pointer; text-decoration: none; }
.b-section__item:hover { background: var(--b-surface-hover); color: var(--b-text); }
.b-section__item[aria-current="page"], .b-section__item[aria-current="true"] { color: var(--b-text); background: var(--b-surface); box-shadow: inset 3px 0 0 var(--b-brand-text); font-weight: var(--b-weight-medium); }
.b-section__item small { display: block; font-size: var(--b-text-xs); color: var(--b-text-muted); font-weight: var(--b-weight-regular); }

.b-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; }
.b-topbar { position: sticky; top: 0; z-index: var(--b-z-sticky); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--b-space-3); min-height: var(--b-topbar-height); padding: var(--b-space-2) var(--b-space-6); background: var(--b-header-blur-bg); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: var(--b-border-width) solid var(--b-border); }
.b-topbar__title { display: grid; gap: 2px; min-width: 0; }
.b-topbar__actions { display: flex; align-items: center; gap: var(--b-space-2); }
.b-content { padding: var(--b-space-6); width: 100%; max-width: var(--b-content-max); }

.b-details { grid-area: details; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; background: var(--b-surface); border-left: var(--b-border-width) solid var(--b-border); }
.b-details__header { display: flex; align-items: center; justify-content: space-between; gap: var(--b-space-2); min-height: var(--b-topbar-height); padding: var(--b-space-2) var(--b-space-4); border-bottom: var(--b-border-width) solid var(--b-border); }
.b-details__body { display: grid; gap: var(--b-space-5); padding: var(--b-space-4); }
.b-details__close { display: none; }

.b-mobile-bar { display: none; }
.b-scrim { display: none; }

/* ≤1279: details becomes an overlay drawer */
@media (max-width: 1279px) {
  .b-shell, .b-shell[data-details="closed"] { grid-template-columns: var(--b-rail-width-collapsed) var(--b-section-width) minmax(0, 1fr); grid-template-areas: "rail section main"; }
  .b-rail .b-rail__label, .b-brand__word { display: none; }
  .b-rail__item { justify-content: center; padding: 0; }
  .b-brand { justify-content: center; padding: 0; }
  .b-details { position: fixed; right: 0; top: 0; width: min(var(--b-details-width), 100vw); z-index: var(--b-z-drawer); box-shadow: var(--b-shadow-float); transform: translateX(100%); transition: transform var(--b-duration) var(--b-ease); }
  .b-shell[data-details="open"] .b-details { transform: none; display: block; }
  .b-shell[data-details="closed"] .b-details { display: block; }
  .b-shell[data-details="open"] .b-scrim { display: block; position: fixed; inset: 0; background: var(--b-overlay-scrim); z-index: calc(var(--b-z-drawer) - 1); }
  .b-details__close { display: inline-flex; }
}

/* ≤959: section nav becomes a horizontal strip above main */
@media (max-width: 959px) {
  .b-shell, .b-shell[data-details="closed"] { grid-template-columns: var(--b-rail-width-collapsed) minmax(0, 1fr); grid-template-areas: "rail section" "rail main"; grid-template-rows: auto 1fr; }
  .b-section { position: sticky; height: auto; display: flex; align-items: center; gap: var(--b-space-1); padding: 0 var(--b-space-2); overflow-x: auto; border-right: 0; border-bottom: var(--b-border-width) solid var(--b-border); z-index: calc(var(--b-z-sticky) + 1); scrollbar-width: none; }
  .b-section__header, .b-section__group, .b-section__item small, .b-section__extra { display: none; }
  .b-section__item { display: inline-flex; width: auto; min-height: var(--b-control-lg); padding: 0 var(--b-space-3); gap: var(--b-space-2); white-space: nowrap; }
  .b-section__item[aria-current="page"], .b-section__item[aria-current="true"] { background: none; box-shadow: inset 0 -2px 0 var(--b-brand-text); }
  .b-topbar { top: 0; }
  .b-content { padding: var(--b-space-4); }
}

/* ≤639: rail becomes a bottom bar; 16px gutters */
@media (max-width: 639px) {
  .b-shell, .b-shell[data-details="closed"] { grid-template-columns: minmax(0, 1fr); grid-template-areas: "section" "main"; padding-bottom: calc(var(--b-control-lg) + var(--b-space-3)); }
  .b-rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; justify-content: space-around; padding: var(--b-space-1); border-right: 0; border-top: var(--b-border-width) solid var(--b-border); z-index: var(--b-z-drawer); }
  .b-rail .b-brand, .b-rail__spacer, .b-rail__utility { display: none; }
  .b-rail__item { flex-direction: column; gap: 2px; height: var(--b-control-lg); width: auto; flex: 1; font-size: var(--b-text-2xs); }
  .b-rail .b-rail__label { display: block; }
  .b-topbar { padding: var(--b-space-2) var(--b-space-4); }
  .b-content { padding: var(--b-space-4); }
  .b-details { width: 100vw; }
}

/* ══════════════════════════════════════════════════════════════════════
   Surface patterns (Desk family)
   ══════════════════════════════════════════════════════════════════════ */

/* Pads: list + editor */
.b-pad-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); border: var(--b-border-width) solid var(--b-border); background: var(--b-surface); min-height: 560px; }
.b-pad-list { border-right: var(--b-border-width) solid var(--b-border); background: var(--b-bg); display: flex; flex-direction: column; min-width: 0; }
.b-pad-list__tools { display: grid; gap: var(--b-space-2); padding: var(--b-space-3); border-bottom: var(--b-border-width) solid var(--b-border); }
.b-pad-group { margin: 0; padding: var(--b-space-3) var(--b-space-3) var(--b-space-1); display: flex; justify-content: space-between; }
.b-pad-item { display: grid; gap: 2px; width: 100%; padding: var(--b-space-2) var(--b-space-3); border: 0; border-bottom: var(--b-border-width) solid var(--b-border); background: none; text-align: left; cursor: pointer; }
.b-pad-item:hover { background: var(--b-surface-hover); }
.b-pad-item[aria-current="true"] { background: var(--b-surface); box-shadow: inset 3px 0 0 var(--b-brand-text); }
.b-pad-item__title { font-weight: var(--b-weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-pad-editor { display: flex; flex-direction: column; min-width: 0; }
.b-pad-editor__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--b-space-2); padding: var(--b-space-2) var(--b-space-4); border-bottom: var(--b-border-width) solid var(--b-border); }
.b-pad-editor__doc { padding: var(--b-space-8) var(--b-space-8) var(--b-space-12); max-width: calc(var(--b-reading-max) + 2 * var(--b-space-8)); }
.b-pad-editor__title { width: 100%; border: 0; background: none; padding: 0; font-family: var(--b-font-serif); font-size: var(--b-text-3xl); line-height: var(--b-leading-tight); outline: none; }
.b-pad-editor__text { width: 100%; min-height: 280px; border: 0; background: none; padding: 0; margin-top: var(--b-space-4); font-size: var(--b-text-lg); line-height: 1.7; resize: none; outline: none; }

/* Pad actions menu: formatting lives here, not in a visible toolbar. The page itself is the editor. */
.b-menu-anchor { position: relative; display: inline-flex; }
.b-menu-anchor > .b-menu, .b-menu-anchor > .b-popover { position: absolute; top: calc(100% + var(--b-space-1)); right: 0; z-index: var(--b-z-menu); }
.b-menu--wide { min-width: 260px; max-height: min(70vh, 560px); overflow-y: auto; }
.b-menu__item[aria-checked="true"] { color: var(--b-brand-text); font-weight: var(--b-weight-semibold); }
.b-menu__item[aria-checked="true"]::before { content: "✓"; width: 12px; margin-left: -4px; }
.b-menu__item[aria-checked="false"]::before { content: ""; width: 12px; margin-left: -4px; }
.b-menu--wide .b-menu__item:not([aria-checked])::before { content: ""; width: 12px; margin-left: -4px; }
.b-menu__item:disabled { color: var(--b-text-muted); cursor: not-allowed; background: none; }
.b-menu__item--h1 { font-family: var(--b-font-serif); font-size: var(--b-text-lg); }
.b-menu__item--h2 { font-family: var(--b-font-serif); }
.b-menu__item--h3 { font-family: var(--b-font-mono); font-size: var(--b-text-xs); letter-spacing: var(--b-tracking-mono); text-transform: uppercase; }

/* Layer bar: names a non-default view (source, revisions, conflict) and how to leave it */
.b-layer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--b-space-2) var(--b-space-3); margin: calc(-1 * var(--b-space-8)) calc(-1 * var(--b-space-8)) var(--b-space-6); padding: var(--b-space-2) var(--b-space-8); background: var(--b-surface-sunken); border-bottom: var(--b-border-width) solid var(--b-border); }
.b-layer-bar > :last-child { margin-left: auto; }
@media (max-width: 759px) { .b-layer-bar { margin: calc(-1 * var(--b-space-5)) calc(-1 * var(--b-space-4)) var(--b-space-5); padding: var(--b-space-2) var(--b-space-4); } }

/* Rendered Pad document: the newspaper reading surface, directly editable */
.b-doc { margin-top: var(--b-space-4); min-height: 280px; font-size: var(--b-text-lg); line-height: 1.7; color: var(--b-text); outline: none; caret-color: var(--b-brand-text); overflow-wrap: anywhere; }
.b-doc:focus-visible { outline: none; }
.b-doc > :first-child { margin-top: 0; }
.b-doc p { margin: 0 0 var(--b-space-4); }
.b-doc h1, .b-doc h2, .b-doc h3 { font-family: var(--b-font-serif); font-weight: var(--b-weight-regular); line-height: var(--b-leading-tight); margin: var(--b-space-8) 0 var(--b-space-3); }
.b-doc h1 { font-size: var(--b-text-2xl); padding-bottom: var(--b-space-2); border-bottom: var(--b-border-width-strong) solid var(--b-text); }
.b-doc h2 { font-size: var(--b-text-xl); }
.b-doc h3 { font-family: var(--b-font-mono); font-size: var(--b-text-xs); letter-spacing: var(--b-tracking-mono); text-transform: uppercase; color: var(--b-text-secondary); margin-top: var(--b-space-6); }
.b-doc strong { font-weight: var(--b-weight-semibold); }
.b-doc a { color: var(--b-brand-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.b-doc ul, .b-doc ol { margin: 0 0 var(--b-space-4); padding-left: var(--b-space-6); }
.b-doc li { margin: 0 0 var(--b-space-1); padding-left: var(--b-space-1); }
.b-doc ul { list-style: square; }
.b-doc ul li::marker { color: var(--b-text-muted); }
.b-doc ol li::marker { font-family: var(--b-font-mono); font-size: var(--b-text-sm); color: var(--b-text-muted); }
.b-doc table { width: 100%; margin: 0 0 var(--b-space-5); border-collapse: collapse; font-size: var(--b-text-md); line-height: var(--b-leading-snug); }
.b-doc th { text-align: left; font-family: var(--b-font-mono); font-size: var(--b-text-2xs); font-weight: var(--b-weight-semibold); letter-spacing: var(--b-tracking-mono); text-transform: uppercase; color: var(--b-text-secondary); padding: var(--b-space-2) var(--b-space-3); border-bottom: var(--b-border-width-strong) solid var(--b-text); }
.b-doc td { padding: var(--b-space-2) var(--b-space-3); border-bottom: var(--b-border-width) solid var(--b-border); vertical-align: top; }
.b-doc [data-align="right"] { text-align: right; }
.b-doc [data-align="center"] { text-align: center; }
.b-doc table:focus-within { outline: 1px dashed var(--b-border-strong); outline-offset: 4px; }

/* Revisions inspection layer: change marks and contributor colours live ONLY here, never in the document */
.b-doc--inspect { cursor: default; }
.b-diff-add { background: color-mix(in srgb, var(--b-contributor, var(--b-brand-text)) 14%, transparent); box-shadow: inset 0 -2px 0 var(--b-contributor, var(--b-brand-text)); text-decoration: none; }
.b-diff-del { color: var(--b-text-muted); text-decoration: line-through; text-decoration-color: var(--b-accent-paprika); text-decoration-thickness: 1px; }
.b-diff-block { box-shadow: inset 3px 0 0 var(--b-contributor, var(--b-brand-text)); padding-left: var(--b-space-3); margin-left: calc(-1 * var(--b-space-3) - 3px); }
.b-contributor { display: inline-flex; align-items: center; gap: var(--b-space-1); font-size: var(--b-text-sm); color: var(--b-text-secondary); }
.b-contributor::before { content: ""; width: 10px; height: 10px; background: var(--b-contributor); }

/* Draft conflict review: two named sides, never auto-merged */
.b-conflict { display: grid; grid-template-columns: 1fr 1fr; border: var(--b-border-width) solid var(--b-border); margin: 0 0 var(--b-space-4); }
.b-conflict > div { padding: var(--b-space-3) var(--b-space-4); min-width: 0; }
.b-conflict > div + div { border-left: var(--b-border-width) solid var(--b-border); }
.b-conflict .b-eyebrow { margin-bottom: var(--b-space-2); }
.b-conflict p, .b-conflict ol, .b-conflict table { margin: 0; }
@media (max-width: 759px) { .b-conflict { grid-template-columns: 1fr; } .b-conflict > div + div { border-left: 0; border-top: var(--b-border-width) solid var(--b-border); } }

/* Take to…: clean content preview, provenance shown apart from it */
.b-dialog--wide { width: min(720px, calc(100vw - var(--b-space-8))); }
.b-transfer-preview { max-height: 320px; overflow-y: auto; padding: var(--b-space-4) var(--b-space-5); border: var(--b-border-width) solid var(--b-border); background: var(--b-bg); }
.b-transfer-preview .b-doc { margin: 0; min-height: 0; font-size: var(--b-text-md); }
.b-transfer-preview__title { font-family: var(--b-font-serif); font-size: var(--b-text-2xl); line-height: var(--b-leading-tight); margin: 0 0 var(--b-space-3); }

/* Editorial annotations — PROPOSAL ONLY. Not document format; shown on reference pages labelled as a proposal. */
.b-annotation { padding: 0 2px; background: color-mix(in srgb, var(--b-annotation) 16%, transparent); border-bottom: 2px solid var(--b-annotation); }
.b-annotation--verify { --b-annotation: var(--b-accent-mustard); }
.b-annotation--source { --b-annotation: var(--b-accent-sky); }
.b-annotation--confirmed { --b-annotation: var(--b-accent-olive); }
.b-annotation--question { --b-annotation: var(--b-accent-paprika); border-bottom-style: dotted; }

/* Unsupported Markdown: preserved verbatim, shown locked, never dropped */
.b-doc .b-raw-block { margin: 0 0 var(--b-space-4); padding: var(--b-space-2) var(--b-space-3); border: 1px dashed var(--b-border-strong); background: var(--b-surface-sunken); font-family: var(--b-font-mono); font-size: var(--b-text-sm); white-space: pre-wrap; color: var(--b-text-secondary); user-select: all; }
.b-doc .b-raw-block::before { content: "Kept as Markdown · edit in source view"; display: block; margin-bottom: var(--b-space-1); font-size: var(--b-text-2xs); letter-spacing: var(--b-tracking-mono); text-transform: uppercase; color: var(--b-text-muted); }

/* Source view: the canonical Markdown, exactly as stored */
.b-pad-source { width: 100%; min-height: 360px; margin-top: var(--b-space-4); padding: var(--b-space-4); border: var(--b-border-width) solid var(--b-border); background: var(--b-surface-sunken); color: var(--b-text); font-family: var(--b-font-mono); font-size: var(--b-text-sm); line-height: 1.7; resize: vertical; tab-size: 2; }
.b-pad-source:focus { outline: none; border-color: var(--b-border-focus); }

/* Link popover */
.b-popover { display: grid; gap: var(--b-space-3); width: 320px; padding: var(--b-space-3); background: var(--b-surface); border: var(--b-border-width) solid var(--b-border-strong); box-shadow: var(--b-shadow-float); }
.b-pad-editor__status { display: flex; flex-wrap: wrap; gap: var(--b-space-3); align-items: center; padding: var(--b-space-2) var(--b-space-4); border-top: var(--b-border-width) solid var(--b-border); margin-top: auto; background: var(--b-surface-sunken); }
.b-trail { display: flex; flex-wrap: wrap; align-items: center; gap: var(--b-space-1); font-family: var(--b-font-mono); font-size: var(--b-text-xs); color: var(--b-text-secondary); }
.b-trail span + span::before { content: "→"; margin-right: var(--b-space-1); color: var(--b-text-muted); }
.b-revision { display: grid; grid-template-columns: auto 1fr; gap: var(--b-space-1) var(--b-space-3); padding: var(--b-space-2) 0; border-bottom: var(--b-border-width) solid var(--b-border); font-size: var(--b-text-sm); }
.b-revision__n { font-family: var(--b-font-mono); font-size: var(--b-text-xs); color: var(--b-text-secondary); }

@media (max-width: 759px) {
  .b-pad-layout { grid-template-columns: 1fr; }
  .b-pad-list { border-right: 0; border-bottom: var(--b-border-width) solid var(--b-border); max-height: 280px; overflow-y: auto; }
  .b-pad-editor__doc { padding: var(--b-space-5) var(--b-space-4) var(--b-space-8); }
}

/* Calendar */
.b-cal-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--b-space-3); margin-bottom: var(--b-space-3); }
.b-cal-nav { display: flex; align-items: center; gap: var(--b-space-2); }
.b-cal-range { font-family: var(--b-font-serif); font-size: var(--b-text-2xl); line-height: 1.1; margin: 0 var(--b-space-2); }
.b-cal-legend { display: flex; flex-wrap: wrap; gap: var(--b-space-2); margin-bottom: var(--b-space-3); }

.b-cal-week { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); border: var(--b-border-width) solid var(--b-border); background: var(--b-surface); }
.b-cal-week__head { padding: var(--b-space-2); border-bottom: var(--b-border-width) solid var(--b-border); border-left: var(--b-border-width) solid var(--b-border); }
.b-cal-week__head:first-child { border-left: 0; }
.b-cal-week__head[data-today] .b-cal-daynum { background: var(--b-brand); color: var(--b-brand-fg); }
.b-cal-daynum { display: inline-grid; place-items: center; min-width: 28px; height: 28px; font-family: var(--b-font-serif); font-size: var(--b-text-xl); }
.b-cal-allday { grid-column: 1 / -1; display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); border-bottom: var(--b-border-width) solid var(--b-border-strong); background: var(--b-surface-sunken); }
.b-cal-allday > * { padding: var(--b-space-1); min-height: 28px; border-left: var(--b-border-width) solid var(--b-border); }
.b-cal-allday > :first-child { border-left: 0; display: flex; align-items: center; }
.b-cal-grid { grid-column: 1 / -1; display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); position: relative; }
.b-cal-hours { display: grid; grid-template-rows: repeat(10, 48px); }
.b-cal-hours span { font-family: var(--b-font-mono); font-size: var(--b-text-2xs); color: var(--b-text-muted); padding: 0 var(--b-space-1); transform: translateY(-6px); text-align: right; }
.b-cal-col { position: relative; display: grid; grid-template-rows: repeat(10, 48px); border-left: var(--b-border-width) solid var(--b-border); }
.b-cal-col > i { border-top: var(--b-border-width) solid var(--b-border); }
.b-cal-col[data-today] { background: color-mix(in srgb, var(--b-brand-soft) 45%, transparent); }
.b-cal-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--b-accent-paprika); z-index: 2; }
.b-cal-now::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; background: var(--b-accent-paprika); }

/* Event block: lane colour as left rule; status changes fill/stroke, not hue */
.b-event {
  position: absolute;
  left: 3px; right: 3px;
  display: grid;
  align-content: start;
  gap: 1px;
  padding: 3px var(--b-space-2);
  overflow: hidden;
  background: color-mix(in srgb, var(--b-lane, var(--b-sky)) 14%, var(--b-surface));
  border: var(--b-border-width) solid color-mix(in srgb, var(--b-lane, var(--b-sky)) 40%, var(--b-border));
  border-left: 3px solid var(--b-lane, var(--b-sky));
  font-size: var(--b-text-xs);
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  z-index: 1;
}
.b-event:hover { box-shadow: var(--b-shadow-hover); border-color: var(--b-lane, var(--b-sky)); }
.b-event[aria-selected="true"] { outline: 2px solid var(--b-text); outline-offset: -1px; }
.b-event strong { font-weight: var(--b-weight-semibold); font-size: var(--b-text-xs); color: var(--b-text); }
.b-event time { font-family: var(--b-font-mono); font-size: var(--b-text-2xs); color: var(--b-text-secondary); }
.b-event--tentative { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--b-lane) 12%, var(--b-surface)) 0 6px, var(--b-surface) 6px 12px); border-style: dashed; border-left-style: solid; }
.b-event--cancelled { background: var(--b-surface); opacity: 0.7; }
.b-event--cancelled strong { text-decoration: line-through; }
.b-event--shift { background: var(--b-surface); border-left-width: 6px; }
.b-event--allday { position: static; height: 22px; white-space: nowrap; text-overflow: ellipsis; display: block; width: 100%; padding: 1px var(--b-space-2); font-size: var(--b-text-2xs); }

.b-cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: var(--b-border-width) solid var(--b-border); border-left: var(--b-border-width) solid var(--b-border); background: var(--b-surface); }
.b-cal-month > div { min-height: 96px; padding: var(--b-space-1); border-right: var(--b-border-width) solid var(--b-border); border-bottom: var(--b-border-width) solid var(--b-border); display: grid; align-content: start; gap: 2px; }
.b-cal-month__dow { min-height: auto !important; font-family: var(--b-font-mono); font-size: var(--b-text-2xs); color: var(--b-text-muted); text-transform: uppercase; letter-spacing: var(--b-tracking-mono); padding: var(--b-space-2) !important; }
.b-cal-month [data-outside] { background: var(--b-surface-sunken); color: var(--b-text-muted); }
.b-cal-month .b-event { position: static; height: auto; white-space: nowrap; }

.b-agenda-day { display: grid; grid-template-columns: 88px 1fr; border-bottom: var(--b-border-width) solid var(--b-border); }
.b-agenda-day > :first-child { padding: var(--b-space-3) 0; }
.b-agenda-item { display: grid; grid-template-columns: 96px 1fr auto; gap: var(--b-space-3); align-items: baseline; padding: var(--b-space-3); border-left: 3px solid var(--b-lane, var(--b-sky)); margin: var(--b-space-2) 0; background: var(--b-surface); border-top: 1px solid var(--b-border); border-right: 1px solid var(--b-border); border-bottom: 1px solid var(--b-border); }

@media (max-width: 759px) {
  .b-cal-week, .b-cal-allday, .b-cal-grid { grid-template-columns: 40px repeat(3, minmax(0, 1fr)); }
  .b-cal-week [data-wide] { display: none; }
  .b-cal-month > div { min-height: 64px; }
  .b-cal-month .b-event span { display: none; }
  .b-agenda-item { grid-template-columns: 1fr; gap: var(--b-space-1); }
  .b-agenda-day { grid-template-columns: 1fr; }
}

/* Inbox */
.b-inbox { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); border: var(--b-border-width) solid var(--b-border); background: var(--b-surface); min-height: 520px; }
.b-inbox__list { border-right: var(--b-border-width) solid var(--b-border); min-width: 0; }
.b-inbox__list .b-list { border-top: 0; }
.b-inbox__read { display: flex; flex-direction: column; min-width: 0; }
.b-thread { display: grid; gap: var(--b-space-4); padding: var(--b-space-5); align-content: start; flex: 1; }
.b-message { display: grid; grid-template-columns: 32px 1fr; gap: var(--b-space-3); max-width: 640px; }
.b-message__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--b-space-2); }
.b-message__body { margin-top: var(--b-space-1); padding: var(--b-space-3) var(--b-space-4); border: var(--b-border-width) solid var(--b-border); background: var(--b-bg); font-size: var(--b-text-md); }
.b-message--own .b-message__body { background: var(--b-brand-soft); border-color: color-mix(in srgb, var(--b-brand-text) 30%, var(--b-border)); }
.b-thread__day { display: flex; align-items: center; gap: var(--b-space-3); }
.b-thread__day::before, .b-thread__day::after { content: ""; flex: 1; height: 1px; background: var(--b-border); }
.b-composer { display: grid; grid-template-columns: 1fr auto; gap: var(--b-space-2); padding: var(--b-space-3) var(--b-space-4); border-top: var(--b-border-width) solid var(--b-border); background: var(--b-surface-sunken); align-items: end; }
.b-composer .b-textarea { min-height: 44px; }

@media (max-width: 899px) {
  .b-inbox { grid-template-columns: 1fr; }
  .b-inbox__list { border-right: 0; border-bottom: var(--b-border-width) solid var(--b-border); }
}

/* Account */
.b-account-head { display: grid; grid-template-columns: auto 1fr auto; gap: var(--b-space-4); align-items: center; padding: var(--b-space-5); }
.b-account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--b-space-4); }
@media (max-width: 639px) {
  .b-account-head { grid-template-columns: auto 1fr; }
  .b-account-head > :last-child { grid-column: 1 / -1; }
  .b-account-grid { grid-template-columns: 1fr; }
  .b-dl { grid-template-columns: 1fr; }
  .b-dl dt { border-bottom: 0; padding-bottom: 0; }
}
