/* Market Office graphite/blue, adapted to Desk's existing controls and tables.
   Source: art_manager/app/market-appearance.css. Keep semantic status colors. */
:root {
  --md-primary: #2563eb;
  --md-on-primary: #fff;
  --md-primary-container: #e8f0fe;
  --md-on-primary-container: #204da5;
  --md-secondary-container: #dfe5ef;
  --md-on-secondary-container: #253243;
  --md-surface: #fff;
  --md-surface-container-low: color-mix(in srgb, var(--md-surface-container) 40%, var(--md-surface));
  --md-surface-container: #eef0f4;
  --md-surface-container-high: #d9dee6;
  --md-on-surface: #18202b;
  --md-on-surface-variant: #465160;
  --md-outline: #929cab;
  --md-outline-variant: #c4c9d1;
  --row-border: color-mix(in srgb, var(--md-outline-variant) 55%, var(--md-surface));
  --desk-selection-border: var(--md-primary);
  --desk-control-border: var(--md-outline);
  --desk-hover: color-mix(in srgb, var(--md-primary) 6%, var(--md-surface));
  --desk-primary-hover: color-mix(in srgb, var(--md-primary) 85%, #000);
  --desk-check: #f0f2f5;
  --desk-note-surface: var(--desk-check);
  --desk-note-input-surface: var(--md-surface);
  --desk-note-border: var(--md-outline-variant);
  --desk-note-input-border: var(--md-outline);
  --desk-note-text: var(--md-on-surface);
  --desk-chrome: #202630;
  --desk-nav: #2d3440;
  --desk-nav-hover: #414954;
  --desk-nav-active: var(--md-primary);
  --desk-nav-text: #e3e9f2;
  --desk-nav-muted: #bdc8d7;
  --desk-page: #e4e7ec;
  --desk-radius-action: 8px;
  --desk-radius-card: 9px;
  --desk-radius-dialog: 14px;
  --md-shadow: 0 16px 48px rgb(24 32 43 / 20%);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  background: var(--desk-page);
  font-synthesis: none;
}
.app-shell {
  --desk-work-surface: var(--md-surface);
  --desk-work-frame: var(--desk-page);
  --desk-work-muted: var(--md-surface-container);
  --desk-work-header: var(--md-surface-container);
  --desk-work-border: var(--md-outline-variant);
}
button, input, select, textarea { font-family: inherit; letter-spacing: normal; }
button, .row-action, .icon-button { border-radius: var(--desk-radius-action); }
button.primary:hover { background: var(--desk-primary-hover); box-shadow: none; }
.app-shell > .topbar { background: var(--desk-chrome); color: var(--desk-nav-text); border-color: var(--desk-nav-hover); }
.topbar :is(.brand, h1, .account, #logout) { color: var(--desk-nav-text); }
.topbar :is(.account-avatar, .count) { background: var(--desk-nav-hover); color: var(--desk-nav-text); }
.topbar #logout:hover { background: var(--desk-nav-hover); }
.topbar h1 { font-size: 18px; font-weight: 600; }
.topbar .brand { font-size: 19px; letter-spacing: 0; }
.app-shell > .sidebar { background: var(--desk-nav); border-color: var(--desk-nav-hover); }
.sidebar :is(.nav-heading, .sidebar-caption) { color: var(--desk-nav-muted); }
.sidebar .nav-group + .nav-group { border-color: var(--desk-nav-hover); }
.sidebar .nav button, .sidebar .sidebar-help { border-radius: 8px; color: var(--desk-nav-text); font-weight: 400; }
.sidebar .nav button .material-symbols-rounded { color: var(--desk-nav-muted); }
.sidebar .nav button:hover, .sidebar .sidebar-help:hover { background: var(--desk-nav-hover); }
.sidebar .nav button.active, .sidebar .sidebar-help.active { background: var(--md-primary); color: #fff; box-shadow: none; font-weight: 600; }
.sidebar .nav button.active .material-symbols-rounded { color: inherit; }
:is(.topbar, .sidebar) :is(button, a):focus-visible { outline: 2px solid var(--desk-nav-text); outline-offset: -3px; }
.app-shell .workspace { border-radius: var(--desk-radius-card); }
.workspace .toolbar { padding: 10px 12px; gap: 12px; }
.workspace .toolbar :is(input, select, .filter-toggle, .refresh) { min-height: 40px; height: 40px; }
.workspace .search-input > .material-symbols-rounded { top: 9px; }
.workspace .toolbar .filter-toggle { color: var(--md-on-surface); background: var(--md-surface); border-color: var(--md-outline); font-size:14px; font-weight:400; }
.workspace .toolbar .filter-toggle.has-filters,
.workspace .toolbar .filter-toggle[aria-expanded=true] { border-color:var(--md-primary); background:var(--md-primary-container); color:var(--md-on-primary-container); }
.workspace .work-views { gap: 8px; padding: 0 12px; min-height: 44px; }
.workspace .work-views button, .detail-nav button { position: relative; border-radius: 0; border: 0; min-height: 44px; box-shadow: none; }
.workspace .work-views button[aria-pressed=true], .detail-nav button[aria-selected=true] {
  background: var(--md-primary-container); color: var(--md-on-primary-container); border-color: transparent; box-shadow: inset 0 -3px var(--md-primary); font-weight: 600;
}
.detail-nav button[aria-selected=true]::after { content: none; }
.workspace .work-view-count { background: var(--desk-check); color: var(--md-on-surface-variant); }
.detail-nav > div { gap: 8px; padding-block: 0; }
#data-table td { color: var(--md-on-surface); }
#data-table > tbody > tr:hover > td { background: var(--desk-hover); }
#data-table > tbody > tr.selected > td, #data-table > tbody > tr.selected:hover > td { background: var(--md-primary-container); }
#data-table .row-action { background: var(--md-surface); color: var(--md-on-surface); border: 1px solid var(--md-outline-variant); font-weight: 500; }
#data-table .row-action:hover { background: var(--md-primary-container); border-color: var(--md-primary); color: var(--md-on-primary-container); }
#data-table .row-action[data-flow-selected]:disabled { background: var(--md-primary-container); color: var(--md-on-primary-container); border-color: var(--md-primary); opacity: 1; }
#data-table :is(.offer-meta, .offer-id, .offer-address, .table-team, .offer-facts dt) { color: var(--md-on-surface-variant); }
#data-table .row-link { color: var(--md-on-surface); }
#data-table .row-link:hover { color: var(--md-primary); }
#data-table :is(.text-button, .external-link) { color: var(--md-on-surface-variant); }
#data-table :is(.text-button, .external-link):hover { color: var(--md-primary); }
.badge, .filter-chip { border-radius: 5px; }
#data-table .badge.teal { background: var(--md-surface-container); color: var(--md-on-surface-variant); }
#data-table .badge.green { background: #eef6f2; color: #226449; }
#data-table .badge.red { background: #faf0ef; color: #963f39; }
#data-table .badge.contract-warning { background: #fff7e6; color: #805500; }
#data-table button.confirm-advertising { border: 1px solid var(--md-outline-variant); }
dialog:not(.fullscreen-gallery):not(.filter-drawer) { border-radius: var(--desk-radius-dialog); }
dialog :is(.detail-header, .drawer-footer, .form-footer), .filter-drawer-header, .filter-drawer-footer, .forwarding-footer { background: var(--md-surface-container); border-color: var(--md-outline-variant); }
dialog .detail-header h2 { font-size: 20px; font-weight: 600; }
.listing-dialog, .inquiry-dialog { --listing-detail-soft: var(--desk-check); --listing-detail-line: var(--md-outline-variant); }
.inquiry-input-section label { color: var(--md-on-surface-variant); }
.inquiry-property-section #chosen-listing:has(.inquiry-property-card) { background: var(--desk-check); border-color: var(--md-outline-variant); border-radius: 9px; }
#inquiry-selection, .selection-person { background: var(--md-primary-container); border-color: var(--md-outline-variant); border-radius: 9px; }
.forwarding-context { background: var(--desk-check); border-color: var(--md-outline-variant); }
.login { background: var(--desk-page); }
.login-card { border-radius: 14px; border: 1px solid var(--md-outline-variant); box-shadow: var(--md-shadow); }

/* The work zone remains fixed; only results and their final pagination scroll. */
.app-shell.desk-list-page { grid-template-rows: 64px minmax(0, 1fr); }
.desk-list-page .workspace { position: relative; }
.desk-list-page #table-wrap { overscroll-behavior: contain; scroll-padding-top: 44px; overflow-anchor: none; }
.desk-work-zone { flex:0 0 auto; position:relative; z-index:3; min-width:0; border-top:3px solid var(--md-primary); border-bottom:1px solid var(--md-outline); background:var(--md-surface-container); box-shadow:0 3px 8px rgb(24 32 43 / 10%); }
.workspace .desk-work-zone .toolbar { padding:12px 16px; background:var(--md-surface-container); border-bottom:0; }
.workspace .desk-work-zone .search { min-width:0; }
.workspace .desk-work-zone .search-label-line { margin-bottom:6px; }
.workspace .desk-work-zone .search .control-label { font-weight:600; color:var(--md-on-surface); }
.workspace .desk-work-zone .search input { height:46px; min-height:46px; border:1px solid color-mix(in srgb,var(--md-primary) 45%,var(--md-outline)); background:var(--md-surface); font-size:15px; box-shadow:0 1px 3px rgb(24 32 43 / 8%); }
.workspace .desk-work-zone .search-input > .material-symbols-rounded { top:12px; color:var(--md-primary); }
.workspace .desk-work-zone .search input:focus { outline:2px solid var(--md-primary); outline-offset:1px; }
.workspace .desk-work-zone .active-listing-filters { background:var(--md-surface-container); }
.workspace .desk-work-zone .work-views { border-top:1px solid var(--md-outline-variant); border-bottom:0; background:var(--md-surface-container); }
.desk-list-body { display: flex; flex-direction: column; min-height: 100%; min-width: 0; }
.desk-list-body > table { flex: none; }
.desk-list-body > .app-footer { flex: none; margin-top: auto; min-height: 60px; padding: 10px 12px; background: var(--md-surface-container); border-top: 1px solid var(--md-outline-variant); }
.desk-list-body > .app-footer .view-note { display: none; }
.desk-list-body > .app-footer .pagination { margin-inline: auto; }
@media (max-width: 760px) {
  .app-shell.desk-list-page { grid-template-rows: 64px 58px minmax(0, 1fr); }
  .desk-list-body > .app-footer .pagination { flex-wrap: wrap; justify-content: center; }
  .workspace .toolbar :is(input, select, .filter-toggle, .refresh) { min-height: 44px; height: 44px; }
  .workspace:is(.is-offers, .is-inquiries, .is-agents) .toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 10px; }
  .workspace .toolbar .search { grid-column: 1 / -1; width: 100%; }
  .workspace .toolbar .filters { grid-column: 1 / -1; order: 0; width: 100%; overflow: visible; }
  .workspace.is-listings .toolbar .filter-control { flex: 1; min-width: 0; }
  .workspace .toolbar .filter-toggle { grid-column: 1; }
  .workspace .toolbar .refresh { grid-column: 2; order: 0; width: 44px; }
  dialog :is(input, select, textarea) { font-size: 16px; }
}

/* Market Office palettes. Root scope also covers dynamically mounted dialogs. */
:root[data-desk-appearance=art] {
  --md-primary:#b32132; --md-primary-container:#f5e7e9; --md-on-primary-container:#8e1a28;
  --md-secondary-container:#e8dfe1; --md-on-secondary-container:#39282c;
  --desk-page:#d1d1d3; --md-surface-container:#e7e7e9; --md-surface-container-high:#dcdcdf;
  --md-on-surface:#191b20; --md-on-surface-variant:#484c54; --md-outline-variant:#c4c5c9;
  --desk-chrome:#242629; --desk-nav:#34373b; --desk-nav-hover:#484d53; --desk-check:#eeeeef;
}
:root[data-desk-appearance=petrol] {
  --md-primary:#92502b; --md-primary-container:#f1e8de; --md-on-primary-container:#7e4222;
  --md-secondary-container:#d5e1df; --md-on-secondary-container:#20424a;
  --md-surface:#fffefa; --desk-page:#c9d4d3; --md-surface-container:#e1e8e6; --md-surface-container-high:#d2dddc;
  --md-on-surface:#182c2f; --md-on-surface-variant:#425658; --md-outline-variant:#b8c7c6;
  --desk-chrome:#142e33; --desk-nav:#20424a; --desk-nav-hover:#315660; --desk-nav-active:#3c6570; --desk-check:#eaf0ed;
}
:root[data-desk-appearance=blue] {
  --md-primary:#295b90; --md-primary-container:#dbe6f3; --md-on-primary-container:#244f7e;
  --md-secondary-container:#d0dceb; --md-on-secondary-container:#253243;
  --md-surface:#fafbfd; --desk-page:#cbd3de; --md-surface-container:#dfe5ed; --md-surface-container-high:#d0d9e5;
  --md-on-surface:#1c293a; --md-on-surface-variant:#4b5c72; --md-outline-variant:#b9c7d8;
  --desk-chrome:#192839; --desk-nav:#2b3c51; --desk-nav-hover:#3a536f; --desk-check:#e8edf3;
}
/* Selected navigation follows the active Market Office palette: ART red,
   petrol teal, muted blue or graphite blue. */
:root[data-desk-appearance] .sidebar :is(.nav button.active,.sidebar-help.active) { background:var(--desk-nav-active); color:var(--md-on-primary); box-shadow:none; }
.workspace .work-views button:hover { background:var(--desk-hover); }
.forwarding-action.forwarding-pending:hover { background:var(--desk-primary-hover); }
.app-shell .table-wrap, .form-scroll, .filter-drawer-body { scrollbar-color:var(--md-outline) var(--md-surface-container); }
.sidebar .nav { min-height:0; overflow-y:auto; }
.sidebar .sidebar-help { flex-shrink:0; }
.sidebar .sidebar-caption { margin-top:0; }
.appearance-picker { display:flex; flex:0 0 auto; gap:8px; padding:8px 8px 0; }
.appearance-picker button { display:grid; place-items:center; flex:0 0 36px; width:36px; height:36px; min-height:36px; padding:5px; border:1px solid transparent; border-radius:6px; background:transparent; }
.appearance-picker button:hover { background:var(--desk-nav-hover); }
.appearance-picker button[aria-pressed=true] { border-color:var(--desk-nav-muted); }
.appearance-swatch { width:24px; height:24px; border:1px solid #ffffff80; border-radius:4px; }

/* Complete dialog/form bridge, not just the outer dialog frame. Preserve
   validation colors, gallery controls, switches and existing form behavior. */
:root dialog:not(.fullscreen-gallery) { background:var(--md-surface); color:var(--md-on-surface); border-radius:14px; }
:root dialog.filter-drawer { border-radius:14px 0 0 14px; border-left:0; }
:root dialog:not(.fullscreen-gallery) :is(h2,.detail-header h2) { font-size:20px; line-height:28px; font-weight:600; letter-spacing:0; }
:root dialog:not(.fullscreen-gallery) :is(.detail-header,.filter-drawer-header,header):not(.location-branch-heading) { background:var(--md-surface-container); border-color:var(--md-outline-variant); box-shadow:none; }
:root dialog:not(.fullscreen-gallery) :is(footer,.form-footer,.drawer-footer,.selection-footer,.forwarding-footer) { background:var(--md-surface-container); border-color:var(--md-outline-variant); }
:root dialog:not(.fullscreen-gallery) :where(button:not(.loc-property-pin):not(.loc-poi-pin):not(.preview-photo-stage)) { border-radius:8px; box-shadow:none; }
:root dialog:not(.fullscreen-gallery) :where(button:not(.primary):not(.danger):not(.text-button):not(.loc-property-pin):not(.loc-poi-pin):not([data-forward-yes])) { color:var(--md-on-surface); }
:root dialog:not(.fullscreen-gallery) :where(button:hover:not(:disabled):not(.primary):not(.danger):not(.loc-property-pin):not(.loc-poi-pin):not([data-forward-yes])) { background:var(--desk-hover); }
:root dialog .detail-nav button { border-radius:0; }
:root dialog .detail-nav button[aria-selected=true] { color:var(--md-on-primary-container); background:var(--md-primary-container); box-shadow:inset 0 -3px var(--md-primary); }
:root dialog:not(.fullscreen-gallery) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea) {
  background:var(--md-surface); color:var(--md-on-surface); border:1px solid var(--md-outline); border-radius:8px; font-size:14px; font-weight:400; box-shadow:none;
}
:root dialog:not(.fullscreen-gallery) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select) { min-height:40px; padding:8px 12px; }
:root dialog:not(.fullscreen-gallery) :is(input,select,textarea):focus { outline:2px solid var(--md-primary); outline-offset:-1px; border-color:var(--md-primary); }
:root dialog:not(.fullscreen-gallery) :is(input,select,textarea)[aria-invalid=true] { border-color:var(--md-error); }
:root dialog:not(.fullscreen-gallery) :is(input,select,textarea):is(:disabled,[readonly]) { background:var(--md-surface-container); color:var(--md-on-surface-variant); }
:root dialog :is(input[type=checkbox],input[type=radio]) { accent-color:var(--md-primary); }
:root dialog .inquiry-readonly-control input { padding-right:40px; }
:root dialog .eyebrow { color:var(--md-on-surface-variant); font-size:12px; }
:root dialog .section-title { color:var(--md-on-surface); font-size:16px; font-weight:600; }
:root dialog :is(.inquiry-input-section label,.form-grid>label,.agent-picker-search label) { color:var(--md-on-surface-variant); font-size:13px; }
:root dialog label:has([aria-invalid=true]) { color:var(--md-error); }
:root dialog :is(.listing-summary,.inquiry-contact-summary,.selection-compact,.selection-saved,.forwarding-context,.forwarding-preview,.inquiry-note,.inquiry-note-composer,.team-filter-section,.location-branch) {
  background:var(--desk-check); border-color:var(--md-outline-variant); border-radius:9px; box-shadow:none;
}
:root dialog .inquiry-contact-summary { background:var(--desk-check); }
:root dialog :is(.selection-new-item,.forwarding-composer) { background:var(--md-surface); border-color:var(--md-outline-variant); }
:root dialog :is(.selection-item-agent,.forwarding-message-preview,.forwarding-sent-context,.phone-context-info,.xml-progress-file) { background:var(--desk-check); border-color:var(--md-outline-variant); border-radius:9px; }
:root dialog .forwarding-sent-context > div { border-color:var(--md-outline-variant); }
:root dialog .selection-item-number { background:var(--md-primary-container); color:var(--md-on-primary-container); }
:root dialog :is(.forwarding-message-heading span,.forwarding-footer-status p,.audit-event small,.audit-event-body h3 small) { color:var(--md-on-surface-variant); }
:root dialog :is(.audit-event,.audit-diff th,.audit-diff td) { border-color:var(--md-outline-variant); }
:root dialog :is(.audit-event[open] summary,.audit-diff thead) { background:var(--desk-check); }
:root dialog .inquiry-property-card > .overview-identity > .offer-facts { border-color:var(--md-outline-variant); }
:root dialog :is(.agent-picker-option,.contact-choice,.checks label)[aria-pressed=true],
:root dialog :is(.contact-choice,.checks label):has(input:checked) { background:var(--md-primary-container); border-color:var(--md-primary); }

/* Market's continuous filter list: no card borders or large tinted tiles. */
:root .filter-drawer-header { min-height:74px; padding:12px 16px; background:var(--md-surface); }
:root .filter-drawer-header h2 { font-size:22px; line-height:28px; font-weight:500; }
:root .filter-drawer-body, :root .filter-option-search { background:var(--md-surface); }
:root .filter-menu { padding:8px 14px 16px; }
:root .filter-drawer .filter-menu-row { min-height:56px; height:auto; margin:0; padding:8px 10px; gap:14px; border:0; border-radius:6px; background:transparent; text-align:left; }
:root .filter-drawer .filter-menu-row + .filter-menu-row { margin-top:0; }
:root .filter-drawer .filter-menu-row:hover { background:var(--desk-hover); }
:root .filter-drawer .filter-menu-row.is-set { background:transparent; color:var(--md-on-surface); }
:root .filter-drawer .filter-menu-row.is-set:hover { background:var(--desk-hover); }
:root .filter-drawer .filter-menu-row strong { font-size:15px; line-height:20px; font-weight:400; }
:root .filter-drawer .filter-menu-row small { font-size:12px; line-height:16px; margin-top:0; color:var(--md-on-surface-variant); }
:root .filter-drawer .filter-menu-row.is-set :is(.filter-menu-icon,small) { color:var(--md-primary); }
:root .filter-drawer .filter-menu-row > .material-symbols-rounded { font-size:20px; }
:root .filter-drawer .filter-choice { min-height:44px; border:0; border-radius:5px; padding:8px 12px; font-size:14px; }
:root .filter-drawer .filter-choice:has(input:checked) { background:var(--md-secondary-container); color:var(--md-on-secondary-container); box-shadow:none; }
:root .filter-drawer .filter-choice:hover { background:var(--desk-hover); }
:root .filter-drawer .filter-choice:focus-within { outline:2px solid var(--md-primary); outline-offset:-2px; }
:root .filter-drawer .filter-choice input { width:20px; height:20px; min-height:20px; flex-basis:20px; }
:root .filter-drawer :is(.filter-choice-page,.filter-range-page,.feature-filter-page,.location-filter-page,.team-filter-page) { padding:16px; }
:root .filter-drawer .filter-drawer-footer { padding:16px; background:var(--md-surface); }
:root .filter-drawer .filter-drawer-footer button { display:flex; align-items:center; justify-content:center; gap:8px; min-height:48px; border-radius:8px; }
:root .filter-drawer .filter-drawer-footer button .filter-svg-icon { width:18px; height:18px; }
:root .filter-drawer .team-agent { min-height:58px; border:1px solid var(--md-outline-variant); border-radius:8px; }
:root .filter-drawer .location-branch-locations { border-radius:0; }
@media (pointer:coarse) {
  :root dialog:not(.fullscreen-gallery) :is(button,input:not([type=checkbox]):not([type=radio]):not([type=range]),select) { min-height:44px; }
}
@media (max-width:760px) {
  .app-shell { grid-template-rows:64px 102px minmax(0,1fr) 52px; }
  .app-shell.desk-list-page { grid-template-rows:64px 102px minmax(0,1fr); }
  .sidebar:has(.sidebar-help) { flex-wrap:wrap; align-content:start; row-gap:0; }
  .sidebar .nav { overflow-x:auto; overflow-y:hidden; }
  .appearance-picker { flex-basis:100%; justify-content:flex-end; padding:0; }
  :root dialog.filter-drawer { border-radius:0; }
  :root dialog:not(.fullscreen-gallery) :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { font-size:16px; }
}
