/* Offline Tailwind & iMD Medical Examiner Core CSS */
*, ::before, ::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-width: 0;
  border-style: solid;
  border-color: currentColor;
}

:root {
  --app-max-width: 1020px;
  --app-gutter: 16px;
  --bg-app: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  --bg-header: rgba(15, 43, 72, 0.94);
  --header-text: #ffffff;
  --header-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --accent-primary: #0284c7;
  --accent-primary-hover: #0369a1;
  --accent-soft: #e0f2fe;
  --imd-blue: #0f3c64;
  --imd-green: #10b981;
  --imd-green-bg: #ecfdf5;
  --imd-green-border: #a7f3d0;
  --imd-red: #ef4444;
  --imd-red-bg: #fef2f2;
  --imd-red-border: #fecaca;
  --imd-yellow: #f59e0b;
}

@media (max-width: 640px) {
  :root {
    --app-gutter: 12px;
  }
}

.dark {
  --bg-app: #080d16;
  --bg-surface: #0f172a;
  --bg-card: #131c31;
  --bg-card-subtle: #1e293b;
  --bg-header: rgba(10, 20, 36, 0.94);
  --header-text: #f1f5f9;
  --header-muted: #94a3b8;
  --border-color: #1e293b;
  --border-strong: #334155;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --accent-primary: #38bdf8;
  --accent-primary-hover: #7dd3fc;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --imd-blue: #1e293b;
  --imd-green: #34d399;
  --imd-green-bg: rgba(16, 185, 129, 0.12);
  --imd-green-border: rgba(16, 185, 129, 0.3);
  --imd-red: #f87171;
  --imd-red-bg: rgba(239, 68, 68, 0.12);
  --imd-red-border: rgba(239, 68, 68, 0.3);
  --imd-yellow: #fbbf24;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

html, body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header Styles */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: var(--bg-header);
  color: var(--header-text);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Layout Wrappers */
.view-container {
  padding-top: 76px;
  padding-bottom: 84px;
  max-width: var(--app-max-width);
  width: 100%;
  margin: 0 auto;
  padding-left: var(--app-gutter);
  padding-right: var(--app-gutter);
  box-sizing: border-box;
}

/* Header Icon Buttons */
.icon-btn {
  background: transparent;
  border: none;
  color: var(--header-text);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.12);
}
.icon-btn.active {
  color: #fbbf24;
}

/* Home / Dashboard Menu Items */
.home-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 24px;
  margin-bottom: 10px;
  padding-left: 4px;
}

.menu-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
}
.menu-card:hover {
  border-color: var(--border-strong);
  background-color: var(--bg-card-subtle);
}

.menu-card-title {
  font-size: 15px;
  font-weight: 550;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Question Viewer Content */
.card-stem {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  margin-bottom: 16px;
}

.stem-text {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-main);
}
.stem-text p {
  margin-bottom: 12px;
}

/* Radio Options Table */
.options-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.option-row {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.option-row:hover:not(.locked) {
  background-color: var(--bg-card-subtle);
  border-color: var(--border-strong);
}

.option-row td {
  vertical-align: middle;
}

.option-icon-cell {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  padding: 10px 0 10px 10px;
  text-align: center;
  vertical-align: middle;
}

.option-icon-wrap {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  flex-shrink: 0;
}

.option-radio-cell {
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  padding: 10px 0;
  text-align: center;
  vertical-align: middle;
}

.option-radio-cell input[type="radio"] {
  cursor: pointer;
  width: 17px;
  height: 17px;
  margin: 0 auto;
  display: block;
}

.option-letter-cell {
  width: 26px;
  min-width: 26px;
  max-width: 26px;
  padding: 10px 0;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  vertical-align: middle;
  text-align: left;
}

.option-text-cell {
  padding: 10px 16px 10px 4px;
  font-size: 15px;
  color: var(--text-main);
  vertical-align: middle;
  word-break: break-word;
}

.option-stat-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 13px;
  color: var(--text-subtle);
  font-weight: 500;
}

/* Result Banner (Matching iMD Screenshot 1) */
.result-banner {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 18px;
  margin-bottom: 18px;
}
.result-statement {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.result-pct {
  font-size: 13.5px;
  color: var(--text-subtle);
}

/* Explanation Area */
.card-explanation {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  margin-top: 16px;
}

.explanation-heading {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}

.explanation-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
}

.explanation-body p {
  margin-bottom: 12px;
}

.explanation-body ul, .explanation-body ol {
  margin: 12px 0 12px 24px;
}

.explanation-body li {
  margin-bottom: 6px;
}

.explanation-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  margin: 14px 0;
  display: block;
  background-color: #ffffff;
}

/* Medical Tables Rendering */
.explanation-body table, table.table {
  width: 100% !important;
  margin: 16px 0 !important;
  border-collapse: collapse !important;
  border: 1px solid var(--border-color) !important;
  font-size: 13.5px !important;
  border-radius: 6px;
  overflow: hidden;
}

.explanation-body th, table.table th {
  background-color: var(--bg-card-subtle) !important;
  color: var(--text-main) !important;
  font-weight: 650 !important;
  text-align: left !important;
  padding: 10px 14px !important;
  border: 1px solid var(--border-color) !important;
}

.explanation-body td, table.table td {
  padding: 9px 14px !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-muted) !important;
}

.explanation-body tr:nth-child(even) td, table.table-striped tbody tr:nth-child(odd) td {
  background-color: rgba(148, 163, 184, 0.05) !important;
}

/* Footer Metadata (Matching Screenshot 2) */
.footer-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 6px;
  margin-top: 14px;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 550;
  color: var(--text-subtle);
}

/* Bottom Floating Navigation */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.bottom-nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-nav {
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-nav-prev {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-nav-prev:hover:not(:disabled) {
  background-color: var(--bg-card-subtle);
  border-color: var(--border-strong);
}
.btn-nav-next {
  background-color: var(--accent-primary);
  color: #ffffff;
  border: none;
}
.btn-nav-next:hover:not(:disabled) {
  background-color: var(--accent-primary-hover);
}
.btn-nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Modal Dialogs (Subject Picker, Test Config, Palette) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-window {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
}
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Palette Grid */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.palette-cell {
  height: 42px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}
.palette-cell:hover {
  border-color: var(--accent-primary);
}
.palette-cell.current {
  border: 2px solid var(--accent-primary);
}
.palette-cell.correct {
  background-color: var(--imd-green-bg);
  color: var(--imd-green);
  border-color: var(--imd-green-border);
}
.palette-cell.wrong {
  background-color: var(--imd-red-bg);
  color: var(--imd-red);
  border-color: var(--imd-red-border);
}
.palette-cell.flagged::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: var(--imd-yellow);
}

/* Green count pill badge in lists (Exact iMD Android match) */
.count-badge-green {
  background-color: #0b8043;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 9999px;
  min-width: 32px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.01em;
}

/* Header Search Pill (Matches Screenshots 1, 2, 3) */
.header-search-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 6px 10px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 550;
  cursor: pointer;
  transition: opacity 0.15s ease;
  user-select: none;
}
.header-search-pill:hover {
  opacity: 0.85;
}

/* Form Controls */
.form-select, .form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-size: 14.5px;
  outline: none;
  margin-bottom: 14px;
}
.form-select:focus, .form-input:focus {
  border-color: var(--accent-primary);
}

/* Search Header & Input Bar */
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 5px 12px;
  width: 100%;
  transition: background-color 0.15s, border-color 0.15s;
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.search-input-wrap:focus-within {
  background-color: #ffffff;
  border-color: #ffffff;
}
.search-input-icon {
  display: flex;
  align-items: center;
  margin-right: 8px;
  color: var(--header-muted);
}
.search-input-wrap:focus-within .search-input-icon {
  color: #64748b;
}
.search-bar-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14.5px;
  color: #ffffff;
}
.search-input-wrap:focus-within .search-bar-input {
  color: #0f172a;
}
.search-bar-input::placeholder {
  color: var(--header-muted);
}
.search-clear-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}
.search-clear-btn:hover {
  color: #ef4444;
}

/* Autocomplete Dropdown */
.search-autocomplete-box {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.22);
  max-height: 380px;
  overflow-y: auto;
  z-index: 1000;
}
.search-suggest-item {
  padding: 10px 16px;
  font-size: 14px;
  color: #1e293b;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.1s, color 0.1s;
}
.search-suggest-item:last-child {
  border-bottom: none;
}
.search-suggest-item:hover {
  background-color: #f1f5f9;
  color: var(--accent-primary);
}

/* Search Result Cards */
.search-result-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.search-result-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  border-color: var(--border-strong);
}
.search-result-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}
.search-result-snippet {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
}
.search-result-type-badge {
  color: #ef4444;
  font-weight: 600;
  margin-right: 6px;
}

/* Question List Cards (Screenshot 2) */
.qlist-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.qlist-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  border-color: var(--border-strong);
}
.qlist-card-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}
.qlist-card-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Home Settings Action Buttons (Screenshots 3 & 4) */
.settings-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 15.5px;
  font-weight: 700;
  color: #ffffff;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  display: block;
  box-sizing: border-box;
}
.settings-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.settings-btn:active {
  transform: translateY(0);
}
.settings-btn-red {
  background-color: #dc2626;
}
.settings-btn-orange {
  background-color: #ea580c;
}
.settings-btn-blue {
  background-color: #0284c7;
}
.settings-btn-darkblue {
  background-color: #1d4ed8;
}
.settings-btn-purple {
  background-color: #4338ca;
}
/* Examination Hub Card Grid & Avatars */
.hub-category-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 26px;
  margin-bottom: 12px;
  padding-left: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.exam-hub-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px 16px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.exam-hub-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  background-color: var(--bg-card-subtle);
}
.exam-hub-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  border: 2px solid var(--border-color);
}
.exam-hub-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 8px;
  flex-grow: 1;
}
.exam-hub-badge-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}

/* UpToDate Clinical Knowledge Base & Medical Reader Styles */
.utd-container {
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: 12px 16px 80px;
}
.utd-header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.utd-breadcrumb-item {
  color: var(--accent-primary);
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
}
.utd-breadcrumb-item:hover {
  text-decoration: underline;
}
.utd-reader-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 16px;
  gap: 8px;
}
.utd-reader-title-area {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}
.utd-topic-h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 8px;
}
.utd-topic-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.utd-badge-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.utd-badge-med { background: rgba(14, 165, 233, 0.12); color: #0284c7; }
.utd-badge-drug { background: rgba(16, 185, 129, 0.12); color: #059669; }
.utd-badge-pat { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.utd-body {
  font-size: 16px;
  line-height: 1.78;
  color: var(--text-main);
}
.utd-body h1, .utd-body h2, .utd-body h3, .utd-body h4 {
  font-weight: 750;
  color: var(--text-main);
  margin-top: 1.6em;
  margin-bottom: 0.6em;
  line-height: 1.35;
}
.utd-body h1 {
  font-size: 20px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border-color);
  color: var(--accent-primary);
}
.utd-body h2 { font-size: 18px; }
.utd-body h3 { font-size: 16px; color: var(--text-main); }
.utd-body p { margin-bottom: 1.1em; }
.utd-body ul, .utd-body ol { margin: 0.8em 0 1.2em 24px; }
.utd-body li { margin-bottom: 6px; }
.utd-body strong, .utd-body b { font-weight: 650; color: var(--text-main); }
.utd-body table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 20px 0 !important;
  font-size: 14px !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px;
  overflow: hidden;
}
.utd-body th {
  background-color: var(--bg-card-subtle) !important;
  color: var(--text-main) !important;
  font-weight: 700 !important;
  text-align: left !important;
  padding: 10px 14px !important;
  border: 1px solid var(--border-color) !important;
}
.utd-body td {
  padding: 9px 14px !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
  vertical-align: top !important;
}
.utd-body tr:nth-child(even) td {
  background-color: rgba(148, 163, 184, 0.05) !important;
}
.utd-body .recommendation,
.utd-body .summary,
.utd-body .key-point,
.utd-body .clinical-box,
.utd-body .grading {
  background-color: var(--accent-soft);
  border-left: 4px solid var(--accent-primary);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 18px 0;
  font-size: 15px;
}
.utd-body a[href^="javascript:appAction"] {
  color: var(--accent-primary) !important;
  font-weight: 550;
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-primary);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.utd-body a[href^="javascript:appAction"]:hover {
  background-color: var(--accent-soft);
  border-bottom-style: solid;
}
.utd-outline-drawer {
  position: fixed;
  top: 60px;
  right: -340px;
  width: 320px;
  bottom: 0;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  z-index: 90;
  transition: right 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  padding: 18px 16px 40px;
}
.utd-outline-drawer.open { right: 0; }
.utd-outline-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}
.utd-outline-link {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
  margin-bottom: 3px;
  transition: all 0.12s ease;
}
.utd-outline-link:hover {
  background: var(--accent-soft);
  color: var(--accent-primary);
}
.utd-graphic-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.utd-graphic-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(0,0,0,0.35);
}
.utd-graphic-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
}
.utd-graphic-modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
  text-align: center;
}
.utd-graphic-modal-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0 auto;
  display: block;
  transition: transform 0.2s ease;
}

/* Textbook Documentation Reader */
.textbook-doc-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-main);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 24px;
}
.textbook-doc-body h1, .textbook-doc-body h2, .textbook-doc-body h3 {
  margin-top: 1.4em;
  margin-bottom: 0.6em;
  font-weight: 700;
  color: var(--text-main);
}
.textbook-doc-body p {
  margin-bottom: 1em;
}
.textbook-doc-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 14px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.textbook-doc-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
.textbook-doc-body th, .textbook-doc-body td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  font-size: 14px;
}

/* Interactive Clinical Video & Media Links */
.video-link {
  color: var(--accent-primary) !important;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px dotted var(--accent-primary);
  padding: 1px 6px 2px;
  border-radius: 4px;
  background: var(--accent-soft);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: baseline;
}
.video-link:hover {
  background: rgba(2, 132, 199, 0.22);
  border-bottom-style: solid;
  transform: translateY(-1px);
}
.video-link-badge {
  display: inline-flex;
  align-items: center;
  color: var(--accent-primary);
}

/* Video Lightbox & Player Modal */
.video-modal-window {
  background: #090e17;
  border: 1px solid #1e293b;
  border-radius: 12px;
  width: 95vw;
  max-width: 820px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
}
.video-modal-header {
  padding: 14px 20px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.video-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-hd-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #0284c7;
  color: #ffffff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.video-modal-body {
  padding: 16px;
  background: #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}
.video-loader-card {
  padding: 32px 24px;
  text-align: center;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.video-pulse-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(2, 132, 199, 0.15);
  border: 2px solid #0284c7;
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 14px rgba(56, 189, 248, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}
.video-loader-title {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 6px;
}
.video-loader-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 20px;
}
.video-progress-track {
  width: 100%;
  height: 8px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.video-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 999px;
  transition: width 0.15s ease;
}
.video-progress-stats {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 12.5px;
  color: #cbd5e1;
  font-weight: 550;
  margin-bottom: 14px;
}
.video-chunk-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
}
.video-chunk-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  transition: all 0.2s ease;
}
.video-chunk-pill.active {
  background: rgba(2, 132, 199, 0.2);
  border-color: #0284c7;
  color: #38bdf8;
}
.video-chunk-pill.complete {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
}
.video-player-wrap {
  width: 100%;
}
.video-player-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #0f172a;
  border-top: 1px solid #1e293b;
  flex-wrap: wrap;
  gap: 10px;
}
.video-speed-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.video-ctrl-label {
  font-size: 12.5px;
  color: #94a3b8;
  margin-right: 4px;
}
.btn-speed {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-speed:hover, .btn-speed.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}
.btn-download-video {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-download-video:hover {
  background: #334155;
  color: #ffffff;
}