:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-muted: #f7f9fc;
  --text: #17202a;
  --muted: #64748b;
  --line: #d9e2ec;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.09);
  --ok: #15803d;
  --warn: #a16207;
  --bad: #b42318;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

* {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Roboto, "Segoe UI", Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.sandbox-header {
  display: block;
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
}

.sandbox-header-inner {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 28px;
}

.sandbox-brand {
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-decoration: none;
}

.sandbox-brand:hover {
  opacity: 0.9;
}

.sandbox-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.sandbox-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.sandbox-nav a:hover,
.sandbox-nav a.active {
  background: #1e3a8a;
  color: #ffffff;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topnav {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

body.homol-host .topnav {
  display: inline-flex;
}

.flow-dock {
  position: fixed;
  left: 10px;
  top: 142px;
  z-index: 80;
  width: 38px;
  color: #0f172a;
}

.flow-dock[open] {
  width: 166px;
}

.flow-dock summary {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 850;
  list-style: none;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(12px);
}

.flow-dock summary::-webkit-details-marker {
  display: none;
}

.flow-dock-label {
  display: none;
}

.flow-dock[open] .flow-dock-label {
  display: inline;
}

.flow-dock-panel {
  margin-top: 7px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(12px);
}

.flow-dock-link {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-decoration: none;
  white-space: nowrap;
}

.flow-dock-link:hover,
.flow-dock-link.is-active,
.flow-dock-link[aria-current="step"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.flow-dock-link b {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
}

.flow-dock-link.is-active b,
.flow-dock-link[aria-current="step"] b {
  background: var(--accent);
  color: #ffffff;
}

.topnav a {
  min-width: 86px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.topnav a:hover,
.topnav a.active {
  color: #ffffff;
  background: var(--accent);
}

.last-refresh {
  display: none;
}

.topbar h1,
.panel h2,
.summary-strip h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 22px;
  line-height: 1.2;
}

.panel h2,
.summary-strip h2 {
  font-size: 17px;
}

.eyebrow,
.field span,
.list-title,
.summary-grid dt {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 24px 32px;
}

.sidebar,
.main-area,
.workflow-grid,
.results-grid,
.lower-grid {
  min-width: 0;
}

.sidebar,
.main-area {
  display: grid;
  align-content: start;
  gap: 12px;
}

.panel,
.summary-strip {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 14px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #ffffff;
}

.field input,
.field select {
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field textarea {
  min-height: 132px;
  resize: vertical;
  padding: 11px;
  font: 13px/1.45 "Roboto Mono", Consolas, "Courier New", monospace;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: var(--accent);
}

.field input:disabled {
  background: #eef2f6;
  color: #8a98a8;
}

.ghost-button,
.command-button,
.tab-button,
.chip,
.tiny-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.ghost-button {
  height: 34px;
  max-width: 100%;
  padding: 0 12px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-button:hover,
.chip:hover,
.tiny-button:hover,
.tab-button:hover {
  border-color: rgba(37, 99, 235, 0.45);
  color: var(--accent);
}

.command-stack {
  display: grid;
  gap: 8px;
}

.mode-field {
  margin: 2px 0 0;
}

.command-button {
  min-height: 52px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px;
  text-align: center;
}

.command-button span {
  min-width: 0;
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.command-button small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-button.primary {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.command-button:not(.primary):hover {
  border-color: rgba(37, 99, 235, 0.45);
  background: var(--accent-soft);
}

.command-button.primary:hover {
  background: var(--accent-dark);
}

.command-button.primary small {
  color: rgba(255, 255, 255, 0.86);
}

.command-button.compact {
  min-height: 44px;
  min-width: 132px;
}

.command-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.quick-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.quick-status div {
  min-height: 52px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
}

.quick-status span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-status strong {
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill,
.job-state {
  min-width: 112px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.ok,
.job-state.success {
  color: var(--ok);
  border-color: rgba(21, 128, 61, 0.25);
  background: rgba(21, 128, 61, 0.08);
}

.status-pill.bad,
.job-state.failed {
  color: var(--bad);
  border-color: rgba(180, 35, 24, 0.25);
  background: rgba(180, 35, 24, 0.08);
}

.job-state.running,
.job-state.queued {
  color: var(--warn);
  border-color: rgba(161, 98, 7, 0.25);
  background: rgba(161, 98, 7, 0.08);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 30px;
}

.chip {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.summary-strip {
  display: grid;
  grid-template-columns: minmax(210px, 260px) 1fr;
  align-items: center;
  gap: 18px;
  padding: 16px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 0.8fr minmax(180px, 1.6fr) minmax(140px, 1.2fr) 0.7fr 0.7fr;
  gap: 8px;
  margin: 0;
}

.summary-grid div {
  min-height: 52px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
}

.summary-grid dd {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-grid,
.results-grid,
.lower-grid {
  display: grid;
  gap: 12px;
}

.workflow-grid {
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
}

.input-panel .panel-header .ghost-button,
.input-tabs,
#urlPanel,
#pastePanel,
#saveConfigButton,
#importButton,
#integrationStatus,
.technical-field,
.summary-grid div:nth-child(2),
.summary-grid div:nth-child(5) {
  display: none !important;
}

.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.evtol-box {
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.045), rgba(255, 255, 255, 0));
}

.params-panel,
.input-panel,
.plots-panel {
  border-color: rgba(217, 226, 236, 0.9);
}

.results-grid {
  grid-template-columns: minmax(460px, 1.1fr) minmax(420px, 0.9fr);
}

.lower-grid {
  grid-template-columns: minmax(320px, 0.7fr) minmax(440px, 1.3fr);
}

.input-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.evtol-box {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 8px;
  background: #fbfdff;
}

.evtol-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.evtol-header h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.tab-button {
  height: 32px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tab-button.active {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.hidden {
  display: none;
}

.button-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
}

.helper-text {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.helper-text.bad {
  color: var(--bad);
}

.weather-list {
  display: grid;
  gap: 10px;
}

.weather-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) 1fr 1fr;
  gap: 8px;
  align-items: end;
}

.weather-row.two-col {
  grid-template-columns: minmax(130px, 0.9fr) 1fr;
}

.toggle-field {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  font-size: 13px;
  font-weight: 800;
}

.toggle-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.inline-field {
  margin-bottom: 0;
}

.simulation-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.simulation-fields .field:last-child {
  grid-column: 1 / -1;
}

.log-output {
  height: 300px;
  margin: 0;
  overflow: auto;
  padding: 13px;
  border-radius: 6px;
  background: #101923;
  color: #d7e2ee;
  font: 13px/1.55 "Roboto Mono", Consolas, "Courier New", monospace;
  white-space: pre-wrap;
}

.outputs-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.outputs-columns ul {
  min-height: 84px;
  max-height: 230px;
  overflow: auto;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}

.outputs-columns li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font: 13px/1.4 "Roboto Mono", Consolas, "Courier New", monospace;
  word-break: break-word;
}

.outputs-columns li:hover {
  background: #f8fafc;
}

.file-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: Inter, Roboto, "Segoe UI", Arial, sans-serif;
  font-size: 12px;
}

.file-actions {
  display: flex;
  gap: 6px;
}

.tiny-button {
  min-width: 42px;
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.jobs-list {
  display: grid;
  gap: 8px;
}

.job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.job-row:hover {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.job-row:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}

.job-main {
  min-width: 0;
}

.job-row strong {
  display: block;
  max-width: 100%;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-row small {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
}

.job-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jobs-empty {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-muted) 100%);
  color: var(--muted);
  font-size: 13px;
}

.jobs-empty strong {
  color: var(--text);
  font-size: 14px;
}

.file-preview {
  min-height: 260px;
  max-height: 420px;
  overflow: auto;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--text);
  font: 13px/1.55 "Roboto Mono", Consolas, "Courier New", monospace;
  white-space: pre-wrap;
}

.file-preview img {
  display: block;
  max-width: 100%;
  height: auto;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-strip,
  .workflow-grid,
  .results-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .flow-dock {
    left: 8px;
    top: 132px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .panel-header {
    align-items: flex-start;
  }

  .panel-header .ghost-button {
    width: 100%;
  }

  .summary-grid dd {
    white-space: normal;
  }

  .app-shell {
    width: auto;
    max-width: 100%;
    padding: 14px;
  }

  .sidebar,
  .summary-grid,
  .simulation-fields,
  .outputs-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .weather-row,
  .weather-row.two-col {
    grid-template-columns: 1fr;
  }

  .button-row {
    flex-direction: column;
  }

  .log-output {
    height: 320px;
  }

  .job-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .job-row .job-state {
    justify-self: start;
    min-width: 0;
  }

  .job-meta span {
    max-width: 100%;
  }
}


.plots-panel {
  min-width: 0;
}

.plots-panel.has-plots {
  border-color: rgba(21, 128, 61, 0.28);
}

.plot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.plot-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.plot-card:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.08);
}

.plot-card span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plot-thumb {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
}

.plot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.outputs-columns li.image-file {
  padding-left: 8px;
  border-left: 3px solid rgba(37, 99, 235, 0.45);
}

/* --- Galeria: micro-interacao --- */
.plots-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.plot-card {
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.plot-card:hover {
  transform: translateY(-2px);
}
.plot-thumb img {
  transition: transform 0.2s ease;
}
.plot-card:hover .plot-thumb img {
  transform: scale(1.05);
}

/* --- Lightbox --- */
body.lightbox-open {
  overflow: hidden;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 70px;
  background: rgba(7, 12, 24, 0.9);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.lightbox[hidden] {
  display: none;
}
.lightbox-figure {
  margin: 0;
  max-width: min(1100px, 92vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lightbox-figure img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.lightbox-figure figcaption {
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  word-break: break-all;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.24);
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 64px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 30px;
  cursor: pointer;
}
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.24);
}
.lightbox-nav.prev {
  left: 14px;
}
.lightbox-nav.next {
  right: 14px;
}
.lightbox-bar {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  color: #e5e7eb;
  font-size: 13px;
}
.lightbox-bar .ghost-button {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

body:not(.results-page) .plots-panel,
body:not(.results-page) .files-panel,
body:not(.results-page) .preview-panel,
body:not(.results-page) .results-toolbar {
  display: none;
}

body:not(.results-page) .sidebar {
  display: none;
}

body:not(.results-page) .app-shell {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1180px;
}

body:not(.results-page) .results-grid,
body:not(.results-page) .lower-grid {
  grid-template-columns: minmax(0, 1fr);
}

body:not(.results-page) .jobs-panel {
  max-width: 760px;
}

.results-page .sidebar,
.results-page .command-panel,
.results-page .input-panel,
.results-page .params-panel,
.results-page .summary-strip,
.results-page .log-panel,
.results-page .jobs-panel {
  display: none;
}

.results-page .app-shell {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1280px;
}

.results-toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.results-page .results-toolbar {
  position: sticky;
  top: 10px;
  z-index: 5;
}

.results-toolbar h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.results-actions {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.results-workspace-field {
  width: min(420px, 52vw);
  margin: 0;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.result-metrics div {
  min-height: 50px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
}

.result-metrics span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.result-metrics strong {
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.results-page .results-grid {
  grid-template-columns: minmax(0, 1fr);
}

.results-page .files-panel,
.results-page .preview-panel,
.results-page .lower-grid {
  display: none;
}

.results-page .log-output {
  height: 360px;
}

.results-page .outputs-columns ul {
  max-height: 310px;
}

.results-page .lower-grid {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 760px) {
  .sandbox-header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 18px;
  }

  .sandbox-nav {
    justify-content: flex-start;
  }

  .sandbox-nav a {
    font-size: 13px;
  }

  .topnav,
  .topnav a,
  .results-workspace-field {
    width: 100%;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
