/*
 * 診断画面（/check/）専用のスタイル
 * 共通トークン・ヘッダー・ボタンは /styles.css が提供する。
 */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.mono {
  font-family: "Roboto Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.check-main {
  padding-bottom: 24px;
}

/* ---------- 枠 ---------- */

.assessment {
  max-width: 800px;
  margin: 32px auto 72px;
  background: var(--white);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  position: relative;
}

.assessment-head {
  padding: 20px 28px;
  border-bottom: 2px solid var(--ink);
  display: flex;
  justify-content: space-between;
  gap: 12px 20px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.assessment-head .eyebrow {
  margin-bottom: 8px;
}

.assessment-head h1 {
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
  font-weight: 800;
  font-size: clamp(1.4rem, 3.4vw, 2rem);
  line-height: 1.3;
  margin: 0;
}

.progress-wrap {
  min-width: 170px;
}

.progress-label {
  margin: 0;
  font-family: "Roboto Mono", monospace;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.progress {
  height: 6px;
  width: 170px;
  margin-top: 6px;
  background: var(--grid);
  overflow: hidden;
}

.progress__bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width 0.25s ease-out;
}

.panel {
  padding: clamp(20px, 5vw, 40px);
}

.panel[aria-busy="true"] {
  cursor: progress;
}

/* ---------- 学年選択 ---------- */

.start__heading {
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
  font-size: 1.1rem;
  margin: 0 0 12px;
}

.grade-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}

.grade {
  min-height: 76px;
  padding: 12px 16px;
  border: 2px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  box-shadow: 4px 4px 0 var(--grid);
  transition: box-shadow 0.12s ease-out, transform 0.12s ease-out;
}

.grade__name {
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
}

.grade__note {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.grade:hover {
  background: var(--highlight);
  box-shadow: 4px 4px 0 var(--ink);
}

.grade:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  background: var(--highlight);
}

.grade:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.start-note {
  border-left: 4px solid var(--highlight);
  padding: 4px 0 4px 14px;
  margin: 0 0 20px;
}

.start-note__title {
  font-size: 0.95rem;
  margin: 0 0 2px;
}

.start-note p {
  margin: 0;
  font-size: 0.95rem;
}

.start-facts {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  border-top: 1px solid var(--grid);
}

.start-facts li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--grid);
  font-size: 0.95rem;
}

.start-facts__key {
  flex: 0 0 3.5em;
  font-family: "Roboto Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* 再開 */
.resume__title {
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  line-height: 1.5;
  margin: 0 0 12px;
}

.resume > p {
  margin: 0 0 10px;
}

/* ---------- 設問 ---------- */

.q-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 18px;
}

.q-num {
  font-family: "Roboto Mono", monospace;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--mark-text);
  letter-spacing: 0.04em;
}

.domain-chip {
  display: inline-block;
  padding: 1px 10px;
  border: 1px solid var(--ink);
  background: linear-gradient(transparent 55%, var(--highlight) 55%);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.7;
}

.q-count {
  margin-left: auto;
  font-family: "Roboto Mono", monospace;
  font-size: 0.78rem;
  color: var(--muted);
}

.q-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.q-prompt__heading {
  margin: 0;
  font: inherit;
  color: inherit;
}

.q-prompt {
  display: block;
  float: left;
  width: 100%;
  padding: 0;
  margin: 0 0 8px;
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
  font-weight: 700;
  font-size: clamp(1.2rem, 2.8vw, 1.6rem);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.q-prompt:focus {
  outline: none;
}

.q-prompt:focus-visible {
  outline: 2px dashed var(--ink);
  outline-offset: 6px;
}

.q-help {
  clear: both;
  margin: 0 0 18px;
  font-size: 0.85rem;
  color: var(--muted);
}

.choices {
  display: grid;
  gap: 12px;
}

.choice {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-height: 56px;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  background: var(--white);
  cursor: pointer;
  line-height: 1.6;
  transition: background-color 0.12s ease-out;
}

.choice:hover {
  background: #edf6fc;
}

.choice__input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 24px;
  height: 24px;
  margin: 2px 0 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
}

.choice__input:checked {
  background: var(--ink);
  box-shadow: inset 0 0 0 4px var(--white);
}

.choice__input:focus {
  outline: none;
}

.choice__input:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.choice:has(.choice__input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.choice:has(.choice__input:focus-visible) .choice__input:focus-visible {
  outline: none;
}

.choice__key {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  font-family: "Roboto Mono", monospace;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1;
}

.choice__text {
  overflow-wrap: anywhere;
  padding-top: 1px;
}

.choice.is-selected,
.choice:has(.choice__input:checked) {
  background: var(--highlight);
  box-shadow: inset 0 0 0 2px var(--ink);
}

.choice.is-selected .choice__key,
.choice:has(.choice__input:checked) .choice__key {
  background: var(--ink);
  color: var(--white);
}

.choice.is-selected .choice__text,
.choice:has(.choice__input:checked) .choice__text {
  font-weight: 700;
}

/* ---------- 操作ボタン ---------- */

.assessment-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.assessment-actions .button:last-child {
  margin-left: auto;
}

.panel .button:disabled:hover,
.panel .button:disabled:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
}

.panel .button.secondary:disabled:hover {
  background: var(--white);
  color: var(--ink);
}

/* ---------- 見直し ---------- */

.review__title {
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  line-height: 1.5;
  margin: 0 0 6px;
}

.review__title:focus,
.result-head__title:focus,
.resume__title:focus {
  outline: none;
}

.review__title:focus-visible,
.result-head__title:focus-visible,
.resume__title:focus-visible {
  outline: 2px dashed var(--ink);
  outline-offset: 4px;
}

.review-grid {
  list-style: none;
  margin: 16px 0 8px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
}

.review-item {
  width: 100%;
  min-height: 52px;
  padding: 4px;
  border: 2px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  line-height: 1.2;
}

.review-item__num {
  font-family: "Roboto Mono", monospace;
  font-weight: 700;
  font-size: 0.9rem;
}

.review-item__mark {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--leaf);
}

.review-item.is-missing {
  border-style: dashed;
  background: #fff6f5;
}

.review-item.is-missing .review-item__mark,
.review-item__mark--missing {
  color: var(--mark-text);
}

.review-item:hover {
  background: var(--highlight);
}

.review-item:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.review-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-bottom: 20px;
}

.review-legend__item {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.submit-box {
  border-top: 1px solid var(--grid);
  padding-top: 18px;
  margin-top: 8px;
}

.turnstile-slot {
  margin: 16px 0 6px;
  min-height: 65px;
  max-width: 100%;
  overflow-x: auto;
}

.form-error:empty {
  display: none;
}

/* ---------- 結果 ---------- */

.result-head {
  padding-bottom: 24px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 8px;
}

.result-head .eyebrow {
  margin-bottom: 10px;
}

.result-head__title {
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 4.2vw, 2.3rem);
  line-height: 1.3;
  margin: 0 0 12px;
}

.result-head__lead {
  margin: 0 0 14px;
  max-width: 40rem;
}

.result-total {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

.result-total .mono {
  color: var(--ink);
  font-weight: 700;
}

.result-keep {
  margin-top: 6px;
  padding-left: 10px;
  border-left: 3px solid var(--highlight);
}

.result-sec {
  padding: 28px 0 4px;
}

.result-sec__title {
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.4;
  margin: 0 0 6px;
}

/* 鉛筆線 */
.dlines {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.dline {
  display: grid;
  grid-template-columns: minmax(8em, 11em) minmax(0, 1fr) auto;
  gap: 6px 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed var(--grid);
}

.dline:last-child {
  border-bottom: 0;
}

.dline__label {
  font-weight: 700;
  line-height: 1.5;
}

.dline__track {
  position: relative;
  display: block;
  height: 14px;
  border-bottom: 1px solid var(--grid);
}

.dline__fill {
  position: absolute;
  left: 0;
  bottom: -2px;
  display: block;
  width: 0;
  height: 0;
  border-top: 4px solid var(--ink);
  border-radius: 2px;
  transition: width 0.9s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.dline--again .dline__fill {
  border-top-style: dashed;
  border-top-color: var(--mark);
}

.dline__score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  line-height: 1.35;
  min-width: 7.5em;
}

.dline__score .mono {
  font-weight: 700;
  font-size: 0.95rem;
}

.dline__word {
  font-size: 0.8rem;
  color: var(--muted);
}

.dline--full .dline__word {
  color: var(--leaf);
  font-weight: 700;
}

.dline--again .dline__word {
  color: var(--mark-text);
  font-weight: 700;
}

/* 次に練習すること */
.next-list {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.next-card {
  border: 2px solid var(--ink);
  padding: 18px 20px;
  background: var(--paper);
}

.next-card__title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.next-card__score {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.next-card p {
  margin: 0;
}

.next-card--done {
  margin-top: 12px;
  border-color: var(--leaf);
}

.talk {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--white);
  border-left: 4px solid var(--highlight);
}

.talk__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 2px !important;
}

.talk__text {
  font-weight: 700;
}

/* ふり返り */
.review-filter {
  margin: 14px 0 10px;
}

.check-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--touch);
  cursor: pointer;
  font-weight: 700;
}

.check-toggle input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--ink);
  cursor: pointer;
}

.check-toggle input:disabled,
.check-toggle input:disabled + span {
  cursor: default;
  color: var(--muted);
}

.rv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--grid);
}

.rv-list.is-filtered .rv--ok {
  display: none;
}

.rv {
  border-bottom: 1px solid var(--grid);
}

.rv__summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: baseline;
  min-height: var(--touch);
  padding: 10px 4px;
  cursor: pointer;
  list-style: none;
}

.rv__summary::-webkit-details-marker {
  display: none;
}

.rv__summary::after {
  content: "+";
  font-family: "Roboto Mono", monospace;
  font-weight: 700;
  color: var(--muted);
  justify-self: end;
}

.rv__details[open] > .rv__summary::after {
  content: "−";
}

.rv__summary:hover {
  background: #edf6fc;
}

.rv__summary:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.rv__num {
  font-weight: 700;
  font-size: 0.85rem;
}

.rv__mark {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.rv--ok .rv__mark {
  color: var(--leaf);
}

.rv--again .rv__mark {
  color: var(--mark-text);
}

.rv__prompt {
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.rv__body {
  padding: 4px 4px 18px;
  margin-left: 4px;
  border-left: 3px solid var(--grid);
  padding-left: 14px;
}

.rv__domain {
  margin: 0 0 8px;
}

.rv__dl {
  margin: 0 0 10px;
  display: grid;
  gap: 8px;
}

.rv__dl div {
  display: grid;
  gap: 0;
}

.rv__dl dt {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.rv__dl dd {
  margin: 0;
}

.rv--again .rv__dl div:last-child:not(:first-child) dd {
  background: linear-gradient(transparent 60%, var(--highlight) 60%);
  display: inline;
}

.rv__explain {
  margin: 0;
  font-size: 0.95rem;
}

/* 保護者・先生の方へ */
.note-card {
  border-left: 4px solid var(--mark);
  padding: 14px 18px;
  background: #fff6f5;
  margin-top: 20px;
}

.note-card p {
  margin: 0;
}

.guide.result-sec {
  padding-top: 18px;
  padding-bottom: 18px;
  margin-top: 28px;
}

.guide p {
  margin: 0 0 8px;
}

.guide__list {
  margin: 0;
  padding-left: 1.3em;
}

.guide__list li + li {
  margin-top: 4px;
}

.learn p {
  margin: 8px 0 0;
}

.result-actions {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}

/* ---------- 状態表示 ---------- */

.error {
  padding: 14px 16px;
  border-left: 5px solid var(--mark);
  background: #fff2ef;
  margin: 12px 0 16px;
}

.error p {
  margin: 0;
}

.error p + p {
  margin-top: 6px;
}

.no-js {
  max-width: 800px;
  margin: 32px auto 0;
  padding: 16px 18px;
  border: 2px solid var(--mark);
  background: #fff2ef;
}

.no-js p {
  margin: 0;
}

.no-js p + p {
  margin-top: 6px;
}

.busy {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 32px 0;
  margin: 0;
  color: var(--muted);
}

.busy__dot {
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink);
  border-right-color: transparent;
  border-radius: 50%;
  animation: check-spin 0.9s linear infinite;
}

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

/* ---------- モバイル ---------- */

@media (max-width: 760px) {
  .assessment {
    margin: 16px 0 48px;
  }

  .assessment-head {
    padding: 16px 18px;
    align-items: stretch;
  }

  .assessment-head__title,
  .progress-wrap {
    width: 100%;
  }

  .progress-label {
    text-align: left;
  }

  .progress {
    width: 100%;
  }

  .grade-grid {
    grid-template-columns: 1fr;
  }

  .choice {
    padding: 12px 12px;
    gap: 10px;
  }

  .assessment-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .assessment-actions .button {
    width: 100%;
  }

  .assessment-actions .button:last-child {
    margin-left: 0;
  }

  .dline {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .dline__track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .dline__score {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
  }

  .rv__summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .rv__prompt {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  .rv__summary::after {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
  }

  .q-count {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 400px) {
  .q-help__keys {
    display: none;
  }

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

/* キーボードがない端末では、キー操作の案内を出さない */
@media (hover: none) and (pointer: coarse) {
  .q-help__keys {
    display: none;
  }
}

/* ---------- 動きを減らす ---------- */

@media (prefers-reduced-motion: reduce) {
  .progress__bar,
  .grade,
  .choice,
  .dline__fill {
    transition: none !important;
  }

  .busy__dot {
    animation: none;
    border-right-color: var(--ink);
  }
}

/* ---------- 印刷 ---------- */

@media print {
  .rv-list.is-filtered .rv--ok {
    display: block !important;
  }

  @page {
    margin: 14mm 12mm;
  }

  body {
    background: #fff !important;
    background-image: none !important;
    color: #000;
  }

  .skip,
  .site-head,
  .site-foot,
  .assessment-head,
  .actions,
  .assessment-actions,
  .no-print,
  .busy,
  .turnstile-slot {
    display: none !important;
  }

  .wrap,
  .check-main {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .assessment {
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    max-width: none;
  }

  .panel {
    padding: 0 !important;
  }

  .result-head__title {
    font-size: 1.6rem;
  }

  .result-sec {
    padding-top: 16px;
  }

  .result-sec__title {
    break-after: avoid;
  }

  .dline,
  .next-card,
  .rv,
  .guide {
    break-inside: avoid;
  }

  .dline__fill {
    transition: none !important;
  }

  .next-card,
  .note-card,
  .talk {
    background: #fff !important;
  }

  .next-card {
    border: 1px solid #555 !important;
  }

  .rv__summary::after {
    content: none !important;
  }

  .rv__body {
    padding-bottom: 10px;
  }

  .rv--again .rv__dl div:last-child:not(:first-child) dd {
    background: none;
    text-decoration: underline;
  }

  .domain-chip {
    background: none;
  }

  a {
    color: #000;
  }

  .learn a[href]::after {
    content: "（" attr(href) "）";
    font-size: 0.8rem;
    word-break: break-all;
  }
}

/* Windows のハイコントラストなど、強制カラーでも選んだ選択肢が分かるようにする */
@media (forced-colors: active) {
  .choice__input {
    forced-color-adjust: none;
    border: 2px solid CanvasText;
    background: Canvas;
  }

  .choice__input:checked {
    background: Highlight;
    box-shadow: inset 0 0 0 3px Canvas;
  }

  .choice:has(.choice__input:checked) {
    outline: 3px solid Highlight;
    outline-offset: -3px;
  }

  .dline__fill {
    forced-color-adjust: none;
    border-top-color: CanvasText;
  }
}

/* ---------- ふりがな ---------- */
.assessment ruby {
  ruby-position: over;
  /* よみが長いときに親文字を広げず、よみを中央にそろえる（「学 習」のように離れないように） */
  ruby-align: center;
}

.assessment rt {
  font-size: 0.5em;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

/* ふりがなを付けると行が詰まって見えるため、本文の行間を少し広げる */
.assessment:not(.furigana-off) .panel {
  line-height: 2;
}

.assessment.furigana-off rt,
.assessment.furigana-off rp {
  display: none;
}

.assessment-head__tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.furigana-toggle {
  white-space: nowrap;
  min-height: var(--touch);
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.furigana-toggle[aria-pressed="true"] {
  background: var(--highlight);
}

.furigana-toggle:hover {
  background: var(--paper);
}

.furigana-toggle[aria-pressed="true"]:hover {
  background: var(--highlight);
}

.furigana-toggle__state {
  margin-left: 0.4em;
  padding: 0 0.4em;
  border-left: 1px solid var(--ink);
}

.furigana-toggle:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- 読み上げ ---------- */
.q-speak {
  margin: 0 0 14px;
}

.speak-button {
  min-height: var(--touch);
  padding: 0 18px;
  font-size: 0.95rem;
}

.speak-button.is-speaking {
  background: var(--highlight);
}

/* ---------- 5分でできる練習 ---------- */
.practice {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--white);
  border-left: 4px solid var(--leaf);
}

.practice__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--leaf);
  margin-bottom: 2px !important;
}

/* ---------- 選んだ答えの理由 ---------- */
.rv__why {
  display: block;
  margin-top: 4px;
  padding-left: 12px;
  border-left: 3px solid var(--grid);
  font-size: 0.92rem;
  color: var(--ink);
}

/* ---------- わが家のAIルールシート ---------- */
.rule-sheet {
  border: 2px dashed var(--ink);
  padding: 18px 20px;
  background: var(--white);
}

.rule-sheet__label {
  display: block;
  font-weight: 700;
  margin: 14px 0 4px;
}

.rule-sheet__line {
  margin: 14px 0 0;
}

.rule-sheet__line .rule-sheet__label {
  margin: 0;
}

.rule-sheet__blank {
  display: block;
  height: 2.4em;
  border-bottom: 1px solid var(--muted);
}

.rule-sheet__checks {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.rule-sheet__checks li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.rule-sheet__box {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 0.5em;
  border: 2px solid var(--ink);
  background: var(--white);
}

@media (max-width: 760px) {
  .assessment-head__tools {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 12px;
  }
}

@media print {
  .furigana-toggle,
  .q-speak {
    display: none !important;
  }

  .rule-sheet {
    break-before: page;
    border: 1px dashed #333 !important;
  }

  .rule-sheet__blank {
    height: 3em;
  }

  /* 「ルールシートだけ印刷する」 */
  .print-sheet-only .result > :not(.rule-sheet),
  .print-sheet-only .assessment-head {
    display: none !important;
  }

  .print-sheet-only .rule-sheet {
    break-before: auto;
  }
}

@media (forced-colors: active) {
  .rule-sheet__box,
  .furigana-toggle {
    border-color: CanvasText;
  }
}
