:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --panel: #ffffff;
  --ink: #1c2528;
  --muted: #657174;
  --line: #d9e0df;
  --primary: #164e63;
  --primary-strong: #0f3847;
  --accent: #c2410c;
  --ok: #166534;
  --warn: #92400e;
  --danger: #991b1b;
  --shadow: 0 12px 34px rgba(25, 35, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

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

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

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

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

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

.topbar-actions,
.button-row,
.panel-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segmented button {
  min-height: 38px;
  padding: 8px 11px;
  color: var(--primary);
  background: #ffffff;
  border: 0;
  border-radius: 0;
}

.segmented button + button {
  border-left: 1px solid var(--line);
}

.segmented button.active {
  color: #ffffff;
  background: var(--primary);
}

.panel-heading {
  justify-content: space-between;
}

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

.sidebar,
.content-grid {
  display: grid;
  gap: 18px;
  align-content: start;
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.span-2 {
  grid-column: span 2;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

input[type="checkbox"] {
  width: auto;
}

textarea {
  resize: vertical;
}

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

button {
  min-height: 38px;
  padding: 8px 14px;
  color: #ffffff;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

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

button.secondary {
  color: var(--primary);
  background: #eef6f7;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  color: var(--muted);
  background: #eef1f1;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.ok {
  color: var(--ok);
  background: #dcfce7;
}

.badge.warn {
  color: var(--warn);
  background: #fef3c7;
}

.badge.error {
  color: var(--danger);
  background: #fee2e2;
}

.output,
.code-editor {
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
}

.output {
  min-height: 64px;
  max-height: 280px;
  padding: 12px;
  background: #101820;
  color: #e4f1f3;
  border-radius: 6px;
}

.output.compact {
  min-height: 84px;
  max-height: 180px;
}

.code-editor {
  min-height: 360px;
}

.list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.list-item strong {
  display: block;
}

.list-item small {
  color: var(--muted);
}

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

.links a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.links a:hover {
  text-decoration: underline;
}

.table-wrap {
  overflow: auto;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.progress {
  overflow: hidden;
  height: 10px;
  background: #e6eceb;
  border-radius: 999px;
}

.progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--primary);
}

.list-item.controls {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 160px) minmax(180px, 1fr) auto;
  align-items: center;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

@media (max-width: 980px) {
  .layout,
  .content-grid,
  .pilot-grid,
  .list-item.controls {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .topbar,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .button-row {
    flex-wrap: wrap;
  }
}
