/* mediLinkの白・青・ゴシック体を基調に、既存の学習画面を統一する。 */
:root {
  --ink: #333333;
  --muted: #666666;
  --paper: #ffffff;
  --line: #e5e7ed;
  --brand: #1f44b1;
  --brand-light: #637dd0;
  --red: #c83f59;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: #fff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif; line-height: 1.7; -webkit-font-smoothing: antialiased; }
button, textarea, input { font: inherit; }
button { cursor: pointer; transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease; }
button:disabled { cursor: not-allowed; opacity: .5; box-shadow: none; }
button:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--brand-light); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.app { width: min(880px, calc(100% - 40px)); margin: 0 auto; padding: 20px 0 40px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding-bottom: 18px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.login-screen { display: grid; place-items: center; min-height: min(65svh, 600px); padding: 24px 0; }
.login-card { display: grid; gap: 18px; width: min(100%, 400px); padding: 32px; background: #fafbfe; border-radius: 12px; }
.login-card label { font-size: .9rem; font-weight: 600; }
.login-card .primary { margin-top: 6px; border-radius: 28px; }
.login-card h2 { margin: 0 0 8px; color: var(--brand); font-size: 1.4rem; text-align: center; }
.login-card input { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; }
.login-card input:focus-visible { outline: 3px solid var(--brand-light); outline-offset: 2px; }
.login-error { margin: 0; color: var(--red); font-size: .85rem; line-height: 1.6; }
h1 { margin: 0; font-size: clamp(.95rem, 2.4vw, 1.15rem); letter-spacing: .025em; font-weight: 700; color: var(--brand); }
.eyebrow { margin: 0; color: var(--muted); font-size: .8rem; font-weight: 700; }
.product-screen { min-height: min(64svh, 520px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 28px; }
.product-screen h2 { margin: 0; font-size: 1.15rem; font-weight: 600; letter-spacing: .04em; }
.product-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; width: 100%; }
.product-button { width: min(400px, 100%); min-height: 68px; padding: 16px 28px; border: 2px solid #2946b7; border-radius: 40px; background: var(--paper); color: #2946b7; font-size: 1.4rem; font-weight: 700; letter-spacing: .03em; box-shadow: 0 6px 10px #18234b26; }
.product-button:hover { background: #f0f4ff; box-shadow: 0 8px 16px #18234b30; }
.product-button-nursing { color: #c53d5a; border-color: #ff6e82; }
.product-button-nursing:hover { background: #fff3f6; }
#productStatus { margin: 0; }
.question-list-heading { margin: 24px 0; color: var(--ink); font-size: 1.4rem; }
.question-groups { display: grid; gap: 28px; }
.question-group { display: grid; gap: 10px; }
.question-group h3 { margin: 0 0 4px; padding: 0 0 10px; border-bottom: 2px solid #ff6e82; font-size: 1rem; color: #c53d5a; }
.question-choice { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); text-align: left; font-weight: 600; line-height: 1.7; }
.question-choice:hover { border-color: #ff6e82; background: #fff7f9; }
.question-choice-status { flex-shrink: 0; padding: 3px 8px; border-radius: 4px; background: #f3f4f7; color: var(--muted); font-size: .75rem; font-weight: 400; }
@media (max-width: 480px) { .question-choice { flex-wrap: wrap; gap: 8px; padding: 14px; } }
.exam-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.back-button { min-height: 38px; padding: 7px 14px; border: 1px solid #d2dbf0; border-radius: 4px; background: var(--paper); color: var(--brand); font-size: .8rem; }
.back-button:hover { background: #eef3ff; }
.conversation-layout { display: grid; gap: 16px; margin-top: 14px; }
.question-heading { padding: 22px 24px; border: 1px solid var(--line); border-top: 3px solid var(--brand); border-radius: 6px; background: #fafbfe; }
#questionProgress { display: inline-block; padding: 3px 12px; color: var(--brand); background: #edf2ff; border-radius: 20px; font-size: .8rem; }
.question-heading h2 { margin: 14px 0 0; font-size: clamp(1.1rem, 2.8vw, 1.35rem); font-weight: 600; line-height: 1.85; overflow-wrap: anywhere; }
.card { padding: 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.card.login-card { padding: 32px; border-radius: 12px; background: #fafbfe; }
.chat-composer { display: grid; gap: 12px; }
.answer-mode-switch { display: inline-grid; justify-self: start; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: 7px; background: #f0f2f7; }
.mode-button { min-height: 40px; padding: 7px 22px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: .85rem; font-weight: 700; }
.mode-button.active { color: #fff; background: var(--brand); }
textarea { display: block; width: 100%; padding: 12px 14px; resize: vertical; min-height: 112px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); line-height: 1.7; }
textarea::placeholder { color: var(--muted); }
.record-block { text-align: center; }
.record-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; width: min(100%, 300px); padding: 12px 24px; border: 0; border-radius: 28px; background: var(--brand); color: #fff; font-weight: 700; }
.record-button.recording { background: var(--red); }
.record-orb { width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.record-button.recording .record-orb { animation: pulse 1s infinite; }
.hint, .saving-line { color: var(--muted); font-size: .8rem; line-height: 1.7; }
.hint:empty, .saving-line:empty { display: none; }
.composer-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px; }
.saving-line { flex: 1 1 180px; margin: 0; }
.primary { min-height: 44px; padding: 10px 28px; border: 1px solid transparent; border-radius: 4px; background: var(--brand); color: #fff; font-weight: 700; font-size: .9rem; }
.primary:hover:not(:disabled) { background: #17358e; }
.oral-chat { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; max-height: 44vh; overflow: auto; margin-bottom: 16px; }
.oral-chat:empty { display: none; }
.chat-message { display: grid; gap: 4px; max-width: 95%; }
.chat-message.student { align-self: flex-end; }
.chat-role { color: var(--muted); font-size: .75rem; }
.chat-message.student .chat-role { justify-self: end; }
.chat-bubble { margin: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: #f7f8fb; font-size: .95rem; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message.student .chat-bubble { background: #eef3ff; }
.score-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.score-heading h3 { margin: 0; font-size: 1.1rem; }
.score { margin: 0; color: var(--brand); white-space: nowrap; }
.score strong { font-size: 2.8rem; font-variant-numeric: tabular-nums; }
.score span { font-size: .9rem; }
.result-card { background: #fff; border-top: 3px solid var(--brand); }
.result-card p, .result-card li { line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.result-card .hint { margin: 0 0 12px; }
.result-card h4 { margin: 18px 0 6px; color: var(--brand); }
.result-card h4 + p { margin-top: 0; }
.result-card ul { margin: 0; padding-left: 1.4em; }
.result-card li + li { margin-top: 6px; }
.result-card details { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.result-card summary { cursor: pointer; color: var(--brand); font-weight: 700; }
.example-question { font-weight: 700; }
.result-card a { color: var(--brand); text-underline-offset: 3px; }
.next-question { justify-self: end; }
.completion-message { margin: 8px 0; text-align: center; color: var(--brand); font-weight: 700; }
.speech-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.speech-controls label { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.speech-controls input { accent-color: var(--brand); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { button { transition: none; } .record-button.recording .record-orb { animation: none; } }
@media (max-width: 480px) {
  .app { width: calc(100% - 24px); padding-top: 14px; }
  .question-heading { padding: 16px; }
  .card { padding: 16px; }
  .card.login-card { padding: 24px; }
  .page-header { gap: 8px; margin-bottom: 20px; }
  .page-header .back-button { padding: 7px 10px; white-space: nowrap; }
  .product-button { font-size: 1.25rem; min-height: 64px; }
  .question-heading h2 { line-height: 1.8; }
  .composer-actions .primary { min-width: 120px; }
  .chat-bubble { padding: 10px 12px; }
  .next-question { width: 100%; }
}

.exercise-choice { padding: 22px; }
.exercise-content { display: grid; gap: 8px; }
.exercise-content strong { color: #c53d5a; font-size: 1rem; }
.exercise-topics { color: var(--muted); font-size: .85rem; font-weight: 400; }
