.container-fluid { max-width: 1400px; margin: auto; height: 100vh;
  display: flex; flex-direction: column; overflow: hidden; }
.tabbable { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tabbable > .nav-tabs { flex: none; }
.tabbable > .tab-content { flex: 1; min-height: 0; }
.tabbable > .tab-content > .tab-pane.active { height: 100%; }
.scenario-layout { display: grid; grid-template-columns: minmax(300px, 360px)
  minmax(0, 1fr); gap: 24px; align-items: stretch; margin-top: 18px;
  height: calc(100% - 18px); min-height: 0; }
.scenario-settings { min-width: 0; min-height: 0;
  overflow-y: auto; overflow-x: hidden; padding-right: 18px;
  border-right: 1px solid #e5e5e5; }
.scenario-tab-close { margin-left: 9px; color: #777;
  font-size: 18px; line-height: 1; }
.scenario-tab-close:hover, .scenario-tab-close:focus { color: #a94442; }
#scenario_tabs a[data-value="new"] { opacity: 0.45; cursor: not-allowed; }
.file-ready #scenario_tabs a[data-value="new"] { opacity: 1; cursor: pointer; }
.scenario-title-row { display: flex; align-items: flex-end; gap: 10px;
  margin-bottom: 15px; }
.scenario-title-row .form-group { flex: 1; min-width: 0; margin-bottom: 0; }
.scenario-title-row .btn { width: 110px; }
.time-settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; }
.time-settings .form-group { min-width: 0; }
.scenario-plot { min-width: 0; min-height: 0; overflow-y: auto; }
.scenario-actions { display: flex; justify-content: flex-end;
  align-items: center; gap: 10px; margin-top: 14px; }
.parameter-table { width: 100%; margin-top: 12px; }
.parameter-table .form-group { margin-bottom: 0; }
.model-parameter-table { table-layout: fixed; }
.model-parameter-table th:first-child { width: 105px; }
.model-parameter-table td { overflow-wrap: anywhere; }
.model-parameter-table .shiny-input-container { width: 100%; min-width: 0; }
.model-parameter-table .form-control { width: 100%; min-width: 0; }
.model-parameter-table th:last-child { width: 40px; }
.model-parameter-table .parameter-remove { padding: 1px 5px;
  font-size: 18px; line-height: 1; }
.event-table { table-layout: fixed; }
.event-table th:nth-child(2), .event-table td:nth-child(2) { width: 80px;
  text-align: center; }
.event-table th:last-child { width: 40px; }
.event-table td:first-child { overflow-wrap: anywhere; }
.event-table .shiny-input-container { width: auto; min-width: 0; }
.event-table .checkbox { display: inline-block; margin: 0; }
.event-table .event-remove { padding: 1px 5px;
  font-size: 18px; line-height: 1; }
.shiny-image-output { max-width: 100%; }
.viewer-header { display: flex; align-items: center;
  justify-content: space-between; gap: 20px; margin: 16px 0 20px; }
.viewer-header h2 { margin: 0; }
.header-upload .form-group { margin: 0; }
.header-upload .progress { display: none; }
.header-upload { display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; }
.file-loading { display: flex; align-items: center; gap: 10px;
  color: #337ab7; font-size: 18px; font-weight: 600; white-space: nowrap; }
.file-loading[hidden] { display: none; }
.file-loading-spinner { width: 20px; height: 20px;
  border: 3px solid #d6d6d6; border-top-color: #337ab7;
  border-radius: 50%; animation: file-loading-spin 0.8s linear infinite; }
@keyframes file-loading-spin { to { transform: rotate(360deg); } }
@media (max-width: 800px) {
  .container-fluid { height: auto; min-height: 100vh; display: block;
    overflow: visible; }
  .tabbable { display: block; }
  .tabbable > .tab-content > .tab-pane.active { height: auto; }
  .scenario-layout { grid-template-columns: 1fr; height: auto; }
  .scenario-settings { overflow: visible;
    padding-right: 0; border-right: 0; }
  .scenario-plot { overflow: visible; }
}
@media (max-width: 600px) {
  .viewer-header { align-items: stretch; flex-direction: column; }
}
