:root {
  --bg: #eef1f4;
  --ink: #1f2933;
  --muted: #667085;
  --paper: #ffffff;
  --line: #d8dee6;
  --primary: #d71920;
  --primary-strong: #9d1117;
  --accent: #00aeef;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(31, 41, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(23, 107, 135, 0.12), transparent 38%),
    linear-gradient(315deg, rgba(196, 106, 45, 0.14), transparent 34%),
    var(--bg);
  font-family: Avenir Next, Avenir, Trebuchet MS, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem;
}

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

.brand-with-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-with-logo img {
  width: 180px;
  height: 64px;
  object-fit: contain;
}

.brand-with-logo span {
  white-space: nowrap;
}

.hero-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.hero-brand img {
  width: min(420px, 100%);
  height: auto;
}

.tagline,
.step {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.toplink {
  margin-left: auto;
  color: var(--primary-strong);
  font-weight: 800;
  text-decoration: none;
}

.page {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto 4rem;
}

.panel {
  background: var(--paper);
  border: 1px solid rgba(216, 222, 230, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.narrow {
  max-width: 680px;
  margin: 3rem auto;
}

.wide {
  max-width: 980px;
  margin: 2rem auto;
}

.center {
  text-align: center;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.15rem;
}

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

.deadline {
  color: var(--primary-strong);
  font-weight: 700;
}

.stack {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.4rem;
  font-weight: 750;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfcfd;
  font: inherit;
  padding: 0.8rem 0.9rem;
}

textarea {
  resize: vertical;
}

button,
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-strong);
}

.secondary {
  color: var(--primary-strong);
  background: #dff0f5;
}

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

.icon {
  width: 42px;
  padding: 0;
  background: #f8e7e4;
}

.flash {
  max-width: 980px;
  margin: 1rem auto;
  border: 1px solid #ffd6a8;
  border-radius: 8px;
  background: #fff6ed;
  padding: 0.8rem 1rem;
}

.flash p {
  margin: 0;
}

.question-editor,
.answer-field,
.summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 1rem;
}

.question-editor + .question-editor {
  margin-top: 1rem;
}

.question-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: end;
}

.question-grid,
.ready-grid,
.admin-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
}

.checkline,
.choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 650;
}

.checkline input,
.choice input,
.rating input {
  width: auto;
}

.hidden {
  display: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

.qr-card,
.secret,
.metrics > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  padding: 1rem;
}

.qr-card {
  text-align: center;
}

.qr-card img {
  width: min(240px, 100%);
  height: auto;
}

.secret {
  display: grid;
  gap: 0.2rem;
}

.secret strong {
  font-size: 1.5rem;
}

.answer-field {
  display: grid;
  gap: 0.7rem;
}

.answer-field legend {
  font-weight: 850;
  margin-bottom: 0.5rem;
}

.answer-field legend span {
  color: var(--accent);
}

.rating {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.rating label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.25rem 0;
}

.metrics span {
  display: block;
  font-size: 1.7rem;
  font-weight: 850;
}

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

.shareline {
  margin-top: 1rem;
}

.summary-list {
  display: grid;
  gap: 1rem;
  max-width: 980px;
  margin: 1rem auto;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) 2fr auto;
  gap: 0.8rem;
  align-items: center;
}

meter {
  width: 100%;
}

.text-answers {
  display: grid;
  gap: 0.5rem;
  padding-left: 1.1rem;
}

.box-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
}

.box-actions {
  display: grid;
  gap: 0.5rem;
  min-width: 12rem;
}

.box-actions span {
  color: var(--muted);
  font-weight: 800;
}

.ai-summary {
  margin-top: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 1rem;
}

.summary-text {
  white-space: pre-wrap;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .question-grid,
  .ready-grid,
  .admin-head,
  .metrics,
  .bar-row,
  .box-row {
    grid-template-columns: 1fr;
  }

  .actions {
    display: grid;
  }
}
