:root {
  font-family: Georgia, "Times New Roman", serif;
  color: #1f2b22;
  background:
    radial-gradient(circle at top left, rgba(191, 154, 83, 0.2), transparent 30%),
    linear-gradient(180deg, #f7f0e3 0%, #ece2cf 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

button,
input,
.card,
.question-card,
.option-card {
  border-radius: 18px;
}

button {
  border: 1px solid #b99861;
  background: #fffaf2;
  color: #273226;
  cursor: pointer;
  padding: 0.9rem 1rem;
}

button.primary {
  background: #1f6758;
  border-color: #1f6758;
  color: #fff;
}

input {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid #d0bb95;
  background: #fffdf9;
}

.shell {
  min-height: 100vh;
  padding: 1rem;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
}

.card {
  background: rgba(255, 251, 244, 0.95);
  border: 1px solid rgba(133, 107, 58, 0.18);
  box-shadow: 0 18px 34px rgba(77, 56, 21, 0.08);
}

.hero,
.start-card,
.exam-card,
.toolbar-card,
.sidebar-card,
.detail-card,
.table-card {
  padding: 1.25rem;
}

.hero,
.title-row,
.toolbar-row,
.button-row,
.question-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.pill,
.badge-success,
.badge-error,
.status {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

.pill {
  background: #efe0bd;
  color: #6c5323;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.muted,
table td,
table th,
.question-head span,
.score-box span {
  color: #5a6259;
}

.top-gap {
  margin-top: 1rem;
}

.question-list,
.teacher-layout,
.sidebar,
.stats-grid {
  display: grid;
  gap: 1rem;
}

.question-card {
  padding: 1rem;
  background: #f9f3e8;
  border: 1px solid rgba(120, 98, 55, 0.12);
}

.options-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.option-card {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.95rem;
  background: #fffdf9;
  border: 1px solid rgba(127, 103, 56, 0.16);
}

.option-card.selected {
  border-color: #1f6758;
  background: #e5f1ed;
}

.option-letter {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #ebddbf;
  font-weight: 700;
}

.prompt-text {
  white-space: pre-wrap;
  margin: 1rem 0 0;
  padding: 1rem;
  border-radius: 16px;
  background: #fff8ee;
  font-family: "Courier New", monospace;
}

.mixed-prompt {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.mixed-text {
  margin: 0;
}

.mermaid {
  overflow-x: auto;
  padding: 0.75rem;
  background: #fff8ee;
  border-radius: 16px;
}

.score-box {
  min-width: 120px;
  padding: 0.9rem;
  text-align: center;
  background: #f1e3be;
  border-radius: 18px;
}

.score-box strong,
.stat-card strong {
  display: block;
  font-size: 1.35rem;
}

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

.stat-card {
  padding: 1rem;
  text-align: center;
}

.teacher-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
}

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

th,
td {
  text-align: left;
  padding: 0.8rem 0.6rem;
  border-bottom: 1px solid rgba(135, 112, 70, 0.12);
}

tbody tr {
  cursor: pointer;
}

.selected-row {
  background: #e3f0eb;
}

.badge-success {
  background: #dff2e7;
  color: #146246;
}

.badge-error,
.status {
  background: #ffe4df;
  color: #97382f;
}

.sidebar-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.45rem;
}

.loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

@media (max-width: 1100px) {
  .main-grid,
  .teacher-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .option-card {
    grid-template-columns: auto 1fr;
  }
}
