:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #1f2924;
  --muted: #69746e;
  --line: #dfe5df;
  --brand: #176b5b;
  --brand-strong: #0f4f43;
  --accent: #2f5f9d;
  --danger: #b3261e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

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

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

.topbar,
.section-head,
.topbar-actions,
.tabs,
.form-actions {
  display: flex;
  align-items: center;
}

.topbar,
.section-head {
  justify-content: space-between;
  gap: 16px;
}

.subhead {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.topbar {
  margin-bottom: 22px;
}

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

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.15rem;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

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

.grid.compact {
  gap: 12px;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

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

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 107, 91, 0.12);
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: white;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

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

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

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

.ghost:hover {
  border-color: var(--brand);
  background: #eef7f4;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--muted);
  background: #fff;
  font-size: 0.86rem;
}

.topbar-actions,
.tabs,
.form-actions {
  gap: 10px;
}

.tabs {
  margin-bottom: 14px;
}

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

.tab.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

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

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfb;
}

.stat strong {
  display: block;
  margin-top: 6px;
  color: var(--brand);
  font-size: 1.5rem;
}

.message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
}

.message.error {
  color: var(--danger);
}

.log {
  min-height: 48px;
  overflow: auto;
  margin: 16px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #18231f;
  color: #e9f2ee;
  padding: 13px;
  white-space: pre-wrap;
}

.hidden {
  display: none !important;
}

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

  .grid.two,
  .stats {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .tabs {
    width: 100%;
    flex-wrap: wrap;
  }
}
