/* Keep the Hub toolbar outside the scrolling grid, within the pane's height. */
#hub-alignment-toggle[hidden], #hub-alignment-panel[hidden] { display: none !important; }
#hub-alignment-panel button[aria-pressed="true"] { outline: 1px solid #16a085; color: #eef5fb; }
.content-column:has(> #mainContent > #pane-dashboard.active) {
  min-height: 0;
}

/* Use the actual remaining height, including header padding and tab borders. */
.content-column > #mainContent:has(> #pane-dashboard.active) {
  height: auto;
  flex: 1 1 0;
  min-height: 0;
}

#pane-dashboard.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#pane-dashboard > .dashboard-controls {
  flex: 0 0 auto;
}

#pane-dashboard > .wr-dashboard {
  flex: 1 1 0;
  height: auto;
  min-height: 0;
}

#pane-dashboard .dashboard-views {
  min-height: 0;
  top: 0;
}

#pane-dashboard #view-livecards {
  height: auto;
  min-height: 0;
  box-sizing: border-box;
  overflow-y: auto;
}

/* Live uses the same widget editor without the Hub edit-mode toggle. */
#live-alive-mount .livecard-container { position: relative; }
#live-alive-mount.is-edit-mode .hub-widget-actions-toggle { opacity: 1; pointer-events: auto; transform: none; }

#toggleLiveEditMode[aria-pressed="true"] { border-color: #16a085; background: #173b3b; }

/* Live/Favorites are subviews; hidden panels remain connected. */
#pane-board .live-tab-shell { grid-template-columns: minmax(0, 1fr); }
#pane-board .live-runtime-card[hidden] { display: none !important; }
#board-view-live[aria-pressed="true"], #board-view-favorites[aria-pressed="true"] { border-color: #16a085; background: #173b3b; }

/* Widget editor: related controls in tabs, bounded to the viewport. */
#resource-view-prefs-modal .resource-view-prefs-content { display:flex; flex-direction:column; max-height:calc(100dvh - 32px); box-sizing:border-box; padding:18px; overflow:hidden; }
#resource-view-prefs-modal .modal-header, #resource-view-prefs-modal .modal-footer, #resource-view-prefs-modal .resource-prefs-tabs { flex:0 0 auto; }
#resource-view-prefs-modal .modal-body { overflow-y:auto; min-height:0; padding:16px 0; }
#resource-view-prefs-modal .modal-header { margin:0; padding:0 0 14px; }
#resource-view-prefs-modal .modal-footer { display:flex; flex-wrap:wrap; gap:8px; margin:0; padding:14px 0 0; }
#resource-view-prefs-modal .resource-prefs-tabs { display:flex; flex-wrap:wrap; gap:6px; padding:12px 0; border-bottom:1px solid #304252; }
#resource-view-prefs-modal [role="tab"] { border:1px solid #304252; border-radius:7px; background:#121a24; color:#d9e5f0; padding:7px 10px; cursor:pointer; }
#resource-view-prefs-modal [role="tab"][aria-selected="true"] { border-color:#16a085; background:#173b3b; color:#eef5fb; }
#resource-view-prefs-modal [role="tabpanel"][hidden] { display:none !important; }
#resource-view-prefs-modal .resource-view-prefs-copy { margin:0 0 14px; }
#resource-view-prefs-modal #resource-placement-status { grid-column:1 / -1; margin:0; }
#resource-view-prefs-modal #resource-view-prefs-preview-status:not(:empty) { flex-basis:100%; font-size:12px; }
@media(max-width:480px) { #resource-view-prefs-modal .resource-view-prefs-content { padding:14px; max-width:calc(100vw - 20px); } #resource-view-prefs-modal .resource-view-prefs-grid { grid-template-columns:minmax(0,1fr); } }
