:root {
  --bg: #f6f7f4;
  --ink: #17201d;
  --muted: #63716d;
  --line: #d9dfda;
  --panel: #ffffff;
  --accent: #0f8b8d;
  --accent-dark: #0a5e60;
  --warn: #b7791f;
  --bad: #b42318;
  --good: #067647;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

.hidden {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  min-height: 42px;
  padding: 0 16px;
}

button:hover {
  background: var(--accent-dark);
}

button.ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

select {
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 38px;
  padding: 0 10px;
}

.login-screen {
  align-items: center;
  background: #111815;
  display: flex;
  min-height: 100vh;
  padding: 24px;
}

.login-box {
  background: white;
  border-radius: 8px;
  margin: 0 auto;
  max-width: 420px;
  padding: 30px;
  width: 100%;
}

.login-box h1 {
  font-size: 30px;
  margin-bottom: 20px;
}

.topbar {
  align-items: center;
  background: #111815;
  color: white;
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 28px;
}

.brand {
  font-size: 24px;
  font-weight: 850;
  letter-spacing: 0;
}

.subtitle {
  color: #b9c7c2;
  font-size: 13px;
  margin-top: 2px;
}

nav {
  display: flex;
  gap: 10px;
}

nav a {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #eff5f2;
  padding: 10px 12px;
}

.shell {
  margin: 0 auto;
  max-width: 1220px;
  padding: 28px;
}

.hero-panel {
  align-items: end;
  background: #e7efed;
  border: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 26px;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1, h2, p {
  margin-top: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.08;
  margin-bottom: 0;
  max-width: 680px;
}

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

.license {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--good);
  font-weight: 800;
  padding: 12px 14px;
}

.metrics {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.metric strong {
  display: block;
  font-size: 32px;
  margin-top: 8px;
}

.grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 18px;
}

.panel-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.panel-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

.actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.site-form {
  display: grid;
  gap: 12px;
}

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

.list {
  display: grid;
  gap: 10px;
}

.row {
  align-items: center;
  background: #f9faf8;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

.row strong,
.row span {
  display: block;
}

.row span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.badge {
  border-radius: 999px;
  color: white !important;
  font-size: 12px !important;
  font-weight: 800;
  margin: 0 !important;
  padding: 5px 8px;
}

.badge.open {
  background: var(--good);
}

.badge.used {
  background: var(--muted);
}

.badge.live,
.badge.dry {
  margin: 0 !important;
}

.badge.live {
  background: var(--good);
}

.badge.dry {
  background: var(--warn);
}

.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.check.compact {
  margin: 4px 0;
}

.script {
  background: #101815;
  border-radius: 8px;
  color: #e6f4ef;
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
  max-height: 360px;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

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

.toast {
  background: var(--bad);
  bottom: 18px;
  color: white;
  left: 18px;
  padding: 12px 14px;
  position: fixed;
}

.portal {
  background:
    linear-gradient(90deg, rgba(15, 139, 141, 0.9), rgba(17, 24, 21, 0.78)),
    url("https://images.unsplash.com/photo-1566073771259-6a8506099945?auto=format&fit=crop&w=1800&q=80");
  background-position: center;
  background-size: cover;
  min-height: 100vh;
}

.portal-shell {
  align-items: center;
  display: flex;
  min-height: 100vh;
  padding: 24px;
}

.portal-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
  max-width: 460px;
  padding: 30px;
  width: 100%;
}

.portal-brand {
  color: var(--accent-dark);
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 22px;
}

.portal-copy {
  color: var(--muted);
  line-height: 1.55;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.field span,
.check {
  color: var(--muted);
  font-size: 14px;
}

input {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  min-height: 44px;
  padding: 0 12px;
  width: 100%;
}

.check {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  line-height: 1.4;
  margin: 18px 0;
}

.check input {
  min-height: auto;
  margin-top: 3px;
  width: auto;
}

.portal-card button {
  width: 100%;
}

.result {
  border-radius: 6px;
  font-weight: 750;
  margin-top: 14px;
  min-height: 0;
  padding: 0;
}

.result.ok,
.result.error {
  padding: 12px;
}

.result.ok {
  background: #e7f7ef;
  color: var(--good);
}

.result.error {
  background: #fee4e2;
  color: var(--bad);
}

@media (max-width: 820px) {
  .topbar,
  .hero-panel {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .shell {
    padding: 18px;
  }

  .metrics,
  .grid.two {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }
}
