:root {
  --navy: #06285f;
  --navy-dark: #031b45;
  --blue: #0b4fd5;
  --blue-light: #eef4ff;
  --text: #0c1f45;
  --muted: #69758b;
  --line: #ced7e6;
  --bg: #ffffff;
  --panel: #ffffff;
  --footer: #7f8791;
  --green: #149447;
  --green-bg: #effaf3;
  --red: #dc2626;
  --red-bg: #fff1f1;
  --gray-chip: #eef1f5;
  --shadow: 0 8px 28px rgba(5, 31, 73, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Yu Gothic", "Meiryo", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
}
.site-title {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: clamp(1.4rem, 4vw, 3.2rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 1;
  min-width: 0;
}

.app-container {
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 260px);
  margin: 0 auto;
  padding: 38px 0 52px;
}

.site-footer {
  min-height: 130px;
  padding: 28px 20px;
  color: #fff;
  text-align: center;
  background: var(--footer);
}

.site-footer p {
  margin: 24px 0 0;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 34px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: #fff;
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.page-heading {
  margin-bottom: 30px;
}

.page-heading h1,
.page-heading h2 {
  margin: 0;
  color: var(--text);
}

.page-heading h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
}

.page-heading h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.page-heading p {
  margin: 12px 0 0;
  font-size: 1.08rem;
  line-height: 1.8;
}

.center-heading {
  text-align: center;
}

.exam-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.exam-card,
.set-card,
.mode-card,
.confirm-panel,
.question-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.exam-card {
  padding: 42px 28px 30px;
  text-align: center;
}

.exam-code {
  margin: 0;
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.exam-name {
  min-height: 56px;
  margin: 20px 0 24px;
  padding-top: 20px;
  border-top: 1px dashed #9ba7b8;
  color: #2f3b50;
  font-size: 1.02rem;
}

.primary-button,
.secondary-button,
.card-button {
  min-height: 48px;
  border-radius: 7px;
  padding: 0 24px;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-button {
  border: 1px solid var(--navy);
  color: #fff;
  background: var(--navy);
}

.primary-button:hover {
  background: #0b3a86;
  box-shadow: 0 6px 18px rgba(6, 40, 95, 0.18);
}

.secondary-button,
.card-button {
  border: 1px solid #6d7b91;
  color: var(--text);
  background: #fff;
}

.secondary-button:hover,
.card-button:hover {
  border-color: var(--navy);
  background: #f6f9ff;
}

.primary-button:hover,
.secondary-button:hover,
.card-button:hover {
  transform: translateY(-1px);
}

.card-button {
  width: 75%;
}

.set-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px 26px;
}

.set-card {
  padding: 26px;
  text-align: center;
}

.set-card h3 {
  margin: 0;
  font-size: 2rem;
}

.set-meta {
  margin: 18px 0 22px;
  padding-top: 15px;
  border-top: 1px dashed #9ba7b8;
  line-height: 1.7;
}

.mode-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.mode-card {
  padding: 34px;
  text-align: left;
}

.mode-card:hover {
  border-color: #7399df;
}

.mode-card h3 {
  margin: 0 0 12px;
  font-size: 1.8rem;
}

.mode-card p {
  min-height: 90px;
  margin: 0;
  line-height: 1.8;
}

.mode-icon {
  margin-bottom: 18px;
  font-size: 3rem;
}

.mode-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 24px 0 26px;
  padding-top: 20px;
  border-top: 1px dashed #9ba7b8;
  text-align: center;
}

.mode-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 1.15rem;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
}

.confirm-panel {
  padding: 34px;
}

.confirm-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
  font-size: 1.5rem;
  font-weight: 800;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #90ace3;
  border-radius: 8px;
  padding: 9px 16px;
  color: #123e86;
  background: var(--blue-light);
}

.confirm-actions,
.question-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 26px;
}

.test-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.progress-line {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 0 26px;
  font-weight: 700;
}

.progress-track {
  flex: 1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eaf0;
}

.progress-value {
  height: 100%;
  border-radius: inherit;
  background: var(--navy);
}

.question-panel {
  padding: 26px;
}

.question-number-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-weight: 800;
}

.category-chip {
  display: inline-block;
  border-radius: 6px;
  padding: 5px 12px;
  color: #174081;
  background: #eaf1ff;
  font-size: 0.86rem;
}

.question-title {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.8;
}

.question-support {
  margin: 8px 0 20px;
  color: #384860;
  line-height: 1.7;
}

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

.choice {
  display: grid;
  grid-template-columns: 26px auto 30px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  border: 1px solid #bfcadd;
  border-radius: 7px;
  padding: 10px 14px;
  color: var(--text);
  background: #fff;
  text-align: left;
}

.choice:hover:not(.locked) {
  border-color: #6d96dd;
  background: #f8fbff;
}

.choice input {
  width: 18px;
  height: 18px;
}

.choice.correct {
  border-color: #32a85d;
  color: #0f5929;
  background: var(--green-bg);
}

.choice.incorrect {
  border-color: #ef5350;
  color: #9f1919;
  background: var(--red-bg);
}

.choice-result-icon {
  justify-self: end;
  font-size: 1.25rem;
  font-weight: 900;
}

.answer-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 12px;
  border: 1px solid;
  border-radius: 7px;
  padding: 14px 18px;
  font-size: 1.1rem;
  font-weight: 800;
}

.answer-banner.correct {
  border-color: #32a85d;
  color: var(--green);
  background: var(--green-bg);
}

.answer-banner.incorrect {
  border-color: #ef5350;
  color: var(--red);
  background: var(--red-bg);
}

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

.explanation-box {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 15px 16px;
}

.explanation-box h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.explanation-box p,
.explanation-box li {
  margin: 0;
  line-height: 1.7;
}

.explanation-box ul {
  margin: 6px 0 0;
  padding-left: 22px;
}

.question-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
  padding: 12px 0;
  border-top: 1px dashed #a9b4c5;
  border-bottom: 1px dashed #a9b4c5;
  text-align: center;
}

.question-meta strong {
  display: block;
  margin-top: 4px;
}

.question-actions {
  justify-content: space-between;
  align-items: center;
}

.right-actions {
  display: flex;
  gap: 12px;
}

.left-actions {
  display: flex;
  gap: 12px;
}

.danger-button {
  min-height: 48px;
  border-radius: 7px;
  padding: 0 24px;
  font-weight: 700;
  border: 1px solid var(--red);
  color: var(--red);
  background: #fff;
  transition: background 0.15s, color 0.15s;
}

.danger-button:hover {
  background: var(--red-bg);
}

.result-summary {
  display: flex;
  gap: 20px;
  margin-bottom: 28px;
  font-size: 1.08rem;
}

.result-summary span + span::before {
  content: "|";
  margin-right: 20px;
  color: #7c8798;
}

.result-panel {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 38px;
  padding: 36px;
}

.chart-area {
  display: grid;
  place-items: center;
}

.donut {
  --score: 78;
  width: min(340px, 76vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    conic-gradient(
      var(--green) 0 calc(var(--score) * 1%),
      #ff5151 calc(var(--score) * 1%) 92%,
      #aab2bf 92% 100%
    );
  position: relative;
}

.donut::after {
  content: "";
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
}

.donut-center {
  position: absolute;
  z-index: 1;
  text-align: center;
}

.donut-center strong {
  display: block;
  font-size: 3.6rem;
  line-height: 1;
}

.donut-center span {
  display: block;
  margin-top: 8px;
  font-weight: 700;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-color {
  width: 13px;
  height: 13px;
  border-radius: 2px;
}

.legend-green { background: var(--green); }
.legend-red { background: #ff5151; }
.legend-gray { background: #aab2bf; }

.result-detail {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--line);
  padding-left: 38px;
}

.result-score {
  margin: 18px 0;
  font-size: 1.2rem;
}

.result-score strong {
  font-size: 4rem;
  line-height: 1;
}

.pass-banner,
.fail-banner {
  border: 1px solid;
  border-radius: 8px;
  margin: 20px 0;
  padding: 14px 18px;
  font-weight: 800;
}

.pass-banner {
  border-color: #4cb570;
  color: var(--green);
  background: var(--green-bg);
}

.fail-banner {
  border-color: #ef5350;
  color: var(--red);
  background: var(--red-bg);
}

.result-buttons {
  display: grid;
  gap: 12px;
}

.notice {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.empty-message {
  padding: 40px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  text-align: center;
}

@media (max-width: 900px) {
  .exam-grid,
  .set-grid,
  .mode-layout,
  .result-panel {
    grid-template-columns: 1fr;
  }

  .result-detail {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 28px 0 0;
  }

  .mode-card p {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 70px;
    padding: 0 14px;
  }

  .app-container {
    width: min(100% - 24px, 1180px);
    padding-top: 24px;
  }

  .exam-card {
    padding: 28px 20px;
  }

  .exam-code {
    font-size: 3rem;
  }

  .set-grid {
    gap: 14px;
  }

  .mode-stats,
  .question-meta {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .test-header-row,
  .question-actions,
  .left-actions,
  .confirm-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .right-actions {
    display: grid;
  }

  .primary-button,
  .secondary-button,
  .card-button {
    width: 100%;
  }

  .result-summary {
    display: grid;
    gap: 8px;
  }

  .result-summary span + span::before {
    content: none;
  }

  .result-panel {
    padding: 20px;
  }
}

/* JSON読み込み対応で追加 */
.set-card.is-disabled {
  opacity: 0.55;
  box-shadow: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none !important;
}

.status-panel {
  width: min(720px, 100%);
  margin: 80px auto;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.status-panel h2 {
  margin: 18px 0 12px;
}

.error-panel {
  border-color: #efb4b4;
  background: #fffafa;
}

.loading-spinner {
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border: 5px solid #dfe6f2;
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: awsExamSpin 0.85s linear infinite;
}

@keyframes awsExamSpin {
  to { transform: rotate(360deg); }
}

.status-panel code {
  display: inline-block;
  margin: 8px 0;
  padding: 4px 8px;
  border-radius: 5px;
  background: #eef1f5;
}

/* ============================================================
   保存データ再開バナー
   ============================================================ */
.resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--blue-light);
  border: 1px solid var(--blue);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.resume-banner-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.resume-banner-info strong {
  color: var(--blue);
  font-size: 0.95rem;
}

.resume-banner-info span {
  color: var(--text);
  font-size: 0.88rem;
}

.resume-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .resume-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .resume-banner-actions {
    width: 100%;
  }

  .resume-banner-actions .primary-button,
  .resume-banner-actions .secondary-button {
    flex: 1;
  }
}

/* ============================================================
   ヘッダー アカウントボタン
   ============================================================ */
.header-account {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.account-button-group {
  display: flex;
  gap: 8px;
}

.account-button {
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.account-button:hover {
  opacity: 0.85;
}

/* ログアウト状態 */
.account-button--out {
  border: 1px solid rgba(255,255,255,0.6);
  background: transparent;
  color: #fff;
}

.account-button--signup {
  border: 0;
  background: #fff;
  color: var(--navy);
}

/* ログイン状態 */
.account-button--in {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.12);
  color: #fff;
  max-width: 260px;
  overflow: hidden;
}

.account-button-icon { font-size: 1rem; flex-shrink: 0; }

.account-button-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
  font-size: 0.8rem;
}

.account-button-caret { font-size: 0.7rem; flex-shrink: 0; }

/* ドロップダウンメニュー */
.account-menu-wrap {
  position: relative;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 200;
  overflow: hidden;
}

.account-dropdown-email {
  padding: 12px 16px 4px;
  font-size: 0.82rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-dropdown-divider {
  margin: 0;
  border: none;
  border-top: 1px solid var(--line);
}

.account-dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.account-dropdown-item:hover {
  background: #f8fafc;
}

/* ============================================================
   認証モーダル
   ============================================================ */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal[hidden] { display: none; }

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
}

.auth-modal-box {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  padding: 36px 32px 32px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
}

.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal-close:hover { background: #f1f5f9; }

.auth-modal-title {
  margin: 0 0 20px;
  font-size: 1.5rem;
  color: var(--text);
}

.auth-desc {
  margin: -8px 0 20px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.auth-field {
  margin-bottom: 18px;
}

.auth-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.auth-hint {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: 6px;
}

.auth-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--blue);
}

.auth-error {
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--red-bg);
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: var(--red);
  font-size: 0.88rem;
  line-height: 1.5;
}

.auth-error--success {
  background: var(--green-bg);
  border-color: #86efac;
  color: var(--green);
}

.auth-submit {
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.auth-submit:hover:not(:disabled) { background: #0b3a86; }
.auth-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-submit--disabled { background: #94a3b8; }

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: center;
  margin-top: 18px;
}

.auth-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

@media (max-width: 640px) {
  .site-header {
    /* 縦並び廃止。横並びを維持してボタンを右端に */
    min-height: 64px;
    padding: 0 12px;
    gap: 8px;
  }

  /* ログイン・アカウント作成ボタンはテキストを非表示にしてアイコン表示 */
  .account-button--out::before    { content: "🔑"; font-size: 1.1rem; }
  .account-button--signup::before { content: "👤"; font-size: 1.1rem; }
  .account-button--out .account-button-text,
  .account-button--signup .account-button-text { display: none; }
}
@media (max-width: 480px) {
  .auth-modal-box { padding: 28px 18px 24px; }
  .header-account { gap: 4px; }
  .account-button-label { max-width: 60px; }
  /* スマホではボタンのパディングを縮小 */
  .account-button { padding: 5px 10px; font-size: 0.78rem; }
}

/* ============================================================
   マイページ
   ============================================================ */
.mypage-info {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px 0;
  margin-bottom: 20px;
}

.mypage-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}

.mypage-info-row:last-child {
  border-bottom: none;
}

.mypage-info-label {
  font-size: 0.85rem;
  color: var(--muted);
  flex-shrink: 0;
}

.mypage-info-value {
  font-size: 0.92rem;
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mypage-menu {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.mypage-danger-zone {
  border: 1px solid #fecaca;
  border-radius: 10px;
  overflow: hidden;
}

.mypage-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.mypage-menu-item:last-child {
  border-bottom: none;
}

.mypage-menu-item:hover {
  background: #f8fafc;
}

.mypage-menu-item--danger {
  color: var(--red);
  background: #fff;
}

.mypage-menu-item--danger:hover {
  background: var(--red-bg);
}

.mypage-menu-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.mypage-menu-arrow {
  margin-left: auto;
  color: var(--muted);
  font-size: 1.2rem;
}

/* 退会ボタン */
.auth-submit--delete {
  background: var(--red);
  border: 1px solid var(--red);
}

.auth-submit--delete:hover:not(:disabled) {
  background: #b91c1c;
}

/* ドロップダウン danger item */
.account-dropdown-item--danger {
  color: var(--red);
}

.account-dropdown-item--danger:hover {
  background: var(--red-bg);
}

/* ============================================================
   トップページ（試験・回の一覧）レイアウト
   ============================================================ */
.home-intro {
  margin-bottom: 40px;
}

.home-intro .page-heading p {
  max-width: 820px;
  margin: 16px auto 0;
  line-height: 1.9;
}

/* 資格ごとのブロック（CLF / SAA / SAP） */
.exam-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 56px;
}

.exam-block {
  padding: 30px 32px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.exam-block-head {
  margin-bottom: 20px;
}

.exam-block .exam-code {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 0.03em;
}

.exam-block .exam-name {
  margin: 4px 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.exam-block .exam-desc {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

/* 第1回〜第6回のボタン列 */
.set-button-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.set-button {
  position: relative;
  padding: 16px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--blue-light);
  color: var(--navy);
  font-size: 1.02rem;
  font-weight: 700;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.set-button:hover:not(:disabled) {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(11, 79, 213, 0.22);
}

.set-button.is-locked {
  background: var(--gray-chip);
  color: var(--muted);
  border-style: dashed;
}

.set-lock-icon {
  font-size: 0.92em;
  vertical-align: baseline;
}

.exam-lock-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* 「このサイトでできること」「2つの学習モード」 */
.home-about,
.home-modes {
  margin-top: 56px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.home-modes .about-grid {
  grid-template-columns: repeat(2, 1fr);
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.about-card {
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.about-card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: var(--navy);
}

.about-card p {
  margin: 0;
  line-height: 1.8;
  color: var(--text);
}

@media (max-width: 900px) {
  .set-button-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .about-grid,
  .home-modes .about-grid {
    grid-template-columns: 1fr;
  }

  .exam-block {
    padding: 24px 20px;
  }
}

@media (max-width: 480px) {
  .set-button-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.history-list { display: grid; gap: 16px; }
.history-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.history-card h2 { margin-top: 0; }
.history-card button { margin: 4px; }
