* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f7fb;
  color: #172033;
  font: 16px system-ui, -apple-system, Segoe UI, sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px max(18px, calc((100% - 1100px) / 2));
  background: #fff;
  border-bottom: 1px solid #d9e0ea;
}

.topbar h1 {
  margin: 0;
  font-size: 1.35rem;
}

.topbar p {
  margin: 4px 0 0;
  color: #5d6b82;
  font-size: 0.9rem;
}

main {
  width: min(1100px, calc(100% - 30px));
  margin: 24px auto 64px;
}

nav,
.toolbar,
.tabs,
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar {
  justify-content: space-between;
}

.card,
.question {
  margin: 16px 0;
  padding: 18px;
  background: #fff;
  border: 1px solid #d9e0ea;
  border-radius: 14px;
  box-shadow: 0 5px 18px rgba(23, 32, 51, 0.05);
}

.narrow {
  max-width: 480px;
  margin: 50px auto;
}

h2,
h3 {
  margin-top: 0;
}

label {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-weight: 650;
}

input,
textarea,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #b8c4d4;
  border-radius: 9px;
  color: #172033;
  background: #fff;
  font: inherit;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

button {
  border: 0;
  border-radius: 9px;
  padding: 10px 14px;
  background: #1459c7;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.06);
}

button.secondary,
.tabs button {
  background: #e8eef8;
  color: #183765;
}

.message {
  min-height: 1.3em;
}

.success {
  color: #126137;
}

.error {
  color: #9a1c1c;
}

.option {
  display: block;
  width: 100%;
  margin: 8px 0;
  text-align: left;
  color: #172033;
  background: #eef2f7;
}

.option.correct {
  background: #dff6e7;
  border: 1px solid #269657;
}

.option.incorrect {
  background: #ffebeb;
  border: 1px solid #d64545;
}

.option-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.option-row input[type="radio"] {
  width: auto;
}

.question small {
  color: #5d6b82;
}

.admin-question {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.admin-question h3 {
  margin: 3px 0;
}

.admin-question .actions {
  align-self: center;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

td,
th {
  padding: 10px;
  border: 1px solid #d9e0ea;
  text-align: left;
  vertical-align: top;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #edf1f6;
}

@media (max-width: 650px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
  }

  nav button {
    flex: 1;
  }

  .admin-question {
    flex-direction: column;
  }

  .admin-question .actions button {
    flex: 1;
  }

  .toolbar input {
    width: 100%;
  }
}