/* walters.css: every component and shell style in the Walters app. It is global on purpose (no Razor CSS isolation), so the
   markup matches the Walters Buildings design system's wb-* classes exactly. Values come only from tokens.css (var(--token)).

   1. The design system's components/bundle.css, verbatim (design system version 1792180638-5467). Re-sync it from the design
      system rather than editing it here, so the Razor components and the design system's previews stay identical.
   2. The design canvas's theme.css additions.
   3. App additions for pieces the design system has no component for yet. */

/* =============================================================================================
   1. Design system: components/bundle.css
   ============================================================================================= */
.wb-icon { flex: 0 0 auto; display: block; }
.wb-link { color: var(--brand-red-text); font-size: 13px; text-decoration: none; }
.wb-link:hover { text-decoration: underline; }

/* Buttons */
.wb-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-8); height: var(--size-control); padding: 0 22px; border-radius: var(--radius-0); font-family: var(--font-brand); font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; white-space: nowrap; }
.wb-btn-primary { background: var(--brand-red); color: var(--on-brand); border: 0; }
.wb-btn-primary:hover { background: var(--brand-red-hover); }
.wb-btn-secondary { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.wb-btn-secondary:hover { background: var(--surface-hover); }
.wb-btn-ghost { background: transparent; color: var(--ink); border: 0; }
.wb-btn-ghost:hover { background: var(--surface-hover); }
.wb-btn-danger { background: transparent; color: var(--error-ink); border: 2px solid var(--error); }
.wb-btn-sm { height: var(--size-control-sm); padding: 0 14px; font-size: 12px; }
.wb-btn-icon { width: var(--size-control); padding: 0; }
.wb-btn-sm.wb-btn-icon { width: var(--size-control-sm); }
.wb-btn:disabled { color: var(--ink-disabled); border-color: var(--line); background: transparent; cursor: default; }
.wb-btn:focus-visible, .wb-iconbtn:focus-visible, .wb-user:focus-visible, .wb-row:focus-visible, .wb-kpi:focus-visible, .wb-tab:focus-visible,
.wb-switcher-opt:focus-visible, .wb-bottomnav-item:focus-visible, .wb-link:focus-visible, .wb-input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* Sidebar */
.wb-sidebar { width: calc(var(--size-sidebar) + env(safe-area-inset-left, 0px)); min-height: 100%; box-sizing: border-box; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); background: var(--nav); color: var(--nav-ink); display: flex; flex-direction: column; font-family: var(--font-brand); }
.wb-sidebar-collapsed { width: calc(var(--size-sidebar-collapsed) + env(safe-area-inset-left, 0px)); }
.wb-sidebar-brand { height: var(--size-topbar); box-sizing: border-box; display: flex; align-items: center; padding: 0 var(--space-20); border-bottom: 3px solid var(--nav-marker); }
.wb-sidebar-brand img { height: 40px; width: auto; display: block; }
.wb-sidebar-collapsed .wb-sidebar-brand { padding: 0 var(--space-12); }
.wb-sidebar-collapsed .wb-sidebar-brand img { height: 24px; }
.wb-sidebar-name { color: var(--nav-ink-active); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.wb-sidebar-items { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: var(--space-12) 0; }
.wb-nav-heading { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--nav-muted); padding: 18px var(--space-24) var(--space-8); }
.wb-nav-rule { height: 1px; background: var(--nav-hover); margin: var(--space-8) var(--space-24) 0; }
.wb-nav-item { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 46px; padding: 0 var(--space-24); box-sizing: border-box; border: 0; background: transparent; color: var(--nav-ink); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.wb-nav-item:hover { background: var(--nav-hover); color: var(--nav-ink-active); }
.wb-nav-active { background: var(--nav-hover); color: var(--nav-ink-active); font-weight: 600; }
.wb-nav-active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; background: var(--nav-marker); }
.wb-nav-item:focus-visible, .wb-nav-sub a:focus-visible { outline: 2px solid var(--nav-ink-active); outline-offset: -3px; }
.wb-nav-label { flex: 1 1 auto; }
.wb-nav-star { color: var(--brand-red); }
.wb-nav-sub { display: flex; flex-direction: column; background: var(--nav-sub); padding: 6px 0 10px; }
.wb-nav-sub a { display: block; padding: var(--space-8) var(--space-24) var(--space-8) 58px; color: var(--nav-ink); text-decoration: none; font-size: 13px; }
.wb-nav-sub a:hover { color: var(--nav-ink-active); }
.wb-nav-sub a.wb-nav-current { color: var(--nav-ink-active); font-weight: 600; }
.wb-nav-sub a.wb-nav-current::before { content: ""; display: inline-block; width: 12px; height: 2px; background: var(--nav-marker); vertical-align: middle; margin: 0 var(--space-8) 3px -20px; }
.wb-nav-fill { flex: 1 1 auto; min-height: var(--space-24); }
.wb-sidebar-collapsed .wb-nav-item { justify-content: center; padding: 0; }
.wb-sidebar-collapsed .wb-nav-label, .wb-sidebar-collapsed .wb-nav-caret, .wb-sidebar-collapsed .wb-nav-heading, .wb-sidebar-collapsed .wb-nav-sub { display: none; }
.wb-sidebar-user { flex: 0 0 auto; display: flex; align-items: center; gap: var(--space-12); width: 100%; min-height: 68px; padding: 14px var(--space-20); box-sizing: border-box; border: 0; border-top: 1px solid var(--nav-hover); background: transparent; color: var(--nav-ink-active); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.wb-sidebar-user:hover, .wb-sidebar-user[aria-expanded="true"] { background: var(--nav-hover); }
.wb-sidebar-user:focus-visible { outline: 2px solid var(--nav-ink-active); outline-offset: -3px; }
.wb-sidebar-user-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.wb-sidebar-user-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-sidebar-user-role { font-size: 11px; color: var(--nav-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-sidebar-user-caret { color: var(--nav-muted); }
.wb-sidebar-collapsed .wb-sidebar-user { justify-content: center; padding: 14px 0; }
.wb-sidebar-collapsed .wb-sidebar-user-text, .wb-sidebar-collapsed .wb-sidebar-user-caret { display: none; }
/* The full menu drawn over the page: the tablet menu and the phone drawer. Its parent is positioned (.wb-shell-body), with a .wb-scrim behind it. */
.wb-sidebar-overlay { position: absolute; top: 0; left: 0; bottom: 0; z-index: 40; min-height: 0; box-shadow: var(--shadow-drawer); }
.wb-scrim { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 39; width: 100%; border: 0; padding: 0; background: var(--scrim); cursor: default; }

/* Top bar */
.wb-topbar { height: calc(var(--size-topbar) + env(safe-area-inset-top, 0px)); box-sizing: border-box; display: flex; align-items: center; gap: var(--space-12); padding: env(safe-area-inset-top, 0px) calc(var(--space-24) + env(safe-area-inset-right, 0px)) 0 var(--space-24); background: var(--topbar); border-bottom: 1px solid var(--line); color: var(--ink); font-family: var(--font-brand); }
.wb-topbar-fill { flex: 1 1 auto; }
.wb-search { flex: none; min-width: 0; display: flex; align-items: center; gap: 10px; height: var(--size-control); padding: 0 14px; box-sizing: border-box; background: var(--field); border: 1px solid var(--line-control); color: var(--ink-subtle); }
.wb-topbar .wb-search { flex: 0 1 520px; }
.wb-search input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; outline: none; }
.wb-search:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.wb-iconbtn { position: relative; width: var(--size-control); height: var(--size-control); display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.wb-iconbtn:hover { color: var(--brand-red-text); }
.wb-count { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 3px; box-sizing: border-box; background: var(--brand-red); color: var(--on-brand); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.wb-user { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.wb-avatar { width: var(--size-avatar); height: var(--size-avatar); flex: 0 0 auto; background: var(--brand-red); color: var(--on-brand); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.wb-user-text { display: flex; flex-direction: column; line-height: 1.2; }
.wb-user-name { font-size: 13px; font-weight: 600; }
.wb-user-role { font-size: 11px; color: var(--ink-subtle); }

/* Page header */
.wb-pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-16); font-family: var(--font-brand); color: var(--ink); }
.wb-pagehead-text { display: flex; flex-direction: column; gap: var(--space-4); }
.wb-crumb { color: var(--ink-subtle); text-transform: uppercase; }
.wb-title { margin: 0; text-transform: uppercase; }
.wb-title::after { content: ""; display: block; width: 64px; height: 3px; background: var(--brand-red-text); margin-top: 10px; }
.wb-subtitle { color: var(--ink-muted); }
.wb-pagehead-actions { display: flex; flex-wrap: wrap; gap: var(--space-8); }

/* KPI tile */
.wb-kpi { display: flex; flex-direction: column; gap: 6px; padding: var(--space-20) 22px; background: var(--surface); color: var(--ink); text-decoration: none; font-family: var(--font-brand); }
.wb-kpi-label { color: var(--ink-muted); text-transform: uppercase; }
.wb-kpi-note { color: var(--ink-subtle); }
a.wb-kpi:hover { background: var(--surface-hover); }

/* Panel and rows */
.wb-panel { background: var(--surface); color: var(--ink); padding: 18px 10px 10px; font-family: var(--font-brand); }
.wb-panel-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-12); padding: 0 var(--space-12) var(--space-8); }
.wb-panel-head h2 { margin: 0; text-transform: uppercase; }
.wb-panel-feature { background: var(--feature-surface); color: var(--feature-ink); padding: 14px 18px; }
.wb-panel-feature .wb-panel-head { padding: 0 0 var(--space-8); }
.wb-panel-feature a { color: var(--feature-ink); }
.wb-row { display: flex; align-items: center; gap: var(--space-12); padding: 10px var(--space-12); color: inherit; text-decoration: none; }
a.wb-row:hover { background: var(--surface-hover); }
.wb-row-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wb-row-title { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; font-size: 14px; font-weight: 500; }
.wb-row-meta { color: var(--ink-subtle); }
.wb-tag { font-size: 11px; font-weight: 600; background: var(--neutral-tint); color: var(--neutral-ink); padding: 1px 6px; }

/* Status badge */
.wb-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px var(--space-8); font-family: var(--font-brand); font-size: 12px; font-weight: 600; white-space: nowrap; border-radius: var(--radius-0); }
.wb-badge::before { content: ""; width: 7px; height: 7px; background: currentColor; }
.wb-badge-success { background: var(--success-tint); color: var(--success-ink); }
.wb-badge-warning { background: var(--warning-tint); color: var(--warning-ink); }
.wb-badge-error { background: var(--error-tint); color: var(--error-ink); }
.wb-badge-info { background: var(--info-tint); color: var(--info-ink); }
.wb-badge-neutral { background: var(--neutral-tint); color: var(--neutral-ink); }

/* Field */
.wb-field { display: flex; flex-direction: column; gap: 5px; font-family: var(--font-brand); color: var(--ink); }
.wb-field-label { font-size: 13px; font-weight: 600; }
.wb-input { height: var(--size-control-sm); padding: 0 10px; box-sizing: border-box; border: 1px solid var(--line-control); border-radius: var(--radius-0); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.wb-field-invalid .wb-input { border: 2px solid var(--error); }
.wb-field-error { display: flex; align-items: center; gap: 6px; color: var(--error-ink); font-size: 12px; }
.wb-field-note { color: var(--ink-subtle); }
select.wb-input { padding-right: 6px; }
.wb-input:disabled { color: var(--ink-disabled); background: var(--ground); }
.wb-input[readonly] { background: var(--ground); }

/* Checkbox: an 18px box in brand-red's accent beside its label; the whole line is a size-touch target. */
.wb-check { display: flex; align-items: center; gap: 10px; min-height: var(--size-touch); font-size: 14px; cursor: pointer; }
.wb-check input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: var(--brand-red); }
.wb-check input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* Notice */
.wb-notice { display: flex; gap: 10px; align-items: flex-start; padding: var(--space-12) 14px; font-family: var(--font-brand); font-size: 14px; line-height: 1.45; }
.wb-notice-info { background: var(--info-tint); color: var(--info-ink); }
.wb-notice-success { background: var(--success-tint); color: var(--success-ink); }
.wb-notice-warning { background: var(--warning-tint); color: var(--warning-ink); }
.wb-notice-error { background: var(--error-tint); color: var(--error-ink); }

/* Tabs */
.wb-tabs { font-family: var(--font-brand); color: var(--ink); }
.wb-tabs-strip { display: flex; gap: var(--space-4); border-bottom: 1px solid var(--line); overflow-x: auto; }
.wb-tab { border: 0; background: transparent; padding: var(--space-12) var(--space-16); font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.wb-tab:hover { color: var(--ink); }
.wb-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand-red-text); }
.wb-tabs-body { padding: var(--space-16) 0; }

/* View switcher */
.wb-switcher { display: inline-flex; border: 1px solid var(--line-control); font-family: var(--font-brand); }
.wb-switcher-opt { display: inline-flex; align-items: center; gap: 6px; height: var(--size-control-sm); padding: 0 14px; border: 0; border-right: 1px solid var(--line-control); background: var(--surface); color: var(--ink); font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; }
.wb-switcher-opt:last-child { border-right: 0; }
.wb-switcher-opt[aria-pressed="true"] { background: var(--inverse-surface); color: var(--inverse-ink); }

/* Change row */
.wb-change { display: flex; gap: 10px; align-items: flex-start; padding: var(--space-8) 0; font-family: var(--font-brand); color: var(--ink); font-size: 14px; }
.wb-change-glyph { display: inline-flex; padding-top: 2px; }
.wb-change-edit .wb-change-glyph { color: var(--info-ink); }
.wb-change-add .wb-change-glyph { color: var(--success-ink); }
.wb-change-delete .wb-change-glyph { color: var(--error-ink); }
.wb-change-where { color: var(--ink-subtle); }

/* Timer bar */
.wb-timerbar { display: flex; align-items: center; gap: 10px; padding: var(--space-8) var(--space-8) var(--space-8) var(--space-16); background: var(--feature-surface); color: var(--feature-ink); font-family: var(--font-brand); }
.wb-timerbar-idle { background: transparent; padding: 0; }
.wb-timerbar-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; font-size: 13px; }
.wb-timerbar-since { font-size: 11px; color: var(--nav-ink); }
.wb-timerbar-stop { height: var(--size-touch); padding: 0 14px; border: 0; background: var(--brand-red); color: var(--on-brand); font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; }
.wb-timerbar-stop:hover { background: var(--brand-red-hover); }
.wb-timerbar-stop:focus-visible { outline: 2px solid var(--feature-ink); outline-offset: 2px; }

/* Bottom nav (phones) */
.wb-bottomnav { display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0); font-family: var(--font-brand); }
.wb-bottomnav-item { flex: 1 1 0; min-height: var(--size-bottom-nav); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; color: var(--ink-muted); font: inherit; font-size: 11px; cursor: pointer; }
.wb-bottomnav-active { color: var(--brand-red-text); font-weight: 600; }
.wb-bottomnav-icon { position: relative; display: flex; }
.wb-bottomnav-icon .wb-count { top: -5px; right: -9px; }
.wb-bottomnav-primary .wb-bottomnav-icon { width: 44px; height: 30px; align-items: center; justify-content: center; background: var(--brand-red); color: var(--on-brand); }

/* Environment banner */
.wb-env { background: var(--env-banner); border-bottom: 1px solid var(--env-banner-border); color: #000000; padding: var(--space-4) var(--space-16); text-align: center; font-family: var(--font-brand); font-size: 12px; font-weight: 600; }

/* Rows as buttons: the TreeNav's rows and a picker's choices. */
button.wb-row { width: 100%; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.wb-row:hover { background: var(--surface-hover); }
button.wb-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* Screen-reader-only text (the DataGrid's caption, a hidden column header). */
.wb-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* List pages (Inventory › Items): a Toolbar (Filters and the page's actions, a Search, Refresh and grid settings), a
   collapsible FilterPanel, a summary line, the DataGrid with no row lines and the Pager under it. A TreeNav sits beside. */
.wb-listpage { display: flex; flex-wrap: wrap; gap: var(--space-16); align-items: flex-start; }
.wb-listpage-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-12); }
.wb-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); padding: var(--space-12) var(--space-16); background: var(--surface); }
.wb-toolbar-start { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.wb-toolbar .wb-search { flex: 1 1 240px; height: var(--size-control-sm); margin: 0 var(--space-8); }
.wb-toolbar-end { position: relative; display: flex; gap: var(--space-4); margin-left: auto; }
.wb-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-16); padding: var(--space-16); background: var(--surface); }
.wb-filters .wb-field { flex: 1 1 150px; min-width: 0; }
.wb-summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-8); font-size: 14px; }
.wb-summary strong { font-weight: 600; }
.wb-summary .meta { color: var(--ink-subtle); }

/* Data grid: header cells in the label style over one hairline, rows that wash surface-hover with no lines between them,
   a 3px bar while a page reloads (the rows stay readable, so the page never blocks) and placeholder rows while the first
   page loads. */
.wb-grid-wrap { position: relative; background: var(--surface); overflow-x: auto; }
.wb-grid { width: 100%; border-collapse: collapse; font-family: var(--font-brand); font-size: 14px; color: var(--ink); }
.wb-grid th { text-align: left; text-transform: uppercase; color: var(--ink-muted); padding: 14px var(--space-12); border-bottom: 1px solid var(--line); white-space: nowrap; }
.wb-grid td { padding: var(--space-4) var(--space-12); height: 56px; box-sizing: border-box; vertical-align: middle; }
.wb-grid th:first-child, .wb-grid td:first-child { padding-left: var(--space-16); }
.wb-grid th:last-child, .wb-grid td:last-child { padding-right: var(--space-16); }
.wb-grid-compact td { height: 48px; }
.wb-grid th.wb-grid-num, .wb-grid td.wb-grid-num { text-align: right; font-variant-numeric: tabular-nums; }
.wb-grid td.wb-grid-open { width: 28px; color: var(--ink-subtle); }
.wb-grid-row:hover { background: var(--surface-hover); }
.wb-grid-clickable { cursor: pointer; }
.wb-grid-sort { display: inline-flex; align-items: center; gap: 4px; border: 0; padding: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.wb-grid-sort:hover, .wb-grid th[aria-sort] .wb-grid-sort { color: var(--ink); }
.wb-grid-sort:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.wb-grid-sort .wb-sort-asc { transform: rotate(180deg); }
.wb-grid-loading tbody { opacity: 0.55; }
.wb-grid-busy { position: absolute; top: 0; left: 0; right: 0; height: 3px; overflow: hidden; z-index: 1; }
.wb-grid-busy::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: var(--brand-red); animation: wb-busy 1.1s ease-in-out infinite; }
@keyframes wb-busy { from { left: -40%; } to { left: 100%; } }
.wb-skeleton { display: block; height: 12px; max-width: 100%; background: var(--neutral-tint); animation: wb-pulse 1.4s ease-in-out infinite; }
@keyframes wb-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .wb-grid-busy::after, .wb-skeleton { animation: none; } .wb-grid-busy::after { left: 0; width: 100%; } }
.wb-grid-empty { padding: var(--space-32) var(--space-16); text-align: center; color: var(--ink-subtle); }
.wb-grid-empty strong { display: block; margin-bottom: var(--space-4); color: var(--ink); font-size: 14px; font-weight: 600; }
/* Cells: a title over a meta line, quiet and strong words, and a change's tone (a cost going up is a warning). */
.wb-cell-stack { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
.wb-cell-title { font-weight: 600; color: var(--ink); text-decoration: none; }
a.wb-cell-title:hover { text-decoration: underline; }
a.wb-cell-title:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.wb-cell-stack .meta { color: var(--ink-subtle); }
.wb-tone-up, .wb-tone-warning { color: var(--warning-ink); }
.wb-tone-down { color: var(--success-ink); }
.wb-tone-flat { color: var(--ink-muted); }
.wb-muted { color: var(--ink-muted); }
.wb-subtle { color: var(--ink-subtle); }
.wb-strong { font-weight: 600; }

/* Pager: Show 50 / 100 / 200 / All, then Prev, Page n of N, Next. */
.wb-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-12); }
.wb-pager-group { display: flex; align-items: center; gap: var(--space-8); }
.wb-pager .meta { color: var(--ink-muted); }

/* Tree nav (the Items list's Item Groups): indented rows with their counts; the selected one washes brand-red-tint with a
   red bar. In the tablet and phone shells it folds behind a button that names the pick, so the grid keeps the width. */
.wb-tree { flex: 1 1 220px; max-width: 260px; min-width: 0; box-sizing: border-box; background: var(--surface); padding: 14px 0 10px; font-family: var(--font-brand); }
.wb-tree-head { padding: 0 var(--space-16) var(--space-8); text-transform: uppercase; color: var(--ink-muted); }
.wb-tree-item { min-height: 40px; gap: var(--space-8); padding-top: 6px; padding-bottom: 6px; padding-right: var(--space-16); color: var(--ink); }
.wb-tree-item[aria-current="true"] { background: var(--brand-red-tint); box-shadow: inset 4px 0 0 var(--brand-red); font-weight: 600; }
.wb-tree-label { flex: 1 1 auto; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.wb-tree-count { color: var(--ink-subtle); font-variant-numeric: tabular-nums; }
.wb-tree-item[aria-current="true"] .wb-tree-count { color: var(--ink-muted); }
.wb-tree-caret { display: flex; color: var(--ink-subtle); }
.wb-tree-toggle { display: none; }
.wb-shell-phone .wb-tree, .wb-shell-tablet .wb-tree { max-width: none; flex-basis: 100%; padding-top: 0; }
.wb-shell-phone .wb-tree-toggle, .wb-shell-tablet .wb-tree-toggle { display: flex; }
.wb-shell-phone .wb-tree-closed, .wb-shell-tablet .wb-tree-closed { padding-bottom: 0; }
.wb-shell-phone .wb-tree-closed .wb-tree-list, .wb-shell-phone .wb-tree-closed .wb-tree-head,
.wb-shell-tablet .wb-tree-closed .wb-tree-list, .wb-shell-tablet .wb-tree-closed .wb-tree-head { display: none; }

/* Dialog: a square surface over the scrim with shadow-drawer. A confirm names the thing; a form dialog holds fields. */
.wb-dialog-layer { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: calc(var(--space-16) + env(safe-area-inset-top, 0px)) var(--space-16) calc(var(--space-16) + env(safe-area-inset-bottom, 0px)); }
.wb-dialog-scrim { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; border: 0; padding: 0; background: var(--scrim); cursor: default; }
.wb-dialog { position: relative; width: 100%; max-width: 480px; max-height: 100%; overflow-y: auto; box-sizing: border-box; display: flex; flex-direction: column; gap: var(--space-16); padding: var(--space-24); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-drawer); font-family: var(--font-brand); font-size: 14px; }
.wb-dialog:focus { outline: none; }
.wb-dialog-wide { max-width: 680px; }
.wb-dialog-title { margin: 0; text-transform: uppercase; }
.wb-dialog-body { display: flex; flex-direction: column; gap: var(--space-12); }
.wb-dialog-body p { margin: 0; }
.wb-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-8); }

/* Toasts: one short sentence ("Saved.") on inverse-surface, bottom center (above the phone's bottom bar), for 4 seconds. */
.wb-toasts { position: fixed; left: 50%; bottom: calc(var(--space-24) + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: var(--space-8); width: max-content; max-width: calc(100% - 32px); pointer-events: none; }
.wb-shell-phone .wb-toasts { bottom: calc(var(--size-bottom-nav) + var(--space-16) + env(safe-area-inset-bottom, 0px)); }
.wb-toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: var(--space-12) var(--space-16); background: var(--inverse-surface); color: var(--inverse-ink); box-shadow: var(--shadow-menu); font-family: var(--font-brand); font-size: 14px; }
/* error-tint is translucent: lay it over surface so the page doesn't show through a floating toast. */
.wb-toast-error { background: linear-gradient(var(--error-tint), var(--error-tint)), var(--surface); color: var(--error-ink); }

/* App shell: exactly the window's height (dvh, which iPhone and iPad measure correctly). The page scrolls inside .wb-shell-scroll and the sidebar's menu scrolls on its own. */
.wb-shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.wb-shell-body { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.wb-shell-body > .wb-sidebar:not(.wb-sidebar-overlay) { min-height: 0; }
.wb-shell-main { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.wb-shell-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) 0; }

/* Touch screens: the shell puts wb-touch on <html> on phones and tablets. Every target grows to at least size-touch, and fields use 16px text so iOS doesn't zoom in on focus. */
.wb-touch .wb-btn, .wb-touch .wb-btn-sm { height: var(--size-touch); }
.wb-touch .wb-btn-icon, .wb-touch .wb-btn-sm.wb-btn-icon { width: var(--size-touch); }
.wb-touch .wb-iconbtn { width: var(--size-touch); height: var(--size-touch); }
.wb-touch .wb-search, .wb-touch .wb-toolbar .wb-search { height: var(--size-touch); }
.wb-touch .wb-search input, .wb-touch .wb-input { font-size: 16px; }
.wb-touch .wb-input { height: var(--size-touch); }
.wb-touch .wb-switcher-opt { height: var(--size-touch); }
.wb-touch .wb-tab { min-height: var(--size-touch); }
.wb-touch .wb-row { min-height: var(--size-touch); box-sizing: border-box; }
.wb-touch .wb-link { display: inline-block; padding: 12px 0; margin: -12px 0; }
.wb-touch .wb-nav-item { min-height: 48px; }
.wb-touch .wb-nav-sub a { padding-top: 12px; padding-bottom: 12px; line-height: 20px; }

/* =============================================================================================
   From the design canvas's theme.css: host-page rules, and markup that sits beside the components.
   ============================================================================================= */
html, body { margin: 0; overscroll-behavior: none; }
body { background: var(--ground); color: var(--ink); font-family: var(--font-brand); font-size: 14px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
a.wb-btn { text-decoration: none; box-sizing: border-box; }
.wb-panel-feature .wb-row-meta { color: var(--nav-ink); }
.wb-panel-feature a.wb-row:hover { background: var(--nav-hover); }
button.wb-row { width: 100%; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.wb-row:hover { background: var(--surface-hover); }
.wb-panel-feature button.wb-row:hover { background: var(--nav-hover); }
.wb-launch:focus-visible, .wb-menu-item:focus-visible, button.wb-row:focus-visible, .wb-chip:focus-visible, .wb-linkbtn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.wb-menu-item:hover { background: var(--surface-hover); }
.wb-grid-row:hover { background: var(--surface-hover); }
.wb-shell-nav { display: flex; flex-direction: column; flex: 0 0 auto; }
.wb-shell-nav .wb-sidebar { flex: 1 1 auto; min-height: 0; }
.wb-toolbar .wb-search { height: var(--size-control-sm); }
.wb-touch .wb-toolbar .wb-search { height: var(--size-touch); }

/* =============================================================================================
   App additions: classes the Razor components and the shell use that have no design-system
   component yet. Tokens only (var(--…)); never raw colors.
   ============================================================================================= */

/* Scrollbars stay quiet: thin, and charcoal inside the charcoal sidebar. */
.wb-sidebar-items { scrollbar-width: thin; scrollbar-color: var(--nav-hover) transparent; }
.wb-shell-scroll, .wb-tabs-strip, .wb-chips { scrollbar-width: thin; scrollbar-color: var(--line-control) transparent; }

/* The page title takes focus after navigation (for screen readers); it is not a control, so it shows no ring. */
.wb-title[tabindex="-1"]:focus { outline: none; }

/* Pages pad space-20 top and space-32 sides (space-16 on phones) and fade in on navigation. */
.wb-page { box-sizing: border-box; width: 100%; min-height: 100%; padding: var(--space-20) var(--space-32) var(--space-48); display: flex; flex-direction: column; gap: var(--space-24); animation: wb-fade-in 140ms ease-out; }
.wb-shell-phone .wb-page { padding: var(--space-16) var(--space-16) var(--space-32); gap: var(--space-16); }
@keyframes wb-fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wb-page { animation: none; } }

/* Dashboards: four KPI tiles in a row (two by two on phones), then a wide work column and a side column. */
.wb-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--space-16); }
.wb-shell-phone .wb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12); }
.wb-shell-phone .wb-kpi { padding: 14px var(--space-16); }
.wb-shell-phone .wb-kpi-value { font-size: 22px; }
.wb-shell-phone .wb-title { font-size: 22px; }
.wb-columns { display: flex; flex-wrap: wrap; gap: var(--space-16); align-items: flex-start; }
.wb-col-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-16); }
.wb-col-side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-16); }
.wb-empty { margin: 0; padding: var(--space-8) var(--space-12) var(--space-12); color: var(--ink-subtle); }
.wb-panel-feature .wb-empty { padding: 0 0 var(--space-8); color: var(--nav-ink); }

/* Home: the module launch tiles. */
.wb-launch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: var(--space-8); padding: var(--space-4) var(--space-12) var(--space-12); }
.wb-launch { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-8); min-height: 120px; padding: var(--space-16); box-sizing: border-box; border: 0; background: var(--ground); color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.wb-launch:hover { background: var(--brand-red-tint); }
.wb-launch-icon { display: flex; color: var(--brand-red-text); }
.wb-launch-label { font-size: 14px; font-weight: 600; line-height: 1.3; }
.wb-launch-note { color: var(--ink-subtle); }
.wb-row-star { display: flex; color: var(--brand-red); }

/* Menus float with shadow-menu: the account menu (beside the sidebar's user block) and the notifications
   panel (under the bell). A transparent catcher behind them closes them on a click outside. */
.wb-menu-catcher { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 20; border: 0; padding: 0; background: transparent; cursor: default; }
.wb-menu { position: absolute; z-index: 30; box-sizing: border-box; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-menu); font-family: var(--font-brand); }
.wb-menu-account { left: var(--space-8); bottom: calc(var(--space-8) + env(safe-area-inset-bottom, 0px)); width: 300px; max-width: calc(100% - 16px); padding: 0 0 var(--space-8); }
.wb-menu-head { display: flex; gap: var(--space-12); align-items: center; padding: var(--space-16); border-bottom: 1px solid var(--line); margin-bottom: var(--space-8); }
.wb-menu-head .wb-avatar { width: 48px; height: 48px; font-size: 16px; }
.wb-menu-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wb-menu-head-text strong { font-size: 14px; font-weight: 600; }
.wb-menu-head-text .meta { color: var(--ink-subtle); }
.wb-menu-item { display: flex; align-items: center; gap: var(--space-12); width: 100%; min-height: var(--size-touch); padding: 0 var(--space-16); box-sizing: border-box; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.wb-menu-rule { height: 1px; background: var(--line); margin: var(--space-8) 0; }
.wb-menu-alerts { top: calc(var(--size-topbar) + var(--space-4) + env(safe-area-inset-top, 0px)); right: var(--space-24); width: 400px; max-width: calc(100% - 48px); }
.wb-menu-alerts-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); padding: 14px var(--space-16) 10px; border-bottom: 1px solid var(--line); }
.wb-menu-alerts-head h2 { margin: 0; text-transform: uppercase; }
.wb-menu-alerts .wb-row { align-items: flex-start; padding: var(--space-12) var(--space-16); border-bottom: 1px solid var(--line); }
.wb-menu-foot { padding: 0 var(--space-16) var(--space-4); }
.wb-shell-phone .wb-menu-account { left: auto; right: var(--space-8); bottom: auto; top: calc(var(--size-mobile-header) + 3px + var(--space-4) + env(safe-area-inset-top, 0px)); }
.wb-shell-phone .wb-menu-alerts { top: calc(var(--size-mobile-header) + 3px + var(--space-4) + env(safe-area-inset-top, 0px)); right: var(--space-8); max-width: calc(100% - 16px); }

/* A link-looking button (Notification Settings, Back to Items): brand-red-text, 44px tall to tap. */
.wb-linkbtn { display: inline-flex; align-items: center; gap: 6px; min-height: var(--size-touch); border: 0; padding: 0; background: transparent; color: var(--brand-red-text); font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; }
.wb-linkbtn:hover { text-decoration: underline; }

/* The phone header: a feature-surface bar (menu, the white logo, the avatar) over a 3px brand-red rule. */
.wb-mobilehead { flex: 0 0 auto; height: calc(var(--size-mobile-header) + env(safe-area-inset-top, 0px)); box-sizing: border-box; display: flex; align-items: center; gap: var(--space-4); padding: env(safe-area-inset-top, 0px) calc(var(--space-8) + env(safe-area-inset-right, 0px)) 0 calc(var(--space-8) + env(safe-area-inset-left, 0px)); background: var(--feature-surface); color: var(--feature-ink); font-family: var(--font-brand); }
.wb-mobilehead img { height: 32px; width: auto; display: block; }
.wb-mobilehead-fill { flex: 1 1 auto; }
.wb-mobilehead .wb-iconbtn { width: var(--size-touch); height: var(--size-touch); color: var(--feature-ink); }
.wb-mobilehead-avatar { width: var(--size-touch); height: var(--size-touch); display: flex; align-items: center; justify-content: center; border: 0; padding: 0; background: transparent; cursor: pointer; }
.wb-mobilehead-avatar .wb-avatar { width: 32px; height: 32px; font-size: 12px; }
.wb-mobilehead .wb-iconbtn:focus-visible, .wb-mobilehead-avatar:focus-visible { outline: 2px solid var(--feature-ink); outline-offset: -3px; }
.wb-mobilehead-rule { flex: 0 0 auto; height: 3px; background: var(--brand-red); }

/* Phones: a module's pages as a sideways-scrolling row of square chips under the title, the current one inverse. */
.wb-chips { display: flex; gap: var(--space-8); overflow-x: auto; margin: 0 calc(var(--space-16) * -1); padding: 0 var(--space-16); }
.wb-chip { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: var(--size-touch); padding: 0 14px; box-sizing: border-box; border: 1px solid var(--line-control); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.wb-chip[aria-current="page"] { background: var(--inverse-surface); border-color: var(--inverse-surface); color: var(--inverse-ink); }

/* Facts and settings inside a Panel (Profile & Settings, a record's details). */
.wb-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-16); padding: var(--space-4) var(--space-12) var(--space-12); }
.wb-fact { display: flex; flex-direction: column; gap: 2px; font-size: 14px; overflow-wrap: anywhere; }
.wb-fact .label { text-transform: uppercase; color: var(--ink-muted); }
.wb-settings { display: flex; flex-direction: column; gap: var(--space-16); padding: var(--space-4) var(--space-12) var(--space-12); }
.wb-setting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-12); }
.wb-setting-text { display: flex; flex-direction: column; gap: 2px; }
.wb-setting-text strong { font-size: 14px; font-weight: 600; }
.wb-setting-text .meta { color: var(--ink-subtle); }

/* A centered card on ground (signed out, errors). */
.wb-center { min-height: 100%; box-sizing: border-box; display: flex; align-items: center; justify-content: center; padding: var(--space-32) var(--space-16); }
.wb-card { width: 100%; max-width: 440px; box-sizing: border-box; display: flex; flex-direction: column; gap: var(--space-16); padding: var(--space-32); background: var(--surface); color: var(--ink); font-family: var(--font-brand); }
.wb-card img { width: 220px; height: auto; display: block; }

/* Blazor's unhandled-error bar. */
#blazor-error-ui { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; box-sizing: border-box; padding: var(--space-12) var(--space-16) calc(var(--space-12) + env(safe-area-inset-bottom, 0px)); border-top: 3px solid var(--error); background: var(--surface); color: var(--error-ink); font-family: var(--font-brand); font-size: 14px; box-shadow: var(--shadow-drawer); }
#blazor-error-ui .reload { margin-left: var(--space-12); color: var(--brand-red-text); }
#blazor-error-ui .dismiss { float: right; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }

/* The Sign In page (the canvas's Sign In artboard): the framing photo with its caption beside the form, stacked on
   phones. Always light (data-theme on its root). */
.wb-signin { flex: 1 1 auto; display: flex; flex-wrap: wrap; min-height: 0; overflow-y: auto; background: var(--surface); color: var(--ink); font-family: var(--font-brand); }
.wb-signin-photo { flex: 1 1 520px; min-height: 300px; position: relative; overflow: hidden; background: var(--nav); }
.wb-signin-photo img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.wb-signin-caption { position: absolute; left: var(--space-32); bottom: var(--space-32); max-width: 380px; margin-right: var(--space-32); padding: var(--space-20) var(--space-24); background: var(--surface); color: var(--ink); }
.wb-signin-caption .section-title { text-transform: uppercase; }
.wb-signin-caption p { margin: 6px 0 0; color: var(--ink-muted); }
.wb-signin-panel { flex: 0 1 560px; min-width: 0; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; gap: var(--space-20); padding: var(--space-48) 64px calc(var(--space-48) + env(safe-area-inset-bottom, 0px)); }
.wb-signin-logo { width: 220px; height: auto; display: block; }
.wb-signin-title { margin: var(--space-16) 0 0; text-transform: uppercase; }
.wb-signin-rule { width: 64px; height: 3px; margin-top: 10px; background: var(--brand-red-text); }
.wb-signin-intro { margin: 14px 0 0; color: var(--ink-muted); }
.wb-signin-m365 { width: 100%; height: var(--size-touch); }
.wb-signin-or { display: flex; align-items: center; gap: var(--space-12); }
.wb-signin-or span:first-child, .wb-signin-or span:last-child { flex: 1 1 auto; height: 1px; background: var(--line); }
.wb-signin-or .label { text-transform: uppercase; color: var(--ink-subtle); }
.wb-signin-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.wb-signin-keep { display: flex; align-items: center; gap: 10px; min-height: var(--size-touch); font-size: 14px; cursor: pointer; }
.wb-signin-keep input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand-red); }
.wb-signin-submit { width: 100%; }
.wb-signin-help { margin: 0; color: var(--ink-subtle); }
.wb-signin-help:first-of-type { margin-top: var(--space-8); }
.wb-signin a { color: var(--brand-red-text); }
.wb-signin a:hover { color: var(--brand-red-hover); }
@media (max-width: 719px) {
    .wb-signin-photo { flex-basis: 100%; min-height: 200px; }
    .wb-signin-caption { left: var(--space-16); bottom: var(--space-16); margin-right: var(--space-16); padding: var(--space-12) var(--space-16); }
    .wb-signin-panel { flex-basis: 100%; padding: var(--space-32) var(--space-16) calc(var(--space-32) + env(safe-area-inset-bottom, 0px)); }
}

/* The browser host's loading screen: it sits in #app until the app's first render replaces it. */
.wb-boot { min-height: 100dvh; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-16); padding: var(--space-32) var(--space-16); color: var(--ink-subtle); font-family: var(--font-brand); font-size: 14px; }
.wb-boot img { width: 56px; height: 56px; display: block; }

/* A grid's settings menu (the optional columns), under its toolbar button. Its catcher covers the window (fixed),
   because the menu sits inside the toolbar. */
.wb-menu-columns { top: calc(100% + var(--space-4)); right: 0; width: 240px; padding: var(--space-8) var(--space-16); }
.wb-menu-columns .label { display: block; padding: var(--space-4) 0; text-transform: uppercase; color: var(--ink-muted); }
.wb-menu-catcher-fixed { position: fixed; }

/* Record editors (Inventory › Items › an item): forms in Panels, two columns (one on phones), and a side column. */
.wb-back { margin-bottom: calc(var(--space-16) * -1); }
.wb-field > .wb-switcher { align-self: flex-start; max-width: 100%; }
.wb-tabs-strip { overflow-y: hidden; }
.wb-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-16); padding: var(--space-8) var(--space-12) var(--space-12); }
.wb-form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wb-form-wide { grid-column: 1 / -1; }
.wb-shell-phone .wb-form-grid { grid-template-columns: minmax(0, 1fr); }
.wb-form-stack { display: flex; flex-direction: column; gap: var(--space-16); padding: var(--space-8) var(--space-12) var(--space-12); }
.wb-form-note { padding: 0 var(--space-12) var(--space-8); color: var(--ink-subtle); }
.wb-checks { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-24); }
.wb-pathfield { display: flex; gap: var(--space-8); align-items: center; }
.wb-pathfield .wb-input { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wb-side-block { display: flex; flex-direction: column; gap: 10px; padding: var(--space-4) var(--space-12) var(--space-12); font-size: 14px; }
.wb-side-block .meta { color: var(--ink-subtle); }
.wb-split { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); }
.wb-rule-top { padding-top: var(--space-8); border-top: 1px solid var(--line); }
.wb-cost { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-8); }
.wb-cost .meta { color: var(--ink-muted); }
.wb-panel-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-12); padding: var(--space-4) var(--space-12) var(--space-12); }
.wb-panel-tools .wb-notice { flex: 1 1 360px; }
.wb-panel-tools .meta { color: var(--ink-subtle); }
.wb-panel-grid .wb-grid-wrap { background: transparent; }
.wb-qty { width: 96px; text-align: right; }
.wb-star-on { color: var(--brand-red); }
.wb-picker-list { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; margin: 0 calc(var(--space-24) * -1); }
.wb-picker-list .wb-row { padding-left: var(--space-24); padding-right: var(--space-24); }
.wb-picker-list .wb-row[aria-pressed="true"] { background: var(--brand-red-tint); box-shadow: inset 4px 0 0 var(--brand-red); }
/* A grid's group rows (WbDataGrid GroupBy): a label band on ground over the rows it heads (Truss Specs by roof type). */
.wb-grid tr.wb-grid-group th { padding: var(--space-16) var(--space-16) var(--space-8); background: var(--ground); color: var(--ink); font-weight: 600; border-bottom: 0; }
.wb-panel-grid .wb-grid tr.wb-grid-group th { background: transparent; }
/* A checkbox in a Toolbar's end (Show deleted on the Material Specs lists) is 44px tall: keep the small buttons beside it centered. */
.wb-toolbar-end { align-items: center; }

/* A Panel's action as a button (WbPanel OnAction: Help Needed's Edit), drawn as the action link. */
.wb-link-button { border: 0; padding: 0; background: transparent; font: inherit; font-size: 13px; cursor: pointer; }

/* A multi-line field (WbTextArea): an input's look, as tall as its rows. Beats .wb-touch .wb-input's 44px height. */
textarea.wb-input.wb-textarea, .wb-touch textarea.wb-input.wb-textarea { height: auto; min-height: 64px; padding: 10px; line-height: 1.5; resize: vertical; display: block; width: 100%; }

/* The window (WindowLayout: one record, opened from a link, with no app navigation; the Help Request Window first), as
   the Help Request Window canvas draws it: the charcoal head with the account, the page scrolling between it and the
   pinned bar. Phones (.wb-window-phone) tighten the padding. */
.wb-window { position: relative; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--ground); color: var(--ink); font-family: var(--font-brand); }
.wb-window .wb-window-head { gap: var(--space-12); padding-left: calc(var(--space-16) + env(safe-area-inset-left, 0px)); padding-right: calc(var(--space-8) + env(safe-area-inset-right, 0px)); }
.wb-window-phone .wb-window-head { gap: var(--space-8); padding-left: calc(var(--space-8) + env(safe-area-inset-left, 0px)); }
.wb-window-headbar { flex: 0 0 auto; }
.wb-window-head-divider { width: 1px; height: 24px; background: var(--nav-muted); opacity: 0.5; }
.wb-window-head-title { color: var(--nav-ink); text-transform: uppercase; }
.wb-window-account { display: flex; align-items: center; gap: var(--space-8); min-height: var(--size-touch); padding: 0 var(--space-8); border: 0; background: transparent; color: var(--feature-ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.wb-window-account .wb-avatar { width: 32px; height: 32px; font-size: 12px; }
.wb-window-account:hover { background: var(--nav-hover); }
.wb-window-account:focus-visible { outline: 2px solid var(--feature-ink); outline-offset: -3px; }
.wb-window .wb-menu-account { left: auto; bottom: auto; right: var(--space-8); top: calc(var(--size-mobile-header) + 3px + var(--space-4) + env(safe-area-inset-top, 0px)); }
.wb-window > .wb-notice { flex: 0 0 auto; padding-left: var(--space-16); padding-right: var(--space-16); }
.wb-window-scroll { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-control) transparent; }
.wb-window-page { max-width: 1180px; margin: 0 auto; box-sizing: border-box; padding: var(--space-20) var(--space-32) var(--space-24); display: flex; flex-direction: column; gap: var(--space-16); }
.wb-window-phone .wb-window-page { padding: var(--space-16) var(--space-16) var(--space-20); }
.wb-window-phone .wb-pagehead .page-title { font-size: 22px; }
.wb-window-facts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8) var(--space-16); font-size: 14px; }
.wb-window-facts .meta { color: var(--ink-subtle); }
.wb-window-cols { display: flex; flex-wrap: wrap; gap: var(--space-16); align-items: flex-start; }
.wb-window-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-16); }
.wb-window-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-16); }
.wb-window-text { margin: 0; padding: var(--space-4) var(--space-12) var(--space-12); font-size: 14px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.wb-window-toasts { position: relative; flex: 0 0 auto; height: 0; z-index: 60; }
.wb-window-toasts .wb-toasts { position: absolute; bottom: var(--space-16); }
.wb-window-bar { flex: 0 0 auto; background: var(--surface); border-top: 1px solid var(--line); padding: var(--space-12) calc(var(--space-32) + env(safe-area-inset-right, 0px)) calc(var(--space-12) + env(safe-area-inset-bottom, 0px)) calc(var(--space-32) + env(safe-area-inset-left, 0px)); }
.wb-window-phone .wb-window-bar { padding-left: calc(var(--space-16) + env(safe-area-inset-left, 0px)); padding-right: calc(var(--space-16) + env(safe-area-inset-right, 0px)); }
.wb-window-bar-inner { max-width: 1116px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-12); }
.wb-window-bar-wide { flex: 1 1 100%; min-width: 0; }
.wb-window-actions { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-8); }
.wb-window-phone .wb-window-actions { flex-wrap: nowrap; }
.wb-window-phone .wb-window-actions .wb-btn-primary { flex: 1 1 auto; }
.wb-window-unsaved { color: var(--ink-subtle); }
.wb-window-phone .wb-window-unsaved { display: none; }
.wb-window-closed { flex: 999 1 320px; margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-muted); align-self: center; }
.wb-window-center { min-height: 100%; box-sizing: border-box; display: flex; align-items: center; justify-content: center; padding: var(--space-32) var(--space-16); }
.wb-window-card { width: 100%; max-width: 440px; box-sizing: border-box; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-16); padding: var(--space-32); background: var(--surface); color: var(--ink); }
.wb-window-card h1 { margin: 0; text-transform: uppercase; }
.wb-window-card img { width: 56px; height: 56px; display: block; }
.wb-window-card p { margin: 0; font-size: 14px; line-height: 1.6; }
.wb-window-card .meta { color: var(--ink-subtle); }

/* The note box pinned in the window's bar (the label hides on phones). */
.wb-compose { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.wb-compose .wb-field-label { font-size: 13px; font-weight: 600; }
.wb-compose textarea.wb-input.wb-textarea, .wb-touch .wb-compose textarea.wb-input.wb-textarea { max-height: 180px; }

/* A record's files as chips: the icon, the name and its size. */
.wb-filechips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); padding: var(--space-4) var(--space-12) var(--space-12); }
.wb-filechip { display: inline-flex; align-items: center; gap: var(--space-8); min-height: var(--size-control-sm); padding: 0 var(--space-12); box-sizing: border-box; border: 1px solid var(--line-control); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.wb-filechip .meta { color: var(--ink-subtle); font-weight: 400; }
.wb-filechip:hover { background: var(--surface-hover); }
.wb-filechip:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.wb-touch .wb-filechip { min-height: var(--size-touch); }
.wb-filechip:disabled { cursor: default; opacity: 0.6; }
/* Add File: a label styled as a ghost button around a hidden file input, ringed while the input has focus. */
.wb-filepick { cursor: pointer; }
.wb-filepick:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* A conversation, newest first: a person's note (avatar, name, when, text; the one a link was sent for marked New)
   and a system row ("To changed from Unassigned to Chris Muller.") between them. */
.wb-thread { display: flex; flex-direction: column; padding: 0 0 var(--space-4); }
.wb-note { display: flex; gap: var(--space-12); align-items: flex-start; padding: var(--space-12); }
.wb-note-new { background: var(--brand-red-tint); }
.wb-note > .wb-avatar { width: 32px; height: 32px; font-size: 12px; }
.wb-note > .wb-avatar-other { background: var(--neutral-tint); color: var(--neutral-ink); }
.wb-note-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.wb-note-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-8); }
.wb-note-name { font-size: 14px; font-weight: 600; }
.wb-note-when { color: var(--ink-subtle); }
.wb-note-new-label { color: var(--brand-red-text); text-transform: uppercase; }
.wb-note-text { margin: 0; font-size: 14px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.wb-event { display: flex; gap: var(--space-8); align-items: flex-start; padding: 6px var(--space-12) 6px 56px; color: var(--ink-subtle); font-size: 13px; line-height: 1.5; }
.wb-event .wb-icon { margin-top: 2px; flex: 0 0 auto; }
