:root {
  color-scheme: light;
  --ink: #242424;
  --muted: #73716d;
  --line: #e7e2da;
  --paper: #fffdf9;
  --soft: #f6f1ea;
  --mint: #dff5e7;
  --mint-ink: #256143;
  --rose: #ffe8e5;
  --rose-ink: #8b3830;
  --sun: #ffcf6e;
  --sky: #ddecff;
  --shadow: 0 18px 45px rgba(50, 43, 35, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app {
  min-height: 100vh;
}

.gate-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  background: #fff;
}

.logo-button {
  width: clamp(68px, 18vw, 96px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}

.logo-button:hover,
.logo-button:focus-visible {
  transform: scale(1.04);
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.12));
  outline: none;
}

.logo-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.access-panel {
  width: min(100%, 260px);
  text-align: center;
}

.pin-row {
  display: grid;
  grid-template-columns: repeat(4, 44px);
  justify-content: center;
  gap: 10px;
}

.pin-input {
  width: 44px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  background: #fbfaf7;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.pin-input:focus {
  border-color: var(--sun);
  box-shadow: 0 0 0 4px rgba(255, 207, 110, 0.22);
}

.access-message {
  min-height: 1.2em;
  margin: 10px 0 0;
  color: var(--rose-ink);
  font-size: 0.82rem;
}

.home-screen {
  min-height: 100vh;
  padding: 14px 18px 18px;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 207, 110, 0.22), transparent 28%),
    linear-gradient(180deg, #fffdf9 0%, #f8f4ee 100%);
}

.topbar {
  max-width: 920px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.logout-button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.logout-button img {
  width: 28px;
  height: 28px;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}

.logout-button:hover,
.logout-button:focus-visible {
  outline: none;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.14));
}

.section-list,
.math-menu,
.practice-screen {
  width: min(100%, 920px);
  margin: 0 auto;
}

.section-card,
.subsection-card {
  width: 100%;
  min-height: 76px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.section-card span,
.subsection-card span {
  display: block;
  font-weight: 800;
  font-size: 1rem;
}

.section-card small,
.subsection-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.section-card:hover,
.subsection-card:not(:disabled):hover {
  border-color: #dacbb8;
  transform: translateY(-1px);
}

.subsection-card:disabled {
  opacity: 0.56;
  cursor: default;
  box-shadow: none;
}

.back-button {
  margin: 0 0 18px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.back-button:hover,
.back-button:focus-visible {
  color: var(--ink);
  border-color: #dacbb8;
  outline: none;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(1.35rem, 5vw, 2rem);
  letter-spacing: 0;
}

.quiet-note {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.section-intro {
  max-width: 720px;
  margin: -4px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
}

.section-intro p {
  margin: 0;
  line-height: 1.45;
  font-size: 0.95rem;
  font-weight: 720;
}

.subsection-grid {
  display: grid;
  gap: 12px;
}

.practice-heading {
  display: grid;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.iva-top-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.exercise-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.level-switch {
  width: 100%;
  max-width: 390px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.level-switch.two-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.level-button,
.tip-level-button,
.pisa-level-button,
.pisa-language-button,
.pisa-mode-button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 900;
  cursor: pointer;
}

.level-button.active,
.tip-level-button.active,
.pisa-level-button.active,
.pisa-language-button.active,
.pisa-mode-button.active {
  color: #2c2111;
  background: var(--sky);
}

.generate-button,
.solution-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #2c2111;
  background: var(--sun);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(166, 119, 28, 0.18);
}

.generate-button {
  padding: 0 18px;
}

.history-clear-button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 900;
  cursor: pointer;
}

.history-clear-button:hover,
.history-clear-button:focus-visible {
  color: var(--rose-ink);
  border-color: #efc6c0;
  outline: none;
}

.history-clear-bottom {
  width: min(100%, 210px);
  margin-top: 12px;
  box-shadow: none;
}

.current-problem {
  min-height: 104px;
}

.problem-chip {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.problem-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 850;
}

.problem-level {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--soft);
  font-size: 0.72rem;
  font-weight: 900;
}

.answer-input {
  width: 86px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  font-weight: 800;
  background: #fff;
  outline: none;
}

.answer-input:focus {
  border-color: #9ec7ff;
  box-shadow: 0 0 0 4px rgba(221, 236, 255, 0.9);
}

.iva-chip {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.iva-field {
  display: grid;
  gap: 8px;
}

.iva-field span,
.tax-box span,
.iva-results span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.money-input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  font-size: 1.18rem;
  font-weight: 850;
  outline: none;
}

.money-input:focus {
  border-color: #9ec7ff;
  box-shadow: 0 0 0 4px rgba(221, 236, 255, 0.9);
}

.money-input:read-only {
  background: #fbfaf7;
}

.ticket-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ticket-value span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ticket-value strong {
  font-size: 1.55rem;
}

.tip-options {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.tip-button {
  min-width: 112px;
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  cursor: pointer;
}

.tip-button strong,
.tip-button small {
  display: block;
  text-align: center;
}

.tip-button strong {
  font-size: 1rem;
}

.tip-button small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.tip-button.active {
  border-color: #b8ccea;
  background: var(--sky);
}

.random-tip {
  border-style: dashed;
}

.iva-answer-grid {
  display: grid;
  gap: 12px;
}

.iva-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.iva-actions .solution-button,
.iva-top-actions .solution-button {
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
}

.iva-results {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.iva-results .result {
  margin: 0 0 2px;
}

.iva-result-line,
.iva-history-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #fff;
}

.iva-result-line span,
.iva-history-line span {
  white-space: nowrap;
}

.iva-results strong {
  font-size: 1.05rem;
}

.iva-result-line span:last-child {
  color: var(--mint-ink);
}

.iva-result-line span:last-child strong {
  font-size: 1.25rem;
}

.iva-history-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  opacity: 0.82;
}

.iva-history-card .result {
  padding: 8px 10px;
}

.solution-button {
  padding: 0 15px;
}

.result {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 780;
}

.result.good {
  color: var(--mint-ink);
  background: var(--mint);
}

.result.bad {
  color: var(--rose-ink);
  background: var(--rose);
}

.result.close {
  color: #675018;
  background: #fff1c7;
}

.history {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.history .problem-chip {
  box-shadow: none;
  opacity: 0.78;
}

.history-title {
  margin: 18px 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pisa-status {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.86rem;
  font-weight: 780;
}

.pisa-status:empty {
  display: none;
}

.pisa-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(340px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid #f0d08e;
  border-radius: 8px;
  color: #533d0f;
  background: #fff3c7;
  box-shadow: 0 16px 32px rgba(43, 32, 13, 0.16);
  font-size: 0.92rem;
  font-weight: 850;
  animation: pisa-toast-in 0.18s ease-out;
}

.pisa-toast.is-danger {
  border-color: #efc6c0;
  color: var(--rose-ink);
  background: var(--rose);
}

@keyframes pisa-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pisa-control-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.pisa-control-grid .level-switch {
  max-width: none;
}

.control-label {
  display: block;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pisa-unit {
  display: grid;
  gap: 12px;
}

.pisa-empty,
.pisa-panel,
.pisa-question {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.pisa-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  color: var(--muted);
  font-weight: 760;
}

.pisa-empty.is-loading {
  color: var(--ink);
}

.pisa-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #eadfcc;
  border-top-color: #ffc75f;
  border-radius: 50%;
  animation: pisa-spin 0.8s linear infinite;
}

@keyframes pisa-spin {
  to {
    transform: rotate(360deg);
  }
}

.pisa-panel {
  padding: 14px;
}

.pisa-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.pisa-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--soft);
  font-size: 0.72rem;
  font-weight: 900;
}

.pisa-timebox {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  background: #fffaf0;
}

.pisa-timebox-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.pisa-timebox-head strong {
  color: #4e3a10;
  font-size: 1rem;
}

.pisa-timebox-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eadfce;
}

.pisa-timebox-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #ffc75f;
  transition: width 0.3s ease;
}

.pisa-timebox-foot {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.pisa-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  letter-spacing: 0;
}

.pisa-context,
.pisa-source-note,
.pisa-text p,
.pisa-explanation {
  line-height: 1.45;
}

.pisa-context {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 760;
}

.pisa-source-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fbfaf7;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
}

.pisa-text {
  display: grid;
  gap: 10px;
}

.pisa-text p {
  margin: 0;
}

.pisa-sources {
  display: grid;
  gap: 12px;
}

.pisa-source-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.pisa-source-block h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pisa-source-block p {
  margin: 0;
  line-height: 1.45;
}

.pisa-glossary {
  background: #fbfaf7;
}

.pisa-glossary-list {
  display: grid;
  gap: 6px;
}

.pisa-glossary-list p {
  color: var(--muted);
  font-size: 0.9rem;
}

.pisa-glossary-list strong {
  color: var(--ink);
}

.pisa-data-list {
  display: grid;
  gap: 6px;
}

.pisa-data-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: baseline;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--soft);
}

.pisa-data-row span,
.pisa-data-row small {
  min-width: 0;
  color: var(--muted);
  font-weight: 760;
}

.pisa-data-row strong {
  color: var(--ink);
  font-weight: 900;
  text-align: right;
}

.pisa-data-row small {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  line-height: 1.35;
}

.pisa-questions {
  display: grid;
  gap: 12px;
}

.pisa-question {
  display: grid;
  gap: 12px;
  padding: 14px;
  box-shadow: none;
}

.pisa-question h2 {
  margin: 0;
  font-size: 0.98rem;
  letter-spacing: 0;
}

.pisa-options {
  display: grid;
  gap: 8px;
}

.pisa-option {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  font-weight: 760;
  cursor: pointer;
}

.pisa-option:disabled {
  cursor: default;
}

.pisa-option:hover,
.pisa-option:focus-visible {
  border-color: #b8ccea;
  outline: none;
}

.pisa-option.selected {
  border-color: #9ec7ff;
  background: var(--sky);
}

.pisa-option.correct {
  border-color: #a6dcb8;
  color: var(--mint-ink);
  background: var(--mint);
}

.pisa-option.wrong {
  border-color: #efc6c0;
  color: var(--rose-ink);
  background: var(--rose);
}

.pisa-free-answer {
  width: 100%;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
  color: var(--ink);
  background: #fff;
  font: inherit;
  outline: none;
}

.pisa-free-answer:focus {
  border-color: #9ec7ff;
  box-shadow: 0 0 0 4px rgba(221, 236, 255, 0.9);
}

.pisa-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pisa-submit-panel,
.pisa-session-history {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.pisa-submit-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.pisa-submit-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 760;
}

.pisa-session-history {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
}

.pisa-session-history h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.pisa-history-list {
  display: grid;
  gap: 10px;
}

.pisa-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  border-left: 6px solid #d8d0c4;
}

.pisa-history-item.is-strong {
  border-left-color: #7fb7d8;
  background: linear-gradient(90deg, rgba(222, 240, 249, 0.72), #fff 42%);
}

.pisa-history-item.is-excellent {
  border-left-color: #55b978;
  background: linear-gradient(90deg, rgba(210, 246, 222, 0.82), #fff 44%);
}

.pisa-history-item.is-medium {
  border-left-color: #ffc75f;
  background: linear-gradient(90deg, rgba(255, 241, 199, 0.7), #fff 42%);
}

.pisa-history-item.is-low,
.pisa-history-item.is-abandoned {
  border-left-color: #efc6c0;
  background: linear-gradient(90deg, rgba(255, 232, 229, 0.62), #fff 42%);
}

.pisa-history-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.pisa-history-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.pisa-history-meta,
.pisa-history-detail,
.pisa-history-time,
.pisa-history-badge,
.pisa-history-star {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
}

.pisa-history-aside {
  display: grid;
  grid-template-columns: minmax(120px, auto);
  gap: 7px;
  align-content: center;
  justify-items: start;
}

.pisa-history-score {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: var(--ink);
}

.pisa-history-score strong {
  font-size: 1.35rem;
  line-height: 1;
}

.pisa-history-score span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pisa-history-star {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #7b5708;
  background: #ffe8a8;
  font-size: 0.78rem;
  font-weight: 900;
}

.pisa-history-star-time {
  color: #4f5f1d;
  background: #edf5bf;
}

.pisa-history-note-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pisa-history-badge {
  justify-self: start;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: #5f5648;
  font-size: 0.78rem;
  font-weight: 900;
}

.pisa-history-item.is-excellent .pisa-history-badge {
  color: var(--mint-ink);
  background: var(--mint);
}

.pisa-history-item.is-strong .pisa-history-badge {
  color: #1f536f;
  background: #dff0f9;
}

.pisa-history-item.is-medium .pisa-history-badge {
  color: #675018;
  background: #fff1c7;
}

.pisa-history-item.is-low .pisa-history-badge,
.pisa-history-item.is-abandoned .pisa-history-badge {
  color: var(--rose-ink);
  background: var(--rose);
}

.pisa-small-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 900;
  cursor: pointer;
}

.pisa-small-button:hover,
.pisa-small-button:focus-visible {
  color: var(--ink);
  border-color: #dacbb8;
  outline: none;
}

.pisa-explanation {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: #fbfaf7;
  font-size: 0.9rem;
  font-weight: 720;
}

.pisa-explanation.good {
  color: var(--mint-ink);
  background: var(--mint);
}

.pisa-explanation.bad {
  color: var(--rose-ink);
  background: var(--rose);
}

.pisa-explanation.close {
  color: #675018;
  background: #fff1c7;
}

@media (min-width: 640px) {
  .home-screen {
    padding: 20px 28px 28px;
  }

  .section-list {
    max-width: 420px;
  }

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

  .practice-heading {
    grid-template-columns: 1fr auto;
  }

  .pisa-history-item {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    align-items: center;
  }

  .pisa-history-main {
    min-width: 0;
  }

  .pisa-history-aside,
  .pisa-history-detail,
  .pisa-history-time {
    justify-items: start;
    justify-self: stretch;
  }

  .pisa-history-note-row {
    justify-content: flex-start;
  }

  .problem-chip {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .result {
    grid-column: 1 / -1;
  }

  .iva-answer-grid,
  .iva-actions,
  .iva-results {
    width: 100%;
  }

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

  .iva-top-actions {
    grid-template-columns: 150px 150px;
  }

  .exercise-actions {
    grid-template-columns: 170px 180px;
  }

  .iva-actions {
    grid-template-columns: 160px 160px;
  }

  .pisa-control-grid {
    max-width: 760px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pisa-unit.has-content {
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
    align-items: start;
  }

  .pisa-unit.has-questions-only {
    max-width: 720px;
  }

  .pisa-questions {
    position: sticky;
    top: 18px;
  }
}

@media (min-width: 920px) {
  .home-screen {
    padding-top: 22px;
  }

  .section-list {
    margin-top: 8vh;
  }
}
