html[data-text-size="standard"] { font-size: 100%; }
html[data-text-size="large"] { font-size: 125%; }
html[data-text-size="extra-large"] { font-size: 150%; }

.home-preferences-group {
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
}
.home-preferences-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.875rem;
}
.home-preferences-field > span { font-weight: 700; }
.home-preferences-field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  font: inherit;
}
.home-preferences-field select:focus-visible {
  outline: 3px solid #a75066;
  outline-offset: 2px;
}
.send-key-hint,
.user-preferences-status {
  margin: 0;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.5;
}
.body-exam-input .send-key-hint { flex: 0 0 100%; }

/* Keep larger text within flexible rows and allow long reading content to wrap. */
html:not([data-text-size="standard"]) .header-main-row { flex-wrap: wrap; }
html:not([data-text-size="standard"]) .header-left { flex-shrink: 1; }
html:not([data-text-size="standard"]) .header-right { flex-wrap: wrap; justify-content: flex-end; }
html:not([data-text-size="standard"]) .home-main-tabs { grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr)); }
html:not([data-text-size="standard"]) :is(.chat-input-row, .body-exam-input) { flex-wrap: wrap; }
html:not([data-text-size="standard"]) :is(.chat-input-row, .body-exam-input) textarea { flex-basis: 100%; }
html:not([data-text-size="standard"]) .home-settings-popover { width: min(24rem, calc(100vw - 32px)); }
html:not([data-text-size="standard"]) .patient-type-slider-label { min-height: 2rem; height: auto; }
html:not([data-text-size="standard"]) .home-main-tab { overflow-wrap: anywhere; }

html[data-line-spacing="wide"] :is(.page, .home-settings-popover, #authGate) { line-height: 1.9; }
html[data-line-spacing="wide"] :is(
  p, li, td, th, textarea, .helper-text,
  .chat-message, .body-exam-bubble, .body-exam-system-bubble,
  .presentation-followup-bubble, .presentation-followup-note,
  .soap-sample-box, .soap-user-display-box, .evaluation-log-text,
  .evaluation-feedback-box, .evaluation-supervisor-note,
  .postcc-task-sheet, .presentation-intake-intro,
  .yoshinhyo-box, .send-key-hint
) { line-height: 1.9; }

/* The case list uses fixed columns; let the table scroll instead of squeezing enlarged text. */
.case-list-table-scroll { overflow-x: auto; }
.case-list-table-scroll table { min-width: 62rem; }
.case-list-table-scroll .col-order { width: 5rem; }
.case-list-table-scroll .col-name { width: 11.25rem; }
.case-list-table-scroll .col-date { width: 10.625rem; }
.case-list-table-scroll .col-result { width: 8.75rem; }
html:not([data-text-size="standard"]) .case-list-table-scroll .question-text,
html[data-line-spacing="wide"] .case-list-table-scroll .question-text { white-space: normal; overflow-wrap: anywhere; }
body.case-list-page :is(.topbar, .toolbar, .result-summary) { flex-wrap: wrap; }
body.case-list-page .title { min-width: min(14rem, 100%); }
