/* Preserve the existing modebar height; controls never wrap or add a row. */
body #app .modebar { flex-wrap: nowrap !important; }
.project-data-status-group {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  gap: 8px;
  height: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  white-space: nowrap;
}
.project-data-status-group::-webkit-scrollbar { display: none; }
.project-data-status-group > * { flex: 0 0 auto; }
body #app .project-data-status-group [hidden] { display: none !important; }
body #app .project-data-status-group .data-health-pill {
  height: 19px !important;
  min-height: 19px !important;
  box-sizing: border-box;
  padding: 0 6px !important;
  font-size: 8.8px !important;
  cursor: pointer;
}
.project-action-separator { width: 1px; height: 14px; background: var(--cm-border, #ccd5e0); margin: 0 2px; }
body #app .project-data-status-group .project-action-status {
  display: inline-flex; align-items: center; gap: 4px;
  box-sizing: border-box; height: 19px; min-height: 19px; padding: 0 6px;
  border: 1px solid #e6a5a5; border-radius: 4px; background: #fff0f0;
  font: 600 9px/1 var(--cm-font-ui); color: #a12828; cursor: pointer;
}
.project-action-status:hover { filter: brightness(.97); }
.project-action-status:focus-visible { outline: 2px solid var(--cm-accent, #375dfb); outline-offset: 1px; }
.project-action-status .ui-icon { width: 12px; height: 12px; }
.project-action-status.has-actions { color: #a12828; }
.professional-statusbar .status-project #runIdPill {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 5px !important;
  color: var(--cm-muted, #6f7b91);
  font-weight: 500;
}
.professional-statusbar { overflow-x: auto; scrollbar-width: none; }
.professional-statusbar::-webkit-scrollbar { display: none; }
.professional-statusbar > .status-project { flex: 0 0 auto !important; overflow: visible !important; }
.professional-statusbar .status-project > #statusProjectName { max-width: none !important; overflow: visible; text-overflow: clip; }
.professional-statusbar .status-primary { max-width: 300px !important; }
body #app .project-data-status-group [data-action-pending='true'] {
  color: #8b6506 !important;
  border-color: #dfbd55 !important;
  background: #fff6da !important;
}
body #app .project-data-status-group .project-action-status[data-action-pending='true'] {
  color: #a12828 !important;
  border-color: #e6a5a5 !important;
  background: #fff0f0 !important;
  animation: project-action-reminder 5.6s ease-in-out infinite;
}
body #app .project-data-status-group .action-is-error {
  color: #982e25 !important;
  border-color: #e9a19b !important;
  background: #fff1f0 !important;
}
body #app .project-data-status-group .action-reviewed {
  color: #64748b !important;
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}
.project-data-status-group .action-pulse { animation: project-action-pulse 800ms ease-in-out 3; }
body #app #mapLocationStatusBtn.is-accepted { color: #66558b !important; border-color: #cfc5df !important; background: #f6f3fb !important; }
@keyframes project-action-pulse { 50% { box-shadow: inset 0 0 0 2px currentColor; } }
@keyframes project-action-reminder {
  0%, 3%, 6%, 9%, 100% { box-shadow: inset 0 0 0 0 rgb(190 40 40 / 0%); filter: brightness(1); }
  1.5%, 7.5% { box-shadow: inset 0 0 0 2px rgb(190 40 40 / 55%); filter: brightness(.91); }
}
@media (prefers-reduced-motion: reduce) {
  .project-data-status-group .action-pulse,
  body #app .project-data-status-group .project-action-status[data-action-pending='true'] { animation: none; }
}
body #app #clustersView [data-analysis-table-action], .analysis-table-toolbar [data-analysis-table-action] {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 5px;
  flex: 0 0 auto; width: auto !important; min-width: max-content !important; max-width: none !important;
  height: 27px !important; min-height: 27px !important; padding: 0 7px !important;
  border: 0; border-radius: 4px; background: transparent; color: var(--cm-text); font: 11px/1 var(--cm-font-ui); white-space: nowrap;
}
.analysis-table-toolbar { display: flex; align-items: center; gap: 4px; overflow-x: auto; padding: 4px; margin-bottom: 4px; background: var(--cm-surface-2); }
.analysis-table-toolbar .ui-icon { width: 15px; height: 15px; }
.analysis-table-toolbar input[type='search'] { appearance: none; flex: 0 0 170px; width: 170px; min-width: 100px; height: 27px; padding: 3px 7px; border: 1px solid var(--cm-border); border-radius: 4px; box-shadow: none; background: var(--cm-surface); color: var(--cm-text); font: 11px var(--cm-font-ui); }
.analysis-table-toolbar [data-analysis-table-action]:hover { background: #edf3fa; }
.analysis-table-toolbar select { flex: 0 0 auto; width: auto; }
.analysis-table-count { flex: 0 0 auto; color: var(--cm-muted); font-size: 10px; white-space: nowrap; }
.analysis-table-options { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px; font-size: 11px; }
.analysis-table-options label { display: inline-flex; align-items: center; gap: 4px; }
.analysis-table-options[hidden], .analysis-table-toolbar [hidden], .analysis-table-hidden { display: none !important; }
.workspace-filter-editor[hidden] { display: none !important; }
.workspace-filter-editor { box-sizing: border-box; width: min(290px, 100%); padding: 8px; font: 12px/1.35 var(--cm-font-ui); }
.table-text-size { appearance: auto; width: auto !important; min-width: 64px !important; height: 27px; font: 11px var(--cm-font-ui); }
.table-text-size[hidden] { display: none !important; }
.font-size-menu-wrap:has(.table-text-size) { display: inline-flex; align-items: center; gap: 4px; width: auto !important; max-width: none !important; }
body #app #metadataView :is(.metadata-grid,.metadata-grid-virtual),
body #app #metadataView :is(.metadata-grid,.metadata-grid-virtual) :is(th,td),
body #app #clustersView .cluster-summary-grid,
body #app #clustersView .cluster-summary-grid :is(th,td) {
  font-size: var(--workspace-table-font-size, 11px) !important;
}
body #app #clusterColumnsPanel.analysis-table-options { position: static; width: auto; max-height: none; padding: 6px; box-shadow: none; border: 0; }
.metadata-sync-popover, .project-action-popover {
  position: fixed;
  margin: 0;
  box-sizing: border-box;
  width: min(390px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: var(--cm-surface, #fff);
  color: var(--cm-text, #27364d);
  box-shadow: 0 12px 34px rgb(28 43 66 / 18%);
  z-index: 65000;
  font: 11px/1.45 var(--cm-font-ui, 'Segoe UI', sans-serif);
}
:is(.metadata-sync-popover, .project-action-popover) .metadata-link-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; padding-bottom: 5px; border-bottom: 1px solid #e1e6ed; }
:is(.metadata-sync-popover, .project-action-popover) .metadata-link-close { display: grid; place-items: center; width: 24px; height: 24px; min-height: 24px; padding: 3px; border: 0; background: transparent; }
:is(.metadata-sync-popover, .project-action-popover) .ui-icon { width: 14px; height: 14px; }
.metadata-sync-summary { display: grid; gap: 2px; padding: 7px 8px; border: 1px solid #b4dbc9; border-radius: 4px; background: #f0faf5; }
.metadata-sync-summary strong { color: #167455; }
.metadata-sync-summary span { overflow-wrap: anywhere; font-size: 10px; }
.metadata-sync-popover[data-state='pending'] .metadata-sync-summary { border-color: #dfbd55; background: #fff6da; }
.metadata-sync-popover[data-state='pending'] .metadata-sync-summary strong { color: #8b6506; }
.metadata-sync-popover[data-state='error'] .metadata-sync-summary { border-color: #e9a19b; background: #fff1f0; }
.metadata-sync-popover[data-state='error'] .metadata-sync-summary strong { color: #982e25; }
.metadata-sync-flow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0; padding: 6px 8px; background: var(--cm-surface-2, #f8fafc); border-radius: 4px; }
.metadata-sync-flow > span:not([aria-hidden]) { display: grid; gap: 1px; }
.metadata-sync-flow b { font-size: 10px; font-weight: 500; color: #64748b; }
.metadata-sync-details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 12px; margin: 8px 0; font-size: 10px; }
.metadata-sync-details dt { color: #64748b; }
.metadata-sync-details dd { margin: 0; overflow-wrap: anywhere; }
.metadata-sync-actions { display: flex; justify-content: flex-end; padding-top: 7px; border-top: 1px solid #e1e6ed; }
.metadata-sync-scope { width: 100%; border-collapse: collapse; margin: 5px 0; font-size: 10px; }
.metadata-sync-scope :is(th,td) { padding: 3px 5px; border-bottom: 1px solid var(--cm-border); font-weight: 400; text-align: left; }
.metadata-sync-scope td { text-align: right; white-space: nowrap; color: #64748b; }
.metadata-sync-scope [data-scope-state='Current'] { color: #167455; }
.metadata-sync-scope [data-scope-state='Pending'] { color: #8b6506; }
.metadata-sync-scope [data-scope-state='Failed'], .metadata-sync-scope [data-scope-state$='needed'] { color: #982e25; }
.metadata-sync-scope-note { color: #64748b; margin: 6px 0; font-size: 9px; line-height: 1.4; }
.data-status-action-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  box-sizing: border-box; flex: 0 0 auto; width: auto; min-width: max-content; height: 28px; min-height: 28px;
  padding: 4px 10px; margin: 0; border: 1px solid var(--cm-border-strong, #c8d3e3); border-radius: 5px;
  background: var(--cm-surface, #fff); color: var(--cm-text, #27364d); box-shadow: none;
  font: 500 11px/1.2 var(--cm-font-ui); white-space: nowrap; cursor: pointer;
}
.data-status-action-btn .ui-icon { flex: 0 0 14px; width: 14px; height: 14px; }
.data-status-action-btn.is-primary { background: #eef4ff; border-color: #afc5e5; color: #245990; }
.data-status-action-btn:hover:not(:disabled) { background: #e5edf8; border-color: #92acce; }
.data-status-action-btn:focus-visible { outline: 2px solid var(--cm-accent, #375dfb); outline-offset: 2px; }
.data-status-action-btn:disabled { opacity: .55; cursor: default; }
.tree-modal-actions.data-status-footer { flex-wrap: wrap; justify-content: flex-end; gap: 8px !important; }
.project-action-popover { width: min(440px, calc(100vw - 16px)); }
.project-action-intro { margin: 0 0 7px; color: var(--cm-muted, #64748b); font-size: 10px; }
.project-action-guide { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.project-action-guide li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 8px; padding: 6px 7px; border: 1px solid var(--cm-border, #dce3ef); border-radius: 4px; }
.project-action-guide li[data-pending='true'] { border-color: #dfbd55; background: #fffbef; }
.project-action-guide h3 { display: flex; align-items: baseline; gap: 7px; margin: 0; font-size: 10.5px; font-weight: 600; }
.project-action-guide h3 span { color: var(--cm-muted, #64748b); font-size: 9px; font-weight: 500; }
.project-action-guide p { grid-column: 1 / -1; grid-row: 2; margin: 0; font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.project-action-guide .data-status-action-btn { grid-column: 2; grid-row: 1; height: 24px; min-height: 24px; padding: 3px 7px; font-size: 10px; }
@media (max-width: 1000px) {
  body #app .modebar > .active-project-chip { max-width: 100px; }
  body #app .modebar > #projectModeLabel { max-width: 80px; }
  body #app .modebar > .modebar-spacer { flex-basis: 0; min-width: 0; }
}
@media (max-width: 700px) {
  body #app .modebar > :is(#projectModeLabel, #runIdPill, .project-context-separator) { display: none !important; }
  body #app .modebar { gap: 5px; }
}
