/* Shared workspace palette. Accent colours are separate from status and sidebar colours. */
:root {
  color-scheme: light;
  --paper: #f4f5f7;
  --surface: #fff;
  --surface-subtle: #f8f9fb;
  --ink: #202224;
  --muted: #58636f;
  --line: #e2e6eb;
  --green: #15714d;
  --amber: #815211;
  --blue: #305c9d;
  --positive-bg: #e9f5ed;
  --warning-bg: #fff4e2;
  --warning-line: #ead7b5;
  --info-bg: #eaf1fc;
  --neutral-bg: #edf0f4;
  --special-bg: #f1edfa;
  --special-text: #574480;
  --hire-bg: #e6f3f9;
  --hire-text: #2d5e74;
  --shadow: 0 12px 30px #18223008;
  --radius: 17px;

  --office-bg: #f6f7f7;
  --office-panel: #fff;
  --office-subtle: #f6f8fa;
  --office-text: #203040;
  --office-muted: #566678;
  --office-border: #dce2e8;
  --office-outline: #8d9eae;
  --office-accent: #0868b6;
  --office-button: #2998ff;
  --office-on-button: #fff;
  --office-button-hover: #1478d4;
  --office-hover: #edf7ff;
  --office-selected: #eaf5ff;
  --office-indicator: var(--office-button);
  --office-focus: #0a70c8;
  --office-disabled-bg: #edf0f4;
  --office-disabled-text: #617283;
  --office-success: #176344;
  --office-success-bg: #e9f5ed;
  --office-warning: #785015;
  --office-warning-bg: #fff4e2;
  --office-completion-filled: #2bb98f;
  --office-completion-missing: #ff9600;
  --office-danger: #a3293b;
  --office-danger-bg: #ffedf0;
  --office-overlay: #17283d70;
  --office-shadow: 0 12px 30px #20304014;
  --office-button-height: 40px;
  --office-button-radius: 999px;
  --office-button-font: 14px;
  --office-list-text-size: 14px;
  --office-list-heading-size: 13px;
  --office-list-heading-weight: 650;
  --office-list-detail-size: 12px;
  --office-list-emphasis-weight: 700;
  --office-font-family: 'Noto Sans', system-ui, sans-serif;
  --office-field-size: 14px;
  --office-label-size: 13px;
  --office-control-weight: 400;
  --office-tab-active-weight: 700;
  --office-section-title-size: 18px;
  --office-section-title-weight: 700;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #151719;
  --surface: #202224;
  --surface-subtle: #26292d;
  --ink: #f3f4f6;
  --muted: #b2bac4;
  --line: #373b41;
  --green: #86d9ad;
  --amber: #f2c77f;
  --blue: #a2c8ff;
  --positive-bg: #233a30;
  --warning-bg: #3d3122;
  --warning-line: #5d4a2f;
  --info-bg: #24364c;
  --neutral-bg: #2c3137;
  --special-bg: #353044;
  --special-text: #d2c2f3;
  --hire-bg: #253a44;
  --hire-text: #acd7e8;
  --shadow: 0 12px 30px #0002;

  --office-bg: #151e29;
  --office-panel: #1d2835;
  --office-subtle: #222f3e;
  --office-text: #edf3fa;
  --office-muted: #afbed0;
  --office-border: #364659;
  --office-outline: #70869e;
  --office-accent: #a8d5ff;
  --office-hover: #263a50;
  --office-selected: #2c445e;
  --office-focus: #8bc6ff;
  --office-disabled-bg: #2c3949;
  --office-disabled-text: #a5b5c7;
  --office-success: #9cdbb6;
  --office-success-bg: #263d35;
  --office-warning: #f2cb8d;
  --office-warning-bg: #3d3326;
  --office-completion-filled: #58d4ae;
  --office-completion-missing: #ffb44d;
  --office-danger: #ff9ea8;
  --office-danger-bg: #492d39;
  --office-overlay: #0a1323a6;
  --office-shadow: 0 12px 30px #0005;
}

body:has(.office-sidebar-shell,.field-shell,.staff-workspace) {
  --paper: var(--office-bg);
  --surface: var(--office-panel);
  --surface-subtle: var(--office-subtle);
  --ink: var(--office-text);
  --muted: var(--office-muted);
  --line: var(--office-border);
  --shadow: var(--office-shadow);
  background: var(--office-bg);
  color: var(--office-text);
}

.live-shell .main {
  font-family: var(--office-font-family);
}
.live-shell .main :is(h1,h2,h3) { font-family: inherit; }
.live-shell .topbar { border-color: var(--office-border); }
.live-shell .global-search input { border-color: var(--office-border); font-size: 14px; }
.live-shell .search-results a:hover { background: var(--office-hover); }
.live-shell .mobile-menu:hover { background: var(--office-hover); color: var(--office-text); }
:is(.office-sidebar-shell,.field-shell) :is(button, a, input, select, textarea, summary):focus-visible,
body:has(.office-sidebar-shell,.field-shell) :is(#modal,.today-editor) :is(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--office-focus);
  outline-offset: 2px;
}

.sidebar {
  background: var(--surface);
  color: var(--muted);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.office-brand, .side-foot strong { color: var(--ink); }
.office-brand span, .nav-label, .side-foot a { color: var(--muted); }
.office-brand { margin-bottom: 21px; }
.nav-label { font-size: 10px; }
.side-nav a { font-size: 12px; border-radius: 10px; }
.side-nav a:hover { background: var(--surface-subtle); color: var(--ink); }
.side-nav a.active { background: var(--office-selected); color: var(--office-text); font-weight: 700; }
.nav-count { background: var(--neutral-bg); color: var(--ink); }
.side-foot { border-color: var(--line); }

.topbar, .btn, .stat, .panel, .resource-card, .pill-tabs, .cal-resource,
dialog, .modal-head, input, select, textarea, .client-body, .client-header, .mobile-menu {
  background: var(--surface);
  color: var(--ink);
}
.client-header { border: 1px solid var(--line); }
.user-avatar, th, .cal-header, .modal-actions, .check-option, .close,
.resource-tags span, tr.clickable:hover { background: var(--surface-subtle); }
input, select, textarea, td, .cal-cell { border-color: var(--line); }
input::placeholder, textarea::placeholder, .detail-section p { color: var(--muted); }

.content { max-width: 1680px; }
.content > .panel + .panel, .content > .customer-grid + .panel,
.content > .panel + .customer-grid { margin-top: 18px; }
.page-head h1 { font-size: clamp(29px, 4vw, 42px); letter-spacing: -.045em; }
.eyebrow { font-size: 10px; letter-spacing: .12em; }
.sub, .detail-section p, .customer-card p { font-size: 13px; line-height: 1.65; }
.crumb, .btn, td { font-size: 12px; }
th, td .minor, .log-row time, .panel-head p, .stat-note, .stat-label { font-size: 11px; }
.panel-head h2 { font-size: 15px; }
.btn { min-height: 40px; border-radius: 10px; }
.btn:hover { border-color: var(--muted); }
.btn.red { background: var(--office-button); border-color: var(--office-button); color: var(--office-on-button); }
.btn.red:not(:disabled):hover { background: var(--office-button-hover); border-color: var(--office-button-hover); }
.btn.dark, .pill-tabs button.active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn.danger { color: var(--office-danger); }
.text-link { color: var(--office-accent); }
.panel, .stat, .resource-card { border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-icon { color: var(--office-indicator); }
.connection-dot { background: var(--office-muted); }
.connection-dot[data-state="connected"] { background: var(--office-success); }
.connection-dot[data-state="setup"] { background: var(--office-warning); }
.bar-track { background: var(--neutral-bg); }

.demo-strip, .notice { background: var(--warning-bg); color: var(--amber); border-color: var(--warning-line); }
.demo-strip, .demo-strip button, .notice { font-size: 11px; }
.notice.good { background: var(--positive-bg); border-color: var(--line); color: var(--green); }
.badge { font-size: 10px; border-radius: 999px; padding: 5px 9px; background: var(--neutral-bg); color: var(--muted); }
.badge.booked, .badge.paid, .badge.sent, .badge.completed { background: var(--positive-bg); color: var(--green); }
.badge.quoted, .badge.pending, .badge.accepted { background: var(--warning-bg); color: var(--amber); }
.badge.in-progress, .provider-logo { background: var(--info-bg); color: var(--blue); }
.badge.schedule-review, .badge.payment-review, .badge.failed, .error { background: var(--office-danger-bg); color: var(--office-danger); }
.cal-header.today, .provider-logo.calendar { background: var(--office-selected); color: var(--office-accent); }
.badge.dry, .cal-event.dry, .provider-logo.stripe { background: var(--special-bg); color: var(--special-text); }
.badge.wet { background: var(--hire-bg); color: var(--hire-text); }
.cal-event { background: var(--positive-bg); color: var(--green); }
.cal-event.provisional { background: var(--warning-bg); color: var(--amber); }
.cal-event.block { background: var(--neutral-bg); color: var(--muted); }
#toast { background: var(--ink); color: var(--surface); }

.module-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.module-link { display: flex; align-items: center; gap: 13px; padding: 16px; min-height: 76px; }
.module-link:hover { border-color: var(--office-indicator); background: var(--office-hover); }
.module-link-icon { color: var(--office-indicator); background: var(--office-selected); width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; flex: none; }
.module-link strong, .module-link small { display: block; }
.module-link strong { font-size: 13px; }
.module-link small { color: var(--muted); font-size: 11px; margin-top: 4px; }
.module-link-arrow { margin-left: auto; color: var(--muted); }

.theme-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; border: 0; padding: 4px; color: var(--muted); background: transparent; white-space: nowrap; font-size: 11px; }
.theme-switch-track { display: inline-flex; align-items: center; flex: none; width: 36px; height: 22px; padding: 3px; background: var(--neutral-bg); border: 1px solid var(--line); border-radius: 999px; }
.theme-switch-track span { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s ease; }
.theme-switch[aria-checked="true"] .theme-switch-track { background: var(--office-button); border-color: transparent; }
.theme-switch[aria-checked="true"] .theme-switch-track span { transform: translateX(14px); background: var(--office-on-button); }
.theme-switch:focus-visible, .module-link:focus-visible { outline: 2px solid var(--office-focus); outline-offset: 3px; }

.live-shell .theme-switch { border-radius: var(--office-button-radius); padding-inline: 7px; white-space: normal; }
.live-shell .theme-switch:hover { background: var(--office-hover); }
.live-shell .theme-switch-track { background: var(--office-outline); border-color: transparent; }
.live-shell .theme-switch-track span { background: var(--office-panel); }
.live-shell .theme-switch[aria-checked="true"] .theme-switch-track { background: var(--office-button); }
.live-shell .theme-switch[aria-checked="true"] .theme-switch-track span { background: var(--office-on-button); }

@media (max-width: 690px) { .module-shortcuts { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .theme-switch-label { display: none; }
  .theme-switch { min-width: 44px; min-height: 44px; }
  .demo-strip, .demo-strip button { font-size: 10px; }
}
@media print {
  :root[data-theme] { color-scheme: light; --ink: #202224; --paper: #fff; --surface: #fff; --muted: #454a50; }
  .theme-switch, .module-shortcuts { display: none; }
}

.workspace-form { display: grid; gap: 12px; max-width: 620px; margin: 12px 0; }
.workspace-form > .btn { justify-self: start; }
.workspace-form label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 8px; }
.workspace-form input[type="checkbox"] { width: 16px; accent-color: var(--office-button); }
[data-day-note-fields] {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.workspace-form .schedule-day-note-choice { display: flex; align-items: center; gap: 8px; }
.workspace-form .schedule-day-note-choice input { flex: none; margin: 0; }
.clock-in-fields { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.clock-in-fields legend { font-weight: 600; padding: 0 0 4px; }
.clock-field-with-description > label { margin: 0; }
.clock-field-description { display: block; margin-block: 4px 10px; font-size: var(--office-list-detail-size); white-space: pre-line; overflow-wrap: anywhere; }
.workspace-disclosure { margin: 12px 0; }
.workspace-disclosure summary { cursor: pointer; font-weight: 650; font-size: 13px; color: var(--office-accent); }
.workspace-message:empty { display: none; }
.workspace-message { color: var(--office-accent); }
.workspace-entry, .workspace-row, .setup-steps li { padding: 16px 0; border-top: 1px solid var(--line); }
.workspace-entry h3 { margin-bottom: 7px; }
.workspace-row, .setup-steps li { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.setup-steps { margin: 0; padding: 0; list-style: none; }
.setup-steps h3 { margin-top: 7px; }
.setup-steps .btn + .btn { margin-left: 7px; }
.client-setup { display: grid; gap: 16px; }
.client-setup-form, .client-setup-next { display: flex; flex-wrap: wrap; gap: 12px; }
.client-setup-form { align-items: end; margin-top: 16px; }
.client-setup-form label { flex: 0 1 280px; min-width: 0; margin: 0; }
.client-setup-next { justify-content: space-between; align-items: center; }
.client-setup-notice:empty { display: none; }
.client-setup-steps .actions { margin: 0; }
.client-setup-steps .actions .btn + .btn { margin-left: 0; }
.staff-workspace { max-width: 860px; margin-inline: auto; }
.staff-theme { display: flex; justify-content: flex-end; }

.assistant-panel { scroll-margin-top: 24px; }
.assistant-history { display: grid; gap: 12px; max-width: 680px; }
.assistant-message { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.assistant-message p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; }
.assistant-prompts { flex-wrap: wrap; }
.assistant-form [role="status"]:empty { display: none; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.live-shell .topbar { position: sticky; top: 0; z-index: 4; height: auto; min-height: 66px; padding-block: 10px; }
.live-shell .nav-label { margin: 16px 0 4px; }
.live-shell .side-nav a { min-height: 40px; gap: 9px; }
.nav-glyph { display: grid; place-items: center; flex: 0 0 27px; height: 27px; border-radius: 8px; background: var(--neutral-bg); color: var(--muted); }
.nav-glyph .icon { width: 16px; height: 16px; color: inherit; }
.nav-overview, .nav-help { background: var(--info-bg); color: var(--blue); }
.nav-jobs, .nav-customers { background: var(--positive-bg); color: var(--green); }
.nav-equipment, .nav-hire-live { background: var(--hire-bg); color: var(--hire-text); }
.global-search { flex: 1 1 230px; max-width: 420px; min-width: 0; position: relative; }
.global-search input { width: 100%; min-height: 40px; background: var(--surface-subtle); }
.search-results { position: absolute; top: calc(100% + 8px); width: 100%; min-width: min(280px, 88vw); z-index: 5; overflow: hidden; }
.search-results li a { padding-inline: 14px; }
.today-quick, .today-metrics, .timesheet-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 192px), 1fr)); gap: 13px; margin-bottom: 16px; }
.quick-action, .today-metric { display: flex; align-items: center; gap: 12px; padding: 15px; color: var(--ink); text-align: left; text-decoration: none; }
.quick-action { cursor: pointer; min-height: 74px; }
button.today-metric { cursor: pointer; font: inherit; }
.quick-action:hover, .today-metric:hover { border-color: var(--office-indicator); background: var(--office-hover); }
.quick-action > span:last-child { margin-left: auto; color: var(--muted); }
.quick-action strong, .quick-action small, .today-metric strong, .today-metric small { display: block; }
.quick-action small, .today-metric small { color: var(--muted); margin-top: 3px; font-size: 12px; }
.today-metric strong { font-size: 25px; line-height: 1; }
.today-attendance { margin-bottom: 16px; overflow: visible; }
.today-attendance-head { gap: 12px; flex-wrap: wrap; }
.today-attendance-head .head-actions { justify-content: flex-start; }
.today-attendance-search { display: flex; align-items: center; position: relative; margin: 0; max-width: 200px; }
.today-attendance-search input { width: 100%; min-height: 40px; padding-inline-start: 36px; }
.today-attendance-search svg {
  position: absolute; inset-block: 0; inset-inline-start: 10px; margin-block: auto;
  width: 17px; height: 17px; color: var(--office-muted); pointer-events: none;
}
.today-attendance-body { padding: 0 16px 12px; }
.today-attendance-categories { display: flex; flex-wrap: wrap; gap: 8px; }
.today-attendance-categories .btn[hidden] { display: none; }
.live-shell .today-attendance-categories .btn[aria-pressed="true"] { background: var(--office-selected); border-color: var(--office-indicator); }
.today-attendance-categories [data-today-attendance-count] { min-width: 1.4em; text-align: center; }
.today-attendance [role="status"]:empty { margin: 0; }
.today-attendance-list { margin: 8px 0 0; padding: 0; list-style: none; }
.today-attendance-row { display: flex; align-items: center; gap: 10px; min-height: 60px; padding-block: 7px; }
.today-attendance-row + .today-attendance-row { border-top: 1px solid var(--office-border); }
.today-attendance-row .chat-avatar { flex: 0 0 32px; width: 32px; height: 32px; }
.today-attendance-worker { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.today-attendance-worker strong { display: block; color: var(--office-text); font-weight: 600; }
.today-attendance-worker small, .today-attendance-menu-panel small { display: block; color: var(--office-muted); font-size: 12px; }
.today-attendance-menu { position: relative; }
.today-attendance-menu[open] { z-index: 4; }
.today-attendance-icon { display: grid; place-items: center; width: 40px; padding: 0; list-style: none; }
.today-attendance-icon::-webkit-details-marker { display: none; }
.today-attendance-icon svg { width: 18px; height: 18px; }
.today-attendance-menu-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 5px); margin: 0;
  min-width: 190px; width: max-content; max-width: min(264px, 67vw); padding: 10px; background: var(--office-panel);
  border: 1px solid var(--office-border); border-radius: 12px; box-shadow: var(--office-shadow); }
.today-attendance-menu-panel fieldset { display: grid; gap: 10px; margin: 0 0 10px; padding: 0; border: 0; }
.today-attendance-menu-panel legend { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.today-attendance-menu-panel label { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 8px; margin: 0; }
.today-attendance-menu-panel input { width: 16px; margin: 3px 0 0; accent-color: var(--office-accent); }
.today-attendance-row-menu { display: grid; gap: 6px; }
.today-columns { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.today-columns .detail-section, .planner-agenda .detail-section { padding-block: 6px; }
.launch-card { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 22px; gap: 20px; margin-bottom: 16px; background: var(--office-selected); }
.launch-card h2 { font-size: 22px; margin: 4px 0; }
.launch-card p { color: var(--muted); margin: 0; }
.launch-copy { flex: 1 1 270px; }
.launch-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12px; margin-top: 12px; color: var(--muted); }
.launch-progress progress { width: min(160px, 100%); height: 9px; accent-color: var(--office-button); }
.action-list { list-style: none; margin: 0; padding: 0; }
.action-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.action-list li + li { border-top: 1px solid var(--line); }
.action-list li:has(> a) { display: block; }
.action-list li > a { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink); text-decoration: none; padding-block: 12px; }
.action-list li > a:hover strong { color: var(--office-accent); }
.action-list li:not(:has(> a)) { padding-block: 10px; }
.action-list small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.action-list strong { overflow-wrap: anywhere; }
.badge.published, .badge.approved { background: var(--positive-bg); color: var(--green); }
.badge.submitted { background: var(--info-bg); color: var(--blue); }
.badge.returned, .badge.unassigned { background: var(--warning-bg); color: var(--amber); }
.planner-toolbar, .time-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; padding: 12px 16px; margin-bottom: 14px; }
.planner-filters, .time-filters, .period-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.planner-filters label, .time-filters label, .inline-filter { margin: 0; font-size: 11px; }
.planner-filters select, .time-filters select, .inline-filter select { min-height: 39px; padding-block: 7px; }
.planner-toolbar + .planner-grid { margin-bottom: 16px; }
.planner-grid .calendar-grid { grid-template-columns: 135px repeat(7, minmax(100px, 1fr)); min-width: 850px; }
.planner-grid .cal-event { text-decoration: none; overflow-wrap: anywhere; }
.cal-event.dispatch-draft { background: var(--info-bg); color: var(--blue); border-style: dashed; }
.planner-agenda, .planner-grid.hide-grid { display: none; }
.planner-agenda.show-agenda { display: block; margin-bottom: 16px; }
.planner-agenda .panel-head { gap: 12px; }
.operations-drawer[open] { position: fixed; inset: 0 0 0 auto; width: min(530px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-left: 1px solid var(--line); border-radius: 0; display: flex; flex-direction: column; overflow: hidden; }
.operations-drawer::backdrop { background: var(--office-overlay); }
.drawer-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 14px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.drawer-head .eyebrow { grid-column: 1; }
.drawer-head h2 { grid-column: 1; overflow-wrap: anywhere; }
.drawer-head .btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.drawer-body { padding: 18px 22px max(24px, env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.drawer-body > .panel { margin-block: 15px; }
.drawer-body .panel-head { padding-block: 11px; }
.dispatch-info { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-subtle); }
.dispatch-info p { margin: 0; line-height: 1.55; }
.dispatch-resources { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; display: grid; gap: 7px; min-width: 0; }
.dispatch-resources legend { font-size: 12px; font-weight: 700; padding-inline: 5px; }
.dispatch-resources label { min-height: 24px; }
.workspace-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.workspace-tabs a { padding: 9px 12px; min-height: 40px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); text-decoration: none; }
.workspace-tabs a[aria-current="page"] { background: var(--office-selected); color: var(--office-accent); border-color: var(--office-indicator); font-weight: 700; }
.timesheet-summary > div { padding: 13px 15px; }
.timesheet-summary span, .timesheet-summary strong { display: block; }
.timesheet-summary span { font-size: 11px; color: var(--muted); }
.timesheet-summary strong { font-size: 21px; margin-top: 4px; }
.period-picker > span { font-weight: 700; white-space: nowrap; }
.time-table td { white-space: normal; }
.time-table td input[type="checkbox"] { min-width: 19px; min-height: 19px; accent-color: var(--office-button); }
.time-table td .badge { margin-top: 2px; }
.time-breakdown { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0; }
.time-breakdown > div { padding: 10px; border-radius: 9px; background: var(--surface-subtle); }
.time-breakdown dt { font-size: 11px; color: var(--muted); }
.time-breakdown dd { margin: 3px 0 0; font-weight: 700; }
.field-shell { max-width: 740px; min-height: 100dvh; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.field-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.field-header h1 { font-size: clamp(31px, 5vw, 42px); letter-spacing: -.05em; margin: 4px 0; }
.field-header p { margin: 0; }
.field-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 3; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); padding: 5px max(12px, calc((100vw - 710px) / 2)) env(safe-area-inset-bottom); border-top: 1px solid var(--line); }
.field-nav a { display: grid; place-items: center; align-content: center; gap: 4px; color: var(--muted); text-decoration: none; min-height: 58px; font-size: 12px; }
.field-nav a[aria-current="page"] { color: var(--office-accent); font-weight: 700; }
.field-nav a .icon { width: 20px; height: 20px; color: currentColor; }
.field-content > .panel + .panel { margin-top: 13px; }
.field-job-list { display: grid; gap: 13px; }
.field-job, .field-clock { padding: 17px; }
.field-clock { border-color: var(--office-indicator); background: var(--office-selected); margin-bottom: 16px; }
.field-clock-head h2, .field-job h2 { font-size: 20px; margin: 4px 0; }
.field-elapsed { font-size: 36px; font-variant-numeric: tabular-nums; }
.field-job-head, .field-job-actions, .field-clock-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.field-job-head { justify-content: space-between; }
.field-job-time { margin: 5px 0; font-weight: 650; }
.field-job .sub { margin: 3px 0 9px; }
.field-instructions { padding: 10px; border-radius: 8px; background: var(--surface-subtle); white-space: pre-wrap; }
.field-shell :is(.field-job-actions,.field-clock-actions) .btn { min-height: 44px; }
.field-job-actions .workspace-form, .field-clock-actions .workspace-form { margin: 0; }
.field-clock-actions { align-items: flex-start; }
.field-shell .notice { margin-bottom: 14px; }
.field-shell #staff-help { scroll-margin-bottom: 85px; }
#toast { z-index: 20; pointer-events: none; }
.field-mode #toast { bottom: calc(74px + env(safe-area-inset-bottom)); }

.assistant-open { gap: 7px; color: var(--office-accent); background: var(--office-selected); border-color: transparent; white-space: nowrap; }
.assistant-spark { width: 17px; height: 17px; flex: none; }
.assistant-panel > .panel-head { justify-content: flex-start; gap: 10px; }
.assistant-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; background: var(--office-selected); color: var(--office-accent); }
.assistant-intro { color: var(--muted); margin: 0 0 12px; }
.assistant-user { margin-left: min(40px, 9%); background: var(--office-selected); }
.assistant-assistant { margin-right: min(40px, 9%); background: var(--surface-subtle); }
.assistant-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.assistant-sources small { width: 100%; font-size: 11px; color: var(--muted); }
.assistant-sources a { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--surface); font-size: 11px; text-decoration: none; }
.assistant-sources a:hover { border-color: var(--office-indicator); color: var(--office-accent); background: var(--office-hover); }
.assistant-prompts .btn { min-height: 35px; white-space: normal; text-align: left; font-size: 11px; }
.assistant-history:empty { display: none; }
.assistant-guide .action-list { margin-top: 9px; }
.assistant-drawer[open] { position: fixed; inset: 0 0 0 auto; width: min(470px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-left: 1px solid var(--line); border-radius: 0; overflow-y: auto; background: var(--paper); }
.assistant-drawer::backdrop { background: var(--office-overlay); }
.assistant-drawer-bar { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.assistant-drawer-bar span { font-weight: 700; font-size: 10px; letter-spacing: .09em; color: var(--muted); }
.assistant-drawer .assistant-panel { margin: 10px 12px max(14px, env(safe-area-inset-bottom)); }
.assistant-drawer .assistant-history { max-height: 42dvh; overflow-y: auto; }
.field-header-actions { display: flex; align-items: center; gap: 6px; }
.project-job-picker { display: block; max-width: 420px; margin-block: 8px 16px; }
.project-values { list-style: none; padding: 0; }
.project-values li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.project-values p, .project-message, .lesson p { white-space: pre-wrap; overflow-wrap: anywhere; }
.builder-row { display: grid; gap: 8px; padding: 12px; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.builder-row > .btn { justify-self: start; }
.lesson { padding: 12px; margin-block: 8px; background: var(--surface-subtle); border-radius: 10px; }
@media print {
  body:has(#print-project-record) * { visibility: hidden; }
  #print-project-record, #print-project-record * { visibility: visible !important; }
  #print-project-record { position: absolute; inset: 0 auto auto 0; width: 100%; }
  #print-project-record button, #print-project-record form, #print-project-record details, #print-project-record .actions { display: none; }
}

@media (max-width: 1000px) {
  .live-shell .topbar .crumb { display: none; }
  .planner-grid { display: none; }
  .planner-agenda { display: block; margin-bottom: 15px; }
  .planner-view-picker { display: none; }
}
@media (max-width: 760px) {
  .today-columns { grid-template-columns: 1fr; }
  .time-table, .time-table tbody, .time-table tr, .time-table td,
  .quote-table, .quote-table tbody, .quote-table tr, .quote-table td { display: block; width: 100%; min-width: 0; }
  .time-table thead, .quote-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .time-table tr, .quote-table tr { padding: 8px 14px; border-top: 1px solid var(--line); }
  .time-table td, .quote-table td { display: grid; grid-template-columns: minmax(90px, 37%) minmax(0, 1fr); justify-items: start; align-items: baseline; border: 0; padding: 5px 0; white-space: normal; }
  .time-table td[data-label]::before, .quote-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 11px; }
  .time-table td[data-label]:empty { display: none; }
  .time-table td .minor, .quote-table td .minor { grid-column: 2; }
  .time-table td:last-child, .quote-table td:last-child { display: block; padding-top: 8px; }
  .time-batch .panel-head { gap: 12px; }
}
@media (max-width: 540px) {
  .live-shell .topbar { flex-wrap: wrap; gap: 6px 12px; }
  .live-shell .topbar-right { margin-left: auto; }
  .global-search { flex-basis: 100%; max-width: none; order: 3; }
  .today-quick, .today-metrics, .timesheet-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .today-quick .module-link-icon { width: 29px; height: 29px; }
  .quick-action, .today-metric { padding: 10px; gap: 6px; min-height: 62px; }
  .quick-action > span:last-child { display: none; }
  .quick-action small, .today-metric small { font-size: 10px; }
  .today-metric .module-link-icon { width: 30px; height: 30px; }
  .launch-card, .drawer-body, .drawer-head { padding-inline: 14px; }
  .time-filters { width: 100%; }
  .time-filters label { flex: 1 1 110px; }
  .field-shell { padding-inline: 12px; }
  .field-shell #staff-help { scroll-margin-top: 15px; }
}

/* Team communications */
.field-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.field-chat-shell { max-width: 1150px; }
.field-chat-shell .field-header { margin-bottom: 8px; }
.field-chat-shell .field-header h1,.field-chat-shell .field-header .eyebrow { display: none; }
.chat-workspace { display: grid; grid-template-columns: minmax(245px, 32.5%) minmax(0, 1fr); position: relative;
  height: clamp(540px, calc(100dvh - 136px), 980px); min-width: 0; border: 1px solid var(--line); border-radius: 16px;
  color: var(--ink); background: var(--surface); }
.chat-workspace [hidden] { display: none !important; }
.chat-workspace h1,.chat-workspace h2,.chat-workspace h3,.chat-workspace h4,.chat-workspace p { margin-block: 0; }
.chat-inbox { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--line); }
.chat-inbox-head,.chat-header,.chat-info-head,.chat-dialog-head { display: flex; align-items: center; justify-content: space-between;
  gap: 9px; padding: 15px 17px; }
.chat-inbox-head h1 { margin-top: 2px; font-size: 30px; line-height: 1.1; letter-spacing: -.03em; }
.chat-tools,.chat-composer-tools,.chat-info-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.chat-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; gap: 4px; min-height: 36px;
  padding: 6px 10px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 12px; font-weight: 700; text-decoration: none; cursor: pointer; }
.chat-button.primary { color: var(--office-on-button); background: var(--office-button); border-color: var(--office-button); }
.chat-button:not(:disabled):hover { background: var(--office-hover); color: var(--chat-button-active-text,var(--office-accent)); }
.chat-button:not(.primary,:disabled):is([aria-pressed="true"], [aria-expanded="true"]) { background: var(--office-selected); color: var(--chat-button-active-text,var(--office-accent)); }
.chat-button.primary:not(:disabled):hover { background: var(--office-button-hover); color: var(--office-on-button); border-color: var(--office-button-hover); }
.chat-button:disabled { background: var(--office-disabled-bg); color: var(--office-disabled-text); border-color: var(--office-border); cursor: default; }
.chat-search { margin: 0 14px 10px; }
.chat-workspace input:not([type="checkbox"],[type="file"]),.chat-workspace textarea,.chat-workspace select {
  display: block; width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px;
  color: var(--ink); background: var(--surface); font: inherit; font-size: 14px; }
.chat-workspace textarea { resize: vertical; min-height: 44px; }
.chat-filters { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border-bottom: 1px solid var(--line); }
.chat-filters::after { position: absolute; inset: auto auto 0 0; width: 25%; height: 2px; content: ""; pointer-events: none;
  background: var(--office-indicator); transform: translateX(var(--chat-tab-position,0%)); transition: transform .18s ease; }
.chat-filters:has([data-value="unread"][aria-pressed="true"]) { --chat-tab-position: 100%; }
.chat-filters:has([data-value="direct"][aria-pressed="true"]) { --chat-tab-position: 200%; }
.chat-filters:has([data-value="group"][aria-pressed="true"]) { --chat-tab-position: 300%; }
.chat-filters:not(:has([aria-pressed="true"]))::after { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .chat-filters::after { transition: none; } }
.chat-list,.chat-timeline,.chat-info { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.chat-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 65px;
  padding: 9px 13px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); border-inline-start: 3px solid transparent; }
.chat-search-messages h3 { margin: 12px 13px 4px; color: var(--office-muted); font-size: var(--office-list-text-size); }
.chat-row.chat-message-result { grid-template-columns: minmax(0, 1fr) auto; }
.chat-inbox-minimized .chat-message-result .chat-row-copy small { display: block; }

.chat-row-copy,.chat-row-meta { display: grid; gap: 2px; min-width: 0; }
.chat-row-copy>* { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row-copy strong { font-size: 14px; }
.chat-row small,.chat-heading small,.chat-form-status,.chat-byline time,.chat-byline>span,.chat-seen { font-size: 11px; color: var(--muted); }
.chat-row-meta { justify-items: end; }
.chat-row-meta b { border-radius: 99px; color: var(--office-on-button); background: var(--office-accent); font-size: 10px; padding: 2px 6px; }
.chat-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: var(--office-selected); color: var(--office-accent); font-size: 16px; font-weight: 800; }
.chat-kind-help { background: var(--warning-bg); color: var(--amber); }
.chat-kind-broadcast { background: var(--special-bg); color: var(--special-text); }
.chat-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface-subtle); border-radius: 0 16px 16px 0; }
.chat-header { justify-content: flex-start; background: var(--surface); border-bottom: 1px solid var(--line); border-radius: 0 16px 0 0; }
.chat-back { display: none; }
.chat-heading { min-width: 0; flex: 1 1 auto; }
.chat-heading h2 { font-size: 17px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pins { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; overflow-x: auto; padding: 6px 12px;
  background: var(--office-selected); color: var(--office-accent); font-size: 12px; }
.chat-pins .chat-button { min-height: 28px; }
.chat-timeline { flex: 1 1 auto; padding: 8px 16px 20px; }
.chat-welcome { display: grid; align-content: center; justify-items: center; gap: 8px; min-height: 100%; padding: 24px;
  color: var(--muted); text-align: center; }
.chat-welcome div { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--office-selected); color: var(--office-accent); font-size: 25px; }
.chat-welcome h2 { color: var(--ink); font-size: 22px; }
.chat-empty { padding: 19px; color: var(--muted); font-size: 13px; }
.chat-day { display: flex; align-items: center; gap: 8px; margin: 17px 0; color: var(--muted); font-size: 11px; }
.chat-day::before,.chat-day::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.chat-message { display: flex; margin: 8px 0 12px; }
.chat-message.mine { justify-content: end; }
.chat-message.highlight .chat-bubble { outline: 2px solid var(--office-accent); }
.chat-message-inner { width: fit-content; max-width: min(87%, 610px); min-width: 0; }
.chat-byline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; min-height: 28px; }
.mine .chat-byline { justify-content: end; }
.chat-bubble { display: grid; gap: 6px; min-width: 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 4px 13px 13px; overflow-wrap: anywhere; font-size: 14px; }
.mine .chat-bubble { background: var(--office-selected); border-radius: 13px 4px 13px 13px; }
.chat-message-text,.chat-ai-result,.chat-guide p { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-bubble blockquote { margin: 0; padding: 4px 7px; border-left: 2px solid var(--office-accent); color: var(--muted); font-size: 12px; }
.chat-attachment audio { display: block; width: min(260px, 100%); min-width: min(175px, 100%); max-width: 100%; }
.chat-attachment .chat-button,.chat-reactions .chat-button { min-height: 27px; }
.chat-attachment a,.chat-job-link { color: var(--office-accent); font-weight: 700; }
.chat-message-menu { position: relative; }
.chat-message-menu summary { cursor: pointer; list-style: none; color: var(--muted); border-radius: 6px; padding: 3px 6px; }
.chat-message-menu summary::-webkit-details-marker { display: none; }
.chat-message-menu[open] summary { color: var(--office-accent); background: var(--office-selected); }
.chat-message-menu>div { position: absolute; inset: calc(100% + 3px) auto auto 0; display: flex; flex-wrap: wrap; gap: 3px;
  width: min(202px, 55vw); z-index: 4; padding: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  box-shadow: 0 8px 18px #0002; }
.mine .chat-message-menu>div { inset: calc(100% + 3px) 0 auto auto; }
.chat-message-menu .chat-button { min-height: 28px; }
.chat-reactions { display: flex; gap: 4px; margin: 4px 0; }
.mine .chat-reactions { justify-content: end; }
.chat-seen { display: block; margin-top: 3px; text-align: right; }
.chat-compose { flex: 0 0 auto; border-top: 1px solid var(--line); background: var(--surface); padding: 9px 12px; border-radius: 0 0 16px 0; }
.chat-composer-tools { margin-top: 6px; }
.chat-composer-tools label { margin: 0; }
.chat-composer-tools .primary { margin-inline-start: auto; }
.chat-check { display: flex; align-items: center; gap: 5px; color: var(--ink); font-size: 12px; }
.chat-workspace .chat-check input { width: auto; min-width: 15px; accent-color: var(--office-accent); }
.chat-form-status { min-height: 15px; margin-top: 5px !important; }
.chat-read-only { padding: 7px; color: var(--muted); font-size: 13px; }
.chat-guide-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 8px 12px;
  border: 1px solid var(--office-border);
  border-radius: 12px;
  background: var(--office-panel);
  color: var(--office-muted);
  font-size: 13px;
}
.chat-guide-note p { flex: 1 1 185px; }
.chat-guide-note .chat-button {
  border-radius: var(--office-button-radius);
  color: var(--office-button);
  font-weight: 400;
}
[data-chat-reply],[data-chat-uploads] { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; font-size: 12px; }
[data-chat-uploads]>span,[data-chat-reply]>span { padding: 2px 6px; background: var(--office-selected); border-radius: 7px; overflow-wrap: anywhere; }
[data-chat-uploads]>span { display: flex; align-items: center; gap: 4px; min-inline-size: 0; max-inline-size: min(100%,300px); }
.chat-upload-name { min-inline-size: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-chat-uploads] .chat-button,[data-chat-reply] .chat-button { min-height: 23px; padding: 1px 4px; }
.chat-info { position: absolute; inset: 0 0 0 auto; width: min(100%, 290px); z-index: 6;
  padding: 0 12px 14px; border: 1px solid var(--line); border-radius: 12px; box-shadow: -12px 0 25px #0002; background: var(--surface); }
.chat-info-head { padding: 12px 0; }
.chat-info p { margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.chat-info h4 { margin-top: 16px; font-size: 13px; }
.chat-info ul { padding-left: 18px; margin-block: 6px; font-size: 13px; }
.chat-info li { padding: 3px 0; }
.chat-scheduled small { display: block; color: var(--muted); }
.chat-scheduled .chat-button { min-height: 25px; margin: 4px 3px 4px 0; }
.chat-dialog { width: min(480px,calc(100% - 24px)); max-height: 88dvh; padding: 0; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; }
.chat-dialog::backdrop { background: var(--office-overlay); }
.chat-dialog-head { border-bottom: 1px solid var(--line); }
.chat-dialog-body,.chat-dialog-actions,.chat-dialog [data-chat-dialog-status] { padding: 10px 17px; }
.chat-dialog-body { display: grid; gap: 10px; }
.chat-dialog-body label:not(.chat-check) { display: grid; gap: 4px; }
.chat-dialog-body .chat-check { margin-block: 4px; }
.chat-dialog-actions { display: flex; justify-content: end; }
.chat-people { max-height: 175px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.chat-new-types { display: grid; gap: 6px; }
.chat-new-types .chat-button { display: grid; justify-content: stretch; justify-items: start; text-align: start; padding: 9px; }
.chat-new-types small,.chat-guide small { color: var(--muted); }
.chat-guide { padding: 8px; border: 1px solid var(--line); border-radius: 9px; }
.chat-guide summary { cursor: pointer; }
.chat-guide p { margin-block: 9px; }
@media (max-width: 720px) {
  .chat-workspace { display: block; height: max(440px,calc(100dvh - 120px)); }
  .chat-inbox,.chat-main { height: 100%; border: 0; border-radius: 16px; }
  .chat-workspace:not(.chat-open) .chat-main,.chat-workspace.chat-open .chat-inbox { display: none; }
  .chat-back { display: inline-flex; }
  .chat-header { padding: 8px; gap: 6px; border-radius: 16px 16px 0 0; }
  .chat-header .chat-avatar { width: 29px; height: 29px; font-size: 12px; }
  .chat-heading h2 { font-size: 14px; }
  .chat-heading small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-header .chat-button { min-height: 38px; padding-inline: 6px; }
  .chat-message-inner { max-width: 91%; }
  .chat-compose { border-radius: 0 0 16px 16px; }
  .chat-workspace input:not([type="checkbox"],[type="file"]),.chat-workspace textarea,.chat-workspace select { font-size: 16px; }
  .chat-composer-tools .chat-button { min-height: 38px; }
  .field-chat-shell .chat-workspace { height: max(430px,calc(100dvh - 205px)); }
}
.field-nav a { position: relative; }
.field-nav .nav-count { position: absolute; top: 4px; inset-inline-start: 60%; }
[data-chat-unread][hidden] { display: none; }
.chat-mentions,[data-chat-mentions] { display: flex; flex-wrap: wrap; gap: 5px; font-size: 12px; }
.chat-mentions span,[data-chat-mentions] span { padding: 2px 5px; border-radius: 6px; background: var(--surface-subtle); }
.chat-mentions .mentioned { background: var(--warning-bg); color: var(--amber); font-weight: 700; }
.chat-poll fieldset { border: 1px solid var(--line); padding: 8px; border-radius: 8px; min-width: 0; }
.chat-poll label { margin: 4px 0; }
.chat-poll legend,.chat-poll small { color: var(--muted); font-size: 11px; }
.chat-poll .chat-button { margin: 5px 5px 0 0; min-height: 30px; }
.chat-workspace label.chat-check { display: flex; flex-direction: row; align-items: center; }
@media (min-width: 721px) {
  .field-chat-shell .chat-workspace { height: clamp(345px,calc(100dvh - 155px),980px); }
  .field-chat-shell:has(.notice) .chat-workspace { height: clamp(345px,calc(100dvh - 207px),980px); }
}
@media (max-width: 720px) {
  .field-chat-shell { padding-inline: 8px; }
  .chat-composer-tools { gap: 5px; }
  .chat-composer-tools .chat-button { padding-inline: 7px; }
}

/* Conversation surfaces and shared blue controls. */
.chat-workspace {
  --chat-inset: clamp(14px,1.45vw,22px);
  --chat-head: clamp(68px,6vw,86px);
  --chat-canvas: var(--office-bg);
  --chat-message-own: var(--office-selected);
  --chat-message-edge: var(--office-border);
  --chat-popover-shadow: var(--office-shadow);
}

.chat-search label { display: block; position: relative; }
.chat-search label svg { position: absolute; width: 18px; height: 18px; inset: 50% 10px auto auto;
  transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.chat-search input { padding-inline-end: 36px !important; }
.chat-search input::-webkit-search-cancel-button { margin-inline-end: 12px; }
.chat-filters .chat-button { border: 0; border-radius: 0; color: var(--ink); white-space: nowrap; }
.chat-filters .chat-button:enabled:is(:hover,[aria-pressed="true"]) { color: var(--office-button); background: transparent; }
.chat-filters .chat-button:focus-visible { outline-offset: -3px; }
.chat-row:hover { background: var(--office-hover); }
.chat-row[aria-current] { border-inline-start-color: var(--office-accent); }
.chat-row-meta b { background: var(--office-button); color: var(--office-on-button); }
.chat-main { background: var(--chat-canvas); }
.chat-avatar { position: relative; overflow: hidden; border-radius: 50%; isolation: isolate; background: var(--avatar-bg,#deedfe);
  color: var(--avatar-text,#245991); letter-spacing: .02em; }
.chat-avatar > span { display: grid; place-items: center; width: 100%; height: 100%; }
.chat-avatar svg,.chat-welcome svg { width: 52%; height: 52%; }
.chat-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
[data-tone="teal"] { --avatar-bg: #d9f0ed; --avatar-text: #21685f; }
[data-tone="green"] { --avatar-bg: #dcefe1; --avatar-text: #24603e; }
[data-tone="amber"] { --avatar-bg: #faead1; --avatar-text: #76531d; }
[data-tone="rose"] { --avatar-bg: #fbe4e9; --avatar-text: #973954; }
[data-tone="violet"] { --avatar-bg: #ece5fa; --avatar-text: #5e438c; }
[data-tone="slate"] { --avatar-bg: #e7edf4; --avatar-text: #415775; }
.chat-header .chat-avatar { width: 43px; height: 43px; }
.chat-member-avatar { width: 28px; height: 28px; font-size: 11px; }
.chat-message-avatar { width: 34px; height: 34px; font-size: 13px; margin-top: 25px; }
.chat-avatar-preview { width: 68px; height: 68px; font-size: 28px; }
.chat-workspace .chat-member-list { padding: 0; list-style: none; }
.chat-member-list li { display: flex; align-items: center; gap: 8px; }
.chat-welcome div { background: var(--office-hover); color: var(--office-accent); }
.chat-thread-search { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.chat-thread-search label { flex: 1; margin: 0; }
.chat-icon-button,.chat-send-button { width: 38px; height: 38px; padding: 0; border-radius: 50%; }
.chat-icon-button svg,.chat-send-button svg,.chat-back svg,.chat-composer-tools svg,.chat-menu-item > svg,[data-chat-delivery] svg {
  width: 18px; height: 18px; flex: 0 0 18px; }

.chat-timeline { padding-inline: clamp(10px,2.3vw,34px); }
.chat-message { gap: 9px; }
.chat-message-inner { max-width: min(82%,650px); }
.chat-bubble { padding: 9px 12px; border: 1px solid var(--chat-message-edge); border-radius: 4px 14px 14px; }
.mine .chat-bubble { background: var(--chat-message-own); border-radius: 14px 4px 14px 14px; }
.chat-bubble-meta { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; line-height: 1.2; }
.mine .chat-bubble-meta { justify-content: end; }
.chat-tick,.chat-inline-mention { color: var(--office-accent); }
.chat-tick { font-weight: 800; letter-spacing: -.18em; padding-right: .18em; }
.chat-inline-mention.mentioned { text-decoration: underline; }
.chat-quick-reactions { display: flex; width: 100%; flex-wrap: wrap; gap: 3px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.chat-quick-reactions .chat-button { min-width: 28px; min-height: 27px; height: auto; width: auto; padding: 2px 4px; border: 0; font-size: 16px; }
.chat-quick-reactions .chat-button svg { width: 15px; height: 15px; }
.chat-compose { background: var(--chat-canvas); border-top: 0; padding: 9px clamp(8px,1.5vw,22px) 12px; }
.chat-compose-pill { display: grid; grid-template-columns: 38px 38px minmax(0,1fr) 38px 42px;
  grid-template-areas: "input input input input input" "emoji attach tools clock send"; gap: 1px 3px; align-items: center;
  padding: 6px 8px; border: 1px solid var(--chat-message-edge); border-radius: 14px; background: var(--surface); }
.chat-compose-pill [data-chat-action="emoji"] { grid-area: emoji; }
.chat-compose-pill [data-chat-action="attachment-menu"] { grid-area: attach; }
.chat-compose-pill [data-chat-action="schedule"] { grid-area: clock; }
.chat-compose-input { grid-area: input; min-width: 0; margin: 0; }
.chat-workspace .chat-compose-input textarea { height: 40px; min-height: 39px; max-height: 120px; line-height: 1.4;
  border: 0; border-radius: 8px; padding: 10px 8px; resize: none; background: var(--surface); box-shadow: none; }
.chat-compose-input textarea:focus-visible { outline: 2px solid var(--office-accent); outline-offset: -2px; }
.chat-compose-pill .chat-icon-button,.chat-composer-tools .chat-button { border-color: transparent; color: var(--muted); }
.chat-compose-pill .chat-icon-button[aria-pressed="true"] { color: var(--office-accent); background: var(--office-hover); }
.chat-composer-tools { grid-area: tools; min-width: 0; gap: 3px 7px; margin: 0; }
.chat-composer-tools .chat-button { min-height: 32px; padding: 3px 6px; }
.chat-send-button { grid-area: send; justify-self: end; }

.chat-compose [data-chat-compose-status]:empty { display: none; }
[data-chat-delivery] { display: flex; align-items: center; gap: 7px; justify-content: space-between; margin-top: 6px;
  padding: 3px 7px 3px 9px; border-radius: 9px; background: var(--surface); color: var(--office-accent); font-size: 12px; }
[data-chat-delivery] span { display: flex; align-items: center; gap: 5px; }
[data-chat-delivery] .chat-button { min-height: 25px; padding: 1px 6px; }
.chat-popover { position: absolute; z-index: 10; width: min(270px,calc(100% - 16px)); max-height: min(370px,calc(100% - 16px));
  overflow: auto; padding: 7px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--chat-popover-shadow); }
.chat-popover[data-kind="emoji"] { width: min(350px,calc(100% - 16px)); }
.chat-popover[data-kind^="mention"] { width: min(310px,calc(100% - 16px)); }
.chat-menu-list,.chat-mention-menu { display: grid; gap: 2px; }
.chat-menu-list > strong,.chat-menu-list > small,.chat-mention-menu > strong,.chat-mention-menu > p { margin: 3px 8px; }
.chat-menu-list > small { color: var(--muted); }
.chat-button.chat-menu-item,.chat-popover .chat-new-types .chat-button { display: flex; justify-content: start; align-items: center; gap: 9px;
  width: 100%; min-width: 0; min-height: 38px; padding: 6px 8px; border: 0; text-align: start; color: var(--ink); }
.chat-menu-item small { margin-left: auto; color: var(--muted); }
.chat-inbox-layout-trigger svg:last-child { margin-inline-start: auto; }
.chat-inbox-layout {
  position: fixed; z-index: 1; display: grid; box-sizing: border-box; width: 157px; padding: 8px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--chat-popover-shadow);
}
.chat-inbox-layout-inline { position: static; width: auto; margin: 0 0 4px 14px; border-radius: 12px; box-shadow: none; }
.chat-inbox-layout .chat-inbox-layout-choice {
  justify-content: space-between; min-height: 36px; padding: 8px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink); font-size: 14px; font-weight: 400; line-height: 20px;
}
.chat-inbox-layout .chat-inbox-layout-choice:enabled[aria-pressed="true"] { background: transparent; color: var(--ink); }
.chat-inbox-layout .chat-inbox-layout-choice:enabled:hover { background: var(--office-hover); color: var(--ink); }
.chat-inbox-layout .chat-inbox-layout-choice:focus-visible { outline: 2px solid var(--office-focus); outline-offset: -2px; }
.chat-inbox-layout-choice svg { width: 16px; height: 16px; color: var(--office-button); }
.chat-popover .chat-new-types .chat-button > svg { width: 19px; height: 19px; flex: 0 0 19px; color: var(--office-accent); }
.chat-popover .chat-new-types .chat-button strong,.chat-popover .chat-new-types .chat-button small { display: block; }
.chat-emoji-head { position: sticky; z-index: 1; top: -7px; padding: 8px 5px 6px; background: var(--surface); }
.chat-emoji-head label { display: block; margin-top: 6px; }
.chat-emoji-scroll { max-height: 257px; overflow: auto; }
.chat-emoji-scroll h4 { color: var(--muted); font-size: 12px; margin: 4px 6px; }
.chat-emoji-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(34px,1fr)); padding: 0 3px 5px; }
.chat-emoji-grid .chat-button { border: 0; min-height: 36px; padding: 3px; font-size: 20px; line-height: 1; }
.chat-art-preview { display: flex; align-items: center; gap: 13px; }
.chat-art-preview p { font-size: 13px; color: var(--muted); }
.chat-art-controls { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 9px; }
@media (max-width: 720px) {
  .chat-header { min-height: 57px; padding-inline: 6px; gap: 5px; }
  .chat-header .chat-avatar { width: 33px; height: 33px; }
  .chat-header .chat-icon-button { min-height: 34px; width: 34px; height: 34px; padding: 0; }
  .chat-header .chat-back { padding-inline: 4px 6px; gap: 1px; min-height: 34px; }
  .chat-header .chat-back svg { width: 14px; height: 14px; flex-basis: 14px; }
  .chat-heading h2 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .chat-message-avatar { width: 29px; height: 29px; font-size: 11px; }
  .chat-compose-pill { grid-template-columns: 32px 32px minmax(0,1fr) 32px 38px;
    grid-template-areas: "emoji attach input clock send" "tools tools tools tools tools"; padding: 4px 5px; border-radius: 22px; }
  .chat-compose-pill .chat-icon-button { width: 32px; height: 36px; min-height: 36px; padding: 0; }
  .chat-compose-pill .chat-send-button { width: 36px; height: 36px; min-height: 36px; }
  .chat-workspace .chat-compose-input textarea { padding-inline: 3px; }
  .chat-composer-tools { padding-inline: 4px; }
  .chat-message-inner { max-width: 85%; }
  [data-chat-uploads] { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(115px,100%),1fr)); }
}
@media (max-width: 380px) {
  .chat-compose-pill { grid-template-areas: "input input input clock send" "emoji attach tools tools tools"; }
}

/* Keep both panes and their headers aligned across every conversation. */
.chat-workspace { border-radius: 19px; }
.chat-inbox-head,.chat-header {
  flex: 0 0 var(--chat-head); height: var(--chat-head); min-height: 0;
  padding: 0 var(--chat-inset); border-bottom: 1px solid var(--line);
}
.chat-inbox-head { gap: 6px; }
.chat-header { gap: clamp(8px,1vw,14px); border-radius: 0 19px 0 0; }
.chat-inbox-head .chat-new-button {
  min-inline-size: 77px;
  min-height: var(--office-button-height);
  gap: 0;
  padding: 10px;
  border: 0;
  border-radius: var(--office-button-radius);
  font-size: var(--office-button-font);
  font-weight: 400;
  line-height: 20px;
}
.chat-new-label { padding-inline: 4px; }
.chat-new-chevron { display: grid; place-items: center; flex: 0 0 20px; height: 20px; }
.chat-new-button svg { display: block; width: 16px; height: 16px; transition: transform .18s ease; }
.chat-new-button[aria-expanded="true"] svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .chat-new-button svg { transition: none; } }
.chat-tools { flex-wrap: nowrap; gap: clamp(4px,.65vw,10px); }
.chat-inbox-head .chat-icon-button,.chat-header .chat-icon-button,.chat-profile-button {
  width: 42px; height: 42px; border-radius: 50%;
}
:is(.chat-inbox-head .chat-icon-button,.chat-header .chat-icon-button,.chat-profile-button,.chat-back,
    .chat-support-quick .chat-button,.chat-channel-actions .chat-button,.chat-starred-state .chat-button,
    .chat-group-wizard-sheet [data-chat-group-back]):where(:not(.primary,:disabled)) {
  --chat-button-active-text: var(--office-button);
  color: var(--office-button);
  background: var(--office-panel);
  border-color: var(--office-border);
}
.chat-profile-button { width: auto; border-radius: var(--office-button-radius); padding-inline: 11px; font-size: var(--office-button-font); font-weight: 400; }
.chat-profile-button svg { width: 17px; height: 17px; }
.chat-heading h2 { font-size: clamp(17px,1.5vw,23px); letter-spacing: -.015em; }
.chat-heading small { font-size: 13px; }
.chat-header .chat-avatar { width: clamp(38px,3.3vw,49px); height: clamp(38px,3.3vw,49px); }
.chat-search { flex: 0 0 auto; margin: 15px var(--chat-inset) 10px; }
.chat-search label { margin: 0; }
.chat-workspace .chat-search input { height: 43px; border-radius: 10px; }
.chat-search label svg { width: 20px; height: 20px; right: 13px; color: var(--ink); }
.chat-filters { flex: 0 0 auto; margin-inline: var(--chat-inset); }
.chat-filters .chat-button { min-height: 36px; padding: 7px 2px; font-size: 14px; font-weight: 400; line-height: 20px; }
.chat-filters .chat-button[aria-pressed="true"] { font-weight: 700; }
.chat-filter-note { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 8px; margin: 7px var(--chat-inset) 0;
  color: var(--office-accent); font-size: 12px; font-weight: 700; }
.chat-filter-note .chat-button { min-height: 28px; }
.chat-list { flex: 1 1 auto; padding: 10px var(--chat-inset); }
.chat-row { min-height: 68px; padding: 10px clamp(5px,1vw,14px); border-inline-start: 0; gap: 11px; }
.chat-row[aria-current] { background: var(--office-selected); }
.chat-row-copy strong { font-size: 15px; font-weight: 650; }
.chat-row small { font-size: 12px; }
.chat-row .chat-avatar { width: 41px; height: 41px; }
.chat-tips-avatar { background: var(--surface); border: 2px solid var(--chat-message-edge); color: var(--office-accent); }
.chat-timeline { padding-inline: var(--chat-inset); }
.chat-message-wide .chat-message-inner { flex: 1 1 auto; max-width: 100%; }
.chat-message-wide.mine .chat-message-inner { flex: 0 1 86%; }
.chat-message-wide .chat-bubble-meta { justify-content: end; }
.chat-attachment-photo { display: grid; justify-items: start; gap: 4px; }
.chat-attachment-photo img { display: block; width: auto; height: auto; max-width: min(100%,360px); max-height: 280px; border-radius: 9px; }
.chat-info { top: var(--chat-head); border-radius: 13px 0 18px 13px; }
.chat-tips-open .chat-timeline { display: grid; align-content: start; gap: 9px; padding-block: 10px 20px; }
.chat-tip-card { display: grid; gap: 12px; padding: clamp(13px,1.25vw,21px); border: 1px solid var(--chat-message-edge);
  background: var(--surface); border-radius: 15px; box-shadow: 0 2px 5px #263e5210; font-size: 15px; }
.chat-tip-card h3 { font-size: 17px; line-height: 1.3; }
.chat-tip-card ol { margin: 0; padding-inline-start: 20px; }
.chat-tip-card li+li { margin-top: 10px; }
.chat-tip-illustration { display: flex; align-items: center; justify-content: center; gap: 10px; width: min(100%,267px);
  min-height: 105px; padding: 12px; border-radius: 12px; background: var(--office-hover); }
.chat-tip-illustration span { display: grid; place-items: center; width: 53px; height: 53px; border: 2px solid var(--chat-message-edge);
  border-radius: 50%; background: var(--surface); color: var(--office-accent); }
.chat-tip-illustration span:nth-child(2) { transform: translateY(-9px); }
.chat-tip-illustration span:nth-child(3) { transform: translateY(7px); }
.chat-tip-illustration svg { width: 23px; height: 23px; }
.chat-popover[data-kind="new"] { width: min(310px,calc(100% - 16px)); }
.chat-popover[data-kind="new"] .chat-menu-item,.chat-work-status .chat-menu-item { min-height: 42px; font-size: 14px; font-weight: 600; }
.chat-popover[data-kind="new"] hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin-block: 4px; }
.chat-work-trigger span { flex: 1; }
.chat-work-status { width: min(260px,calc(100% - 16px)); z-index: 11; }
.chat-status-heading { display: flex; justify-content: space-between; align-items: center; gap: 4px; padding-left: 8px; color: var(--muted); font-size: 13px; }
.chat-status-heading .chat-button { min-height: 30px; height: 30px; width: 30px; }
.chat-work-status .chat-button:disabled { cursor: default; }
.chat-format-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 0 6px; }
.chat-format-toolbar .chat-button { min-height: 32px; font-weight: 400; }
.chat-message-text :is(ol, ul) { margin: 3px 0; padding-inline-start: 23px; }
.chat-message-text a { color: var(--office-accent); text-decoration: underline; }
.chat-byline input[data-chat-select-message] { width: auto; margin: 0 4px; accent-color: var(--office-button); }
@media (max-width: 920px) {
  .chat-profile-button { width: 40px; height: 40px; padding: 0; }
  .chat-profile-button span { display: none; }
}
@media (max-width: 720px) {
  .chat-workspace { --chat-head: 59px; --chat-inset: 10px; }
  .chat-header { gap: 6px; border-radius: 19px 19px 0 0; }
  .chat-header .chat-icon-button { min-height: 35px; width: 35px; height: 35px; }
  .chat-header .chat-avatar { width: 34px; height: 34px; }
  .chat-heading h2 { font-size: 15px; }
  .chat-heading small { font-size: 11px; }
  .chat-list { padding-top: 4px; }
  .chat-search { margin-top: 11px; }
  .chat-message-wide.mine .chat-message-inner { flex-basis: 92%; }
}
.chat-support { position: fixed; z-index: 18; inset: 18px 19px auto auto; width: min(400px,calc(100vw - 38px)); height: min(800px,calc(100dvh - clamp(95px,22dvh,200px)));
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 22px;
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 54px #0c223835; }
.chat-support-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-support-header > div { flex: 1; min-width: 0; }
.chat-support-header h2 { font-size: 16px; }
.chat-support-header h2:focus { outline: none; }
.chat-support-header p,.chat-support-intro,.chat-support-message small { color: var(--muted); font-size: 12px; }
.chat-support-header .chat-icon-button { min-height: 32px; width: 32px; height: 32px; font-size: 19px; }
.chat-support-mark { display: grid; flex: 0 0 38px; place-items: center; height: 38px; border-radius: 50%; color: var(--office-accent); background: var(--office-hover); }
.chat-support-mark svg { width: 21px; height: 21px; }
.chat-support-body { flex: 1; min-height: 0; padding: 16px; overflow-y: auto; }
.chat-support-intro { text-align: center; padding-block: 6px 20px; }
.chat-support-message { max-width: 94%; margin-bottom: 12px; }
.chat-support-message p,.chat-support-offline { padding: 12px 14px; background: var(--surface-subtle); border-radius: 16px;
  font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-support-message small { display: block; margin: 4px 8px; }
.chat-support-user { margin-inline-start: auto; }
.chat-support-user p { background: var(--chat-message-own); }
.chat-support-offline { color: var(--muted); margin-block: 8px !important; }
.chat-support-footer { padding: 12px 16px 16px; }
.chat-support-quick { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.chat-support-quick .chat-button { border-radius: var(--office-button-radius); box-shadow: 0 3px 8px #1112; }
.chat-support-footer form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; padding-top: 12px; }
.chat-support-footer form label { grid-column: 1/-1; margin: 0; }
.chat-support-footer form p { font-size: 11px; color: var(--muted); }
.chat-support-footer form [data-chat-assistant-status] { grid-column: 1/-1; }
.chat-support-footer form [data-chat-assistant-status]:empty { display: none; }
@media (max-width: 720px) {
  .chat-support { inset: 10px 8px 22px; width: auto; height: auto; border-radius: 16px; }
  .field-mode .chat-support { bottom: calc(67px + env(safe-area-inset-bottom)); }
}
.chat-inbox-minimized .chat-row { min-height: 49px; padding-block: 6px; }
.chat-inbox-minimized .chat-row-copy small { display: none; }
.chat-inbox-minimized .chat-row .chat-avatar { width: 32px; height: 32px; }
.chat-media-list { display: grid; gap: 7px; }
.chat-media-list a { display: flex; align-items: center; min-width: 0; gap: 9px; padding: 7px; color: var(--office-accent);
  border: 1px solid var(--line); border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; }
.chat-media-list img,.chat-media-list svg { flex: 0 0 46px; width: 46px; height: 40px; object-fit: contain; border-radius: 5px; }
.chat-media-list small { display: block; color: var(--muted); }

.chat-workspace .chat-message-menu[open] summary { background: var(--office-hover); color: var(--office-accent); }
.chat-media-item { display: flex; align-items: center; gap: 6px; }
.chat-media-item>a:first-child { flex: 1 1 auto; }
.chat-media-item .chat-media-download { flex: 0 0 auto; align-self: stretch; padding-inline: 9px; }

.chat-settings-drawer {
  --chat-settings-close-fill: color-mix(in srgb, var(--office-text) 40%, transparent);
  --chat-settings-close-hover: var(--office-overlay);
  --chat-settings-muted: color-mix(in srgb, var(--office-text) 52%, transparent);
  --chat-settings-track: color-mix(in srgb, var(--office-text) 16%, transparent);
  position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
  overflow: hidden; border: 0; background: transparent; color: var(--ink);
}
:root[data-theme="dark"] .chat-settings-drawer {
  --chat-settings-close-fill: var(--office-overlay);
  --chat-settings-close-hover: var(--office-hover);
  --chat-settings-muted: var(--office-muted);
  --chat-settings-track: var(--office-outline);
}
.chat-settings-drawer[open] { display: grid; grid-template-rows: 64px minmax(0,1fr); }
.chat-settings-drawer::backdrop { background: var(--office-overlay); backdrop-filter: blur(3px); }
.chat-settings-close-row { display: grid; place-items: center; }
.chat-settings-close-row button { min-width: 64px; min-height: var(--office-button-height); padding: 10px; border: 0; border-radius: var(--office-button-radius);
  background: var(--chat-settings-close-fill); color: var(--office-on-button); font-size: var(--office-button-font); font-weight: 400; line-height: 20px; }
.chat-settings-close-row button:hover { background: var(--chat-settings-close-hover); }
.chat-settings-sheet {
  display: grid; grid-template-rows: 68px minmax(0,1fr) minmax(73px,auto);
  min-height: 0; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; overflow: hidden;
  animation: chat-settings-rise .21s ease-out both;
}
@keyframes chat-settings-rise { from { transform: translateY(35%); opacity: .55; } to { transform: translateY(0); opacity: 1; } }
.chat-settings-sheet>header { display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.chat-settings-sheet>header h2 { color: var(--chat-settings-muted); font-size: 14px; font-weight: 400; line-height: 20px; }
.chat-settings-body { display: grid; grid-template-columns: 200px minmax(0,1fr); min-height: 0; }
.chat-settings-nav { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 8px; border-right: 1px solid var(--line); }
.chat-settings-nav button { width: 100%; min-height: 36px; padding: 8px; color: var(--ink); background: transparent; border: 0;
  border-radius: 10px; text-align: start; font-size: 14px; font-weight: 400; line-height: 20px; }
.chat-settings-nav button:hover { background: var(--office-hover); }
.chat-settings-nav button[aria-pressed="true"] { background: var(--office-selected); }
.chat-settings-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.chat-settings-content { width: min(600px,calc(100% - 32px)); margin-inline: auto; padding-block: 32px 26px; }
.chat-settings-content h3 { font-size: 18px; font-weight: 700; line-height: 28px; }
.chat-settings-description { color: var(--chat-settings-muted); font-size: 14px; line-height: 20px; }
[data-chat-section-panel="general"] .chat-settings-description { margin: 2px 0 16px; }
.chat-setting-channels { display: grid; gap: 16px; }
.chat-setting-channel { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 16px;
  min-height: 82px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; }
.chat-setting-channel > label { min-width: 0; margin: 0; cursor: pointer; }
.chat-channel-actions { display: flex; align-items: center; gap: 8px; }
.chat-channel-actions .chat-button { min-height: var(--office-button-height); padding-inline: 14px; border-color: var(--office-border);
  border-radius: var(--office-button-radius); font-size: var(--office-button-font); font-weight: 400; line-height: 20px; }
.chat-setting-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--avatar-bg,#deedfe); color: var(--avatar-text,#245991); }
.chat-setting-mark svg { width: 21px; height: 21px; }
.chat-setting-label { display: grid; gap: 2px; }
.chat-setting-label strong { color: var(--ink); font-size: 14px; font-weight: 400; line-height: 20px; }
.chat-setting-channel .chat-setting-label strong { font-weight: 700; }
.chat-setting-label small { color: var(--chat-settings-muted); font-size: 14px; font-weight: 400; line-height: 20px; }
.chat-settings-drawer input.chat-setting-toggle { appearance: none; position: relative; flex: 0 0 auto; width: 40px; height: 24px;
  align-self: center; margin: 0; padding: 0; border: 0; border-radius: var(--office-button-radius); background: var(--chat-settings-track); cursor: pointer; }
.chat-settings-drawer input.chat-setting-toggle::before { position: absolute; inset: 3px auto auto 3px; content: ''; width: 18px; height: 18px;
  border-radius: 50%; background: var(--office-on-button); box-shadow: 0 1px 4px #1b2f4330; transition: transform .13s ease-out; }
.chat-settings-drawer input.chat-setting-toggle:checked { background: var(--office-button); }
.chat-settings-drawer input.chat-setting-toggle:disabled { opacity: .5; cursor: default; }
.chat-settings-drawer input.chat-setting-toggle:checked::before { transform: translateX(16px); }
.chat-settings-drawer input:focus-visible,.chat-settings-drawer button:focus-visible { outline: 2px solid var(--office-focus); outline-offset: 2px; }
.chat-setting-fieldset { min-width: 0; margin: 0; padding: 20px; border: 0; }
.chat-setting-fieldset + .chat-setting-fieldset { margin-top: 16px; }
.chat-setting-fieldset legend { float: left; margin-bottom: 16px; padding: 0; color: var(--ink); font-size: 15px; font-weight: 700; line-height: 20px; }
.chat-setting-box { clear: both; display: grid; gap: 16px; }
[data-chat-section-panel="notifications"] .chat-setting-fieldset legend { margin-bottom: 22px; line-height: 15px; }
[data-chat-section-panel="advanced"] { max-width: 496px; }
[data-chat-section-panel="advanced"] h3 { margin-bottom: 32px; }
[data-chat-section-panel="advanced"] .chat-setting-fieldset { padding: 0; border: 0; }
[data-chat-section-panel="advanced"] .chat-setting-fieldset + .chat-setting-fieldset { margin-top: 32px; padding-top: 32px; border-top: 1px solid var(--line); }
[data-chat-section-panel="advanced"] .chat-setting-fieldset legend { font-size: 14px; }
.chat-setting-row,.chat-setting-radio { display: flex; flex-direction: row; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 24px; margin: 0; font-size: 14px; font-weight: 400; line-height: 20px; }
.chat-setting-radio { justify-content: start; gap: 8px; min-height: 20px; color: var(--ink); }
.chat-settings-drawer :is(.chat-setting-radio input,.chat-settings-picker input[type="checkbox"],.chat-limit-check input) {
  flex: 0 0 auto; width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--office-button);
}
.chat-setting-exceptions { min-width: 0; margin: 0; padding: 0 0 0 20px; border: 0; }
.chat-setting-exceptions > * + * { margin-top: 16px; }
.chat-setting-exceptions:disabled .chat-settings-picker summary span:last-child { color: var(--office-muted); }
.chat-settings-picker { color: var(--ink); font-size: 14px; line-height: 20px; }
.chat-settings-picker summary { display: flex; justify-content: space-between; gap: 8px; cursor: pointer; }
.chat-settings-picker summary span:last-child { color: var(--office-accent); text-decoration: underline; text-underline-offset: 2px; text-align: end; }
.chat-settings-picker > input[type="search"] { margin-top: 8px; }
.chat-settings-picker>div { max-height: 125px; overflow: auto; margin-top: 8px; padding: 6px 9px; border-radius: 8px; background: var(--surface); }
.chat-settings-picker label { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; padding: 4px 0;
  color: var(--ink); font-size: 14px; font-weight: 400; }
.chat-setting-picker-empty { color: var(--chat-settings-muted); font-size: 14px; line-height: 20px; }
.chat-limit-check { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; margin: 0; }
.chat-settings-drawer .chat-limit-check input { margin-top: 2px; }
.chat-minute-row .chat-setting-label small { font-size: 12px; line-height: 16px; }
.chat-limit-duration { display: flex; flex: 0 0 auto; flex-direction: row; align-items: center; gap: 8px; margin: 0;
  color: var(--ink); font-size: 14px; font-weight: 400; line-height: 20px; }
.chat-settings-drawer .chat-minute-row select { width: 40px; height: 40px; flex: 0 0 auto; padding: 0 4px; line-height: 20px; }
.chat-settings-drawer .chat-minute-row select:disabled { background: var(--office-disabled-bg); color: var(--office-disabled-text); }
.chat-settings-sheet>footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 9px 16px; border-top: 1px solid var(--line); }
.chat-settings-sheet>footer p { margin-inline-end: auto; color: var(--chat-settings-muted); font-size: 13px; }
.chat-workspace .chat-settings-sheet>footer .primary { min-width: 117px; min-height: var(--office-button-height); padding-inline: 12px;
  border-radius: var(--office-button-radius); font-size: var(--office-button-font); font-weight: 400; line-height: 20px; }
.chat-ops-card>div { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.chat-ops-card time { color: var(--muted); font-size: 12px; }
@media (max-width: 650px) {
  .chat-settings-drawer[open] { grid-template-rows: 45px minmax(0,1fr); }
  .chat-settings-sheet { grid-template-rows: 50px minmax(0,1fr) minmax(58px,auto); border-radius: 15px 15px 0 0; }
  .chat-settings-body { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); }
  .chat-settings-nav { flex-direction: row; gap: 3px; padding: 4px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .chat-settings-nav button { width: auto; flex: 1 0 auto; padding-inline: 7px; text-align: center; font-size: 12px; }
  .chat-settings-content { width: calc(100% - 26px); padding-block: 19px; }
  .chat-setting-channel { padding: 11px; gap: 8px; }
  .chat-channel-actions { flex-direction: column; align-items: flex-end; }
  .chat-setting-mark { width: 32px; height: 32px; }
  .chat-setting-mark svg { width: 17px; height: 17px; }
  .chat-minute-row { flex-wrap: wrap; gap: 6px; }
  .chat-limit-duration { margin-inline-start: 24px; }
  .chat-settings-sheet>footer { padding-bottom: max(8px,env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .chat-settings-sheet { animation: none; }
}

.office-chat-shell .chat-workspace {
  --chat-secondary-copy: color-mix(in srgb, var(--office-text) 50%, transparent);
  --chat-placeholder: color-mix(in srgb, var(--office-text) 52%, transparent);
}
:root[data-theme="dark"] .office-chat-shell .chat-workspace {
  --chat-secondary-copy: var(--office-muted);
  --chat-placeholder: var(--office-muted);
}
.office-chat-shell .chat-row-copy strong { font-size: 15px; font-weight: 400; line-height: 22px; }
.office-chat-shell .chat-row :is(.chat-row-copy, .chat-row-meta) small {
  color: var(--chat-secondary-copy);
  font-size: 13px;
  font-weight: 400;
  line-height: 16px;
}
.office-chat-shell .chat-heading h2 { font-size: 18px; font-weight: 700; line-height: 26px; letter-spacing: normal; }
.office-chat-shell .chat-heading small { color: var(--chat-secondary-copy); font-size: 14px; line-height: 19px; }
.office-chat-shell .chat-welcome h2 { font-size: 16px; font-weight: 400; }
.office-chat-shell .chat-tip-card h3 { font-size: 16px; font-weight: 600; }
.office-chat-shell .chat-byline > strong { font-weight: 500; }
.office-chat-shell :is(.chat-day, .chat-bubble-meta, .chat-byline > span) { color: var(--chat-secondary-copy); }
.office-chat-shell .chat-workspace :is(input[type="search"], .chat-compose-input textarea) {
  font-weight: 400;
  line-height: 20px;
}
.office-chat-shell .chat-workspace :is(input[type="search"], .chat-compose-input textarea)::placeholder { color: var(--chat-placeholder); }
.office-chat-shell .chat-pins .chat-button,
.office-chat-shell .chat-composer-tools .chat-button,
.office-chat-shell .chat-popover .chat-menu-item { font-weight: 400; }
.office-chat-shell .topbar .assistant-open { font-weight: 400; }
@media (max-width: 720px) {
  .office-chat-shell .chat-heading h2 { font-size: 15px; font-weight: 600; line-height: 20px; }
  .office-chat-shell .chat-heading small { font-size: 12px; line-height: 16px; }
}

.join-card .actions { justify-content: center; }
.join-card [hidden] { display: none !important; }

:is(.office-sidebar-shell,.field-shell) .btn,
body:has(.office-sidebar-shell,.field-shell) :is(#modal,.today-editor) .btn {
  min-height: var(--office-button-height);
  border-radius: var(--office-button-radius);
  font-size: var(--office-button-font);
  font-weight: 400;
  line-height: 1.2;
  border-color: var(--office-border);
  background: var(--office-panel);
  color: var(--office-button);
}
:is(.office-sidebar-shell,.field-shell) .btn.small,
body:has(.office-sidebar-shell,.field-shell) :is(#modal,.today-editor) .btn.small { min-height: 32px; font-size: 12px; }
:is(.office-sidebar-shell,.field-shell) .btn:not(:disabled):hover,
body:has(.office-sidebar-shell,.field-shell) :is(#modal,.today-editor) .btn:not(:disabled):hover { background: var(--office-hover); }
:is(.office-sidebar-shell,.field-shell) .btn:is(.red,.dark,.primary):not(.danger,:disabled),
body:has(.office-sidebar-shell,.field-shell) :is(#modal,.today-editor) .btn:is(.red,.dark,.primary):not(.danger,:disabled) {
  background: var(--office-button);
  border-color: var(--office-button);
  color: var(--office-on-button);
}
:is(.office-sidebar-shell,.field-shell) .btn:is(.red,.dark,.primary):not(.danger,:disabled):hover,
body:has(.office-sidebar-shell,.field-shell) :is(#modal,.today-editor) .btn:is(.red,.dark,.primary):not(.danger,:disabled):hover {
  background: var(--office-button-hover);
  border-color: var(--office-button-hover);
}
:is(.office-sidebar-shell,.field-shell) .btn:disabled,
body:has(.office-sidebar-shell,.field-shell) :is(#modal,.today-editor) .btn:disabled {
  background: var(--office-disabled-bg);
  color: var(--office-disabled-text);
  border-color: var(--office-border);
  cursor: default;
}
:is(.office-sidebar-shell,.field-shell) .btn.danger:not(:disabled),
body:has(.office-sidebar-shell,.field-shell) #modal .btn.danger:not(:disabled) { color: var(--office-danger); }
:is(.office-sidebar-shell,.field-shell) .btn.danger:not(:disabled):hover,
body:has(.office-sidebar-shell,.field-shell) #modal .btn.danger:not(:disabled):hover { background: var(--office-danger-bg); }
.live-shell .pill-tabs button.active { background: var(--office-selected); color: var(--office-accent); }
.live-shell .pill-tabs button:not(.active):hover { background: var(--office-hover); }
.live-shell :is(.text-link,.drawer-body a:not(.btn)) { color: var(--office-accent); }
body:has(.live-shell) #modal::backdrop { background: var(--office-overlay); }
.today-editor::backdrop { background: var(--office-overlay); }
dialog.today-editor[open] {
  position: fixed;
  inset: 0;
  width: min(850px,calc(100% - 30px));
  max-width: none;
  height: fit-content;
  min-height: 0;
  max-height: 90dvh;
  margin: auto;
  border: 1px solid var(--office-border);
  border-radius: 16px;
  background: var(--office-panel);
  color: var(--office-text);
  box-shadow: var(--office-shadow);
  overflow: auto;
}
dialog.today-editor.people-dialog > form { height: auto; max-height: calc(90dvh - 2px); }
.today-editor .today-schedule-form { margin: 0; }
.today-editor .modal-actions { position: sticky; bottom: 0; flex-wrap: wrap; z-index: 1; }
.today-editor .modal-actions .workspace-message { flex-basis: 100%; margin: 0; }
.today-editor .modal-actions .workspace-message:empty { display: none; }
.today-metric-dialog .action-list :is(strong,small) { overflow-wrap: anywhere; }
.today-metric-dialog .modal-body > :first-child { margin-block-start: 0; }
.today-metric-dialog .modal-body > :last-child { margin-block-end: 0; }
.live-shell .notice.good { background: var(--office-success-bg); color: var(--office-success); }

/* Quotes and invoices */
.workspace-tabs.quotes-invoices-tabs {
  gap: 0 8px;
  padding-inline: 10px;
  border: 1px solid var(--office-border);
  border-radius: 13px;
  background: var(--office-panel);
}
.quotes-invoices-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 8px 12px;
  border: 0;
  border-block-end: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--office-text);
}
.quotes-invoices-tabs a:hover { color: var(--office-accent); background: var(--office-hover); }
.quotes-invoices-tabs a[aria-current="page"] {
  border-block-end-color: var(--office-indicator);
  background: transparent;
  color: var(--office-accent);
}
.invoice-toolbar { flex-wrap: wrap; padding: 14px 16px; gap: 12px 18px; }
.invoice-toolbar p { font-size: 13px; }
.invoice-toolbar .invoice-count { margin: 0; white-space: nowrap; }
.invoice-filters { display: flex; flex: 1 1 280px; flex-wrap: wrap; gap: 8px; }
.invoice-filters label { margin: 0; min-width: 0; }
.invoice-filters label:first-child { flex: 1 1 160px; max-width: 310px; }
.office-record-list .office-list-controls :is(input, select) {
  min-height: var(--office-button-height);
  border-color: var(--office-border);
  background: var(--office-panel);
  color: var(--office-text);
}
.office-record-list :is(th, td) { text-align: start; white-space: normal; }
.office-record-list tbody tr:hover { background: var(--office-hover); }
.office-record-list td :is(.minor, small) {
  display: block;
  margin-block-start: 4px;
  color: var(--office-muted);
}
.office-record-list td .badge {
  border-radius: var(--office-button-radius);
}
.office-record-list td:last-child { white-space: nowrap; }
.invoice-table :is(th, td) { padding: 12px 16px; }
.invoice-table :is(.invoice-reference, .invoice-job) { overflow-wrap: anywhere; }
.invoice-table .invoice-amount { white-space: nowrap; }
.invoice-table td:last-child { width: 1%; }
.invoice-empty { border-block-start: 1px solid var(--office-border); }

@media (max-width: 820px) {
  .invoice-table table, .invoice-table tbody { display: block; }
  .invoice-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .invoice-table tbody { display: grid; gap: 10px; padding: 0 12px 12px; }
  .invoice-table tbody tr:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--office-border);
    border-radius: 12px;
  }
  .invoice-table :is(.invoice-reference, .invoice-job, td:last-child) { grid-column: 1 / -1; }
  .invoice-table td { min-width: 0; padding: 0; border: 0; }
  .invoice-table td:last-child { width: auto; }
  .invoice-table .invoice-amount { white-space: normal; overflow-wrap: anywhere; }
  .invoice-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-block-end: 4px;
    color: var(--office-muted);
    font-size: var(--office-list-detail-size);
    font-weight: 400;
  }
}
@media (max-width: 760px) {
  .office-record-list .quote-table td[data-label]::before {
    font-size: var(--office-list-detail-size);
    font-weight: 400;
  }
}

