:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #162033;
  --muted: #657085;
  --line: #d9e1ee;
  --brand: #147a5c;
  --brand-dark: #0d5f48;
  --accent: #bc5b23;
  --danger: #b3261e;
  --ok: #177245;
  --shadow: 0 18px 50px rgba(30, 43, 66, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(20, 122, 92, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(188, 91, 35, 0.13), transparent 34%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.tab {
  min-width: 86px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}

.tab.active,
.tab:hover {
  background: var(--brand);
  color: #fff;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 360px;
  gap: 28px;
  align-items: stretch;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

.lede {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.panel,
.status-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.status-panel {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.status-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.status-row span,
.panel p {
  color: var(--muted);
}

.status-row strong {
  text-align: right;
  overflow-wrap: anywhere;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 24px;
}

.panel {
  padding: 22px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

h2 {
  margin: 0 0 4px;
  font-size: 22px;
  letter-spacing: 0;
}

.panel p {
  margin: 0;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: #314057;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 13px 14px;
  outline: none;
}

input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(20, 122, 92, 0.13);
}

.challenge {
  display: grid;
  grid-template-columns: 1fr 44px auto;
  gap: 10px;
  align-items: end;
}

.question {
  min-width: 78px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-weight: 800;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.primary {
  width: 100%;
  background: var(--brand);
  color: #fff;
  min-height: 48px;
}

.primary:hover,
#adminButton:hover {
  background: var(--brand-dark);
}

.icon-button {
  width: 44px;
  height: 46px;
  padding: 0;
  background: #e8eef6;
  color: var(--ink);
  font-size: 20px;
}

#adminButton {
  background: var(--brand);
  color: #fff;
}

button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef5f2;
  color: var(--brand-dark);
  font-weight: 800;
  white-space: nowrap;
}

.message {
  min-height: 24px;
  margin-top: 14px;
  overflow-wrap: anywhere;
}

.message.error {
  color: var(--danger);
}

.message.ok {
  color: var(--ok);
}

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

.claim {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.claim:last-child {
  border-bottom: 0;
}

.claim strong,
.claim a {
  overflow-wrap: anywhere;
}

.claim small {
  color: var(--muted);
}

.admin {
  margin-top: 24px;
}

.admin-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

pre {
  overflow: auto;
  max-height: 360px;
  margin: 16px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: #101827;
  color: #dbeafe;
}

@media (max-width: 820px) {
  .topnav {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
  }

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

  .challenge,
  .admin-controls {
    grid-template-columns: 1fr;
  }

  .question,
  .icon-button {
    width: 100%;
  }
}
