:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #172033;
  background: #f6f8fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 2rem;
  background:
    radial-gradient(circle at top left, rgba(90, 141, 238, 0.18), transparent 28rem),
    linear-gradient(135deg, #f6f8fb 0%, #eef3f9 100%);
}

body:has(.card) {
  display: grid;
  place-items: center;
}

.card:has(.camera-panel) {
  width: min(94vw, 820px);
}

.card,
.dashboard {
  width: min(92vw, 720px);
  padding: 4rem 3rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(23, 32, 51, 0.12);
}

.card {
  text-align: center;
}

.dashboard {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 2rem;
}

.eyebrow {
  margin: 0 0 1rem;
  color: #4f6fba;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin: 0;
  font-size: 1.1rem;
}

.intro {
  max-width: 36rem;
  margin: 1.4rem auto 0;
  color: #5e6b7e;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  line-height: 1.7;
}

.stack {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
  text-align: left;
}

label,
legend {
  color: #263349;
  font-weight: 700;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  color: #172033;
  font: inherit;
  background: #fff;
  border: 1px solid #d9e1ee;
  border-radius: 14px;
  outline: none;
}

textarea {
  resize: vertical;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: #4f6fba;
  box-shadow: 0 0 0 4px rgba(79, 111, 186, 0.14);
}

button,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.8rem 1.1rem;
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  background: #294ca6;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.ghost-button {
  color: #294ca6;
  background: #eef4ff;
}

.danger-button {
  color: #b42318;
  background: #fee4e2;
}

.actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

fieldset {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
}

.choices {
  display: grid;
  gap: 0.8rem;
}

.questions-list {
  display: grid;
  gap: 1.25rem;
}

.page-progress {
  margin: 0;
  color: #667085;
  font-weight: 800;
}

.question-block {
  padding: 1.25rem;
  background: #fff;
  border: 1px solid #dce4f1;
  border-radius: 18px;
}

.assessment-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.choice {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding: 1rem;
  background: #fff;
  border: 1px solid #dce4f1;
  border-radius: 16px;
}

.message {
  min-height: 1.4rem;
  margin: 0;
  color: #b42318;
  font-weight: 700;
}

.warning-banner {
  margin-top: 1.5rem;
  padding: 1rem;
  color: #7a271a;
  text-align: left;
  background: #ffead5;
  border: 1px solid #fdb022;
  border-radius: 16px;
}

.timer-panel {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.25rem;
  padding: 0.7rem 1rem;
  color: #263349;
  background: #eef4ff;
  border: 1px solid #c7d7fe;
  border-radius: 999px;
}

.timer-panel span {
  color: #667085;
  font-size: 0.9rem;
  font-weight: 700;
}

.timer-panel strong {
  color: #294ca6;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.timer-panel strong.danger {
  color: #b42318;
}

.camera-panel {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
  padding: 1rem;
  text-align: left;
  background: #f8fbff;
  border: 1px solid #d9e5f7;
  border-radius: 20px;
}

.camera-panel video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #111827;
  border-radius: 14px;
  transform: scaleX(-1);
}

.camera-panel h2 {
  margin-bottom: 0.4rem;
}

.camera-panel p {
  margin: 0;
  color: #667085;
  line-height: 1.5;
}

.completion {
  text-align: center;
}

.completion h2 {
  font-size: 2.4rem;
}

.dashboard-header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: space-between;
}

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

.stats article,
.table-card {
  background: #fff;
  border: 1px solid #e2e8f3;
  border-radius: 20px;
}

.stats article {
  padding: 1.4rem;
}

.stats span {
  display: block;
  font-size: 2.3rem;
  font-weight: 900;
}

.stats p {
  margin: 0.25rem 0 0;
  color: #667085;
}

.table-card {
  overflow: hidden;
}

.form-card {
  margin: 2rem 0;
}

.question-editor {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
}

.choice-grid,
.form-row {
  display: grid;
  gap: 1rem;
}

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

.form-row {
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
}

.inline-check {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  min-height: 3rem;
}

.table-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  border-bottom: 1px solid #e2e8f3;
}

.table-header p {
  margin: 0;
  color: #667085;
}

.table-wrap {
  overflow-x: auto;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid #edf1f7;
  white-space: nowrap;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f8fbff;
}

.clickable-row:focus {
  outline: 3px solid rgba(79, 111, 186, 0.2);
  outline-offset: -3px;
}

th {
  color: #667085;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: #7a4a00;
  background: #fff3d6;
  border-radius: 999px;
  text-transform: capitalize;
}

.status.completed {
  color: #05603a;
  background: #d1fadf;
}

.warning-count {
  display: inline-flex;
  min-width: 2rem;
  min-height: 2rem;
  align-items: center;
  justify-content: center;
  color: #b42318;
  font-weight: 900;
  background: #fee4e2;
  border-radius: 999px;
}

.snapshot-thumb {
  display: block;
  width: 88px;
  height: 66px;
  object-fit: cover;
  background: #f2f4f7;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
}

.detail-panel {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #e2e8f3;
  border-radius: 20px;
}

.detail-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid #edf1f7;
}

.detail-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.detail-header p {
  margin: 0.35rem 0 0;
  color: #667085;
}

.detail-content {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

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

.detail-grid article,
.answer-card,
.event-row {
  padding: 1rem;
  background: #f8fbff;
  border: 1px solid #e2e8f3;
  border-radius: 16px;
}

.detail-grid strong,
.detail-grid span {
  display: block;
}

.detail-grid span {
  margin-top: 0.25rem;
  color: #667085;
}

.detail-section h3 {
  margin: 0 0 0.75rem;
}

.detail-photo {
  width: min(320px, 100%);
  border: 1px solid #d0d5dd;
  border-radius: 16px;
}

.answer-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.answer-card p {
  margin: 0.4rem 0 0;
  color: #475467;
  white-space: normal;
}

.answer-badge {
  flex: 0 0 auto;
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 999px;
}

.answer-badge.correct {
  color: #05603a;
  background: #d1fadf;
}

.answer-badge.wrong {
  color: #b42318;
  background: #fee4e2;
}

.event-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.event-row span {
  color: #667085;
}

@media (max-width: 540px) {
  body {
    padding: 1rem;
  }

  .card,
  .dashboard {
    padding: 2rem 1.25rem;
    border-radius: 22px;
  }

  .dashboard-header,
  .table-header,
  .detail-header,
  .answer-card,
  .event-row {
    flex-direction: column;
  }

  .camera-panel {
    grid-template-columns: 1fr;
  }

  .choice-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

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

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