.study-mode-toggle { border: 0; padding: 0; margin: 20px 0; min-width: 0; }
.study-mode-toggle legend { font-weight: 700; margin-bottom: 10px; }
.study-mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 5px; }
.study-mode-options label { position: relative; cursor: pointer; }
.study-mode-options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.study-mode-options span { display: flex; min-height: 50px; align-items: center; justify-content: center; text-align: center; padding: 10px; border-radius: 11px; font-weight: 700; font-size: 14px; }
.study-mode-options input:checked + span { background: var(--accent); color: white; }
.study-mode-options input:focus-visible + span { outline: 3px solid var(--accent-strong); outline-offset: 3px; }
.study-mode-help { color: var(--muted); font-size: 13px; line-height: 1.7; }
.study-mode-actions { grid-template-columns: 1fr; }
.draft-notice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 14px; margin: 14px 0; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.draft-notice > span { font-size: 13px; font-weight: 700; }
.draft-notice small { flex-basis: 100%; font-size: 12px; line-height: 1.7; margin: 0; }
.draft-notice button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; padding: 8px 0; cursor: pointer; text-decoration: underline; min-height: 44px; }
.consultation-details > summary { cursor: pointer; margin-bottom: 14px; font-weight: 700; }
.math-preview { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); margin: 6px 0 10px; min-width: 0; overflow-wrap: anywhere; }
.math-preview[hidden] { display: none; }
.math-preview > small { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.math-preview-body { white-space: pre-wrap; line-height: 2; }
.math-expression { display: inline-block; vertical-align: middle; max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: .12em .15em; scrollbar-width: thin; }
.math-expression math { font-family: 'STIX Two Math', 'Cambria Math', 'Latin Modern Math', math, serif; font-size: 1.15em; line-height: normal; white-space: nowrap; }
.math-expression mi { text-transform: none; font-style: italic; }
@media (max-width: 450px) { .study-mode-options span { padding: 10px 6px; font-size: 13px; } }
.mode-draft-status { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 16px; font-size: 12px; color: var(--muted); }
.mode-draft-status span { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }
.mode-draft-status .is-current { color: var(--ink); background: var(--bg); }
.input-photo-note { flex-basis: 100%; margin: 8px 0 0; font-size: 12px; line-height: 1.7; color: var(--muted); }
.input-photo-note[hidden], .selected-photo[hidden] { display: none; }
.selected-photo { margin: 10px 0; min-width: 0; }
.selected-photo-image { display: block; max-width: 100%; width: 100%; max-height: 240px; object-fit: contain; border-radius: 10px; background: var(--bg); }
.selected-photo-image[hidden] { display: none; }
.selected-photo p { overflow-wrap: anywhere; font-size: 12px; color: var(--muted); line-height: 1.7; }
.selected-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.selected-photo-actions button, .selected-photo-dialog button { min-height: 44px; padding: 10px 14px; font: inherit; font-size: 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
.selected-photo-actions button:disabled { opacity: .5; cursor: default; }
.selected-photo-dialog { width: min(1000px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-sizing: border-box; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.selected-photo-dialog::backdrop { background: #0009; }
.selected-photo-dialog img { display: block; max-width: 100%; height: auto; margin-top: 12px; }
