:root {
  --accent: #2E7D32;
  --accent-2: #7CB342;
  --grad: linear-gradient(135deg, #7CB342, #2E7D32);
  --bg: #f6f8f7;
  --card: #ffffff;
  --line: #e3ebe5;
  --text: #152018;
  --muted: #6b7a70;
  --danger: #c62828;
  --warn: #b26a00;
  --ok: #2E7D32;
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.brand b { color: var(--accent); }

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
}

.userbox { display: flex; align-items: center; gap: 12px; }
.user-name { color: var(--muted); font-size: 14px; }

.page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 34px 22px 70px;
}

.hero { padding: 12px 0 22px; }
.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
h1 { margin: 0 0 10px; font-size: clamp(26px, 4vw, 38px); line-height: 1.1; }
h2 { margin: 32px 0 14px; font-size: 20px; }
.lead { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.55; }
.section-note { margin: -4px 0 16px; color: var(--muted); font-size: 14px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(20, 54, 26, .05);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card h3 { margin: 0; font-size: 18px; }
.card p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 14px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: #eef3ef;
  color: var(--muted);
}
.badge.ok { background: #E8F5E9; color: var(--ok); }
.badge.warn { background: #fff4e5; color: var(--warn); }
.badge.off { background: #fdecea; color: var(--danger); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 7px 12px;
  font-size: 13.5px;
}
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 700; color: #33443a; }
input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #dfe6e1;
  border-radius: 11px;
  background: #fbfcfb;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
input:focus { outline: none; border-color: var(--accent); background: #fff; }
.field { margin-bottom: 12px; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 12px; }

.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 4px; }

.btn {
  border: 0;
  border-radius: 11px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(46, 125, 50, .22); }
.btn-secondary { background: #E8F5E9; color: var(--accent); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-danger { background: #fdecea; color: var(--danger); }
.btn-small { padding: 7px 10px; font-size: 12.5px; }

.alert {
  margin: 8px 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fdecea;
  color: var(--danger);
  font-size: 14px;
}
.alert.ok { background: #E8F5E9; color: var(--ok); }
.hidden { display: none !important; }

.code {
  margin: 0 0 12px;
  padding: 16px;
  overflow-x: auto;
  background: #0f1b13;
  color: #d7ead9;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.55;
}

.connect .code { white-space: pre-wrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 15px;
  border-radius: 12px;
  background: #152018;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  font-size: 14px;
  z-index: 30;
}

@media (max-width: 620px) {
  .topbar { padding: 12px 14px; }
  .user-name { display: none; }
  .page { padding: 24px 14px 60px; }
  .card { padding: 17px; }
}
