/* A shared model/assistant column, present for both input formats. */
#app .dash.has-pf-configuration {
  grid-template-columns: minmax(260px, 310px) minmax(260px, 1fr) 340px;
  grid-template-areas: "drop topo config" "pipe topo config" "con topo config" "stats stats stats";
}
#pf-configuration[hidden] { display: none; }
#pf-configuration {
  grid-area: config;
  padding: 0;
  text-align: left;
  cursor: default;
  gap: 0;
}
#pf-configuration .dash-head { letter-spacing: 1px; }
#pf-configuration [hidden] { display: none !important; }
.gr-sidebar-tabs { display: flex; flex-shrink: 0; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); }
.gr-sidebar-tab { flex: 1 1 auto; min-width: 0; border: 1px solid transparent; border-radius: 7px; background: transparent; padding: 10px 7px; color: var(--muted); font-family: var(--sans); font-size: 11px; line-height: 1.35; cursor: pointer; }
.gr-sidebar-tab:hover { background: var(--hover-tint); color: var(--text); }
.gr-sidebar-tab[aria-selected="true"] { background: var(--card2); border-color: var(--border-l); color: var(--text); }
.gr-sidebar-tab:focus-visible, .gr-model-config:focus-visible { outline: 2px solid var(--cyan); outline-offset: -3px; }
.gr-model-config { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; overflow: hidden; }
.gr-config-head { padding: 16px 14px 10px; margin: 0; }
.pf-config-body { flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 14px 16px; scrollbar-color: var(--border-l) transparent; scrollbar-width: thin; }
.gr-assistant-dock { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#gr-assistant-panel-mount { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; overflow: hidden; }
.gr-assistant-panel-placeholder { padding: 18px 16px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.psse-config-bundle { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; }
.psse-config-bundle > div { display: grid; grid-template-columns: 53px minmax(0, 1fr); gap: 8px; line-height: 1.5; font-size: 11px; }
.psse-config-bundle dt { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.psse-config-bundle dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.psse-config-strategy { border-top: 1px solid var(--border); padding-top: 10px; margin: 12px 0 0; font-size: 11px; color: var(--text); line-height: 1.55; }
.psse-config-strategy small { display: block; color: var(--muted); margin-top: 4px; font-size: 10px; }
.psse-config-strategy.is-empty { margin-top: 0; padding-top: 0; border-top: 0; color: var(--muted); font-size: 10px; }
.psse-config-strategy.is-empty small { display: none; }
#pf-config-status { white-space: nowrap; letter-spacing: .2px; }
.pf-config-file { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; line-height: 1.4; }
.pf-config-intro { color: var(--muted); font-size: 11px; line-height: 1.55; margin: 7px 0 12px; }
.pf-config-content { min-height: 0; padding: 1px 3px 3px 1px; }
.pf-config-section { border: 0; padding: 0; margin: 0 0 17px; min-width: 0; }
.pf-config-section legend { font-family: var(--mono); font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--slate); padding: 0; margin-bottom: 8px; width: 100%; }
.pf-config-count { float: right; color: var(--dim); }
.pf-config-option {
  display: flex; align-items: flex-start; gap: 8px; padding: 9px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--card2); margin-bottom: 6px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pf-config-option:hover { border-color: var(--border-l); }
.pf-config-option.is-upload-active {
  background: var(--green-tint);
  box-shadow: 0 0 11px rgba(52,211,153,.065), inset 0 0 14px rgba(52,211,153,.025);
}
.pf-config-option.is-selected { border-color: var(--border-l); }
.pf-config-option input { flex-shrink: 0; margin: 2px 0 0; accent-color: var(--cyan); width: 12px; height: 12px; }
.pf-config-option:focus-within { outline: 2px solid var(--cyan); outline-offset: 2px; }
.pf-config-option-text { display: block; flex: 1; min-width: 0; }
.pf-config-option-name { display: block; color: var(--text); font-size: 11.5px; line-height: 1.4; overflow-wrap: anywhere; }
.pf-config-option-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: 9px; color: var(--muted); line-height: 1.35; }
.pf-config-active { color: var(--green); display: inline-flex; align-items: center; gap: 4px; font-size: 8.5px; }
.pf-config-active::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.pf-config-date { margin: -3px 0 15px; padding: 8px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 10px; line-height: 1.5; color: var(--muted); }
.pf-config-date strong { display: block; font-family: var(--mono); font-size: 10px; color: var(--text); font-weight: 400; margin-top: 3px; }
.pf-config-empty { font-size: 11px; color: var(--muted); line-height: 1.6; }
.pf-config-legend { display: flex; align-items: center; gap: 7px; font-size: 9px; line-height: 1.5; color: var(--muted); margin-bottom: 14px; }
.pf-config-legend .pf-config-active { white-space: nowrap; }
.pf-config-stages { border-top: 1px solid var(--border); padding-top: 10px; margin-bottom: 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.pf-config-stages summary { cursor: pointer; color: var(--slate); }
.pf-config-stages ul { list-style: none; margin: 8px 0 0; padding: 0; }
.pf-config-stages li { margin: 6px 0; overflow-wrap: anywhere; }
.pf-config-stages small { display: block; color: var(--dim); font-size: 9px; }
.pf-config-actions { display: flex; flex-direction: column; gap: 7px; flex-shrink: 0; padding-top: 12px; }
.pf-config-actions:empty { padding: 0; }
.pf-config-actions button { font-family: var(--sans); font-size: 11px; line-height: 1.35; border-radius: 7px; padding: 8px 10px; border: 1px solid var(--border-l); background: transparent; color: var(--text); cursor: pointer; }
.pf-config-actions button:hover { background: var(--hover-tint); }
.pf-config-actions button.pf-config-primary { background: var(--cyan); color: var(--bg); border-color: var(--cyan); font-weight: 700; }
.pf-config-actions button:disabled { opacity: .45; cursor: not-allowed; }
.pf-config-actions button.pf-config-text-button { border-color: transparent; color: var(--muted); padding: 4px 8px; }
.pf-config-actions button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.pf-config-message { flex-shrink: 0; color: var(--muted); font-size: 10px; line-height: 1.5; margin-top: 9px; overflow-wrap: anywhere; }
.pf-config-message:empty { display: none; }
.pf-config-message.is-error { color: var(--amber); }
.pf-config-wait { display: flex; align-items: center; gap: 8px; margin: 15px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.pf-config-wait::before { content: ""; flex-shrink: 0; width: 12px; height: 12px; border: 1px solid var(--border-l); border-top-color: var(--cyan); border-radius: 50%; animation: spin 1s linear infinite; }
@media (min-width: 901px) {
  /* Keep the complete PSS/E bundle controls reachable without pushing
     the pipeline, console and component strip below the dashboard. */
  .has-pf-configuration .dash-drop:has(#dash-tab-psse[aria-selected="true"]) {
    max-height: max(170px, calc(100dvh - 470px));
    overflow-y: auto;
    overflow-x: hidden;
    color-scheme: dark;
    scrollbar-color: var(--border-l) transparent;
    scrollbar-width: thin;
  }
}
@media (max-width: 1190px) {
  #app .dash.has-pf-configuration { grid-template-columns: minmax(230px, 270px) minmax(180px, 1fr) 300px; }
}
@media (max-width: 900px) {
  html.dash-up:has(.dash.has-pf-configuration), html.dash-up:has(.dash.has-pf-configuration) body { height: auto; overflow: auto; }
  html.dash-up #app:has(.dash.has-pf-configuration) { height: auto; min-height: 100vh; }
  #app .dash.has-pf-configuration { height: auto; grid-template-columns: minmax(0, 1fr) minmax(240px, 1fr); grid-template-rows: auto auto auto auto auto; grid-template-areas: "drop config" "pipe config" "con config" "topo topo" "stats stats"; }
  .has-pf-configuration .dash-topo { min-height: 420px; }
  .has-pf-configuration .dash-con { min-height: 180px; }
  #pf-configuration { height: 680px; max-height: none; }
}
@media (max-width: 560px) {
  #app .dash.has-pf-configuration { grid-template-columns: minmax(0, 1fr); grid-template-areas: "drop" "config" "pipe" "con" "topo" "stats"; }
  #pf-configuration { height: 640px; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-config-wait::before { animation: none; }
  .pf-config-option { transition: none; }
}
