:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --panel: #ffffff;
  --ink: #17211b;
  --muted: #66736b;
  --line: #dce4de;
  --accent: #16775b;
  --accent-dark: #105943;
  --error: #b42318;
  --ok: #067647;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

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

h1 {
  font-size: 24px;
}

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

p {
  margin: 6px 0 0;
  color: var(--muted);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

nav a,
button {
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

nav a {
  background: #ffffff;
  color: var(--accent-dark);
}

.secondary-button {
  background: #ffffff;
  color: var(--accent-dark);
}

button:hover,
nav a:hover {
  border-color: var(--accent-dark);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 56px;
}

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

.panel {
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.narrow {
  max-width: 720px;
}

.copyline {
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfa;
  padding: 12px;
  font-family: Consolas, Monaco, monospace;
}

.stack {
  display: grid;
  gap: 14px;
}

.pin-form {
  margin-top: 16px;
}

.lock-form {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}

textarea {
  resize: vertical;
}

dl {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px 12px;
  margin: 0;
}

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

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

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

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

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

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

.badge {
  display: inline-block;
  min-width: 76px;
  border-radius: 999px;
  padding: 3px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.badge.inbound {
  background: #e8f6ef;
  color: #067647;
}

.badge.outbound {
  background: #eef4ff;
  color: #175cd3;
}

.notice {
  margin-bottom: 16px;
  border-radius: 6px;
  padding: 12px;
}

.compact-notice {
  margin-bottom: 8px;
  padding: 8px;
}

.success {
  background: #e8f6ef;
  color: var(--ok);
}

.error {
  background: #ffebe9;
  color: var(--error);
}

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

.ok {
  color: var(--ok);
  font-weight: 700;
}

.fail {
  color: var(--error);
  font-weight: 700;
}

.response-card {
  display: grid;
  gap: 16px;
}

.response-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.json-block {
  max-height: 420px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101815;
  color: #edf7f1;
  padding: 14px;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.small-json {
  max-height: 220px;
  min-width: 360px;
}

@media (max-width: 760px) {
  header,
  .grid {
    grid-template-columns: 1fr;
  }

  header {
    display: grid;
    padding: 18px;
  }

  main {
    width: min(100% - 20px, 1180px);
    margin-top: 10px;
  }

  dl {
    grid-template-columns: 1fr;
  }

  .response-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
