:root {
  --bg: #0b1220;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.70);
  --muted-2: rgba(255, 255, 255, 0.55);
  --danger: #ff5c5c;
  --success: #24d18f;
  --warning: #ffcc66;
  --accent: #6aa9ff;

  --radius: 14px;
  --shadow: 0 16px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(106, 169, 255, 0.22), transparent 55%),
    radial-gradient(900px 500px at 100% 10%, rgba(36, 209, 143, 0.14), transparent 60%),
    radial-gradient(900px 700px at 70% 100%, rgba(255, 204, 102, 0.10), transparent 60%),
    var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.35;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 28px auto;
}

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

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.2px;
}

.brand .sub {
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 900px) {
  .grid.cols-2 {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
  }
}

.card {
  background: linear-gradient(180deg, var(--panel), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 80ms ease, background 120ms ease, border-color 120ms ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn:active { transform: translateY(1px); }

.btn.primary {
  background: rgba(106, 169, 255, 0.16);
  border-color: rgba(106, 169, 255, 0.35);
}

.btn.danger {
  background: rgba(255, 92, 92, 0.12);
  border-color: rgba(255, 92, 92, 0.35);
}

.btn.link {
  background: transparent;
  border-color: transparent;
  padding: 8px 10px;
}

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

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

.input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
}

.input:focus {
  outline: none;
  border-color: rgba(106, 169, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(106, 169, 255, 0.16);
}

.help {
  color: var(--muted-2);
  font-size: 12px;
}

.code {
  margin: 0;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.86);
  overflow: auto;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.badge.success {
  background: rgba(36, 209, 143, 0.12);
  border-color: rgba(36, 209, 143, 0.35);
  color: rgba(226, 255, 245, 0.92);
}

.badge.danger {
  background: rgba(255, 92, 92, 0.12);
  border-color: rgba(255, 92, 92, 0.35);
  color: rgba(255, 231, 231, 0.92);
}

.badge.warning {
  background: rgba(255, 204, 102, 0.12);
  border-color: rgba(255, 204, 102, 0.35);
  color: rgba(255, 246, 222, 0.92);
}

.kv {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

@media (min-width: 720px) {
  .kv {
    grid-template-columns: 1fr 1fr;
  }
}

.kv .item {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.kv .k {
  color: var(--muted-2);
  font-size: 12px;
  margin-bottom: 3px;
}

.kv .v {
  font-weight: 650;
  font-size: 13px;
  word-break: break-word;
}

.results {
  display: grid;
  gap: 12px;
}

.result {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  padding: 14px;
}

.result .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.result .title {
  font-weight: 700;
}

.log {
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  padding: 10px;
  max-height: 220px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
}

.log .line {
  white-space: pre-wrap;
  margin: 0 0 6px;
}

hr.sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

.footer-note {
  color: var(--muted-2);
  font-size: 12px;
}
