:root {
  --background: #f7f7f5;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #5f6b76;
  --border: #d8dee4;
  --accent: #234f7d;
  --accent-dark: #183a5c;
  --soft-accent: #eaf1f8;
  --success: #2f6f4e;
  --danger: #8a3a3a;
  --shadow: 0 8px 24px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background: var(--background);
  line-height: 1.6;
}

.app-container {
  width: min(960px, 92%);
  margin: 0 auto;
  padding: 32px 0;
}

.app-header {
  margin-bottom: 24px;
}

.site-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
}

.intro {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.controls-card,
.question-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.controls-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  padding: 20px;
  margin-bottom: 20px;
}

.topic-control {
  flex: 1;
}

label {
  display: block;
  margin-bottom: 8px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
}

select {
  width: 100%;
  max-width: 360px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  font-size: 1rem;
}

.score-box {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.score-box div {
  min-width: 88px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfbfa;
  text-align: center;
}

.score-label,
.score-value {
  display: block;
  font-family: Arial, Helvetica, sans-serif;
}

.score-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.score-value {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
}

.question-card {
  padding: 26px;
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.topic-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--soft-accent);
  color: var(--accent);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
}

.question-number {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.transaction-text {
  margin: 0 0 22px;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  line-height: 1.45;
}

.thinking-prompts {
  padding: 18px;
  margin-bottom: 22px;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: #fbfbfa;
}

.thinking-prompts h3,
.answer-section h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.thinking-prompts ul {
  margin: 0;
  padding-left: 22px;
}

.answer-section {
  margin: 22px 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fcfcfb;
}

.hidden {
  display: none;
}

.entry-table {
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.entry-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.entry-row:last-child {
  border-bottom: none;
}

.entry-header {
  background: var(--soft-accent);
  color: var(--accent-dark);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
}

.credit-indent {
  padding-left: 24px;
}

.explanation-box {
  margin-top: 18px;
}

.explanation-box h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.explanation-box p {
  margin: 0;
  color: var(--muted);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

button {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  background: #ffffff;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #f1f4f7;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary-btn {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.primary-btn:hover {
  background: var(--accent-dark);
}

.secondary-btn {
  color: var(--muted);
}

.app-footer {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.92rem;
}

.app-footer a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .controls-card {
    display: block;
  }

  .score-box {
    margin-top: 18px;
  }

  .score-box div {
    flex: 1;
  }

  .question-card {
    padding: 20px;
  }

  .question-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .entry-row {
    grid-template-columns: 1.3fr 0.8fr 0.8fr;
    font-size: 0.92rem;
  }

  .button-row {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}