:root {
  --sync-ink: #142b4c;
  --sync-muted: #64788e;
  --sync-line: #dce8f3;
  --sync-blue: #168ee2;
  --sync-canvas: #f2f7fc;
  --sync-panel: #fff;
}

#app-screen {
  min-height: 100vh;
  padding: 0;
  color: var(--sync-ink);
  background:
    radial-gradient(ellipse at 82% 2%, rgba(113, 190, 245, .16), transparent 30%),
    linear-gradient(135deg, #eaf3fb 0%, #f6f9fc 47%, #e9f3fb 100%);
  font-family: "Manrope", "Segoe UI", sans-serif;
}

#app-screen > .container {
  width: auto;
  max-width: none;
  min-height: 100vh;
  margin: 0 0 0 232px;
  padding: 14px 22px 38px;
}

#app-screen > .container > header { display: none; }

#app-screen .tab-container {
  position: fixed;
  z-index: 40;
  inset: 14px auto 14px 14px;
  display: flex;
  width: 204px;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 17px 10px 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 17px;
  background: linear-gradient(155deg, #173a5d 0%, #102b48 62%, #10263f 100%);
  box-shadow: 0 16px 40px rgba(15, 42, 71, .22);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.22) transparent;
}

#app-screen .app-sidebar-brand {
  display: flex;
  min-height: 45px;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 13px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .045em;
}

#app-screen .app-brand-mark {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  color: #27a9fa;
}

#app-screen .app-brand-mark svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
#app-screen .app-sidebar-caption { padding: 8px 11px 7px; color: #8ea8c2; font-size: 9px; font-weight: 800; letter-spacing: .15em; }

#app-screen .tab-container > .tab {
  display: flex;
  min-height: 39px;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  margin: 0;
  padding: 8px 11px;
  border: 0;
  border-radius: 9px;
  color: #e4edf7;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
#app-screen .tab-container > .tab[hidden] { display: none !important; }

#app-screen .tab-container > .tab:hover { transform: translateX(2px); color: #fff; background: rgba(126, 190, 242, .13); }
#app-screen .tab-container > .tab.active { color: #fff; background: linear-gradient(110deg, rgba(34, 151, 228, .44), rgba(57, 144, 205, .22)); box-shadow: inset 2px 0 #39b5ff; }
#app-screen .tab-container > .tab.restricted-tab { display: none !important; }
#app-screen .app-nav-icon { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

#app-screen .user-header {
  position: sticky;
  z-index: 25;
  top: 0;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin: -14px -22px 21px;
  padding: 10px 24px;
  border-bottom: 1px solid rgba(215, 229, 241, .85);
  background: rgba(248, 251, 254, .92);
  box-shadow: 0 5px 20px rgba(36, 69, 102, .035);
  backdrop-filter: blur(15px);
}

#app-screen .app-global-search {
  display: flex;
  width: min(270px, 28vw);
  height: 38px;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  padding: 0 11px;
  border: 1px solid var(--sync-line);
  border-radius: 9px;
  background: #f3f8fd;
}

#app-screen .app-global-search[hidden], #app-screen .app-new-patient-btn[hidden] { display: none !important; }
#app-screen .app-global-search svg { width: 16px; flex: 0 0 16px; fill: none; stroke: #607c97; stroke-width: 1.8; stroke-linecap: round; }
#app-screen .app-global-search input { width: 100%; min-width: 0; padding: 6px 0; border: 0; outline: 0; background: transparent; color: var(--sync-ink); box-shadow: none; font: inherit; font-size: 11px; }
#app-screen .app-global-search input:focus { border: 0; box-shadow: none; }
#app-screen .user-info { gap: 9px; }
#app-screen .user-avatar { width: 34px; height: 34px; border: 2px solid #fff; box-shadow: 0 2px 9px rgba(17, 50, 82, .16); }
#app-screen #user-name { color: var(--sync-ink); font-size: 11px; font-weight: 800; }
#app-screen .user-role-label { color: var(--sync-muted); font-size: 10px; }
#app-screen .user-email-legacy { display: none; }
#app-screen .user-actions { gap: 7px; }
#app-screen .app-new-patient-btn { display: inline-flex; min-height: 37px; align-items: center; gap: 7px; padding: 0 14px; border: 0; border-radius: 8px; color: #fff; background: linear-gradient(120deg, #1598ed, #0876cf); box-shadow: 0 5px 13px rgba(18, 132, 211, .19); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
#app-screen .app-new-patient-btn span { font-size: 18px; font-weight: 500; }
#app-screen .profile-btn, #app-screen .logout-btn { padding: 8px 10px; border: 1px solid var(--sync-line); border-radius: 8px; color: #34516c; background: #fff; box-shadow: none; font-size: 10px; }

#app-screen .tab-content { width: 100%; }
#app-screen .tab-content > .card { padding: 22px; border: 1px solid #e1eaf3; border-radius: 15px; background: rgba(255,255,255,.91); box-shadow: 0 8px 26px rgba(32, 66, 99, .055); }
#app-screen .tab-content > .card > h2 { margin-top: 0; color: var(--sync-ink); }
#app-screen .app-eyebrow { display: block; color: #7b8fa4; font-size: 9px; font-weight: 800; letter-spacing: .13em; }

/* Dashboard */
#app-screen .sync-dashboard { display: grid; gap: 14px; }
#app-screen .dashboard-welcome { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 1px 1px 2px; }
#app-screen .dashboard-welcome h2 { margin: 4px 0 2px; color: var(--sync-ink); font-size: clamp(23px, 2.5vw, 30px); letter-spacing: -.045em; }
#app-screen .dashboard-welcome p { margin: 0; color: #647b92; font-size: 13px; }
#app-screen .dashboard-date-label { padding: 8px 11px; border: 1px solid #dce9f5; border-radius: 8px; color: #56718d; background: rgba(255,255,255,.68); font-size: 10px; font-weight: 700; text-transform: capitalize; }
#app-screen .dashboard-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
#app-screen .dashboard-stat-card { display: flex; min-height: 73px; align-items: center; gap: 12px; padding: 13px; border: 1px solid #e0eaf3; border-radius: 12px; background: linear-gradient(140deg, #fff, #fafdff); box-shadow: 0 4px 12px rgba(31, 67, 102, .045); }
#app-screen .dashboard-stat-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 10px; background: #edf6ff; color: #178be0; }
#app-screen .dashboard-stat-icon svg, #app-screen .quick-card-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#app-screen .dashboard-stat-card > div { display: grid; gap: 1px; }
#app-screen .dashboard-stat-card strong { color: #142d52; font-size: 21px; line-height: 1.15; }
#app-screen .dashboard-stat-card > div span { color: #5f7690; font-size: 10px; }
#app-screen .stat-green .dashboard-stat-icon { color: #16a56a; background: #eaf9f1; }
#app-screen .stat-red .dashboard-stat-icon { color: #ef525c; background: #fff0f0; }
#app-screen .stat-violet .dashboard-stat-icon { color: #6654ff; background: #f1efff; }
#app-screen .dashboard-panel { min-width: 0; padding: 15px; border: 1px solid #e0eaf3; border-radius: 12px; background: rgba(255,255,255,.83); box-shadow: 0 4px 15px rgba(31, 67, 102, .035); }
#app-screen .dashboard-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
#app-screen .dashboard-section-heading h3 { margin: 3px 0 0; color: var(--sync-ink); font-size: 14px; }
#app-screen .dashboard-section-heading h3 small { color: #73859a; font-size: 10px; font-weight: 500; }
#app-screen .dashboard-quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
#app-screen .dashboard-quick-card { position: relative; display: flex; min-height: 123px; flex-direction: column; align-items: flex-start; gap: 5px; padding: 12px; border: 1px solid #dfebf5; border-radius: 10px; color: var(--sync-ink); background: linear-gradient(145deg, #f5faff, #edf6fc); box-shadow: 0 3px 8px rgba(35, 73, 108, .045); text-align: left; cursor: pointer; }
#app-screen .dashboard-quick-card:hover { transform: translateY(-2px); border-color: #abd5f4; box-shadow: 0 8px 16px rgba(32, 90, 137, .10); }
#app-screen .quick-card-icon { display: grid; width: 27px; height: 27px; place-items: center; color: #1769ff; }
#app-screen .quick-card-icon svg { width: 24px; height: 24px; }
#app-screen .quick-card-icon.quick-violet { color: #6754f5; }
#app-screen .quick-card-icon.quick-green { color: #14a56d; }
#app-screen .quick-card-icon.quick-cyan { color: #1898ed; }
#app-screen .dashboard-quick-card strong { font-size: 11px; }
#app-screen .dashboard-quick-card > span:not(.quick-card-icon) { max-width: 95%; color: #627991; font-size: 9px; line-height: 1.45; }
#app-screen .dashboard-quick-card i { position: absolute; right: 11px; bottom: 8px; color: #0788dc; font-size: 17px; font-style: normal; }
#app-screen .dashboard-lower-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 11px; }
#app-screen .dashboard-patients-list { display: grid; }
#app-screen .dashboard-patient-row { display: grid; min-height: 39px; grid-template-columns: 27px minmax(80px, 1fr) auto auto; align-items: center; gap: 9px; padding: 5px 2px; border: 0; border-bottom: 1px solid #edf2f7; border-radius: 0; color: #263f5c; background: transparent; box-shadow: none; text-align: left; cursor: pointer; }
#app-screen .dashboard-patient-row:last-child { border-bottom: 0; }
#app-screen .dashboard-patient-row:hover { color: #087ecb; background: #f5faff; transform: none; }
#app-screen .dashboard-patient-avatar { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; color: #147bd2; background: #e5f2ff; font-size: 9px; font-weight: 800; }
#app-screen .dashboard-patient-name { overflow: hidden; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
#app-screen .dashboard-patient-age, #app-screen .dashboard-patient-row time { color: #72859a; font-size: 9px; white-space: nowrap; }
#app-screen .dashboard-chart-wrap { position: relative; height: 155px; }
#app-screen .dashboard-chart-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; color: #71859a; font-size: 10px; text-align: center; pointer-events: none; }
#app-screen .dashboard-chart-empty[hidden] { display: none; }
#app-screen .dashboard-text-link { padding: 4px 0; border: 0; color: #087ed2; background: transparent; box-shadow: none; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
#app-screen .dashboard-text-link:hover { color: #075fa1; text-decoration: underline; transform: none; }
#app-screen .dashboard-recent-exams-panel .exams-list { margin: 0; }
#app-screen .dashboard-recent-exams-panel .professional-exam-item { border-color: #edf2f7; border-radius: 8px; box-shadow: none; }
#app-screen .dashboard-empty-state { padding: 16px 4px; color: #75889c; font-size: 11px; }

/* Patient registration */
#app-screen #patient-data > .card { max-width: 1120px; margin: 0 auto; padding: 0; overflow: hidden; }
#app-screen .patient-page-heading { padding: 17px 20px 12px; border-bottom: 1px solid #e9eff5; }
#app-screen .app-breadcrumb { display: flex; align-items: center; gap: 9px; color: #70859b; font-size: 10px; }
#app-screen .app-breadcrumb strong { color: #284463; }
#app-screen .patient-title-row { margin-top: 16px; }
#app-screen .patient-title-row h2 { margin: 3px 0 0; font-size: 22px; }
#app-screen .patient-form-section { margin: 15px 18px 0; padding: 13px 14px 2px; border: 1px solid #e4edf6; border-radius: 11px; background: #fff; }
#app-screen .form-section-heading { margin-bottom: 11px; }
#app-screen .form-section-heading h3 { margin: 0; color: var(--sync-ink); font-size: 13px; }
#app-screen .form-section-heading p { margin: 3px 0 0; color: #74879a; font-size: 10px; }
#app-screen .patient-personal-grid { grid-template-columns: minmax(220px, 1.6fr) minmax(110px, .65fr) minmax(140px, .9fr); gap: 13px; }
#app-screen .patient-clinical-section .two-columns { grid-template-columns: minmax(180px, .72fr) minmax(260px, 1.28fr); gap: 13px; }
#app-screen .patient-form-section .form-group { margin-bottom: 11px; }
#app-screen .patient-form-section label { margin-bottom: 5px; color: #3a536e; font-size: 10px; }
#app-screen .patient-form-section input, #app-screen .patient-form-section select { min-height: 37px; padding: 8px 10px; border-radius: 7px; font-size: 11px; }
#app-screen .patient-form-actions { display: flex; justify-content: flex-end; gap: 9px; margin: 14px 18px 17px; }
#app-screen .patient-form-actions button { min-width: 105px; min-height: 38px; font-size: 11px; }

/* Exam workflow */
#app-screen #exam-data > .card { padding: 19px; }
#app-screen .exam-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: -2px -1px 13px; }
#app-screen .exam-page-heading h2 { margin: 11px 0 2px; color: var(--sync-ink); font-size: 21px; }
#app-screen .exam-page-heading p { margin: 0; color: #73869a; font-size: 11px; }
#app-screen .exam-patient-summary { display: flex; min-width: 215px; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid #e4edf5; border-radius: 9px; background: #fbfdff; }
#app-screen .exam-patient-avatar { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: #167ccc; background: #e4f2ff; font-weight: 800; }
#app-screen .exam-patient-summary strong, #app-screen .exam-patient-summary small { display: block; }
#app-screen .exam-patient-summary strong { max-width: 190px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
#app-screen .exam-patient-summary small { margin-top: 2px; color: #71869b; font-size: 9px; }
#app-screen .exam-workflow-steps { display: flex; gap: 0; margin: 0 -1px 16px; padding: 4px; overflow: auto; border: 1px solid #dfebf5; border-radius: 11px; background: #f3f8fc; }
#app-screen .exam-step { min-width: max-content; flex: 1; padding: 9px 12px; border: 0; border-radius: 8px; color: #516c87; background: transparent; box-shadow: none; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
#app-screen .exam-step span { margin-right: 4px; }
#app-screen .exam-step:hover { color: #116eb2; background: #e7f3fc; transform: none; }
#app-screen .exam-step.is-current { color: #fff; background: linear-gradient(110deg, #168fdf, #0876c9); box-shadow: 0 3px 8px rgba(18, 124, 195, .18); }
#app-screen .exam-audiometry-heading { scroll-margin-top: 95px; margin-bottom: 10px; }
#app-screen .exam-audiometry-heading h3 { margin: 0; color: var(--sync-ink); font-size: 14px; }
#app-screen .exam-audiometry-heading p { margin: 3px 0 0; color: #77899b; font-size: 10px; }
#app-screen #exam-logoaudiometry-section, #app-screen #unified-impedance-section { scroll-margin-top: 90px; }

/* PAC catalog and role-specific screens */
#app-screen #tests .tests-hub-card { padding: 20px; border-radius: 14px; }
#app-screen #tests .tests-hub-header h2 { margin: 0; color: var(--sync-ink); font-size: 22px; }
#app-screen #tests .tests-hub-header p { color: #70849a; font-size: 11px; }
#app-screen #tests .tests-catalog-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
#app-screen #tests .tests-protocol-card { min-height: 132px; padding: 13px; border-color: #dfebf5; border-radius: 10px; background: linear-gradient(145deg, #fff, #f3f9fe); box-shadow: 0 4px 12px rgba(31, 67, 102, .05); }
#app-screen #tests .tests-protocol-card:hover { border-color: #a9d6f5; box-shadow: 0 9px 18px rgba(28, 91, 142, .11); }

@media (max-width: 980px) {
  #app-screen > .container { margin-left: 206px; padding-right: 16px; padding-left: 16px; }
  #app-screen .tab-container { width: 178px; }
  #app-screen .dashboard-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app-screen .dashboard-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  #app-screen > .container { min-height: 100vh; margin: 0; padding: 0 12px 92px; }
  #app-screen .tab-container { inset: auto 0 0; width: auto; height: 66px; flex-direction: row; align-items: stretch; gap: 5px; overflow-x: auto; overflow-y: hidden; padding: 6px 8px max(6px, env(safe-area-inset-bottom)); border: 0; border-radius: 14px 14px 0 0; }
  #app-screen .app-sidebar-brand, #app-screen .app-sidebar-caption { display: none; }
  #app-screen .tab-container > .tab { min-width: 70px; min-height: 51px; flex: 0 0 auto; flex-direction: column; justify-content: center; gap: 2px; padding: 4px 8px; font-size: 9px; text-align: center; }
  #app-screen .tab-container > .tab.active { box-shadow: inset 0 2px #39b5ff; }
  #app-screen .app-nav-icon { width: 17px; height: 17px; }
  #app-screen .user-header { top: 0; min-height: 57px; flex-wrap: wrap; gap: 8px; margin: 0 -12px 14px; padding: 8px 12px; }
  #app-screen .app-global-search { width: 100%; max-width: none; height: 34px; order: 2; }
  #app-screen .user-info { margin-right: auto; }
  #app-screen .user-actions { gap: 5px; }
  #app-screen .app-new-patient-btn { min-height: 32px; padding: 0 9px; font-size: 9px; }
  #app-screen .profile-btn, #app-screen .logout-btn { padding: 7px; font-size: 9px; }
  #app-screen .dashboard-welcome { align-items: flex-start; }
  #app-screen .dashboard-date-label { display: none; }
  #app-screen .dashboard-stats-grid { gap: 7px; }
  #app-screen .dashboard-stat-card { min-height: 65px; gap: 8px; padding: 9px; }
  #app-screen .dashboard-stat-icon { width: 29px; height: 29px; flex-basis: 29px; }
  #app-screen .dashboard-stat-card strong { font-size: 18px; }
  #app-screen .dashboard-stat-card > div span { font-size: 9px; }
  #app-screen .dashboard-panel { padding: 12px; }
  #app-screen .dashboard-lower-grid { grid-template-columns: 1fr; }
  #app-screen .dashboard-quick-card { min-height: 116px; }
  #app-screen .dashboard-patient-row { grid-template-columns: 26px minmax(80px, 1fr) auto; }
  #app-screen .dashboard-patient-age { display: none; }
  #app-screen .dashboard-chart-wrap { height: 175px; }
  #app-screen #patient-data > .card, #app-screen #exam-data > .card { padding: 13px; }
  #app-screen .patient-page-heading { padding: 12px 13px 9px; }
  #app-screen .patient-form-section { margin: 11px 8px 0; padding: 11px 10px 1px; }
  #app-screen .patient-personal-grid, #app-screen .patient-clinical-section .two-columns { grid-template-columns: 1fr 1fr; gap: 8px; }
  #app-screen .patient-personal-grid .form-group:first-child, #app-screen .patient-clinical-section .form-group:first-child { grid-column: 1 / -1; }
  #app-screen .patient-form-actions { margin: 12px 8px; }
  #app-screen .exam-page-heading { align-items: flex-start; flex-direction: column; }
  #app-screen .exam-patient-summary { width: 100%; min-width: 0; }
  #app-screen .exam-workflow-steps { margin-bottom: 12px; }
  #app-screen .exam-step { padding: 8px; font-size: 9px; }
}

/* Student study workspace follows the supplied case-study screens. */
#app-screen:has(.user-header.student) .student-case-overview { gap: 8px; }
#app-screen:has(.user-header.student) .student-case-overview-title { min-height: 30px; padding: 2px 6px; border: 0; border-radius: 0; background: transparent; }
#app-screen:has(.user-header.student) .student-case-breadcrumb { display: flex; align-items: center; gap: 9px; color: #637a90; font-size: 11px; }
#app-screen:has(.user-header.student) .student-case-breadcrumb > span:nth-child(2) { color: #9aafc1; }
#app-screen:has(.user-header.student) .student-case-breadcrumb strong { color: #173451; font-size: 12px; }
#app-screen:has(.user-header.student) .student-workflow-steps { justify-content: space-between; gap: 3px; padding: 5px 8px; border-radius: 11px; }
#app-screen:has(.user-header.student) .student-workflow-steps button { min-height: 32px; gap: 6px; padding: 4px 8px; white-space: nowrap; }
#app-screen:has(.user-header.student) .student-workflow-steps button.is-active { color: #0877c5; background: transparent; }
#app-screen:has(.user-header.student) .student-workflow-steps button.is-active span { background: #168ee2; }
#app-screen:has(.user-header.student) .student-simulator-header { min-height: 42px; padding: 3px 2px 7px; border: 0; background: transparent; }
#app-screen:has(.user-header.student) .student-simulator-header h3 { margin: 0 0 2px; color: #173451; font-size: 15px; font-weight: 800; }
#app-screen:has(.user-header.student) .student-simulator-header p { margin: 0; color: #637a90; font-size: 10px; }

#app-screen:has(.user-header.student) #student-audiometry-simulator { grid-template-columns: minmax(220px, .76fr) minmax(0, 1.5fr); gap: 9px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator > .student-simulator-header,
#app-screen:has(.user-header.student) #student-audiometry-simulator > .student-training-note { grid-column: 1 / -1; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiometer-panel { padding: 10px; border: 1px solid #d9e6f0; border-radius: 10px; color: #193955; background: linear-gradient(150deg, #f4f9fd, #eaf3fa); box-shadow: 0 4px 14px rgba(31, 67, 102, .06); }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiometer-display { min-height: 36px; grid-template-columns: auto auto 1fr auto; gap: 7px; margin-bottom: 8px; padding: 6px 8px; border: 1px solid #d9e7f2; border-width: 1px; border-radius: 7px; color: #173451; background: #fff; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiometer-display span,
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiometer-display strong { color: #173451; font-size: 10px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-primary-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 7px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-primary-controls .student-control-block { min-width: 0; padding: 7px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-control-masking { grid-column: 1 / -1; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-control-block { margin-top: 7px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-control-block label { font-size: 8px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-toggle-group button,
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-frequency-grid button,
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-intensity-control button { min-height: 28px; padding: 5px 6px; font-size: 9px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-frequency-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-intensity-control { grid-template-columns: 1fr; gap: 7px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-intensity-step-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-intensity-step-grid button { min-width: 0; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-main-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; margin-top: 9px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-main-actions button { min-height: 34px; padding: 7px 9px; font-size: 9px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-present-btn { grid-column: 1 / -1; color: #513f06; background: #f3c843; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-mark-btn { color: #fff; background: #16895b; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-results-panel { min-width: 0; padding: 10px; border: 1px solid #e0eaf3; border-radius: 10px; background: #fff; box-shadow: 0 4px 14px rgba(31, 67, 102, .045); }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-results-panel > div:first-child h4 { margin: 0; color: #173451; font-size: 12px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-card { min-width: 0; min-height: 0; padding: 8px; border-radius: 9px; background: #fff; box-shadow: none; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-card-right { border-color: #f0dada; background: linear-gradient(180deg, #fff8f8, #fff); }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-card-left { border-color: #d9e7f7; background: linear-gradient(180deg, #f7fbff, #fff); }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-heading { justify-content: flex-start; gap: 6px; margin-bottom: 4px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-heading span { display: grid; width: 20px; height: 20px; place-items: center; border: 2px solid currentColor; border-radius: 50%; color: #df3038; background: #fff; font-size: 11px; font-weight: 800; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-card-left .student-audiogram-chart-heading span { color: #176fe5; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-heading strong { color: #173451; font-size: 9px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-wrap { height: 166px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-wrap canvas { width: 100% !important; height: 100% !important; }
#app-screen:has(.user-header.student) .student-symbol-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 13px; margin-top: 6px; padding: 7px 8px; border: 1px solid #e2ebf3; border-radius: 8px; color: #415b74; background: #fbfdff; font-size: 8px; }
#app-screen:has(.user-header.student) .student-symbol-legend span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
#app-screen:has(.user-header.student) .student-symbol-legend b { min-width: 12px; color: #df3038; font-size: 12px; text-align: center; }
#app-screen:has(.user-header.student) .student-symbol-legend b.is-left { color: #176fe5; }
#app-screen:has(.user-header.student) .student-training-note { padding: 7px 9px; color: #637a90; background: #f1f7fc; font-size: 8px; }

#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-grid { grid-template-columns: 1fr; gap: 9px; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-card { min-width: 0; min-height: 0; padding: 10px; border: 1px solid #e0eaf3; border-radius: 10px; background: #fff; box-shadow: none; transition: border-color .16s ease, box-shadow .16s ease; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-card-right { border-top: 3px solid #df3038; background: linear-gradient(180deg, #fffafa, #fff); }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-card-left { border-top: 3px solid #176fe5; background: linear-gradient(180deg, #f8fbff, #fff); }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-card.is-selected { box-shadow: 0 0 0 2px rgba(22, 142, 226, .18); }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-card h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 5px; color: #173451; font-size: 11px; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-card h4 span { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; color: #fff; background: #df3038; font-size: 9px; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-card-left h4 span { background: #176fe5; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-wrap { height: 176px; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-wrap canvas { width: 100% !important; height: 100% !important; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-answer-card { display: grid; grid-template-columns: minmax(125px, .8fr) minmax(145px, 1fr) auto minmax(115px, .8fr); align-items: end; gap: 8px; padding: 10px; border-radius: 9px; background: #f7fbfe; box-shadow: none; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-ear-control { margin: 0; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-answer-card > label { align-self: end; margin: 0 0 5px; color: #526b83; font-size: 9px; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator #student-tymp-answer { min-width: 0; min-height: 34px; padding: 6px 8px; border-radius: 7px; font-size: 10px; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator #student-check-tymp { min-height: 34px; padding: 7px 10px; font-size: 9px; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator #student-tymp-feedback { margin: 0; color: #526b83; font-size: 9px; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-metrics { grid-column: 4; grid-row: 1 / span 2; align-self: stretch; border-radius: 8px; font-size: 9px; }

#app-screen:has(.user-header.student) #student-audiometric-result-section { display: grid; gap: 10px; padding-top: 0; border-top: 0; }
#app-screen:has(.user-header.student) .student-result-overview { display: grid; gap: 9px; padding: 0; border: 0; border-radius: 0; background: transparent; }
#app-screen:has(.user-header.student) .student-result-report-grid { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(290px, .9fr); align-items: stretch; gap: 10px; }
#app-screen:has(.user-header.student) .student-result-audiograms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(280px, auto) auto; align-content: start; gap: 9px; }
#app-screen:has(.user-header.student) .student-result-audiogram-card { min-width: 0; min-height: 300px; padding: 11px; border: 1px solid #e0eaf3; border-radius: 10px; background: #fff; }
#app-screen:has(.user-header.student) .student-result-audiogram-right { border-top: 3px solid #df3038; }
#app-screen:has(.user-header.student) .student-result-audiogram-left { border-top: 3px solid #176fe5; }
#app-screen:has(.user-header.student) .student-result-audiogram-card h4 { margin: 0 0 7px; color: #173451; font-size: 13px; }
#app-screen:has(.user-header.student) .student-result-audiogram-right h4 { color: #df3038; }
#app-screen:has(.user-header.student) .student-result-audiogram-left h4 { color: #176fe5; }
#app-screen:has(.user-header.student) .student-result-audiogram-wrap { height: 264px; }
#app-screen:has(.user-header.student) .student-result-audiogram-wrap canvas { width: 100% !important; height: 100% !important; }
#app-screen:has(.user-header.student) .student-result-measures { display: grid; align-content: start; gap: 7px; }
#app-screen:has(.user-header.student) .student-result-measures section { overflow: hidden; border: 1px solid #e0eaf3; border-radius: 10px; background: #fff; }
#app-screen:has(.user-header.student) .student-result-measures h4 { margin: 0; padding: 11px 12px 8px; color: #173451; font-size: 14px; }
#app-screen:has(.user-header.student) .student-result-measures table { width: 100%; border-collapse: collapse; font-size: 12px; }
#app-screen:has(.user-header.student) .student-result-measures th,
#app-screen:has(.user-header.student) .student-result-measures td { text-align: center; }
#app-screen:has(.user-header.student) .student-result-measures thead th { padding: 8px 9px; border-top: 1px solid #e8eff5; border-bottom: 1px solid #e8eff5; color: #435d76; text-align: center; }
#app-screen:has(.user-header.student) .student-result-measures thead th:first-child { text-align: left; }
#app-screen:has(.user-header.student) .student-result-measures thead th:nth-child(2) { color: #c52c34; background: #fff0ef; }
#app-screen:has(.user-header.student) .student-result-measures thead th:nth-child(3) { color: #176fe5; background: #edf5ff; }
#app-screen:has(.user-header.student) .student-result-measures tbody th,
#app-screen:has(.user-header.student) .student-result-measures tbody td { padding: 8px 9px; border-top: 1px solid #e8eff5; color: #435d76; }
#app-screen:has(.user-header.student) .student-result-measures tbody th { font-weight: 500; text-align: left; }
#app-screen:has(.user-header.student) .student-result-measures tbody td { color: #173451; font-weight: 700; }
#app-screen:has(.user-header.student) .student-result-conclusion-preview { grid-column: 1 / -1; display: flex; align-items: center; gap: 13px; min-height: 94px; padding: 14px 18px; border-radius: 10px; color: #234d43; background: #e8f8f0; }
#app-screen:has(.user-header.student) .student-result-conclusion-preview > span { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border-radius: 50%; color: #fff; background: #18a66b; font-size: 25px; font-weight: 800; }
#app-screen:has(.user-header.student) .student-result-conclusion-preview strong { font-size: 14px; }
#app-screen:has(.user-header.student) .student-result-conclusion-preview p { margin: 3px 0 0; color: #45695f; font-size: 13px; line-height: 1.5; }
#app-screen:has(.user-header.student) .student-result-note-card { gap: 10px; padding: 11px; border-radius: 10px; }
#app-screen:has(.user-header.student) .student-result-note-card h4 { margin: 0; color: #173451; font-size: 12px; }
#app-screen:has(.user-header.student) .student-result-comment textarea { min-height: 72px; }

@media (max-width: 760px) {
  #app-screen:has(.user-header.student) .student-workflow-steps { justify-content: flex-start; }
  #app-screen:has(.user-header.student) #student-audiometry-simulator { grid-template-columns: 1fr; }
  #app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiometer-panel,
  #app-screen:has(.user-header.student) #student-audiometry-simulator .student-results-panel { grid-column: 1; grid-row: auto; }
  #app-screen:has(.user-header.student) .student-result-report-grid { grid-template-columns: 1fr; }
  #app-screen:has(.user-header.student) .student-result-measures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-answer-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-metrics { grid-column: auto; grid-row: auto; }
}

@media (max-width: 520px) {
  #app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-grid,
  #app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-grid,
  #app-screen:has(.user-header.student) .student-result-audiograms { grid-template-columns: 1fr; }
  #app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-wrap { height: 190px; }
  #app-screen:has(.user-header.student) .student-result-audiogram-wrap { height: 185px; }
  #app-screen:has(.user-header.student) .student-result-audiograms,
  #app-screen:has(.user-header.student) .student-result-measures { grid-template-columns: 1fr; }
  #app-screen:has(.user-header.student) .student-result-audiogram-card { min-height: 225px; }
  #app-screen:has(.user-header.student) .student-result-conclusion-preview { align-items: flex-start; }
  #app-screen:has(.user-header.student) .student-case-breadcrumb { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  #app-screen *, #app-screen *::before, #app-screen *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Professional exam workspace */
#app-screen .exam-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
#app-screen .exam-header-action, #app-screen .exam-header-settings { min-height: 34px; padding: 7px 10px; border: 1px solid #d8e7f4; border-radius: 8px; color: #285273; background: #fff; box-shadow: none; font-size: 10px; font-weight: 700; }
#app-screen .exam-header-settings { width: 36px; padding: 0; color: #0879ce; font-size: 17px; }
#app-screen .exam-header-action:hover, #app-screen .exam-header-settings:hover { border-color: #95c9ee; background: #f2f9ff; transform: none; }
#app-screen .exam-audiometry-workspace { display: grid; grid-template-columns: minmax(235px, .38fr) minmax(0, 1fr); align-items: start; gap: 12px; }
#app-screen .exam-threshold-panel, #app-screen .exam-preview-panel { min-width: 0; padding: 12px; border: 1px solid #e0eaf3; border-radius: 11px; background: #fff; }
#app-screen .exam-pathway-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 10px; padding: 4px; border: 1px solid #e1ebf4; border-radius: 9px; background: #f3f8fc; }
#app-screen .exam-pathway-switch button { min-height: 34px; padding: 7px; border: 0; border-radius: 7px; color: #4c6781; background: transparent; box-shadow: none; font-size: 10px; font-weight: 800; }
#app-screen .exam-pathway-switch button.is-active { color: #fff; background: linear-gradient(110deg, #168fdf, #0876c9); box-shadow: 0 3px 8px rgba(18, 124, 195, .18); }
#app-screen .exam-pathway-switch button:hover:not(.is-active) { color: #0876c9; background: #e6f3fc; transform: none; }
#app-screen .exam-pathway-panel[hidden] { display: none !important; }
#app-screen .exam-pathway-panel { margin: 0; padding: 0; border: 0; border-radius: 0; border-left: 0; background: transparent; }
#app-screen .exam-pathway-panel > h3 { margin: 0 0 9px; padding: 0; border: 0; color: #304b67; font-size: 11px; }
#app-screen .exam-pathway-panel .air-pta-wrap { display: block; }
#app-screen .exam-pathway-panel .table-container { width: 100%; overflow: visible; }
#app-screen .exam-threshold-table-wrap { overflow: visible; }
#app-screen table.exam-threshold-table { width: 100%; min-width: 0; border-collapse: separate; border-spacing: 0 4px; }
#app-screen .exam-threshold-table th, #app-screen .exam-threshold-table td { height: 32px; padding: 3px 5px; border: 0; background: #f5f9fc; text-align: center; }
#app-screen .exam-threshold-table thead th { height: 28px; color: #60758a; background: transparent; font-size: 9px; font-weight: 800; }
#app-screen .exam-threshold-table tbody th { width: 34%; border-radius: 6px 0 0 6px; color: #38536f; font-size: 9px; font-weight: 700; text-align: left; white-space: nowrap; }
#app-screen .exam-threshold-table tbody td:last-child { border-radius: 0 6px 6px 0; }
#app-screen .exam-threshold-table input.audiogram-input { width: 100%; min-width: 0; min-height: 27px; margin: 0; padding: 4px 3px; border: 1px solid #d4e1ed; border-radius: 5px; color: #25425f; background: #fff; font-size: 10px; text-align: center; }
#app-screen .exam-threshold-table input.audiogram-input:focus { border-color: #168fdf; outline: 2px solid rgba(22, 143, 223, .12); }
#app-screen .exam-ear-dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; vertical-align: 1px; }
#app-screen .exam-ear-dot.right { background: #e45d55; }
#app-screen .exam-ear-dot.left { background: #3996d4; }
#app-screen .exam-notation-details { margin-top: 9px; border-top: 1px solid #e7eef5; }
#app-screen .exam-notation-details > summary { padding: 9px 2px 3px; color: #526c84; font-size: 9px; font-weight: 800; cursor: pointer; }
#app-screen .exam-notation-details .notation-panel { margin-top: 8px; padding: 7px; overflow-x: auto; border: 1px solid #e5edf4; border-radius: 7px; background: #f8fbfd; }
#app-screen .exam-notation-details .audiogram-notation-table { min-width: 380px; font-size: 9px; }
#app-screen .exam-preview-panel { padding: 12px; }
#app-screen .exam-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
#app-screen .exam-preview-heading h3 { margin: 0; color: var(--sync-ink); font-size: 13px; }
#app-screen .exam-preview-heading p { margin: 3px 0 0; color: #7a8da0; font-size: 9px; }
#app-screen .exam-preview-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
#app-screen .exam-auto-plot { display: inline-flex; align-items: center; gap: 5px; color: #49647e; font-size: 9px; white-space: nowrap; }
#app-screen .exam-auto-plot input { width: 15px; height: 15px; margin: 0; accent-color: #168fdf; }
#app-screen .exam-refresh-plots { min-height: 29px; padding: 5px 9px; border: 1px solid #d8e8f5; border-radius: 7px; color: #0876c9; background: #f4faff; box-shadow: none; font-size: 9px; font-weight: 800; }
#app-screen .exam-refresh-plots:hover { background: #e7f4ff; transform: none; }
#app-screen .exam-preview-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#app-screen .exam-preview-chart-card { min-width: 0; padding: 8px 7px 5px; border: 1px solid #e2ebf3; border-radius: 8px; background: linear-gradient(155deg, #fff, #f9fcff); }
#app-screen .exam-preview-chart-card h4 { margin: 0 0 2px; color: #304b67; font-size: 9px; text-align: center; }
#app-screen .exam-preview-chart-wrap { position: relative; height: 205px; min-width: 0; }
#app-screen .exam-preview-chart-wrap canvas { width: 100% !important; height: 100% !important; }
#app-screen .exam-preview-legend-slot { display: flex; gap: 4px 10px; margin: 8px 0 0; padding: 7px 2px; border-top: 1px solid #e7eef5; }
#app-screen .exam-preview-legend-slot .legend-item { gap: 4px; color: #526b83; font-size: 8px; }
#app-screen .exam-preview-legend-slot .legend-symbol { width: 13px; height: 13px; font-size: 12px; }
#app-screen .exam-live-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 4px; }
#app-screen .exam-live-metric { min-width: 0; padding: 8px; border: 1px solid #e4edf5; border-radius: 8px; background: #fbfdff; }
#app-screen .exam-live-metric h4 { min-height: 18px; margin: 0 0 5px; color: #5a7189; font-size: 8px; font-weight: 800; }
#app-screen .exam-live-metric h4 small { font-size: 7px; }
#app-screen .exam-live-metric .pta-panel { display: grid; width: auto; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
#app-screen .exam-live-metric .pta-title { grid-column: 1 / -1; margin: 0 0 2px; color: #5a7189; font-size: 8px; }
#app-screen .exam-live-metric .pta-box { display: flex; align-items: center; gap: 4px; margin: 0; padding: 5px; border: 1px solid #edf2f7; border-radius: 6px; background: #f4f8fc; }
#app-screen .exam-live-metric .pta-ear { color: #ed5c54; font-size: 8px; font-weight: 800; }
#app-screen .exam-live-metric .pta-left .pta-ear { color: #3296d4; }
#app-screen .exam-live-metric .pta-value { color: #213d5b; font-size: 12px; font-weight: 800; }
#app-screen .exam-live-metric .pta-unit { color: #71869b; font-size: 7px; }
#app-screen .exam-metric-ears { display: grid; gap: 4px; }
#app-screen .exam-metric-ears span { display: flex; align-items: center; gap: 5px; min-height: 20px; padding: 3px 5px; border-radius: 5px; background: #f3f8fc; }
#app-screen .exam-metric-ears span:first-child b { color: #df5b53; }
#app-screen .exam-metric-ears span:last-child b { color: #318dcc; }
#app-screen .exam-metric-ears b { min-width: 20px; font-size: 8px; }
#app-screen .exam-metric-ears strong { color: #243e5b; font-size: 10px; }
#app-screen .exam-metric-ears small { margin-left: auto; color: #75899c; font-size: 7px; }
#app-screen .exam-audiometry-actions { display: flex; justify-content: space-between; gap: 8px; margin: 10px 0 18px; }
#app-screen .exam-audiometry-actions button { min-height: 35px; padding: 8px 12px; border-radius: 7px; font-size: 10px; font-weight: 800; }
#app-screen .exam-audiometry-actions .exam-back-patient { border: 1px solid #d6e6f3; color: #3a6387; background: #fff; box-shadow: none; }
#app-screen .exam-audiometry-actions .exam-next-stage { margin-left: auto; border: 0; color: #fff; background: linear-gradient(110deg, #168fdf, #0876c9); }
#app-screen .exam-audiometry-actions button:hover { filter: brightness(.98); transform: translateY(-1px); }

@media (max-width: 900px) {
  #app-screen .exam-audiometry-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  #app-screen .exam-header-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  #app-screen .exam-patient-summary { order: -1; flex: 1 1 100%; }
  #app-screen .exam-threshold-panel { display: block; }
  #app-screen .exam-preview-heading { align-items: flex-start; flex-direction: column; }
  #app-screen .exam-preview-controls { width: 100%; justify-content: space-between; }
  #app-screen .exam-preview-charts { grid-template-columns: 1fr; }
  #app-screen .exam-preview-chart-wrap { height: 230px; }
  #app-screen .exam-live-metrics { grid-template-columns: 1fr; }
  #app-screen .exam-audiometry-actions button { flex: 1; }
}

/* Shared language for role dashboards and operational pages */
#app-screen .tab-content > .card { border-color: #e0eaf3; color: #263f5c; }
#app-screen .tab-content h2,
#app-screen .tab-content h3,
#app-screen .tab-content h4 { color: var(--sync-ink); }
#app-screen .tab-content p { line-height: 1.55; }
#app-screen .tab-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
#app-screen .tab-content select,
#app-screen .tab-content textarea { border: 1px solid #d7e4ef; border-radius: 7px; color: #263f5c; background: #fbfdff; }
#app-screen .tab-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
#app-screen .tab-content select:focus,
#app-screen .tab-content textarea:focus { border-color: #69b5eb; outline: 0; box-shadow: 0 0 0 3px rgba(22, 143, 223, .12); }
#app-screen .btn-primary,
#app-screen .btn-secondary,
#app-screen .btn-danger,
#app-screen .action-buttons button,
#app-screen .quick-actions button { min-height: 36px; padding: 8px 13px; border-radius: 7px; font: inherit; font-size: 11px; font-weight: 800; }
#app-screen .btn-primary { border: 0; color: #fff; background: linear-gradient(110deg, #168fdf, #0876c9); box-shadow: 0 4px 10px rgba(18, 124, 195, .15); }
#app-screen .btn-primary:hover:not(:disabled) { background: linear-gradient(110deg, #087fc9, #0868b1); transform: translateY(-1px); }
#app-screen .btn-secondary { border: 1px solid #d6e5f1; color: #365873; background: #f5f9fc; box-shadow: none; }
#app-screen .btn-secondary:hover:not(:disabled) { border-color: #a9cfea; color: #116eb2; background: #edf7ff; transform: none; }
#app-screen .btn-danger { border: 0; color: #fff; background: #d84e55; }
#app-screen .message { margin: 8px 0; padding: 9px 11px; border: 1px solid #dce8f2; border-radius: 7px; font-size: 10px; }
#app-screen .message-success { border-color: #c6e9d5; color: #177746; background: #edf9f2; }
#app-screen .message-error { border-color: #f1cfd1; color: #a53d45; background: #fff1f2; }
#app-screen .message-info { border-color: #c8e4f5; color: #176da8; background: #eef8ff; }
#app-screen .loading-dashboard { padding: 24px; color: #647b92; font-size: 11px; }
#app-screen .loading-dashboard .spinner { border-color: #dbe8f2; border-top-color: #168fdf; }

#app-screen .professional-header {
  display: flex; min-height: 116px; align-items: center; justify-content: space-between; gap: 18px;
  margin: 0; padding: 20px 22px; border: 1px solid #dce9f4; border-left: 4px solid #168fdf;
  border-radius: 12px; color: var(--sync-ink); background: linear-gradient(115deg, #fff, #f1f8fe);
  box-shadow: 0 5px 16px rgba(31, 67, 102, .045);
}
#app-screen .professional-header h2 { margin: 2px 0 5px; color: var(--sync-ink); font-size: 22px; letter-spacing: -.035em; }
#app-screen .professional-header > div:not(.partner-dashboard-hero-badge) { color: #526d87; font-size: 12px; }
#app-screen .professional-header .partner-dashboard-eyebrow { color: #1682c8; font-size: 9px; }
#app-screen .professional-header .partner-dashboard-subtitle { color: #536d86; font-size: 11px; }
#app-screen .professional-header .partner-dashboard-subtitle span { color: #70859a; }
#app-screen .professional-header .partner-dashboard-hero-badge { min-width: 118px; padding: 10px 13px; border: 1px solid #d7e9f7; border-radius: 9px; color: #176da8; background: rgba(255,255,255,.82); backdrop-filter: none; }
#app-screen .professional-header .partner-dashboard-hero-badge span { color: #71869a; font-size: 8px; }
#app-screen .professional-header .partner-dashboard-hero-badge strong { margin-top: 4px; color: #176da8; font-size: 25px; }
#app-screen .professional-header.company-dashboard-hero { border-left-color: #168fdf; background: linear-gradient(115deg, #fff, #f1f8fe); }
#app-screen .professional-header.partner-dashboard-hero { border-left-color: #20a477; background: linear-gradient(115deg, #fff, #f1f9f7); }
#app-screen .professional-header.partner-dashboard-hero .partner-dashboard-eyebrow { color: #17805f; }
#app-screen .dashboard-admin,
#app-screen .dashboard-partner,
#app-screen .company-management-tab,
#app-screen .dashboard-professional:not(.sync-dashboard) { display: grid; gap: 13px; }

#app-screen .dashboard-stats,
#app-screen .professional-stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; }
#app-screen .stat-card {
  min-width: 0; min-height: 90px; padding: 13px 14px; border: 1px solid #e0eaf3; border-left: 3px solid #168fdf;
  border-radius: 10px; background: linear-gradient(145deg, #fff, #f8fbfe); box-shadow: 0 4px 12px rgba(31, 67, 102, .045);
}
#app-screen .stat-card h3,
#app-screen .stat-card h4 { margin: 0 0 5px; color: #60768b; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
#app-screen .stat-card .stat-number { margin: 2px 0; color: #173b62; font-size: 24px; line-height: 1.15; }
#app-screen .stat-card p { margin: 3px 0 0; color: #71869a; font-size: 9px; }
#app-screen .partner-stat-card::after { background: rgba(22, 143, 223, .06); }
#app-screen .dashboard-section { min-width: 0; margin: 0; padding: 15px; border: 1px solid #e0eaf3; border-radius: 11px; background: rgba(255,255,255,.9); box-shadow: 0 4px 13px rgba(31, 67, 102, .035); }
#app-screen .dashboard-section > h3,
#app-screen .dashboard-section .section-heading-with-action h3 { margin: 0 0 10px; color: #203f61; font-size: 13px; }
#app-screen .dashboard-section h3 { border: 0; padding: 0; }
#app-screen .section-heading-with-action { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
#app-screen .section-heading-with-action button { min-height: 30px; padding: 6px 9px; font-size: 9px; }
#app-screen .professional-overview-grid { gap: 8px; }
#app-screen .professional-overview-card { min-width: 0; padding: 11px 12px; border: 1px solid #e1eaf2; border-radius: 9px; background: #f9fcff; box-shadow: none; }
#app-screen .professional-overview-card .overview-label { color: #71869a; font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
#app-screen .professional-overview-card > strong { display: block; margin-top: 4px; color: #173b62; font-size: 18px; }
#app-screen .professional-overview-card p { margin: 3px 0 0; color: #6d8195; font-size: 9px; }
#app-screen .partner-stage-card { border-top: 2px solid #168fdf; }
#app-screen .partner-stage-card.stage-converted { border-top-color: #21a56b; }
#app-screen .partner-stage-card.stage-cancelled { border-top-color: #d75b62; }
#app-screen .partner-stage-card.stage-scheduled { border-top-color: #e3a52b; }
#app-screen .partner-stage-card.stage-contacted { border-top-color: #3698d3; }
#app-screen .quick-actions, #app-screen .action-buttons { gap: 7px; margin-top: 10px; }
#app-screen .admin-commerce-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 10px; }

/* History, results, and referral management */
#app-screen .table-container { margin: 8px 0 0; overflow-x: auto; border: 1px solid #e2ebf3; border-radius: 9px; background: #fff; }
#app-screen .referrals-table,
#app-screen .ranking-table { min-width: 640px; border-collapse: separate; border-spacing: 0; }
#app-screen .referrals-table th,
#app-screen .ranking-table th { padding: 9px 10px; border-bottom: 1px solid #dfe9f2; color: #526b83; background: #f3f8fc; font-size: 9px; font-weight: 800; }
#app-screen .referrals-table td,
#app-screen .ranking-table td { padding: 9px 10px; border-bottom: 1px solid #edf2f6; color: #405a74; font-size: 10px; vertical-align: middle; }
#app-screen .referrals-table tbody tr:last-child td,
#app-screen .ranking-table tbody tr:last-child td { border-bottom: 0; }
#app-screen .referrals-table tbody tr:hover td,
#app-screen .ranking-table tbody tr:hover td { background: #f8fbfe; }
#app-screen .referrals-table td small,
#app-screen .ranking-table td small { color: #7a8da0; font-size: 9px; }
#app-screen .partner-status-select { min-height: 32px; padding: 5px 8px; border-color: #d5e3ee; border-radius: 6px; font-size: 10px; }
#app-screen .count-badge { display: inline-flex; align-items: center; width: max-content; padding: 4px 7px; border: 1px solid #d9e9f5; border-radius: 99px; color: #176da8; background: #edf7ff; font-size: 8px; font-weight: 800; }
#app-screen .count-badge.tone-pending { border-color: #e7d9b3; color: #8b661a; background: #fff8e8; }
#app-screen .count-badge.tone-scheduled { border-color: #f2ddb1; color: #93691c; background: #fff7e6; }
#app-screen .count-badge.tone-contacted { border-color: #c8e4f5; color: #176da8; background: #eef8ff; }
#app-screen .count-badge.tone-converted { border-color: #c6e9d5; color: #177746; background: #edf9f2; }
#app-screen .count-badge.tone-cancelled { border-color: #f1cfd1; color: #a53d45; background: #fff1f2; }
#app-screen .no-data,
#app-screen .empty-state,
#app-screen .error-state { border: 1px dashed #d7e5f0; border-radius: 9px; color: #6e8296; background: #f8fbfe; font-size: 11px; }
#app-screen .search-box { display: flex; gap: 7px; margin: 12px 0; }
#app-screen .search-box input { min-width: 0; min-height: 37px; flex: 1; padding: 8px 10px; }
#app-screen .search-box button { min-height: 37px; padding: 7px 12px; border: 0; border-radius: 7px; color: #fff; background: #1687d2; font-size: 10px; font-weight: 800; }
#app-screen #history > .card > h2,
#app-screen #results > .card > h2,
#app-screen #partners > .card > h2 { margin: 0 0 14px; font-size: 21px; }
#app-screen #history .patients-list { max-height: 620px; margin-top: 12px; padding-right: 3px; }
#app-screen #history .exam-card,
#app-screen #history .partner-card { margin-bottom: 8px; padding: 13px; border: 1px solid #e0eaf3; border-radius: 9px; box-shadow: none; }
#app-screen #history .exam-card:hover,
#app-screen #history .partner-card:hover { border-color: #b7d7ed; background: #fbfdff; }
#app-screen #history .exam-header { gap: 9px; }
#app-screen #history .exam-date { border-radius: 6px; color: #176da8; background: #edf7ff; font-size: 9px; }
#app-screen #history > .partner-history-card { display: grid; gap: 12px; padding: 0; }
#app-screen .partner-history-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px; border: 1px solid #dce9f4; border-left: 4px solid #20a477; border-radius: 10px; background: linear-gradient(115deg, #fff, #f1f9f7); }
#app-screen .partner-history-header .partner-dashboard-eyebrow { color: #17805f; font-size: 9px; }
#app-screen .partner-history-header h2 { margin: 2px 0 4px; font-size: 20px; }
#app-screen .partner-history-subtitle { margin: 0; color: #71869a; font-size: 10px; }
#app-screen .partner-history-toolbar { display: flex; min-width: min(440px, 48%); gap: 6px; }
#app-screen .partner-history-toolbar input { min-width: 0; flex: 1; min-height: 35px; padding: 7px 9px; }
#app-screen .partner-history-toolbar button { min-height: 35px; padding: 6px 9px; border: 1px solid #d6e5f1; border-radius: 7px; color: #365873; background: #f5f9fc; font-size: 9px; font-weight: 800; }
#app-screen .partner-history-toolbar #partner-history-search-btn { border-color: #1687d2; color: #fff; background: #1687d2; }
#app-screen .partner-history-count { padding: 6px 9px; border: 1px solid #d8e9f5; border-radius: 99px; color: #176da8; background: #f1f8fe; font-size: 9px; }
#app-screen .admin-commission-card { border: 1px solid #dce8f2; border-radius: 12px; box-shadow: 0 22px 60px rgba(18, 45, 73, .24); }
#app-screen .admin-commission-header { padding: 13px 15px; border-bottom-color: #e1eaf2; background: linear-gradient(115deg, #fff, #f1f8fe); }
#app-screen .admin-commission-header h3 { color: #203f61; font-size: 16px; }
#app-screen .admin-commission-form { padding: 14px; }
#app-screen .admin-commission-form label { color: #526b83; font-size: 9px; }
#app-screen .admin-commission-form input,
#app-screen .admin-commission-form textarea,
#app-screen .admin-commission-form select { min-height: 34px; padding: 7px 9px; border-color: #d7e4ef; border-radius: 7px; background: #fbfdff; font-size: 10px; }
#app-screen .admin-commission-actions { gap: 7px; }
#app-screen .admin-commission-actions button { min-height: 34px; padding: 7px 10px; border-radius: 7px; font-size: 9px; }

@media (max-width: 900px) {
  #app-screen .dashboard-stats,
  #app-screen .professional-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app-screen .admin-commerce-grid { grid-template-columns: 1fr; }
  #app-screen .partner-history-header { align-items: flex-start; flex-direction: column; }
  #app-screen .partner-history-toolbar { width: 100%; min-width: 0; }
}

@media (max-width: 680px) {
  #app-screen .professional-header { min-height: 0; align-items: flex-start; flex-direction: column; padding: 14px; }
  #app-screen .professional-header .partner-dashboard-hero-badge { width: 100%; }
  #app-screen .dashboard-stats,
  #app-screen .professional-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  #app-screen .stat-card { min-height: 75px; padding: 10px; }
  #app-screen .stat-card .stat-number { font-size: 20px; }
  #app-screen .dashboard-section { padding: 11px; }
  #app-screen #results > .card,
  #app-screen #history > .card,
  #app-screen #partners > .card { padding: 13px; }
  #app-screen .search-box { flex-wrap: wrap; }
  #app-screen .search-box input { flex-basis: 100%; }
  #app-screen .partner-history-toolbar { flex-wrap: wrap; }
  #app-screen .partner-history-toolbar input { flex-basis: 100%; }
}

/* Company workspace and administrator inventory */
#app-screen .company-management-tab { display: grid; gap: 12px; }
#app-screen .company-dashboard-grid { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 10px; }
#app-screen .company-dashboard-grid > div { min-width: 0; padding: 14px; border: 1px solid #e0eaf3; border-radius: 10px; background: #fff; }
#app-screen .company-dashboard-grid > div > h3 { margin: 0 0 9px; font-size: 13px; }
#app-screen .partner-referral-helper { margin: 3px 0 12px; color: #71869a; font-size: 10px; }
#app-screen .company-professional-form,
#app-screen .company-professionals-list { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
#app-screen .company-professional-form-grid { gap: 9px; }
#app-screen .company-professional-form .form-group { margin-bottom: 8px; }
#app-screen .company-professional-form label { margin-bottom: 4px; color: #506a84; font-size: 9px; font-weight: 700; }
#app-screen .company-professional-form input { min-height: 34px; padding: 7px 9px; font-size: 10px; }
#app-screen .company-professional-card { padding: 12px; border-color: #e0eaf3; border-radius: 9px; background: linear-gradient(145deg, #fff, #f8fbfe); box-shadow: none; }
#app-screen .company-professional-card-header { align-items: center; margin-bottom: 10px; }
#app-screen .company-professional-card-header h4 { margin: 0 0 3px; color: #203f61; font-size: 12px; }
#app-screen .company-professional-card-header p { margin: 0; color: #71869a; font-size: 9px; }
#app-screen .company-professional-meta { gap: 6px; }
#app-screen .company-professional-meta div { padding: 8px; border-color: #e7eef5; border-radius: 7px; background: #f9fcff; }
#app-screen .company-professional-meta strong { color: #71869a; font-size: 8px; }
#app-screen .company-professional-meta span { color: #314e6c; font-size: 9px; }
#app-screen .company-professional-actions { gap: 6px; margin-top: 9px; }
#app-screen .company-professional-actions button { min-height: 31px; padding: 6px 9px; font-size: 9px; }
#app-screen .company-professional-editor { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e5edf4; }

#app-screen #stock > .stock-admin-card { padding: 0; overflow: hidden; }
#app-screen .stock-admin-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 19px; border-bottom: 1px solid #e7eef5; background: linear-gradient(115deg, #fff, #f3f9fe); }
#app-screen .stock-admin-header h2 { margin: 3px 0 4px; font-size: 20px; }
#app-screen .stock-admin-header p:not(.partner-dashboard-eyebrow) { margin: 0; color: #73879b; font-size: 10px; }
#app-screen .stock-admin-header .partner-dashboard-eyebrow { margin: 0; color: #1682c8; font-size: 9px; }
#app-screen .stock-admin-layout { grid-template-columns: minmax(260px, .78fr) minmax(0, 1.22fr); gap: 10px; padding: 12px; }
#app-screen .stock-form-panel,
#app-screen .stock-list-panel { min-width: 0; padding: 13px; border: 1px solid #e2ebf3; border-radius: 10px; background: #fff; box-shadow: none; }
#app-screen .stock-photo-preview-shell { border-color: #e3edf5; border-radius: 8px; background: #f7fafc; }
#app-screen .stock-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
#app-screen .stock-summary-card { padding: 10px; border: 1px solid #e3ebf2; border-radius: 8px; background: #f9fcff; box-shadow: none; }
#app-screen .stock-summary-card strong { color: #173b62; font-size: 18px; }
#app-screen .stock-summary-card span { color: #71869a; font-size: 9px; }
#app-screen .stock-items-list { gap: 8px; }
#app-screen .stock-item-card { gap: 10px; padding: 10px; border-color: #e0eaf3; border-radius: 9px; box-shadow: none; }
#app-screen .stock-item-photo-wrap { border-radius: 7px; background: #f3f8fc; }
#app-screen .stock-item-header h4 { color: #203f61; font-size: 11px; }
#app-screen .stock-item-header p,
#app-screen .stock-item-meta { color: #71869a; font-size: 9px; }
#app-screen .stock-item-actions { gap: 5px; }

/* Student simulator and real-case learning */
#app-screen:has(.user-header.student) { --sync-student-sidebar: #123654; }
#app-screen:has(.user-header.student) .tab-container { background: linear-gradient(180deg, #143b5d, #102d49); }
#app-screen:has(.user-header.student) .app-sidebar-brand { align-items: flex-start; flex-direction: column; gap: 4px; padding: 15px 12px 17px; }
#app-screen:has(.user-header.student) .app-sidebar-brand::after { content: "SIMULADOR CLÍNICO DE AUDIOLOGIA"; color: #b8c9d8; font-size: 8px; letter-spacing: .04em; }
#app-screen:has(.user-header.student) .app-sidebar-caption { display: none; }
#app-screen:has(.user-header.student) .tab-container > .tab[data-tab="student"]::first-letter { color: #fff; }
#app-screen:has(.user-header.student) .tab-container > .tab[data-tab="student"] span::after { content: ""; }
#app-screen:has(.user-header.student) .tab-container > .tab[data-tab="student"] { order: 1; }
#app-screen:has(.user-header.student) .tab-container > .tab[data-tab="student-cases"] { order: 2; }
#app-screen:has(.user-header.student) .student-area-hero { display: none; }
#app-screen:has(.user-header.student) .student-case-overview { display: grid; gap: 10px; }
#app-screen:has(.user-header.student) .student-case-overview-title { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid #dce8f3; border-radius: 12px; background: rgba(255,255,255,.92); }
#app-screen:has(.user-header.student) .student-case-overview-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 50%; color: #fff; background: #168ee2; font-size: 20px; }
#app-screen:has(.user-header.student) .student-case-overview-title p { margin: 0 0 4px; color: #61788e; font-size: 10px; }
#app-screen:has(.user-header.student) .student-case-overview-title h2 { margin: 0; color: #173451; font-size: 19px; }
#app-screen:has(.user-header.student) .student-case-overview-title small { color: #71869a; font-size: 10px; }
#app-screen:has(.user-header.student) .student-workflow-steps { display: flex; align-items: center; justify-content: space-around; gap: 4px; padding: 7px 10px; border: 1px solid #dce8f3; border-radius: 12px; background: rgba(255,255,255,.87); }
#app-screen:has(.user-header.student) .student-workflow-steps button { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; padding: 5px 9px; border: 0; border-radius: 18px; color: #536d86; background: transparent; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
#app-screen:has(.user-header.student) .student-workflow-steps button span { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; color: #536d86; background: #e7eff6; }
#app-screen:has(.user-header.student) .student-workflow-steps button.is-active { color: #0877c5; background: #edf7ff; }
#app-screen:has(.user-header.student) .student-workflow-steps button.is-active span { color: #fff; background: #168ee2; }
#app-screen:has(.user-header.student) .student-workflow-steps button:disabled { opacity: .55; cursor: not-allowed; }
#app-screen:has(.user-header.student) .student-workflow-steps > i { color: #b2c2d1; font-style: normal; }
#app-screen:has(.user-header.student) .student-simulator[hidden],
#app-screen:has(.user-header.student) .student-case-completion[hidden] { display: none !important; }
#app-screen:has(.user-header.student) .student-case-completion:not([hidden]) { margin-top: 0; }
#app-screen:has(.user-header.student) .student-area-hero { display: none; }
#app-screen:has(.user-header.student) .tab-content > .student-area-card { gap: 10px; }
#app-screen:has(.user-header.student) .student-simulator-header { min-height: 66px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator { display: grid; grid-template-columns: minmax(230px, .85fr) minmax(0, 2fr); gap: 10px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator > .student-simulator-header,
#app-screen:has(.user-header.student) #student-audiometry-simulator > .student-training-note { grid-column: 1 / -1; }
#app-screen:has(.user-header.student) #student-audiometry-simulator > .student-audiometer-layout { display: contents; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiometer-panel { grid-column: 1; grid-row: 2; color: #fff; background: linear-gradient(145deg, #173e62, #102e4a); border-color: #244e70; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-results-panel { grid-column: 2; grid-row: 2; margin: 0; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-card { min-height: 270px; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-card canvas { height: 215px !important; }
#app-screen:has(.user-header.student) .student-speech-simulator { display: grid; grid-template-columns: minmax(0, 1fr); }
#app-screen:has(.user-header.student) .student-srt-word-bank,
#app-screen:has(.user-header.student) .student-iprf-word-bank { background: #f8fbfe; }
#app-screen:has(.user-header.student) .student-case-completion { border-radius: 12px; }
@media (max-width: 1050px) {
  #app-screen:has(.user-header.student) #student-audiometry-simulator { grid-template-columns: minmax(210px, .75fr) minmax(0, 1.5fr); }
}
@media (max-width: 760px) {
  #app-screen:has(.user-header.student) .student-workflow-steps { justify-content: flex-start; overflow-x: auto; }
  #app-screen:has(.user-header.student) .student-workflow-steps > i { display: none; }
  #app-screen:has(.user-header.student) .student-workflow-steps button { flex: 0 0 auto; }
  #app-screen:has(.user-header.student) #student-audiometry-simulator { grid-template-columns: 1fr; }
  #app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiometer-panel,
  #app-screen:has(.user-header.student) #student-audiometry-simulator .student-results-panel { grid-column: 1; grid-row: auto; }
  #app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-grid { grid-template-columns: 1fr; }
}
#app-screen .tab-content > .student-area-card { display: grid; gap: 12px; padding: 0; overflow: hidden; }
#app-screen .student-area-hero { align-items: center; margin: 0; padding: 19px 21px; border: 1px solid #dce9f4; border-left: 4px solid #168fdf; border-radius: 11px; color: var(--sync-ink); background: linear-gradient(115deg, #fff, #eef7fd); }
#app-screen .student-area-eyebrow { margin-bottom: 5px; color: #1682c8; font-size: 9px; }
#app-screen .student-area-hero h2 { margin: 0 0 4px; color: var(--sync-ink); font-size: 21px; }
#app-screen .student-area-hero p { color: #61788e; font-size: 10px; }
#app-screen .student-area-badge { padding: 8px 11px; border: 1px solid #d2e7f6; border-radius: 8px; color: #176da8; background: #f4faff; font-size: 9px; }
#app-screen .student-selected-case { border-color: #c8e2f4; color: #176da8; background: #eaf6ff; }
#app-screen .student-simulator { gap: 11px; margin: 0; padding: 0 12px; }
#app-screen .student-simulator-header { align-items: center; padding: 12px 14px; border-color: #e0eaf3; border-radius: 9px; background: #fff; box-shadow: none; }
#app-screen .student-simulator-header h3 { margin: 0 0 3px; color: #203f61; font-size: 15px; }
#app-screen .student-simulator-header p { color: #71869a; font-size: 10px; }
#app-screen .student-area-eyebrow-dark { color: #71869a; }
#app-screen .student-audiometer-panel { padding: 13px; border-color: #d9e6f0; border-radius: 11px; background: linear-gradient(145deg, #eef4f9, #f9fbfd); box-shadow: 0 4px 12px rgba(31, 67, 102, .05); }
#app-screen .student-audiometer-display { min-height: 75px; margin-bottom: 11px; padding: 10px 13px; border-width: 3px; border-radius: 9px; }
#app-screen .student-audiometer-display span,
#app-screen .student-audiometer-display strong { font-size: 15px; }
#app-screen .student-patient-response-signal { width: 72px; height: 26px; border-width: 2px; }
#app-screen .student-primary-controls { grid-template-columns: minmax(125px, .62fr) minmax(195px, .95fr) minmax(275px, 1.3fr); gap: 8px; margin-top: 9px; }
#app-screen .student-primary-controls .student-control-block { padding: 10px; border-color: #dce7f0; border-radius: 8px; background: #fff; }
#app-screen .student-control-block { margin-top: 10px; }
#app-screen .student-control-block label { margin-bottom: 6px; color: #526b83; font-size: 8px; letter-spacing: .07em; }
#app-screen .student-toggle-group,
#app-screen .student-frequency-grid { gap: 5px; }
#app-screen .student-toggle-group button,
#app-screen .student-frequency-grid button,
#app-screen .student-intensity-control button { min-height: 31px; padding: 7px 10px; border: 1px solid #dce7f0; border-radius: 7px; color: #405d78; background: #f2f7fb; font-size: 10px; }
#app-screen .student-toggle-group button.is-active,
#app-screen .student-frequency-grid button.is-active { border-color: #168fdf; color: #fff; background: #168fdf; box-shadow: 0 3px 8px rgba(22, 143, 223, .15); }
#app-screen .student-intensity-control { grid-template-columns: auto minmax(160px, 1fr); gap: 10px; }
#app-screen .student-intensity-step-grid { grid-template-columns: repeat(2, minmax(48px, auto)); gap: 5px; }
#app-screen .student-intensity-step-grid button { min-width: 52px; }
#app-screen .student-main-actions { gap: 6px; margin-top: 11px; }
#app-screen .student-main-actions button { min-height: 36px; padding: 8px 12px; border-radius: 7px; box-shadow: none; font-size: 10px; }
#app-screen .student-present-btn { color: #503f08; background: #f1c84b; }
#app-screen .student-mark-btn { color: #fff; background: #20a365; }
#app-screen .student-results-panel { padding: 13px; border-color: #e0eaf3; border-radius: 10px; box-shadow: none; }
#app-screen .student-results-panel h4 { margin-bottom: 3px; font-size: 13px; }
#app-screen .student-results-panel p { color: #71869a; font-size: 10px; }
#app-screen .student-audiogram-chart-grid { gap: 9px; }
#app-screen .student-audiogram-chart-card { min-height: 300px; padding: 11px; border-color: #e0eaf3; border-radius: 9px; box-shadow: none; }
#app-screen .student-audiogram-chart-heading { gap: 7px; }
#app-screen .student-audiogram-chart-heading span { width: 27px; height: 27px; border-radius: 7px; }
#app-screen .student-audiogram-chart-heading strong { font-size: 11px; }
#app-screen .student-audiogram-chart-card canvas { height: 245px !important; }
#app-screen .student-training-note { padding: 10px 12px; border-radius: 8px; font-size: 9px; }
#app-screen .student-speech-simulator,
#app-screen .student-audiometric-result-section { margin-top: 2px; padding-top: 12px; border-top: 1px solid #e3ebf3; }
#app-screen .student-word-bank { gap: 11px; padding: 13px; border-color: #e0eaf3; border-radius: 10px; background: #fff; box-shadow: 0 4px 12px rgba(31, 67, 102, .04); }
#app-screen .student-word-bank-header h4 { margin-bottom: 3px; font-size: 14px; }
#app-screen .student-word-bank-header > div > p:last-child { color: #71869a; font-size: 10px; }
#app-screen .student-srt-presenter,
#app-screen .student-iprf-console { padding: 13px; border: 1px solid #dce8f2; border-radius: 9px; color: #294762; background: #f2f8fc; }
#app-screen .student-srt-presenter span,
#app-screen .student-srt-presenter small,
#app-screen .student-iprf-toolbar > div > span,
#app-screen .student-iprf-score > span { color: #637a90; }
#app-screen .student-srt-live-metrics span,
#app-screen .student-iprf-ear-data { border-color: #dce8f2; color: #294762; background: #fff; }
#app-screen .student-srt-live-metrics strong,
#app-screen #student-srt-current-word,
#app-screen .student-iprf-presentation strong,
#app-screen .student-iprf-score strong { color: #203f61; }
#app-screen .student-srt-ear-controls button,
#app-screen .student-iprf-console .student-toggle-group button { border-color: #dce7f0; color: #405d78; background: #f2f7fb; }
#app-screen .student-srt-ear-controls button.is-active,
#app-screen .student-iprf-console .student-toggle-group button.is-active { border-color: #168fdf; color: #fff; background: #168fdf; }
#app-screen .student-word-bank-actions button,
#app-screen .student-iprf-apply { min-height: 34px; padding: 7px 11px; border-radius: 7px; background: #1687d2; font-size: 10px; }
#app-screen .student-word-bank-actions button.is-secondary { border: 1px solid #d6e5f1; color: #365873; background: #f4f8fb; }
#app-screen .student-iprf-toolbar { border-top-color: #dce8f2; }
#app-screen .student-iprf-score small { color: #71869a; }
#app-screen .student-iprf-rule-status { border-color: #dce8f2; color: #526d87; background: #fff; }
#app-screen .student-srt-word-grid button { border-color: #e0eaf3; border-radius: 8px; }
#app-screen .student-tymp-chart-card,
#app-screen .student-tymp-answer-card,
#app-screen .student-result-note-card,
#app-screen .student-result-ear,
#app-screen .student-case-progress { border-color: #e0eaf3; border-radius: 9px; box-shadow: none; }
#app-screen .student-tymp-metrics { border-radius: 8px; background: #f0f7fc; }
#app-screen .student-audiometric-result-grid { border-color: #e0eaf3; border-radius: 9px; background: #f9fcff; }
#app-screen .student-result-group + .student-result-group { border-left-width: 1px; border-left-color: #dce8f2; }
#app-screen .student-result-group legend { color: #526b83; font-size: 9px; }
#app-screen .student-result-option { min-height: 36px; padding: 7px 9px; border-color: #e0eaf3; border-radius: 7px; box-shadow: none; }
#app-screen .student-result-option-text { font-size: 10px; }
#app-screen .student-result-comment label { color: #526b83; font-size: 9px; }
#app-screen .student-case-completion { gap: 12px; margin-top: 0; padding: 14px; border-color: #dce8f2; border-radius: 10px; background: linear-gradient(140deg, #fff, #f1f8fd); box-shadow: none; }
#app-screen .student-case-completion-header h3 { font-size: 17px; }
#app-screen .student-case-completion-header p:last-child { color: #71869a; font-size: 10px; }
#app-screen .student-case-completion button { min-height: 35px; padding: 8px 12px; border-radius: 7px; background: #1687d2; box-shadow: none; font-size: 10px; }
#app-screen .student-case-progress { gap: 4px; padding: 10px; }
#app-screen .student-case-progress span { color: #71869a; font-size: 8px; }
#app-screen .student-case-progress strong { color: #203f61; font-size: 17px; }
#app-screen .student-case-performance { padding: 13px; border: 1px solid #dce8f2; border-radius: 9px; color: #294762; background: #f2f8fc; }
#app-screen .student-case-performance-score span,
#app-screen .student-case-performance-score small,
#app-screen .student-case-performance-breakdown span,
#app-screen .student-case-performance-breakdown small { color: #637a90; }
#app-screen .student-case-performance-score strong { color: #16805f; font-size: 32px; }
#app-screen .student-case-performance-breakdown > div { border-color: #dce8f2; border-radius: 7px; background: #fff; }
#app-screen .student-case-performance-breakdown strong { color: #203f61; }
#app-screen .student-case-history h4 { font-size: 12px; }
#app-screen .student-real-cases-toolbar { gap: 6px; margin: 0 12px; }
#app-screen .student-real-cases-toolbar input { min-height: 36px; padding: 7px 10px; border-radius: 7px; }
#app-screen .student-real-cases-toolbar button { min-height: 36px; padding: 7px 11px; border: 1px solid #d6e5f1; border-radius: 7px; color: #365873; background: #f4f8fb; font-size: 10px; }
#app-screen #student-real-cases-buy-more { border: 0; color: #fff; background: #1687d2; }
#app-screen .student-real-cases-grid { gap: 9px; padding: 0 12px 12px; }
#app-screen .student-real-case-card { gap: 7px; padding: 12px; border-color: #e0eaf3; border-radius: 9px; box-shadow: 0 4px 12px rgba(31, 67, 102, .04); }
#app-screen .student-real-case-tag { padding: 4px 7px; border: 1px solid #dbeaf5; border-radius: 6px; color: #176da8; background: #f2f8fd; font-size: 8px; }
#app-screen .student-real-case-card h3 { font-size: 13px; }
#app-screen .student-real-case-card p { color: #71869a; font-size: 10px; }
#app-screen .student-real-case-card button { min-height: 34px; padding: 7px 10px; border-radius: 7px; background: #1687d2; font-size: 10px; }
#app-screen .student-placeholder-section { margin: 0 12px 12px; border-color: #e0eaf3; border-radius: 9px; }

/* Keep the real-case catalog informative and populated in the student workspace. */
#app-screen #student-cases .student-real-cases-hero { display: flex; min-height: 96px; margin: 12px 12px 0; padding: 16px 18px; }
#app-screen #student-cases .student-real-cases-hero > div:first-child { display: grid; gap: 4px; }
#app-screen #student-cases .student-real-cases-hero .student-area-eyebrow { margin: 0; color: #1682c8; }
#app-screen #student-cases .student-real-cases-hero h2 { margin: 0; color: #173451; font-size: 19px; }
#app-screen #student-cases .student-real-cases-hero p { margin: 0; color: #61788e; font-size: 11px; }
#app-screen #student-cases .student-real-cases-hero .student-area-badge { flex: 0 0 auto; }
#app-screen #student-cases .student-real-cases-toolbar { align-items: center; margin: 0 12px; }
#app-screen #student-cases .student-real-cases-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); align-items: stretch; }
#app-screen #student-cases .student-real-case-card { min-width: 0; min-height: 155px; align-content: start; }
#app-screen #student-cases .student-real-case-card button { align-self: end; margin-top: auto; }
#app-screen #student-cases .student-real-cases-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 8px; padding: 40px 20px; border: 1px dashed #cdddea; border-radius: 12px; color: #526d87; background: #f8fbfe; text-align: center; }
#app-screen #student-cases .student-real-cases-empty > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; color: #1687d2; background: #e8f5fe; font-size: 22px; }
#app-screen #student-cases .student-real-cases-empty h3 { margin: 0; color: #173451; font-size: 15px; }
#app-screen #student-cases .student-real-cases-empty p { max-width: 520px; margin: 0; font-size: 11px; line-height: 1.6; }
#app-screen #student-cases .student-real-cases-empty button { min-height: 36px; margin-top: 4px; padding: 8px 13px; border: 0; border-radius: 7px; color: #fff; background: #1687d2; font-size: 10px; font-weight: 700; cursor: pointer; }

@media (max-width: 900px) {
  #app-screen .company-dashboard-grid,
  #app-screen .stock-admin-layout { grid-template-columns: 1fr; }
  #app-screen .student-primary-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app-screen .student-control-masking { grid-column: 1 / -1; }
  #app-screen .student-srt-presenter,
  #app-screen .student-case-performance { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  #app-screen .company-dashboard-grid > div { padding: 11px; }
  #app-screen .stock-admin-header { align-items: flex-start; flex-direction: column; padding: 13px; }
  #app-screen .stock-admin-layout { padding: 8px; }
  #app-screen .stock-form-panel,
  #app-screen .stock-list-panel { padding: 10px; }
  #app-screen .student-area-card { gap: 9px; }
  #app-screen .student-area-hero { align-items: flex-start; padding: 13px; }
  #app-screen .student-area-hero h2 { font-size: 17px; }
  #app-screen .student-simulator { padding: 0 8px; }
  #app-screen .student-audiometer-panel { padding: 9px; }
  #app-screen .student-audiometer-display { grid-template-columns: auto auto 1fr auto; gap: 6px; padding: 8px; }
  #app-screen .student-audiometer-display span,
  #app-screen .student-audiometer-display strong { font-size: 11px; }
  #app-screen .student-primary-controls { grid-template-columns: 1fr; }
  #app-screen .student-control-masking { grid-column: auto; }
  #app-screen .student-intensity-control { grid-template-columns: 1fr; }
  #app-screen .student-intensity-step-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #app-screen .student-intensity-step-grid button { min-width: 0; }
  #app-screen .student-main-actions { display: grid; grid-template-columns: 1fr 1fr; }
  #app-screen .student-main-actions button:first-child { grid-column: 1 / -1; }
  #app-screen .student-audiogram-chart-card { min-height: 260px; }
  #app-screen .student-audiogram-chart-card canvas { height: 210px !important; }
  #app-screen .student-iprf-ear-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app-screen .student-audiometric-result-grid { grid-template-columns: 1fr; gap: 10px; padding: 10px; }
  #app-screen .student-result-group,
  #app-screen .student-result-group:first-child,
  #app-screen .student-result-group:last-child { padding: 0; }
  #app-screen .student-result-group + .student-result-group { padding-top: 9px; border-top: 1px solid #dce8f2; border-left: 0; }
  #app-screen .student-real-cases-toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  #app-screen .student-real-cases-toolbar input { grid-column: 1 / -1; min-width: 0; }
  #app-screen .student-real-cases-toolbar button { padding: 7px; }
  #app-screen .student-real-cases-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  #app-screen #student-cases .student-real-cases-hero { align-items: flex-start; flex-direction: column; margin: 8px 8px 0; }
  #app-screen #student-cases .student-real-cases-toolbar { margin: 0 8px; }
  #app-screen #student-cases .student-real-cases-grid { grid-template-columns: 1fr; padding-right: 8px; padding-left: 8px; }
}

/* Clinical results and partner registration */
#app-screen #results > .card { max-width: 1240px; margin: 0 auto; padding: 20px; }
#app-screen .results-section { margin: 12px 0; padding: 14px; border: 1px solid #e0eaf3; border-radius: 10px; background: #fff; box-shadow: 0 4px 13px rgba(31, 67, 102, .035); }
#app-screen .results-section > h3 { margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid #e8eff5; color: #294866; font-size: 13px; }
#app-screen .audiograms-container,
#app-screen .impedance-charts-results { gap: 9px; }
#app-screen .audiogram-box,
#app-screen .impedance-chart-box { min-width: 0; padding: 10px; border: 1px solid #e2ebf3; border-radius: 8px; background: #fbfdff; box-shadow: none; }
#app-screen .audiogram-container,
#app-screen .impedance-chart-container { min-width: 0; }
#app-screen .audiogram-legend { gap: 5px 11px; padding: 9px 2px 0; }
#app-screen .audiogram-legend .legend-item { color: #526b83; font-size: 9px; }
#app-screen .logoaudiometry-results { margin: 0; padding: 0; border-radius: 0; background: transparent; box-shadow: none; }
#app-screen .logoaudiometry-results-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 0; }
#app-screen .logoaudiometry-result-card { padding: 12px; border: 1px solid #e2ebf3; border-radius: 8px; background: linear-gradient(145deg, #fff, #f8fbfe); box-shadow: none; }
#app-screen .logoaudiometry-result-card h4 { margin: 0 0 8px; color: #294866 !important; font-size: 10px; }
#app-screen .logoaudiometry-result-item { gap: 8px; padding: 6px 0; border-bottom: 1px solid #edf2f6; }
#app-screen .logoaudiometry-result-label { color: #71869a; font-size: 9px; }
#app-screen .logoaudiometry-result-value { color: #203f61; font-size: 12px; font-weight: 800; }
#app-screen .audiometric-result-structured { gap: 8px; }
#app-screen .audiometric-result-group { padding: 11px; border: 1px solid #e2ebf3; border-radius: 8px; background: #fbfdff; }
#app-screen .audiometric-result-group h4,
#app-screen .audiometric-result-group label[for] { color: #526b83; font-size: 9px; }
#app-screen .audiometric-check-option { padding: 7px 9px; border-color: #e2ebf3; border-radius: 7px; background: #fff; box-shadow: none; font-size: 10px; }
#app-screen .audiometric-check-option:has(input:checked) { border-color: #8cc5e9; background: #f0f8fe; }
#app-screen .professional-observations-box { margin-top: 9px; padding: 12px; border-color: #e2ebf3; border-radius: 8px; background: #fbfdff; }
#app-screen .professional-observations-box label { color: #526b83; font-size: 10px; }
#app-screen .professional-observations-box textarea { min-height: 110px; border-color: #d7e4ef; border-radius: 7px; background: #fff; }
#app-screen .pdf-brand-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; padding: 12px; border: 1px solid #dfeaf3; border-radius: 9px; background: #f8fbfe; }
#app-screen .pdf-brand-copy { display: grid; gap: 3px; }
#app-screen .pdf-brand-copy strong { color: #294866; font-size: 11px; }
#app-screen .pdf-brand-copy span { color: #71869a; font-size: 9px; }
#app-screen .pdf-brand-upload,
#app-screen .pdf-brand-preview button { min-height: 31px; padding: 7px 10px; border: 1px solid #d6e5f1; border-radius: 7px; color: #176da8; background: #fff; font-size: 9px; font-weight: 800; cursor: pointer; }
#app-screen #partners > .card { max-width: 900px; margin: 0 auto; padding: 20px; }
#app-screen #partners .form-group label { color: #506a84; font-size: 10px; }
#app-screen #partners .form-group input,
#app-screen #partners .form-group select { min-height: 37px; padding: 8px 10px; font-size: 11px; }
#app-screen #partners .two-columns { gap: 10px; }
#app-screen #partners .action-buttons { justify-content: flex-end; }

/* Account profile dialog */
#app-screen .profile-modal-card { border: 1px solid #dce8f2; border-radius: 14px; box-shadow: 0 24px 70px rgba(18, 45, 73, .25); }
#app-screen .profile-modal-header { border-bottom-color: #e6edf4; }
#app-screen .profile-modal-header h2 { color: var(--sync-ink); }
#app-screen .profile-summary { border-color: #e1eaf2; border-radius: 9px; background: #f6faff; }
#app-screen .profile-field label { color: #526b83; font-size: 9px; }
#app-screen .profile-field input,
#app-screen .profile-field select,
#app-screen .profile-field textarea,
#app-screen .profile-field div { border-color: #d7e4ef; border-radius: 7px; color: #263f5c; background: #fbfdff; }
#app-screen .profile-save-btn { border: 0; border-radius: 7px; color: #fff; background: #1687d2; }

@media (max-width: 900px) {
  #app-screen .logoaudiometry-results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app-screen .audiometric-result-structured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  #app-screen #results > .card,
  #app-screen #partners > .card { padding: 12px; }
  #app-screen .results-section { padding: 10px; }
  #app-screen .audiograms-container,
  #app-screen .impedance-charts-results,
  #app-screen .logoaudiometry-results-grid,
  #app-screen .audiometric-result-structured { grid-template-columns: 1fr; }
  #app-screen .pdf-brand-control { align-items: flex-start; flex-direction: column; }
  #app-screen #partners .two-columns { grid-template-columns: 1fr; }
}

/* AI/SIA workspace */
#app-screen #ai-analysis > .ai-analysis-card { gap: 12px; padding: 0; }
#app-screen .ai-analysis-hero { align-items: center; gap: 14px; padding: 16px; border-color: #dce9f4; border-left: 4px solid #168fdf; border-radius: 10px; background: linear-gradient(115deg, #fff, #f1f8fe); }
#app-screen .ai-analysis-eyebrow { margin-bottom: 4px; color: #1682c8; font-size: 9px; }
#app-screen .ai-analysis-hero h2 { margin: 2px 0 4px; color: var(--sync-ink); font-size: 20px; }
#app-screen .ai-analysis-subtitle { color: #647b92; font-size: 10px; }
#app-screen .ai-analysis-actions { gap: 6px; }
#app-screen .ai-analysis-actions button,
#app-screen .ai-chat-header > button { min-height: 33px; padding: 7px 10px; font-size: 9px; }
#app-screen .ai-analysis-status-chip { padding: 6px 9px; border: 1px solid #dce8f2; border-radius: 7px; font-size: 9px; }
#app-screen .ai-analysis-meta { gap: 7px; }
#app-screen .ai-analysis-meta-card { padding: 10px; border-color: #e0eaf3; border-radius: 8px; }
#app-screen .ai-analysis-meta-card span { margin-bottom: 3px; color: #71869a; font-size: 8px; }
#app-screen .ai-analysis-meta-card strong { color: #203f61; font-size: 11px; }
#app-screen .ai-analysis-content { gap: 8px; }
#app-screen .ai-analysis-empty { padding: 14px; border-color: #cfe3f2; border-radius: 8px; background: #f8fbfe; }
#app-screen .ai-analysis-empty h3 { margin: 0 0 4px; font-size: 12px; }
#app-screen .ai-analysis-empty p { color: #71869a; font-size: 10px; }
#app-screen .ai-analysis-grid { gap: 8px; }
#app-screen .ai-analysis-section { padding: 12px; border-color: #e0eaf3; border-radius: 8px; }
#app-screen .ai-analysis-section h3 { margin-bottom: 7px; color: #294866; font-size: 12px; }
#app-screen .ai-analysis-section p,
#app-screen .ai-analysis-section li { color: #526b83; font-size: 10px; line-height: 1.55; }
#app-screen .ai-analysis-summary,
#app-screen .ai-analysis-disclaimer { background: #f7fbfe; }
#app-screen .ai-chat-card { gap: 10px; padding: 12px; border-color: #dce8f2; border-radius: 9px; background: #fff; }
#app-screen .ai-chat-header { align-items: center; }
#app-screen .ai-chat-header h3 { margin: 2px 0 3px; color: #203f61; font-size: 13px; }
#app-screen .ai-chat-header p { color: #71869a; font-size: 10px; }
#app-screen .ai-chat-messages { gap: 8px; max-height: 340px; padding: 10px; border-color: #e0eaf3; border-radius: 8px; background: #f7fafc; }
#app-screen .ai-chat-empty { padding: 11px; border-color: #cfe3f2; border-radius: 7px; color: #71869a; font-size: 10px; }
#app-screen .ai-chat-empty strong { color: #294866; }
#app-screen .ai-chat-message { padding: 9px 11px; border-color: #dce8f2; border-radius: 9px; box-shadow: none; font-size: 10px; }
#app-screen .ai-chat-message.user { border-color: #c7e1f3; background: #eef7fd; }
#app-screen .ai-chat-message-label { margin-bottom: 3px; color: #1682c8; font-size: 8px; }
#app-screen .ai-chat-message-content { color: #405a74; font-size: 10px; }
#app-screen .ai-chat-form { gap: 7px; }
#app-screen .ai-chat-form textarea { min-height: 62px; padding: 9px; border-color: #d7e4ef; border-radius: 7px; font-size: 10px; }
#app-screen .ai-chat-form button { min-height: 35px; padding: 7px 12px; font-size: 10px; }

/* PAC modal and protocol screens */
#app-screen .tests-hub-card { max-width: 1180px; margin: 0 auto; }
#app-screen .tests-modal-backdrop { background: rgba(12, 34, 57, .58); }
#app-screen .tests-modal-card { border: 1px solid #d9e6f0; border-radius: 13px; box-shadow: 0 24px 70px rgba(18, 45, 73, .26); }
#app-screen .tests-modal-header { align-items: center; padding: 14px 17px; border-bottom-color: #e0eaf3; background: linear-gradient(115deg, #fff, #f1f8fe); }
#app-screen .tests-modal-eyebrow { margin-bottom: 3px; color: #1682c8; font-size: 8px; }
#app-screen .tests-modal-header h2 { color: #203f61; font-size: 18px; }
#app-screen .tests-modal-close { width: 33px; height: 33px; border-color: #d9e6f0; border-radius: 7px; color: #365873; font-size: 21px; }
#app-screen .tests-modal-body { padding: 15px; }
#app-screen .tests-protocol-shell { gap: 9px; }
#app-screen .tests-protocol-banner { padding: 13px 15px; border-color: #dce9f4; border-radius: 9px; background: linear-gradient(115deg, #fff, #f2f8fd); }
#app-screen .tests-protocol-banner.compact { padding: 10px 12px; }
#app-screen .tests-protocol-eyebrow { margin-bottom: 4px; color: #1682c8; font-size: 8px; }
#app-screen .tests-protocol-banner h2 { margin: 3px 0 5px; color: #203f61; font-size: 20px; }
#app-screen .tests-protocol-banner h3 { color: #526b83; font-size: 10px; }
#app-screen .tests-protocol-banner p { color: #71869a; font-size: 10px; }
#app-screen .tests-meta-grid,
#app-screen .tests-intensity-grid,
#app-screen .tests-parameter-grid,
#app-screen .tests-list-grid { gap: 8px; }
#app-screen .tests-protocol-table { border-collapse: separate; border-spacing: 0; border: 1px solid #e0eaf3; border-radius: 8px; overflow: hidden; }
#app-screen .tests-protocol-table th,
#app-screen .tests-protocol-table td { padding: 7px 9px; border-color: #e7eef4; color: #405a74; font-size: 9px; }
#app-screen .tests-protocol-table th { color: #526b83; background: #f3f8fc; }
#app-screen .tests-protocol-shell textarea { border-color: #d7e4ef; border-radius: 7px; font-size: 10px; }
#app-screen .tests-protocol-actions { gap: 9px; padding: 10px; border-color: #e0eaf3; border-radius: 8px; background: #f8fbfe; }
#app-screen .tests-protocol-actions-main { gap: 6px; }
#app-screen .tests-protocol-actions-main button { min-height: 33px; padding: 7px 10px; border-radius: 7px; font-size: 9px; }
#app-screen .tests-protocol-save-status { min-height: 18px; color: #71869a; font-size: 9px; }
#app-screen .tests-pdf-export { color: #263f5c; }

/* Admin commissions and legacy partner-registration view */
#app-screen #commissions > .card,
#app-screen #partner-registration > .card { max-width: 1180px; margin: 0 auto; padding: 17px; border: 1px solid #e0eaf3; border-radius: 12px; background: rgba(255,255,255,.93); box-shadow: 0 8px 26px rgba(32, 66, 99, .055); }
#app-screen .commissions-header { gap: 10px; margin-bottom: 12px; padding: 12px; border: 1px solid #dce9f4; border-left: 4px solid #168fdf; border-radius: 9px; background: linear-gradient(115deg, #fff, #f1f8fe); }
#app-screen .commissions-header h2 { margin: 0; color: #203f61; font-size: 19px; }
#app-screen .commissions-header .header-actions { gap: 6px; }
#app-screen .commissions-header .header-actions button { min-height: 32px; padding: 6px 9px; font-size: 9px; }
#app-screen .commissions-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
#app-screen .commissions-stats .stat-card { min-width: 0; min-height: 78px; padding: 10px; border: 1px solid #e0eaf3; border-left: 3px solid #168fdf; border-radius: 8px; box-shadow: none; }
#app-screen .commissions-stats .stat-card h3 { color: #60768b; font-size: 8px; }
#app-screen .commissions-stats .stat-number { margin: 2px 0; color: #173b62; font-size: 19px; }
#app-screen .commissions-stats .stat-card p { margin: 0; color: #71869a; font-size: 8px; }
#app-screen .commissions-main { gap: 9px; margin: 0; }
#app-screen .commission-form-section,
#app-screen .partners-list-section { min-width: 0; padding: 12px; border: 1px solid #e0eaf3; border-radius: 9px; background: #fff; box-shadow: none; }
#app-screen .commission-form-section h3,
#app-screen .partners-list-section h3 { margin: 0 0 8px; color: #294866; font-size: 12px; }
#app-screen .commission-form-section .form-card { margin-top: 8px; }
#app-screen .commission-form-section .form-group { margin-bottom: 9px; }
#app-screen .commission-form-section .form-group label { color: #526b83; font-size: 9px; }
#app-screen .commission-form-section input,
#app-screen .commission-form-section select { min-height: 34px; padding: 7px 9px; font-size: 10px; }
#app-screen .partner-card { gap: 10px; padding: 10px; border-color: #e0eaf3; border-radius: 8px; background: #fbfdff; box-shadow: none; }
#app-screen .partner-avatar { width: 32px; height: 32px; background: #168fdf; font-size: 13px; }
#app-screen .partner-name { color: #294866; font-size: 10px; }
#app-screen .partner-email { color: #71869a; font-size: 9px; }
#app-screen .partner-stats { gap: 8px; }
#app-screen .stat-label { color: #71869a; font-size: 7px; }
#app-screen .stat-value { color: #203f61; font-size: 9px; }
#app-screen #partner-registration .two-columns { gap: 9px; }
#app-screen #partner-registration .form-group label { color: #526b83; font-size: 9px; }
#app-screen #partner-registration .form-group input,
#app-screen #partner-registration .form-group select,
#app-screen #partner-registration .form-group textarea { min-height: 34px; padding: 7px 9px; font-size: 10px; }

/* Login and registration use the same SYNC visual system */
#auth-screen { padding: 18px; font-family: "Manrope", "Segoe UI", sans-serif; background: radial-gradient(ellipse at 82% 2%, rgba(113, 190, 245, .16), transparent 30%), linear-gradient(135deg, #eaf3fb, #f6f9fc 47%, #e9f3fb); }
#auth-screen .auth-shell { width: min(1320px, 100%); min-height: calc(100vh - 36px); grid-template-columns: minmax(350px, 410px) minmax(0, 1fr); border: 1px solid #dce8f2; border-radius: 17px; background: #fff; box-shadow: 0 18px 48px rgba(24, 53, 83, .13); }
#auth-screen .auth-side-panel { gap: 18px; padding: 26px 25px; background: #f8fbfe; border-right-color: #e0eaf3; }
#auth-screen .auth-side-header h1 { color: #173b62; font-size: 29px; letter-spacing: -.04em; }
#auth-screen .auth-side-header p { color: #637a90; font-size: 11px; }
#auth-screen .auth-kicker,
#auth-screen .auth-brand-label { border-radius: 6px; color: #176da8; background: #eaf5fd; font-size: 8px; }
#auth-screen .auth-container { padding: 18px; border-color: #e0eaf3; border-radius: 10px; box-shadow: 0 4px 14px rgba(31, 67, 102, .04); }
#auth-screen .auth-brand-lockup { gap: 10px; margin-bottom: 13px; }
#auth-screen .auth-brand-lockup img { width: 76px; }
#auth-screen .auth-brand-lockup h2 { margin-top: 3px; color: #173b62; font-size: 20px; }
#auth-screen .auth-form .form-group { margin-bottom: 11px; }
#auth-screen .auth-form label { margin-bottom: 5px; color: #526b83; font-size: 10px; }
#auth-screen .auth-form input,
#auth-screen .auth-form select { min-height: 36px; padding: 8px 10px; border-color: #d7e4ef; border-radius: 7px; background: #fbfdff; color: #263f5c; font-size: 11px; }
#auth-screen .auth-form input:focus,
#auth-screen .auth-form select:focus { border-color: #69b5eb; box-shadow: 0 0 0 3px rgba(22, 143, 223, .12); }
#auth-screen .auth-form button { min-height: 37px; padding: 8px 12px; border-radius: 7px; background: linear-gradient(110deg, #168fdf, #0876c9); box-shadow: 0 4px 10px rgba(18, 124, 195, .15); font-size: 11px; }
#auth-screen .auth-form button:hover { background: linear-gradient(110deg, #087fc9, #0868b1); box-shadow: 0 6px 12px rgba(18, 124, 195, .18); }
#auth-screen .auth-switch { margin-top: 11px; color: #71869a; font-size: 10px; }
#auth-screen .auth-switch a,
#auth-screen .auth-inline-link { color: #0876c9; font-size: 10px; }
#auth-screen .error-message { margin-top: 9px; font-size: 10px; }
#auth-screen .auth-showcase-panel { background: #edf5fb; }
#auth-screen .auth-showcase-image { object-position: center; }

@media (max-width: 1120px) {
  #auth-screen .auth-shell { grid-template-columns: 1fr; }
  #auth-screen .auth-side-panel { border-right: 0; }
  #auth-screen .auth-showcase-panel { display: none; }
}
@media (max-width: 640px) {
  #auth-screen { padding: 9px; }
  #auth-screen .auth-shell { min-height: auto; border-radius: 12px; }
  #auth-screen .auth-side-panel { gap: 12px; padding: 16px 12px; }
  #auth-screen .auth-side-header h1 { font-size: 24px; }
  #auth-screen .auth-container { padding: 13px; }
}

@media (max-width: 900px) {
  #app-screen .ai-analysis-hero,
  #app-screen .ai-chat-header { align-items: flex-start; flex-direction: column; }
  #app-screen .commissions-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app-screen .commissions-header { align-items: flex-start; flex-direction: column; }
  #app-screen .commissions-main { grid-template-columns: 1fr; }
  #app-screen .tests-modal-card { width: calc(100vw - 24px); max-height: calc(100vh - 24px); margin: 12px auto; }
}
@media (max-width: 680px) {
  #app-screen .ai-chat-form { grid-template-columns: 1fr; }
  #app-screen .ai-chat-form button { justify-self: end; }
  #app-screen .tests-modal-body { padding: 9px; }
  #app-screen .tests-modal-header { padding: 10px; }
  #app-screen .commissions-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app-screen #commissions > .card,
  #app-screen #partner-registration > .card { padding: 10px; }
  #app-screen #partner-registration .two-columns { grid-template-columns: 1fr; }
}

/* PAC catalog: compact protocol tiles and category filters from the reference. */
#app-screen #tests .tests-hub-card {
  max-width: 1180px;
  padding: 16px 15px 18px;
  border: 1px solid #e0eaf3;
  border-radius: 13px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 7px 22px rgba(32, 66, 99, .045);
}
#app-screen #tests .tests-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
#app-screen #tests .tests-hub-header h2 {
  margin: 0 0 3px;
  color: #173b62;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.025em;
  text-transform: none;
}
#app-screen #tests .tests-hub-header p {
  margin: 0;
  color: #6c8095;
  font-size: 10px;
}
#app-screen #tests .tests-catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}
#app-screen #tests .tests-catalog-filters {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  padding: 1px 0 4px;
  scrollbar-width: thin;
}
#app-screen #tests .tests-catalog-filter {
  min-height: 27px;
  flex: 0 0 auto;
  padding: 5px 11px;
  border: 1px solid #e1eaf3;
  border-radius: 999px;
  color: #526a82;
  background: #f5f9fd;
  box-shadow: none;
  font: inherit;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
#app-screen #tests .tests-catalog-filter:hover {
  transform: none;
  border-color: #b9d9f1;
  color: #126eae;
  background: #edf7ff;
}
#app-screen #tests .tests-catalog-filter.is-active {
  border-color: #168fdf;
  color: #fff;
  background: linear-gradient(110deg, #168fdf, #0876c9);
  box-shadow: 0 2px 6px rgba(18, 124, 195, .16);
}
#app-screen #tests .tests-catalog-status {
  display: inline-flex;
  min-height: 29px;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid #d6eafb;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(110deg, #168fdf, #0876c9);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
#app-screen #tests .tests-catalog-status span { font-size: 13px; line-height: 1; }
#app-screen #tests .tests-catalog-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}
#app-screen #tests .tests-protocol-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 88px;
  grid-template-rows: auto auto 1fr;
  gap: 5px;
  padding: 9px 10px 18px;
  border: 1px solid #e0eaf3;
  border-radius: 9px;
  color: #183657;
  background: linear-gradient(145deg, #fff, #f4f9fe);
  box-shadow: 0 3px 10px rgba(31, 67, 102, .045);
  text-align: left;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
#app-screen #tests .tests-protocol-card:hover {
  transform: translateY(-2px);
  border-color: #acd4f1;
  box-shadow: 0 7px 15px rgba(28, 91, 142, .10);
}
#app-screen #tests .tests-protocol-card:focus-visible,
#app-screen #tests .tests-catalog-filter:focus-visible {
  outline: 3px solid rgba(22, 143, 223, .3);
  outline-offset: 2px;
}
#app-screen #tests .tests-protocol-card[hidden] { display: none !important; }
#app-screen #tests .tests-protocol-card-order {
  color: #1769bd;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
#app-screen #tests .tests-protocol-card strong {
  display: -webkit-box;
  overflow: hidden;
  color: #142d4e;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
#app-screen #tests .tests-protocol-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #637991;
  font-size: 8px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
#app-screen #tests .tests-protocol-card-action {
  position: absolute;
  right: 9px;
  bottom: 5px;
  color: #168fdf;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

@media (max-width: 1120px) {
  #app-screen #tests .tests-catalog-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  #app-screen #tests .tests-catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  #app-screen #tests .tests-hub-card { padding: 13px 11px; }
  #app-screen #tests .tests-catalog-toolbar { align-items: flex-start; flex-direction: column; }
  #app-screen #tests .tests-catalog-filters { width: 100%; }
  #app-screen #tests .tests-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  #app-screen #tests .tests-protocol-card { min-height: 94px; }
}
@media (max-width: 380px) {
  #app-screen #tests .tests-catalog-grid { grid-template-columns: 1fr; }
}

/* Audiometry workspace aligned with the supplied clinical-screen reference. */
#app-screen #exam-data > .card { padding: 14px 15px 13px; }
#app-screen .exam-page-heading { display: block; margin: 0 1px 8px; }
#app-screen .exam-page-heading .app-breadcrumb { gap: 8px; color: #5a7189; font-size: 10px; }
#app-screen .exam-page-heading .app-breadcrumb strong { color: #18395d; }
#app-screen .exam-screen-reader-title { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
#app-screen .exam-workflow-steps {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 0;
  margin: 0 0 9px;
  padding: 3px 5px;
  border: 1px solid #e0eaf3;
  border-radius: 11px;
  background: linear-gradient(180deg, #fff, #f8fbfe);
}
#app-screen .exam-step {
  position: relative;
  display: flex;
  min-width: max-content;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 16px;
  border: 0;
  border-radius: 8px;
  color: #526b83;
  background: transparent;
  box-shadow: none;
  font-size: 9px;
}
#app-screen .exam-step:hover { transform: none; color: #1177bd; background: #f0f7fd; }
#app-screen .exam-step .exam-step-number,
#app-screen .exam-step > span:first-child {
  display: inline-grid;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  place-items: center;
  margin: 0;
  border-radius: 50%;
  color: #53718e;
  background: #e8f0f7;
  font-size: 9px;
  font-weight: 800;
}
#app-screen .exam-step.is-current { color: #fff; background: linear-gradient(110deg, #168fdf, #0876c9); box-shadow: 0 3px 8px rgba(18, 124, 195, .18); }
#app-screen .exam-step.is-current .exam-step-number { color: #fff; background: rgba(5, 93, 160, .55); }
#app-screen .exam-step:not(:last-child)::after { content: "→"; position: absolute; z-index: 1; right: -4px; color: #b4c5d5; font-size: 12px; font-weight: 500; }
#app-screen .exam-patient-strip {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 5px 7px;
  border: 1px solid #e5edf4;
  border-radius: 9px;
  background: #fff;
}
#app-screen .exam-patient-strip .exam-patient-summary {
  min-width: 0;
  flex: 1 1 auto;
  gap: 9px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
#app-screen .exam-patient-strip .exam-patient-avatar { width: 25px; height: 25px; flex: 0 0 25px; border-radius: 7px; color: #fff; background: #176cad; font-size: 11px; }
#app-screen .exam-patient-inline-summary > span:last-child { display: flex; min-width: 0; align-items: center; gap: 8px; }
#app-screen .exam-patient-inline-summary strong { max-width: min(300px, 32vw); color: #18395d; font-size: 10px; }
#app-screen .exam-patient-inline-summary small,
#app-screen .exam-patient-inline-summary time { margin: 0; color: #4f657c; font-size: 9px; white-space: nowrap; }
#app-screen .exam-patient-separator { width: 1px; height: 15px; flex: 0 0 1px; background: #d9e4ee; }
#app-screen .exam-header-actions { flex: 0 0 auto; gap: 6px; }
#app-screen .exam-header-action { min-height: 30px; padding: 6px 10px; font-size: 9px; }
#app-screen .exam-header-settings { width: 31px; min-height: 30px; height: 30px; font-size: 15px; }
#app-screen .exam-audiometry-workspace { grid-template-columns: minmax(220px, .38fr) minmax(0, 1fr); align-items: stretch; gap: 9px; }
#app-screen .exam-threshold-panel,
#app-screen .exam-preview-panel { padding: 9px; border-color: #e1eaf3; border-radius: 10px; }
#app-screen .exam-audiometry-heading { margin: 0 0 7px; scroll-margin-top: 85px; }
#app-screen .exam-audiometry-heading h3 { margin: 0; color: #294866; font-size: 10px; font-weight: 800; }
#app-screen .exam-pathway-switch { gap: 3px; margin-bottom: 6px; padding: 3px; border-radius: 8px; }
#app-screen .exam-pathway-switch button { min-height: 29px; padding: 5px 7px; font-size: 9px; }
#app-screen .exam-pathway-panel > h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
#app-screen table.exam-threshold-table { border-spacing: 0 2px; }
#app-screen .exam-threshold-table th,
#app-screen .exam-threshold-table td { height: 28px; padding: 2px 4px; }
#app-screen .exam-threshold-table thead th { height: 23px; font-size: 8px; }
#app-screen .exam-threshold-table tbody th { width: 42%; font-size: 8px; }
#app-screen .exam-threshold-table input.audiogram-input { min-height: 24px; padding: 2px; font-size: 9px; }
#app-screen .exam-preview-panel { padding: 9px; }
#app-screen .exam-preview-heading { min-height: 22px; align-items: center; margin-bottom: 5px; }
#app-screen .exam-preview-heading h3 { font-size: 10px; }
#app-screen .exam-preview-controls { gap: 6px; }
#app-screen .exam-auto-plot { gap: 6px; font-size: 8px; }
#app-screen .exam-auto-plot input {
  position: relative;
  width: 28px;
  height: 16px;
  flex: 0 0 28px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #bac8d5;
  cursor: pointer;
  transition: background .16s ease;
}
#app-screen .exam-auto-plot input::before { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(22, 46, 68, .25); transition: transform .16s ease; }
#app-screen .exam-auto-plot input:checked { background: #168fdf; }
#app-screen .exam-auto-plot input:checked::before { transform: translateX(12px); }
#app-screen .exam-auto-plot input:focus-visible { outline: 3px solid rgba(22, 143, 223, .25); outline-offset: 2px; }
#app-screen .exam-refresh-plots,
#app-screen .exam-expand-plots { display: inline-grid; width: 27px; min-height: 27px; height: 27px; place-items: center; padding: 5px; border: 1px solid #dce8f2; border-radius: 7px; color: #167cc4; background: #fff; box-shadow: none; cursor: pointer; }
#app-screen .exam-refresh-plots:hover,
#app-screen .exam-expand-plots:hover { transform: none; border-color: #a9d2ed; background: #f1f8fd; }
#app-screen .exam-refresh-plots svg,
#app-screen .exam-expand-plots svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#app-screen .exam-expand-plots[aria-pressed="true"] { color: #fff; border-color: #168fdf; background: #168fdf; }
#app-screen .exam-preview-charts { gap: 6px; }
#app-screen .exam-preview-chart-card { padding: 6px 5px 4px; border-radius: 7px; }
#app-screen .exam-preview-chart-card h4 { margin-bottom: 0; font-size: 8px; }
#app-screen .exam-preview-chart-card:first-child h4 { color: #e44943; }
#app-screen .exam-preview-chart-card:last-child h4 { color: #1671d5; }
#app-screen .exam-preview-chart-wrap { height: 154px; }
#app-screen .exam-audiometry-workspace.is-preview-expanded .exam-preview-chart-wrap { height: 225px; }
#app-screen .exam-preview-legend-slot { align-items: center; justify-content: space-between; gap: 4px 7px; margin-top: 5px; padding: 5px 1px; }
#app-screen .exam-preview-legend-slot > .legend-item { flex: 0 1 auto; gap: 4px; font-size: 7px; white-space: nowrap; }
#app-screen .exam-preview-legend-slot > .legend-item .legend-symbol { width: 12px; height: 12px; }
#app-screen .exam-legend-more { position: relative; flex: 0 0 auto; color: #5d7389; font-size: 8px; }
#app-screen .exam-legend-more > summary { width: 19px; height: 19px; overflow: hidden; border: 1px solid #e1eaf3; border-radius: 50%; cursor: pointer; font-size: 0; list-style: none; text-align: center; }
#app-screen .exam-legend-more > summary::-webkit-details-marker { display: none; }
#app-screen .exam-legend-more > summary::before { content: "···"; color: #52718e; font-size: 11px; line-height: 16px; }
#app-screen .exam-legend-extra-items { position: absolute; z-index: 6; right: 0; bottom: calc(100% + 5px); display: grid; width: max-content; max-width: min(300px, 78vw); gap: 7px; padding: 10px; border: 1px solid #dce8f2; border-radius: 8px; background: #fff; box-shadow: 0 8px 22px rgba(23, 52, 80, .16); }
#app-screen .exam-legend-extra-items .legend-item { gap: 5px; color: #526b83; font-size: 8px; }
#app-screen .exam-live-metrics { gap: 6px; margin-top: 3px; }
#app-screen .exam-live-metric { padding: 7px; border-radius: 7px; }
#app-screen .exam-live-metric h4 { min-height: 15px; margin-bottom: 4px; font-size: 8px; }
#app-screen .exam-live-metric .pta-panel { grid-template-columns: 1fr; gap: 3px; }
#app-screen .exam-live-metric .pta-title { margin-bottom: 1px; }
#app-screen .exam-live-metric .pta-box { min-height: 23px; padding: 3px 5px; }
#app-screen .exam-metric-ears { gap: 3px; }
#app-screen .exam-metric-ears span { min-height: 23px; padding: 3px 5px; }
#app-screen .exam-audiometry-actions { margin: 8px 0 13px; }
#app-screen .exam-audiometry-actions button { min-height: 34px; padding: 7px 12px; font-size: 9px; }

@media (min-width: 721px) and (max-width: 900px) {
  #app-screen .exam-audiometry-workspace { grid-template-columns: minmax(205px, .38fr) minmax(0, 1fr); }
  #app-screen .exam-preview-chart-wrap { height: 140px; }
}
@media (max-width: 720px) {
  #app-screen .exam-audiometry-workspace { grid-template-columns: 1fr; }
  #app-screen .exam-patient-strip { align-items: flex-start; flex-direction: column; }
  #app-screen .exam-header-actions { width: 100%; justify-content: flex-end; }
  #app-screen .exam-preview-charts { grid-template-columns: 1fr; }
  #app-screen .exam-preview-chart-wrap { height: 210px; }
  #app-screen .exam-live-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  #app-screen .exam-patient-inline-summary { width: 100%; flex-wrap: wrap; }
  #app-screen .exam-patient-inline-summary > span:last-child { flex-wrap: wrap; gap: 5px; }
  #app-screen .exam-patient-inline-summary strong { max-width: calc(100vw - 120px); }
  #app-screen .exam-workflow-steps { overflow-x: auto; justify-content: flex-start; }
  #app-screen .exam-step { flex: 0 0 auto; padding: 4px 9px; }
  #app-screen .exam-step-label { font-size: 8px; }
  #app-screen .exam-live-metrics { grid-template-columns: 1fr; }
}

/* Final student overrides stay after legacy component rules. */
#app-screen:has(.user-header.student) .student-case-overview-title { min-height: 30px; padding: 2px 6px; border: 0; border-radius: 0; background: transparent; }
#app-screen:has(.user-header.student) .student-workflow-steps { justify-content: space-between; gap: 3px; padding: 5px 8px; }
#app-screen:has(.user-header.student) .student-workflow-steps button.is-active { color: #0877c5; background: transparent; }
#app-screen:has(.user-header.student) .student-simulator-header { min-height: 42px; padding: 3px 2px 7px; border: 0; background: transparent; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiometer-panel { color: #193955; background: linear-gradient(150deg, #f4f9fd, #eaf3fa); border-color: #d9e6f0; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-card { min-height: 0; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-card canvas { height: 100% !important; }
@media (max-width: 760px) {
  #app-screen:has(.user-header.student) .student-workflow-steps { justify-content: flex-start; }
  #app-screen:has(.user-header.student) #student-audiometry-simulator { grid-template-columns: 1fr; }
  #app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiometer-panel,
  #app-screen:has(.user-header.student) #student-audiometry-simulator .student-results-panel { grid-column: 1; grid-row: auto; }
}
@media (max-width: 520px) {
  #app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-grid,
  #app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-grid,
  #app-screen:has(.user-header.student) .student-result-audiograms { grid-template-columns: 1fr; }
}

/* Patient registration layout */
#app-screen #patient-data > .card { max-width: 1120px; }
#app-screen .patient-title-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 13px; }
#app-screen .patient-title-row h2 { margin: 0; font-size: 20px; }
#app-screen .patient-lookup-toolbar { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 14px; }
#app-screen .patient-lookup-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; margin: 0; color: #4d6480; font-size: 10px; white-space: nowrap; cursor: pointer; }
#app-screen .patient-lookup-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
#app-screen .patient-lookup-switch { position: relative; width: 29px; height: 16px; border: 1px solid #cbd9e6; border-radius: 99px; background: #dce7f0; transition: background .18s ease, border-color .18s ease; }
#app-screen .patient-lookup-switch::after { position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #183b5b30; content: ""; transition: transform .18s ease; }
#app-screen .patient-lookup-toggle input:checked + .patient-lookup-switch { border-color: #1688d4; background: #1688d4; }
#app-screen .patient-lookup-toggle input:checked + .patient-lookup-switch::after { transform: translateX(13px); }
#app-screen .patient-lookup-toggle input:focus-visible + .patient-lookup-switch { outline: 3px solid #1688d433; outline-offset: 2px; }
#app-screen .patient-lookup-search { position: relative; width: min(260px, 30vw); }
#app-screen .patient-lookup-search[hidden], #app-screen .patient-lookup-results[hidden] { display: none; }
#app-screen .patient-lookup-search input { width: 100%; min-height: 35px; padding: 8px 11px; border: 1px solid #d7e2ed; border-radius: 7px; background: #fff; font-size: 10px; }
#app-screen .patient-lookup-results { position: absolute; z-index: 12; top: calc(100% + 5px); right: 0; left: 0; max-height: 230px; overflow-y: auto; padding: 5px; border: 1px solid #dfe9f2; border-radius: 9px; background: #fff; box-shadow: 0 10px 25px #1637551c; }
#app-screen .patient-lookup-result { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 8px 9px; border: 0; border-radius: 6px; color: #243e5d; background: transparent; box-shadow: none; text-align: left; cursor: pointer; }
#app-screen .patient-lookup-result:hover, #app-screen .patient-lookup-result:focus-visible { background: #eef7fd; transform: none; }
#app-screen .patient-lookup-result strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
#app-screen .patient-lookup-result span { color: #72859a; font-size: 9px; }
#app-screen .patient-lookup-result .patient-lookup-result-date { grid-column: 1 / -1; }
#app-screen .patient-lookup-empty { margin: 0; padding: 9px; color: #71859a; font-size: 10px; }
#app-screen .patient-personal-grid { display: grid; grid-template-columns: minmax(170px, 1.3fr) minmax(145px, 1fr) minmax(85px, .58fr) minmax(130px, .88fr); gap: 0 13px; }
#app-screen .patient-email-field { grid-column: span 2; }
#app-screen .patient-age-input { position: relative; }
#app-screen .patient-age-input input { padding-right: 38px; }
#app-screen .patient-age-input > span { position: absolute; top: 50%; right: 10px; color: #73869a; font-size: 9px; transform: translateY(-50%); pointer-events: none; }
#app-screen .patient-clinical-grid { display: grid; grid-template-columns: minmax(200px, 1.2fr) minmax(150px, .75fr) minmax(220px, 1.2fr); gap: 0 13px; }
#app-screen .patient-required-mark { color: #dd625e; }
#app-screen .patient-form-section input, #app-screen .patient-form-section select, #app-screen .patient-form-section textarea { width: 100%; min-height: 36px; padding: 8px 10px; border: 1px solid #d5e1ec; border-radius: 7px; color: #263f5e; background: #fff; font: inherit; font-size: 10px; }
#app-screen .patient-form-section input:focus, #app-screen .patient-form-section select:focus, #app-screen .patient-form-section textarea:focus { border-color: #69a9df; outline: 3px solid #1688d41a; }
#app-screen .patient-form-section input[readonly] { color: #5e7792; background: #f3f7fb; }
#app-screen .patient-observations-field { position: relative; margin-top: 2px; }
#app-screen .patient-form-section textarea { min-height: 58px; resize: vertical; }
#app-screen .patient-observations-count { position: absolute; right: 9px; bottom: 8px; color: #8394a7; font-size: 8px; }
#app-screen .patient-equipment-legacy { display: none !important; }
#app-screen .patient-form-actions { align-items: center; margin-top: 12px; }
#app-screen .patient-form-actions .patient-cancel-button { border: 1px solid #d7e2ec; color: #3c5876; background: #fff; box-shadow: none; }
#app-screen .patient-form-actions .patient-continue-button { min-width: 146px; color: #fff; background: linear-gradient(110deg, #1995e3, #087acb); box-shadow: 0 5px 13px #167cc522; }
@media (max-width: 850px) {
  #app-screen .patient-title-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  #app-screen .patient-lookup-toolbar { width: 100%; justify-content: space-between; }
  #app-screen .patient-lookup-search { width: min(300px, 55vw); }
  #app-screen .patient-personal-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  #app-screen .patient-personal-grid .patient-email-field { grid-column: 1 / -1; }
  #app-screen .patient-clinical-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
  #app-screen .patient-clinical-grid .form-group:last-child { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  #app-screen .patient-lookup-toolbar { align-items: flex-start; flex-direction: column; }
  #app-screen .patient-lookup-search { width: 100%; }
  #app-screen .patient-personal-grid, #app-screen .patient-clinical-grid { grid-template-columns: 1fr 1fr; gap: 0 9px; }
  #app-screen .patient-personal-grid .form-group:first-child,
  #app-screen .patient-personal-grid .patient-email-field,
  #app-screen .patient-clinical-grid .form-group:first-child,
  #app-screen .patient-clinical-grid .form-group:last-child { grid-column: 1 / -1; }
  #app-screen .patient-form-actions { justify-content: stretch; }
  #app-screen .patient-form-actions button { flex: 1 1 0; min-width: 0; padding: 9px 8px; }
}

/* Student workspace: navigation, study pages, and accessible workflow tabs. */
#app-screen:has(.user-header.student) .tab-container > .tab[data-tab="dashboard"] { order: 0; }
#app-screen:has(.user-header.student) .tab-container > .tab[data-tab="student"] { order: 1; }
#app-screen:has(.user-header.student) .tab-container > .tab[data-tab="student-cases"] { order: 2; }
#app-screen:has(.user-header.student) .tab-container > .tab[data-tab="student-results"] { order: 3; }
#app-screen:has(.user-header.student) .tab-container > .tab[data-tab="student-history"] { order: 4; }
#app-screen:has(.user-header.student) .tab-container > .tab[data-tab="student-learn"] { order: 5; }
#app-screen:has(.user-header.student) .tab-container > .tab[data-tab="student-settings"] { order: 6; }
#app-screen .student-header-action[hidden] { display: none !important; }
#app-screen .student-header-action { min-height: 32px; padding: 0 10px; border: 1px solid #dce8f3; border-radius: 8px; color: #294b6b; background: #fff; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
#app-screen .student-header-action:hover { border-color: #9bc9ed; color: #0877c5; }
#app-screen:has(.user-header.student) .student-simulator[hidden],
#app-screen:has(.user-header.student) .student-case-completion[hidden],
#app-screen:has(.user-header.student) .student-word-bank[hidden],
#app-screen:has(.user-header.student) .student-result-tab-panel[hidden] { display: none !important; }
#app-screen:has(.user-header.student) .student-speech-tabs,
#app-screen:has(.user-header.student) .student-result-tabs { display: flex; align-items: center; gap: 5px; width: fit-content; max-width: 100%; margin: 0 0 10px; padding: 4px; border: 1px solid #dce8f3; border-radius: 10px; background: #f5f9fd; }
#app-screen:has(.user-header.student) .student-speech-tabs button,
#app-screen:has(.user-header.student) .student-result-tabs button { min-height: 32px; padding: 6px 12px; border: 0; border-radius: 7px; color: #526b83; background: transparent; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
#app-screen:has(.user-header.student) .student-speech-tabs button[aria-selected="true"],
#app-screen:has(.user-header.student) .student-result-tabs button[aria-selected="true"] { color: #fff; background: linear-gradient(110deg, #168ee2, #0878ca); box-shadow: 0 3px 8px #168ee226; }
#app-screen:has(.user-header.student) .student-speech-tabs button:focus-visible,
#app-screen:has(.user-header.student) .student-result-tabs button:focus-visible,
#app-screen .student-header-action:focus-visible { outline: 3px solid #66b7f0; outline-offset: 2px; }
#app-screen:has(.user-header.student) .student-result-tab-panel { min-width: 0; }
#app-screen:has(.user-header.student) .student-tymp-chart-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(105px, .45fr); grid-template-rows: auto minmax(150px, 1fr); gap: 6px 10px; }
#app-screen:has(.user-header.student) .student-tymp-chart-card h4 { grid-column: 1 / -1; }
#app-screen:has(.user-header.student) .student-tymp-chart-wrap { min-width: 0; height: 174px; }
#app-screen:has(.user-header.student) .student-tymp-measures { display: grid; align-content: center; gap: 7px; margin: 0; padding: 9px; border: 1px solid #e3edf5; border-radius: 8px; background: #f8fbfe; }
#app-screen:has(.user-header.student) .student-tymp-measures div { display: flex; justify-content: space-between; gap: 5px; }
#app-screen:has(.user-header.student) .student-tymp-measures dt { color: #637a90; font-size: 8px; }
#app-screen:has(.user-header.student) .student-tymp-measures dd { margin: 0; color: #173451; font-size: 9px; font-weight: 800; text-align: right; }

#app-screen .student-home-page, #app-screen .student-content-page { display: grid; gap: 14px; min-width: 0; }
#app-screen .student-home-welcome { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 8px 2px; }
#app-screen .student-home-welcome > div > span, #app-screen .student-page-heading > span, #app-screen .student-home-section header > div > span { color: #1985cb; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
#app-screen .student-home-welcome h2, #app-screen .student-page-heading h2 { margin: 5px 0 3px; color: #173451; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.035em; }
#app-screen .student-home-welcome p, #app-screen .student-page-heading p { margin: 0; color: #667f96; font-size: 12px; }
#app-screen .student-primary-action { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 9px; padding: 0 15px; border: 0; border-radius: 8px; color: #fff; background: linear-gradient(110deg, #168ee2, #0878ca); box-shadow: 0 5px 14px #167cc522; font: inherit; font-size: 10px; font-weight: 800; cursor: pointer; }
#app-screen .student-home-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
#app-screen .student-home-stat { display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 11px; min-height: 76px; padding: 12px; border: 1px solid #e0eaf3; border-radius: 11px; color: #173451; background: linear-gradient(145deg, #fff, #f5faff); text-align: left; cursor: pointer; }
#app-screen .student-home-stat > span { grid-row: 1 / 3; display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: #168ee2; background: #e9f5ff; font-size: 18px; }
#app-screen .student-home-stat strong { font-size: 20px; line-height: 1; }
#app-screen .student-home-stat small { color: #667f96; font-size: 9px; }
#app-screen .student-home-section { display: grid; gap: 10px; padding: 14px; border: 1px solid #e0eaf3; border-radius: 11px; background: rgba(255,255,255,.88); }
#app-screen .student-home-section > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#app-screen .student-home-section h3 { margin: 3px 0 0; color: #173451; font-size: 14px; }
#app-screen .student-home-section header > button { border: 0; color: #0877c5; background: transparent; font: inherit; font-size: 9px; font-weight: 700; cursor: pointer; }
#app-screen .student-home-quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
#app-screen .student-home-quick-grid > button { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 4px 9px; min-height: 100px; padding: 12px; border: 1px solid #dfebf5; border-radius: 9px; color: #173451; background: linear-gradient(145deg, #f7fbff, #edf6fc); text-align: left; cursor: pointer; }
#app-screen .student-quick-icon { grid-row: 1 / 3; display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; color: #168ee2; background: #fff; font-size: 18px; }
#app-screen .student-home-quick-grid strong { align-self: center; font-size: 10px; }
#app-screen .student-home-quick-grid small { grid-column: 2; color: #667f96; font-size: 9px; line-height: 1.45; }
#app-screen .student-home-quick-grid b { position: absolute; right: 11px; bottom: 8px; color: #168ee2; }
#app-screen .student-home-completed-list { display: grid; }
#app-screen .student-home-completed-list article { display: grid; grid-template-columns: 22px 1fr minmax(130px, auto) 44px; align-items: center; gap: 8px; padding: 9px 2px; border-top: 1px solid #e8eff5; font-size: 9px; }
#app-screen .student-home-completed-list article small { color: #71869a; }
#app-screen .student-home-completed-list article > b { color: #0877c5; text-align: right; }
#app-screen .student-completed-check { display: grid; width: 19px; height: 19px; place-items: center; border-radius: 50%; color: #fff; background: #18a66a; }
#app-screen .student-page-heading { padding: 3px 1px 5px; }
#app-screen .student-learning-steps { display: grid; gap: 9px; }
#app-screen .student-learning-steps article { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid #e0eaf3; border-radius: 10px; background: rgba(255,255,255,.9); }
#app-screen .student-learning-steps article > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: #fff; background: #168ee2; font-size: 12px; font-weight: 800; }
#app-screen .student-learning-steps h3, #app-screen .student-settings-card h3 { margin: 0 0 4px; color: #173451; font-size: 12px; }
#app-screen .student-learning-steps p, #app-screen .student-settings-card p { margin: 0; color: #667f96; font-size: 10px; line-height: 1.55; }
#app-screen .student-learning-steps article > button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #d9e8f4; border-radius: 7px; color: #176da8; background: #f5faff; font: inherit; font-size: 9px; font-weight: 700; cursor: pointer; }
#app-screen .student-safety-note { padding: 12px 14px; border: 1px solid #d8e9f3; border-left: 3px solid #23a2df; border-radius: 9px; background: #f1f8fd; }
#app-screen .student-safety-note strong { color: #173451; font-size: 10px; }
#app-screen .student-safety-note p { margin: 4px 0 0; color: #526b83; font-size: 9px; line-height: 1.55; }
#app-screen .student-settings-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #e0eaf3; border-radius: 10px; background: rgba(255,255,255,.9); }
#app-screen .student-settings-avatar { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; color: #fff; background: #168ee2; font-weight: 800; }
#app-screen .student-settings-card > div:nth-child(2) > span { display: block; margin-bottom: 4px; color: #1985cb; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
#app-screen .student-records-summary { display: flex; align-items: baseline; gap: 7px; padding: 11px 13px; border: 1px solid #e0eaf3; border-radius: 9px; background: #fff; }
#app-screen .student-records-summary strong { color: #173451; font-size: 22px; }
#app-screen .student-records-summary span { color: #667f96; font-size: 10px; }
#app-screen .student-record-list { display: grid; gap: 9px; }
#app-screen .student-record-card { display: grid; gap: 10px; padding: 13px; border: 1px solid #e0eaf3; border-radius: 10px; background: rgba(255,255,255,.92); }
#app-screen .student-record-card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#app-screen .student-record-card > header > div { display: grid; gap: 4px; }
#app-screen .student-record-case-id { color: #173451; font-size: 12px; font-weight: 800; }
#app-screen .student-record-card > header small { color: #71869a; font-size: 9px; }
#app-screen .student-record-card > header > strong { color: #0877c5; font-size: 18px; }
#app-screen .student-record-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 6px; }
#app-screen .student-record-sections > div { display: flex; justify-content: space-between; gap: 6px; padding: 8px; border: 1px solid #e8eff5; border-radius: 7px; color: #526b83; background: #f8fbfe; font-size: 9px; }
#app-screen .student-record-sections b { color: #173451; }
#app-screen .student-record-complete { display: inline-flex; align-items: center; gap: 5px; color: #16815d; font-size: 8px; }
#app-screen .student-record-complete i { font-style: normal; }
#app-screen .student-record-no-breakdown { margin: 0; color: #71869a; font-size: 9px; }
#app-screen .student-empty-state { display: grid; justify-items: center; gap: 8px; padding: 26px 16px; border: 1px dashed #cdddea; border-radius: 10px; color: #667f96; background: rgba(255,255,255,.76); text-align: center; }
#app-screen .student-empty-state > span { color: #168ee2; font-size: 24px; }
#app-screen .student-empty-state h3 { margin: 0; color: #173451; font-size: 14px; }
#app-screen .student-empty-state p { max-width: 400px; margin: 0; font-size: 10px; }
#app-screen .student-empty-state > button:not(.student-primary-action) { min-height: 32px; padding: 6px 10px; border: 1px solid #d6e5f1; border-radius: 7px; color: #176da8; background: #f5faff; cursor: pointer; }

@media (max-width: 1000px) {
  #app-screen:has(.user-header.student) #student-audiometry-simulator { grid-template-columns: minmax(190px, .7fr) minmax(0, 1.6fr); }
  #app-screen:has(.user-header.student) .student-tymp-chart-card { grid-template-columns: minmax(0, 1fr) minmax(95px, .4fr); }
}
@media (max-width: 760px) {
  #app-screen:has(.user-header.student) .student-speech-tabs,
  #app-screen:has(.user-header.student) .student-result-tabs { width: 100%; overflow-x: auto; }
  #app-screen:has(.user-header.student) .student-speech-tabs button,
  #app-screen:has(.user-header.student) .student-result-tabs button { flex: 0 0 auto; }
  #app-screen:has(.user-header.student) .student-tymp-chart-card { grid-template-columns: 1fr; grid-template-rows: auto 165px auto; }
  #app-screen:has(.user-header.student) .student-tymp-measures { grid-column: 1; grid-template-columns: 1fr 1fr; }
  #app-screen .student-home-welcome { align-items: flex-start; flex-direction: column; }
  #app-screen .student-home-stat-grid, #app-screen .student-home-quick-grid { grid-template-columns: 1fr; }
  #app-screen .student-learning-steps article { grid-template-columns: 30px 1fr; }
  #app-screen .student-learning-steps article > button { grid-column: 2; justify-self: start; }
  #app-screen .student-home-completed-list article { grid-template-columns: 22px 1fr 42px; }
  #app-screen .student-home-completed-list article small { grid-column: 2; }
  #app-screen .student-home-completed-list article > b { grid-column: 3; grid-row: 1 / 3; }
}

/* SRT follows the study reference: controls, live word/progress, and a compact word list. */
#app-screen:has(.user-header.student) #student-srt-training { min-width: 0; padding: 12px; }
#app-screen:has(.user-header.student) #student-srt-training .student-word-bank-header { margin: 0 0 9px; }
#app-screen:has(.user-header.student) #student-srt-training .student-word-bank-header h4 { margin: 0 0 3px; color: #173451; font-size: 13px; }
#app-screen:has(.user-header.student) #student-srt-training .student-word-bank-header > div > p:last-child { margin: 0; color: #637a90; font-size: 9px; }
#app-screen:has(.user-header.student) #student-srt-word-panel { display: grid; grid-template-columns: minmax(185px, .82fr) minmax(190px, .88fr) minmax(245px, 1.05fr); grid-template-rows: auto auto auto; align-items: stretch; gap: 9px; }
#app-screen:has(.user-header.student) #student-srt-word-panel > .student-srt-presenter { display: contents; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-action-area { grid-column: 1; grid-row: 1; align-content: start; justify-items: stretch; gap: 11px; min-width: 0; padding: 12px; border: 1px solid #dce8f3; border-radius: 9px; background: #f5f9fd; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-ear-controls { justify-self: start; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-ear-controls button { min-width: 54px; color: #395a77; background: #eaf3fa; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-ear-controls button.is-active { color: #fff; background: #168ee2; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-word-bank-actions { display: grid; grid-template-columns: 1fr; gap: 7px; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-word-bank-actions button { min-height: 35px; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-word-bank-actions button:first-child { color: #513f08; background: #f3c843; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-word-bank-actions button.is-secondary { color: #365873; background: #e8f1f8; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-current-data { grid-column: 2; grid-row: 1; align-content: center; gap: 7px; min-width: 0; min-height: 205px; padding: 14px; border: 1px solid #dce8f3; border-radius: 9px; color: #173451; background: linear-gradient(145deg, #f6fbff, #edf6fc); }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-current-data > span { color: #637a90; font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
#app-screen:has(.user-header.student) #student-srt-word-panel #student-srt-current-word { color: #173451; font-size: clamp(22px, 2.1vw, 30px); font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
#app-screen:has(.user-header.student) #student-srt-word-panel #student-srt-progress { color: #637a90; font-size: 9px; letter-spacing: 0; text-transform: none; }
#app-screen:has(.user-header.student) .student-srt-progress-track { height: 7px; overflow: hidden; border-radius: 99px; background: #dbe7f0; }
#app-screen:has(.user-header.student) .student-srt-progress-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #20a66c, #39c28a); transition: width .2s ease; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-live-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 2px 0 0; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-live-metrics span { gap: 4px; padding: 8px; border: 1px solid #e2ebf3; border-radius: 7px; color: #637a90; background: #fff; font-size: 7px; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-live-metrics strong { color: #173451; font-size: 11px; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-speech-console-details { grid-column: 1 / 3; grid-row: 2; min-width: 0; padding: 9px 10px; border: 1px solid #dce8f3; border-radius: 8px; background: #fff; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-speech-console-details summary { color: #365873; font-size: 9px; font-weight: 800; cursor: pointer; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-console-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-speech-measure-field { min-width: 0; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-speech-measure-field > span { color: #637a90; font-size: 7px; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-speech-measure-field input,
#app-screen:has(.user-header.student) #student-srt-word-panel .student-speech-measure-field select { min-height: 32px; padding: 6px 7px; border-color: #dce8f3; border-radius: 6px; font-size: 9px; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-word-bank-help,
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-test-status,
#app-screen:has(.user-header.student) #student-srt-word-panel > .student-speech-audio-status { grid-column: 1 / 3; margin: 0; font-size: 8px; line-height: 1.45; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-word-bank-help { color: #637a90; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-test-status { padding: 8px 10px; border-radius: 7px; font-size: 8px; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-word-list { grid-column: 3; grid-row: 1 / 6; display: flex; width: 100%; height: min(420px, calc(100vh - 245px)); min-width: 0; min-height: 250px; max-height: 420px; flex-direction: column; overflow: hidden; border: 1px solid #dce8f3; border-radius: 9px; background: #fff; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-word-list > header { display: flex; min-height: 37px; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-bottom: 1px solid #e6eef5; color: #173451; font-size: 9px; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-word-list > header span { padding: 3px 7px; border-radius: 5px; color: #0877c5; background: #eaf5fd; font-size: 8px; font-weight: 800; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-word-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 4px; min-height: 0; overflow-y: auto; padding: 6px; scrollbar-color: #b7cde0 transparent; scrollbar-width: thin; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-word-grid button { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(52px, auto); min-height: 31px; align-items: center; gap: 7px; padding: 4px 6px; border: 1px solid #e3edf5; border-radius: 6px; color: #173451; background: #fff; font-size: 8px; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-word-grid button > span { width: 20px; height: 20px; font-size: 8px; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-word-grid button strong { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-word-grid button small { overflow: hidden; color: #8191a1; font-size: 7px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-word-grid button.is-current { border-color: #168ee2; background: #edf7ff; box-shadow: inset 2px 0 #168ee2; }
#app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-word-grid button:disabled { opacity: .78; }
@media (max-width: 1050px) {
  #app-screen:has(.user-header.student) #student-srt-word-panel { grid-template-columns: minmax(170px, .9fr) minmax(180px, 1fr); }
  #app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-word-list { grid-column: 2; grid-row: 1 / 5; }
  #app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-action-area,
  #app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-current-data { grid-column: 1; }
  #app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-current-data { grid-row: 2; }
  #app-screen:has(.user-header.student) #student-srt-word-panel .student-speech-console-details { grid-row: 3; }
  #app-screen:has(.user-header.student) #student-srt-word-panel .student-speech-console-details,
  #app-screen:has(.user-header.student) #student-srt-word-panel .student-word-bank-help,
  #app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-test-status,
  #app-screen:has(.user-header.student) #student-srt-word-panel > .student-speech-audio-status { grid-column: 1; }
  #app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-console-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #app-screen:has(.user-header.student) #student-srt-word-panel { grid-template-columns: minmax(0, 1fr); }
  #app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-action-area,
  #app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-current-data,
  #app-screen:has(.user-header.student) #student-srt-word-panel .student-speech-console-details,
  #app-screen:has(.user-header.student) #student-srt-word-panel .student-word-bank-help,
  #app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-test-status,
  #app-screen:has(.user-header.student) #student-srt-word-panel > .student-speech-audio-status,
  #app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-word-list { grid-column: 1; grid-row: auto; }
  #app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-current-data { min-height: auto; }
  #app-screen:has(.user-header.student) #student-srt-word-panel .student-srt-word-list { height: min(300px, calc(100vh - 300px)); min-height: 180px; max-height: 300px; }
}

/* Match the reference audiometry workspace while keeping every study control active. */
#app-screen:has(.user-header.student) #student-audiometry-simulator {
  grid-template-columns: minmax(250px, .74fr) minmax(0, 1.7fr);
  align-items: start;
  gap: 9px 10px;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiometer-panel {
  align-self: start;
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 12px;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiometer-display[hidden] { display: none !important; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-primary-controls {
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  margin: 0;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-primary-controls .student-control-block {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-control-block { margin: 0; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-control-block label {
  margin-bottom: 5px;
  color: #173451;
  font-size: 9px;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator #student-ear-controls,
#app-screen:has(.user-header.student) #student-audiometry-simulator #student-route-controls,
#app-screen:has(.user-header.student) #student-audiometry-simulator #student-masking-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-toggle-group button {
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid #dce8f2;
  border-radius: 7px;
  color: #31506d;
  background: #f1f7fc;
  box-shadow: none;
  font-size: 10px;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator #student-ear-controls button[data-ear="right"].is-active {
  border-color: #e73d42;
  color: #fff;
  background: #e73d42;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator #student-ear-controls button[data-ear="left"].is-active {
  border-color: #1677df;
  color: #fff;
  background: #1677df;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator #student-route-controls button.is-active,
#app-screen:has(.user-header.student) #student-audiometry-simulator #student-masking-controls button.is-active {
  border-color: #173a5d;
  color: #fff;
  background: #173a5d;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-frequency-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-frequency-grid button {
  min-width: 0;
  min-height: 30px;
  padding: 4px 2px;
  border: 1px solid #e0eaf3;
  border-radius: 6px;
  font-size: 9px;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-intensity-control {
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-intensity-step-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-intensity-step-grid button {
  min-width: 0;
  min-height: 32px;
  padding: 5px 2px;
  border: 1px solid #dce8f2;
  border-radius: 6px;
  background: #f1f7fc;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator #student-sim-intensity-label {
  color: #173451;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator #student-intensity-slider {
  height: 5px;
  margin: 2px 0 0;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-main-actions {
  position: relative;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 0;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-main-actions button {
  min-height: 34px;
  padding: 7px 8px;
  font-size: 9px;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-present-btn {
  grid-column: 1 / -1;
  padding-right: 30px !important;
  color: #513f06;
  background: #f3c843;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-patient-response-signal {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 11px;
  width: 13px;
  height: 13px;
  margin: 0;
  border: 2px solid #72804f;
  border-radius: 50%;
  background: #aab58b;
  box-shadow: none;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-patient-response-signal.is-flashing {
  border-color: #9f1612;
  background: #f44336;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator #student-mark-threshold { grid-column: 1; }
#app-screen:has(.user-header.student) #student-audiometry-simulator #student-sim-response-label:not([hidden]) {
  grid-column: 1 / -1;
  margin: 1px 0 0;
  color: #31506d;
  font-size: 9px;
  text-align: center;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-results-panel {
  align-content: start;
  align-items: stretch;
  gap: 7px;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-results-panel > div:first-child { display: none; }
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-grid {
  align-content: start;
  align-items: stretch;
  gap: 8px;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-card {
  min-height: 270px;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-wrap { height: 205px; }
@media (max-width: 1050px) {
  #app-screen:has(.user-header.student) #student-audiometry-simulator {
    grid-template-columns: minmax(225px, .78fr) minmax(0, 1.5fr);
  }
  #app-screen:has(.user-header.student) #student-audiometry-simulator .student-frequency-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #app-screen:has(.user-header.student) #student-audiometry-simulator { grid-template-columns: minmax(0, 1fr); }
  #app-screen:has(.user-header.student) #student-audiometry-simulator .student-results-panel,
  #app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiometer-panel { grid-column: 1; grid-row: auto; }
  #app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-grid { grid-template-columns: minmax(0, 1fr); }
}

#app-screen:has(.user-header.student) #student-audiometry-simulator .student-symbol-legend {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  justify-content: start;
  gap: 7px 8px;
  padding: 10px 12px;
  font-size: 11px;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-symbol-legend span {
  gap: 6px;
  font-weight: 700;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-symbol-legend b {
  min-width: 16px;
  font-size: 16px;
}
@media (max-width: 520px) {
  #app-screen:has(.user-header.student) #student-audiometry-simulator .student-symbol-legend {
    grid-template-columns: repeat(2, max-content);
    justify-content: start;
    column-gap: 8px;
  }
}

#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-heading {
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 8px;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-heading span {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  font-size: 13px;
  line-height: 1;
}
#app-screen:has(.user-header.student) #student-audiometry-simulator .student-audiogram-chart-heading strong {
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
#app-screen .user-header.student {
  min-height: 60px;
  gap: 16px;
  border-left: 0;
}
#app-screen .user-header.student .user-info { display: none !important; }
#app-screen .user-header.student .user-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}
#app-screen .user-header.student .student-header-action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  border: 0;
  color: #304f6c;
  background: transparent;
  box-shadow: none;
  font-size: 11px;
  font-weight: 600;
}
#app-screen .user-header.student .student-header-action:hover {
  color: #0877c5;
  background: transparent;
}
#app-screen .user-header.student .student-header-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
#app-screen .user-header.student .student-account-menu { position: relative; }
#app-screen .user-header.student .student-account-trigger {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 2px 3px;
  border: 0;
  border-radius: 7px;
  color: #203f5e;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}
#app-screen .user-header.student .student-account-trigger:hover { background: #edf5fb; }
#app-screen .user-header.student .student-account-trigger .user-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  background: #168ee2;
}
#app-screen .user-header.student .student-account-trigger > svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}
#app-screen .user-header.student .student-account-menu-panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 148px;
  gap: 4px;
  padding: 6px;
  border: 1px solid #dce8f3;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(23, 52, 81, .16);
}
#app-screen .user-header.student .student-account-menu-panel[hidden] { display: none !important; }
#app-screen .user-header.student .student-account-menu-panel button {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  color: #294b6b;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 11px;
  text-align: left;
}
#app-screen .user-header.student .student-account-menu-panel button:hover { background: #eef6fc; }
#app-screen .user-header.student .student-account-trigger:focus-visible,
#app-screen .user-header.student .student-header-action:focus-visible,
#app-screen .user-header.student .student-account-menu-panel button:focus-visible {
  outline: 3px solid #66b7f0;
  outline-offset: 2px;
}
@media (max-width: 680px) {
  #app-screen .user-header.student { flex-wrap: nowrap; gap: 10px; padding-right: 10px; padding-left: 10px; }
  #app-screen .user-header.student .user-actions { gap: 10px; }
  #app-screen .user-header.student .student-header-action { gap: 4px; font-size: 10px; }
}

/* Center every role's tab content on wide screens. */
#app-screen .tab-content {
  width: 100%;
  max-width: 1500px;
  margin-inline: auto;
}

/* Override the legacy global header treatment on the student home page. */
#app-screen .student-home-welcome {
  margin: 0;
  padding: 18px 22px;
  border: 1px solid #d4e4f1;
  border-radius: 12px;
  color: #173451;
  background: linear-gradient(120deg, #f7fbff, #eaf4fc);
  box-shadow: 0 5px 16px rgba(30, 70, 105, .06);
  text-align: left;
}
#app-screen .student-home-welcome h2 { color: #173451; }
#app-screen .student-home-welcome p { color: #4e6881; }
#app-screen .student-home-welcome > div > span,
#app-screen .student-page-heading > span,
#app-screen .student-home-section header > div > span { color: #0877b9; }
#app-screen .student-home-section > header {
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #173451;
  background: transparent;
  box-shadow: none;
  text-align: left;
}
#app-screen .student-home-section h3 { color: #173451; }
#app-screen .student-home-section header > button { color: #086eaf; }
#app-screen .student-home-stat small,
#app-screen .student-home-quick-grid small { color: #4f6880; font-size: 10px; }
#app-screen .student-empty-state {
  border-color: #bfd2e2;
  color: #425d76;
  background: #f7fbfe;
  font-size: 12px;
}

body.student-tutorial-open { overflow: hidden; }
.student-tutorial-modal[hidden] { display: none !important; }
.student-tutorial-modal {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 31, 52, .58);
  backdrop-filter: blur(5px);
  animation: student-tutorial-fade-in .18s ease-out;
}
.student-tutorial-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; cursor: default; }
.student-tutorial-dialog {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: min(680px, calc(100vh - 40px));
  overflow: auto;
  padding: 24px;
  border: 1px solid #dbe8f2;
  border-radius: 17px;
  color: #203d59;
  background: #fff;
  box-shadow: 0 24px 70px rgba(8, 29, 49, .28);
  animation: student-tutorial-rise-in .22s ease-out;
}
.student-tutorial-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
  text-align: left;
}
.student-tutorial-header > div > span,
.student-tutorial-eyebrow { color: #0879be; font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.student-tutorial-header p { margin: 5px 0 0; color: #647d94; font-size: 11px; }
.student-tutorial-header p b { color: #173451; }
.student-tutorial-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid #dce8f2;
  border-radius: 8px;
  color: #395b77;
  background: #f7fbfe;
  font-size: 22px;
  cursor: pointer;
}
.student-tutorial-progress { height: 6px; overflow: hidden; margin: 17px 0 22px; border-radius: 99px; background: #e5eef5; }
.student-tutorial-progress span { display: block; width: 20%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #20a2ed, #0877c5); transition: width .2s ease; }
.student-tutorial-body { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 17px; align-items: start; }
.student-tutorial-step-number { display: grid; width: 50px; height: 50px; place-items: center; border: 1px solid #cae4f5; border-radius: 14px; color: #0877c5; background: #edf7fe; font-size: 19px; font-weight: 800; }
.student-tutorial-copy h2 { margin: 5px 0 8px; color: #173451; font-size: 23px; line-height: 1.25; }
.student-tutorial-copy > p { margin: 0; color: #4e6881; font-size: 13px; line-height: 1.6; }
.student-tutorial-copy ol { display: grid; gap: 9px; margin: 17px 0 0; padding: 0; list-style: none; counter-reset: tutorial-point; }
.student-tutorial-copy li { position: relative; min-height: 38px; padding: 9px 11px 9px 39px; border: 1px solid #e3edf5; border-radius: 8px; color: #38556f; background: #f8fbfe; font-size: 12px; line-height: 1.5; counter-increment: tutorial-point; }
.student-tutorial-copy li::before { position: absolute; top: 8px; left: 11px; display: grid; width: 19px; height: 19px; place-items: center; border-radius: 50%; color: #0877c5; background: #e3f2fc; content: counter(tutorial-point); font-size: 10px; font-weight: 800; }
.student-tutorial-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 15px; border-top: 1px solid #e8eff5; }
.student-tutorial-footer button { min-height: 38px; padding: 8px 13px; border: 1px solid #d6e4ef; border-radius: 8px; color: #31516e; background: #fff; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.student-tutorial-footer button:disabled { opacity: .45; cursor: not-allowed; }
.student-tutorial-footer .student-tutorial-next { border-color: #087bc9; color: #fff; background: #108bd8; }
.student-tutorial-indicators { display: flex; align-items: center; justify-content: center; gap: 6px; }
.student-tutorial-indicators button { width: 9px; min-width: 9px; min-height: 9px; height: 9px; padding: 0; border: 0; border-radius: 99px; background: #cad8e4; }
.student-tutorial-indicators button.is-active { width: 22px; background: #168ee2; }
.student-tutorial-indicators button.is-complete { background: #65b4e7; }
.student-tutorial-dialog button:focus-visible { outline: 3px solid #69b8ed; outline-offset: 3px; }
@keyframes student-tutorial-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes student-tutorial-rise-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 560px) {
  .student-tutorial-modal { align-items: end; padding: 10px; }
  .student-tutorial-dialog { max-height: calc(100vh - 20px); padding: 18px; border-radius: 15px; }
  .student-tutorial-body { grid-template-columns: 40px minmax(0, 1fr); gap: 11px; }
  .student-tutorial-step-number { width: 38px; height: 38px; border-radius: 11px; font-size: 16px; }
  .student-tutorial-copy h2 { font-size: 19px; }
  .student-tutorial-copy > p { font-size: 12px; }
  .student-tutorial-copy li { font-size: 11px; }
  .student-tutorial-footer { gap: 7px; }
  .student-tutorial-footer button { padding: 7px 9px; font-size: 10px; }
  .student-tutorial-indicators { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .student-tutorial-modal, .student-tutorial-dialog { animation: none; }
  .student-tutorial-progress span { transition: none; }
}

/* Student tympanometry layout follows the paired audiology-card reference. */
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 13px;
  border: 1px solid #e0eaf3;
  border-radius: 12px;
  box-shadow: none;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-card-right {
  border-top: 3px solid #df3038;
  background: linear-gradient(180deg, #fffafa, #fff);
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-card-left {
  border-top: 3px solid #176fe5;
  background: linear-gradient(180deg, #f8fbff, #fff);
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-card.is-selected {
  box-shadow: 0 0 0 2px rgba(22, 142, 226, .16);
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-card h4 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #df3038;
  font-size: 14px;
  font-weight: 800;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-card-left h4 { color: #176fe5; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-card h4 span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: #df3038;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-card-left h4 span { color: #176fe5; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-content {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(145px, .85fr);
  align-items: stretch;
  gap: 11px;
  min-width: 0;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-wrap {
  min-width: 0;
  height: 250px;
  padding: 5px;
  border: 1px solid #edf1f5;
  border-radius: 9px;
  background: rgba(255, 255, 255, .84);
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-parameter-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e7eef5;
  border-radius: 10px;
  background: rgba(255, 255, 255, .82);
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-parameter-panel h5 {
  margin: 0;
  color: #173451;
  font-size: 13px;
  font-weight: 800;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-measures {
  display: grid;
  align-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-measures div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #edf2f7;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-measures div:last-child { border-bottom: 0; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-measures dt {
  color: #526b83;
  font-size: 11px;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-measures dd {
  margin: 0;
  color: #173451;
  font-size: 14px;
  font-weight: 800;
  text-align: right;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-answer-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 11px;
  padding: 14px;
  border: 1px solid #dce8f3;
  border-radius: 11px;
  background: #fff;
  box-shadow: none;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-answer-heading h4 {
  margin: 0 0 3px;
  color: #173451;
  font-size: 14px;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-answer-heading p {
  margin: 0;
  color: #637a90;
  font-size: 11px;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-answer-controls {
  display: grid;
  grid-template-columns: minmax(150px, .75fr) minmax(170px, 1fr) auto minmax(125px, .65fr);
  align-items: end;
  gap: 10px;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-ear-control,
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-type-control { margin: 0; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-type-control label {
  display: block;
  margin: 0 0 6px;
  color: #526b83;
  font-size: 10px;
  font-weight: 800;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator #student-tymp-answer {
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cfe1ef;
  border-radius: 8px;
  color: #173451;
  background: #fbfdff;
  font-size: 12px;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator #student-check-tymp {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 11px;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-metrics {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 7px 12px;
  min-height: 40px;
  padding: 8px 11px;
  border-radius: 8px;
  color: #526b83;
  background: #eff7fd;
  font-size: 10px;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-metrics strong { color: #173451; font-size: 16px; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator #student-tymp-feedback {
  min-height: 17px;
  margin: 0;
  color: #526b83;
  font-size: 11px;
  line-height: 1.45;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-guidance {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid #d4eaf8;
  border-radius: 11px;
  color: #365a78;
  background: linear-gradient(105deg, #eaf7ff, #f5fbff);
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-guidance > span {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #4ba4db;
  font-size: 17px;
  font-weight: 800;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-guidance p {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
}
@media (max-width: 980px) {
  #app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  #app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-content { grid-template-columns: minmax(0, 1.4fr) minmax(125px, .8fr); }
  #app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-wrap { height: 230px; }
  #app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-answer-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-metrics { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  #app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-content { grid-template-columns: 1fr; }
  #app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-chart-wrap { height: 240px; }
  #app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-parameter-panel { padding: 10px; }
  #app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-measures { grid-template-columns: 1fr; }
  #app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-answer-controls { grid-template-columns: 1fr; }
  #app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-metrics { grid-column: auto; }
}

#app-screen:has(.user-header.student) #student-tympanometry-simulator > .student-simulator-header { display: none; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-parameter-panel {
  gap: 7px;
  padding: 11px;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-answer-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-answer-field label {
  color: #526b83;
  font-size: 11px;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-answer-field select {
  min-width: 60px;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid #dce7f0;
  border-radius: 7px;
  color: #173451;
  background: #fbfdff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-measures div { padding: 6px 0; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-measures dt { font-size: 10px; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-measures dd { font-size: 12px; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-check-ear {
  justify-self: end;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid #d1e3f1;
  border-radius: 7px;
  color: #146ca7;
  background: #f6fbff;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-check-ear:disabled { opacity: .55; cursor: not-allowed; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-answer-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  border: 0;
  border-radius: 9px;
  background: #f1f8fd;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator #student-tymp-feedback {
  min-height: 0;
  font-size: 10px;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-metrics {
  display: grid;
  grid-template-columns: auto auto auto auto;
  align-items: center;
  gap: 4px 7px;
  min-height: 0;
  padding: 5px 9px;
  background: #e4f2fc;
  font-size: 9px;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-metrics strong { font-size: 12px; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-guidance {
  min-height: 58px;
  padding: 10px 14px;
}
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-guidance > div { display: grid; gap: 2px; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-guidance strong { color: #173451; font-size: 13px; }
#app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-guidance p { font-size: 11px; }
#app-screen:has(.user-header.student) .student-step-navigation { display: flex; justify-content: flex-end; padding-top: 8px; }
#app-screen:has(.user-header.student) .student-step-navigation button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 10px; padding: 8px 16px; border: 0; border-radius: 7px; color: #fff; background: #1687d2; box-shadow: 0 5px 12px rgba(22, 135, 210, .16); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
#app-screen:has(.user-header.student) .student-step-navigation button:hover { background: #0878bf; }
#app-screen:has(.user-header.student) .student-step-navigation button:focus-visible { outline: 3px solid rgba(22, 135, 210, .28); outline-offset: 2px; }
#app-screen:has(.user-header.student) .student-step-navigation button span { font-size: 16px; line-height: 1; }
#app-screen:has(.user-header.student) .student-case-finalization { display: grid; gap: 10px; margin-top: 10px; padding: 12px; border: 1px solid #d9e7f1; border-radius: 10px; background: #f5f9fc; }
#app-screen:has(.user-header.student) .student-case-finalization .student-case-completion-header { align-items: center; gap: 14px; }
#app-screen:has(.user-header.student) .student-case-finalization .student-case-completion-header h3 { margin: 0 0 3px; color: #173451; font-size: 15px; }
#app-screen:has(.user-header.student) .student-case-finalization .student-case-completion-header p:last-child { color: #526b83; font-size: 11px; }
#app-screen:has(.user-header.student) .student-case-finalization #student-finish-case { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; padding: 8px 14px; border: 0; border-radius: 7px; color: #fff; background: #1687d2; box-shadow: 0 5px 12px rgba(22, 135, 210, .16); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
#app-screen:has(.user-header.student) .student-case-finalization #student-finish-case:disabled { cursor: not-allowed; background: #a9bac8; box-shadow: none; }
#app-screen:has(.user-header.student) .student-case-finalization .student-case-progress-grid { grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 7px; }
#app-screen:has(.user-header.student) .student-case-finalization .student-case-progress { padding: 9px; border-radius: 8px; }
#app-screen:has(.user-header.student) .student-case-finalization .student-case-progress strong { font-size: 17px; }

/* Student case answer key: read-only, complete feedback by assessment stage. */
#app-screen .student-case-performance {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
  padding: 16px;
  border: 1px solid #d8e7f2;
  border-radius: 12px;
  color: #173451;
  background: #fff;
}
#app-screen .student-case-performance-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 2px 2px 12px; border-bottom: 1px solid #e2edf5; }
#app-screen .student-case-performance-score { flex: 1; display: grid; grid-template-columns: auto minmax(100px, 1fr); align-items: center; gap: 4px 12px; }
#app-screen .student-case-performance-score > span { grid-column: 1 / -1; color: #173451; font-size: 14px; font-weight: 800; }
#app-screen .student-case-score-meter { height: 9px; overflow: hidden; border-radius: 99px; background: #e5edf4; }
#app-screen .student-case-score-meter > span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #16a36a, #36c18a); transition: width .35s ease; }
#app-screen .student-case-performance-score small { grid-column: 1 / -1; color: #5c7388; font-size: 11px; }
#app-screen .student-case-score-value { color: #173451; font-size: 24px; white-space: nowrap; }
#app-screen .student-case-feedback-tabs { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0; }
#app-screen .student-case-feedback-tabs [role="tab"] { min-height: 34px; padding: 7px 12px; border: 1px solid #d9e6ef; border-radius: 7px; color: #365873; background: #f3f8fc; font-size: 11px; font-weight: 800; }
#app-screen .student-case-feedback-tabs [role="tab"][aria-selected="true"] { border-color: #1687d2; color: #fff; background: #1687d2; }
#app-screen .student-case-feedback-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .38fr); align-items: start; gap: 12px; min-width: 0; }
#app-screen .student-case-feedback-panel { min-width: 0; display: grid; align-content: start; gap: 11px; }
#app-screen .student-case-feedback-panel[hidden],
#app-screen .student-case-performance[hidden],
#app-screen .student-case-progress-grid[hidden],
#app-screen #student-finish-case[hidden] { display: none !important; }
#app-screen .student-case-feedback-summary { min-width: 0; }
#app-screen .student-feedback-card { padding: 13px; border: 1px solid #d8e7f2; border-radius: 9px; color: #38546c; background: #f5f9fc; }
#app-screen .student-feedback-card.is-positive { border-color: #bfe7d1; background: #effaf4; }
#app-screen .student-feedback-card.is-review { border-color: #f0dfba; background: #fff9eb; }
#app-screen .student-feedback-card-heading { display: flex; align-items: center; gap: 9px; }
#app-screen .student-feedback-card-heading > span { flex: 0 0 26px; display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; color: #fff; background: #1aa36a; font-weight: 900; }
#app-screen .student-feedback-card.is-review .student-feedback-card-heading > span { background: #c78512; }
#app-screen .student-feedback-card-heading > div { display: grid; gap: 2px; }
#app-screen .student-feedback-card-heading strong { color: #173451; font-size: 13px; }
#app-screen .student-feedback-card-heading small { color: #5c7388; font-size: 10px; }
#app-screen .student-feedback-card p,
#app-screen .student-feedback-card ul { margin: 8px 0 0; color: #48637a; font-size: 10px; line-height: 1.55; }
#app-screen .student-feedback-card ul { padding-left: 16px; }
#app-screen .student-feedback-two-column,
#app-screen .student-feedback-audiometry-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .42fr); align-items: start; gap: 11px; min-width: 0; }
#app-screen .student-feedback-audiometry-layout { grid-template-columns: minmax(0, 1.25fr) minmax(270px, .9fr); }
#app-screen .student-feedback-audiogram-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; }
#app-screen .student-feedback-audiogram,
#app-screen .student-feedback-tymp-chart { min-width: 0; padding: 9px; border: 1px solid #e0eaf2; border-radius: 8px; background: #fff; }
#app-screen .student-feedback-audiogram-right,
#app-screen .student-feedback-tymp-chart.student-feedback-audiogram-right { border-top: 3px solid #df3038; }
#app-screen .student-feedback-audiogram-left,
#app-screen .student-feedback-tymp-chart.student-feedback-audiogram-left { border-top: 3px solid #176fe5; }
#app-screen .student-feedback-audiogram h4,
#app-screen .student-feedback-tymp-chart h4 { margin: 0 0 6px; color: #173451; font-size: 11px; }
#app-screen .student-feedback-audiogram > div { height: 190px; }
#app-screen .student-feedback-chart-legend { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; color: #405d76; font-size: 10px; }
#app-screen .student-feedback-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
#app-screen .student-feedback-chart-legend i { width: 10px; height: 3px; border-radius: 4px; background: #df3038; }
#app-screen .student-feedback-chart-legend i.is-answer { background: repeating-linear-gradient(90deg, #60778c 0 3px, transparent 3px 5px); }
#app-screen .student-feedback-route-tabs { display: flex; gap: 6px; }
#app-screen .student-feedback-route-tabs button { min-height: 30px; padding: 5px 10px; border: 1px solid #d9e6ef; border-radius: 6px; color: #365873; background: #f3f8fc; font-size: 10px; font-weight: 800; }
#app-screen .student-feedback-route-tabs button[aria-pressed="true"] { border-color: #1687d2; color: #fff; background: #1687d2; }
#app-screen .student-feedback-comparison { min-width: 0; overflow: hidden; border: 1px solid #dce7ef; border-radius: 8px; background: #fff; }
#app-screen .student-feedback-comparison > h4 { margin: 0; padding: 9px 10px; border-bottom: 1px solid #e3edf4; color: #173451; font-size: 11px; }
#app-screen .student-feedback-table-scroll { max-width: 100%; overflow: auto; }
#app-screen .student-feedback-comparison table { width: 100%; border-collapse: collapse; font-size: 9px; }
#app-screen .student-feedback-comparison th,
#app-screen .student-feedback-comparison td { padding: 6px 5px; border-bottom: 1px solid #e8eff4; color: #36516a; text-align: center; white-space: nowrap; }
#app-screen .student-feedback-comparison thead th { color: #24435f; background: #f2f7fb; font-weight: 800; }
#app-screen .student-feedback-comparison tbody th { text-align: left; }
#app-screen .student-feedback-comparison .is-right-ear { color: #c62932; background: #fff1f1; }
#app-screen .student-feedback-comparison .is-left-ear { color: #1465c7; background: #eef6ff; }
#app-screen .student-feedback-comparison td small { display: block; margin-top: 2px; color: #71869a; font-size: 8px; }
#app-screen .student-feedback-route-note { margin: 7px 9px; color: #60788e; font-size: 9px; line-height: 1.5; }
#app-screen .student-feedback-status { font-weight: 800; }
#app-screen .student-feedback-status.is-correct { color: #12804f; }
#app-screen .student-feedback-status.is-incorrect { color: #bd343b; }
#app-screen .student-feedback-status.is-pending { color: #8b6a2d; }
#app-screen .student-feedback-tymp-review { grid-template-columns: minmax(0, 1.2fr) minmax(220px, .8fr); }
#app-screen .student-feedback-tymp-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#app-screen .student-feedback-tymp-chart > div { height: 165px; }
#app-screen .student-feedback-ear-results { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 0; padding: 0; list-style: none; }
#app-screen .student-feedback-ear-results li { display: grid; gap: 4px; padding: 9px; border: 1px solid #e0eaf2; border-radius: 7px; color: #49647b; font-size: 9px; }
#app-screen .student-feedback-ear-results li > strong { color: #173451; }
#app-screen .student-feedback-ear-results li > b { justify-self: start; }
#app-screen .student-feedback-comment-review { padding: 10px; border-top: 1px solid #e3edf4; }
#app-screen .student-feedback-comment-review h4 { margin: 0 0 6px; color: #173451; font-size: 10px; }
#app-screen .student-feedback-comment-review blockquote { margin: 0; color: #49647b; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
#app-screen .student-case-performance-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding-top: 11px; border-top: 1px solid #e2edf5; }
#app-screen .student-case-performance-footer #student-next-case { min-width: 150px; background: #1687d2; }
#app-screen .student-case-performance-breakdown > div { padding: 8px 9px; }
@media (max-width: 1050px) {
  #app-screen .student-case-feedback-content,
  #app-screen .student-feedback-two-column,
  #app-screen .student-feedback-audiometry-layout,
  #app-screen .student-feedback-tymp-review { grid-template-columns: minmax(0, 1fr); }
  #app-screen .student-case-feedback-summary { grid-row: 1; }
}
@media (max-width: 640px) {
  #app-screen .student-case-performance-header { align-items: flex-start; }
  #app-screen .student-case-feedback-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app-screen .student-case-feedback-tabs [role="tab"] { padding-inline: 6px; }
  #app-screen .student-feedback-audiogram-grid,
  #app-screen .student-feedback-tymp-charts { grid-template-columns: minmax(0, 1fr); }
  #app-screen .student-feedback-audiogram > div { height: 210px; }
  #app-screen .student-feedback-ear-results { grid-template-columns: minmax(0, 1fr); }
  #app-screen .student-case-performance-footer { grid-template-columns: minmax(0, 1fr); }
  #app-screen .student-case-performance-footer #student-next-case { width: 100%; }
}

@media (max-width: 620px) {
  #app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-answer-card { grid-template-columns: 1fr; }
  #app-screen:has(.user-header.student) #student-tympanometry-simulator .student-tymp-metrics { justify-content: start; }
  #app-screen:has(.user-header.student) .student-step-navigation button,
  #app-screen:has(.user-header.student) .student-case-finalization #student-finish-case { width: 100%; }
  #app-screen:has(.user-header.student) .student-case-finalization .student-case-completion-header { align-items: stretch; flex-direction: column; }
}
