/* Shared, compact read controls. Uses the existing unified design tokens. */
.workspace .compact-filter-bar.compact-filter-bar,
.compact-filter-bar {
  display: block;
  grid-template-columns: none;
  min-width: 0;
  margin-block: var(--ds-space-3);
  padding: 0;
  border: 0;
  background: transparent;
}
.compact-filter-main {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--ds-space-2);
  min-width: 0;
}
.compact-filter-main > label {
  display: grid;
  gap: var(--ds-space-1);
  min-width: 0;
  margin: 0;
  color: var(--ds-text-muted);
  font-size: var(--ds-caption-size);
}
.compact-filter-main > .compact-filter-search { flex: 1 1 220px; max-width: 360px; }
.compact-filter-main > .compact-filter-primary-field { flex: 0 1 200px; }
.compact-filter-main :is(input,select) { min-width: 0; width: 100%; }
.compact-filter-main > button { flex: 0 0 auto; margin: 0; }
.compact-filter-panel {
  flex: 0 1 auto;
  position: relative;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.compact-filter-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-2);
  min-height: 40px;
  padding: 8px 12px;
  list-style: none;
  border: 1px solid var(--ds-input-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-surface);
  color: var(--ds-text);
  font-size: var(--ds-body-size);
  font-weight: 500;
  cursor: pointer;
}
.compact-filter-panel > summary::-webkit-details-marker { display:none; }
.compact-filter-panel > summary::before { content:none; }
.compact-filter-panel > summary:hover { background:var(--ds-surface-soft); }
.compact-filter-panel > summary:focus-visible { outline:2px solid var(--ds-focus); outline-offset:2px; }
.compact-filter-panel[open] > summary { border-color:var(--ds-focus); }
.compact-filter-panel[data-filter-sheet-open] > summary { border-color:var(--ds-focus); }
.compact-filter-panel[open] .compact-filter-chevron { transform:rotate(180deg); }
.compact-filter-fields {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:var(--ds-space-3);
  position:absolute;
  z-index:45;
  inset-block-start:calc(100% + 8px);
  inset-inline-end:0;
  width:min(440px,calc(100vw - 40px));
  max-height:min(65vh,560px);
  overflow:auto;
  padding:var(--ds-space-4);
  border:1px solid var(--ds-border);
  border-radius:var(--ds-radius-panel);
  background:var(--ds-surface);
  box-shadow:0 8px 24px rgb(0 0 0 / .14);
}
.compact-filter-fields > label {
  display:grid;
  gap:var(--ds-space-1);
  min-width:0;
  margin:0;
  color:var(--ds-text-muted);
  font-size:var(--ds-caption-size);
}
.compact-filter-fields > :is(details,fieldset,p) { grid-column:1/-1; min-width:0; margin:0; }
.compact-filter-fields :is(input,select) { width:100%; min-width:0; }
.compact-filter-fields > .compact-filter-apply { grid-column:1/-1; justify-self:end; }
.compact-filter-chips {
  display:flex;
  flex-wrap:wrap;
  gap:var(--ds-space-2);
  margin-block-start:var(--ds-space-2);
}
.compact-filter-chips[hidden],.compact-filter-main > [hidden],.compact-filter-fields > [hidden] { display:none; }
.compact-filter-chip {
  display:flex;
  align-items:center;
  gap:var(--ds-space-2);
  min-height:32px;
  max-width:100%;
  padding:4px 10px;
  text-align:start;
  background:var(--ds-surface-soft);
  border:1px solid var(--ds-border);
  border-radius:var(--ds-radius-control);
  color:var(--ds-text);
  font-size:var(--ds-caption-size);
}
.compact-filter-chip > span:first-child { overflow-wrap:anywhere; }
.compact-filter-chip > span:last-child { margin-inline-start:auto; font-size:18px; }
.compact-filter-bar > :is([role="alert"],[role="status"]):empty { display:none; }
.personal-filter-options:has(.compact-filter-bar) { border:0; padding:0; background:transparent; }
.personal-filter-options:has(.compact-filter-bar) > summary { display:none; }
.planner-workspace .planner-record-filters { margin:0; padding:0; }
.planner-workspace .planner-advanced-filters { padding:12px; }
.planner-workspace .planner-advanced-filters .planner-record-filter { grid-column:1/-1; }
.planner-workspace[data-bay-schedule] > :is(.planner-records-host,.planner-records-summary,.planner-source-status) { display:none; }
.planner-workspace[data-bay-schedule] > .planner-resource-view { grid-column:1/-1; margin:0; padding:0; border:0; }
.planner-workspace[data-bay-schedule] > .planner-resource-view > h3 { margin-block:8px 12px; }
.planner-workspace[data-bay-schedule] > .planner-resource-view > .planner-filters[hidden] { display:none; }
/* The native top-layer dialog covers the mobile navigation while filters have focus. */
.compact-filter-sheet .compact-filter-sheet-summary {
  margin:0 0 var(--ds-space-4);
  color:var(--ds-text-muted);
  font-size:var(--ds-body-size);
}
.compact-filter-sheet .compact-filter-fields {
  position:static;
  display:grid;
  grid-template-columns:minmax(0,1fr);
  inset:auto;
  width:100%;
  max-height:none;
  overflow:visible;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
.compact-filter-sheet .compact-filter-fields > .compact-filter-apply { display:none; }
.compact-filter-sheet .workspace-modal-footer { display:grid; grid-template-columns:minmax(0,1fr); }
.compact-filter-sheet .workspace-modal-footer > button { width:100%; margin:0; }
.compact-filter-sheet .workspace-modal-footer > [hidden] { display:none; }
@media(max-width:760px) {
  .compact-filter-main > .compact-filter-search { flex:1 1 100%; max-width:none; }
  .compact-filter-main > .compact-filter-primary-field { flex:1 1 140px; }
  .compact-filter-main > .compact-filter-panel { flex:1 1 auto; }
  .compact-filter-panel > summary,.compact-filter-main > button,.compact-filter-chip {
    min-height:var(--ds-control-height-touch);
  }
  .compact-filter-panel > summary { white-space:normal; overflow-wrap:anywhere; }
  .compact-filter-main :is(input,select),.compact-filter-fields :is(input,select) {
    min-height:var(--ds-control-height-touch);
    font-size:16px;
  }
  .compact-filter-sheet .workspace-modal-header { align-items:center; }
  dialog.workspace-modal.compact-filter-sheet {
    max-height:calc(100dvh - 16px);
    max-height:min(88dvh,calc(100dvh - 16px));
  }
  .compact-filter-sheet .workspace-modal-body {
    overscroll-behavior:contain;
    padding-block-end:var(--ds-space-5);
  }
  .compact-filter-sheet .workspace-modal-footer {
    gap:var(--ds-space-2);
    padding-block-end:calc(var(--ds-space-4) + env(safe-area-inset-bottom));
  }
  .compact-filter-sheet .compact-filter-fields > label {
    gap:var(--ds-space-2);
    font-size:var(--ds-body-size);
    color:var(--ds-text);
  }
  .compact-filter-sheet :is(button,input,select) { min-height:var(--ds-control-height-touch); }
  .compact-filter-sheet .compact-filter-sheet-summary { font-size:16px; }
}
