:root {
  --bg: #000000;
  --bg-elevated: #0c0c0c;
  --surface: rgba(18, 18, 18, 0.92);
  --ink: #ffffff;
  --muted: #7a8f5c;
  --muted-soft: #9aa891;
  --line: rgba(112, 184, 45, 0.22);
  --line-soft: rgba(255, 255, 255, 0.08);
  --accent: #70a73f;
  --accent-bright: #8fc24f;
  --accent-dim: rgba(112, 167, 63, 0.14);
  --accent-ink: #000000;
  --up: #70a73f;
  --down: #e5484d;
  --unknown: #8b9288;
  --danger: #c62828;
  --radius: 4px;
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Orbitron", "Exo 2", "Manrope", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

.bg-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 45% at 8% -8%, rgba(112, 184, 45, 0.16), transparent 55%),
    radial-gradient(ellipse 55% 40% at 95% 5%, rgba(112, 184, 45, 0.08), transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(112, 184, 45, 0.06), transparent 55%),
    linear-gradient(180deg, #050505 0%, #000000 55%, #050805 100%);
}

a { color: var(--ink); }
a:hover { color: var(--accent-bright); }

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-link:hover { color: var(--ink); }

.brand-mark {
  width: 1.85rem;
  height: 1.85rem;
  flex-shrink: 0;
}

.brand-wordmark {
  height: 1.05rem;
  width: auto;
  display: block;
}

.brand-wordmark-hero {
  height: 2rem;
  width: auto;
  display: block;
}

.brand-wordmark-footer {
  height: 0.8rem;
}

.brand-lockup-hero {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  margin-bottom: 0.35rem;
}

.brand-mark-hero {
  width: 4.5rem;
  height: 4.5rem;
}

.brand-tagline {
  margin: 0;
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  background: rgba(0, 0, 0, 0.65);
}

.wordmark,
.wordmark-sm,
.wordmark-hero {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

.wordmark { font-size: 1.1rem; }
.wordmark-sm { font-size: 0.85rem; letter-spacing: 0.12em; }
.wordmark-hero {
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  line-height: 0.95;
  margin: 0.2rem 0 0.4rem;
  letter-spacing: 0.1em;
}

.wordmark .accent-x,
.wordmark-sm .accent-x,
.wordmark-hero .accent-x {
  color: var(--accent);
}

.topnav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  font-size: 0.92rem;
}

.topnav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--muted-soft);
}

.topnav a:hover { color: var(--accent-bright); }

.shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 1.75rem auto 3rem;
}

.shell-narrow { width: min(420px, calc(100% - 2rem)); }
.shell-not-found { width: min(640px, calc(100% - 1.5rem)); }
.shell-login { margin-top: 10vh; }

.site-footer {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line-soft);
}

.site-footer .brand-wordmark {
  opacity: 0.95;
}

.tagline {
  font-style: normal;
  font-family: var(--display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.made-by {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.app-version {
  margin: 0.35rem 0 0;
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
  opacity: 0.85;
}

.made-by a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.made-by a:hover {
  color: var(--text);
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-head h1 {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0.15rem 0;
  letter-spacing: 0.02em;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--display);
}

.eyebrow a { text-decoration: none; color: var(--accent); }
.eyebrow a:hover { color: var(--accent-bright); }

.lede {
  color: var(--muted-soft);
  margin: 0.75rem 0 1.5rem;
  text-align: center;
}

.muted { color: var(--muted-soft); }
.mono { font-variant-numeric: tabular-nums; font-size: 0.92em; }
.right { text-align: right; }
.truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.inline { display: inline; margin: 0; }

.login-panel {
  padding: 2rem 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  box-shadow: 0 0 40px rgba(112, 184, 45, 0.06);
}

.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: not-found-rise 0.55s ease-out both;
}

.not-found-brand {
  position: relative;
  z-index: 1;
  margin-bottom: -0.35rem;
  animation: not-found-fade 0.7s ease-out both;
}

.not-found-art {
  margin: -0.5rem 0 -1.75rem;
  width: min(100%, 34rem);
  pointer-events: none;
  animation: not-found-fade 0.75s ease-out 0.06s both;
  -webkit-mask-image: radial-gradient(ellipse 72% 68% at 50% 48%, #000 42%, transparent 78%);
  mask-image: radial-gradient(ellipse 72% 68% at 50% 48%, #000 42%, transparent 78%);
}

.not-found-art picture,
.not-found-art img {
  display: block;
  width: 100%;
  height: auto;
}

.not-found-title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.not-found-lede {
  position: relative;
  z-index: 1;
  margin: 0.85rem auto 1.5rem;
  max-width: 30ch;
}

.not-found-actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  width: 100%;
}

.not-found-actions .btn {
  min-width: 10rem;
  margin-inline: auto;
  animation: not-found-fade 0.85s ease-out 0.12s both;
}

@keyframes not-found-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes not-found-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .not-found,
  .not-found-brand,
  .not-found-art,
  .not-found-actions .btn {
    animation: none;
  }
}

.stack { display: grid; gap: 1rem; }
.stack label,
.form-grid label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted-soft);
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  font: inherit;
  color: var(--ink);
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(112, 184, 45, 0.35);
  border-color: var(--accent);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 0.75rem; align-items: center; margin-top: 0.25rem; }

.check {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  align-self: end;
  padding-bottom: 0.4rem;
}
.check.compact { padding: 0; font-weight: 400; }

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.form-inline input[type="url"] { flex: 1 1 240px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-bright);
  color: var(--accent-ink);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.85rem; font-weight: 600; }

.linkish {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linkish:hover { color: var(--accent-bright); }
.linkish.danger { color: var(--down); }

.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.data th,
.data td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.data th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  font-family: var(--display);
  background: rgba(112, 184, 45, 0.06);
}
.data tr:last-child td { border-bottom: none; }
.data tr:hover td { background: rgba(112, 184, 45, 0.04); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--display);
}
.badge-up { background: var(--accent-dim); color: var(--up); }
.badge-down { background: rgba(229, 72, 77, 0.18); color: var(--down); }
.badge-unknown { background: rgba(139, 146, 136, 0.2); color: var(--unknown); }

.flash-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.flash {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  margin: 0 0 0.5rem;
  border: 1px solid var(--line);
  background: rgba(12, 12, 12, 0.9);
}
.flash-success { border-color: rgba(112, 184, 45, 0.45); color: var(--up); }
.flash-error { border-color: rgba(229, 72, 77, 0.45); color: var(--down); }

.section {
  margin-top: 2rem;
  padding-top: 0.5rem;
}
.section h2 {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.85rem;
  letter-spacing: 0.03em;
}
.subhead {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
}
.empty {
  padding: 1.5rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted-soft);
  background: rgba(12, 12, 12, 0.7);
}

.target-edit { display: grid; gap: 0.4rem; }
.target-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.error-line { margin: 0; color: var(--down); font-size: 0.85rem; }

.danger-zone {
  border-top: 1px solid var(--line-soft);
  padding-top: 1.5rem;
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .data { display: block; overflow-x: auto; }
  .brand-mark-hero { width: 3.75rem; height: 3.75rem; }
}
