:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #6a7280;
  --line: #d9e1ec;
  --primary: #1663d8;
  --primary-strong: #0f4fb3;
  --ok: #087f5b;
  --warn: #a66100;
  --bad: #b42318;
  --shadow: 0 12px 30px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 30px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.15;
}

h2 {
  font-size: 17px;
}

.topbar p,
.hint,
.muted {
  color: var(--muted);
}

.topbar p {
  margin-top: 7px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 1.1fr) minmax(260px, 0.9fr) minmax(260px, 0.9fr);
  gap: 18px;
  padding: 22px;
}

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.setup-panel,
.job-panel {
  grid-column: span 1;
}

.log-panel {
  grid-column: 1 / -1;
}

.panel-title,
.status-strip,
.button-row,
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title {
  justify-content: space-between;
  margin-bottom: 16px;
}

.status-strip {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.status-pill {
  min-width: 86px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f9fafc;
  color: var(--muted);
  text-align: center;
}

.status-pill.ok {
  color: var(--ok);
  border-color: rgba(8, 127, 91, 0.28);
  background: rgba(8, 127, 91, 0.08);
}

.status-pill.warn {
  color: var(--warn);
  border-color: rgba(166, 97, 0, 0.3);
  background: rgba(166, 97, 0, 0.09);
}

.status-pill.bad {
  color: var(--bad);
  border-color: rgba(180, 35, 24, 0.3);
  background: rgba(180, 35, 24, 0.08);
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  font-weight: 650;
  color: #334155;
}

input,
select {
  width: 100%;
  min-height: 41px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 99, 216, 0.13);
}

input[readonly] {
  background: #f8fafc;
  color: #475467;
}

button {
  min-height: 41px;
  padding: 9px 14px;
  border: 1px solid var(--primary);
  border-radius: 7px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 760;
  cursor: pointer;
}

button:hover {
  background: var(--primary-strong);
}

button.secondary {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

button.secondary:hover {
  background: #f2f5f9;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.toggle-row {
  flex-wrap: wrap;
  margin: 3px 0 16px;
}

.toggle-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

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

.hint {
  margin-top: 12px;
  line-height: 1.5;
  font-size: 13px;
}

.progress-track {
  height: 10px;
  margin: 14px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e4eaf2;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--ok);
  transition: width 180ms ease;
}

video {
  display: none;
  width: 100%;
  max-height: 460px;
  margin-top: 14px;
  border-radius: 8px;
  background: #101828;
}

pre {
  min-height: 300px;
  max-height: 480px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111827;
  color: #edf2f7;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    display: grid;
  }

  .layout,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .setup-panel,
  .job-panel,
  .log-panel {
    grid-column: auto;
  }
}
