:root {
  --teal: #1F6F8B;
  --orange: #FF6B35;
  --ink: #111111;
  --gray: #555555;
  --line: #d8dee8;
  --panel: #f5f6f8;
  --ok: #1d5e42;
  --bad: #8a2116;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--panel);
  color: var(--ink);
  line-height: 1.5;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 18px; }
header.site {
  background: #fff;
  border-bottom: 1px solid #d8e5ed;
  padding: 12px 0;
  margin-bottom: 22px;
  box-shadow: 0 8px 20px rgba(24, 52, 66, .05);
}
header.site .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 220px;
}
.brand {
  font-weight: 900;
  color: var(--teal);
  font-size: clamp(22px, 3.4vw, 28px);
  line-height: 1.05;
  text-decoration: none;
  letter-spacing: .01em;
}
.brand-sub {
  color: #3e6070;
  font-size: 13px;
  max-width: 38ch;
}
header.site nav a { color: var(--teal); text-decoration: none; font-weight: 600; margin-left: 14px; }
footer.site { margin: 40px 0 24px; color: var(--gray); font-size: 13px; }
footer.site a { color: var(--gray); }

h1 { font-size: 24px; margin: 0 0 10px; }
h2 { font-size: 19px; margin: 18px 0 8px; }
h3 { font-size: 16px; margin: 14px 0 6px; }
.muted { color: var(--gray); font-size: 14px; }
.fine { font-size: 13px; opacity: .8; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 20px; margin-bottom: 16px;
}
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }

/* ---------------------------------------------------------------- landing page */

.hero {
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  gap: 22px;
  align-items: stretch;
  background:
    radial-gradient(circle at 12% 0%, #d7eef6 0%, #ffffff 42%),
    linear-gradient(145deg, #ffffff 0%, #f4f7fb 100%);
  padding: 26px;
}

.hero-copy h1 { margin-bottom: 10px; }
.product-name {
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.02;
  margin-bottom: 6px;
  color: #0f4860;
  letter-spacing: -0.02em;
}

.product-tagline {
  margin: 0 0 14px;
  color: #2f5666;
  font-size: clamp(16px, 2.1vw, 20px);
}
.hero-eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 12px;
}

.hero-lead {
  margin: 0;
  max-width: 64ch;
  color: #24303f;
}

.hero-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-logo-slot {
  border-radius: 12px;
  background: #eef7fb;
  min-height: 220px;
  max-height: 340px;
  aspect-ratio: 4 / 3;
  padding: 14px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(31, 111, 139, .14);
  display: grid;
  place-items: center;
}

.hero-logo {
  display: block;
  width: min(100%, 420px);
  max-height: clamp(180px, 26vw, 300px);
  height: auto;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 12px 20px rgba(23, 59, 77, .15));
}

.slug-builder {
  max-width: 420px;
}

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

.quick-links .button {
  margin-top: 0;
  text-align: center;
  width: 100%;
}

label { display: block; font-weight: 600; margin: 14px 0 0; }
input, textarea, select {
  width: 100%; font: inherit; padding: 9px 10px; margin-top: 5px;
  border: 1px solid #cfd6df; border-radius: 5px; background: #fff;
}
textarea { min-height: 220px; resize: vertical; }
.hint { display: block; font-weight: 400; color: var(--gray); font-size: 13px; margin-top: 3px; }

button, .button {
  font: inherit; padding: 10px 16px; border-radius: 5px; border: 1px solid #b9c3cf;
  background: #fff; cursor: pointer; text-decoration: none; color: var(--ink);
  display: inline-block; margin-top: 14px;
}
button.primary, .button.primary {
  background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 600;
}
button.big { padding: 13px 22px; font-size: 17px; }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.link { border: 0; background: none; padding: 0; margin: 0; color: var(--teal); text-decoration: underline; }

.errors { background: #fff4f1; border: 1px solid #e0b4ab; border-radius: 5px; padding: 10px 10px 10px 28px; color: var(--bad); }
.notice { background: #eef7f3; border-left: 4px solid var(--teal); padding: 10px 12px; margin: 12px 0; }
.warnbox { background: #fff8ee; border: 1px solid #e8cfa8; border-radius: 6px; padding: 12px 16px; margin: 16px 0; }
.warnbox ul { margin: 6px 0 0; padding-left: 20px; }
.facts { padding-left: 20px; }

table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #eef2f6; font-size: 13px; }
tr.flagged td { background: #fff4f1; }
.scroll { overflow-x: auto; }

.chip {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 9px;
  border-radius: 3px; border: 1px solid #c7ced8; background: #fff; color: var(--gray);
}
.chip.ok { border-color: var(--ok); color: var(--ok); }
.chip.bad { border-color: var(--bad); color: var(--bad); background: #fff4f1; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ------------------------------------------------------------------ sitting page */

body.sitting { background: #fff; }
body.sitting main.wrap { max-width: 1000px; padding-bottom: 60px; }
.exam-header { border-bottom: 2px solid var(--teal); padding: 14px 0; margin-bottom: 18px; }
.exam-header .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.exam-header h1 { font-size: 20px; color: var(--teal); }
.timer { font-size: 26px; font-weight: 800; color: var(--teal); white-space: nowrap; }
.timer.low { color: var(--bad); }
.warning {
  margin-top: 10px; padding: 9px 12px; background: #fff1e7; color: #7a1f13;
  font-weight: 600; border-left: 4px solid var(--orange); font-size: 13px;
}
.alerts { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.alert {
  padding: 9px 14px; border-radius: 3px; font-weight: 700; font-size: 13px;
  border: 1px solid #b8382b; background: #fff4f1; color: #6f1d14;
}
.alert.warn { border-color: #8a6a00; background: #fff8d8; color: #5c4600; }

.progress { display: flex; justify-content: space-between; color: var(--gray); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.option { display: block; font-weight: 400; margin: 8px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.option:hover { background: var(--panel); }
.option input { width: auto; margin-right: 8px; }
.prompt { white-space: pre-wrap; margin: 12px 0; }
.selectbox { display: flex; gap: 10px; align-items: flex-start; border: 2px solid #b8c2ce; border-radius: 6px; padding: 12px; font-weight: 600; }
.selectbox.selected { border-color: var(--ok); background: #eef7f3; }
.selectbox input { width: auto; margin-top: 3px; transform: scale(1.2); }
.sectionc { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; margin-bottom: 12px; background: #eef7f3; border: 1px solid #9bc8b5; border-radius: 6px; }
.sectionc strong { width: 100%; color: #173b2c; }
.badge { font-size: 13px; padding: 4px 8px; border: 1px solid #b8c2ce; border-radius: 4px; background: #fff; }
.badge.selected { background: #173b2c; color: #fff; border-color: #173b2c; font-weight: 700; }
.badge.written { border-color: #d3a22b; }
.actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.actions .group { display: flex; gap: 8px; }

#proctorVideo, #proctorCanvas { position: fixed; left: -10000px; top: 0; width: 320px; height: 240px; }

#paperShield { display: none; }
body.blanked #paperShield { display: block; position: fixed; inset: 0; z-index: 8000; background: #0b1220; }
#blackout, .overlay {
  position: fixed; inset: 0; z-index: 9000; background: #0b1220; color: #fff;
  display: none; align-items: center; justify-content: center; text-align: center; padding: 24px;
}
.overlay { display: flex; background: rgba(11, 18, 32, .97); }
#blackout .panel, .overlay .panel { max-width: 620px; }
.overlay .panel.wide { max-width: 720px; text-align: left; }
.overlay .panel h2, #blackout h2 { font-size: 28px; margin: 0 0 12px; color: var(--orange); }
.overlay .panel .notice { background: rgba(255,255,255,.08); border-left-color: var(--orange); color: #fff; }
.overlay .facts { color: #cfd8e6; }
#blackout .count { font-size: 42px; font-weight: 800; margin: 14px 0; }
#blackout button, .overlay button {
  background: var(--orange); border: 0; color: #fff; font-weight: 800; font-size: 18px;
  padding: 13px 24px; border-radius: 5px; cursor: pointer;
}
.overlay button:disabled { background: #4a5568; }

/* ------------------------------------------------------------------- admin panel */

.admin-nav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-nav a { color: var(--teal); font-weight: 600; text-decoration: none; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { flex: 1 1 150px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.stat .n { font-size: 28px; font-weight: 800; color: var(--teal); }
.stat .n.bad { color: var(--bad); }
.stat .k { font-size: 13px; color: var(--gray); }
.snapshots { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.snapshots figure { margin: 0; width: 240px; }
.snapshots img { width: 100%; border: 1px solid var(--line); border-radius: 5px; display: block; }
.snapshots figcaption { font-size: 12px; color: var(--gray); margin-top: 4px; }
.inline-form { display: inline; }
.inline-form button { margin: 0; padding: 4px 9px; font-size: 13px; }
code, pre { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
pre { background: var(--panel); padding: 12px; border-radius: 5px; overflow-x: auto; }

/* ---------------------------------------------------------- responsive layout */

@media (max-width: 980px) {
  .quick-links {
    grid-template-columns: 1fr 1fr;
  }

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

  .stat {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .wrap {
    padding: 0 12px;
  }

  header.site {
    padding: 10px 0;
  }

  .brand-lockup { width: 100%; }

  .brand {
    width: 100%;
    font-size: clamp(20px, 8vw, 30px);
  }

  .brand-sub {
    font-size: 12px;
    max-width: none;
  }

  header.site nav {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
  }

  header.site nav a {
    margin-left: 0;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    padding: 18px;
    gap: 14px;
  }

  .hero-logo-slot {
    min-height: 160px;
    max-height: 260px;
    padding: 10px;
  }

  .hero-logo {
    width: min(100%, 320px);
    max-height: 220px;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    gap: 8px;
  }

  .admin-nav a {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px 10px;
    background: #fff;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  th, td {
    padding: 7px 8px;
  }

  button.big {
    width: 100%;
  }
}
