* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #f3f4f6;
  color: #222;
}

body:has(#screen1.hidden) .home-header-actions {
  display: none;
}
body:has(#screen1:not(.hidden)) .header-left {
  flex-shrink: 0;
}
body:has(#screen1:not(.hidden)) .header-right {
  display: none;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.timer-box {
  padding: 4px 10px 2px;
  border-radius: 10px;
  background-color: #fee2e2;
  border: 1px solid #fecaca;
  min-width: 200px;
}
.timer-label {
  font-size: 0.6875rem;
  color: #7f1d1d;
}
.timer-time {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 0;
  transition: color 0.2s;
}
.timer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.timer-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background-color: #fecaca;
  overflow: hidden;
}
.timer-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(120deg, #2563eb, #3b82f6);
  transition: width 0.2s linear, background 0.2s;
}
.timer-caption {
  font-size: 0.6875rem;
  color: #7f1d1d;
  margin-top: 2px;
}

.header-patient {
  margin-top: 4px;
  font-size: 0.6875rem;
  color: #374151;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hidden { display: none !important; }

/* Keep the exercise header's space while its controls are hidden on the home screen. */
.header-right #timerBox.hidden {
  visibility: hidden;
  pointer-events: none;
}
.header-right #timerBox.hidden { display: block !important; }

/* 残り時間は上部に表示し、入力欄下の案内・時間と右下の重複表示は隠す。 */
#screen3 .send-key-hint,
#screen3 .exercise-inline-timer,
.exercise-floating-timer {
  display: none !important;
}

.page {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px 32px;
}
.page > .page-back-link {
  margin: 0 0 12px;
}
section { margin-bottom: 24px; }

.result-navigation {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
.result-navigation[hidden],
.result-back-to-top[hidden] { display: none !important; }
.result-back-to-top {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px) + var(--result-bottom-bar-height, 0px));
  z-index: 900;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #ffffff;
  color: #1d4ed8;
  box-shadow: 0 4px 18px rgb(15 23 42 / 18%);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}
.result-back-to-top:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}
@media print {
  .result-navigation, .result-back-to-top { display: none !important; }
}

.panel {
  background-color: #ffffff;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
  border-top: 4px solid #f1a7b3;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.panel-title { font-size: 1rem; font-weight: 700; }
.panel-subtitle { font-size: 0.75rem; color: #6b7280; }
.mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin-left: 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  background: #f3f4f6;
  color: #374151;
}
.mode-badge--training { background: #fff7ed; color: #9a3412; }
.mode-badge--interview { background: #e6f4ff; color: #075985; }
.mode-badge--standard { background: #e6f4ff; color: #075985; }
.mode-badge--presentation { background: #f0fdf4; color: #166534; }
.mode-badge--full { background: #f5f3ff; color: #5b21b6; }

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8125rem;
}
.field label { font-weight: 600; }
.helper-text {
  font-size: 0.6875rem;
  color: #6b7280;
  margin-top: 4px;
}

/* === 履歴機能 === */
.history-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}
.history-toolbar .btn {
  padding: 12px 20px;
  border: 0;
  border-radius: 8px;
  background: #1b4da1;
  color: #fff;
  font-weight: 700;
  box-shadow: none;
}
.history-toolbar .btn:hover:not(:disabled) { background: #163e82; }
.history-toolbar .btn:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  opacity: 1;
}
.history-list {
  margin-top: 8px;
}
.history-table {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow-x: auto;
  background: #fff;
}
.history-table-head,
.history-row {
  display: grid;
  grid-template-columns: 40px 50px 116px 112px minmax(180px, 1fr) 110px 86px 68px 116px;
  min-width: 978px;
  align-items: center;
}
.history-table-head {
  background: #f8fafc;
  color: #334155;
  font-size: 0.82em;
  font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
}
.history-head-cell,
.history-cell {
  padding: 12px 8px;
  min-width: 0;
}
.history-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.history-sort-btn:hover {
  color: #0f172a;
}
.history-sort-btn.active {
  color: #0f172a;
}
.history-sort-indicator {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 10px;
  flex-shrink: 0;
}
.history-sort-indicator::before,
.history-sort-indicator::after {
  content: '';
  width: 6px;
  height: 6px;
  border-top: 2px solid #cbd5e1;
  border-left: 2px solid #cbd5e1;
}
.history-sort-indicator::before { transform: rotate(45deg); }
.history-sort-indicator::after { transform: rotate(225deg); }
.history-sort-indicator[data-order="asc"]::before,
.history-sort-indicator[data-order="desc"]::after {
  border-color: #2563eb;
}
.history-header-filter {
  width: 100%;
  min-width: 0;
  padding: 6px 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-overflow: ellipsis;
}
.history-header-filter.active { color: #1d4ed8; background: #dbeafe; }
.history-header-filter:focus-visible,
.history-sort-btn:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
.history-empty-filter { padding: 24px 12px; color: #64748b; text-align: center; }
.history-row {
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.history-row:last-child {
  border-bottom: none;
}
.history-row:hover {
  background: #f8fafc;
}
.history-row.selected {
  background-color: #eff6ff;
}
.history-row.score-high {
  background-image: linear-gradient(90deg, rgba(34, 197, 94, 0.08) 0, rgba(34, 197, 94, 0.08) 6px, transparent 6px);
}
.history-row.score-mid {
  background-image: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0, rgba(245, 158, 11, 0.1) 6px, transparent 6px);
}
.history-row.score-low {
  background-image: linear-gradient(90deg, rgba(239, 68, 68, 0.08) 0, rgba(239, 68, 68, 0.08) 6px, transparent 6px);
}
.history-cell-order {
  text-align: center;
  font-weight: 700;
  color: #0f172a;
}
.history-head-cell-select,
.history-cell-select {
  display: flex;
  align-items: center;
  justify-content: center;
}
.history-select-checkbox,
.history-select-all-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2563eb;
  cursor: pointer;
}
.history-symptom-cell,
.history-patient-cell,
.history-complaint-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.history-symptom-cell {
  font-weight: 700;
  color: #0f172a;
}
.history-patient-cell {
  color: #2563eb;
  font-weight: 600;
}
.history-replay-btn,
.history-review-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.history-replay-btn:hover { text-decoration: underline; }
.history-review-link:focus-visible,
.history-replay-btn:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
.history-assessment-heading,
.history-cell-assessment { text-align: center; }
.history-assessment-mark {
  --self-assessment-color: #9da2ae;
  color: var(--self-assessment-color);
  font-size: 1.65rem;
  line-height: 1;
}
.history-complaint-cell {
  color: #475569;
}
.history-cell-date {
  color: #475569;
  font-size: 0.92em;
}
.history-cell-score {
  font-weight: 700;
}
.history-score-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.9em;
}
.history-score-value.score-high {
  background: #f0fdf4;
  color: #15803d;
}
.history-score-value.score-mid {
  background: #fffbeb;
  color: #b45309;
}
.history-score-value.score-low {
  background: #fef2f2;
  color: #b91c1c;
}
.history-score-value.score-pending {
  background: #f1f5f9;
  color: #64748b;
}
.history-delete-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.history-delete-btn {
  color: #94a3b8;
  font-size: 1em;
}
.history-delete-btn:hover {
  color: #dc2626;
  background: #fee2e2;
}
.history-mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.84em;
  font-weight: 700;
  white-space: nowrap;
}
.history-mode-badge.pre {
  background: #eff6ff;
  color: #1d4ed8;
}
.history-mode-badge.post {
  background: #dbeafe;
  color: #1e40af;
}
.history-mode-badge.speed {
  background: #e0e7ff;
  color: #4338ca;
}
.history-cell-action {
  display: flex;
  justify-content: center;
}
.history-cell-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* モーダル */
.modal-overlay { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.5); z-index:1000; display:flex; justify-content:center; align-items:center; }
.modal-content { background:#fff; width:90%; max-width:800px; height:90%; border-radius:8px; display:flex; flex-direction:column; overflow:hidden; animation:slideIn 0.3s ease; }
@keyframes slideIn { from { transform: translateY(20px); opacity:0; } to { transform: translateY(0); opacity:1; } }
.modal-header { padding:15px; border-bottom:1px solid #ddd; display:flex; justify-content:space-between; background:#f8f9fa; }
.modal-body { padding:20px; overflow-y:auto; flex-grow:1; }
.modal-footer { padding:10px; border-top:1px solid #ddd; text-align:right; background:#f8f9fa; }
body.history-review-open { overflow: hidden; }
.history-review-modal {
  width: calc(100% - 40px);
  max-width: 1000px;
  height: min(88vh, 1000px);
  height: min(88dvh, 1000px);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.3);
}
.history-review-modal .modal-header,
.history-review-modal .modal-footer { flex-shrink: 0; }
.history-review-modal .modal-header { align-items: center; }
.history-review-modal .modal-header h2 { font-size: 1.25rem; }
.history-review-modal .modal-body { min-height: 0; overscroll-behavior: contain; background: #f8fafc; }
.history-review-meta { margin-bottom: 20px; overflow-wrap: anywhere; }
.history-review-meta h3 { margin: 0 0 6px; color: #0f172a; }
.history-review-meta p { margin: 4px 0; color: #64748b; font-size: 0.8125rem; line-height: 1.6; }
.history-evaluation-view { min-width: 0; overflow-wrap: anywhere; }
.history-evaluation-view > *,
.history-evaluation-view .soap-layout > * { min-width: 0; }
.history-material-status { margin: 16px 0; color: #64748b; font-size: 0.8125rem; line-height: 1.7; }
.history-material-status .btn { display: block; margin-top: 10px; }
.history-review-presentation summary { cursor: pointer; }
@media (max-width: 640px) {
  .history-review-modal { width: calc(100% - 16px); height: 94vh; height: 94dvh; border-radius: 12px; }
  .history-review-modal .modal-body { padding: 12px; }
  .history-review-modal .soap-layout { grid-template-columns: minmax(0, 1fr); }
}
.history-results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 12px;
  padding: 16px;
  border-radius: 10px;
  background: #f8fafc;
}
.history-result-count {
  flex: 1 1 220px;
  color: #1f2937;
  font-size: 1rem;
  font-weight: 700;
}
.history-result-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.history-result-filter {
  min-width: 48px;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #e5e7eb;
  color: #64748b;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.history-result-filter:hover { background: #dbeafe; }
.history-result-filter[aria-pressed="true"] {
  background: #164ca3;
  border-color: #164ca3;
  color: #fff;
}
.history-result-filter:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }

.detail-section { margin-bottom:30px; }
.detail-label { font-size:0.9em; color:#7f8c8d; border-bottom:2px solid #eee; margin-bottom:10px; padding-bottom:5px; }
.history-detail-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(110px, 1fr)); gap:8px; margin-top:8px; }
.history-detail-stat { background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px; padding:8px 10px; display:flex; flex-direction:column; gap:4px; }
.history-detail-stat span { font-size:0.75em; color:#64748b; }
.history-detail-stat strong { font-size:0.95em; color:#0f172a; }
.history-detail-breakdown { margin-top:10px; border:1px solid #e2e8f0; border-radius:8px; overflow:hidden; }
.history-detail-breakdown-row { display:flex; justify-content:space-between; gap:12px; padding:7px 10px; font-size:0.88em; border-top:1px solid #edf2f7; }
.history-detail-breakdown-row:first-child { border-top:none; }
.history-detail-breakdown-row span:first-child { color:#334155; font-weight:600; }
.history-detail-breakdown-row span:last-child { color:#64748b; white-space:nowrap; }
.specialty-progress-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.specialty-progress-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
}
.specialty-progress-summary-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #000000;
  border: 1px solid #d1d5db;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}
.specialty-progress-summary-text {
  color: #000000;
  font-size: 0.92rem;
  line-height: 1.5;
}
.specialty-progress-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.specialty-progress-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.specialty-progress-card {
  width: 100%;
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  background: #ffffff;
  padding: 15px 16px;
  display: block;
  text-align: left;
  font: inherit;
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.specialty-progress-group.open .specialty-progress-card {
  border-color: #94a3b8;
}
.specialty-progress-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(148, 163, 184, 0.16);
}
.specialty-progress-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}
.specialty-progress-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.specialty-progress-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 0 240px;
}
.specialty-progress-code {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  color: #000000;
  font-size: 1rem;
  font-weight: 800;
  flex: 0 0 auto;
}
.specialty-progress-label {
  color: #000000;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}
.specialty-progress-percent {
  color: #000000;
  font-size: 1rem;
  font-weight: 800;
  white-space: nowrap;
}
.specialty-progress-track {
  flex: 1 1 auto;
  height: 24px;
  border-radius: 5px;
  background: #e5e7eb;
  overflow: hidden;
}
.specialty-progress-fill {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: #f3bcc7;
}
.specialty-progress-card--pink .specialty-progress-fill {
  background: #f3bcc7;
}
.specialty-progress-card--blue .specialty-progress-fill {
  background: #f3bcc7;
}
.specialty-progress-detail {
  padding: 4px 8px 4px 22px;
}
.specialty-progress-detail-item {
  width: 100%;
  padding: 10px 14px;
  border-top: 1px solid #e5e7eb;
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-radius: 0;
  background: #ffffff;
  color: #000000;
  font-size: 0.96rem;
  line-height: 1.5;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: inherit;
  cursor: pointer;
}
.specialty-progress-detail-item:first-child {
  border-top: none;
}
.specialty-progress-detail-item:hover {
  background: #f8fafc;
}
.specialty-progress-detail-item:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.22);
  outline-offset: 1px;
}
.specialty-progress-detail-item.is-achieved {
  background: #f9d7df;
}
.specialty-progress-detail-item.is-achieved:hover {
  background: #f6cfd8;
}
.specialty-progress-detail-item.is-locked {
  color: #374151;
  background: #f8fafc;
  cursor: default;
  opacity: 0.82;
}
.specialty-progress-detail-item.is-locked:disabled {
  pointer-events: none;
}
.specialty-progress-detail-main {
  color: #000000;
}
.specialty-progress-detail-date {
  color: #475569;
  font-size: 0.86rem;
  white-space: nowrap;
}
.log-container { background:#f9f9f9; padding:15px; border-radius:6px; max-height:300px; overflow-y:auto; border:1px solid #eee; }
.log-row { margin-bottom:8px; }
.log-bubble { padding:6px 10px; border-radius:8px; display:inline-block; max-width:80%; }
.log-user .log-bubble { background:#d1ecf1; color:#0c5460; }
.log-model .log-bubble { background:#e2e3e5; color:#383d41; }
.log-user { text-align:right; }

.btn {
  border: none;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.8125rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}
.btn.is-loading {
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
.btn-loading-spinner {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.btn-primary {
  background: linear-gradient(120deg, #2563eb, #3b82f6);
  color: #ffffff;
  box-shadow: 0 3px 6px rgba(37, 99, 235, 0.4);
}
.btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-primary.is-loading:disabled {
  background: linear-gradient(120deg, #2563eb, #3b82f6);
  cursor: wait;
  opacity: 0.9;
}
.btn-secondary {
  background-color: #e5e7eb;
  color: #111827;
}
.btn-row {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.btn-row > #backToCasesBtn,
.btn-row > a[href^="/case-category.html"] {
  margin-right: auto;
}
.start-session-row {
  margin: 6px 0 12px;
  display: flex;
  justify-content: flex-end;
}
.start-session-row.bottom {
  margin-top: 18px;
}

@media (max-width: 640px) {
  .history-toolbar {
    align-items: stretch;
    width: 100%;
  }
  .history-toolbar .btn {
    flex: 1 1 0;
  }
  .specialty-progress-summary {
    flex-direction: column;
    align-items: flex-start;
  }
  .specialty-progress-card {
    padding: 14px;
  }
  .specialty-progress-inline {
    align-items: flex-start;
    flex-direction: column;
  }
  .specialty-progress-name {
    width: 100%;
    flex: 0 0 auto;
  }
  .specialty-progress-track {
    width: 100%;
  }
  .specialty-progress-detail {
    padding-left: 10px;
  }
  .specialty-progress-detail-item {
    align-items: flex-start;
    flex-direction: column;
  }
  .specialty-progress-detail-date {
    white-space: normal;
  }
}

/* ==== 設定エリア（難易度・患者タイプ） ==== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  background-color: #f9fafb;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
@media (max-width: 700px) {
  .settings-grid { grid-template-columns: 1fr; }
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.radio-btn, .checkbox-btn {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  padding: 6px 12px;
  font-size: 0.8125rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.radio-btn input, .checkbox-btn input {
  cursor: pointer;
}
.radio-btn.selected {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
}

.case-buttons { margin-top: 6px; }
.case-buttons.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.case-random {
  margin-bottom: 6px;
  width: 100%;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
}
.case-first-round-btn {
  --first-round-size: 46px;
  border: none;
  background-color: transparent;
  color: #111827;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: none;
  white-space: normal;
}
.case-first-round-btn:hover .case-first-round-icon {
  border-color: #9ca3af;
}
.case-first-round-btn:focus-visible {
  outline: 2px solid #94a3b8;
  outline-offset: 3px;
}
.case-first-round-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
/* 全体の行だけ文字を表示し、各巻は位置と読み上げ名を保ってアイコンのみ表示する。 */
.case-vol-section .case-first-round-label {
  clip-path: inset(50%);
}
.case-first-round-icon {
  width: var(--first-round-size);
  height: var(--first-round-size);
  border: 2px solid #bdbdbd;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
}
.case-first-round-icon svg {
  width: 19px;
  height: 19px;
  stroke: #bdbdbd;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.case-first-round-btn.selected .case-first-round-label {
  color: #2563eb;
}
.case-first-round-btn.selected .case-first-round-icon {
  border-color: #2563eb;
}
.case-first-round-btn.selected .case-first-round-icon svg {
  stroke: #2563eb;
}
.case-first-round-top-btn {
  width: 100%;
}
.case-vol-header-styled .case-first-round-btn {
  --first-round-size: 40px;
  order: 1;
}
.case-vol {
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px dashed #e5e7eb;
}
.case-vol-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 8px;
}
.case-vol-title {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 600;
}
/* 新しいVolヘッダー */
.case-vol-section {
  margin-top: 4px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 14px;
}
.case-vol-header-styled {
  grid-column: 1 / -1;
  margin-top: 12px;
  margin-bottom: 10px;
  padding: 0;
  background-color: transparent;
  border-radius: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #374151;
}
.case-vol-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  padding: 15px 16px;
  margin: 0;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.case-vol-meta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(148, 163, 184, 0.16);
}
.case-vol-meta.selected {
  border-color: #94a3b8;
  background-color: #ffffff;
  color: #1d4ed8;
}
.case-vol-meta.selected .vol-title,
.case-vol-meta.selected .vol-score-subtext {
  color: #1d4ed8;
}
.vol-title {
  color: #374151;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}
.vol-score-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 1 58%;
  min-width: 320px;
}
.vol-score-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  flex: 0 0 auto;
  min-width: 112px;
}
.vol-score-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b7280;
}
.vol-score-subtext {
  font-size: 1rem;
  font-weight: 800;
  color: #2563eb;
  white-space: nowrap;
}
.vol-score-rate {
  color: #374151;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}
.vol-score-container.score-mid .vol-score-subtext {
  color: #2563eb;
}
.vol-score-container.score-low .vol-score-subtext {
  color: #2563eb;
}
.vol-score-track {
  flex: 1 1 auto;
  min-width: 220px;
  height: 24px;
  background-color: #e5e7eb;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
}
.vol-score-fill {
  display: block;
  height: 100%;
  border-radius: 0;
}
.vol-score-fill-high {
  background-color: #4E80ED;
}
.vol-score-fill-mid {
  background-color: #E8A13B;
}
.vol-score-fill-low {
  background-color: #DD514C;
}

/* 全体の成績用スタイル（さらに大きく） */
.total-score-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  font-size: 1rem;
  padding: 15px 16px;
  border: 1px solid #dbe4f0;
  background-color: #ffffff;
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.total-score-header:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(148, 163, 184, 0.16);
}
.total-score-header.is-loading {
  cursor: default;
}
.total-score-header.is-loading:hover {
  transform: none;
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.12);
}
.case-buttons-loading .case-first-round-btn {
  cursor: default;
  opacity: 0.72;
}
.total-score-header .vol-score-text {
  font-size: 0.875rem;
  font-weight: 700;
  color: #374151;
}
.total-score-header .vol-score-subtext {
  font-size: 1rem;
}
.total-score-header .vol-score-container {
  flex-basis: 58%;
  min-width: 320px;
}

/* スコア別色分け：背景は共通、文字色のみ変更 */
.total-score-header.score-high {
  background-color: #ffffff;
}
.total-score-header.score-high .vol-score-text {
  color: #374151;
}
.total-score-header.score-mid {
  background-color: #ffffff;
}
.total-score-header.score-mid .vol-score-text {
  color: #374151;
}
.total-score-header.score-low {
  background-color: #ffffff;
}
.total-score-header.score-low .vol-score-text {
  color: #374151;
}
.total-score-header .vol-score-track {
  height: 24px;
}

/* Pre OSCE・カスタム練習：ラベルの高さに左右されず、項目と矢印を中央揃えにする。 */
:is(#preccPane, #postccExtraPane) {
  --case-random-size: 54px;
}
:is(#preccPane, #postccExtraPane) .case-vol-header-styled {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--case-random-size);
  align-items: center;
  gap: 12px;
}
:is(#preccPane, #postccExtraPane) .total-score-row {
  margin-top: 20px;
}
:is(#preccPane, #postccExtraPane) :is(.total-score-header, .case-vol-meta) {
  min-height: var(--case-random-size);
  border: 1px solid #dbe1e9;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05);
}
:is(#preccPane, #postccExtraPane) .case-vol-header-styled > .case-first-round-btn {
  --first-round-size: 100%;
  position: relative;
  width: var(--case-random-size);
  height: var(--case-random-size);
  min-width: 0;
  gap: 0;
  border: 1px solid #dbe1e9;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05);
}
:is(#preccPane, #postccExtraPane) .case-vol-header-styled .case-first-round-label {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.625rem;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}
:is(#preccPane, #postccExtraPane) .case-vol-header-styled .case-first-round-icon {
  flex: 1;
  border: 0;
  border-radius: inherit;
  box-sizing: border-box;
}
:is(#preccPane, #postccExtraPane) .case-vol-header-styled .case-first-round-icon svg {
  width: 24px;
  height: 24px;
  stroke: #858585;
}
:is(#preccPane, #postccExtraPane) .case-vol-header-styled > .case-first-round-btn:hover {
  border-color: #8b98aa;
}
:is(#preccPane, #postccExtraPane) .case-vol-header-styled > .case-first-round-btn.selected {
  border-color: #2563eb;
}
:is(#preccPane, #postccExtraPane) .case-vol-header-styled > .case-first-round-btn.selected svg {
  stroke: #2563eb;
}

@media (max-width: 768px) {
  :is(#preccPane, #postccExtraPane) {
    --case-random-size: 48px;
  }
  .case-vol-meta {
    align-items: flex-start;
    flex-direction: column;
  }
  .vol-score-container {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
  }
  .vol-score-copy {
    min-width: 96px;
  }
}

.case-category-group {
  display: contents;
}
.case-vol-section.category-page-active .case-category-group {
  display: none;
}
.case-vol-section.category-page-active .case-category-group.active {
  display: block;
  grid-column: 1 / -1;
}
.case-vol-section.category-page-active .case-category-group.active .case-category-header {
  display: none;
}
.case-category-header {
  min-height: 54px;
  width: 100%;
  border: 2px solid #c3ccda;
  border-radius: 14px;
  background: #ffffff;
  color: #66748a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.case-category-header:hover,
.case-category-header.selected {
  background-color: #f8fafc;
  border-color: #8b98aa;
  color: #334155;
  box-shadow: 0 4px 10px rgba(148, 163, 184, 0.16);
}
.case-category-header:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 2px;
}
.case-category-header .count-badge {
  display: none;
}
/* Pre-CC / Post-CC / カスタム練習：巻は見出し、症候は進捗付きの一覧行。 */
:is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout {
  --postcc-random-size: 60px;
  --postcc-row-gap: 12px;
}
:is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout .case-buttons-list { gap: 24px; }
:is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout .case-vol-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
:is(#preccPane, #postccPane, #postccExtraPane) .postcc-vol-title {
  margin: 0;
  color: #273142;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.5;
}
:is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout :is(.total-score-row, .case-category-group) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--postcc-random-size);
  align-items: center;
  gap: var(--postcc-row-gap);
}
:is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout .total-score-row { margin: 16px 0 20px; }
:is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout :is(.total-score-header, .case-category-header) {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(0, 1.6fr);
  gap: 20px;
  min-height: 60px;
  padding: 10px 16px;
  border: 1px solid #dbe1e9;
  border-radius: 12px;
  color: #273142;
  text-align: left;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05);
}
:is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout .case-category-name { line-height: 1.5; }
:is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout .vol-score-container {
  min-width: 0;
  width: 100%;
}
:is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout .vol-score-track { min-width: 0; height: 24px; }
:is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout :is(.total-score-row, .case-category-group) > .case-first-round-btn {
  --first-round-size: 100%;
  position: relative;
  width: var(--postcc-random-size);
  height: var(--postcc-random-size);
  min-width: 0;
  gap: 0;
  border: 1px solid #dbe1e9;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05);
}
:is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout .total-score-row .case-first-round-label {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.625rem;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}
:is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout :is(.total-score-row, .case-category-group) .case-first-round-icon {
  flex: 1;
  border: 0;
  border-radius: inherit;
  box-sizing: border-box;
}
:is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout :is(.total-score-row, .case-category-group) .case-first-round-icon svg {
  width: 24px;
  height: 24px;
  stroke: #858585;
}
:is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout :is(.total-score-row, .case-category-group) > .case-first-round-btn:hover {
  border-color: #8b98aa;
}
:is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout :is(.total-score-row, .case-category-group) > .case-first-round-btn.selected {
  border-color: #2563eb;
}
:is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout :is(.total-score-row, .case-category-group) > .case-first-round-btn.selected svg {
  stroke: #2563eb;
}
@media (max-width: 768px) {
  :is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout {
    --postcc-random-size: 48px;
    --postcc-row-gap: 10px;
  }
  :is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout :is(.total-score-header, .case-category-header) {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 10px 12px;
  }
  :is(#preccPane, #postccPane, #postccExtraPane) .postcc-category-layout .vol-score-copy { min-width: 0; }
}
/* スマホのホームは画面幅を使い、症候名・残数の下に進捗をまとめる。 */
@media (max-width: 640px) {
  body:has(#screen1:not(.hidden)) { background: #fff; }
  body:has(#screen1:not(.hidden)) .page {
    padding: 8px max(6px, env(safe-area-inset-right)) 24px max(6px, env(safe-area-inset-left));
  }
  #screen1 {
    padding: 8px 2px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  #screen1 .home-start-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 0 0 10px; }
  #screen1 .home-start-main-actions { grid-column: 1; width: 100%; }
  #screen1 .home-start-main-actions > .btn {
    min-height: 40px;
    padding: 8px;
    font-size: 0.875rem;
    border-radius: 6px;
  }
  #screen1 .home-start-row > .home-record-actions { grid-column: 2; gap: 0; }
  #screen1 .home-main-tabs { margin-bottom: 10px; border-radius: 6px; }
  #screen1 .home-main-tab { min-height: 44px; padding: 8px 4px; font-size: 0.75rem; border-bottom-width: 3px; }
  #screen1 .home-pane { margin-top: 0; }
  #screen1 .postcc-snapshot-wrapper { padding: 0; border: 0; border-radius: 0; }
  #screen1 .postcc-category-layout {
    --postcc-random-size: 52px;
    --postcc-row-gap: 8px;
  }
  #screen1 .postcc-category-layout .case-buttons-list { gap: 20px; }
  #screen1 .postcc-category-layout .case-vol-section { gap: 10px; }
  #screen1 .postcc-vol-title { margin-bottom: 2px; font-size: 0.875rem; }
  #screen1 .postcc-category-layout .total-score-row { margin: 20px 0 16px; }
  #screen1 .postcc-category-layout :is(.total-score-header, .case-category-header) {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 6px;
    min-height: 56px;
    padding: 8px;
    border-radius: 10px;
    font-size: 0.8125rem;
  }
  #screen1 .postcc-category-layout :is(.vol-title, .case-category-name) {
    grid-column: 1;
    grid-row: 1;
    font-size: 0.8125rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }
  #screen1 .postcc-category-layout .vol-score-container { display: contents; }
  #screen1 .postcc-category-layout .vol-score-copy {
    grid-column: 2;
    grid-row: 1;
    align-items: flex-end;
    gap: 0;
    min-width: 0;
    line-height: 1.2;
  }
  #screen1 .postcc-category-layout .vol-score-subtext { font-size: 0.75rem; }
  #screen1 .postcc-category-layout .vol-score-rate { font-size: 0.625rem; }
  #screen1 .postcc-category-layout .vol-score-track {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    height: 10px;
    min-width: 0;
    border-radius: 4px;
  }
  #screen1 .postcc-category-layout :is(.total-score-row, .case-category-group) > .case-first-round-btn {
    align-self: stretch;
    height: auto;
    min-height: 56px;
    border-radius: 10px;
  }
  #screen1 .postcc-category-layout .case-first-round-icon svg { width: 20px; height: 20px; }
}
.case-category-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 12px;
}
.case-category-back {
  border: 2px solid #c3ccda;
  border-radius: 12px;
  background: #ffffff;
  color: #66748a;
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 800;
  padding: 9px 14px;
}
.case-category-back:hover {
  border-color: #8b98aa;
  color: #334155;
  background: #f8fafc;
}
.case-category-detail-title {
  color: #111827;
  font-size: 1.25rem;
  font-weight: 800;
}
.case-list-container {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 0;
  margin: 0 0 8px;
}

.case-buttons-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.case-btn {
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background-color: #f9fafb;
  cursor: pointer;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.case-btn:not(.selected):not(:disabled):hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
.case-btn-main {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}
.case-btn-copy {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.case-btn-info {
  font-size: 0.85em;
  color: #666;
  margin-left: 4px;
}
.case-btn span.index {
  font-weight: 700;
  margin-right: 4px;
}
.case-btn-history {
  margin-left: auto;
  flex: 0 0 auto;
}
.case-history-meta {
  display: none;
  min-width: 128px;
  padding-left: 12px;
  border-left: 1px solid #dbe4f0;
  flex-direction: row;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  font-size: 0.65625rem;
  color: #64748b;
}
.case-history-line {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  white-space: nowrap;
}
.case-history-label {
  color: #94a3b8;
  font-weight: 600;
}
.case-history-value {
  color: #475569;
  font-weight: 700;
}
#preccPane .case-history-meta--precc,
#postccPane .case-history-meta--postcc,
#postccExtraPane .case-history-meta--speed {
  display: inline-flex;
}
.case-btn.selected {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
}
.case-btn.selected .case-btn-info,
.case-btn.selected .case-history-label,
.case-btn.selected .case-history-value {
  color: rgba(255, 255, 255, 0.92);
}
.case-btn.selected .case-history-meta {
  border-left-color: rgba(255, 255, 255, 0.28);
}

@media (max-width: 820px) {
  .case-btn {
    align-items: flex-start;
    flex-direction: column;
  }
  .case-btn-history {
    margin-left: 0;
    width: 100%;
  }
  .case-history-meta {
    min-width: 0;
    width: 100%;
    padding-left: 0;
    padding-top: 6px;
    border-left: none;
    border-top: 1px solid #dbe4f0;
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .case-history-line {
    justify-content: flex-start;
  }
  .case-btn.selected .case-history-meta {
    border-top-color: rgba(255, 255, 255, 0.28);
  }
}

/* ==== 予診票 ==== */
#screen2.postcc-task-layout {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#screen2.postcc-task-layout > .panel-header,
#screen2.postcc-task-layout > .yoshinhyo-grid {
  display: none;
}
.postcc-task-sheet {
  width: 100%;
  margin: 0 0 20px;
  padding: 24px 28px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  color: #000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.9;
  overflow-wrap: anywhere;
}
.postcc-task-sheet h2 {
  margin: 0 0 20px;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.6;
  text-align: left;
}
.postcc-task-sheet p {
  margin: 0;
}
.postcc-task-patient > span {
  display: inline-block;
  margin-right: 0.5em;
}
.postcc-task-patient ruby {
  ruby-position: over;
}
.postcc-task-patient rt {
  font-size: 0.625em;
  font-weight: 400;
  line-height: 1.2;
}
.postcc-task-sheet .postcc-task-instructions {
  margin-top: 20px;
}
.postcc-task-sheet .postcc-task-note {
  margin-top: 16px;
}
.precc-task-items,
.precc-task-notes {
  list-style: none;
  margin: 20px 0 0;
  padding-left: 1.5em;
}
.precc-task-items li,
.precc-task-notes li {
  position: relative;
}
.precc-task-items li::before,
.precc-task-notes li::before {
  position: absolute;
  left: -1.5em;
  content: "●";
}
.precc-task-notes {
  padding-left: 2.5em;
}
.precc-task-notes li + li {
  margin-top: 10px;
}
.precc-task-notes li::before {
  content: "＊";
}
#preccPresentationInstruction {
  color: #1d4ed8;
}
.practice-mode-descriptions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
  margin-top: 20px;
  padding: 20px 24px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
  color: #374151;
  font-size: 0.875rem;
  line-height: 1.7;
}
.practice-mode-descriptions h3 {
  margin: 0 0 6px;
  color: #164ca3;
  font-size: 0.9375rem;
}
.practice-mode-descriptions p {
  margin: 0;
}
.practice-mode-descriptions-note {
  grid-column: 1 / -1;
  color: #64748b;
  font-size: 0.8125rem;
}
#screen2 > .practice-save-mode,
#screen2 > .btn-row {
  width: 100%;
}
#screen2 .practice-save-mode-options,
#screen2 > .btn-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 360px);
  margin-left: auto;
}
#screen2 .practice-save-mode-options {
  padding: 0;
  border: 0;
  background: transparent;
}
#screen2 > .btn-row {
  display: flex;
  width: 100%;
}
#screen2 > .btn-row > .btn {
  flex: 0 1 176px;
}
#screen2 .practice-save-mode-option,
#screen2 > .btn-row > .btn {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: center;
  white-space: normal;
}
#screen2 .practice-save-mode-option:not(.selected) {
  box-shadow: inset 0 0 0 1px #dbe3ef;
}
@media (max-width: 600px) {
  .practice-mode-descriptions {
    grid-template-columns: 1fr;
    padding: 16px 18px;
  }
  .postcc-task-sheet {
    padding: 20px 18px;
    font-size: 0.875rem;
  }
  .postcc-task-sheet h2 {
    margin-bottom: 16px;
    font-size: 1.25rem;
  }
  #screen2 > .practice-save-mode {
    flex-wrap: wrap;
  }
  #screen2 .practice-save-mode-option {
    min-width: 0;
    padding: 8px 12px;
  }
}
.presentation-intake-intro {
  overflow-wrap: anywhere;
}
.presentation-intake-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.presentation-intake-header h2 {
  margin: 0;
}
.presentation-intake-header .btn {
  flex-shrink: 0;
  min-height: 36px;
}
.presentation-intake-intro p {
  margin: 0;
}
.presentation-intake-intro .custom-settings-notice {
  margin: -8px 0 16px;
  color: #64748b;
  text-align: right;
}
.custom-intake-pdf-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  margin-top: 24px;
  font-size: 0.875rem;
}
.custom-intake-pdf-actions .btn {
  min-height: 40px;
  white-space: normal;
}
#screen2:has(input[name="practiceSaveMode"][value="face-to-face"]:checked) #customIntakePdf {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 56px;
  padding: 14px 26px;
  border: 1px solid #2563eb;
  border-radius: 14px;
  background: #2563eb;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 3px 8px rgb(37 99 235 / 22%);
}
#screen2:has(input[name="practiceSaveMode"][value="face-to-face"]:checked) #customIntakePdf:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}
#screen2:has(input[name="practiceSaveMode"][value="face-to-face"]:checked) #customIntakePdf:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 3px;
}
.custom-intake-pdf-actions a[aria-disabled="true"] {
  opacity: .6;
  pointer-events: none;
}
#customIntakePdfStatus {
  width: 100%;
}
.custom-intake-guide {
  flex: 1 1 20rem;
  min-width: 0;
}
.custom-intake-guide > summary {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  list-style: none;
}
.custom-intake-guide > summary::-webkit-details-marker {
  display: none;
}
.custom-intake-guide > summary::before {
  content: "▸";
  margin-right: 4px;
}
.custom-intake-guide[open] > summary::before {
  content: "▾";
}
.custom-intake-guide > summary:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}
.custom-intake-guide-content {
  margin-top: 12px;
  padding: 16px 20px;
  border: 1px solid #dbe3ed;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  line-height: 1.8;
}
.custom-intake-guide-content ol {
  margin: 0;
  padding-left: 1.5em;
}
.custom-intake-guide-content li + li {
  margin-top: 8px;
}
.presentation-intake-intro .custom-intake-guide-content p {
  margin-top: 12px;
}
@media (max-width: 600px) {
  .presentation-intake-header { flex-wrap: wrap; }
}
.presentation-intake-instructions {
  margin: 20px 0;
  font-size: 0.875rem;
  line-height: 1.8;
}
.yoshinhyo-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  row-gap: 6px;
  column-gap: 12px;
  font-size: 0.8125rem;
}
.yoshinhyo-label {
  font-weight: 600;
  text-align: right;
  padding-right: 4px;
}
.yoshinhyo-value {
  background-color: #f9fafb;
  border-radius: 4px;
  padding: 4px 6px;
  border: 1px solid #e5e7eb;
}
.practice-save-mode {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}
.practice-save-mode-label {
  color: #374151;
  font-size: 0.8125rem;
  font-weight: 700;
}
.practice-save-mode-options {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: #f3f4f6;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
}
.practice-save-mode-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 36px;
  padding: 8px 16px;
  border-radius: 999px;
  color: #64748b;
  font-size: 0.8125rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}
.practice-save-mode-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.practice-save-mode-option.selected {
  background: #ffffff;
  color: #164ca3;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.16);
}
.yoshinhyo-small {
  margin-bottom: 12px;
  font-size: 0.8125rem;
  color: #1e3a8a;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 600;
}

/* ==== 患者タイプ ==== */
.patient-persona {
  margin-top: 6px;
  font-size: 0.75rem;
  color: #4b5563;
}

/* ==== 画面3レイアウト ==== */
.training-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}
.training-layout-left,
.training-layout-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  height: 100%;
}
.training-layout .memo-section {
  margin-top: 0;
}
#generalMemoSection {
  padding: 0;
  border: 0;
  background: transparent;
}
@media (max-width: 960px) {
  .training-layout {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 768px) {
  #trainingLayout.layout-mode-interview_only {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  #trainingLayout.layout-mode-interview_only .memo-section {
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  #trainingLayout.layout-mode-interview_only #freeMemo {
    flex: 1;
    min-height: 360px;
  }
}

/* ==== チャット ==== */
.chat-panel { display: flex; flex-direction: column; gap: 8px; }
.patient-speech-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  font-size: 0.8125rem;
}
.patient-speech-toggle, .patient-speech-replay {
  min-height: 36px;
  padding: 5px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font: inherit;
  cursor: pointer;
}
.patient-speech-toggle { min-width: 60px; font-weight: 700; }
.patient-speech-toggle[aria-checked="true"] { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.patient-speech-replay[aria-pressed="true"] { background: #dbeafe; border-color: #2563eb; color: #1d4ed8; }
.patient-speech-controls button:focus-visible, .patient-speech-replay:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
.patient-speech-controls button:disabled { opacity: 0.55; cursor: default; }
.patient-speech-status { flex-basis: 100%; margin: 0; color: #64748b; font-size: 0.75rem; }
.chat-content .patient-speech-replay { margin-top: 4px; font-size: 0.75rem; }
.patient-speech-replay[hidden] { display: none; }
.chat-log {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 8px;
  background-color: #f9fafb;
  overflow-y: auto;
  font-size: 0.8125rem;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 360px;
}
.chat-message-row {
  display: flex;
  width: 100%;
  gap: 10px;
  align-items: flex-start;
}
/* 医学生（右側） */
.chat-message-row.student {
  flex-direction: row-reverse;
}
/* システムメッセージ（中央） */
.chat-message-row.system {
  justify-content: center;
}

/* アイコン */
.chat-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  overflow: hidden;
}
.chat-icon-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chat-message-row.student .chat-icon {
  background-color: #dbeafe; /* 薄い青 */
}
.chat-message-row.patient .chat-icon {
  background-color: #fff;
  border: 1px solid #e5e7eb;
}

/* コンテンツラッパー（名前と吹き出し） */
.chat-content {
  display: flex;
  flex-direction: column;
  max-width: 70%;
}
.chat-message-row.student .chat-content {
  align-items: flex-end;
}
.chat-message-row.patient .chat-content {
  align-items: flex-start;
}

.chat-message {
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 18px;
  font-size: 0.8125rem;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
  position: relative;
}
.chat-message.patient {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-top-left-radius: 4px;
}
.chat-message.student {
  background-color: #2563eb;
  color: #ffffff;
  border-top-right-radius: 4px;
}
.chat-message.system {
  margin: 0 auto;
  background-color: #e5e7eb;
  color: #374151;
  font-size: 0.75rem;
  line-height: 1.6;
  border-radius: 12px;
  padding: 8px 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.chat-meta {
  font-size: 0.625rem;
  color: #9ca3af;
  margin-bottom: 2px;
}
.chat-input-area { display: flex; flex-direction: column; gap: 6px; }
.chat-input-row { display: flex; gap: 6px; align-items: stretch; }
.chat-input-area textarea {
  flex: 1;
  resize: vertical;
  min-height: 60px;
  max-height: 130px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 0.8125rem;
}
.voice-input-btn {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  min-width: 38px;
  padding: 0;
  border: 1px solid #d1d5db;
  background: #f8fafc;
  color: #334155;
  box-shadow: none;
}
.voice-input-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.voice-input-btn:hover:not(:disabled) {
  background: #eef2ff;
  color: #1d4ed8;
}
.voice-input-btn.is-recording {
  border-color: #fecaca;
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.16);
}
.voice-input-btn.is-recording svg {
  opacity: 0;
}
.voice-input-btn.is-recording::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.voice-input-btn.is-recording::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #dc2626;
}
.voice-input-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.voice-input-status {
  min-height: 16px;
  padding: 0 2px;
  color: #64748b;
  font-size: 0.6875rem;
  line-height: 1.4;
}
.voice-input-status.error {
  color: #b91c1c;
}
.phrase-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.6875rem;
}
.phrase-btn {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background-color: #f3f4f6;
  padding: 4px 10px;
  cursor: pointer;
}

/* ==============================
   身体診察ブロック
   ============================== */
.body-exam-panel {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  margin-bottom: 16px;
  overflow: hidden;
}

.body-exam-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #eef0f2;
  background: #fafafa;
}

.body-exam-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: #1f2937;
}

.body-exam-badge {
  font-size: 0.6875rem;
  background: #fff7ed;
  color: #9a3412;
  padding: 2px 8px;
  border-radius: 999px;
}

.body-exam-log {
  height: 280px;
  overflow-y: auto;
  padding: 14px 16px;
  background: #fcfcfd;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.body-exam-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.body-exam-row.body-exam-doctor {
  justify-content: flex-end;
}

.body-exam-row.body-exam-system {
  justify-content: center;
}

.body-exam-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.body-exam-avatar-supervisor {
  background: #fff3e0;
  color: #8b5e34;
  border: 1px solid #ffe0b2;
}

.body-exam-avatar-doctor {
  background: #e3f2fd;
  color: #1e40af;
  order: 2;
}

.body-exam-label {
  font-size: 0.6875rem;
  color: #6b7280;
  margin-bottom: 4px;
}

.body-exam-row.body-exam-doctor .body-exam-label {
  text-align: right;
}

.body-exam-bubble {
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.8125rem;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  word-wrap: break-word;
  white-space: pre-wrap;
}

.body-exam-content {
  display: flex;
  flex-direction: column;
  max-width: 70%;
}

.body-exam-content.body-exam-content-doctor {
  align-items: flex-end;
}

.body-exam-content.body-exam-content-supervisor {
  align-items: flex-start;
}

.body-exam-bubble-supervisor {
  background: #f1f3f4;
  color: #202124;
  border: 1px solid #e0e0e0;
  border-bottom-left-radius: 4px;
}

.body-exam-bubble-doctor {
  background: #2563eb;
  color: #ffffff;
  border-bottom-right-radius: 4px;
  margin-left: auto;
}

.body-exam-system-bubble {
  background: #e5e7eb;
  color: #374151;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 999px;
  text-align: center;
}

.body-exam-input {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid #eef0f2;
  background: #ffffff;
}

.body-exam-input textarea {
  flex: 1;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.8125rem;
  resize: vertical;
  font-family: inherit;
}
.body-exam-input .voice-input-status {
  flex: 0 0 100%;
  margin-top: -4px;
}

/* ==== 電子カルテ風ノート ==== */
.emr-note {
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background-color: #eff6ff;
  margin-top: 6px;
  overflow: hidden;
}
.emr-header {
  background-color: #93c5fd;
  color: #111827;
  padding: 4px 8px;
  font-size: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.soap-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 12px;
  align-items: flex-start;
  padding: 8px 10px;
}
.soap-layout-single {
  grid-template-columns: minmax(0, 1fr);
}
.soap-layout-single > div {
  width: 100%;
}
.soap-column-title {
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.soap-sample-box {
  background-color: #f9fafb;
  border-radius: 8px;
  border: 1px dashed #d1d5db;
  padding: 8px 10px;
  font-size: 0.75rem;
  white-space: pre-wrap;
}
.soap-user-display-box {
  min-height: 0;
  overflow: visible;
}
.soap-section { margin-bottom: 10px; }
.soap-label-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.soap-label-line-auto-fill {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.soap-auto-fill-controls {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.soap-note-once {
  font-size: 0.6875rem;
  color: #6b7280;
  margin: -2px 0 6px;
}
.soap-auto-fill-controls .soap-note-once {
  margin: 0;
  text-align: right;
}
.soap-sample-toggle-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 8px;
}
.soap-sample-panel {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  background-color: #f8fafc;
}
.soap-sample-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.soap-label { font-size: 0.8125rem; font-weight: 700; }
.soap-input {
  width: 100%;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  padding: 8px 10px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: inherit;
  color: #000;
}
#presentationInput {
  min-height: 150px;
}

.layout-mode-postcc-presentation #presentationInput {
  min-height: 360px;
}

.soap-textarea {
  width: 100%;
  resize: vertical;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 0.8125rem;
  font-family: inherit;
  min-height: 380px;
}

.assessment-group {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 8px;
  align-items: center;
}
.assessment-main-label {
  margin-bottom: 0 !important;
  line-height: 1.2;
}
.assessment-subfield {
  grid-column: 2;
  margin-left: 18px;
  padding-left: 12px;
  border-left: 2px solid #e2e8f0;
}
@media (max-width: 640px) {
  .assessment-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .assessment-subfield {
    margin-left: 18px;
  }
}
/* モード別: S欄の高さ調整 */
#soapS { min-height: 480px; }
#soapSTraining { min-height: 180px; }

/* 標準・フルコース時は左右カラムの高さバランスを優先 */
#trainingLayout.layout-mode-standard #soapS {
  min-height: 200px;
}
#trainingLayout.layout-mode-standard #soapAP {
  min-height: 240px;
}
#trainingLayout.layout-mode-standard .chat-log {
  height: 460px;
}
#trainingLayout.layout-mode-presentation #presentationInput {
  min-height: 420px !important;
}
#trainingLayout.layout-mode-presentation .chat-log {
  height: 420px;
}
#trainingLayout.layout-mode-training_short #soapSTraining {
  height: 160px;
  min-height: 140px;
}
#trainingLayout.layout-mode-training_short #soapOTraining {
  min-height: 110px !important;
}
#trainingLayout.layout-mode-training_short .memo-section {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
}
#trainingLayout.layout-mode-training_short .memo-section textarea {
  min-height: 160px;
}
#trainingLayout.layout-mode-full .chat-log {
  height: 500px;
}
#trainingLayout.layout-mode-full #soapS {
  min-height: 150px;
}
#trainingLayout.layout-mode-full #soapAP {
  min-height: 150px;
}
#trainingLayout.layout-mode-full #presentationInput {
  min-height: 170px !important;
}
.memo-section {
  margin-top: 14px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background-color: #f9fafb;
  padding: 8px 10px;
  font-size: 0.75rem;
}
.memo-section textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  padding: 6px 8px;
  font-size: 0.8125rem;
}

.memo-label {
  display: block;
  margin-bottom: 4px;
}
.presentation-memo-area {
  margin-top: 12px;
}
.presentation-memo-area .btn-row {
  margin-top: 40px;
  justify-content: flex-end;
}

.presentation-followup-area {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.presentation-followup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.presentation-followup-eyebrow {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
}
.presentation-followup-header h2 {
  margin: 2px 0 0;
  color: #0f172a;
  font-size: 1.125rem;
  letter-spacing: 0;
}
.presentation-followup-status {
  min-width: 92px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}
.presentation-followup-note {
  margin-bottom: 12px;
  color: #475569;
  font-size: 0.8125rem;
  line-height: 1.7;
}
.presentation-followup-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.presentation-followup-row {
  display: flex;
}
.presentation-followup-row--student {
  justify-content: flex-end;
}
.presentation-followup-bubble {
  max-width: min(760px, 92%);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #dbe3ec;
  background: #f8fafc;
  color: #1f2937;
  font-size: 0.8125rem;
  line-height: 1.7;
  white-space: pre-wrap;
}
.presentation-followup-row--student .presentation-followup-bubble {
  background: #ecfeff;
  border-color: #bae6fd;
}
.presentation-followup-row--system .presentation-followup-bubble {
  background: #fefce8;
  border-color: #fde68a;
  color: #854d0e;
}
.presentation-followup-label {
  margin-bottom: 4px;
  color: #64748b;
  font-size: 0.6875rem;
  font-weight: 700;
}
.presentation-followup-controls textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #0f172a;
  font: inherit;
  font-size: 0.8125rem;
}
.presentation-followup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.presentation-followup-finish {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  text-align: right;
}
.presentation-followup-finish .btn {
  max-width: 100%;
  white-space: normal;
  line-height: 1.6;
}
.presentation-followup-finish .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.presentation-followup-finish p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.6;
}
@media (max-width: 720px) {
  .presentation-followup-header {
    display: block;
  }
  .presentation-followup-status {
    display: inline-block;
    margin-top: 8px;
  }
}

/* ==== 評価エリア ==== */
.evaluation-area { margin-top: 20px; }
.evaluation-intro {
  padding: 10px 12px;
  margin-bottom: 12px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #334155;
}
.evaluation-intro-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}
.evaluation-intro-heading h3 {
  margin: 0;
  color: #475569;
  font-size: 1.2rem;
}
.evaluation-intro-case {
  min-width: 0;
  color: #64748b;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
.soap-comparison { margin-bottom: 14px; }
.reference-links-box {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 12px 10px;
  margin-bottom: 14px;
  box-shadow: 0 3px 10px rgba(148, 163, 184, 0.2);
}
.reference-links-title {
  font-size: 1.125rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 10px;
}
.evaluation-logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.evaluation-logs-toggle-btn {
  flex-shrink: 0;
  font-weight: 700;
}
.evaluation-logs-panel {
  margin-top: 8px;
}
.evaluation-log-text {
  padding: 14px 16px;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  font-size: 0.6875rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.evaluation-log-empty {
  color: #64748b;
  font-size: 0.8125rem;
}
.evaluation-supervisor-note {
  margin-top: 12px;
  text-align: right;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.reference-pinned-links {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.reference-pinned-links-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.reference-pinned-link-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.reference-pinned-link-label {
  font-size: 0.875rem;
  font-weight: 800;
  color: #0f172a;
  padding-top: 4px;
}
.reference-pinned-link-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}
.reference-links-table-wrap {
  overflow-x: auto;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #f3f4f6;
}
.reference-links-table {
  width: 100%;
  min-width: 560px;
  table-layout: fixed;
  border-collapse: collapse;
  color: #111827;
  font-size: 0.8125rem;
  background: #f3f4f6;
}
.reference-links-table thead th {
  background: #e5e7eb;
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 1px solid #cbd5e1;
  border-right: 1px solid #d1d5db;
  text-align: center;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
.reference-links-table thead th:first-child {
  text-align: left;
  width: 180px;
  min-width: 180px;
  position: sticky;
  left: 0;
  z-index: 3;
}
.reference-links-table tbody th,
.reference-links-table tbody td {
  padding: 8px 10px;
  border-top: 1px solid #d1d5db;
  border-right: 1px solid #d1d5db;
  background: #f3f4f6;
}
.reference-links-table tbody th {
  font-weight: 700;
  text-align: left;
  white-space: normal;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #eef0f3;
}
.reference-links-table tr > *:last-child { border-right: none; }
.reference-links-table tbody td { text-align: left; white-space: normal; vertical-align: top; }
.reference-disease-name {
  font-weight: 800;
  color: #0f172a;
}
.reference-disease-code {
  margin-top: 4px;
  font-size: 0.6875rem;
  color: #64748b;
  word-break: break-all;
}
.reference-link-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.reference-link-token {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 18px;
}
.reference-link-code {
  font-weight: 800;
  font-size: 0.75rem;
  color: #111827;
  letter-spacing: 0.01em;
}
.reference-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.625rem;
  line-height: 1;
  color: #fff;
  box-sizing: border-box;
  user-select: none;
}
.reference-icon-mieru,
.reference-icon-shinsatsu {
  min-width: 28px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}
.reference-icon-mieru { background: #69c3ab; }
.reference-icon-shinsatsu { background: #6f86cf; }
.reference-icon-yearnote {
  width: 22px;
  height: 16px;
  border-radius: 3px;
  background: #59b4e6;
  font-size: 0.5rem;
  letter-spacing: 0.03em;
}
.reference-icon-rb,
.reference-icon-other {
  min-width: 24px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.5rem;
  letter-spacing: 0.03em;
}
.reference-icon-rb {
  background: #8b5cf6;
}
.reference-icon-at {
  min-width: 28px;
  height: 16px;
  padding: 0 7px 0 5px;
  background: #ef6e48;
  font-size: 0.625rem;
  letter-spacing: -0.02em;
  clip-path: polygon(0 0, 78% 0, 100% 50%, 78% 100%, 0 100%, 10% 50%);
}
.reference-icon-other {
  background: #64748b;
}
.reference-link-button {
  display: inline-flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.reference-link-button:hover {
  transform: translateY(-1px);
  border-color: #94a3b8;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}
.reference-link-button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.reference-link-button-main {
  min-width: 0;
  font-size: 0.6875rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  word-break: break-word;
}
.reference-links-table .reference-link-list {
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 4px;
  width: 100%;
  align-items: center;
}
.reference-links-table .reference-link-button {
  flex: 0 1 auto;
  width: fit-content;
  max-width: calc(50% - 2px);
  padding: 3px 6px;
  border-radius: 6px;
  align-items: center;
}
.reference-links-table .reference-link-button:only-child {
  max-width: 100%;
}
.reference-links-table .reference-link-button-main {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}
.reference-link-button-sub {
  font-size: 0.6875rem;
  color: #64748b;
  line-height: 1.2;
  word-break: break-all;
}
.reference-link-empty {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: #94a3b8;
  font-weight: 700;
}
.reference-links-empty-row td {
  padding: 18px;
  text-align: center;
  color: #64748b;
}
.reference-links-empty-message {
  font-size: 0.8125rem;
  color: #64748b;
}
.reference-icon-rb,
.reference-icon-other {
  color: #ffffff;
}

.explanation-blue {
  color: #2563eb;
  font-weight: 700;
}

.explanation-figure {
  margin: 14px 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.explanation-image,
.explanation-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.explanation-image {
  margin: 14px auto;
}

.explanation-figure figcaption {
  display: none;
}

.explanation-ref-link {
  margin: 2px 4px 2px 0;
}

.explanation-ref-missing {
  display: inline-flex;
  margin: 2px 4px 2px 0;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid #fbbf24;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 700;
}

.reference-videos-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #334155;
  line-height: 1.7;
}

.reference-videos-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reference-video-card {
  display: block;
  width: min(760px, 100%);
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  color: #0f172a;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.reference-video-card:hover {
  transform: translateY(-1px);
  border-color: #94a3b8;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.13);
}

.reference-video-card:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

.reference-video-thumbnail {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e5e7eb;
}

.reference-video-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.reference-video-card:hover .reference-video-thumbnail img,
.reference-video-card:focus-visible .reference-video-thumbnail img {
  transform: scale(1.015);
  filter: brightness(0.84);
}

.reference-video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.16);
  transition: background 0.2s ease;
}

.reference-video-card:hover .reference-video-overlay,
.reference-video-card:focus-visible .reference-video-overlay {
  background: rgba(15, 23, 42, 0.36);
}

.reference-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 66px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.64);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.26);
  transform: translate(-50%, -50%);
  transition: background 0.2s ease, transform 0.2s ease;
}

.reference-video-card:hover .reference-video-play,
.reference-video-card:focus-visible .reference-video-play {
  background: rgba(37, 99, 235, 0.88);
  transform: translate(-50%, -50%) scale(1.05);
}

.reference-video-play-icon {
  display: block;
  width: 0;
  height: 0;
  margin-left: 5px;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 18px solid #ffffff;
}

.reference-video-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

.reference-video-body {
  display: block;
  padding: 10px 12px 12px;
}

.reference-video-title {
  display: block;
  color: #0f172a;
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.45;
}

.reference-video-description {
  margin-top: 3px;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5;
}

.reference-video-thumbnail-placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  color: #475569;
  font-size: 1.125rem;
  font-weight: 800;
}

.reference-video-missing {
  display: inline-flex;
  margin: 2px 4px 2px 0;
  padding: 4px 8px;
  border: 1px solid #fbbf24;
  border-radius: 6px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 700;
}

.evaluation-summary-layout {
  display: grid;
  grid-template-columns: minmax(340px, 1.08fr) minmax(300px, 0.92fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 14px;
}
.scoreboard {
  align-self: start;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dbe4ee;
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.22);
  color: #111827;
}
.scoreboard-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.self-assessment {
  width: 100%;
  border-top: 1px dashed #cbd5e1;
  padding-top: 18px;
  text-align: left;
}
.self-assessment-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.self-assessment-label {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-right: 4px;
  color: #475569;
}
.self-assessment-choices {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  flex: 0 1 264px;
  width: 100%;
}
.self-assessment-button {
  --self-assessment-color: #9da2ae;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #d1d5dc;
  font: inherit;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
:is(.self-assessment-button, .history-assessment-mark)[data-self-assessment="◎"] { --self-assessment-color: #0d47a2; }
:is(.self-assessment-button, .history-assessment-mark)[data-self-assessment="○"] { --self-assessment-color: #43a4f4; }
:is(.self-assessment-button, .history-assessment-mark)[data-self-assessment="△"] { --self-assessment-color: #ffa627; }
:is(.self-assessment-button, .history-assessment-mark)[data-self-assessment="×"] { --self-assessment-color: #fb547d; }
.self-assessment-button:hover { background: #f8fafc; }
.self-assessment-button[aria-pressed="true"] {
  color: var(--self-assessment-color);
}
.self-assessment-button:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}
.scoreboard-text-main {
  font-size: 1.125rem;
  font-weight: 800;
  color: #0f172a;
}
.scoreboard-text-sub {
  font-size: 0.8125rem;
  line-height: 1.7;
  color: #475569;
}
.scoreboard-text-meta {
  min-height: 18px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #2563eb;
}
.score-circle {
  --score-progress: 0;
  --score-color: #3b82f6;
  position: relative;
  container-type: inline-size;
  width: min(100%, 340px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.score-circle-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke-width: 16;
}
.score-circle-track {
  stroke: #e7edf6;
}
.score-circle-progress {
  stroke: var(--score-color);
  stroke-dasharray: var(--score-progress) 100;
}
.score-circle-value {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}
.score-circle-main {
  font-size: clamp(2.5rem, 26cqi, 5.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.score-circle-sub {
  margin-top: 2px;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}

.evaluation-bars {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 18px;
  padding: 18px;
  color: #111827;
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.22);
  font-size: 0.75rem;
  border: 1px solid #dbe4ee;
}
.evaluation-bars-title {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 14px;
}
.evaluation-bars-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.evaluation-bars-hint {
  margin: -6px 0 14px;
  color: #64748b;
  font-size: 0.75rem;
}
.evaluation-category {
  min-width: 0;
}
.evaluation-category > summary {
  position: relative;
  padding-right: 32px;
  cursor: pointer;
  list-style: none;
}
.evaluation-category > summary::-webkit-details-marker {
  display: none;
}
.evaluation-category > summary::after {
  content: "";
  position: absolute;
  right: 13px;
  top: calc(50% - 5px);
  width: 7px;
  height: 7px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
}
.evaluation-category[open] > summary::after {
  top: calc(50% - 1px);
  transform: rotate(225deg);
}
.evaluation-category > summary:hover,
.evaluation-category[open] > summary {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.evaluation-category > summary:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}
.evaluation-category > .evaluation-section {
  margin-top: 8px;
  padding: 12px;
  box-shadow: none;
  overflow-wrap: anywhere;
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.bar-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.45;
}
.bar-track {
  height: 12px;
  border-radius: 999px;
  background-color: #dbe4ee;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.28);
}
.bar-score {
  min-width: 78px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.9375rem;
  font-weight: 800;
  color: #2563eb;
}
.bar-score-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #64748b;
}
.bar-row.is-empty .bar-label,
.bar-row.is-empty .bar-score,
.bar-row.is-empty .bar-score-sub {
  color: #94a3b8;
}
.bar-row.is-bonus .bar-score {
  color: #059669;
}
.bar-row.is-bonus .bar-fill {
  background: #10b981;
}
.evaluation-empty-note {
  padding: 12px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: #64748b;
  background: #f8fafc;
}

.evaluation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 12px;
}
.evaluation-details-heading {
  margin: 4px 0 0;
  font-size: 1.125rem;
  font-weight: 800;
  color: #0f172a;
}
.evaluation-section {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.14);
  border: 1px solid #e5e7eb;
  font-size: 0.75rem;
}
.evaluation-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
}
.evaluation-section h3 {
  margin: 0;
  font-size: 0.9375rem;
  color: #0f172a;
}
.evaluation-section-caption {
  margin-top: 4px;
  font-size: 0.75rem;
  color: #64748b;
}
.tag-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background-color: #eff6ff;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}
.tag-score--pending {
  background-color: #f1f5f9;
  color: #64748b;
}
.evaluation-detail-list {
  display: flex;
  flex-direction: column;
}
.evaluation-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid #edf2f7;
}
.evaluation-detail-row:first-child {
  border-top: none;
  padding-top: 0;
}
.evaluation-detail-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.5;
}
.evaluation-detail-id {
  margin-left: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}
.evaluation-detail-rationale {
  margin-top: 5px;
  font-size: 0.75rem;
  line-height: 1.75;
  color: #475569;
  white-space: pre-wrap;
}
.evaluation-detail-mark {
  min-width: 36px;
  text-align: right;
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
}
.evaluation-detail-row--pending .evaluation-detail-title,
.evaluation-detail-row--pending .evaluation-detail-rationale {
  color: #64748b;
}
.evaluation-detail-pending-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}
.evaluation-feedback-box {
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
  border: 1px solid #bae6fd;
  border-left: 6px solid #0ea5e9;
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.12);
}
.evaluation-feedback-title {
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: 800;
  color: #0369a1;
}
.evaluation-feedback-body {
  font-size: 1rem;
  line-height: 1.8;
  color: #334155;
}
.evaluation-inline-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #0369a1;
}
.evaluation-loading-spinner {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 2px solid #0ea5e9;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.header-rank-btn {
  background: linear-gradient(180deg, #fff7d6, #fde68a);
  color: #a16207;
  border: 1px solid #fcd34d;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.18);
}
.header-rank-btn:hover {
  background: linear-gradient(180deg, #fffbeb, #fcd34d);
  color: #92400e;
}

.ranking-modal-content {
  width: min(1380px, 98vw);
  height: auto;
  max-height: 92vh;
  border-radius: 18px;
  border: 1px solid #f6c6cf;
  box-shadow: 0 24px 60px rgba(190, 24, 93, 0.15);
}
.ranking-modal-header {
  background:
    radial-gradient(circle at 10% 10%, rgba(255,255,255,0.7), transparent 45%),
    linear-gradient(135deg, #ffe8ec, #fdf2f8);
  border-bottom-color: #f8d7df;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.ranking-modal-subtitle {
  margin-top: 4px;
  font-size: 0.75rem;
  color: #9f1239;
}
.ranking-filter-btn {
  margin-left: auto;
  white-space: nowrap;
}
.ranking-modal-body {
  background:
    linear-gradient(180deg, rgba(255,248,220,0.55), rgba(255,255,255,0)),
    linear-gradient(135deg, #fffaf2 0%, #fff7fb 45%, #f9fbff 100%);
}
.ranking-v2-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.ranking-v2-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ranking-tab-btn {
  border: 1px solid #d4dcf0;
  background: #edf2ff;
  color: #334155;
  border-radius: 10px;
  padding: 6px 14px;
  font-weight: 700;
  cursor: pointer;
}
.ranking-tab-btn.active {
  background: #1f6feb;
  color: #ffffff;
  border-color: #1f6feb;
}
.ranking-v2-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
}
.ranking-v2-grid.table-only {
  grid-template-columns: minmax(0, 1fr);
}
.ranking-v2-grid.table-only .ranking-v2-self {
  display: none;
}
.ranking-v2-grid.self-only {
  grid-template-columns: minmax(0, 1fr);
}
.ranking-v2-grid.self-only .ranking-v2-board {
  display: none;
}
.ranking-v2-grid.self-only .ranking-v2-self {
  display: block;
  width: min(520px, 100%);
  justify-self: center;
}
.ranking-v2-board {
  border: 1px solid #dbe6f6;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
}
.ranking-v2-header-row {
  display: grid;
  grid-template-columns: minmax(34px, 0.5fr) minmax(0, 2.2fr) minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 6px;
  padding: 11px 10px;
  background: #f2f6ff;
  border-bottom: 1px solid #e2e8f4;
  color: #32415f;
  font-size: 0.75rem;
  font-weight: 700;
}
.ranking-v2-header-row > div,
.ranking-v2-row > div {
  min-width: 0;
}
.ranking-v2-body {
  max-height: 480px;
  overflow-y: auto;
  padding: 6px;
}
.ranking-v2-row {
  display: grid;
  grid-template-columns: minmax(34px, 0.5fr) minmax(0, 2.2fr) minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 6px;
  padding: 9px 6px;
  border-radius: 10px;
  margin: 2px 0;
  align-items: center;
  color: #24324f;
}
.ranking-v2-row:nth-child(odd) {
  background: #f9fbff;
}
.ranking-v2-row.is-self {
  background: #fff8e6;
  border: 1px solid #f1c24a;
}
.ranking-v2-cell-main {
  min-width: 0;
}
.ranking-v2-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranking-v2-meta {
  font-size: 0.6875rem;
  color: #64748b;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranking-tier-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 3px 7px;
  background: #e2e8f0;
  color: #0f172a;
}
.ranking-tier-chip.bronze { background: #b87333; color: #fff; }
.ranking-tier-chip.silver { background: #94a3b8; color: #fff; }
.ranking-tier-chip.gold { background: #e0a91b; color: #fff; }
.ranking-tier-chip.platinum { background: #17a673; color: #fff; }
.ranking-tier-chip.diamond { background: #2d7df6; color: #fff; }
.ranking-tier-chip.master { background: #d94841; color: #fff; }
.ranking-v2-number {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.75rem;
  white-space: nowrap;
}
.ranking-coverage-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.ranking-coverage-bar {
  width: 62px;
  height: 10px;
  border-radius: 999px;
  background: #d6deec;
  overflow: hidden;
  flex: 0 0 auto;
}
.ranking-coverage-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #3cb371;
}
.ranking-coverage-text {
  min-width: 34px;
}
.ranking-v2-change-up { color: #179c52; }
.ranking-v2-change-down { color: #c62828; }
.ranking-v2-footer {
  border-top: 1px solid #e5e7eb;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  padding: 9px 12px;
  font-size: 0.6875rem;
  color: #475569;
}
.ranking-v2-footer strong {
  color: #0f172a;
}
.ranking-v2-empty {
  margin: 10px;
  padding: 14px;
  border-radius: 12px;
  text-align: center;
  font-size: 0.75rem;
  color: #64748b;
  background: #f8fafc;
  border: 1px dashed #d1d5db;
}
.ranking-v2-self {
  border: 1px solid #dbe6f6;
  border-radius: 16px;
  background: #fbfdff;
  padding: 14px;
}
.ranking-v2-self h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #1d2a44;
}
.ranking-self-tier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffffff;
  background: #1f6feb;
}
.ranking-self-tier.bronze { background: #b87333; }
.ranking-self-tier.silver { background: #94a3b8; }
.ranking-self-tier.gold { background: #e0a91b; }
.ranking-self-tier.platinum { background: #17a673; }
.ranking-self-tier.diamond { background: #2d7df6; }
.ranking-self-tier.master { background: #d94841; }
.ranking-self-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 0.8125rem;
  color: #334155;
}
.ranking-progress {
  margin-top: 6px;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e5ebf6;
  overflow: hidden;
}
.ranking-progress-fill {
  height: 100%;
  width: 0;
  background: #3cb371;
  border-radius: 999px;
}
.ranking-progress-fill-blue {
  background: #2d7df6;
}
.ranking-self-trend-title {
  margin-top: 14px;
  font-size: 0.75rem;
  color: #475569;
  font-weight: 700;
}
.ranking-trend-bars {
  margin-top: 8px;
  height: 70px;
  border: 1px solid #e2e8f4;
  border-radius: 10px;
  background: #ffffff;
  padding: 8px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.ranking-trend-bar {
  flex: 1;
  min-width: 0;
  border-radius: 4px 4px 0 0;
  background: #1f6feb;
  opacity: 0.92;
}
.ranking-self-note {
  margin-top: 10px;
  font-size: 0.6875rem;
  color: #64748b;
}

@media (max-width: 768px) {
  .ranking-modal-content {
    width: 96vw;
    max-height: 94vh;
    border-radius: 14px;
  }
  .ranking-modal-body {
    padding: 12px;
  }
  .ranking-v2-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .ranking-filter-btn {
    margin-left: 0;
  }
  .ranking-v2-grid {
    grid-template-columns: 1fr;
  }
  .ranking-v2-header-row {
    display: none;
  }
  .ranking-v2-row {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
    border: 1px solid #e3eaf8;
  }
  .ranking-v2-row > :nth-child(n+3) {
    display: none;
  }
  .ranking-v2-body {
    max-height: 380px;
  }
  .reference-links-title { font-size: 1rem; }
  .reference-pinned-link-row {
    grid-template-columns: minmax(96px, 120px) minmax(0, 1fr);
    gap: 10px;
  }
  .reference-pinned-link-label {
    font-size: 0.8125rem;
  }
  .reference-video-card {
    width: 100%;
  }
  .reference-video-play {
    width: 56px;
    height: 44px;
    border-radius: 12px;
  }
  .reference-video-play-icon {
    border-top-width: 9px;
    border-bottom-width: 9px;
    border-left-width: 15px;
  }
  .reference-video-title {
    font-size: 0.875rem;
  }
  .evaluation-logs-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .evaluation-logs-toggle-btn {
    width: 100%;
  }
  .reference-links-table { min-width: 520px; font-size: 0.75rem; }
  .reference-links-table thead th,
  .reference-links-table tbody th,
  .reference-links-table tbody td {
    padding: 7px 8px;
  }
  .reference-links-table thead th:first-child {
    min-width: 140px;
  }
  .reference-link-code { font-size: 0.6875rem; }
}

@media (max-width: 960px) {
  .evaluation-summary-layout {
    grid-template-columns: 1fr;
  }
  .scoreboard {
    align-items: center;
    text-align: center;
  }
  .scoreboard-copy {
    align-items: center;
  }
  .bar-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .bar-score {
    text-align: left;
  }
  .evaluation-section-header {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .scoreboard {
    padding: 18px 16px;
  }
  .score-circle {
    width: min(100%, 280px);
  }
  .score-circle-sub {
    font-size: 1.375rem;
  }
  .evaluation-bars,
  .evaluation-section,
  .evaluation-feedback-box {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (max-width: 1080px) and (min-width: 769px) {
  .ranking-v2-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

.evaluation-data-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* 学習記録はホームのタブから独立したページとして表示する。 */
.home-record-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; max-width: 100%; gap: 8px; }
.home-record-actions .home-header-action:hover { background: #f3f4f6; }
html:is(.history-page-open, .specialty-page-open) body { background: #fff; }
html:is(.history-page-open, .specialty-page-open) #screen1 { display: none !important; }
html.history-page-open #historyScreen.hidden { display: block !important; }
html.specialty-page-open #specialtyProgressScreen.hidden { display: block !important; }
html:is(.history-page-open, .specialty-page-open) .page { max-width: 1320px; padding-top: 26px; padding-bottom: 80px; }
.history-page-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-bottom: 28px; }
.history-page-heading h2 { margin: 0; color: #111827; font-size: 1.75rem; font-weight: 800; }
.history-back-link { color: #374151; font-size: 1.125rem; font-weight: 700; text-decoration: none; padding: 8px 0; flex-shrink: 0; }
.history-back-link:focus-visible { outline: 3px solid #a75066; outline-offset: 4px; }
.history-page #historyListContainer { overflow-x: auto; }
.history-page .history-table { min-width: 1174px; }
@media (max-width: 640px) {
  .home-record-actions .home-header-action { min-width: 44px; padding-inline: 4px; }
  .history-page-heading { gap: 14px; }
  .history-page-heading h2 { font-size: 1.5rem; }
}

/* Keep the production layout while removing actions that start or change an exercise. */
.admin-log-view .home-header-actions,
.admin-log-view #headerBackHomeBtn,
.admin-log-view .header-right > button,
.admin-log-view #homeSettingsPopover,
.admin-log-view #screen1,
.admin-log-view #screen2,
.admin-log-view #finishBtn,
.admin-log-view #showEvalBtn,
.admin-log-view #startOralReportBtn,
.admin-log-view #presentationFollowupControls,
.admin-log-view #presentationFollowupRetryBtn,
.admin-log-view #presentationReviewRetryBtn { display: none !important; }
.admin-log-banner { margin: 18px auto; padding: 16px 20px; max-width: 1400px; background: #fff; border: 1px solid #dbe4ee; border-radius: 12px; color: #334155; }
.admin-log-banner a { color: #244bb0; font-weight: 700; }
.admin-log-banner p { margin: 8px 0 0; overflow-wrap: anywhere; }
.admin-log-view textarea:disabled,
.admin-log-view input:disabled { opacity: 1; color: #334155; -webkit-text-fill-color: #334155; }
@media (max-width: 700px) { .admin-log-banner { margin: 12px; padding: 12px 16px; } }

/* Face-to-face exercise is available only for a prepared custom session. */
.exercise-mode-notice { margin: 16px 0; line-height: 1.8; }
.face-to-face-notice { padding: 16px 20px; border: 1px solid #93c5fd; border-radius: 12px; background: #eff6ff; color: #1e3a8a; }
.face-to-face-notice p { margin: 8px 0 0; }
.practice-save-mode-options { flex-wrap: wrap; }

/* Shared exercise memo: a full sheet above the chart or presentation. */
.precc-memo-toolbar[hidden], .precc-memo-paper[hidden],
.precc-drawing-tools[hidden] { display: none; }
.precc-memo-toolbar button {
  padding: 9px 12px; min-height: 42px; border: 1px solid #cbd5e1;
  border-radius: 7px; background: white; color: #334155; cursor: pointer;
}
.precc-memo-toolbar [aria-pressed="true"] {
  background: #e0ecff; color: #1e40af; border-color: #93b4ed;
}
.precc-memo-toolbar button:disabled { opacity: .45; cursor: default; }
.precc-memo-toolbar button:focus-visible {
  outline: 3px solid #2563eb; outline-offset: 2px;
}
.precc-memo-toolbar { margin: 8px 0; }
.precc-memo-switch, .precc-drawing-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }
.precc-drawing-tools label { padding: 8px 4px; }
.precc-memo-toolbar p { margin: 6px 0; color: #64748b; line-height: 1.6; }
.precc-memo-surface {
  flex: none; resize: vertical; overflow: hidden;
  width: 100%; max-width: 100%; height: 560px; min-height: 180px;
  border: 1px solid #cbd5e1; border-radius: 6px; background: white;
}
.precc-memo-viewport { width: 100%; height: 100%; overflow: hidden; }
.precc-memo-paper { display: block; width: 100%; height: 100%; background: white; touch-action: none; cursor: crosshair; }
/* A resting finger may land on the adjacent transcript, not just the paper. */
.precc-handwriting, .precc-handwriting * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.precc-handwriting textarea, .precc-handwriting input,
.precc-handwriting [contenteditable="true"], .precc-handwriting [contenteditable="true"] * {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
#trainingLayout .precc-memo #freeMemo,
#trainingLayout .precc-memo #apTraining_presentation {
  display: block; width: 100%; height: 100%; min-height: 0;
  resize: none; border: 0; border-radius: 0; background: white;
}
#trainingLayout .precc-memo #freeMemo[hidden],
#trainingLayout .precc-memo #apTraining_presentation[hidden] { display: none; }
.precc-memo-review { margin: 20px 0; padding: 16px; border: 1px solid #cbd5e1; border-radius: 8px; }
.precc-memo-review img { display: block; width: 100%; max-width: 640px; height: auto; background: white; border: 1px solid #e2e8f0; }
.precc-memo-review p { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (min-width: 768px) {
  #trainingLayout.layout-mode-presentation { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (min-width: 768px) {
  #trainingLayout:has(.precc-memo) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* Keep the shared microphone within the presentation field's lower right corner. */
.presentation-voice-field { position: relative; }
.presentation-voice-field #presentationInput { display: block; padding-bottom: 62px; }
.presentation-voice-field .voice-input-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 44px;
  height: 44px;
}

.training-chart-header { background-color: #fde68a; }
.exercise-panel-heading,
.layout-mode-training_short .body-exam-header,
.layout-mode-training_short .training-chart-header { font-weight: 700; margin: 0; padding: 7px 12px; background: #dcd6fa; color: #292542; font-size: 1rem; border-radius: 8px 8px 0 0; }
.patient-speech-status { flex: 1 1 12em; }
.patient-speech-toggle, .patient-speech-toggle[aria-checked="true"] {
  display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0; color: inherit; padding: 4px;
}
.patient-speech-toggle::before {
  content: ""; width: 36px; height: 22px; border-radius: 20px;
  background: radial-gradient(circle at 11px center, white 8px, transparent 9px), #64748b;
}
.patient-speech-toggle[aria-checked="true"]::before {
  background: radial-gradient(circle at 25px center, white 8px, transparent 9px), #2563eb;
}
.memo-actions { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 3px; white-space: nowrap; }
.memo-actions > div { flex: none; flex-wrap: nowrap; margin: 0; gap: 4px; }
.memo-actions button { padding: 5px 8px; }
.memo-actions svg { width: 20px; height: 20px; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.result-overview { display: grid; gap: 14px; margin-bottom: 14px; }
.result-overview .evaluation-summary-layout:not(.hidden) { display: contents; }
.result-overview .scoreboard { align-self: stretch; }
.result-overview .case-overview { display: grid; }
.result-overview .evaluation-intro { margin: 0; }
@media (min-width: 761px) {
  .result-overview:has(.evaluation-summary-layout:not(.hidden)) { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); }
  .result-overview .evaluation-bars { grid-column: 1 / -1; }
}

/* Align the interview and memo above the exam and active chart/report. */
@media (min-width: 768px) {
  #trainingLayout.layout-mode-training_short {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .layout-mode-training_short > .training-layout-left,
  .layout-mode-training_short > .training-layout-right {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 2;
    height: auto;
  }
  .layout-mode-training_short .chat-log { flex: 1 1 auto; }
  .layout-mode-training_short #generalMemoSection .precc-memo-surface { flex: 1 0 auto; }
}

.layout-mode-training_short .body-exam-title {
  font: inherit;
  color: inherit;
}
.emr-header.exercise-panel-heading .emr-header-meta,
.training-chart-header .emr-header-meta { font-size: .75rem; font-weight: 400; }
@media (min-width: 768px) {
  .layout-mode-training_short:not(.layout-mode-postcc-presentation) .body-exam-panel,
  .layout-mode-training_short #soapAreaDifferentialDiagnosisTraining {
    align-self: stretch;
    margin: 0;
  }
  .layout-mode-training_short:not(.layout-mode-postcc-presentation) .body-exam-panel {
    display: flex;
    flex-direction: column;
  }
  .layout-mode-training_short:not(.layout-mode-postcc-presentation) .body-exam-log {
    flex: 1 1 280px;
    min-height: 0;
  }
}

.review-nav, .review-jump, [data-review-panel="case"], .basic-empty { display: none; }
.tabbed-review .review-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid #dddce6; border-radius: 10px; background: white; }
.review-nav button { flex: 1 1 auto; background: transparent; border: 0; border-radius: 6px; padding: 12px 8px; color: #334155; font: inherit; font-weight: bold; cursor: pointer; scroll-margin-top: 5rem; }
.review-nav button[aria-pressed="true"] { background: #ece7fa; color: #362b54; }
.tabbed-review [data-review-panel] { display: none; }
.tabbed-review [data-review-panel].current-panel { display: block; background: white; padding: 16px; border-radius: 8px; }
.tabbed-review .review-jump { display: inline-block; border: 0; background: transparent; color: #314d86; padding: 6px 0; font: inherit; cursor: pointer; justify-self: start; }
.tabbed-review .scoreboard .review-jump { grid-column: 1 / -1; }
.case-facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; }
.case-facts dt { font-weight: bold; }
.case-facts dd { margin: 0; }
.tabbed-review .hidden + .basic-empty { display: block; }
.review-score-title { display: none; }
.tabbed-review .evaluation-intro, .tabbed-review .scoreboard { background: white; border: 1px solid #dddce6; border-radius: 10px; box-shadow: none; padding: 0; overflow: hidden; }
.tabbed-review .evaluation-intro > div { height: 100%; display: flex; flex-direction: column; }
.tabbed-review .evaluation-intro-heading, .tabbed-review .review-score-title { margin: 0; padding: 12px 16px; background: #e9e2f7; color: #382f49; font-size: 1.2rem; }
.tabbed-review .review-score-title { display: block; }
.tabbed-review .scoreboard { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-content: start; }
.tabbed-review .scoreboard-copy { padding-left: 16px; align-self: center; }
.tabbed-review .scoreboard-copy > .scoreboard-text-main { display: none; }
.tabbed-review .review-score-title, .tabbed-review .self-assessment { grid-column: 1 / -1; }
.tabbed-review .self-assessment, .tabbed-review .case-facts { padding-inline: 16px; }
.tabbed-review .score-circle { margin-right: 16px; width: clamp(76px, 12vw, 124px); height: auto; aspect-ratio: 1; }
.tabbed-review .review-jump { margin: auto 16px 8px; align-self: start; }
