/* Mobile layer: the desktop workspace stays intact above 760px. */
.mobile-navigation { display: none; }
.mobile-menu:not([open]) { display: none; }
body.session-open, body.mobile-menu-open { overflow: hidden; }
.mobile-menu { color: #234b36; border: 0; padding: 24px; border-radius: 22px; width: min(480px, 100%); background: #fff; }
.mobile-menu::backdrop { background: #102d236b; backdrop-filter: blur(4px); }
.mobile-menu-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.mobile-menu-head small { color: #008346; font-weight: 600; }
.mobile-menu-head h2 { margin: 4px 0 20px; font-size: 24px; }
.mobile-menu .icon-button { width: 44px; height: 44px; border: 1px solid #dbe7df; border-radius: 50%; color: #35604b; }
.mobile-menu-links { display: grid; gap: 8px; }
.mobile-menu-links button { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 14px 16px; background: #f5f9f6; border: 1px solid #e3ece6; border-radius: 12px; text-align: left; color: #315b43; font-size: 16px; }
.mobile-menu-links button.is-current { background: #e8f6ed; border-color: #92cbaa; color: #00763d; font-weight: 600; }
.mobile-menu > p { font-size: 13px; color: #657c6e; margin: 22px 0 0; }
@media (max-width: 760px) {
  :root { --mobile-nav-height: 72px; font-size: 16px; }
  html { scroll-padding-top: 78px; }
  body { background: #f4f8f5; }
  #app > aside { display: none; }
  .main { margin: 0; min-width: 0; padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom)); }
  .main > header { position: sticky; top: 0; z-index: 4; height: auto; min-height: 64px; padding: calc(8px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid #dfe9e2; background: #fffffff2; backdrop-filter: blur(14px); gap: 8px; font-size: 12px; }
  header > div { min-width: 0; display: flex; align-items: center; gap: 8px; }
  header .mobile-brand-logo { display: block; width: 36px; height: 38px; flex-shrink: 0; object-fit: contain; margin: 0; }
  header .slash, header .header-status { display: none; }
  header .breadcrumb { white-space: nowrap; font-size: 13px; }
  header b { font-size: 12px; font-weight: 500; color: #617568; line-height: 1.5; border-left: 1px solid #d7e3da; padding-left: 8px; }
  header .header-settings { flex-shrink: 0; margin-left: auto; width: 44px; height: 44px; padding: 10px; border-radius: 12px; }
  main { width: 100%; padding: 22px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
  main:focus { outline: none; }
  main > *, .panel, .heading > div, .settings-form, .settings-pair > *, .personal-link-form > *, .manager-toolbar > *, .context-grid > * { min-width: 0; }
  h1, .heading h1, .welcome h1 { font-size: 26px; line-height: 1.5; letter-spacing: -.3px; overflow-wrap: anywhere; }
  .heading { flex-wrap: wrap; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
  .heading > div { flex: 1 1 100%; }
  .heading .eyebrow, .eyebrow { font-size: 12px; margin-bottom: 6px; }
  .heading p, .welcome p { font-size: 14px; line-height: 1.8; color: #5d7365; overflow-wrap: anywhere; }
  .heading .button.secondary { font-size: 14px; min-height: 44px; padding: 10px 16px; }
  button, a, input, select, textarea { touch-action: manipulation; }
  input:not([type="checkbox"]), select, textarea,
  .manager-toolbar input, .manager-toolbar select, .manager-login input,
  .personal-admin input, .personal-admin select, .team-link input,
  #manager-roster select, #manager-roster textarea, .context-grid select,
  .chat-form input, .manual-search input { font-size: 16px; min-height: 48px; min-width: 0; max-width: 100%; border-radius: 12px; }
  input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #008b46; outline-offset: 2px; }
  .button, .text-link, .icon-button, summary { min-height: 44px; }
  .button { font-size: 15px; padding: 12px 16px; border-radius: 12px; line-height: 1.5; justify-content: center; white-space: normal; }
  .text-link { font-size: 14px; line-height: 1.6; }
  .panel { padding: 20px 18px; border-radius: 16px; }
  .panel h2 { font-size: 21px; line-height: 1.6; }
  .panel p { font-size: 14px; line-height: 1.8; }
  .panel small, .panel > small { font-size: 12px; line-height: 1.7; }
  .mobile-navigation { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; inset: auto 0 0; height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom)); padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); z-index: 8; background: #fffffff5; backdrop-filter: blur(16px); border-top: 1px solid #dce7df; box-shadow: 0 -4px 24px #1c483008; margin: 0; gap: 4px; }
  .mobile-navigation button { border: 0; border-radius: 12px; background: transparent; color: #61786b; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 5px 2px; font-size: 12px; font-weight: 500; line-height: 1.4; }
  .mobile-navigation .icon { width: 22px; height: 22px; }
  .mobile-navigation .is-current { color: #007c40; background: #e8f6ed; font-weight: 700; }
  .mobile-menu { position: fixed; inset: auto 0 0; margin: 0 auto; width: 100%; max-width: 560px; max-height: 85dvh; border-radius: 24px 24px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 80px #193d3420; overflow-y: auto; overscroll-behavior: contain; }
  .mobile-menu::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 4px; background: #d6e3da; margin: -10px auto 20px; }
  #toast { bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 12px); max-width: calc(100% - 32px); width: max-content; text-align: center; padding: 12px 18px; font-size: 14px; }
  footer { padding: 0 16px 18px; font-size: 11px; color: #657b6d; }
  footer span:last-child { display: none; }
  /* Practice: one clear action, readable choices and a compact summary. */
  .welcome { gap: 16px; }
  .welcome-actions { display: grid; grid-template-columns: 1fr; width: 100%; gap: 8px; }
  .welcome-actions .primary { min-height: 52px; font-size: 16px; }
  .welcome-actions .secondary { font-size: 14px; min-height: 44px; }
  .overview-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 16px; gap: 14px 8px; border-radius: 16px; }
  .overview-title { grid-column: 1/-1; padding: 0 0 12px; font-size: 14px; }
  .overview-title small { display: block; margin: 3px 0 0; font-size: 11px; }
  .overview-strip > div > b { font-size: 24px; }
  .overview-strip > div > span { font-size: 12px; }
  .overview-strip > div > b > small { font-size: 11px; }
  .context-grid { grid-template-columns: minmax(0,1fr); border-radius: 16px; padding: 18px; }
  .context-grid label { font-size: 15px; }
  .context-grid small, .business-context > span { font-size: 13px; color: #63786b; }
  .business-context { flex-wrap: wrap; gap: 4px 12px; }
  .business-context > .text-link { margin: 0; width: 100%; }
  .step-heading { align-items: flex-start; }
  .step-heading h2 { font-size: 21px; }
  .step-heading p { font-size: 13px; color: #62796b; }
  .scenario-total { white-space: nowrap; font-size: 11px; }
  .training-layout { display: flex; flex-direction: column; gap: 18px; }
  .scenario-picker, .training-detail { width: 100%; }
  .scenario-picker { border-radius: 16px; padding: 12px; }
  .scenario-picker .filter { min-height: 44px; font-size: 12px; }
  .scenario-list { grid-template-columns: 1fr; gap: 6px; }
  .scenario-choice { min-height: 100px; padding: 14px 10px; gap: 10px; }
  .scenario-info > b { font-size: 16px; }
  .scenario-info > span { font-size: 13px; color: #5f7668; }
  .scenario-info > small { font-size: 12px; color: #687e70; }
  .training-detail { position: static; padding: 24px 18px; border-radius: 16px; scroll-margin-top: 82px; }
  .training-detail > h3 { font-size: 24px; }
  .detail-description, .learning-goal > p { font-size: 15px; color: #5f7667; }
  .mode-option { min-height: 88px; padding: 12px 4px; }
  .mode-option > span { font-size: 13px; flex-direction: column; white-space: normal; }
  .mode-option .icon { height: 20px; width: 20px; }
  .mode-option > small { font-size: 11px; color: #617b6a; }
  .mode-explainer { font-size: 13px; color: #607767; }
  .begin-training { min-height: 54px; font-size: 16px; }
  .begin-training > span { font-size: 12px; }
  .detail-footnote { font-size: 12px; color: #677d6d; }
  .responsible-note { padding: 16px; }
  .responsible-note b { font-size: 14px; }
  .responsible-note p { font-size: 13px; color: #5f7767; }
  /* Manager: readable actions, two-column metrics and self-contained record cards. */
  .personal-admin-heading h2 { font-size: 23px; margin: 6px 0 10px; }
  .personal-admin-heading .level { font-size: 12px; border-radius: 8px; background: #eaf6ee; color: #286644; padding: 5px 10px; }
  .personal-link-form { gap: 16px; margin-top: 20px; }
  .personal-link-form label, .manager-toolbar label, #manager-roster label { font-size: 14px; }
  .personal-link-form > button { min-height: 52px; }
  .personal-admin > small, .manager-note { font-size: 13px; color: #596f60; }
  .manager-toolbar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 10px; }
  .manager-toolbar label { min-width: 0; }
  .manager-toolbar label:nth-child(2) { grid-column: 1/-1; grid-row: 1; }
  .manager-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .manager-metrics .panel { margin: 0; padding: 16px; gap: 5px; }
  .manager-metrics .panel:last-child { grid-column: 1/-1; flex-direction: row; align-items: center; gap: 16px; }
  .manager-metrics strong { font-size: 28px; font-variant-numeric: tabular-nums; }
  .manager-metrics span { font-size: 12px; }
  .manager-table-wrap { overflow: visible; }
  .manager-table { display: block; width: 100%; }
  .manager-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .manager-table tbody { display: grid; gap: 12px; }
  .manager-table tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 16px; border: 1px solid #dce8df; border-radius: 14px; background: #fcfefc; }
  .manager-table tbody td { display: block; min-width: 0; padding: 0; border: 0; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
  .manager-table tbody td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 500; color: #667e6e; margin-bottom: 4px; }
  .manager-table tbody td:first-child { grid-column: 1/-1; border-bottom: 1px solid #e4ece6; padding-bottom: 10px; }
  .manager-table tbody td:has(button), .manager-table tbody td:last-child:nth-child(5) { grid-column: 1/-1; }
  .manager-table tbody td:has(button) { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid #e5eee8; padding-top: 10px; }
  .manager-table tbody td:has(button)::before { display: none; }
  .manager-table td button { min-height: 44px; padding: 10px 14px; border: 1px solid #cee2d5; border-radius: 10px; color: #007d42; background: #edf8f1; font-size: 14px; }
  .manager-table td .danger-link { margin: 0; color: #a83939; background: #fff5f3; border-color: #efd8d2; }
  .manager-table small { font-size: 12px; color: #62796a; }
  .manager-login { margin: 0 auto; }
  .manager-login .primary { width: 100%; min-height: 52px; }
  .manager-login label { font-size: 15px; }
  .issued-link > div { display: grid; grid-template-columns: 1fr; }
  .issued-link .button { width: 100%; }
  .personal-roster summary { font-size: 14px; line-height: 1.7; }
  #manager-detail { scroll-margin-top: 82px; }
  #manager-detail p { overflow-wrap: anywhere; }
  #manager-load-more { width: 100%; margin-top: 16px; }
  .team-link { grid-template-columns: minmax(0,1fr); }
  .settings-pair { grid-template-columns: minmax(0,1fr); }
  .personal-welcome { padding: 16px; }
  .personal-welcome b { font-size: 18px; }
  .personal-welcome small { font-size: 13px; overflow-wrap: anywhere; }
  /* Conversation: a full-height workspace with a visible composer and close control. */
  .modal-backdrop { padding: 0; top: var(--session-top,0px); bottom: auto; height: var(--session-height,100dvh); align-items: stretch; backdrop-filter: none; background: #f8fcf9; }
  .modal-backdrop .session { width: 100%; max-width: none; height: 100%; max-height: 100%!important; padding: 0 16px max(16px,env(safe-area-inset-bottom)); border-radius: 0; box-shadow: none; overflow-y: auto!important; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 0; }
  .session > * { flex-shrink: 0; }
  .session .session-head { position: sticky; top: 0; z-index: 2; padding: calc(14px + env(safe-area-inset-top)) 0 12px!important; background: #fbfdfb; border-bottom: 1px solid #dfe9e2; align-items: center; }
  .session-head h2 { font-size: 21px; margin: 4px 0!important; line-height: 1.5; }
  .session-head .icon-button { width: 44px; height: 44px; flex-shrink: 0; border: 1px solid #d5e3d9; border-radius: 50%; color: #315e43; }
  .session .sync-status { padding: 10px 0; font-size: 12px; }
  .session .session-meta { padding: 0 0 12px!important; gap: 8px; font-size: 12px; }
  .session-meta b { margin-left: auto; font-size: 15px; font-variant-numeric: tabular-nums; }
  .session .goal { margin: 8px 0; padding: 12px; font-size: 13px; }
  .session .conversation { flex: 1 1 auto; min-height: 110px; height: auto; overflow-y: auto; overscroll-behavior: contain; padding: 12px 0; margin: 0 0 12px; }
  .session:has(.conversation) { overflow: hidden!important; }
  .session .message { max-width: 94%; }
  .session .message p { font-size: 16px; line-height: 1.8; padding: 12px 14px; overflow-wrap: anywhere; }
  .session .message small { font-size: 12px; }
  .session .chat-form { min-width: 0; background: #fbfdfb; gap: 8px; }
  .chat-form .button { width: 48px; min-height: 48px; padding: 12px; }
  .session .session-actions { margin-top: 10px; padding-top: 10px; }
  .session-actions .end { min-height: 44px; width: 100%; font-size: 14px; }
  .session .voice-controls { padding: 10px 0; color: #426d51; font-size: 14px; gap: 8px; }
  .voice-controls .button { min-height: 48px; }
  .session .preflight { padding: 20px 0!important; }
  .preflight h3 { font-size: 21px; line-height: 1.6; }
  .preflight > p { font-size: 14px; color: #5d7767; }
  .tester-form { max-width: none; }
  .tester-form > small, .tester-form .training-consent { font-size: 13px; color: #536c5d; }
  .training-consent { min-height: 48px; padding: 8px 0; }
  .tester-form .text-link { padding: 8px 0; }
  .session .error { padding: 10px; font-size: 13px; max-height: 100px; overflow-y: auto; }
  .result-score { gap: 16px; padding: 24px 0; }
  .result-score h3 { font-size: 20px; }
  .result-score p, .feedback-box p, .rubric-results p, .transcript-line { font-size: 14px; color: #516e5b; }
  .rubric-results > div { font-size: 14px; line-height: 1.8; }
  .session:has(#chat-form) .goal { display: none; }
  .session-open #toast { bottom: 16px; }
  /* History, guides and settings use the same readable mobile scale. */
  .history-row { display: grid; grid-template-columns: minmax(0,1fr) auto; padding: 18px; gap: 10px; border-radius: 14px; }
  .history-row > div { min-width: 0; }
  .history-row b { font-size: 15px; line-height: 1.7; }
  .history-row small { font-size: 12px; line-height: 1.8; }
  .history-row > strong { grid-column: 2; grid-row: 1; font-size: 24px; }
  .history-row > .icon { display: none; }
  .history-row > span:not(.avatar) { display: block; font-size: 13px; }
  .history-row > .avatar { display: none; }
  .bars { gap: 6px; padding: 12px 0; }
  .coverage { gap: 10px; font-size: 14px; line-height: 1.7; }
  .coverage b { white-space: nowrap; }
  .knowledge-grid { grid-template-columns: minmax(0,1fr); }
  .knowledge-grid ul { padding-left: 20px; }
  .knowledge-grid a { overflow-wrap: anywhere; }
  .manual-section.panel { scroll-margin-top: 82px; }
  .manual-search input { font-size: 16px; }
  .manual-utility button { font-size: 13px; }
  .manual-audiences button { min-height: 44px; }
  .manual-table-wrap { border: 1px solid #dde8e0; border-radius: 10px; }
  .settings-form label { font-size: 15px; }
  .settings-form .primary { width: 100%; }
  .empty { padding: 40px 16px; }
  .empty h2 { font-size: 22px; }
  .empty p { font-size: 14px; }
}
@media (max-width: 360px) {
  header b { font-size: 11px; }
  header .breadcrumb { font-size: 12px; }
  header > div { gap: 5px; }
  .heading h1, .welcome h1 { font-size: 24px; }
  .manager-table tbody tr { padding: 12px; gap: 10px; }
  .begin-training { flex-wrap: wrap; }
  .begin-training > span { margin-left: 0; }
}
@media (max-height: 550px) and (max-width: 760px) {
  .session:has(.conversation) .session-meta, .session:has(.conversation) .sync-status, .session:has(.conversation) .goal { display: none; }
  .session .session-head { padding-top: 8px!important; padding-bottom: 8px!important; }
  .session-head .eyebrow { display: none; }
  .session .session-actions { margin-top: 6px; padding-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto!important; animation-duration: .01ms!important; transition-duration: .01ms!important; }
}
@media print {
  .mobile-navigation, .mobile-menu { display: none!important; }
  .main { padding-bottom: 0; }
}
@media (max-width: 760px) {
  .manager-heading { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
  .manager-heading > div { grid-column: 1/-1; }
  .manager-heading h1 { font-size: 25px; }
  .manager-heading .button { justify-self: start; }
  .personal-admin-heading h2 { font-size: 22px; }
}
/* Grid children must be allowed to shrink around scrollable reference tables. */
.manual-content > *, .manual-layout > * { min-width: 0; }
