:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #181b20;
  --panel-2: #20242b;
  --line: #303640;
  --text: #f2f4f8;
  --muted: #9aa4b2;
  --accent: #d9586a;
  --accent-2: #5fa8d3;
  --ok: #66c28f;
  --warn: #d6b45f;
  --bad: #df6b6b;
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent-2);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0f12;
  color: var(--text);
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

.app-header {
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 24px;
}

.app-header h1,
.app-header p,
.toolbar h2,
.toolbar p,
.model-nav h2,
.results h2 {
  margin: 0;
}

.app-header h1 {
  font-size: 22px;
}

.app-header p,
.toolbar p,
.field span,
.run-item p {
  color: var(--muted);
}

.header-actions,
.toolbar,
.results-header,
.run-topline,
.run-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workspace {
  display: grid;
  grid-template-columns: 250px minmax(420px, 1fr) 340px;
  min-height: calc(100vh - 72px);
}

.model-nav,
.generator,
.results {
  padding: 20px;
}

.model-nav,
.results {
  background: var(--panel);
}

.model-nav {
  border-right: 1px solid var(--line);
}

.results {
  border-left: 1px solid var(--line);
}

.model-list,
.run-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.model-button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 58px;
  text-align: left;
}

.model-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: #281a20;
}

.model-button span {
  color: var(--muted);
  font-size: 12px;
}

.generator {
  overflow: auto;
}

.toolbar {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  align-content: start;
}

.full {
  grid-column: 1 / -1;
}

.media-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  gap: 8px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.actions {
  display: flex;
  gap: 10px;
}

#generateButton {
  background: var(--accent);
  border-color: var(--accent);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.status-pill.ok {
  color: var(--ok);
  border-color: rgba(102, 194, 143, 0.45);
}

.status-pill.warn {
  color: var(--warn);
  border-color: rgba(214, 180, 95, 0.45);
}

.status-pill.bad {
  color: var(--bad);
  border-color: rgba(223, 107, 107, 0.45);
}

.run-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #12151a;
}

.run-topline {
  justify-content: space-between;
}

.run-item p {
  margin: 8px 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.result-links {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.result-links a {
  color: var(--accent-2);
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .results {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 780px) {
  .app-header,
  .workspace,
  .form-grid,
  .media-inputs {
    display: block;
  }

  .app-header > * + *,
  .form-grid > * + *,
  .media-inputs > * + * {
    margin-top: 12px;
  }

  .model-nav,
  .results {
    border: 0;
    border-bottom: 1px solid var(--line);
  }
}

