/* Delegate interface typography. Load after component styles.
   Only weight is enforced here: existing sizes and spacing remain component-owned.
   These semantic rules intentionally outrank legacy component weights. Authored
   rich text and physical document fields keep their own formatting. */
body {
  font-family: var(--font-ui);
  font-weight: var(--font-regular);
}
body :is(button, input, select, textarea) { font-family: var(--font-ui); }
body :is(strong, b):not(:where(.document-field *, .de-page *, .sign-page *,
  [contenteditable] *, .standard-rich-content *, .inbox-message-body *)) {
  font-weight: var(--font-semibold);
}

/* Regular: copy, values and supporting text. */
body :is(p, small, td, dd, input, select, textarea, .record-link, .person-value,
  .field-hint, .field-help-caption, .standard-field-help, .muted,
  .section-description, .panel-description, .delegate-panel-description,
  .record-reference, .record-updates-label, .record-audit-metadata,
  .dash-subtitle, .dash-caption, .dash-gauge-label, .dash-ring-label,
  .dash-manager-label, .dash-legend-label, .dash-attention-record,
  .table-empty-description, .inbox-excerpt, .row-email, .row-muted
):not(:where(.document-field *, .de-page *, .sign-page *,
  [contenteditable] *, .standard-rich-content *, .inbox-message-body *)) {
  font-weight: var(--font-regular) !important;
}
/* Table names and links are data too; buttons and badges are handled below. */
body :is(.staff-table, .dash-table) tbody td > :is(a, strong, b),
body :is(.staff-table, .dash-table) .person-value > span {
  font-weight: var(--font-regular) !important;
}

/* Medium: controls, navigation, field names and state labels. */
body :is(button, [role="button"], .button, .small-button, .text-button,
  label, legend, .field-label, .record-summary dt,
  .nav-item, .nav-child, .nav-label, .account-name, .breadcrumbs,
  [role="tab"], .delegate-tab, .as-nav-item, .as-nav-item strong,
  .pt-nav-item, .pt-desktop-nav a,
  .badge, .ap-badge, .mt-badge, .pl-badge, .tr-badge, .doc-status,
  .request-status-badge, .development-status, .pw-status, .dash-status,
  .dash-tab-count, .dash-attention-due, .lead-status-select, .as-logo-fallback
):not(:where(.document-field, .document-field *, .de-page *, .sign-page *,
  [contenteditable] *, .standard-rich-content *, .inbox-message-body *)) {
  font-weight: var(--font-medium) !important;
}
body :is(.tenancy-field, .form-field, .mt-field, .mt-picker, .ins-field,
  .doc-control, .collab-field, .dash-field, .tr-field, .pl-field,
  .de-control, .pg-field) > span:first-child {
  font-weight: var(--font-medium) !important;
}
body input::file-selector-button { font: inherit; font-weight: var(--font-medium); }

/* Semibold: headings, card titles and headline figures. */
body :is(h1, h2, h3, h4, h5, h6, th, th .sort-button,
  .panel-title, .delegate-panel-title, .form-section-title,
  .record-overview-title, .record-overview > summary,
  .mt-summary-card.summary-card > strong, .mt-summary-card.summary-card > span,
  .card-title, .pm-comparable-copy strong, .dash-total-label, .dash-total-copy strong,
  .dash-gauge-value, .dash-ring-total, .dash-coverage-number,
  .dash-mini-metric strong, .dash-legend-value, .dash-manager-count,
  .dash-manager-segment, .dash-bar-segment, .dash-bar-total,
  .dash-age-row strong, .dash-stage-row strong
):not(:where(.document-field *, .de-page *, .sign-page *,
  [contenteditable] *, .standard-rich-content *, .inbox-message-body *)) {
  font-weight: var(--font-semibold) !important;
}

/* The shared overview surface includes the sticky/mobile title. */
body :is(.record-overview, .record-overview > summary, .record-overview-title) {
  background-color: var(--delegate-canvas);
}
body[data-page="workspace"] .record-layout > .record-overview,
body[data-page="workspace"] .record-layout > .record-overview > :is(summary, .record-overview-title),
body.pt-app .record-layout > .record-overview {
  background: var(--delegate-canvas);
}

/* One quiet surface for overview panels, table headings and editing chrome. */
body[data-page="workspace"] :is(.staff-table,.tenancy-table,.inbox-register,.dash-table) thead th,
body[data-page="workspace"] .record-updates .collab-composer,
body[data-page="workspace"] .record-shared-panel .collab-composer,
body[data-page="workspace"] :is(.standard-rich-toolbar,.lead-rich-toolbar,.inbox-rich-tools),
body[data-page="workspace"] .inbox-email:not([open]) > .inbox-email-summary {
  background: var(--surface-subtle) !important;
}
body[data-page="workspace"] :is(.staff-table,.tenancy-table,.inbox-register,.dash-table) :is(a, .record-link, .text-button):is(:link,:visited,:hover,:focus,:active),
body[data-page="workspace"] :is(.staff-table,.tenancy-table,.inbox-register,.dash-table) :is(a,.record-link,.text-button) {
  text-decoration: none !important;
}

/* Profile access lives beside settings and notifications for every workspace. */
.topbar-profile { display:inline-flex; align-items:center; justify-content:center; flex:none; width:34px; height:34px; border-radius:50%; color:var(--delegate-ink); text-decoration:none; }
.topbar-profile .avatar { position:relative; display:grid; place-items:center; overflow:hidden; width:30px; height:30px; border-radius:50%; background:#edf1f0; font-size:11px; font-weight:500; }
.topbar-profile .avatar img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.topbar-profile:hover { background:var(--surface-subtle); }
.topbar-profile:focus-visible { outline:2px solid var(--delegate-ink); outline-offset:3px; }
.admin-settings-workspace { min-width:0; }
.admin-settings-workspace .page-heading { margin-bottom:24px; }
.admin-settings-account { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-top:24px; padding-top:24px; border-top:1px solid var(--line,#e3e3e3); }
.admin-settings-account h2 { font-size:15px; margin:0 0 5px; }
.admin-settings-account p { margin:0; }
@media(max-width:760px) {
  .topbar-profile { width:40px; height:40px; }
  .topbar-actions { gap:4px; }
  .topbar .universal-search { flex:1; min-width:40px; width:auto; }
  .topbar .topbar-actions { flex:1; max-width:none; }
  .topbar .topbar-left .agency-picker { max-width:120px; }
  .topbar .topbar-left { gap:4px; }
  .topbar .universal-search-results { top:64px; }
  .admin-settings-account { flex-wrap:wrap; }
}
@media(max-width:480px) {
  .topbar { padding-inline:10px; gap:4px; }
  .topbar .topbar-left .agency-picker { max-width:100px; }
  .topbar .universal-search:not(:focus-within) input::placeholder { color:transparent; }
  .topbar:has(.universal-search:focus-within) .agency-picker { display:none; }
}

/* Shared compact view switches, with the selected view visibly darker. */
body[data-page="workspace"] .workspace-layout .table-toolbar :is(.property-view-toggle,.development-view-switch){display:inline-flex;align-items:center;flex-shrink:0;height:32px;min-height:32px;box-sizing:border-box;gap:3px;padding:3px;border:1px solid #e0e5e3;border-radius:7px;background:var(--surface-subtle,#f5f5f5)}
body[data-page="workspace"] .workspace-layout .table-toolbar :is(.property-view-toggle,.development-view-switch)>.small-button{display:inline-flex;align-items:center;justify-content:center;height:24px;min-height:24px;box-sizing:border-box;padding:0 10px;gap:5px;border:0;border-radius:4px;background:transparent;color:#64716f;box-shadow:none;line-height:1}
body[data-page="workspace"] .workspace-layout .table-toolbar :is(.property-view-toggle,.development-view-switch)>.small-button[aria-pressed="true"]{background:#dce3e1;color:#0d2829;box-shadow:0 1px 2px #0d28290c}
.property-view-controls{display:flex;align-items:center;gap:10px;flex-shrink:0}.property-view-controls.is-table{padding-right:200px}
body[data-page="workspace"] .property-view-controls .property-card-sort{width:190px;height:32px;min-height:32px;font-size:11px;padding-block:4px}
body[data-page="workspace"] .workspace-main:has(.staff-table-footer){padding-bottom:8px}
@media(max-width:760px){.property-view-controls{flex-wrap:wrap}.property-view-controls.is-table{padding-right:0}body[data-page="workspace"] .workspace-layout .table-toolbar :is(.property-view-toggle,.development-view-switch){height:38px;min-height:38px}body[data-page="workspace"] .workspace-layout .table-toolbar :is(.property-view-toggle,.development-view-switch)>.small-button{height:30px;min-height:30px}}

body[data-page="workspace"] table.staff-table tr:is(.staff-selected,.bulk-selected)>td{background:var(--surface-subtle,#f5f5f5)!important}

/* Compact record help and editor chrome without shifting the field baseline. */
body[data-page="workspace"] :is(.field-help-caption,.tenancy-field-label-row){min-height:0;line-height:1.45;gap:4px;margin-bottom:4px}
body[data-page="workspace"] .field-tooltip-trigger{width:14px;height:14px;min-width:14px;min-height:14px;flex-basis:14px;font-size:9px;line-height:1;align-self:center;position:relative}
body[data-page="workspace"] .field-tooltip-trigger::after{content:"";position:absolute;inset:-5px}
body[data-page="workspace"] .standard-field-help{padding:7px 9px;border-radius:6px;font-size:10.5px;line-height:1.5}
body[data-page="workspace"] .standard-rich-toolbar{gap:2px;padding:3px 5px}
body[data-page="workspace"] .standard-rich-toolbar .standard-rich-tool{flex-basis:26px;width:26px;height:26px;min-height:26px;padding:5px}
body[data-page="workspace"] .standard-rich-tool svg{width:15px;height:15px}
body[data-page="workspace"] .standard-rich-letter{font-size:13px}
.workspace-group-heading{margin-bottom:12px!important}
.workspace-group-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px}
.workspace-group-tabs{margin-bottom:18px;flex-shrink:0;overflow-x:auto}
.workspace-group-tabs a{white-space:nowrap}
.workspace-main .workspace-source-heading{display:none!important}
@media(pointer:coarse){body[data-page="workspace"] .standard-rich-toolbar .standard-rich-tool{flex-basis:36px;width:36px;height:36px;min-height:36px}body[data-page="workspace"] .field-tooltip-trigger::after{inset:-8px}}
@media(max-width:600px){.workspace-group-heading{flex-wrap:wrap}.workspace-group-actions{justify-content:flex-start;max-width:100%}}

/* Property categories and related registers share one navigation row. */
.workspace-group-tabs [hidden]{display:none}
