:root {
  color-scheme: dark;
  --bg: #0f141b;
  --panel: #171d26;
  --panel-2: #1f2732;
  --line: #2d3948;
  --text: #edf2f7;
  --muted: #9fb0c3;
  --accent: #39a0ff;
  --accent-2: #1f7dd3;
  --danger: #ff6b6b;
  --success: #4fd18b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, system-ui, sans-serif;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.combined-shell {
  max-width: 1880px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  margin-bottom: 18px;
}

.hero h1,
.output h2 {
  margin: 0;
  font-size: 24px;
}

.subtle {
  color: var(--muted);
}

.status-pill {
  min-width: 160px;
  text-align: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.status-pill[data-ready="true"] {
  border-color: rgba(79, 209, 139, 0.45);
  color: #ddffea;
}

.status-pill[data-ready="false"] {
  border-color: rgba(255, 107, 107, 0.35);
  color: #ffd3d3;
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
}

.dual-workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}

.surface-column {
  min-width: 0;
}

.manual-column .workspace {
  grid-template-columns: 1fr;
}

.column-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  margin-bottom: 12px;
}

.column-toolbar h2 {
  margin: 0;
  font-size: 18px;
}

.benchmark-frame {
  display: block;
  width: 100%;
  height: min(1180px, calc(100vh - 170px));
  min-height: 720px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.controls,
.compose,
.output {
  padding: 18px;
}

.controls {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

label {
  font-weight: 600;
}

select,
textarea,
input[type="number"],
input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

textarea {
  min-height: 260px;
  resize: vertical;
}

.bench-prompts {
  min-height: 188px;
}

input[type="range"] {
  width: 100%;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.primary,
.secondary {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.chip {
  padding: 8px 10px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.primary,
.secondary {
  padding: 10px 14px;
}

.link-button {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.primary:hover {
  background: var(--accent-2);
}

.primary:disabled,
.secondary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.runtime-note {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #111720;
}

.hint {
  color: var(--muted);
  margin: 12px 0 0;
}

.checklist {
  display: grid;
  gap: 8px;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #111720;
}

.check-option input {
  margin: 0;
}

.check-option:has(input:disabled) {
  opacity: 0.55;
}

.output {
  margin-top: 18px;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

audio {
  width: 100%;
}

.log {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #111720;
  color: #d8e2ee;
  white-space: pre-wrap;
  word-break: break-word;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111720;
  margin-top: 14px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.results-table th,
.results-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(45, 57, 72, 0.85);
  vertical-align: top;
}

.results-table th {
  font-size: 12px;
  color: var(--muted);
  background: rgba(17, 23, 32, 0.98);
}

.results-table tbody tr:last-child td {
  border-bottom: none;
}

.results-table tbody tr[data-verdict="low"] td:nth-child(3) {
  color: var(--success);
}

.results-table tbody tr[data-verdict="moderate"] td:nth-child(3) {
  color: #ffd166;
}

.results-table tbody tr[data-verdict="high"] td:nth-child(3) {
  color: var(--danger);
}

html.embedded body {
  background: transparent;
}

html.embedded .shell {
  max-width: none;
  padding: 0;
}

html.embedded .hero {
  display: none;
}

html.embedded .workspace {
  grid-template-columns: 1fr;
  gap: 14px;
}

html.embedded .controls,
html.embedded .compose,
html.embedded .output {
  padding: 14px;
}

html.embedded .output {
  margin-top: 14px;
}

html.embedded .link-button {
  display: none;
}

html.embedded textarea {
  min-height: 150px;
}

html.embedded .bench-prompts {
  min-height: 140px;
}

html.embedded .results-table {
  min-width: 760px;
}

@media (max-width: 1180px) {
  .dual-workspace {
    grid-template-columns: 1fr;
  }

  .benchmark-frame {
    height: 980px;
  }
}

@media (max-width: 900px) {
  .shell {
    padding: 14px;
  }

  .hero {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace {
    grid-template-columns: 1fr;
  }
}
