:root {
  --bg: #f4f7f5;
  --ink: #17211b;
  --muted: #5f6f66;
  --line: #cdd8d1;
  --panel: #ffffff;
  --accent: #1c7c54;
  --accent-dark: #11583a;
  --warning: #b54708;
  --danger: #bd2d2d;
  --focus: #2f80ed;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  border: 0;
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.15);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

.status {
  min-width: 98px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 750;
}

.status.ok {
  color: var(--accent-dark);
  border-color: rgba(28, 124, 84, 0.35);
}

.band {
  margin-top: 16px;
}

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

.panel {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(23, 33, 27, 0.06);
}

.panel-head,
.table-head,
.actions,
.mode-row,
.split {
  display: flex;
  gap: 12px;
}

.panel-head,
.table-head {
  align-items: center;
  justify-content: space-between;
}

.table-head {
  margin-bottom: 12px;
}

.table-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.actions {
  align-items: center;
  flex-wrap: wrap;
}

.split {
  align-items: start;
}

.split > * {
  flex: 1;
}

.ghost,
.primary,
.danger,
.icon {
  min-height: 38px;
  border-radius: 6px;
  padding: 9px 13px;
  font-weight: 800;
}

.ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.primary {
  color: #fff;
  background: var(--accent);
}

.danger {
  color: #fff;
  background: var(--danger);
}

.icon {
  width: 38px;
  padding: 0;
  color: var(--danger);
  border: 1px solid rgba(189, 45, 45, 0.25);
  background: #fff5f5;
}

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

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #eef4f0;
  font-size: 12px;
  font-weight: 850;
}

td {
  background: #fff;
}

td input + input {
  margin-top: 8px;
}

.file {
  max-width: 360px;
  padding: 8px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.compact-wrap table {
  min-width: 900px;
}

.optimizer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.results-table td {
  font-size: 13px;
  word-break: break-word;
}

.results-table .passed td:first-child {
  border-left: 4px solid var(--accent);
}

.results-table .failed td:first-child {
  border-left: 4px solid var(--danger);
}

.mode-row {
  align-items: center;
  flex-wrap: wrap;
}

.check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.check input {
  width: 18px;
  height: 18px;
}

.launch-panel {
  align-content: start;
}

.log {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  color: var(--muted);
  background: #fbfcfb;
  white-space: pre-wrap;
}

.output-panel {
  gap: 12px;
}

pre {
  min-height: 260px;
  max-height: 520px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  color: #102017;
  background: #f9fbfa;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 840px) {
  .shell {
    width: min(100% - 20px, 760px);
    padding-top: 14px;
  }

  .topbar,
  .panel-head,
  .table-head,
  .split {
    align-items: stretch;
    flex-direction: column;
  }

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

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

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

  h1 {
    font-size: 30px;
  }
}
