:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-2: #eef2ed;
  --text: #17201b;
  --muted: #647169;
  --border: #dce3dd;
  --accent: #176b47;
  --accent-hover: #10563a;
  --danger: #a73a31;
  --warning: #9a6417;
  --radius: .75rem;
  --shadow: 0 1px 2px rgb(15 23 18 / 6%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgb(23 107 71 / 25%); outline-offset: 2px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem max(1rem, calc((100vw - 1180px) / 2)); border-bottom: 1px solid var(--border); background: rgb(255 255 255 / 86%); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 5; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.25rem, 3vw, 1.75rem); letter-spacing: -.025em; }
h2 { font-size: 1.125rem; letter-spacing: -.015em; }
.eyebrow { color: var(--accent); font-size: .7rem; font-weight: 800; letter-spacing: .13em; margin-bottom: .25rem; }
.muted { color: var(--muted); font-size: .875rem; }
.page { width: min(1180px, calc(100% - 2rem)); margin: 1.5rem auto 4rem; display: grid; gap: 1rem; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--border); box-shadow: var(--shadow); }
.summary div { background: var(--surface); padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: baseline; }
.summary span { color: var(--muted); font-size: .8rem; }
.summary strong { font-size: 1.4rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { padding: 1.25rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.actions-heading { align-items: center; }
.url-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1.25rem; }
label { display: grid; gap: .4rem; font-size: .8rem; font-weight: 700; color: #354239; }
input, textarea { width: 100%; border: 1px solid #cbd5ce; border-radius: .5rem; padding: .7rem .75rem; color: var(--text); background: #fff; }
textarea { resize: vertical; min-height: 5rem; }
.copy-field { display: grid; grid-template-columns: 1fr auto; }
.copy-field input { border-radius: .5rem 0 0 .5rem; background: var(--surface-2); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .78rem; }
.copy-field button { border: 1px solid #cbd5ce; border-left: 0; border-radius: 0 .5rem .5rem 0; background: #fff; padding: 0 .8rem; color: var(--accent); font-weight: 700; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.primary, .secondary, .ghost, .danger, .icon-btn { border-radius: .5rem; padding: .65rem .9rem; border: 1px solid transparent; font-weight: 700; }
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-hover); }
.secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.danger { color: var(--danger); background: #fff5f4; border-color: #f0d0cc; }
.icon-btn { background: transparent; font-size: 1.5rem; line-height: 1; color: var(--muted); padding: .35rem .55rem; }
.full { width: 100%; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 700px; }
th, td { text-align: left; padding: .9rem 1.25rem; border-bottom: 1px solid var(--border); font-size: .85rem; }
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; background: #fbfcfb; }
tbody tr:last-child td { border-bottom: 0; }
.align-right { text-align: right; }
.node-name { font-weight: 750; }
.node-meta { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .75rem; margin-top: .2rem; }
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .5rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .72rem; font-weight: 750; }
.badge.online { background: #e9f7ef; color: #14613e; }
.badge.offline { background: #fff0ee; color: var(--danger); }
.badge.enabled { color: var(--accent); }
.row-actions { display: flex; justify-content: flex-end; gap: .4rem; }
.row-actions button { padding: .4rem .55rem; font-size: .76rem; }
.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.empty strong { color: var(--text); display: block; margin-bottom: .35rem; }
.status { min-height: 0; padding: 0 1.25rem; color: var(--accent); font-size: .8rem; }
.status:not(:empty) { padding-top: .75rem; }
dialog { border: 0; border-radius: .875rem; padding: 0; width: min(620px, calc(100% - 1.5rem)); box-shadow: 0 24px 70px rgb(16 32 22 / 24%); }
dialog::backdrop { background: rgb(12 20 15 / 55%); backdrop-filter: blur(3px); }
#node-form { padding: 1.25rem; }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; margin-bottom: 1.25rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.wide { grid-column: 1 / -1; }
.or { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .7rem; margin: 1rem 0; }
.or::before, .or::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.checks { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
.checks label { display: flex; align-items: center; gap: .45rem; }
.checks input { width: auto; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }
.alert { border-radius: .5rem; padding: .7rem .8rem; font-size: .82rem; margin: .8rem 0; }
.alert.error { color: var(--danger); background: #fff0ee; border: 1px solid #f0d0cc; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #edf3ee, #f8f9f6); }
.login-shell { width: min(420px, calc(100% - 2rem)); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; padding: 2rem; box-shadow: 0 18px 50px rgb(16 32 22 / 10%); }
.login-card .muted { margin: .5rem 0 1.5rem; }
.brand-mark { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: .65rem; background: var(--accent); color: #fff; font-weight: 900; margin-bottom: 1.25rem; }
.stack { display: grid; gap: 1rem; }
@media (max-width: 720px) {
  .page { width: min(100% - 1rem, 1180px); margin-top: .75rem; }
  .topbar { padding: 1rem; }
  .summary div { display: grid; gap: .25rem; padding: .8rem; }
  .url-list, .form-grid { grid-template-columns: 1fr; }
  .panel-heading { align-items: start; flex-direction: column; }
  .toolbar { width: 100%; justify-content: stretch; }
  .toolbar button { flex: 1; }
  .subscriptions .muted { display: none; }
  #node-form { padding: 1rem; }
}

