:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #eef2f7;
  --text: #1d2433;
  --muted: #627084;
  --line: #d8dee8;
  --primary: #1267a8;
  --primary-dark: #0c4c7d;
  --danger: #b42318;
  --success: #027a48;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 14px;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.page-head {
  margin-bottom: 20px;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.card h2,
.card h3 {
  margin-top: 0;
}

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

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.button.secondary,
button.secondary {
  background: var(--surface);
  color: var(--primary);
}

button:disabled,
.button.disabled {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  cursor: not-allowed;
}

label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #b8c2d1;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 96px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-soft);
}

.flash {
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 6px;
  background: #e7f5ff;
  border: 1px solid #91caff;
}

.flash.error {
  background: #fff0f0;
  border-color: #ffb3b3;
  color: var(--danger);
}

.flash.success {
  background: #ecfdf3;
  border-color: #a6f4c5;
  color: var(--success);
}

.login-card {
  max-width: 520px;
  margin: 40px auto;
}

.metric {
  font-size: 32px;
  font-weight: 800;
  margin: 4px 0;
}

.question {
  margin-bottom: 18px;
}

.question-image,
.choice-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.question-image {
  max-height: 420px;
}

.choice-image {
  max-height: 220px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0;
}

.choice input {
  width: auto;
  margin-top: 6px;
}

.choice-content {
  min-width: 0;
}

.timer {
  position: sticky;
  top: 0;
  z-index: 1;
  margin-bottom: 16px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 700;
}

.video {
  width: 100%;
  max-height: 70vh;
  background: #000;
  border-radius: 8px;
}

@media (max-width: 720px) {
  .site-header__inner {
    align-items: flex-start;
    flex-direction: column;
  }
}
