* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #fff;
  --fg: #0a0a0a;
  --muted: #666;
  --border: #e5e5e5;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Landing */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  text-align: center;
}

.logo {
  height: 100px;
  width: auto;
  margin-bottom: 0.875rem;
  display: block;
}

.mark {
  width: 36px;
  height: 36px;
  border: 1px solid var(--fg);
  margin-bottom: 0.875rem;
}

.landing-footer {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.landing-footer a {
  color: var(--muted);
  text-decoration: none;
}

.landing-footer a:hover {
  color: var(--fg);
}

.landing h1 {
  font-size: clamp(2.25rem, 6.5vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.tagline {
  font-size: 1.25rem;
  color: var(--muted);
  margin-top: 0.3rem;
  font-weight: 300;
}

.beta {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.6rem;
  font-weight: 400;
}

.divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  margin: 0.875rem 0;
}

.cta {
  font-size: 1rem;
  font-weight: 400;
}

.landing .link {
  margin-top: 0.4rem;
  color: var(--fg);
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 1px;
}

.link:hover {
  opacity: 0.7;
}

/* Admin */
.admin {
  min-height: 100vh;
  padding: 1.5rem;
}

.admin-header {
  max-width: 1200px;
  margin: 0 auto 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--fg);
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 500;
}

.admin-logo {
  height: 36px;
  width: auto;
}

.admin-header h1 {
  font-size: 1.25rem;
  font-weight: 500;
}

.admin-header a {
  color: var(--fg);
  text-decoration: none;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--fg);
}

.admin-content {
  max-width: 1200px;
  margin: 0 auto;
}

.section {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.section-desc code {
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
  background: var(--border);
  padding: 0.1em 0.35em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.stat-card {
  padding: 1rem;
  border: 1px solid var(--border);
  background: var(--bg);
}

.stat-label {
  display: block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.stat-value {
  font-size: 1rem;
  font-weight: 500;
}

.stat-value.ok { color: #16a34a; }
.stat-value.warn { color: #ca8a04; }
.stat-value.err { color: #dc2626; }

/* Live Lag */
.live-lag-link { font-size: 0.75rem; font-weight: 400; margin-left: 0.5rem; color: var(--muted); text-decoration: none; }
.live-lag-link:hover { color: var(--fg); }
.live-lag-section {
  background: var(--border);
  padding: 1.25rem;
  border-radius: 4px;
}

.live-lag {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.live-lag-value {
  font-size: 2rem;
  font-weight: 500;
}

.live-lag-value.ok { color: #16a34a; }
.live-lag-value.warn { color: #ca8a04; }
.live-lag-value.err { color: #dc2626; }

.live-lag-meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.live-lag-updated {
  margin-left: 1rem;
  font-size: 0.75rem;
  opacity: 0.8;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th, td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 500;
  color: var(--muted);
}

tr:last-child td {
  border-bottom: none;
}

.key-cell {
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  word-break: break-all;
}

.muted {
  color: var(--muted);
  font-size: 0.875rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--fg);
  color: var(--bg);
  border: none;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.9;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}

.form-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.form-row input {
  flex: 1;
  min-width: 180px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px solid var(--border);
  background: var(--bg);
}

.form-row input:focus {
  outline: none;
  border-color: var(--fg);
}

/* Mobile */
@media (max-width: 480px) {
  .landing {
    padding: 1.5rem 1rem;
  }

  .logo {
    height: 160px;
    margin-bottom: 2rem;
  }

  .mark {
    margin-bottom: 2rem;
  }

  .divider {
    margin: 2rem 0;
  }

  .admin {
    padding: 1rem;
  }

  th, td {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row input {
    min-width: 100%;
  }
}
