/* Classic finish: DAT One-inspired flat controls and quiet separators, using EMR theme tokens.
   Column order/width/font preferences and the draggable searches splitter remain authoritative. */
#bb-pane-datsearch.ds-host:not(.ds-new) {
  --mb-muted: var(--text2);
  --mb-line: var(--emr-border);
  --mb-focus: var(--ink-info);
}
#bb-pane-datsearch.ds-host:not(.ds-new) :is(.ds-toolbar, .ds-results-hdr) {
  background: var(--emr-bg);
  border-bottom-color: var(--mb-line);
}
#bb-pane-datsearch.ds-host:not(.ds-new) :is(.ds-btn, .ds-more-btn, .ds-hdr-tgl, .ds-kbd-btn) {
  border-color: var(--mb-line);
  border-radius: 4px !important;
  box-shadow: none;
  text-decoration: none;
  transition: background-color .12s ease, border-color .12s ease;
}
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-btn.primary { border-color: var(--emr-gold); }
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-btn:not(:disabled):hover { border-color: var(--emr-border-strong); }
#bb-pane-datsearch.ds-host:not(.ds-new) :is(button, a, input, select):focus-visible {
  outline: 2px solid var(--mb-focus);
  outline-offset: 2px;
}
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-btn:disabled { cursor: not-allowed; opacity: .6; }
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-refresh-3d {
  background: var(--emr-bg-subtle);
  color: var(--emr-text);
  border-color: var(--mb-line);
  box-shadow: none;
  transform: none;
  filter: none;
}
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-refresh-3d:hover { background: var(--emr-bg-muted); }
#bb-pane-datsearch.ds-host:not(.ds-new) :is(.ds-scope-seg, .ds-layout-seg) {
  border-color: var(--mb-line);
  border-radius: 4px !important;
}
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-scope-seg button {
  font-weight: 600;
  letter-spacing: 0;
}
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-poll-cycle {
  background: var(--emr-bg-muted);
  color: var(--mb-muted);
  border-radius: 3px !important;
}
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-simon-strip { gap: 3px !important; }
#bb-pane-datsearch.ds-host:not(.ds-new) :is(.ds-simon-strip-count, .ds-simon-strip-toggle, .ds-simon-strip-gear, .ds-simon-strip-open) {
  height: 20px;
  box-sizing: border-box;
  border-radius: 4px !important;
  font-weight: 600 !important;
}
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-simon-strip-count[aria-pressed="false"] {
  border-color: var(--emr-border) !important;
}
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-simon-strip-count[data-simon-count="0"][aria-pressed="false"] {
  background: transparent !important;
  color: var(--mb-muted) !important;
}
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-simon-strip-n { font-variant-numeric: tabular-nums; }
html:root #panel-brokerage #bb-pane-datsearch.ds-host:not(.ds-new) :is(table.ds-strip, table.ds-grid) thead th:not(.ds-th-drop-before):not(.ds-th-drop-after) {
  background: var(--emr-bg-subtle);
  color: var(--mb-muted);
  border-bottom: 1px solid var(--mb-line);
  box-shadow: none;
  font-weight: 600;
  letter-spacing: .025em;
}
html:root #panel-brokerage #bb-pane-datsearch.ds-host:not(.ds-new) .ds-strip-wrap { border-bottom-color: var(--mb-line); }
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-strip-divider { background: var(--emr-bg-muted); border-block: 1px solid var(--mb-line); box-sizing: border-box; }
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-strip-divider:is(:hover, :active) { background: var(--emr-gold); }
#bb-pane-datsearch.ds-host:not(.ds-new) table.ds-grid tbody tr[data-mid] > td { border-bottom-color: var(--mb-line); }
/* Seen still has a quieter age marker. Prices, warning colours and actions stay fully legible. */
#bb-pane-datsearch.ds-host:not(.ds-new) tr.ds-seen:not(.pulled):not(.ds-detail) td { opacity: 1; }
#bb-pane-datsearch.ds-host:not(.ds-new) tr.ds-seen:not(.pulled) td[data-col="age"] { color: var(--mb-muted); }
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-company-link { text-decoration: none; }
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-company-link:hover { color: var(--ink-info); text-decoration: underline; text-underline-offset: 2px; }
#bb-pane-datsearch.ds-host:not(.ds-new) :is(.ds-simon-says, .ds-simon-detail, .ds-simon-unknown, .ds-simon-detail-line) { color: var(--mb-muted); }
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-simon-primary { color: var(--emr-text); }
/* Unassessed rows use the same two lines as assessed rows; the old fallback stacked three. */
#bb-pane-datsearch.ds-host:not(.ds-new) :is(.ds-simon-row-l1, .ds-simon-row-l2) {
  min-width: 0;
  line-height: 12px;
  margin: 0;
}
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-simon-row-l1 .ds-simon-says { line-height: 12px; margin-top: 0; }
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-simon-row-l2 { gap: 5px; }
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-simon-money { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-simon-step-chip {
  padding: 0 4px !important;
  height: 16px;
  min-height: 0;
  border-radius: 3px !important;
}
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-simon-step-chip > .ds-simon-stage { border: 0 !important; background: transparent !important; }
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-simon-work-btn {
  height: 16px !important;
  line-height: 14px !important;
  margin-left: 0 !important;
  border-radius: 3px !important;
}
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-simon-row-l2 .ds-simon-detail-line { overflow: hidden; text-overflow: ellipsis; }
#bb-pane-datsearch.ds-host:not(.ds-new) .ds-reload-grade {
  height: 20px;
  min-width: 22px;
  font-size: 11px;
  border-radius: 3px !important;
}
.ds-host .ds-module-link { flex-shrink: 0; white-space: nowrap; text-decoration: none; }
/* Icon-only Open in new tab (Ed #1433): a small square the height of its neighbours, the glyph centred. */
.ds-host .ds-module-link.ds-icon-only { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 24px; height: 24px; padding: 0; line-height: 1; }
.ds-host .ds-module-link.ds-icon-only .emr-ic { width: 14px; height: 14px; }
/* Preserve every setting and menu action; give their existing surfaces a consistent finish. */
@container dshdr (max-width: 2239.98px) {
  #bb-pane-datsearch.ds-host:not(.ds-new) .ds-toolbar-collapsible {
    background: var(--emr-bg);
    border-color: var(--mb-line);
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgb(0 0 0 / .16);
    padding: 10px;
    gap: 5px;
  }
  #bb-pane-datsearch.ds-host:not(.ds-new) .ds-toolbar-collapsible > .ds-btn {
    justify-content: flex-start;
    text-align: left;
    padding-inline: 9px !important;
  }
}
html:root .ds-view-menu.ds-view-classic {
  border-color: var(--emr-border);
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgb(0 0 0 / .16);
  padding: 12px;
}
.ds-view-classic :is(select, .ds-view-move button, .ds-btn) { border-color: var(--emr-border); border-radius: 4px !important; }
.ds-view-classic .ds-view-tabs { border-bottom: 1px solid var(--emr-border); }
.ds-view-classic .ds-view-row { min-height: 27px; }
.ds-view-classic .ds-view-sec { margin-top: 12px; font-weight: 600; letter-spacing: .04em; }
.ds-view-classic :is(button, select, input):focus-visible { outline: 2px solid var(--ink-info); outline-offset: 2px; }
#bb-pane-datsearch.ds-host:not(.ds-new) :is(.ds-btn, .ds-simon-strip) .emr-ic { width: 13px; height: 13px; vertical-align: -2px; }
#bb-pane-datsearch.ds-host:not(.ds-new) :is(.ds-detail-band > *, .ds-detail-comments) { border-color: var(--mb-line); }
/* Activated only after normal authentication, and only while the Masterboard panel is visible.
   Navigating to another module restores the full portal; login/expiry never inherit this layout. */
body.emr-masterboard-standalone :is(#emr-sidebar, #emr-tabbar, #emr-nav-drawer, #app-sidebar),
body.emr-masterboard-standalone #main-app > .topnav,
body.emr-masterboard-standalone #panel-brokerage > .bb-module-tabs { display: none !important; }
body.emr-masterboard-standalone #main-app.emr-app-shell { padding-left: 0 !important; padding-bottom: 0 !important; }
body.emr-masterboard-standalone #main-app > .app-body { height: auto; flex: 1; min-height: 0; }
body.emr-masterboard-standalone #main-app .main-panel { padding: 0; min-height: 0; }
