:root {
  --page: #f6f6f7;
  --card: #ffffff;
  --text: #202223;
  --muted: #6d7175;
  --border: #dfe3e8;
  --border-strong: #c9cccf;
  --green-bg: #f1f8f4;
  --green-border: #a9d8bd;
  --green-text: #0f5132;
  --yellow-bg: #fff7e6;
  --yellow-border: #e3c37b;
  --yellow-text: #6f4f00;
  --link: #2c6ecb;
  --button-bg: #f7f7f7;
  --button-border: #c9cccf;
  --button-hover: #303030;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.page-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 18px 40px;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 3px;
  font-size: 22px;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

h3 {
  margin-bottom: 6px;
  font-size: 14px;
}

p {
  color: var(--muted);
  font-weight: 400;
}

.topbar p,
.section-heading p,
.card p {
  margin-bottom: 0;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-strong);
}

.tab {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  color: var(--muted);
  text-decoration: none;
}

.tab.active {
  background: var(--card);
  border-color: var(--border-strong);
  color: var(--text);
  font-weight: 650;
  transform: translateY(1px);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.section-heading {
  margin-bottom: 14px;
}

.card {
  margin-bottom: 12px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.warning-card {
  background: var(--yellow-bg);
  border-color: var(--yellow-border);
}

.notice-card {
  background: #fbfbfc;
}

.card-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.summary-list {
  display: grid;
  gap: 0;
  border-top: 1px solid #eef0f2;
}

.summary-list div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid #eef0f2;
}

.log-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.log-metrics div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}

.log-metrics dt {
  margin-bottom: 4px;
  font-size: 12px;
}

.log-metrics dd {
  font-size: 20px;
  font-weight: 650;
}

.log-filters {
  margin-bottom: 0;
}

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

dd {
  margin: 0;
  font-weight: 400;
}

.pill,
.status {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.pill.success,
.status.success {
  background: var(--green-bg);
  color: var(--green-text);
}

.pill.warning,
.status.warning {
  background: var(--yellow-bg);
  color: var(--yellow-text);
  border: 1px solid var(--yellow-border);
}

.pill.neutral {
  background: #eef2f7;
  color: #4b5563;
}

.value-alert {
  display: inline-flex;
  min-width: 24px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
}

.value-alert.warning {
  background: var(--yellow-bg);
  color: var(--yellow-text);
  border: 1px solid var(--yellow-border);
}

.value-alert.danger {
  background: #fdecec;
  color: #9f1d1d;
  border: 1px solid #f0b4b4;
}

.status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.circle-status {
  display: inline-flex;
  width: 22px;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.circle-status.success {
  border: 1px solid var(--green-border);
  background: var(--green-bg);
}

.circle-status.success::after,
.inline-ok::after {
  content: "";
  width: 6px;
  height: 10px;
  border: solid var(--green-text);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.inline-ok {
  display: inline-flex;
  width: 18px;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--green-border);
  border-radius: 50%;
  background: var(--green-bg);
  vertical-align: middle;
  margin-left: 6px;
}

.inline-ok::after {
  width: 5px;
  height: 9px;
}

.circle-status.warning {
  border: 1px solid var(--yellow-border);
  background: #f5d588;
  color: var(--yellow-text);
  font-weight: 800;
}

.provider-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.provider {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #eef0f2;
  border-radius: 8px;
}

.provider input {
  position: static;
  opacity: 1;
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
}

.provider small,
.muted {
  display: block;
  color: var(--muted);
}

.button-line {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.provider-note {
  margin-top: 8px;
  text-align: right;
}

button {
  width: 168px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--button-border);
  border-radius: 6px;
  background: var(--button-bg);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

button:hover,
button:focus {
  border-color: #303030;
  background: var(--button-hover);
  color: #ffffff;
}

.text-link {
  color: var(--link);
  text-decoration: none;
  font-weight: 650;
}

.table-link {
  color: var(--link);
  text-decoration: none;
  font-weight: 400;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.plain-list li + li {
  margin-top: 6px;
}

.form-stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: none;
  margin-bottom: 12px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

input,
select {
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.input-prefix,
.input-suffix {
  display: flex;
  min-height: 32px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #ffffff;
}

.input-prefix > span,
.input-suffix > span {
  display: inline-flex;
  width: 34px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: #f7f7f7;
  border-color: var(--border-strong);
}

.input-prefix > span {
  border-right: 1px solid var(--border-strong);
}

.input-suffix > span {
  border-left: 1px solid var(--border-strong);
}

.input-prefix input,
.input-suffix input {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

pre {
  max-height: 420px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f7f7f7;
  color: var(--text);
  font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 12px;
}

.settings-table {
  min-width: 840px;
}

.settings-table th,
.settings-table td {
  vertical-align: middle;
}

.settings-table input {
  width: 100%;
  min-width: 76px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

@media (max-width: 720px) {
  .page-shell {
    padding: 14px 12px 32px;
  }

  .topbar,
  .card-row {
    display: block;
  }

  .topbar .pill,
  .card-row > .pill,
  .card-row > .status,
  .card-row > button,
  .card-row > .circle-status,
  .card-row > .text-link {
    margin-top: 10px;
  }

  .summary-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .form-stack {
    grid-template-columns: 1fr;
  }

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

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
