body {
  color: var(--kbv-ink);
}

.result-shell {
  width: min(100% - 2rem, 1120px);
  margin: 0 auto;
  padding: 28px 0 36px;
}

.result-hero {
  margin-bottom: 20px;
  padding: 24px 28px;
  border: 1px solid rgba(15, 76, 129, 0.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(242, 184, 75, 0.18), transparent 12rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(240, 247, 255, 0.95));
  box-shadow: var(--kbv-shadow);
}

.result-eyebrow,
.sheet-kicker,
.mini-label {
  margin: 0;
  color: var(--kbv-accent-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.result-hero h1 {
  margin: 8px 0 0;
  color: var(--kbv-brand-1);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.06;
}

.result-subtitle {
  margin: 12px 0 0;
  color: var(--kbv-muted);
  font-size: 15px;
  line-height: 1.6;
}

.result-attempt-meta {
  margin: 10px 0 0;
  color: var(--kbv-brand-1);
  font-size: 14px;
  font-weight: 700;
}

.result-banner,
.empty-state,
.history-panel,
.review-panel {
  margin-bottom: 20px;
}

.result-banner {
  padding: 16px 20px;
  border-left: 5px solid rgba(15, 76, 129, 0.38);
  background: linear-gradient(135deg, rgba(244, 251, 255, 0.99), rgba(234, 246, 255, 0.96));
}

.result-banner p {
  margin: 0;
  color: var(--kbv-brand-1);
  font-weight: 700;
}

.empty-state {
  padding: 28px 24px;
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  color: var(--kbv-brand-1);
}

.empty-state p {
  max-width: 580px;
  margin: 12px auto 0;
  color: var(--kbv-muted);
  line-height: 1.6;
}

.result-sheet {
  padding: 28px 28px 24px;
  border: 1px solid rgba(15, 76, 129, 0.14);
  border-radius: 32px;
  background:
    radial-gradient(circle at top right, rgba(54, 163, 142, 0.09), transparent 14rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 249, 255, 0.97));
  box-shadow: 0 24px 44px rgba(15, 23, 42, 0.14);
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(15, 76, 129, 0.12);
}

.sheet-brand h2 {
  margin: 10px 0 0;
  color: #0d2f57;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.08;
}

.sheet-subline {
  max-width: 560px;
  margin: 10px 0 0;
  color: var(--kbv-muted);
  font-size: 15px;
  line-height: 1.65;
}

.sheet-meta {
  min-width: 250px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(11, 48, 89, 0.94);
  color: #f5f9ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.sheet-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(242, 184, 75, 0.18);
  color: #ffe7aa;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-meta-line {
  margin: 12px 0 0;
  color: rgba(245, 249, 255, 0.9);
  font-size: 14px;
  line-height: 1.5;
}

.sheet-main {
  display: grid;
  grid-template-columns: minmax(270px, 0.9fr) minmax(360px, 1.1fr);
  gap: 18px;
  margin-top: 22px;
}

.sheet-score-block,
.sheet-overview-block,
.sheet-outcome-card {
  padding: 22px;
  border: 1px solid rgba(15, 76, 129, 0.1);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
}

.sheet-score-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(242, 184, 75, 0.18), transparent 10rem),
    linear-gradient(180deg, rgba(247, 251, 255, 0.99), rgba(235, 244, 255, 0.96));
}

.score-line {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin: 18px 0 10px;
  color: var(--kbv-brand-1);
}

.score-line span {
  font-size: clamp(52px, 7vw, 78px);
  font-weight: 800;
  line-height: 1;
}

.score-line small {
  color: var(--kbv-muted);
  font-size: 26px;
  font-weight: 700;
}

.score-percent {
  margin: 0;
  color: #0d2f57;
  font-size: 18px;
  font-weight: 800;
}

.sheet-score-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(15, 76, 129, 0.08);
  color: var(--kbv-ink);
  font-size: 14px;
  line-height: 1.6;
}

.sheet-overview-head h3 {
  margin: 8px 0 0;
  color: #0d2f57;
  font-size: 24px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-top: 18px;
}

.detail-grid p {
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(244, 248, 255, 0.95);
  color: var(--kbv-ink);
  font-size: 14px;
  line-height: 1.5;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.compact-metrics {
  margin-top: 18px;
}

.metric-card {
  padding: 18px 16px;
  border: 1px solid rgba(15, 76, 129, 0.1);
  border-radius: 22px;
  background: rgba(250, 252, 255, 0.98);
  text-align: center;
}

.metric-card span {
  display: block;
  color: #0d2f57;
  font-size: 30px;
  font-weight: 800;
}

.metric-card small {
  display: block;
  margin-top: 6px;
  color: var(--kbv-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sheet-outcome-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.sheet-outcome-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet-outcome-card strong {
  color: #0d2f57;
  font-size: 20px;
}

.sheet-outcome-label {
  color: var(--kbv-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sheet-outcome-card-wide {
  grid-column: span 1;
}

.sheet-outcome-card p {
  margin: 0;
  color: var(--kbv-ink);
  font-size: 14px;
  line-height: 1.65;
}

.sheet-signoff {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.signoff-line {
  padding-top: 34px;
  border-bottom: 1px solid rgba(15, 76, 129, 0.32);
}

.signoff-line span {
  display: inline-block;
  transform: translateY(18px);
  padding-right: 12px;
  background: #ffffff;
  color: var(--kbv-muted);
  font-size: 13px;
  font-weight: 700;
}

.history-panel {
  padding: 24px;
}

.history-panel.is-focused {
  box-shadow: 0 0 0 2px rgba(14, 116, 144, 0.14), var(--kbv-shadow);
}

.review-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.review-head h2 {
  margin: 8px 0 0;
  color: #0d2f57;
  font-size: 28px;
}

.review-head p {
  margin: 10px 0 0;
  color: var(--kbv-muted);
  font-size: 14px;
  line-height: 1.6;
}

.history-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(15, 76, 129, 0.08);
  color: var(--kbv-brand-1);
  font-size: 13px;
  font-weight: 800;
}

.history-device-note {
  margin: 12px 0 14px;
  color: var(--kbv-muted);
  font-size: 13px;
}

#openLatestBtn,
#reviewToggleBtn {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 76, 129, 0.08);
  color: var(--kbv-brand-1);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#openLatestBtn:hover,
#reviewToggleBtn:hover {
  background: rgba(15, 76, 129, 0.14);
}

.history-empty {
  margin: 0 0 10px;
  color: var(--kbv-muted);
}

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

.history-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(15, 76, 129, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
}

.history-card.is-active {
  border-color: rgba(14, 116, 144, 0.42);
  background: linear-gradient(135deg, rgba(243, 249, 255, 0.98), rgba(236, 247, 255, 0.98));
  box-shadow: inset 0 0 0 1px rgba(14, 116, 144, 0.16);
}

.history-card-main {
  display: grid;
  gap: 5px;
}

.history-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-card-title {
  margin: 0;
  color: #0d2f57;
  font-size: 18px;
}

.history-row-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 76, 129, 0.08);
  color: var(--kbv-brand-1);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.history-card-subline,
.history-card-time {
  margin: 0;
  color: var(--kbv-muted);
  font-size: 14px;
  line-height: 1.45;
}

.history-card-side {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.history-card-score {
  color: #0d2f57;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.history-card-score small {
  color: var(--kbv-muted);
  font-size: 14px;
  font-weight: 700;
}

.history-card-open {
  min-width: 148px;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--kbv-brand-1), var(--kbv-brand-2));
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.history-card-open:hover {
  background: #6a0dad;
}

.history-card-open[disabled] {
  background: rgba(15, 76, 129, 0.12);
  color: var(--kbv-brand-1);
  cursor: default;
}

.review-panel {
  padding: 24px;
}

#answerList {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.review-card {
  padding: 16px 18px;
  border: 1px solid rgba(15, 76, 129, 0.08);
  border-left-width: 5px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
}

.review-card.is-correct {
  border-color: rgba(27, 141, 96, 0.28);
}

.review-card.is-wrong {
  border-color: rgba(201, 71, 71, 0.28);
}

.review-card.is-skipped {
  border-color: rgba(204, 141, 30, 0.28);
}

.review-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.review-index {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 76, 129, 0.08);
  color: var(--kbv-brand-1);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-card h3 {
  margin: 10px 0 0;
  color: var(--kbv-ink);
  font-size: 17px;
  line-height: 1.55;
}

.review-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.review-status.is-correct {
  background: rgba(27, 141, 96, 0.12);
  color: #15674a;
}

.review-status.is-wrong {
  background: rgba(201, 71, 71, 0.12);
  color: #9d3434;
}

.review-status.is-skipped {
  background: rgba(204, 141, 30, 0.12);
  color: #9a6a12;
}

.review-meta {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.review-meta p {
  margin: 0;
  color: var(--kbv-ink);
  font-size: 14px;
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

@media (max-width: 980px) {
  .sheet-head,
  .sheet-main,
  .sheet-outcome-row {
    grid-template-columns: 1fr;
  }

  .sheet-head {
    flex-direction: column;
  }

  .sheet-meta {
    width: 100%;
  }

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

@media (max-width: 680px) {
  .result-shell {
    width: min(100% - 1rem, 1120px);
    padding-top: 18px;
  }

  .result-hero,
  .result-sheet,
  .history-panel,
  .review-panel,
  .empty-state {
    padding: 20px 18px;
    border-radius: 24px;
  }

  .detail-grid,
  .result-metrics,
  .sheet-signoff {
    grid-template-columns: 1fr;
  }

  .review-head,
  .review-card-top,
  .history-card,
  .history-card-head,
  .history-head-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-card-side,
  .history-card-open,
  #openLatestBtn,
  #reviewToggleBtn {
    width: 100%;
    justify-items: stretch;
  }

  .score-line small {
    font-size: 20px;
  }
}

@page {
  size: A4;
  margin: 12mm;
}

@media print {
  body {
    background: #ffffff !important;
    color: #111111 !important;
    padding-top: 0 !important;
  }

  .main-header,
  .social-share-bar,
  .result-hero,
  .result-banner,
  .history-panel,
  .review-panel,
  .actions {
    display: none !important;
  }

  .result-shell {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .result-sheet {
    padding: 20px;
    border: 2px solid #0d2f57;
    border-radius: 16px;
    background: #ffffff !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .sheet-head {
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 2px solid #d9e0ea;
  }

  .sheet-brand h2 {
    font-size: 28px;
  }

  .sheet-subline,
  .sheet-meta-line,
  .detail-grid p,
  .sheet-outcome-card p,
  .sheet-score-note {
    color: #222222 !important;
  }

  .sheet-meta {
    min-width: 220px;
    border: 1px solid #0d2f57;
    background: #ffffff !important;
    color: #111111 !important;
    box-shadow: none !important;
  }

  .sheet-chip {
    border: 1px solid #0d2f57;
    background: #ffffff !important;
    color: #0d2f57 !important;
  }

  .sheet-score-block,
  .sheet-overview-block,
  .sheet-outcome-card,
  .metric-card,
  .detail-grid p {
    border-color: #d5dde8 !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  .score-line,
  .score-percent,
  .sheet-brand h2,
  .sheet-overview-head h3,
  .sheet-outcome-card strong,
  .metric-card span {
    color: #0d2f57 !important;
  }

  .signoff-line span {
    background: #ffffff !important;
  }
}
