/* POPO workspace: white surfaces with small, semantic macaron accents. */
:root {
  color-scheme: light;
  --ledger-bg: #fff;
  --ledger-surface: #fff;
  --ledger-fg: #30333d;
  --ledger-muted: #6f7280;
  --ledger-border: #e9eaf0;
  --ledger-border-strong: #d9dbe5;
  --ledger-navy: #6953bf;
  --ledger-navy-hover: #55409f;
  --ledger-navy-soft: #eee8fb;
  --ledger-ready: #2d7358;
  --ledger-ready-soft: #e2f4e6;
  --ledger-attention: #806315;
  --ledger-attention-soft: #fff3c7;
  --ledger-danger: #b14457;
  --ledger-danger-soft: #fde7ec;
  --tag-pink: #b33770;
  --tag-pink-soft: #fbe3ee;
  --tag-pink-accent: #ee5c9e;
  --tag-blue: #3a6e96;
  --tag-blue-soft: #e0f0fb;
  --tag-peach: #985529;
  --tag-peach-soft: #ffe8d8;
  --tag-teal: #267579;
  --tag-teal-soft: #dff4f1;
  --ledger-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --ledger-header-height: 0px;
  --shell-sidebar-width: 224px;
  --shell-radius: 10px;
  --shell-shadow: 0 3px 12px rgb(38 40 56 / 4%);
  --shell-accent-line: #d7caef;
  --shell-inset: #f6f7f9;
  --shell-hover: #fafbfc;
  --shell-focus: #8c75cf;
  --chat-bg: var(--ledger-bg);
  --chat-surface: var(--ledger-surface);
  --chat-surface-soft: var(--shell-inset);
  --chat-navy-950: #252834;
  --chat-navy-900: var(--ledger-fg);
  --chat-navy-800: #484b5b;
  --chat-text: var(--ledger-fg);
  --chat-muted: var(--ledger-muted);
  --chat-subtle: var(--ledger-muted);
  --chat-line: var(--ledger-border);
  --chat-line-strong: var(--ledger-border-strong);
  --chat-violet: var(--ledger-navy);
  --chat-violet-dark: var(--ledger-navy-hover);
  --chat-violet-soft: var(--ledger-navy-soft);
  --chat-violet-border: var(--shell-accent-line);
  --chat-success: var(--ledger-ready);
  --chat-success-soft: var(--ledger-ready-soft);
  --chat-warning: var(--ledger-attention);
  --chat-danger: var(--ledger-danger);
}
body:has(> .ledger-sidebar) {
  box-sizing: border-box;
  padding-left: var(--shell-sidebar-width);
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  background: var(--ledger-bg);
  color: var(--ledger-fg);
  font-family: var(--ledger-sans);
  --ledger-header-height: 0px;
}
.ledger-mobilebar, .shell-nav-backdrop { display: none; }
.ledger-site-header:not(.ledger-sidebar) { display: flex; align-items: center; justify-content: space-between; min-height: 64px; border-bottom: 1px solid var(--ledger-border); background: var(--ledger-surface); padding: 10px 20px; }
.ledger-site-header:not(.ledger-sidebar) .ledger-site-nav a { min-height: 40px; color: var(--ledger-navy); border: 0; border-radius: 7px; }
.ledger-site-header:not(.ledger-sidebar) .ledger-site-context { color: var(--ledger-muted); }
.ledger-sidebar.ledger-site-header {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  width: var(--shell-sidebar-width);
  height: 100dvh;
  min-height: 0;
  padding: 20px 12px 12px;
  border: 0;
  border-right: 1px solid var(--ledger-border);
  background: var(--ledger-surface);
  color: var(--ledger-fg);
}
.ledger-brand-row { display: flex; align-items: center; min-width: 0; gap: 4px; }
.ledger-site-brand { display: flex; align-items: center; gap: 10px; color: var(--ledger-fg); border: 0; padding: 0 8px; min-height: 42px; }
.ledger-site-brand strong { font-size: 20px; letter-spacing: -.5px; }
.ledger-brand-mark { flex: 0 0 30px; width: 30px; height: 30px; padding: 5px; box-sizing: content-box; border-radius: 10px; color: var(--tag-pink-accent); background: var(--tag-pink-soft); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.shell-icon-button { display: inline-grid; place-items: center; flex: 0 0 30px; min-width: 30px; width: 30px; height: 34px; min-height: 34px; border: 0; border-radius: 7px; padding: 6px; background: transparent; color: var(--ledger-muted); cursor: pointer; }
.shell-icon-button:hover { background: var(--ledger-navy-soft); color: var(--ledger-navy); }
.shell-icon-button svg, .ledger-site-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ledger-brand-row .shell-icon-button { margin-left: auto; }
.ledger-sidebar .ledger-site-nav { display: flex; flex: 1; flex-direction: column; align-items: stretch; min-height: 0; overflow: auto; margin-top: 30px; padding: 0 0 20px; gap: 5px; scrollbar-width: thin; }
body[data-view] .ledger-sidebar .ledger-site-nav a { display: flex; flex: 0 0 auto; justify-content: flex-start; align-items: center; min-height: 44px; gap: 13px; border: 0; border-radius: 8px; padding: 10px 13px; font: 500 14px/1.5 var(--ledger-sans); letter-spacing: 0; color: var(--ledger-muted); background: transparent; }
body[data-view] .ledger-sidebar .ledger-site-nav a:hover { background: var(--shell-inset); color: var(--ledger-fg); }
body[data-view] .ledger-sidebar .ledger-site-nav a.is-active { background: var(--ledger-navy-soft); color: var(--ledger-navy); font-weight: 650; }
.ledger-site-nav svg { flex: 0 0 20px; }
.ledger-nav-label { min-width: 0; white-space: nowrap; }
.ledger-sidebar .message-center-nav-count { background: var(--ledger-danger); border-radius: 6px; color: #fff; margin-left: auto; padding: 1px 5px; font-size: 11px; flex: 0 0 auto; }
.ledger-sidebar .ledger-site-account { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 8px; padding: 16px 9px 4px; border-top: 1px solid var(--ledger-border); }
.ledger-sidebar .ledger-site-account > a[href="/account"] { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 4px; color: var(--ledger-fg); font-size: 13px; line-height: 1.5; text-decoration: none; }
.ledger-sidebar .ledger-site-account > a[href="/account"] span { max-width: 138px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ledger-sidebar .ledger-site-account small { display: block; font: 11px/1.5 var(--ledger-sans); color: var(--ledger-muted); letter-spacing: 0; }
.ledger-sidebar .desktop-notifications-entry { grid-column: 1 / -1; justify-content: flex-start; width: 100%; border-color: var(--ledger-border); background: var(--shell-hover); color: var(--ledger-muted); }
.ledger-sidebar .ledger-site-signout { color: var(--ledger-muted) !important; min-width: 36px; min-height: 34px; border: 0; border-radius: 6px; font: 12px var(--ledger-sans); }
.ledger-sidebar .ledger-site-signout:hover { color: var(--ledger-danger) !important; background: var(--ledger-danger-soft); }
.ledger-sidebar :focus-visible, .ledger-mobilebar :focus-visible { outline: 2px solid var(--ledger-navy); outline-offset: 3px; }
/* Consistent controls and typography, including existing page-specific components. */
body[data-view] .ledger-page { min-height: 100dvh; padding: 32px clamp(20px, 2.6vw, 42px) 40px; }
body[data-view] .ledger-title-row { align-items: center; padding-bottom: 24px; border-bottom: 1px solid var(--ledger-border); }
body[data-view] .ledger-title-row h1 { font-size: 28px; font-weight: 650; letter-spacing: -.6px; line-height: 1.4; }
body[data-view] .ledger-title-row p { font-family: var(--ledger-sans); color: var(--ledger-muted); letter-spacing: .02em; }
body[data-view] :is(.ledger-button, .ledger-detail-button, .project-toolbar input, .project-toolbar select, .ledger-field input, .ledger-field select, .work-order-tabs button, .work-order-filters input, .work-order-filters select, .collaboration-fields input, .collaboration-fields select, .collaboration-fields textarea, .ws-toolbar input, .ws-toolbar select, .project-form-fields input, .project-form-fields select, .project-form-fields textarea) { border-radius: 7px; }
body[data-view] .ledger-button { font-weight: 550; border-color: var(--ledger-border-strong); box-shadow: 0 1px 2px rgb(38 40 56 / 2%); }
body[data-view] .ledger-button.is-dark { background: var(--ledger-navy); border-color: var(--ledger-navy); color: white; }
body[data-view] .ledger-button.is-dark:hover:not(:disabled) { background: var(--ledger-navy-hover); }
body[data-view] :is(.ledger-status, .project-badge, .work-order-tag, .home-source) { border: 0; border-radius: 6px; padding: 6px 10px; font-weight: 550; }
body[data-view] :is(.project-badge.active, .project-badge.doing, .project-badge.in_progress, .work-order-tag.doing) { color: var(--tag-pink); background: var(--tag-pink-soft); }
body[data-view] .project-badge.setup { color: var(--ledger-navy); background: var(--ledger-navy-soft); }
body[data-view] :is(.project-badge.paused, .project-badge.todo, .work-order-tag.todo, .work-order-tag.pending, .work-order-tag.partial) { color: var(--ledger-attention); background: var(--ledger-attention-soft); }
body[data-view] :is(.project-badge.blocked, .work-order-tag.blocked) { color: var(--tag-peach); background: var(--tag-peach-soft); }
body[data-view] .work-order-tag.accepted { color: var(--tag-blue); background: var(--tag-blue-soft); }
body[data-view] :is(.project-badge.completed, .project-badge.done, .work-order-tag.done) { color: var(--ledger-ready); background: var(--ledger-ready-soft); }
body[data-view] :is(.project-badge.cancelled, .work-order-tag.declined, .work-order-tag.cancelled) { color: var(--ledger-danger); background: var(--ledger-danger-soft); }
body[data-view] .project-badge.archived { color: var(--ledger-muted); background: var(--shell-inset); }
body[data-view] :is(.project-panel, .home-panel, .work-order-card, .work-order-detail, .work-order-filters, .chat-layout, .files-center .files-browser, .files-center .files-upload-dialog, .notification-ledger-list, .notification-preferences, .ws-panel, .ws-record, .project-metric, .project-stage, .project-empty) { border-color: var(--ledger-border); border-radius: var(--shell-radius); box-shadow: var(--shell-shadow); }
body[data-view] :is(.project-dialog, .home-dialog, .collaboration-dialog, .ws-dialog, .desktop-notifications-dialog) { border-color: var(--ledger-border); border-radius: 12px; box-shadow: 0 18px 70px rgb(38 40 56 / 16%); }
body[data-view] :is(input, select, textarea):focus-visible { outline: 2px solid var(--shell-focus); outline-offset: 2px; }
/* Tables remain tables: calm headings and airy white rows instead of boxed cells. */
body[data-view] :is(.project-table, .portal-ledger-table, .files-table, .ws-table) { font-size: 14px; }
body[data-view] :is(.project-table, .portal-ledger-table, .files-table, .ws-table) th { background: var(--ledger-bg); color: var(--ledger-muted); font-family: var(--ledger-sans); font-size: 12px; font-weight: 550; letter-spacing: .02em; border-color: var(--ledger-border); }
body[data-view] :is(.project-table, .portal-ledger-table, .files-table, .ws-table) td { border-color: var(--ledger-border); border-right: 0; }
body[data-view] :is(.project-table, .portal-ledger-table, .files-table, .ws-table) tbody tr:hover { background: var(--shell-hover); }
body[data-view] .project-table a { color: var(--ledger-fg); font-weight: 600; }
body[data-view] .project-table a:hover { color: var(--ledger-navy); }
body[data-view] .project-toolbar { gap: 14px; padding-block: 22px; }
body[data-view] .project-toolbar label { display: grid; flex: 1 1 140px; min-width: 0; gap: 7px; }
body[data-view] .project-toolbar label:first-child { flex: 1.5 1 200px; }
body[data-view] .project-toolbar :is(input[type="search"], select) { width: 100%; min-width: 0; }
body[data-view] .project-toolbar > button { align-self: end; }
body[data-view] .project-table { border-collapse: separate; border-spacing: 0 4px; }
body[data-view] .project-table-scroll { background: transparent; border: 0; box-shadow: none; }
body[data-view] .project-table td { padding: 18px 16px; background: var(--ledger-surface); border-bottom: 0; }
body[data-view] .project-table td:first-child { border-radius: 8px 0 0 8px; }
body[data-view] .project-table td:last-child { border-radius: 0 8px 8px 0; }
body[data-view] .project-table tbody tr { box-shadow: 0 3px 9px rgb(38 40 56 / 3%); }
body[data-view] .project-table th { padding: 14px 16px; }
body[data-view] .project-stage.is-current { background: var(--ledger-navy-soft); border-color: var(--shell-accent-line); }
body[data-view] .project-note { background: var(--ledger-navy-soft); color: var(--ledger-muted); border-radius: 8px; }
body[data-view] .portal-ledger-grid { border: 0; background: transparent; gap: 22px; }
body[data-view] .portal-ledger-table-wrap { border: 1px solid var(--ledger-border); border-radius: 10px; overflow: hidden; background: var(--ledger-surface); box-shadow: var(--shell-shadow); }
body[data-view] .portal-group-row th { color: var(--ledger-navy); background: var(--ledger-navy-soft); }
body[data-view] .portal-record-drawer { border: 1px solid var(--ledger-border); border-radius: 10px; background: var(--ledger-surface); }
body[data-view] .portal-record-row.is-selected { background: var(--ledger-navy-soft); }
/* Calendar and work orders keep their existing data and state meanings. */
body[data-view] .home-panel h2 { font-size: 19px; font-weight: 600; }
body[data-view] .home-panel { padding: 20px; }
body[data-view] .home-work-grid { gap: 24px; }
body[data-view] .home-segments { gap: 3px; padding: 3px; border-radius: 8px; background: var(--shell-inset); }
body[data-view] .home-segments button { border: 0; border-radius: 6px; margin: 0; background: transparent; color: var(--ledger-muted); }
body[data-view] .home-segments button[aria-pressed="true"] { background: var(--ledger-surface); color: var(--ledger-navy); box-shadow: 0 1px 4px #26283812; }
body[data-view] .home-group-title { border: 0; margin-top: 12px; padding: 8px 10px; border-radius: 6px; background: var(--ledger-navy-soft); color: var(--ledger-navy); }
body[data-view] .home-group-title.home-overdue { background: var(--ledger-danger-soft); color: var(--ledger-danger); }
body[data-view] .home-date { border-radius: 6px; }
body[data-view] .home-source.source-home { color: var(--tag-peach); background: var(--tag-peach-soft); }
body[data-view] :is(.home-source.source-task, .home-source.source-work_order) { color: var(--tag-blue); background: var(--tag-blue-soft); }
body[data-view] .home-calendar-bar.source-project { color: var(--tag-pink); background: var(--tag-pink-soft); }
body[data-view] .home-calendar-bar.source-stage { color: var(--ledger-navy); background: var(--ledger-navy-soft); }
body[data-view] :is(.home-calendar-bar.source-work_order, .home-calendar-bar.source-task) { color: var(--tag-blue); background: var(--tag-blue-soft); }
body[data-view] .home-calendar-bar.source-followup { color: var(--tag-teal); background: var(--tag-teal-soft); }
body[data-view] .home-calendar-bar.source-payment { color: var(--ledger-attention); background: var(--ledger-attention-soft); }
body[data-view] .home-calendar-bar.is-done { color: var(--ledger-ready); background: var(--ledger-ready-soft); }
body[data-view] .home-add-task { background: var(--ledger-surface); border-radius: 7px; border-style: dashed; }
body[data-view] .work-order-tabs button { border-color: var(--ledger-border); color: var(--ledger-muted); }
body[data-view] .work-order-tabs button[aria-pressed="true"] { color: var(--ledger-navy); background: var(--ledger-navy-soft); border-color: var(--shell-accent-line); }
body[data-view] .work-order-card { color: var(--ledger-fg); }
body[data-view] .work-order-card[aria-current="true"] { border-color: var(--shell-accent-line); box-shadow: inset 3px 0 var(--ledger-navy); }
body[data-view] .work-order-card p, body[data-view] .collaboration-subtitle, body[data-view] .work-order-copy { color: var(--ledger-muted); }
body[data-view] .chat-conversation[aria-current="true"] { background: var(--ledger-navy-soft); box-shadow: inset 3px 0 var(--ledger-navy); }
body[data-view] .chat-messages { background: var(--ledger-bg); }
body[data-view] .chat-bubble { color: var(--ledger-fg); border-color: var(--ledger-border); border-radius: 10px; }
body[data-view] .chat-message.is-own .chat-bubble { background: var(--ledger-navy-soft); border-color: var(--shell-accent-line); }
body[data-view] .message-center-filters button { border-color: var(--ledger-border); border-radius: 6px; color: var(--ledger-muted); }
body[data-view] .message-center-filters button[aria-pressed="true"] { color: var(--ledger-navy); background: var(--ledger-navy-soft); border-color: var(--shell-accent-line); }
body[data-view] .message-center-filters button[data-center-type="private"][aria-pressed="true"] { color: var(--tag-pink); background: var(--tag-pink-soft); border-color: transparent; }
body[data-view] .message-center-filters button[data-center-type="work_order"][aria-pressed="true"] { color: var(--tag-blue); background: var(--tag-blue-soft); border-color: transparent; }
body[data-view] .message-center-filters button[data-center-type="notification"][aria-pressed="true"] { color: var(--ledger-attention); background: var(--ledger-attention-soft); border-color: transparent; }
body[data-view] .message-center-page :is(.sidebar-head, .chat-sidebar, .chat-thread-heading, .message-center-settings) { border-color: var(--ledger-border); }
body[data-view] .message-center-page :is(.sidebar-head h2, .chat-sidebar > h2, .chat-thread-heading h2, .message-center-empty h2, .chat-conversation-head strong) { color: var(--ledger-fg); }
body[data-view] .message-center-page :is(.message-center-options, .message-center-settings, .message-center-empty, .collaboration-empty, .chat-conversation-preview, .chat-conversation-time) { color: var(--ledger-muted); }
body[data-view] .message-center-page .message-center-empty svg { color: #aaa3bb; }
body[data-view] .message-center-page .message-center-settings { background: var(--shell-hover); }
body[data-view] .message-center-page .message-center-settings summary { color: var(--ledger-muted); }
body[data-view] .message-center-page .chat-conversation[aria-current="true"] { background: var(--ledger-navy-soft); box-shadow: inset 3px 0 var(--ledger-navy); }
body[data-view] .message-center-page .chat-conversation-avatar { background: var(--ledger-navy-soft); color: var(--ledger-navy); border-radius: 10px; }
body[data-view] .message-center-page .chat-conversation[data-type="private"] .chat-conversation-avatar { background: var(--tag-pink-soft); color: var(--tag-pink); }
body[data-view] .message-center-page .chat-conversation[data-type="work_order"] .chat-conversation-avatar { background: var(--tag-blue-soft); color: var(--tag-blue); }
body[data-view] .message-center-page .chat-conversation[data-type="notification"] .chat-conversation-avatar { background: var(--ledger-attention-soft); color: var(--ledger-attention); }
/* Existing fixed-height workspaces now have the full desktop height. */
body[data-view="agent-chat"] .chat-app-shell { height: 100dvh; grid-template-columns: 248px minmax(0, 1fr); }
body[data-view="agent-chat"] .chat-main { min-width: 0; }
body[data-view="agent-chat"] .context-toggle,
body[data-view="agent-chat"] .context-close { display: inline-flex; }
body[data-view="agent-chat"] .chat-context-rail { position: fixed; inset: 0 0 0 auto; z-index: 160; height: 100dvh; width: 320px; transform: translateX(100%); transition: transform .18s ease; }
body[data-view="agent-chat"].context-open .chat-context-rail { transform: none; }
body[data-view="agent-chat"] :is(button, input, textarea, .chat-composer, .notification-panel, .chat-message) { border-radius: 8px !important; }
body[data-view="agent-chat"] .chat-thread { background: var(--shell-hover); }
body[data-view="agent-chat"] .chat-header { background: var(--ledger-surface); }
body[data-view="agent-chat"] .chat-composer-wrap { background: var(--shell-hover); }
body[data-view="agent-chat"] :is(.chat-composer, .chat-conversation-sidebar, .chat-context-rail, .chat-suggestion-grid button) { background: var(--ledger-surface); }
body[data-view="agent-chat"] .chat-suggestion-grid button:hover,
body[data-view="agent-chat"] .chat-suggestion-grid button:focus-visible { background: var(--ledger-navy-soft); }
body[data-view="agent-chat"] .welcome-mark { color: var(--tag-pink-accent); }
body[data-view="agent-chat"] .chat-composer { box-shadow: 0 5px 22px rgb(38 40 56 / 7%); }
body[data-view="agent-chat"] .chat-composer:focus-within { box-shadow: 0 0 0 3px rgb(105 83 191 / 12%), 0 5px 22px rgb(38 40 56 / 7%); }
body[data-view="commercial-control"] .cc-app-shell { height: 100dvh !important; }
body[data-view="commercial-control"] :is(button, input, select, textarea, .cc-company-context, .cc-tab-panel, .cc-product-card, .cc-agent-card, .cc-operations-card),
body[data-view="admin-console"] :is(button, select, input, textarea, .section-card) { border-radius: 8px !important; }
/* Compact desktop rail retains accessible link names and title tooltips. */
@media (min-width: 761px) {
  html[data-sidebar-collapsed="true"] { --shell-sidebar-width: 76px; }
  html[data-sidebar-collapsed="true"] .ledger-sidebar { padding-inline: 10px; }
  html[data-sidebar-collapsed="true"] .ledger-brand-row { flex-direction: column; }
  html[data-sidebar-collapsed="true"] .ledger-brand-row .shell-icon-button { margin: 4px auto 0; }
  html[data-sidebar-collapsed="true"] .ledger-site-brand { padding: 0; }
  html[data-sidebar-collapsed="true"] .ledger-sidebar .ledger-site-brand strong,
  html[data-sidebar-collapsed="true"] .ledger-nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  html[data-sidebar-collapsed="true"] .ledger-site-nav a { position: relative; }
  html[data-sidebar-collapsed="true"] .ledger-sidebar .message-center-nav-count { position: absolute; right: 2px; top: 1px; min-width: 14px; padding: 1px 3px; text-align: center; font-size: 10px; }
  html[data-sidebar-collapsed="true"] .ledger-sidebar .ledger-site-nav { margin-top: 18px; }
  html[data-sidebar-collapsed="true"] .ledger-sidebar .ledger-site-nav a { justify-content: center; padding-inline: 8px; }
  html[data-sidebar-collapsed="true"] .ledger-sidebar .ledger-site-account { display: flex; flex-direction: column; padding-inline: 0; gap: 8px; }
  html[data-sidebar-collapsed="true"] .ledger-sidebar .ledger-site-account > a[href="/account"] { width: 44px; overflow: hidden; align-items: center; }
  html[data-sidebar-collapsed="true"] .ledger-sidebar .ledger-site-account > a[href="/account"] span { max-width: 44px; font-size: 11px; }
  html[data-sidebar-collapsed="true"] .ledger-sidebar .ledger-site-account small { display: none; }
  html[data-sidebar-collapsed="true"] .ledger-sidebar .desktop-notifications-entry { width: 48px; padding: 6px 2px !important; white-space: normal; font-size: 11px !important; justify-content: center; }
}
@media (min-width: 761px) and (max-width: 1150px) {
  body[data-view] .home-work-grid, body[data-view] .home-bottom-grid { grid-template-columns: minmax(0, 1fr); }
  body[data-view] .portal-ledger-grid { grid-template-columns: minmax(0, 1fr); }
  body[data-view="agent-chat"] .chat-app-shell { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  body[data-view="agent-chat"] .chat-app-shell { display: block; }
  body[data-view="agent-chat"] .chat-main { height: 100dvh; }
  body[data-view="agent-chat"] .chat-conversation-sidebar { top: 0; height: 100dvh; }
}
@media (max-width: 760px) {
  body:has(> .ledger-sidebar) { padding-left: 0; --ledger-header-height: 58px; }
  .ledger-mobilebar { display: flex; position: sticky; top: 0; z-index: 180; height: 58px; box-sizing: border-box; align-items: center; gap: 12px; padding: 8px 14px; background: var(--ledger-surface); border-bottom: 1px solid var(--ledger-border); }
  .ledger-mobilebar .shell-icon-button { width: 40px; height: 40px; }
  .ledger-mobilebar a { color: var(--ledger-fg); text-decoration: none; font: 650 17px var(--ledger-sans); }
  .ledger-mobilebar > span { margin-left: auto; color: var(--ledger-muted); font-size: 12px; }
  .ledger-sidebar.ledger-site-header { width: min(280px, calc(100vw - 52px)); padding-top: 18px; transform: translateX(-100%); visibility: hidden; transition: transform .18s ease, visibility .18s; }
  .shell-nav-open .ledger-sidebar { transform: none; visibility: visible; }
  body.shell-nav-open { overflow: hidden; }
  .shell-nav-open .shell-nav-backdrop { display: block; position: fixed; inset: 0; z-index: 190; border: 0; border-radius: 0; background: #30333d4d; width: 100%; height: 100dvh; }
  .ledger-sidebar .ledger-site-nav { border: 0; margin-top: 24px; }
  .ledger-sidebar .ledger-site-brand strong { font-size: 20px; }
  body[data-view] .ledger-page { min-height: calc(100dvh - 58px); padding: 22px 16px 32px; }
  body[data-view] .ledger-title-row { flex-wrap: wrap; gap: 16px; padding-bottom: 18px; }
  body[data-view] .ledger-title-row h1 { font-size: 25px; }
  body[data-view] .ledger-title-actions { gap: 8px; }
  body[data-view] .project-toolbar { flex-direction: row; align-items: end; gap: 12px; }
  body[data-view] .project-toolbar label { display: grid; flex: 1 1 130px; gap: 6px; }
  body[data-view] .project-toolbar label:first-child { flex-basis: 100%; }
  body[data-view] .project-toolbar :is(input[type="search"], select) { width: 100%; min-width: 0; }
  body[data-view] .home-panel { padding: 14px; }
  body[data-view="agent-chat"] .chat-app-shell, body[data-view="agent-chat"] .chat-main { height: calc(100dvh - 58px); }
  body[data-view="agent-chat"] .chat-context-rail, body[data-view="agent-chat"] .chat-conversation-sidebar { top: 58px; height: calc(100dvh - 58px); }
  body[data-view="commercial-control"] .cc-app-shell { height: auto !important; }
}
@media (prefers-reduced-motion: reduce) {
  .ledger-sidebar, body[data-view="agent-chat"] .chat-context-rail { transition: none !important; }
}
