:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #67727e;
  --line: #dce3e7;
  --good: #147d4f;
  --bad: #b42318;
  --warn: #a15c07;
  --accent: #0f766e;
}

* {
  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;
}

.shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

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

.top-actions {
  display: flex;
  gap: 8px;
}

h1,
h2,
p {
  margin: 0;
}

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

h2 {
  font-size: 16px;
}

.topbar p,
.panel-title span,
.result {
  color: var(--muted);
  font-size: 13px;
}

button,
input,
select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

button {
  padding: 0 14px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 650;
}

button.secondary {
  background: #fff;
  color: var(--bad);
  border-color: #f0b8b0;
}

input,
select {
  min-width: 0;
  padding: 0 10px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

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

.status-card {
  padding: 16px;
}

.status-card strong {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill.good {
  background: #dcfce7;
  color: var(--good);
}

.pill.bad {
  background: #fee2e2;
  color: var(--bad);
}

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

.panel {
  padding: 16px;
  margin-bottom: 12px;
}

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

.columns {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 12px;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr auto auto;
  gap: 8px;
  margin-top: 12px;
}

#whitelist-form {
  grid-template-columns: 1.4fr 1fr auto;
}

.jail-list,
.whitelist {
  display: grid;
  gap: 8px;
}

.jail,
.white-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.jail code,
.white-row code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

pre {
  min-height: 140px;
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  background: #101820;
  color: #e8eef2;
  font-size: 12px;
  line-height: 1.45;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(420px, calc(100vw - 32px));
}

.login-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-card p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

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

@media (max-width: 820px) {
  .topbar,
  .panel-title,
  .jail,
  .white-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-grid,
  .columns,
  .form-row,
  #whitelist-form {
    grid-template-columns: 1fr;
  }

  button,
  input,
  select {
    width: 100%;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
