/* Shared workspace readability and spacing. Authentication has its own layout. */
:where(.workspace, .drawer, .confirm-dialog) .field > span,
:where(.workspace, .drawer, .confirm-dialog) .field small,
:where(.workspace, .drawer, .confirm-dialog) .form-section-head p,
:where(.workspace, .drawer, .confirm-dialog) .form-error,
:where(.workspace, .drawer) .panel-head p,
:where(.workspace, .drawer) .metric-label,
:where(.workspace, .drawer) .metric-foot,
:where(.workspace, .drawer) .table-title small,
:where(.workspace, .drawer) .data-table td small,
:where(.workspace, .drawer) .record-scope,
:where(.workspace, .drawer) .status-row small,
:where(.workspace, .drawer) .vendor-lockup small,
:where(.workspace, .drawer) .connector-meta span,
:where(.workspace, .drawer) .connector-meta strong,
:where(.workspace, .drawer) .card-action,
:where(.workspace, .drawer) .source-card p {
  font-size: 12px;
  line-height: 1.45;
}
:where(.workspace, .drawer) .metric-foot { color: var(--muted); }
:where(.workspace, .drawer) .data-table th {
  font-size: 12px;
  letter-spacing: .025em;
  padding-block: 9px;
}
:where(.workspace, .drawer) .data-table td { font-size: 13px; }
:where(.workspace, .drawer) .badge {
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .015em;
  min-height: 26px;
  padding-block: 3px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
:where(.workspace, .drawer) .data-table .badge {
  max-width: none;
  white-space: nowrap;
  overflow-wrap: normal;
}

/* Trim surrounding space while retaining comfortable form controls. */
.workspace .view { padding-block: 22px 32px; }
.workspace .metrics-grid { gap: 12px; margin-bottom: 18px; }
.workspace .metric-card { min-height: 116px; padding: 16px; }
.workspace .metric-value { margin-top: 10px; }
.workspace .metric-foot { margin-top: 6px; }
:where(.workspace, .drawer) .panel-body { padding: 16px; }
.workspace .connector-card, .workspace .source-card { padding: 16px; }
.workspace .staff-intro { margin-bottom: 18px; }
.workspace .staff-stats { gap: 12px; margin-bottom: 18px; }
.workspace .staff-stat { padding: 16px; }
.workspace .staff-stat strong { margin: 10px 0 6px; }
:where(.workspace, .drawer) .form-section { margin-bottom: 20px; }
:where(.workspace, .drawer) .form-grid { gap: 12px; }
:where(.workspace, .drawer, .confirm-dialog) .field { min-width: 0; }
:where(.workspace, .drawer, .confirm-dialog) .field :is(input, select, textarea) { min-width: 0; }
.drawer-body { padding: 18px; }
.drawer-body .form-actions { bottom: -18px; margin: 20px -18px -18px; padding: 12px 18px; flex-wrap: wrap; }

/* Allow headings and actions to wrap as groups instead of squeezing labels. */
:where(.workspace, .drawer) .panel-head {
  min-height: 58px;
  padding: 12px 16px;
  gap: 10px 16px;
  flex-wrap: wrap;
}
:where(.workspace, .drawer) .panel-head > div:first-child { flex: 1 1 260px; min-width: 0; }
:where(.workspace, .drawer) .panel-actions,
:where(.workspace, .drawer) .section-head-actions {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}
:where(.workspace, .drawer) .panel-head :is(.button, .section-link),
:where(.workspace, .drawer) .section-head-actions .button {
  min-height: 40px;
  max-width: 100%;
  white-space: normal;
  padding-block: 8px;
}
:where(.workspace, .drawer) .panel-head > .section-link { text-align: left; }
.workspace .toolbar { flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.workspace .toolbar .search-box { flex: 1 1 240px; max-width: 420px; min-width: 0; }
.workspace .filter-group { flex-wrap: wrap; gap: 8px; overflow: visible; }
.workspace .filter-chip { min-height: 40px; font-size: 12px; padding-block: 7px; }

/* Search, filters and buttons share a baseline and control height. */
:where(.workspace, .drawer) .record-search { gap: 10px; padding: 14px 16px 10px; }
:where(.workspace, .drawer) .record-search-label { flex: 1 1 260px; }
:where(.workspace, .drawer) .record-size-label { flex: 1 1 150px; max-width: 220px; }
:where(.workspace, .drawer) .record-size-label:has(select[aria-label^="Rows per page"]) { flex: 0 1 90px; }
:where(.workspace, .drawer) .record-search :is(input, select, button) { min-height: 42px; }
:where(.workspace, .drawer) .record-search button { max-width: 100%; white-space: normal; padding-block: 8px; }
:where(.workspace, .drawer) .record-scope { padding: 0 16px 12px; }
:where(.workspace, .drawer) .record-pagination { padding: 12px 16px; }
.workspace .staff-toolbar { flex-wrap: wrap; gap: 10px; padding: 14px 16px; }
.workspace .staff-filters { padding: 14px 16px; gap: 10px; }

@media (max-width: 680px) {
  .workspace .view { padding-block: 16px 24px; }
  .workspace .toolbar .search-box { flex-basis: auto; width: 100%; max-width: none; }
  :where(.workspace, .drawer) .panel-actions { width: 100%; }
  :where(.workspace, .drawer) .record-search-label { flex-basis: 100%; }
  :where(.workspace, .drawer) .record-size-label { max-width: none; }
  .drawer-body { padding: 16px; }
  .drawer-body .form-actions { bottom: -16px; margin: 18px -16px -16px; padding: 12px 16px; }
}
@media (max-width: 480px) {
  :where(.workspace, .drawer) .record-size-label:has(select[aria-label^="Discipline"], select[aria-label^="Sort by"]) { flex-basis: 100%; }
}

/* Long retained references must wrap inside detail panels, not widen them. */
.drawer-body { min-width: 0; overflow-wrap: anywhere; }
.drawer-body :is(.detail-grid, .detail-item, .timeline-event, .status-row, .info-callout) > * { min-width: 0; }
.drawer-body pre { max-width: 100%; overflow-x: auto; }
.source-card-head > .badge, .connector-head > .badge { flex-shrink: 0; white-space: nowrap; }
.source-card-head > :first-child, .connector-head > :first-child { min-width: 0; overflow-wrap: anywhere; }
.workspace :is(.feed-node span, .feed-node strong, .source-stats span, .source-stats strong) { font-size: 12px; }
.workspace :is(.monitoring-hero, .screening-hero, .case-hero, .filing-hero, .operations-hero, .bulk-banner, .decision-control-hero, .activation-hero) .eyebrow { color: #86d7cd; }
.posture-console > .muted { color: #c2d6dd; font-size: 12px; line-height: 1.55; }
.operations-signal > [data-icon] { grid-row: 1 / 3; align-self: center; }
.operations-signal > [data-icon] svg { width: 22px; height: 22px; color: #63dfcf; }
.operations-signal.is-critical > [data-icon] svg { color: #ff989e; }
.operations-signal :is(strong, small) { grid-column: 2; min-width: 0; }

/* A saved dataset has one content column and no leading icon. */
#drawer .screening-dataset-row { grid-template-columns: minmax(0, 1fr); }
#drawer .screening-dataset-row > div { min-width: 0; width: 100%; }
#drawer .screening-dataset-row code { overflow-wrap: anywhere; }

/* Retained automatic closure: readable labels, values and identifiers at narrow widths. */
.management-closure-evidence{display:grid;grid-template-columns:minmax(7rem,.8fr) minmax(0,1.2fr);gap:.75rem 1rem;padding:1rem;margin:1.25rem 0;border:1px solid #d9e5e9;border-radius:12px;background:#f7fafb}
.management-closure-evidence dt{font-weight:700;color:#153240}
.management-closure-evidence dd{margin:0;overflow-wrap:anywhere}
@media(max-width:480px){.management-closure-evidence{grid-template-columns:minmax(0,1fr);gap:.25rem}.management-closure-evidence dd:not(:last-child){margin-bottom:.6rem}}

/* Keep feedback separate from adjacent controls, including inside scrolling drawers. */
:where(.workspace, .drawer, .confirm-dialog) .form-error:not([hidden]) { margin-block: 12px; }
.drawer > .response-mode-banner:not([hidden]) + .drawer-body { padding-top: 0; }
.date-picker-timezone { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.calendar-date-list { display: grid; gap: 10px; min-width: 0; }
.calendar-date-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.calendar-date-row > input { flex: 1; min-width: 0; }
.calendar-date-list > button { justify-self: start; }

/* Saved claim reasons may include long identifiers; never widen the drawer. */
#claim-context{min-width:0;overflow-wrap:anywhere}#claim-context section{margin-top:1.25rem}#claim-context .claim-context-reasons{white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%;max-height:24rem;overflow:auto}#claim-context .table-wrap{max-width:100%}
