:root {
  --brand: #123f5a;
  --brand-dark: #0b2d42;
  --accent: #b66a42;
  --gold: #d7b46a;
  --ink: #17242c;
  --muted: #61717b;
  --line: #d8e1e6;
  --page: #f3f7f8;
  --panel: #ffffff;
  --ok: #1f7a4d;
  --warn: #a66f14;
  --risk: #a43d3d;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 28px rgba(18, 63, 90, 0.18);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--brand);
  background: #fff;
  font-weight: 800;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; line-height: 1.15; }
h2 { font-size: 20px; line-height: 1.25; }
h3 { font-size: 15px; margin-bottom: 5px; }

.topbar p,
.eyebrow {
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 0.8;
}

main {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 14px;
}

.panel {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 2px 12px rgba(23, 36, 44, 0.05);
}

.grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input, textarea, select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 15px;
}

textarea { resize: vertical; }

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

.dashboard article {
  padding: 14px;
  border-radius: 8px;
  background: var(--brand-dark);
  color: #fff;
}

.dashboard span {
  display: block;
  font-size: 26px;
  font-weight: 800;
}

.dashboard p {
  margin-top: 3px;
  color: #dbe8ee;
  font-size: 13px;
  font-weight: 700;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.meta span {
  border-radius: 999px;
  padding: 7px 10px;
  background: #e8f0f4;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.evidence-box {
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 12px;
  background: #fbf4f0;
  line-height: 1.45;
}

.field-stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.helper {
  color: var(--brand);
  font-weight: 800;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 10px 13px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

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

.topbar button {
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  background: var(--brand-dark);
}

.topbar .admin-button {
  background: rgba(11, 45, 66, 0.72);
}

.toggle {
  color: var(--brand);
  background: #e8f0f4;
}

.toggle.active {
  color: #fff;
  background: var(--ok);
}

.buttons {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 9px;
  margin-top: 14px;
}

.primary { color: #fff; background: var(--brand); }
.secondary { color: var(--brand); background: #e8f0f4; }
.small { min-height: 36px; }

footer {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 0 14px 26px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: auto 1fr;
  }

  .header-actions {
    grid-column: 1 / -1;
    width: 100%;
    flex-direction: column;
  }

  .topbar button {
    width: 100%;
  }

  .header-actions .admin-button {
    display: none;
  }

  h1 { font-size: 20px; }
  main { padding: 10px; }
  .panel { padding: 13px; }
  .three, .two, .dashboard, .score-grid, .buttons {
    grid-template-columns: 1fr;
  }
}

.auth-pending main,
.auth-pending footer {
  visibility: hidden;
}

.auth-controls {
  display: grid;
  gap: 4px;
  min-width: 190px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(11, 45, 66, 0.92);
}

.auth-controls span {
  color: #dbe8ee;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.auth-controls button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--brand);
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 720px) {
  .auth-controls {
    width: 100%;
  }
}
