/* ═══════════════════════════════════════════════════════════════
   Enki-Clinical — Clinical Anesthesia Mastery Form
   style.css v5.25.11
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --brand:      #0b1f33;
  --brand-dark: #071523;
  --brand-soft: #e8eef5;
  --accent:     #b86a00;
  --ok:         #0a7c52;
  --danger:     #b42318;
  --focus:      #2563eb;
  --warn:       #d97706;
  --ink:        #0f1d2e;
  --muted:      #5a6b7d;
  --line:       #d4dce8;
  --surface:    #ffffff;
  --surface-2:  #f5f8fb;
  --surface-3:  #edf2f7;
  --nav-height: 56px;
  --sidebar-w:  260px;
  --font:       "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar:    "Noto Kufi Arabic", "Segoe UI", sans-serif;
  --shadow:     0 2px 12px rgba(11,31,51,.10);
  --text:       #0f1d2e;
}

[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--surface-2); }

/* ── Arabic font — Noto Kufi Arabic in AR mode ── */
body.is-ar, body.is-ar * {
  font-family: var(--font-ar);
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.skip-link { position: absolute; top: -100px; left: 12px; z-index: 9999; padding: 6px 12px; background: var(--brand); color: #fff; border-radius: 6px; font-size: .85rem; }
.skip-link:focus { top: 12px; }

/* ── NAV ─────────────────────────────────────────────────── */
.command-nav {
  position: sticky; top: 0; z-index: 900;
  background: var(--brand); display: flex; flex-wrap: nowrap;
  align-items: center; height: var(--nav-height); padding: 0 12px; gap: 0;
}
.command-brand {
  display: flex; align-items: center; gap: 8px; background: none; border: none;
  color: #fff; cursor: pointer; padding: 0 12px 0 0; flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,.1); height: 100%; text-align: left;
}
.command-brand strong { font-size: 14px; font-weight: 700; color: #fff; display: block; }
.command-brand small  { font-size: 10px; color: rgba(255,255,255,.5); display: block; }
.brand-mark { width: 32px; height: 32px; border-radius: 7px; overflow: hidden; flex-shrink: 0; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }

.command-links { display: flex; flex: 1; align-items: center; gap: 2px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; }
.command-links::-webkit-scrollbar { display: none; }

.workspace-btn {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  border-radius: 7px; color: rgba(255,255,255,.75); font-size: 13px; font-weight: 600;
  padding: 6px 14px; min-height: 36px; white-space: nowrap; flex-shrink: 0;
  transition: background .12s, color .12s; cursor: pointer;
}
.workspace-btn:hover  { background: rgba(255,255,255,.14); color: #fff; }
.workspace-btn.active { background: rgba(255,255,255,.22); color: #fff; border-color: rgba(255,255,255,.32); }

/* ── Arabic nav — tighter fit to prevent overflow ── */
body.is-ar .workspace-btn { font-size: 11px; padding: 5px 9px; }
body.is-ar .command-links  { gap: 1px; padding: 0 4px; }
body.is-ar .command-brand  { padding: 0 8px 0 0; }

@keyframes heartbeat {
  0%,100% { transform: scale(1); }
  14%      { transform: scale(1.18); }
  28%      { transform: scale(1); }
  42%      { transform: scale(1.12); }
  56%      { transform: scale(1); }
}
.hint-heart {
  animation: heartbeat 1.8s ease-in-out infinite;
  transform-origin: center;
}
.nav-hint-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(220,50,80,0.55);
  background: rgba(220,50,80,0.1);
  color: #e8304f;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
  margin: 0 6px;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.nav-hint-btn:hover {
  background: rgba(220,50,80,0.2);
  border-color: rgba(220,50,80,0.9);
}
.nav-hint-btn:focus { outline: none; }
.nav-hint-btn:focus-visible { outline: 2px solid rgba(220,50,80,0.6); }
#hintOverlay[hidden] { display: none !important; }

.nav-hamburger {
  display: none; align-items: center; justify-content: center; flex-direction: column;
  gap: 1px; width: 44px; height: 44px; flex-shrink: 0;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px; color: #fff; cursor: pointer;
}
.nav-hamburger-icon  { font-size: 18px; line-height: 1; }
.nav-hamburger-label { font-size: 7px; letter-spacing: .8px; text-transform: uppercase; font-weight: 700; opacity: .7; }

.command-search { display: flex; align-items: center; max-width: 240px; flex: 0 0 240px; padding: 0 0 0 10px; border-left: 1px solid rgba(255,255,255,.1); }
.command-search input { width: 100%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 7px; color: #fff; font-size: 12px; padding: 7px 10px; outline: none; }
.command-search input::placeholder { color: rgba(255,255,255,.4); }

/* ── APP LAYOUT ──────────────────────────────────────────── */
.app-layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: calc(100vh - var(--nav-height) - 48px); }

/* ── SIDEBAR ─────────────────────────────────────────────── */
.side-panel {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: var(--nav-height); height: calc(100vh - var(--nav-height)); overflow-y: auto;
}
.panel-controls { padding: 12px; display: flex; flex-direction: column; gap: 7px; border-bottom: 1px solid var(--line); }
.autosave-note { margin: 0; font-size: .72rem; color: var(--muted); text-align: center; }

.btn-primary { background: var(--brand); color: #fff; border: none; border-radius: 7px; padding: 9px 14px; font-size: .83rem; font-weight: 700; width: 100%; cursor: pointer; transition: opacity .12s; }
.btn-primary:hover { opacity: .88; }
.btn-secondary { background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; color: var(--ink); font-size: .83rem; font-weight: 600; padding: 8px 14px; width: 100%; cursor: pointer; }
.btn-secondary:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; border: none; border-radius: 7px; padding: 8px 14px; font-size: .83rem; font-weight: 600; width: 100%; cursor: pointer; }

/* ── SECTION NAV ─────────────────────────────────────────── */
.section-nav { flex: 1; padding: 10px 6px; overflow-y: auto; }
.nav-label { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px 6px; }
.section-nav ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5,1fr); gap: 4px; }
.section-nav li { margin: 0; }
.section-nav a { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; width: 100%; border-radius: 7px; background: var(--surface-3); color: var(--brand); font-weight: 900; font-size: .8rem; text-decoration: none; transition: background .1s; }
.section-nav a:hover { background: #d0e4f5; }
.section-nav a.active { background: var(--brand); color: #fff; }

/* ── CONTENT ─────────────────────────────────────────────── */
.content-area { padding: 0; overflow-x: hidden; }
.workspace-block { display: block; }

/* ── TRAINING PROGRESS ───────────────────────────────────── */
.training-progress-bar { background: var(--brand); color: #fff; padding: 12px 24px; position: sticky; top: 0; z-index: 10; }
.progress-row { display: flex; gap: 12px; align-items: center; font-size: .85rem; margin-bottom: 6px; }
.progress-row strong { font-weight: 800; }
.progress-track { height: 6px; background: rgba(255,255,255,.2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: #4ade80; border-radius: 999px; transition: width .4s ease; }

/* ── ATF FORM ELEMENTS ───────────────────────────────────── */
#training-form { padding: 0; }

/* Student header card */
.atf-student-header {
  background: linear-gradient(135deg, var(--brand) 0%, #1a4060 60%, #0d5c4a 100%);
  color: #fff; padding: 28px 32px; margin-bottom: 0;
}
.atf-student-header h1 { font-size: 1.6rem; font-weight: 900; margin: 0 0 4px; }
.atf-student-header .subtitle { color: rgba(255,255,255,.7); font-size: .88rem; margin: 0 0 20px; }
.atf-student-header p { color: rgba(255,255,255,.6); font-size: .82rem; margin: 0 0 20px; }

.metadata { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.input-group { display: flex; flex-direction: column; gap: 4px; }
.input-group label { font-size: .75rem; font-weight: 600; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .05em; }
.input-group input, .input-group select {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px; color: #fff; padding: 9px 12px; font-size: .9rem; font-family: inherit; outline: none;
  transition: background .12s;
}
.input-group input:focus, .input-group select:focus { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.5); }
.input-group input::placeholder { color: rgba(255,255,255,.4); }
.input-group select option { background: var(--brand); color: #fff; }

/* Agreement box */
.agreement-box {
  background: #fff7ed; border: 2px solid #f59e0b; border-radius: 0;
  padding: 18px 32px; margin-bottom: 0;
}
.agreement-box h3 { font-size: 1rem; font-weight: 800; color: #92400e; margin: 0 0 10px; }
.agreement-box ul { margin: 0 0 14px 18px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.agreement-box li { font-size: .88rem; color: #78350f; line-height: 1.6; }
.checkbox-wrapper { display: flex; align-items: center; gap: 10px; cursor: pointer; background: rgba(245,158,11,.1); padding: 10px 14px; border-radius: 8px; }
.checkbox-wrapper input { width: 18px; height: 18px; accent-color: var(--warn); cursor: pointer; }
.checkbox-wrapper label { font-weight: 700; color: #92400e; cursor: pointer; font-size: .9rem; }

/* Sections */
.atf-section {
  background: var(--surface); border-bottom: 1px solid var(--line);
  scroll-margin-top: 120px;
}
.section-header {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 24px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  position: sticky; top: 88px; z-index: 5;
}
.section-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; background: var(--brand);
  color: #fff; font-weight: 900; font-size: .85rem; flex-shrink: 0;
}
.section-title { font-size: 1rem; font-weight: 800; color: var(--ink); }

.section-content { padding: 16px 24px 20px; display: flex; flex-direction: column; gap: 8px; }

/* Checklist items */
.checklist-item {
  display: grid; grid-template-columns: 20px 1fr; gap: 12px;
  align-items: flex-start; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); cursor: pointer;
  transition: border-color .12s, background .12s;
}
.checklist-item:hover { border-color: #93c5fd; background: #f8faff; }
.checklist-item.checked { background: #f0fdf4; border-color: #86efac; }
.checklist-item input[type="checkbox"] { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--ok); cursor: pointer; }
.checklist-item label { font-size: .89rem; line-height: 1.65; color: var(--ink); cursor: pointer; }

/* Sub-checkboxes (nested) */
.sub-items { padding-left: 20px; margin-top: 4px; display: flex; flex-direction: column; gap: 6px; }

/* Info boxes */
.info-box {
  background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 9px;
  padding: 12px 16px; font-size: .85rem; color: #0c4a6e; line-height: 1.65;
}
.info-box strong { font-weight: 700; }

/* Input fields within form */
.form-input-group { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.form-input-group label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.form-input-group input[type="text"],
.form-input-group input[type="number"],
.form-input-group textarea,
.form-input-group select,
.vital-input,
input[type="text"]:not(.input-group input),
input[type="number"],
select:not(.input-group select),
textarea {
  border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px;
  font-size: .88rem; font-family: inherit; background: var(--surface-2); outline: none; width: 100%;
}
input[type="text"]:focus, input[type="number"]:focus, textarea:focus, select:focus {
  border-color: var(--focus); background: var(--surface);
}


/* ── Patient info inputs — white background context ──── */
.patient-input-group { display: flex; flex-direction: column; gap: 4px; }
.patient-input-group label {
  font-size: .8rem; font-weight: 700;
  color: #0b1f33; text-transform: uppercase; letter-spacing: .04em;
}
.patient-input-group input,
.patient-input-group select {
  border: 1.5px solid #d1d9e0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .9rem;
  font-family: inherit;
  background: #f8fafc;
  color: #0b1f33;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s, background .15s;
}
.patient-input-group input:focus,
.patient-input-group select:focus {
  border-color: #3b82f6;
  background: #fff;
}
.patient-input-group input::placeholder { color: #94a3b8; }
/* Vital signs grid */
.vital-signs-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 10px 0; }
.vital-sign-item { display: flex; flex-direction: column; gap: 4px; }
.vital-sign-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.vital-input { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; font-size: .88rem; background: var(--surface-2); width: 100%; }

/* Radio groups */
.radio-group { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.radio-option { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; background: var(--surface-2); font-size: .85rem; transition: background .1s; }
.radio-option:hover { background: var(--brand-soft); }
.radio-option input[type="radio"] { accent-color: var(--brand); cursor: pointer; }

/* Conditional sections */
.general-anesthesia-section,
.neuraxial-section,
.regional-details,
.vent-params { display: none; }

/* Section headings within form */
.sub-section-title {
  font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--brand); margin: 14px 0 8px;
  padding-bottom: 4px; border-bottom: 2px solid var(--brand-soft);
}
h4 { font-size: .95rem; font-weight: 700; margin: 12px 0 6px; color: var(--ink); }

/* Mode description */
#mode-description { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; padding: 10px 14px; font-size: .84rem; color: #0c4a6e; margin-top: 8px; min-height: 40px; }

/* Action buttons row */
.action-buttons { display: flex; gap: 10px; flex-wrap: wrap; padding: 20px 24px; background: var(--surface); border-top: 2px solid var(--line); }
.btn { padding: 10px 20px; border-radius: 8px; font-size: .88rem; font-weight: 700; border: none; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.btn-outline { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
.btn-outline:hover { background: var(--surface-3); }

/* ── HOME WORKSPACE ──────────────────────────────────────── */
.home-hero {
  background: linear-gradient(135deg, var(--brand) 0%, #1a4060 60%, #0d5c4a 100%);
  color: #fff; padding: 40px 36px; display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center;
}
.kicker { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.55); margin: 0 0 8px; }
.home-hero h2 { font-size: 1.8rem; font-weight: 900; margin: 0 0 10px; }
.home-hero p { color: rgba(255,255,255,.7); font-size: .9rem; line-height: 1.65; margin: 0 0 20px; }
.home-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.home-actions .btn-primary { width: auto; padding: 10px 20px; font-size: .9rem; }
.home-actions .btn-secondary { width: auto; padding: 10px 20px; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; }
.home-stats { display: flex; flex-direction: column; gap: 12px; text-align: center; }
.stat { background: rgba(255,255,255,.1); border-radius: 12px; padding: 14px 20px; }
.stat span { display: block; font-size: 2rem; font-weight: 900; line-height: 1; }
.stat small { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.55); }
.home-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 0; border-bottom: 1px solid var(--line); }
.home-card { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 22px; cursor: pointer; display: flex; align-items: center; gap: 14px; transition: background .12s; }
.home-card:hover { background: var(--brand-soft); }
.home-card-icon { font-size: 1.8rem; flex-shrink: 0; }
.home-card h3 { margin: 0 0 3px; font-size: .95rem; font-weight: 800; }
.home-card p { margin: 0; font-size: .8rem; color: var(--muted); }
.home-card-arrow { margin-left: auto; color: var(--muted); font-size: 1.1rem; }

/* ── APPENDIX PLACEHOLDER ────────────────────────────────── */
.appendix-placeholder { max-width: 560px; margin: 60px auto; text-align: center; padding: 40px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.placeholder-icon { font-size: 3rem; margin-bottom: 16px; }
.appendix-placeholder h2 { margin: 0 0 12px; font-size: 1.3rem; }
.appendix-placeholder p { color: var(--muted); font-size: .9rem; line-height: 1.7; margin: 0 0 10px; }
.placeholder-sub { font-size: .8rem !important; }
.appendix-placeholder .btn-primary { display: inline-block; width: auto; margin-top: 14px; padding: 10px 22px; border-radius: 8px; text-decoration: none; font-size: .9rem; }

/* ── ABOUT ───────────────────────────────────────────────── */
.about-card { max-width: 720px; margin: 32px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px; }
.about-card h2 { margin: 0 0 12px; }
.about-desc { font-size: .92rem; line-height: 1.75; color: var(--ink); margin: 0 0 20px; }
.about-endorsements { display: flex; flex-direction: column; gap: 10px; margin: 0 0 20px; }
.endorsement { background: var(--surface-2); border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0; padding: 12px 16px; font-size: .84rem; line-height: 1.65; color: var(--ink); }
.about-author { background: var(--brand-soft); border-radius: 10px; padding: 16px; font-size: .88rem; line-height: 1.7; margin-bottom: 14px; }
.about-version { font-size: .8rem; color: var(--muted); margin: 0; }

/* ── MOBILE PORTAL ───────────────────────────────────────── */
.mobile-menu-portal { display: none; position: fixed; top: var(--nav-height); left: 0; right: 0; z-index: 9900; background: var(--brand); flex-direction: column; padding: 8px 12px 14px; gap: 4px; box-shadow: 0 6px 24px rgba(0,0,0,.15); }
.mobile-menu-portal.open { display: flex; }
.mobile-menu-portal .workspace-btn { width: 100%; text-align: left; min-height: 44px; font-size: .9rem; }
.mobile-menu-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 9800; }
.mobile-menu-overlay.open { display: block; }

/* ── TOAST ───────────────────────────────────────────────── */
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 18px; border-radius: 8px; font-size: .85rem; z-index: 9999; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.update-toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(16px); z-index: 9999; opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s; max-width: calc(100vw - 32px); }
.update-toast--visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.update-toast-inner { display: flex; align-items: center; gap: 10px; background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 13px; box-shadow: 0 8px 28px rgba(11,31,51,.22); cursor: pointer; flex-wrap: wrap; }
.update-toast-badge { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25); border-radius: 5px; padding: 2px 7px; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.update-toast-hint { font-size: 11px; opacity: .65; flex-shrink: 0; }
.update-toast-close { background: none; border: none; color: rgba(255,255,255,.7); cursor: pointer; font-size: 14px; padding: 0 2px; flex-shrink: 0; }

/* ── FOOTER ──────────────────────────────────────────────── */
.app-footer { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 10px 24px; background: var(--surface); border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); }
.app-footer-row { display: flex; align-items: center; gap: 10px; }
.app-footer-credit { font-size: 0.72rem; color: var(--muted); opacity: 0.85; text-align: center; line-height: 1.4; padding-top: 2px; }
.app-footer-credit:empty { display: none; }
.hard-refresh-btn { background: none; border: none; color: var(--muted); font-size: 1rem; cursor: pointer; border-radius: 4px; padding: 2px 4px; }
.hard-refresh-btn:hover { color: var(--ink); }
.hard-refresh-btn.spinning { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── FLOATING NOTES (from ATF) ───────────────────────────── */
.floating-notes-btn {
  position: fixed; bottom: 28px; right: 28px; width: 56px; height: 56px;
  border-radius: 50%; background: linear-gradient(135deg, var(--warn), #f97316);
  color: white; border: none; font-size: 26px; cursor: pointer;
  box-shadow: 0 8px 24px rgba(249,115,22,.35); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s;
}
.floating-notes-btn:hover { transform: scale(1.1); }
.floating-notes-btn.has-notes::after {
  content: attr(data-count); position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: white; width: 22px; height: 22px;
  border-radius: 50%; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.floating-notes-panel {
  position: fixed; bottom: 96px; right: 28px; width: 400px; max-height: 580px;
  background: #f8fafc; border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.22);
  z-index: 999; display: none; flex-direction: column; overflow: hidden;
  border: 1px solid #d4dce8;
}
.floating-notes-panel.active { display: flex; }
.notes-header { background: linear-gradient(135deg, #e67e22, #f97316); color: white; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; }
.notes-header h3 { font-size: 1rem; display: flex; align-items: center; gap: 8px; margin: 0; }
.notes-close { background: rgba(255,255,255,.25); border: none; color: white; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.notes-close:hover { background: rgba(255,255,255,.4); }
.notes-body { flex: 1; overflow-y: auto; padding: 14px; background: #eef2f7; border-bottom: 1px solid #d4dce8; }
.notes-empty { text-align: center; padding: 32px 20px; color: #5a6b7d; }
.notes-empty .notes-empty-icon { font-size: 2.5rem; margin-bottom: 10px; }
.notes-empty p { margin: 0 0 4px; font-weight: 700; color: #374151; }
.notes-empty small { font-size: .82rem; color: #6b7280; }
.note-item { background: white; padding: 12px 14px; border-radius: 10px; margin-bottom: 10px; border-left: 4px solid var(--brand); position: relative; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.note-section { font-weight: 700; color: var(--brand); font-size: .75rem; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.note-text { color: #1f2937; line-height: 1.55; font-size: .88rem; }
.note-timestamp { font-size: .7rem; color: #9ca3af; margin-top: 6px; }
.note-delete { position: absolute; top: 8px; right: 8px; background: none; border: none; color: #d1d5db; cursor: pointer; font-size: 1.1rem; padding: 0 4px; }
.note-delete:hover { color: var(--danger); }
.note-input-area { padding: 14px 16px; background: white; border-top: 1px solid #d4dce8; display: none; flex-direction: column; gap: 10px; }
.note-input-area.active { display: flex; }
.note-input-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #5a6b7d; margin: 0; }
.note-input-area select {
  border: 2px solid #d4dce8; border-radius: 8px; padding: 10px 12px;
  font-size: .88rem; font-family: inherit; width: 100%; background: #f8fafc;
  color: #1f2937; outline: none; cursor: pointer;
}
.note-input-area select:focus { border-color: var(--brand); }
.note-input-area textarea {
  resize: vertical; min-height: 100px;
  border: 2px solid #d4dce8; border-radius: 8px; padding: 10px 12px;
  font-size: .88rem; font-family: inherit; width: 100%; background: #f8fafc;
  color: #1f2937; outline: none; line-height: 1.6; box-sizing: border-box;
}
.note-input-area textarea:focus { border-color: var(--brand); background: white; }
.note-input-area textarea::placeholder { color: #9ca3af; }
.note-input-actions { display: flex; gap: 8px; }
.save-note-btn { flex: 1; background: var(--brand); color: white; border: none; border-radius: 8px; padding: 10px; font-size: .85rem; font-weight: 700; cursor: pointer; }
.save-note-btn:hover { opacity: .88; }
.cancel-note-btn { background: #f1f5f9; color: #374151; border: 1.5px solid #d4dce8; border-radius: 8px; padding: 10px 14px; font-size: .85rem; cursor: pointer; font-weight: 600; }
.cancel-note-btn:hover { background: #e2e8f0; }
.add-note-btn { display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: white; border: none; width: 100%; padding: 12px; font-size: .88rem; font-weight: 700; cursor: pointer; letter-spacing: .02em; }
.add-note-btn:hover { opacity: .88; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .side-panel { position: static; height: auto; }
  .home-hero { grid-template-columns: 1fr; }
  .home-cards { grid-template-columns: 1fr; }
  .vital-signs-grid { grid-template-columns: repeat(2,1fr); }
  .metadata { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-hamburger {
    display: flex;
    margin-left: auto;            /* LTR: push MENU to far right corner */
    margin-inline-start: auto;    /* Logical: in RTL becomes margin-right:auto -> pushes to far LEFT corner */
  }
  #commandLinks { display: none !important; }
  /* Hide search from nav on mobile — shown below instead */
  .command-search { display: none !important; }
  .command-search input { font-size: 14px; padding: 8px 10px; }
  /* Lang button stays next to brand, no flex:1 stretch */
  .nav-lang-btn { flex-shrink: 0; }
  .section-header { top: 56px; }
  .floating-notes-panel { width: calc(100vw - 24px); right: 12px; }
  .vital-signs-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  /* Keep search visible — just tighten it */
  .command-search { padding: 0 6px; }
  .command-search input { font-size: 13px; padding: 7px 8px; }
  .metadata { grid-template-columns: 1fr; }
  .atf-student-header, .agreement-box, .section-content { padding-left: 16px; padding-right: 16px; }
}

/* Ventilation CSS variables (from v2.9.9) */
:root {
  --r: 10px;
  --r2: 14px;
  --cp: #b42318;
  --cf: #2563eb;
  --cv: #0a7c52;
  --surface-strong: #f5f8fb;
}


/* ── Ventilation simulator styles ── */
.info-wrap{display:grid;grid-template-columns:220px 1fr;height:100%;overflow:hidden}
.info-sidebar{background:var(--surface);border-right:1px solid var(--line);overflow-y:auto;padding:16px 0}
.info-sidebar-section{padding:6px 16px 2px;font-size:10px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin-top:12px}
.info-nav-link{display:block;padding:6px 20px;font-size:13px;color:var(--ink);text-decoration:none;border-left:3px solid transparent;transition:all .12s}
.info-nav-link:hover{background:var(--brand-soft);color:var(--brand)}
.info-nav-link.active{border-left-color:var(--brand);background:var(--brand-soft);color:var(--brand);font-weight:600}
.info-body{overflow-y:auto;padding:28px 32px}
.info-section-title{font-size:18px;font-weight:700;color:var(--brand);margin-bottom:4px;padding-bottom:10px;border-bottom:2px solid var(--brand-soft);margin-top:8px}
.info-section-desc{color:var(--muted);font-size:13px;margin-bottom:20px}
.param-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:14px;margin-bottom:32px}
.param-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r2);overflow:hidden;box-shadow:var(--shadow)}
.param-card-head{background:var(--brand);color:#fff;padding:10px 14px;display:flex;align-items:center;justify-content:space-between}
.param-card-head.pbw{background:var(--focus)}
.param-name{font-weight:700;font-size:14px}
.param-range{font-size:11px;background:rgba(255,255,255,.15);padding:2px 8px;border-radius:20px;letter-spacing:.04em}
.param-body{padding:14px}
.param-def{font-size:13px;color:var(--ink);margin-bottom:10px;font-style:italic}
.param-effects{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:10px}
.effect-box{border-radius:6px;padding:8px 10px;font-size:12px}
.effect-up{background:#fef3e2;border:1px solid #f5c97a}
.effect-down{background:#e8f5ee;border:1px solid #74c99a}
.effect-label{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;margin-bottom:3px}
.effect-up .effect-label{color:var(--accent)}
.effect-down .effect-label{color:var(--ok)}
.param-example{font-size:12px;color:var(--muted);background:var(--surface-strong);border-radius:6px;padding:8px 10px;border-left:3px solid var(--brand-soft)}
.param-example strong{color:var(--brand);display:block;font-size:11px;text-transform:uppercase;letter-spacing:.06em;margin-bottom:2px}
.pbw-formula{background:#eff6ff;border:1px solid #bfdbfe;border-radius:6px;padding:10px 12px;font-size:12px;margin-bottom:10px;font-family:"Courier New",monospace;color:#1e40af}
.pbw-note{background:#fffbeb;border:1px solid #fde68a;border-radius:6px;padding:8px 10px;font-size:12px;color:#92400e;margin-top:8px}
.waveform-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:28px}
.wf-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r2);overflow:hidden;box-shadow:var(--shadow)}
.wf-head{padding:10px 14px;font-weight:700;font-size:13px;color:#fff}
.wf-pressure .wf-head{background:var(--danger)}
.wf-flow .wf-head{background:var(--focus)}
.wf-volume .wf-head{background:var(--ok)}
.wf-body{padding:14px;font-size:13px}
.wf-abnormal-title{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);margin:8px 0 6px}
.ab-item{display:flex;gap:8px;margin-bottom:5px;align-items:flex-start;font-size:12px}
.ab-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0;margin-top:3px;background:var(--danger)}
.modes-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px;margin-bottom:28px}
.mode-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r2);overflow:hidden;box-shadow:var(--shadow)}
.mode-head{background:var(--brand);color:#fff;padding:10px 14px}
.mode-title{font-weight:700;font-size:14px}
.mode-subtitle{font-size:11px;opacity:.7;margin-top:2px}
.mode-body{padding:14px;font-size:13px}
.mode-row{display:flex;gap:8px;margin-bottom:6px;align-items:flex-start}
.mode-row-label{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);flex-shrink:0;width:70px;padding-top:1px}
.mode-pill{display:inline-block;font-size:10px;padding:2px 7px;border-radius:12px;font-weight:600}
.pill-ctrl{background:#e8eef5;color:var(--brand)}
.pill-var{background:#fff3e0;color:var(--accent)}
.pill-risk{background:#fde8e8;color:var(--danger)}

/* ══ SIM TAB ══ */
.sim-wrap{display:grid;grid-template-columns:268px 1fr;height:100%;overflow:hidden;background:var(--surface-strong)}
.sim-controls{background:var(--surface);border-right:1px solid var(--line);overflow-y:auto;padding:14px}
.ctrl-section{margin-bottom:14px}
.ctrl-section-title{font-size:10px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin-bottom:8px;padding-bottom:5px;border-bottom:1px solid var(--line)}
/* Patient card */
.patient-card{background:var(--brand-soft);border:1px solid var(--brand);border-radius:var(--r);padding:10px 12px;margin-bottom:12px}
.pc-title{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:var(--brand);margin-bottom:8px}
.pc-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:8px}
.pc-field{display:flex;flex-direction:column;gap:3px}
.pc-label{font-size:10px;color:var(--muted);font-weight:600}
.pc-input{background:var(--surface);border:1px solid var(--line);border-radius:5px;padding:5px 7px;font-size:12px;font-family:inherit;color:var(--ink);width:100%;outline:none;transition:border-color .12s}
.pc-input:focus{border-color:var(--focus)}
.sex-toggle{display:grid;grid-template-columns:1fr 1fr;gap:3px}
.sex-btn{background:var(--surface);border:1px solid var(--line);border-radius:5px;padding:5px;font-size:11px;font-weight:600;cursor:pointer;font-family:inherit;color:var(--muted);transition:all .12s;text-align:center}
.sex-btn.active{background:var(--brand);color:#fff;border-color:var(--brand)}
.pbw-display{background:var(--surface);border-radius:6px;padding:8px 10px;font-size:12px;border:1px solid var(--line)}
.pbw-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:3px}
.pbw-key{color:var(--muted);font-size:11px}
.pbw-val{font-weight:700;font-size:13px;color:var(--brand)}
.pbw-range{font-size:11px;color:var(--ok);font-weight:600}
.vt-kg-badge{display:inline-block;font-size:11px;font-weight:700;padding:2px 7px;border-radius:12px;margin-left:4px}
.vt-kg-ok{background:#e8f5ee;color:var(--ok)}
.vt-kg-warn{background:#fffbeb;color:var(--warn)}
.vt-kg-bad{background:#fde8e8;color:var(--danger)}
/* Mode tabs */
.mode-tabs{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin-bottom:10px}
.mode-tab{background:var(--surface-strong);border:1px solid var(--line);border-radius:6px;padding:7px;font-size:11px;font-weight:700;cursor:pointer;text-align:center;transition:all .12s;font-family:inherit;color:var(--muted)}
.mode-tab.active{background:var(--brand);color:#fff;border-color:var(--brand)}
/* Sliders */
.slider-row{margin-bottom:9px}
.slider-label{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:3px}
.slider-name{font-size:12px;color:var(--ink)}
.slider-val{font-size:13px;font-weight:700;color:var(--brand)}
.slider-unit{font-size:10px;color:var(--muted);margin-left:2px}
input[type=range]{width:100%;accent-color:var(--brand);cursor:pointer;height:4px}
/* Presets */
.preset-btns{display:flex;gap:5px;flex-wrap:wrap}
.preset-btn{font-size:11px;border:1px solid var(--line);background:var(--surface);border-radius:6px;padding:5px 9px;cursor:pointer;font-family:inherit;color:var(--ink);transition:all .12s;font-weight:500}
.preset-btn:hover{background:var(--brand-soft);border-color:var(--brand);color:var(--brand)}
.preset-btn.active{background:var(--brand);color:#fff;border-color:var(--brand)}
/* Run button */
.run-btn{width:100%;padding:10px;border:none;border-radius:8px;font-size:13px;font-weight:700;cursor:pointer;font-family:inherit;transition:all .15s;display:flex;align-items:center;justify-content:center;gap:8px}
.run-btn.start{background:var(--ok);color:#fff}
.run-btn.stop{background:var(--danger);color:#fff}
.run-btn:hover{opacity:.88;transform:translateY(-1px)}
/* Mode info box */
.mode-info-box{background:var(--brand-soft);border:1px solid var(--brand);border-radius:7px;padding:9px 11px;font-size:12px;color:var(--brand);margin-bottom:10px;line-height:1.6}
.mode-info-box strong{display:block;font-size:11px;text-transform:uppercase;letter-spacing:.06em;margin-bottom:2px;opacity:.7}
/* VG indicator */
.vg-indicator{background:var(--surface-strong);border:1px solid var(--line);border-radius:6px;padding:8px 10px;font-size:12px;margin-bottom:8px}
.vg-label{font-size:10px;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);margin-bottom:2px}
.vg-bar-track{height:5px;background:var(--line);border-radius:3px;overflow:hidden;margin-top:4px}
.vg-bar-fill{height:100%;background:var(--focus);border-radius:3px;transition:width .35s}
/* Auto-PEEP warning */
.aap-warn{background:#fffbeb;border:1px solid #f59e0b;border-radius:7px;padding:9px 11px;font-size:12px;margin-bottom:8px;display:none}
.aap-title{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--warn);margin-bottom:4px}
.aap-val{font-size:16px;font-weight:800;color:var(--warn);font-family:"Courier New",monospace}
.aap-note{font-size:11px;color:#92400e;margin-top:3px}
/* PSV ETS warning */
.ets-warn{font-size:11px;padding:3px 8px;border-radius:4px;margin-top:3px;display:none}
.ets-early{background:#fde8e8;color:var(--danger)}
.ets-late{background:#fffbeb;color:var(--warn)}
/* Charts area */
.sim-charts{overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px}
.readings-bar{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:9px 14px;display:flex;gap:0;flex-wrap:wrap;align-items:center;flex-shrink:0}
.reading-item{display:flex;flex-direction:column;align-items:center;min-width:58px;padding:0 8px;border-right:1px solid var(--line)}
.reading-item:last-child{border-right:none}
.reading-label{font-size:9px;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);font-weight:600;white-space:nowrap}
.reading-value{font-size:18px;font-weight:800;color:var(--brand);line-height:1.1;font-family:"Courier New",monospace}
.reading-unit{font-size:9px;color:var(--muted)}
.reading-item.pip .reading-value{color:var(--cp)}
.reading-item.fio2 .reading-value{color:var(--cf)}
.reading-item.mv .reading-value{color:var(--ok)}
.reading-item.pplat .reading-value{color:var(--accent)}
.reading-item.vtkgpbw .reading-value{font-size:14px}
.chart-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);overflow:hidden;box-shadow:var(--shadow);flex-shrink:0}
.chart-head{padding:6px 14px;display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--line)}
.chart-title{font-weight:700;font-size:12px;letter-spacing:.04em;text-transform:uppercase}
.chart-unit{font-size:11px;color:var(--muted)}
.chart-p .chart-head{background:#fff5f5}.chart-p .chart-title{color:var(--cp)}
.chart-f .chart-head{background:#f0f4ff}.chart-f .chart-title{color:var(--cf)}
.chart-v .chart-head{background:#f0faf4}.chart-v .chart-title{color:var(--cv)}
.chart-body{position:relative;padding:3px 6px 6px;min-height:276px}
.chart-body canvas{display:block;width:100%;min-height:260px}
@media(max-width:768px){
  .chart-body canvas{min-height:200px}
  .sim-wrap{grid-template-columns:1fr}
  .sim-controls{height:auto;max-height:45vh}
  .waveform-grid,.modes-grid{grid-template-columns:1fr}
  .info-wrap{grid-template-columns:1fr}
  .info-sidebar{display:none}
}
::-webkit-scrollbar{width:5px;height:5px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--line);border-radius:3px}
.pbw-target-note{font-size:11px;background:#eff6ff;border:1px solid #bfdbfe;border-radius:5px;padding:6px 9px;color:#1e40af;margin-top:8px}
/* ── Waveform pattern recognition cards ── */
.pg-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(330px,1fr));gap:12px;margin-bottom:24px}
.pg-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r2);overflow:hidden;box-shadow:var(--shadow)}
.pg-head{padding:9px 14px;display:flex;align-items:center;justify-content:space-between}
.pg-head-title{font-weight:700;font-size:13px;color:#fff}
.pg-head-tag{font-size:9px;background:rgba(255,255,255,.22);padding:2px 7px;border-radius:10px;color:#fff;letter-spacing:.05em;font-weight:600}
.pg-body{padding:12px 14px}
.pg-traces{display:flex;gap:6px;margin-bottom:10px}
.pg-trace{flex:1;min-width:0}
.pg-trace-lbl{font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;text-align:center;margin-bottom:3px}
.lbl-p{color:var(--cp)}.lbl-f{color:var(--cf)}.lbl-v{color:var(--cv)}
.pg-trace svg{display:block;width:100%;border:1px solid var(--line);border-radius:3px}
.pg-info{font-size:12px;line-height:1.55}
.pg-row{display:flex;gap:6px;margin-bottom:5px;align-items:flex-start}
.pg-lbl{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);flex-shrink:0;width:56px;padding-top:1px}
.pg-action{font-size:11px;background:#fef9ee;border:1px solid #fcd34d;border-radius:5px;padding:6px 9px;margin-top:8px}
.pg-action-hd{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--accent);margin-bottom:2px}
/* ETCO2 brief info note */
.etco2-note{background:#f0f4ff;border:1px solid #bfdbfe;border-radius:var(--r2);padding:14px;margin-top:4px;font-size:12px;line-height:1.65}
.etco2-note-title{font-weight:700;font-size:14px;color:#1e40af;margin-bottom:6px}
/* ── Parameter helper buttons ── */
.help-btn{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;border:1px solid var(--line);background:none;color:var(--muted);font-size:9px;font-weight:700;cursor:pointer;font-family:inherit;flex-shrink:0;margin-left:5px;vertical-align:middle;transition:all .12s;padding:0;line-height:1}
.help-btn:hover{background:var(--brand);color:#fff;border-color:var(--brand)}
.helper-overlay{position:fixed;inset:0;z-index:998;display:none}
.helper-popup{position:fixed;z-index:999;background:var(--surface);border:1px solid var(--line);border-radius:var(--r2);box-shadow:0 8px 32px rgba(11,31,51,.2);padding:14px 16px;width:270px;display:none;font-size:12px;line-height:1.55}
.helper-popup-title{font-weight:700;font-size:13px;color:var(--brand);margin-bottom:8px;padding-bottom:6px;border-bottom:1px solid var(--line)}
.helper-row{display:flex;gap:8px;margin-bottom:5px;align-items:flex-start}
.helper-row-lbl{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);flex-shrink:0;width:52px;padding-top:1px}
.helper-close{float:right;background:none;border:none;font-size:18px;cursor:pointer;color:var(--muted);line-height:1;padding:0;margin-left:8px}
/* ── Measure Pplat button ── */
.pplat-btn{width:100%;padding:8px 10px;border:1px solid #bfdbfe;background:#eff6ff;color:#1e40af;border-radius:7px;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;margin-top:8px;transition:all .12s;display:flex;align-items:center;gap:6px}
.pplat-btn:hover{background:var(--focus);color:#fff;border-color:var(--focus)}
.pplat-result{background:#eff6ff;border:1px solid #bfdbfe;border-radius:7px;padding:10px 12px;margin-top:6px;display:none}
/* ── MV tab pane show/hide (was missing) ─────────────────────── */
.mv-pane { display: none; flex: 1; overflow: hidden; }
.mv-pane.active { display: flex; flex-direction: column; }
.mv-tab-bar {
  background: var(--brand-dark, #071523); display: flex;
  align-items: stretch; padding: 0 16px; gap: 2px; flex-shrink: 0;
}
.mv-tab-btn {
  background: none; border: none; color: rgba(255,255,255,.55);
  font-size: 13px; font-weight: 500; padding: 0 16px; cursor: pointer;
  border-bottom: 2px solid transparent; transition: all .15s;
  font-family: inherit; height: 40px;
}
.mv-tab-btn.active { color: #fff; border-bottom-color: #fff; }
.mv-tab-btn:hover:not(.active) { color: rgba(255,255,255,.85); }

/* ── Ventilation workspace — full viewport height, standalone ── */
#ventilationWorkspace {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--nav-height));
  overflow: hidden;
}
#ventilationMount {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  min-height: 0;
}
/* Info body needs scroll */
.info-body { overflow-y: auto; padding: 28px 32px; }
.info-wrap { height: 100%; }
/* Sim pane needs height */
#mv-pane-sim { height: 100%; }
.sim-wrap { height: 100%; overflow: hidden; }
.sim-controls { overflow-y: auto; }
.sim-charts { overflow-y: auto; flex: 1; }

/* ── Hide sidebar section nav on ventilation ─────────────────── */
body.ws-ventilation .section-nav,
body.ws-ventilation .panel-controls { display: none; }
body.ws-ventilation .side-panel { display: none; }
body.ws-ventilation .app-layout { grid-template-columns: 1fr; }

/* ── About page (rich v3.0.5 style) ──────────────────────── */
.about-page { max-width: 860px; margin: 0 auto; padding-bottom: 48px; }
.about-hero { background: linear-gradient(135deg, var(--brand) 0%, #1a4060 60%, #0d5c4a 100%); color: #fff; padding: 40px 36px 36px; }
.about-hero h2 { font-size: clamp(1.4rem,3vw,2rem); font-weight: 900; margin: 8px 0 10px; line-height: 1.25; }
.about-hero p { color: rgba(255,255,255,.7); font-size: .9rem; margin: 0; }
.about-body { padding: 28px 24px; }
.about-lede { font-size: .92rem; line-height: 1.8; color: var(--muted); margin-bottom: 16px; }
.about-quote { border-left: 4px solid var(--brand); margin: 0 0 24px; padding: 10px 16px; font-weight: 700; font-size: 1rem; color: var(--ink); background: var(--brand-soft); border-radius: 0 8px 8px 0; }
.about-section-title { font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.about-feature-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin: 14px 0 24px; }
.about-feature { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.about-feature-icon { font-size: 1.6rem; flex-shrink: 0; }
.about-feature strong { font-size: .9rem; display: block; margin-bottom: 3px; }
.about-feature p { margin: 0; font-size: .8rem; color: var(--muted); line-height: 1.55; }
.about-checklist { margin: 12px 0 24px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.about-checklist li { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; line-height: 1.6; padding: 9px 14px; background: var(--surface-2); border-radius: 8px; }
.about-checklist li::before { content: "✓"; color: var(--ok); font-weight: 900; flex-shrink: 0; }
.about-endorsement-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin: 14px 0 24px; }
.about-endorsement-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.endorse-region { display: inline-block; background: var(--brand); color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .1em; padding: 2px 8px; border-radius: 5px; align-self: flex-start; }
.about-endorsement-card blockquote { margin: 0; font-size: .84rem; line-height: 1.65; color: var(--ink); font-style: italic; }
.about-endorsement-card blockquote::before { content: "\201C"; color: var(--muted); font-size: 1.2rem; }
.endorse-author { display: flex; flex-direction: column; gap: 1px; }
.endorse-author strong { font-size: .85rem; }
.endorse-author span { font-size: .75rem; color: var(--muted); }
.about-disclaimer { background: #fffbea; border: 1px solid #f59e0b; border-radius: 10px; padding: 16px; font-size: .84rem; line-height: 1.7; margin: 0 0 24px; }
.about-author-block { display: flex; justify-content: space-between; align-items: flex-end; padding: 20px 24px; background: var(--surface); border-top: 2px solid var(--line); border-radius: 12px; flex-wrap: wrap; gap: 14px; }
.about-author-name { font-size: 1.05rem; display: block; margin-bottom: 4px; }
.about-author-block p { margin: 0; font-size: .82rem; color: var(--muted); line-height: 1.7; }
.about-author-block a { color: var(--focus); }
.about-version-tag { text-align: right; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.about-version-tag strong { display: block; font-size: 1.2rem; color: var(--brand); }
@media (max-width: 640px) {
  .about-feature-grid, .about-endorsement-grid { grid-template-columns: 1fr; }
  .about-hero { padding: 24px 20px; }
  .about-body { padding: 20px 16px; }
}

/* ── GLOBAL FIXES ──────────────────────────────────────────── */

/* Sidebar: only visible on Training workspace */
.side-panel { display: none; }
body.ws-training .side-panel { display: flex; }
body.ws-training .app-layout { grid-template-columns: var(--sidebar-w) 1fr; }
.app-layout { grid-template-columns: 1fr; }

/* About page: no sidebar gap, full width */
body.ws-about .app-layout,
body.ws-home .app-layout,
body.ws-appendices .app-layout { grid-template-columns: 1fr; }
.about-page { max-width: 900px; margin: 0 auto; }
.about-hero { border-radius: 0; margin: 0; }

/* ATF student header — input visibility on dark bg */
.atf-student-header .metadata { gap: 10px; }
.atf-student-header .input-group label {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  color: rgba(255,255,255,.75); text-transform: uppercase;
}
.atf-student-header .input-group input,
.atf-student-header .input-group select {
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.4);
  border-radius: 8px; color: #fff; padding: 10px 12px;
  font-size: .92rem; width: 100%; outline: none;
  transition: border-color .15s, background .15s;
}
.atf-student-header .input-group input:focus,
.atf-student-header .input-group select:focus {
  border-color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.22);
}
.atf-student-header .input-group input::placeholder { color: rgba(255,255,255,.45); }
.atf-student-header .input-group select option { background: #0b1f33; color: #fff; }

/* Agreement box — ensure I AGREE is always clickable */
.agreement-box { position: relative; z-index: 1; }
.checkbox-wrapper { position: relative; z-index: 2; pointer-events: all; }

/* Checklist items — clear card style */
.checklist-item {
  display: grid !important; grid-template-columns: 20px 1fr !important;
  gap: 12px !important; align-items: flex-start !important;
  padding: 12px 16px !important; margin: 4px 0 !important;
  border: 1.5px solid var(--line) !important;
  border-radius: 10px !important; background: var(--surface) !important;
  cursor: pointer !important; transition: border-color .12s, background .12s !important;
}
.checklist-item:hover { border-color: #93c5fd !important; background: #f8faff !important; }
.checklist-item.checked { background: #f0fdf4 !important; border-color: #86efac !important; }
.checklist-item label { font-size: .9rem !important; line-height: 1.6 !important; }
.checklist-item input[type="checkbox"] {
  width: 18px !important; height: 18px !important;
  margin-top: 2px !important; accent-color: var(--ok) !important; cursor: pointer !important;
}

/* Section content padding */
.section-content { padding: 14px 20px 18px !important; }

/* Form text sizes — mobile-friendly */
.atf-student-header h1 { font-size: clamp(1.2rem,3vw,1.6rem); }
.atf-student-header .subtitle { font-size: .88rem; }
label { font-size: .9rem !important; }

/* Student header metadata grid */
.metadata {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
  gap: 10px !important;
}

/* Fix select dropdown on mobile */
select#student-university {
  width: 100% !important; max-width: 100% !important;
  overflow: hidden; text-overflow: ellipsis;
}

/* About hero — no gap */
#aboutWorkspace { padding: 0 !important; }
.about-body { padding: 24px 28px; }

/* Home workspace — full width */
#homeWorkspace { padding: 0; }
.home-hero { border-radius: 0; }

/* Mobile responsive */
@media (max-width: 760px) {
  .metadata { grid-template-columns: 1fr 1fr !important; }
  .atf-student-header { padding: 20px 16px; }
  .agreement-box { padding: 16px; }
  .section-content { padding: 12px 14px 16px !important; }
  .checklist-item { padding: 10px 12px !important; }
  .about-body { padding: 16px; }
  .about-feature-grid { grid-template-columns: 1fr !important; }
  .about-endorsement-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 480px) {
  .metadata { grid-template-columns: 1fr !important; }
  .atf-student-header h1 { font-size: 1.2rem; }
}

/* ── ADDITIONAL FIXES ──────────────────────────────────────── */

/* Remove content-area top padding for full-bleed pages */
body.ws-about .content-area,
body.ws-home .content-area { padding: 0; }

/* Institution label — never wrap */
.atf-student-header .input-group label { white-space: nowrap; }

/* Metadata grid — all fields same height alignment */
.atf-student-header .input-group { align-items: stretch; }
.atf-student-header .input-group input,
.atf-student-header .input-group select { height: 44px; }

/* About workspace — start at very top, no gap */
#aboutWorkspace { margin: 0; padding: 0; }
.about-page { padding-bottom: 48px; }

/* ── CRITICAL: enforce hidden attribute — overrides .workspace-block display:block ── */
[hidden] { display: none !important; }

/* ══════════════════════════════════════════════════════════
   MOBILE OPTIMISATION
   Fixes training sidebar crushing content on narrow screens
   ══════════════════════════════════════════════════════════ */

/* Mobile save/clear buttons — hidden on desktop */
.mobile-training-actions { display: none; margin-left: auto; gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
.mob-save-btn, .mob-clear-btn {
  border: none; border-radius: 6px; padding: 6px 10px;
  font-size: .75rem; font-weight: 700; cursor: pointer; white-space: nowrap;
  flex: 1;
}
.mob-save-btn  { background: rgba(255,255,255,.9); color: var(--brand); }
.mob-clear-btn { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.3); }

@media (max-width: 760px) {

  /* ── CRITICAL: override high-specificity training layout ── */
  body.ws-training .app-layout  { grid-template-columns: 1fr !important; }
  body.ws-training .side-panel  { display: none !important; }

  /* ── Progress bar: show inline save/clear ── */
  .mobile-training-actions { display: flex; }
  .progress-row { flex-wrap: wrap; }

  /* ── Student header ── */
  .atf-student-header { padding: 16px !important; }
  .atf-student-header h1 { font-size: 1.15rem !important; }
  .atf-student-header .subtitle { font-size: .82rem !important; }

  /* ── Metadata: 2 columns on mid-mobile ── */
  .metadata {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  /* ── Agreement box ── */
  .agreement-box { padding: 14px 16px !important; }
  .agreement-box ul { padding-left: 14px !important; }
  .checkbox-wrapper { padding: 10px 12px !important; font-size: .88rem !important; }

  /* ── Section headers ── */
  .section-header { padding: 12px 14px !important; }
  .section-badge { width: 30px !important; height: 30px !important; font-size: .8rem !important; }
  .section-header h3 { font-size: .92rem !important; }

  /* ── Checklist items ── */
  .section-content { padding: 10px 12px 14px !important; }
  .checklist-item { padding: 10px 12px !important; gap: 10px !important; }
  .checklist-item label { font-size: .86rem !important; }
  .sub-items { padding-left: 12px !important; }

  /* ── Vital signs: 2 cols ── */
  .vital-signs-grid { grid-template-columns: repeat(2,1fr) !important; }

  /* ── Home cards: single column ── */
  .home-cards { grid-template-columns: 1fr !important; }
  .home-hero { grid-template-columns: 1fr !important; padding: 24px 16px !important; }
  .home-stats { flex-direction: row !important; justify-content: space-around !important; }

  /* ── About section ── */
  .about-body { padding: 16px !important; }
  .about-feature-grid  { grid-template-columns: 1fr !important; }
  .about-endorsement-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {

  /* ── Metadata: single column ── */
  .metadata { grid-template-columns: 1fr !important; }

  /* ── Institution label: allow wrap ── */
  .atf-student-header .input-group label { white-space: normal !important; }

  /* ── Inputs full height ── */
  .atf-student-header .input-group input,
  .atf-student-header .input-group select { height: 48px !important; font-size: 1rem !important; }

  /* ── Section header simpler on tiny screens ── */
  .section-header h3 { font-size: .88rem !important; }

  /* ── Floating notes: full width ── */
  .floating-notes-panel { width: calc(100vw - 16px) !important; right: 8px !important; left: 8px !important; }

  /* ── Vital signs: single column ── */
  .vital-signs-grid { grid-template-columns: 1fr !important; }

  /* ── Home hero buttons stacked ── */
  .home-actions { flex-direction: column !important; }
  .home-actions .btn-primary,
  .home-actions .btn-secondary { width: 100% !important; text-align: center !important; }
}

/* ══════════════════════════════════════════════════════════
   APPENDIX LIBRARY
   ══════════════════════════════════════════════════════════ */

.app-lib {
  display: grid;
  grid-template-columns: 230px 1fr;
  height: calc(100vh - var(--nav-height) - 48px);
  overflow: hidden;
}

/* ── Sidebar ── */
.app-lib-sidebar {
  border-right: 1px solid var(--line);
  background: var(--surface);
  overflow-y: auto;
  padding: 8px 0 24px;
  scrollbar-width: thin;
}

.app-lib-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  font-size: .84rem;
  color: var(--ink);
  line-height: 1.3;
  transition: background .1s;
}
.app-lib-nav-item:hover { background: var(--surface-2); }
.app-lib-nav-item.active {
  background: #eff6ff;
  border-left-color: var(--brand);
  color: var(--brand);
  font-weight: 700;
}
.app-lib-nav-icon { font-size: 1.15rem; flex-shrink: 0; }
.app-lib-nav-title { line-height: 1.35; }
.app-lib-nav-short { display: none; } /* shown only on mobile */
.app-lib-sidebar-wrap { display: contents; } /* desktop: transparent wrapper */

/* ── Content Area ── */
.app-lib-content {
  overflow-y: auto;
  padding: 24px 28px 40px;
  background: #f0f4f8;
}

.app-lib-section { display: none; }
.app-lib-section.active { display: block; }

.app-lib-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding: 14px 18px;
  background: white;
  border-radius: 12px;
  border-left: 5px solid #0b1f33;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  overflow: hidden;
}
.app-lib-section-header span { font-size: 2rem; flex-shrink: 0; }
.app-lib-section-header h2 {
  font-size: 1.3rem;
  font-weight: 900;
  margin: 0;
  color: var(--ink);
  word-break: break-word;
  min-width: 0;
}

/* ── Subsection Cards ── */
.app-lib-subsection {
  background: white;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.app-lib-subsection-title {
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--brand);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--line);
}

.app-lib-intro {
  font-size: .86rem;
  color: #374151;
  font-weight: 600;
  background: #f0f4f8;
  padding: 8px 12px;
  border-radius: 7px;
  margin: 0 0 12px;
  line-height: 1.55;
}

.app-lib-note {
  font-size: .78rem;
  color: #6b7280;
  font-style: italic;
  margin: 0 0 8px;
}

/* ── Tables ── */
.app-lib-table-wrap { overflow-x: auto; border-radius: 8px; }
.app-lib-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
}
.app-lib-table th {
  background: #0b1f33;
  color: #fff;
  padding: 9px 12px;
  text-align: left;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  white-space: nowrap;
}
.app-lib-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
  line-height: 1.55;
  color: #1f2937;
}
.app-lib-table tbody tr:nth-child(even) { background: #f8fafc; }
.app-lib-table tbody tr:hover { background: #eff6ff; }

/* ── Callouts ── */
.app-lib-callout {
  display: flex;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 8px;
  border-left: 4px solid;
  font-size: .87rem;
  line-height: 1.65;
}
.app-lib-callout p { margin: 0; }
.app-lib-callout-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }

/* ── Steps ── */
.app-lib-steps { margin: 0; padding-left: 22px; }
.app-lib-steps li {
  font-size: .87rem;
  line-height: 1.65;
  padding: 4px 0;
  color: #1f2937;
}

/* ── Worked Example ── */
.app-lib-example .app-lib-table td:first-child {
  font-weight: 700;
  color: var(--brand);
  width: 42%;
}
.app-lib-example tr.ex-total td {
  background: #0b1f33;
  color: white;
  font-weight: 900;
  font-size: .9rem;
}

/* ── Two Column ── */
.app-lib-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.app-lib-col {
  background: #f8fafc;
  border-radius: 8px;
  padding: 13px 15px;
  border: 1px solid var(--line);
}
.app-lib-col h4 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--brand);
  font-weight: 800;
  margin: 0 0 10px;
}
.app-lib-col ul { margin: 0; padding-left: 18px; }
.app-lib-col li { font-size: .84rem; line-height: 1.6; padding: 3px 0; }

/* ── Reaction Cards ── */
.reaction-cards { display: flex; flex-direction: column; gap: 11px; }
.reaction-card { border-radius: 10px; overflow: hidden; border-left: 4px solid; }
.reaction-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  flex-wrap: wrap;
}
.reaction-header strong { font-size: .88rem; }
.reaction-timing { font-size: .74rem; color: #6b7280; margin-left: auto; white-space: nowrap; }
.reaction-sev {
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .07em;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.reaction-body { padding: 11px 14px; background: white; font-size: .84rem; line-height: 1.6; }
.reaction-signs { margin-bottom: 8px; }
.reaction-mgmt { margin-bottom: 4px; }
.reaction-steps { color: #374151; padding-left: 4px; }

/* ══ MOBILE ══════════════════════════════════════════════ */
@media (max-width: 760px) {
  .app-lib {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;
    grid-template-rows: unset;
    height: calc(100vh - var(--nav-height));
    overflow: hidden;
  }

  /* ── Tab bar ── */
  .app-lib-sidebar-wrap {
    position: relative;
    background: #0b1f33;
    flex-shrink: 0;
    padding-bottom: 2px;
  }
  .app-lib-sidebar {
    display: none !important;  /* hidden on mobile — use select picker instead */
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-bottom: none;
    padding: 12px 14px 10px;
    gap: 10px;
    scrollbar-width: none;
    background: #0b1f33;
  }
  .app-lib-sidebar::-webkit-scrollbar { display: none; }
  .app-lib-scroll-track { display: none !important; }

  /* Scroll position indicator — thick, bright, impossible to miss */
  .app-lib-scroll-track {
    height: 5px;
    background: rgba(255,255,255,.15);
    margin: 0 14px 10px;
    border-radius: 3px;
    overflow: visible;
    position: relative;
  }
  .app-lib-scroll-thumb {
    height: 100%;
    min-width: 28px;
    background: #fff;
    border-radius: 3px;
    position: absolute;
    top: 0; left: 0;
    box-shadow: 0 0 6px rgba(255,255,255,.4);
    transition: width .08s, left .08s;
  }

  .app-lib-nav-item {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 11px 20px;
    min-width: unset;
    flex-shrink: 0;
    border-left: none;
    border-bottom: none;
    border-radius: 26px;
    font-size: .9rem;
    font-weight: 500;
    letter-spacing: .01em;
    text-align: center;
    color: rgba(255,255,255,.6);
    background: rgba(255,255,255,.11);
    white-space: nowrap;
    transition: background .15s, color .15s;
  }
  .app-lib-nav-item:active { opacity: .75; }
  .app-lib-nav-item.active {
    background: #fff;
    border-left-color: transparent;
    border-bottom-color: transparent;
    color: #0b1f33;
    font-weight: 700;
  }
  /* Hide emoji icon — show full title text */
  .app-lib-nav-icon  { display: none; }
  .app-lib-nav-title { display: inline; white-space: nowrap; line-height: 1; }
  .app-lib-nav-short { display: none; }

  .app-lib-content {
    padding: 14px 12px 60px;
    height: calc(100vh - var(--nav-height) - 80px);
    overflow-y: auto;
    scroll-behavior: smooth;
  }

  /* Mobile: single section visible — same as desktop */
  /* .app-lib-section show/hide handled by JS active class */

  /* Sticky tab bar below nav on mobile */
  .app-lib-sidebar-wrap {
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .app-lib-section-header { padding: 12px 14px; }
  .app-lib-section-header h2 { font-size: 1.1rem; }
  .app-lib-subsection { padding: 14px 14px; }
  .app-lib-two-col { grid-template-columns: 1fr; }

  .reaction-header { gap: 6px; }
  .reaction-timing { margin-left: 0; }
}

/* ══════════════════════════════════════════════════════════
   GLOBAL SEARCH PANEL
   ══════════════════════════════════════════════════════════ */

.search-results-panel {
  display: none;
  position: fixed;
  top: var(--nav-height);
  right: 12px;
  width: 440px;
  max-height: 72vh;
  background: #fff;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 8px 40px rgba(11,31,51,.22);
  border: 1px solid #d4dce8;
  border-top: none;
  z-index: 9500;
  overflow: hidden;
  flex-direction: column;
  font-size: .87rem;
}
.search-results-panel.active { display: flex; }

.srp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.srp-count { font-size: .78rem; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.srp-close {
  background: none; border: none; cursor: pointer;
  color: #9ca3af; font-size: 1rem; padding: 2px 6px;
  border-radius: 4px; line-height: 1;
}
.srp-close:hover { background: #f1f5f9; color: #374151; }

.srp-list { overflow-y: auto; flex: 1; }

.srp-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .1s;
}
.srp-item:hover, .srp-item:focus { background: #f0f7ff; outline: none; }
.srp-item:last-child { border-bottom: none; }

.srp-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.srp-badge {
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}
.srp-title {
  font-size: .88rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.3;
}
.srp-parent {
  font-weight: 400;
  color: #6b7280;
  font-size: .82rem;
}
.srp-snippet {
  margin: 0;
  font-size: .82rem;
  color: #6b7280;
  line-height: 1.55;
}
.srp-snippet mark {
  background: #fef08a;
  color: #1f2937;
  border-radius: 2px;
  padding: 0 1px;
}

.srp-empty {
  padding: 32px 24px;
  text-align: center;
  color: #6b7280;
}
.srp-empty span { font-size: 2rem; display: block; margin-bottom: 10px; }
.srp-empty p { margin: 0 0 6px; font-weight: 600; color: #374151; }
.srp-empty small { font-size: .8rem; }

@media (max-width: 760px) {
  .search-results-panel {
    right: 0;
    left: 0;
    width: 100%;
    border-radius: 0 0 14px 14px;
    max-height: 60vh;
    top: 112px; /* nav(56px) + mobile-search-bar(~56px) */
  }
}

/* ── Training content side breathing room ───────────────── */
#training-form {
  padding: 0 12px;
}
@media (max-width: 760px) {
  #training-form {
    padding: 0 10px;
  }
  .checklist-item {
    margin: 4px 0 !important;
  }
  .section-content {
    padding: 10px 4px 14px !important;
  }
  /* Progress bar save/clear visible on mobile */
  .mobile-training-actions { display: flex; }
}
@media (min-width: 761px) {
  #training-form {
    padding: 0 20px;
  }
}

/* ── PWA Install Banner ─────────────────────────────────── */
.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9200;
  padding: 10px 14px;
  background: #0b1f33;
  box-shadow: 0 -4px 20px rgba(0,0,0,.25);
  border-top: 2px solid #1a4060;
  animation: slideUpBanner .3s ease;
}
@keyframes slideUpBanner {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.install-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
}
.install-banner-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
}
.install-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.install-banner-text strong {
  font-size: .9rem;
  color: #fff;
  font-weight: 800;
}
.install-banner-text span {
  font-size: .78rem;
  color: rgba(255,255,255,.65);
}
.install-banner-btn {
  background: #0a7c52;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: .88rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity .12s;
}
.install-banner-btn:hover { opacity: .88; }
.install-banner-dismiss {
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 6px;
  flex-shrink: 0;
  border-radius: 4px;
}
.install-banner-dismiss:hover { color: #fff; background: rgba(255,255,255,.1); }

@media (max-width: 480px) {
  .install-banner-text span { display: none; }
  .install-banner-btn { padding: 8px 14px; font-size: .82rem; }
}

/* ══════════════════════════════════════════════════════════
   CASE HISTORY PANEL
   ══════════════════════════════════════════════════════════ */

/* Archive + History buttons in progress bar */
.mob-archive-btn {
  padding: 5px 9px; border-radius: 6px; border: none; cursor: pointer;
  font-size: .75rem; font-weight: 600; font-family: inherit;
  background: #22c55e; color: #fff; flex: 1;
}
.mob-history-btn {
  padding: 5px 9px; border-radius: 6px; border: none; cursor: pointer;
  font-size: .75rem; font-weight: 600; font-family: inherit;
  background: rgba(255,255,255,.22); color: #fff; flex: 1;
}
.mob-export-btn {
  padding: 5px 9px; border-radius: 6px; border: 1px solid rgba(255,255,255,.25); cursor: pointer;
  font-size: .72rem; font-weight: 600; font-family: inherit;
  background: rgba(26,79,160,.55); color: #c7d7fd;
  flex: 1 1 40%;
}

/* Overlay */
.history-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 8000;
}
.history-overlay.open { display: block; }

/* Slide-in panel from right */
.history-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(92vw, 400px);
  background: #fff;
  z-index: 8100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 32px rgba(0,0,0,.18);
}
.history-panel.open { transform: translateX(0); }

.history-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #0b1f33;
  color: #fff;
  flex-shrink: 0;
}
.history-panel-header h2 {
  font-size: 1.05rem; font-weight: 700; margin: 0; color: #fff;
}
.history-close-btn {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
}

/* Case list */
.history-case-list {
  flex: 1; overflow-y: auto;
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  background: #f8fafc;
}
.history-empty {
  text-align: center; padding: 48px 24px;
  color: #94a3b8; font-size: .9rem; line-height: 1.7;
}
.history-empty strong { display: block; font-size: 1.1rem; color: #64748b; margin-bottom: 6px; }

/* Case card */
.case-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  position: relative;
}
.case-card:hover { border-color: #3b82f6; box-shadow: 0 2px 12px rgba(59,130,246,.12); }
.case-card-patient {
  font-size: .98rem; font-weight: 700; color: #0b1f33; margin-bottom: 4px;
}
.case-card-meta {
  font-size: .78rem; color: #64748b; display: flex; gap: 10px; flex-wrap: wrap;
}
.case-card-progress {
  margin-top: 10px;
  height: 5px; background: #e2e8f0; border-radius: 3px; overflow: hidden;
}
.case-card-progress-fill {
  height: 100%; background: #22c55e; border-radius: 3px;
}
.case-card-delete {
  position: absolute; top: 10px; right: 10px;
  background: none; border: none; color: #cbd5e1; cursor: pointer;
  font-size: 1.1rem; padding: 2px 6px; border-radius: 4px;
}
.case-card-delete:hover { background: #fee2e2; color: #ef4444; }

/* Case detail modal */
.case-detail-modal {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 8200;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.case-detail-modal.open { transform: translateY(0); }
.case-detail-body {
  flex: 1; overflow-y: auto;
  padding: 20px;
  background: #f8fafc;
}

/* Detail field grid */
.case-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 20px;
}
.case-detail-field {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 10px 14px;
}
.case-detail-field label {
  font-size: .72rem; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: 3px;
}
.case-detail-field span {
  font-size: .92rem; font-weight: 600; color: #0b1f33;
}
.case-detail-section {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: #64748b; margin: 18px 0 8px;
}
.case-detail-checklist { display: flex; flex-direction: column; gap: 6px; }
.case-detail-check-item {
  display: flex; align-items: center; gap: 10px;
  font-size: .85rem; color: #374151; padding: 8px 12px;
  background: #fff; border-radius: 7px; border: 1px solid #e2e8f0;
}
.case-detail-check-item.done { color: #166534; background: #f0fdf4; border-color: #86efac; }
.case-check-dot {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid #d1d5db;
}
.case-detail-check-item.done .case-check-dot {
  background: #22c55e; border-color: #22c55e;
}
.case-detail-notes {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 12px 14px;
  font-size: .88rem; color: #374151; line-height: 1.6; white-space: pre-wrap;
}
.case-progress-summary {
  background: #0b1f33; color: #fff;
  border-radius: 10px; padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.case-progress-summary strong { font-size: 1.6rem; }
.case-progress-summary span { font-size: .82rem; opacity: .75; }

/* ── Clinical image block ────────────────────────────── */
.app-lib-clinical-image {
  margin: 4px 0 16px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.app-lib-img {
  width: 100%;
  height: auto;
  display: block;
}
.app-lib-img-caption {
  margin: 0;
  padding: 8px 12px;
  font-size: .75rem;
  color: #64748b;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
  text-align: center;
}

/* ── Red flag list ─────────────────────────────────── */
.app-lib-redflag-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app-lib-redflag-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  font-size: .88rem;
  color: #881337;
  line-height: 1.4;
}
.redflag-dot {
  width: 8px; height: 8px;
  background: #f43f5e;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

/* ── Trial Status Banner ──────────────────────────────────────── */
#trialStatusBanner { width: 100%; }
.trial-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 20px; font-size: .78rem; font-weight: 500;
  gap: 10px; flex-wrap: wrap;
}
@media (min-width: 768px) {
  .trial-banner { padding: 5px 24px; font-size: .76rem; }
}
.trial-banner--trial  { background: rgba(26,158,140,.15); border-bottom: 1px solid rgba(26,158,140,.3); color: #0b1f33; font-weight: 600; }
.trial-banner--urgent { background: rgba(224,100,50,.18);  border-bottom: 1px solid rgba(224,100,50,.4);  color: #0b1f33; font-weight: 600; }
.trial-banner--paid   { background: rgba(80,200,120,.12);  border-bottom: 1px solid rgba(80,200,120,.3);  color: #50c878; }
.trial-upgrade-btn {
  background: linear-gradient(135deg,#1a9e8c,#127a6b);
  color: #fff; border: none; border-radius: 8px;
  padding: 6px 14px; font-size: .82rem; font-weight: 700;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  flex-shrink: 0;
}
.trial-upgrade-btn:hover { opacity: .85; }

/* ── Sidebar Upgrade Button ──────────────────────────────────── */
.btn-upgrade {
  width: 100%; padding: 10px 16px;
  background: linear-gradient(135deg,#1a9e8c,#127a6b);
  color: #fff; border: none; border-radius: 10px;
  font-size: .88rem; font-weight: 700; cursor: pointer;
  font-family: inherit; text-align: center;
}
.btn-upgrade:hover { opacity: .85; }

/* ── Trial banner sign out link ──────────────────────────────── */
.trial-signout-btn {
  background: none; border: none;
  color: rgba(11,31,51,.55); font-size: .75rem;
  cursor: pointer; font-family: inherit;
  text-decoration: underline; padding: 0;
  white-space: nowrap; flex-shrink: 0;
}
.trial-signout-btn:hover { color: #e05252; }

/* ── Nav Sign Out button ─────────────────────────────────────── */
.nav-signout-btn {
  color: rgba(224,82,82,.85) !important;
  font-weight: 600;
}
.nav-signout-btn:hover { color: #e05252 !important; }

/* ═══════════════════════════════════════════════════════════
   BILINGUAL  —  AR/EN labels   (lang.js v1.0.0)
   ═══════════════════════════════════════════════════════════ */

/* ── Inline bilingual label ──────────────────────────────────── */
.bi-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.3;
}
/* AR mode: Arabic primary (top) */
.bi-ar-primary {
  font-size: inherit;
  direction: rtl;
  text-align: right;
  font-family: 'Noto Naskh Arabic', 'Segoe UI', Arial, sans-serif;
}
/* EN secondary line below Arabic */
.bi-en-sub {
  font-size: .78rem;
  opacity: .72;
  direction: ltr;
  text-align: left;
  font-style: italic;
}
/* Legacy .bi-en used in non-sub contexts */
.bi-en {
  font-size: inherit;
}
/* Dark muted contexts (appendices sidebar, light backgrounds) */
.bi-en-dark {
  color: #5a6b7d;
}
.bi-ar {
  font-size: .82rem;
  color: rgba(255,255,255,.6);
  direction: rtl;
  text-align: right;
  font-family: 'Noto Naskh Arabic', 'Segoe UI', Arial, sans-serif;
}
.bi-ar-dark {
  color: #5a6b7d;
}

/* ── Block-level bilingual paragraph ─────────────────────────── */
/* AR mode: Arabic shown as main text, English below smaller + muted */
.bi-para-en {
  display: block;
  font-size: .83em;
  color: #4e6070;
  margin-top: 6px;
  direction: ltr;
  text-align: left;
  font-style: italic;
  line-height: 1.5;
  border-top: 1px solid rgba(0,0,0,.06);
  padding-top: 5px;
}
/* In dark (gradient) contexts */
.dark-section .bi-para-en {
  color: rgba(255,255,255,.38);
  border-top-color: rgba(255,255,255,.1);
}

/* Nav buttons with bilingual label need a bit more height */
.command-links .workspace-btn .bi-label,
.mobile-menu-portal .workspace-btn .bi-label {
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   LANGUAGE SELECTION SCREEN
   ═══════════════════════════════════════════════════════════ */

#langSelectOverlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0b1f33 0%, #1a4060 60%, #0d5c4a 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lang-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  padding: 40px 32px 36px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  color: #fff;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
  backdrop-filter: blur(8px);
}

.lang-card img {
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
}

.lang-card h2 {
  font-size: 1.5rem;
  font-weight: 900;
  margin: 0 0 6px;
  color: #fff;
}

.lang-card .lang-app-sub {
  font-size: .8rem;
  color: rgba(255,255,255,.5);
  margin: 0 0 24px;
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.lang-choose-en {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  margin: 0 0 4px;
}
.lang-choose-ar {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  margin: 0 0 28px;
  direction: rtl;
  font-family: 'Noto Naskh Arabic', 'Segoe UI', Arial, sans-serif;
}

.lang-options {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.lang-btn {
  flex: 1 1 140px;
  min-width: 130px;
  max-width: 180px;
  padding: 18px 14px;
  border: 2px solid rgba(255,255,255,.25);
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 700;
  transition: background .2s, border-color .2s, transform .1s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.lang-btn:hover {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.5);
  transform: translateY(-2px);
}
.lang-btn:active { transform: translateY(0); }

.lang-flag {
  font-size: 1.8rem;
  line-height: 1;
}

.lang-btn-ar span {
  direction: rtl;
  font-family: 'Noto Naskh Arabic', 'Segoe UI', Arial, sans-serif;
}
.lang-btn-ar small {
  font-size: .72rem;
  color: rgba(255,255,255,.6);
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════
   ABOUT TAB — Language Toggle
   ═══════════════════════════════════════════════════════════ */

.lang-toggle-card {
  margin: 16px 48px;
  background: #fff;
  border: 1.5px solid #d4dce8;
  border-radius: 14px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.lang-toggle-label {
  font-weight: 700;
  font-size: .97rem;
  color: #0b1f33;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-toggle-btns {
  display: flex;
  gap: 8px;
}

.lang-toggle-btn {
  padding: 8px 18px;
  border-radius: 9px;
  border: 2px solid #d4dce8;
  background: #f5f8fb;
  color: #5a6b7d;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.lang-toggle-btn:hover {
  background: #e8eef5;
  border-color: #aab8cc;
}
.lang-toggle-btn.active {
  background: #0b1f33;
  border-color: #0b1f33;
  color: #fff;
}

@media (max-width: 520px) {
  .lang-toggle-card { margin: 16px 16px; }
}

/* ═══════════════════════════════════════════════════════════
   NAV LANGUAGE TOGGLE BUTTON
   ═══════════════════════════════════════════════════════════ */

.nav-lang-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 20px;
  color: rgba(255,255,255,.9);
  font-size: .8rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
  letter-spacing: .02em;
}
.nav-lang-btn:hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.4);
}

/* Arabic label inside the button — use Arabic font */
.nav-lang-btn #navLangLabel,
.nav-lang-btn-mob #mobLangLabel {
  font-family: 'Noto Naskh Arabic', 'Segoe UI', Arial, sans-serif;
}

/* Mobile portal version — full width, styled like other nav items */
.nav-lang-btn-mob {
  background: rgba(26,158,140,.15) !important;
  border: 1.5px solid rgba(26,158,140,.4) !important;
  color: #1a9e8c !important;
  font-weight: 700 !important;
  font-family: inherit;
  border-radius: 10px !important;
  margin-bottom: 4px;
}
.nav-lang-btn-mob:hover {
  background: rgba(26,158,140,.25) !important;
}

/* ── Mobile Search Bar ──────────────────────────────────── */
.mobile-search-bar {
  display: none;
}
@media (max-width: 760px) {
  .mobile-search-bar {
    display: block;
    background: #0b1f33;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    position: sticky;
    top: 56px;
    z-index: 90;
  }
  .mobile-search-bar input {
    width: 100%;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    padding: 10px 14px;
    outline: none;
    font-family: inherit;
  }
  .mobile-search-bar input::placeholder { color: rgba(255,255,255,.4); }
  .mobile-search-bar input:focus { border-color: #1a9e8c; }
  /* Push section sticky headers down to account for mobile search bar */
  .section-header { top: 112px; }
}
@media (max-width: 480px) {
  .section-header { top: 112px; }
}

/* ═══════════════════════════════════════════════════════════════════
   RTL MODE (Arabic) — v5.27.0
   Global right-to-left layout. The browser's native bidi algorithm
   handles English technical terms (PEEP, FiO₂, ET, etc.) as LTR
   islands inside RTL Arabic sentences, so commas, colons, parens,
   and numerals land on the correct side automatically.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Base direction + font ── */
html[dir="rtl"] body {
  text-align: right;
  font-family: 'Noto Naskh Arabic', 'Segoe UI', 'Cairo', Arial, sans-serif;
}

/* Help the bidi algorithm on paragraphs/list items that carry mixed
   Arabic + English — isolates each run so punctuation stays anchored. */
html[dir="rtl"] p,
html[dir="rtl"] li,
html[dir="rtl"] td,
html[dir="rtl"] .param-def,
html[dir="rtl"] .param-example,
html[dir="rtl"] .reading-label,
html[dir="rtl"] .vent-title,
html[dir="rtl"] .guide-section-title,
html[dir="rtl"] .auto-peep-warn,
html[dir="rtl"] .gas-trap-warn,
html[dir="rtl"] .section-content,
html[dir="rtl"] .sub-items {
  unicode-bidi: plaintext;
}

/* Technical English strings (PEEP, FiO₂, ETCO₂, etc.) wrapped in our
   bilingual helpers keep their own LTR direction. The existing
   .bi-en-sub / .bi-en / .bi-en-dark rules already set direction: ltr,
   so no extra work needed there. */

/* ── Navigation bar ── */
html[dir="rtl"] .command-nav                 { flex-direction: row-reverse; }
html[dir="rtl"] .command-nav .workspace-btn  { margin-left: 0; margin-right: 0; }
/* Hamburger position handled by margin-inline-start:auto in the mobile rule -
   it auto-flips to push MENU to the far LEFT corner in RTL.
   We just need to neutralize the legacy margin-left:auto on this element in RTL. */
html[dir="rtl"] .nav-hamburger               { margin-left: 0; }
html[dir="rtl"] .command-search              { margin-left: 0; margin-right: auto; }

/* ── Training sidebar (left rail in LTR → right rail in RTL) ── */
html[dir="rtl"] .sidebar {
  border-right: none;
  border-left: 1px solid rgba(255,255,255,.1);
  text-align: right;
}
html[dir="rtl"] .panel-controls      { text-align: right; }
html[dir="rtl"] .section-header      { text-align: right; }
html[dir="rtl"] .section-content     { text-align: right; }
html[dir="rtl"] .sub-items           { padding-left: 0; padding-right: 20px; }
html[dir="rtl"] .agreement-box ul    { margin: 0 18px 14px 0; }

/* ── Appendices sidebar ── */
html[dir="rtl"] #appLibSidebar {
  border-right: none;
  border-left: 1px solid var(--line);
}
html[dir="rtl"] .app-lib-nav-item {
  text-align: right;
  border-left: none;
  border-right: 3px solid transparent;
}
html[dir="rtl"] .app-lib-nav-item.active {
  border-left-color: transparent;
  border-right-color: var(--brand);
}
html[dir="rtl"] .app-lib-section-card {
  border-left: none;
  border-right: 5px solid #0b1f33;
}
html[dir="rtl"] .appx-callout,
html[dir="rtl"] .appx-reaction-card,
html[dir="rtl"] .appx-drug-card {
  border-left: none;
  border-right: 4px solid;
}

/* ── Notes panel (slides in from right in LTR → from left in RTL) ── */
html[dir="rtl"] .notes-panel { right: auto; left: 0; }

/* ── Ventilation simulator (the main pain point) ── */
html[dir="rtl"] .sim-wrap        { direction: rtl; }
html[dir="rtl"] .sim-controls    { border-right: none; border-left: 1px solid var(--line); }
html[dir="rtl"] .sim-charts      { direction: ltr; } /* charts stay LTR — time axis left→right */
html[dir="rtl"] .sim-charts * { unicode-bidi: normal; }
html[dir="rtl"] .reading-item   { border-right: none; border-left: 1px solid var(--line); }
html[dir="rtl"] .reading-item:last-child { border-left: none; }
html[dir="rtl"] .reading-item:first-child { border-right: none; }
html[dir="rtl"] .param-example  { border-left: none; border-right: 3px solid var(--brand-soft); }

/* Keep run/stop buttons, sliders and numerical inputs in their normal
   direction so numbers read left→right even in Arabic mode */
html[dir="rtl"] input[type="number"],
html[dir="rtl"] input[type="range"],
html[dir="rtl"] .run-btn,
html[dir="rtl"] .mv-tab-bar,
html[dir="rtl"] .waveform-grid {
  direction: ltr;
}

/* Mode parameter rows: label on the right, value/unit on the left */
html[dir="rtl"] .param-card-head  { flex-direction: row-reverse; }
html[dir="rtl"] .param-effects    { direction: rtl; }
html[dir="rtl"] .pc-field         { text-align: right; }

/* ── Gate (licensing) modal ── */
html[dir="rtl"] .gate-card             { text-align: right; }
html[dir="rtl"] .gate-close-btn        { right: auto; left: 16px; }
html[dir="rtl"] .gate-back-btn         { text-align: right; }
html[dir="rtl"] .gate-input            { text-align: right; }
html[dir="rtl"] .gate-otp-input,
html[dir="rtl"] .gate-key-input        { text-align: center; direction: ltr; } /* codes stay LTR */
html[dir="rtl"] .qi-number             { direction: ltr; } /* card numbers stay LTR */

/* ── Sign-out modal ── */
html[dir="rtl"] #signOutModal > div    { text-align: center; }

/* ── Install banner ── */
html[dir="rtl"] .install-banner        { flex-direction: row-reverse; text-align: right; }

/* ── Home / About ── */
html[dir="rtl"] .home-stats,
html[dir="rtl"] .home-actions,
html[dir="rtl"] .about-endorsements,
html[dir="rtl"] .about-checklist       { text-align: right; }
html[dir="rtl"] .about-endorsement-card { text-align: right; }
html[dir="rtl"] .endorse-author         { align-items: flex-end; }

/* ── Trial status banner ── */
html[dir="rtl"] #trialStatusBanner     { text-align: center; }

/* ── Search results panel ── */
html[dir="rtl"] .search-results-panel  { direction: rtl; text-align: right; }
html[dir="rtl"] .srp-item              { text-align: right; }
html[dir="rtl"] .srp-top               { flex-direction: row-reverse; }
html[dir="rtl"] .srp-close             { margin-left: 0; margin-right: auto; }

/* ── Mobile menu portal ── */
html[dir="rtl"] .mobile-menu-portal    { text-align: right; }

/* ── Form inputs, selects, textareas ── */
html[dir="rtl"] input[type="text"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="search"],
html[dir="rtl"] input[type="password"],
html[dir="rtl"] select,
html[dir="rtl"] textarea {
  text-align: right;
}
/* Numeric inputs stay LTR so digits and decimals read correctly */
html[dir="rtl"] input[type="number"],
html[dir="rtl"] input[inputmode="numeric"],
html[dir="rtl"] input[inputmode="tel"] {
  text-align: center;
  direction: ltr;
}

/* ── Bilingual helper tweaks in RTL context ── */
/* In RTL mode the bi-ar-primary line is already RTL — no extra rule needed.
   The bi-en-sub line stays LTR (italic, muted) as designed. */
html[dir="rtl"] .bi-label              { align-items: flex-end; }

/* ── Progress bars stay LTR so fill flows correctly ── */
html[dir="rtl"] .progress-bar,
html[dir="rtl"] .progress-fill         { direction: ltr; }

/* ── Tables ── */
html[dir="rtl"] table                  { text-align: right; }
html[dir="rtl"] th, html[dir="rtl"] td { text-align: right; }

/* ── Checkboxes and radio buttons — label after control in LTR,
   label before control in RTL (flex handles this with row-reverse) ── */
html[dir="rtl"] label.form-check-inline { flex-direction: row-reverse; gap: 8px; }

/* ── Section nav grid (1–25 sections) ── */
html[dir="rtl"] #sectionNav            { direction: rtl; }


/* ═══════════════════════════════════════════════════════════════════
   v5.27.1 - Mobile Ventilation Simulator UX overhaul
   When sim is running on mobile, .sim-fullscreen is added to .sim-wrap.
   This hides controls and turns the charts panel into a full-screen
   modal with a close X (top) and a "Stop & Adjust" button (bottom).
   Solves: accidental slider drags during scroll, charts hidden below fold.
   Desktop layout (>768px) is completely unchanged.
   ═══════════════════════════════════════════════════════════════════ */

/* Default state: mobile control button hidden until overlay is active */
.sim-mobile-stop { display: none; }

@media (max-width: 768px) {
  /* Lock body scroll while overlay is open */
  body.sim-modal-open { overflow: hidden; }

  /* Hide the controls panel when overlay is active */
  .sim-wrap.sim-fullscreen .sim-controls { display: none; }

  /* Charts panel becomes a fullscreen overlay */
  .sim-wrap.sim-fullscreen .sim-charts {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: var(--surface-strong, #0b1f33);
    max-height: none;
    padding: 14px 14px 92px;   /* room for bottom Stop button (X removed in v5.27.4) */
    overflow-y: hidden;        /* v5.27.40: no scroll — charts are fitted to viewport by JS */
    box-sizing: border-box;
  }
  /* v5.27.40: kill min-height guards so JS-fitted canvas heights are honoured */
  .sim-wrap.sim-fullscreen .sim-charts .chart-body { min-height: 0; }
  .sim-wrap.sim-fullscreen .sim-charts .chart-body canvas { min-height: 0; }

  /* Bottom Stop & Adjust button */
  .sim-wrap.sim-fullscreen .sim-mobile-stop {
    display: block;
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 700;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 10px;
    z-index: 9001;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(220,38,38,.35);
    letter-spacing: .02em;
  }
  .sim-wrap.sim-fullscreen .sim-mobile-stop:active {
    background: #b91c1c;
    transform: translateY(1px);
  }
}

/* On wider screens: ensure no leak — class is harmless if accidentally applied */
@media (min-width: 769px) {
  .sim-wrap.sim-fullscreen .sim-controls { display: block; }
  .sim-wrap.sim-fullscreen .sim-charts {
    position: static;
    padding: 14px;
  }
}

/* v5.27.41: While the fullscreen sim overlay is open (z-index 9000), the helper
   popup (z-index 999) was invisible — painted behind the overlay. User could click
   ? buttons, nothing appeared, then on Stop the popup would surface on the main screen.
   Fix: promote popup + backdrop above the overlay stack when sim-modal-open is active. */
body.sim-modal-open #helperPopup    { z-index: 9200; }
body.sim-modal-open #helperOverlay,
body.sim-modal-open #helperOverlay2 { z-index: 9150; }

/* ═══════════════════════════════════════════════════════════════════
   v5.27.3 - Stepper controls (replaces native range sliders in MV sim)
   Tap-only +/- controls. No accidental drag-while-scroll.
   ═══════════════════════════════════════════════════════════════════ */
.stepper-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 6px;
}
.stepper-row .slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  padding: 0;
}
.stepper-row .slider-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.stepper {
  display: flex;
  align-items: stretch;
  gap: 2px;
  background: var(--surface-strong, #f1f5f9);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.stepper-btn {
  flex: 0 0 44px;
  min-height: 44px;
  border: none;
  background: var(--brand, #1a9e8c);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.stepper-btn:active {
  background: var(--brand-dark, #0e7a6b);
  transform: scale(.96);
}
.stepper-value {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  color: var(--brand, #1a9e8c);
  background: #fff;
  padding: 0 8px;
  font-variant-numeric: tabular-nums;
  min-width: 60px;
}
.stepper-unit {
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11px;
  color: var(--muted, #64748b);
  background: #fff;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .stepper-btn  { flex-basis: 52px; min-height: 52px; font-size: 26px; }
  .stepper-value { font-size: 18px; min-width: 70px; }
}

/* ════════════════════════════════════════════════════════════
   v5.27.8 — Clinical Authority layer (additive only)
   v5.27.9 — Tighter padding + bolder Amjad Adnan name
   Home: .authority-badge under branding
   About: .about-authority prepended to renderAboutContent
   ════════════════════════════════════════════════════════════ */
.authority-badge {
  margin: 6px 16px 12px;          /* v5.27.9 — tighter top/bottom */
  padding: 7px 14px;              /* v5.27.9 — less vertical padding */
  border-left: 4px solid #0b1f33;
  background: #f4f7fb;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.45;
}

.authority-line {
  font-weight: 600;
  color: #0b1f33;
}

.authority-line.secondary {
  font-weight: 600;               /* v5.27.9 — was 500; matches primary weight */
  color: #3a4b5c;
  font-size: 0.82rem;
}

/* v5.27.9 — extra-bold for the credited names (Dr. Amir Fadhel, Amjad Adnan) */
.authority-badge strong {
  font-weight: 800;
}

.about-authority {
  margin: 20px 16px;
  padding: 16px;
  border: 1.5px solid #d4dce8;
  border-radius: 12px;
  background: #ffffff;
}

.about-authority h3 {
  margin-bottom: 10px;
  font-size: 1rem;
  color: #0b1f33;
}

.about-authority p {
  margin: 6px 0;
  font-size: 0.85rem;
  color: #3a4b5c;
}

/* v5.27.9 — extra-bold for the credited names in About too */
.about-authority strong {
  font-weight: 800;
}

/* ════════════════════════════════════════════════════════════
   v5.27.10 — Scoped block-level RTL for AR mode
   Restores the v5.27.0 reading experience for the About page
   and the Home authority badge — WITHOUT touching nav, MV
   (#ventilationWorkspace), Appendices (#appLibContent),
   or the Training form (#trainingWorkspace).
   ════════════════════════════════════════════════════════════ */

/* Home authority badge — flip border to the right side, RTL block context */
.authority-badge.is-ar {
  direction: rtl;
  text-align: right;
  border-left: none;
  border-right: 4px solid #0b1f33;
  font-family: 'Noto Naskh Arabic', 'Segoe UI', Arial, sans-serif;
}

/* About content area — full block RTL so paragraphs, periods, line wraps,
   and bilingual stacks all flow as a coherent Arabic page */
#aboutBody.is-ar {
  direction: rtl;
  text-align: right;
}

/* English sub-lines under Arabic (biLabel/biPara output) — right-anchor
   them inside #aboutBody.is-ar so they sit cleanly under the Arabic.
   Scoped to #aboutBody only — Appendices and Training keep their bi-en-sub
   left-aligned italic exactly as they are. */
#aboutBody.is-ar .bi-en-sub {
  text-align: right;
  direction: ltr;
  unicode-bidi: isolate;
}

/* ════════════════════════════════════════════════════════════
   v5.27.11 — Option C: extend block-level RTL to Appendices and
   MV (per user request). Workspace-level direction:rtl gives
   Arabic prose a coherent reading flow and fixes browser-bidi
   issues with embedded English drug/dose terms. Tables, sliders,
   canvas, and other structural elements get explicit direction:
   ltr so column order, slider direction, and waveform pixel
   coordinates are preserved exactly as they look today.
   ════════════════════════════════════════════════════════════ */

/* ── Appendices content area ── */
#appLibContent.is-ar {
  direction: rtl;
  text-align: right;
}
#appLibContent.is-ar .bi-en-sub {
  text-align: right;
}

/* Tables stay LTR — column order preserved. Covers the 46 drug
   doses, lab values, blood compatibility, and similar matrices. */
#appLibContent.is-ar table,
#appLibContent.is-ar .app-lib-table {
  direction: ltr;
  text-align: left;
}

/* ── MV / Ventilation workspace ── */
#ventilationWorkspace.is-ar {
  direction: rtl;
  text-align: right;
}
#ventilationWorkspace.is-ar .bi-en-sub {
  text-align: right;
}

/* MV interactive controls + canvas stay LTR — preserve slider
   direction (low on left, high on right), stepper button order,
   and waveform pixel coordinates. */
#ventilationWorkspace.is-ar input[type="range"],
#ventilationWorkspace.is-ar canvas,
#ventilationWorkspace.is-ar .stepper,
#ventilationWorkspace.is-ar .stepper-btn,
#ventilationWorkspace.is-ar .stepper-value {
  direction: ltr;
}

/* ════════════════════════════════════════════════════════════
   v5.27.13 — Standalone LTR for English-only testimonial cards
   inside #aboutBody.is-ar. The doctors' quotes were given in
   English; under direction:rtl the bidi algorithm placed quotes,
   periods, dashes, and numbers in wrong positions. Forcing LTR
   on the card itself restores correct English typography while
   the surrounding Arabic content keeps its RTL flow.
   ════════════════════════════════════════════════════════════ */
#aboutBody.is-ar .testimonial-card {
  direction: ltr;
  text-align: left;
}

/* ════════════════════════════════════════════════════════════
   v5.27.14 — Phase 1: LTR islands for English-only MV cards
   Inside #ventilationWorkspace.is-ar, force LTR + left-align on
   blocks that are pure English (effect callouts, OR Examples,
   warning notes, dark header bars, formulas, action items).
   This kills bidi drift on commas, periods, dashes, ranges, and
   embedded numbers in clinical English text.
   .bilingual-rtl is an opt-out for the few blocks that have
   data-ar attributes and get biPara-processed (Pplat card +
   PBW Target range + simulation tab notes).
   ════════════════════════════════════════════════════════════ */
#ventilationWorkspace.is-ar .effect-box,
#ventilationWorkspace.is-ar .param-example,
#ventilationWorkspace.is-ar .pbw-target-note,
#ventilationWorkspace.is-ar .param-card-head,
#ventilationWorkspace.is-ar .pbw-formula,
#ventilationWorkspace.is-ar .pg-action {
  direction: ltr;
  text-align: left;
}

/* Bilingual exception — keep RTL for biPara-processed blocks */
#ventilationWorkspace.is-ar .bilingual-rtl {
  direction: rtl;
  text-align: right;
}

/* ════════════════════════════════════════════════════════════
   v5.27.15 — Phase 1 MV stragglers: pattern cards + ETCO₂ list
   .pg-info covers SHAPE/MEANS rows in all 7 Pattern Recognition
   cards (zero data-ar across all of them — safe to LTR-island).
   ETCO₂ section: target the English-only <p> and <ul> children;
   exclude any <p> containing a .bi-para-en span (which signals
   the paragraph was biPara-processed and must stay RTL).
   This uses :not(:has(...)) for structural exclusion — no HTML
   markup edits required.
   ════════════════════════════════════════════════════════════ */
#ventilationWorkspace.is-ar .pg-info,
#ventilationWorkspace.is-ar .etco2-note-title,
#ventilationWorkspace.is-ar .etco2-note > p:not(:has(.bi-para-en)),
#ventilationWorkspace.is-ar .etco2-note > ul {
  direction: ltr;
  text-align: left;
}

/* ════════════════════════════════════════════════════════════
   v5.27.16 — Home page Arabic reading flow
   Scoped RTL for the hero title/subtitle and the 3 home-cards
   when in AR mode. Strings affected:
     • إتقان تقنيات التخدير  (hero title)
     • رفيقك في التدريب السريري  (hero subtitle)
     • استمارة التدريب           (Training Form card)
     • المراجع السريرية          (Appendices card)
     • محاكي التهوية             (Ventilation Sim card)
   No clinical content changed. About page untouched.
   ════════════════════════════════════════════════════════════ */
.home-hero-content.is-ar {
  direction: rtl;
  text-align: right;
}

.home-card.is-ar {
  direction: rtl;
  text-align: right;
}

/* ════════════════════════════════════════════════════════════
   v5.27.17 — Notes column RTL inside Appendices tables (Option C)
   Scope: ONLY the last <td> of each data row, AND only when it
   contains a .bi-para-en span (= biPara-processed bilingual cell).
   English-only Notes cells stay LTR. Headers stay LTR. Drug name,
   route, dose cells stay LTR — column order preserved exactly.
   ════════════════════════════════════════════════════════════ */
#appLibContent.is-ar .app-lib-table tbody tr td:last-child:has(.bi-para-en) {
  direction: rtl;
  text-align: right;
}

/* English explainer line stacks under Arabic, right-anchored for visual flow */
#appLibContent.is-ar .app-lib-table tbody tr td:last-child:has(.bi-para-en) .bi-para-en {
  text-align: right;
}

/* ════════════════════════════════════════════════════════════
   v5.27.18 — Authority badge polish + bidi safety
   Subtle hairline between Dr. Amir Fadhel (primary) and
   Amjad Adnan (secondary) so the two contributors read as
   distinct credentials rather than one merged credit block.
   ════════════════════════════════════════════════════════════ */
.authority-line.secondary {
  border-top: 1px solid rgba(11, 31, 51, 0.08);
  padding-top: 5px;
  margin-top: 5px;
}

/* ════════════════════════════════════════════════════════════
   v5.27.19 — Glassmorphism shimmer for Home CTAs and cards
   ────────────────────────────────────────────────────────────
   Scope: STRICTLY .home-actions buttons and .home-card.
   Global .btn-primary / .btn-secondary used elsewhere in the
   app (training form, appendix placeholder, danger banners)
   are untouched. The shimmer is a soft "click me" hint —
   slow, low-opacity, GPU-accelerated transform-based.
   ════════════════════════════════════════════════════════════ */

/* ── Hero CTA buttons ─────────────────────────────────────── */
.home-actions .btn-primary,
.home-actions .btn-secondary {
  position: relative;
  overflow: hidden;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 10px;
  letter-spacing: 0.01em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  isolation: isolate;
}

.home-actions .btn-primary {
  background: linear-gradient(135deg, #0b1f33 0%, #1a3a55 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    0 4px 16px rgba(11, 31, 51, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.home-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.home-actions .btn-primary:hover,
.home-actions .btn-secondary:hover {
  transform: translateY(-1px);
  opacity: 1;
}
.home-actions .btn-primary:hover {
  box-shadow:
    0 8px 26px rgba(11, 31, 51, 0.40),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.home-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 8px 26px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

/* Slow diagonal shimmer sweep — "click me" pulse */
.home-actions .btn-primary::before,
.home-actions .btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.20) 50%,
    transparent 100%
  );
  transform: skewX(-22deg);
  animation: enki-shimmer 3.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
.home-actions .btn-secondary::before { animation-delay: 1.4s; }

.home-actions .btn-primary > *,
.home-actions .btn-secondary > * { position: relative; z-index: 2; }

@keyframes enki-shimmer {
  0%   { left: -150%; }
  55%  { left: 200%; }
  100% { left: 200%; }
}

/* ── Home cards ───────────────────────────────────────────── */
.home-card {
  position: relative;
  overflow: hidden;
  transition: background 0.18s ease, transform 0.20s ease, box-shadow 0.20s ease;
  isolation: isolate;
}

.home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(11, 31, 51, 0.10);
  z-index: 2;
}

/* Soft teal-tinted shimmer — staggered across the 3 cards */
.home-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(13, 148, 136, 0.10) 50%,
    transparent 100%
  );
  transform: skewX(-22deg);
  animation: enki-card-shimmer 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.home-card:nth-of-type(1)::after { animation-delay: 0s;   }
.home-card:nth-of-type(2)::after { animation-delay: 1.6s; }
.home-card:nth-of-type(3)::after { animation-delay: 3.2s; }

.home-card > * { position: relative; z-index: 1; }

@keyframes enki-card-shimmer {
  0%, 25% { left: -150%; }
  70%     { left: 200%; }
  100%    { left: 200%; }
}

/* Respect reduced-motion preference — disable shimmer for users
   who request reduced motion (accessibility). */
@media (prefers-reduced-motion: reduce) {
  .home-actions .btn-primary::before,
  .home-actions .btn-secondary::before,
  .home-card::after {
    animation: none;
    display: none;
  }
}

/* ════════════════════════════════════════════════════════════
   v5.27.20 — Supporting Clinical Team (About page only)
   ────────────────────────────────────────────────────────────
   Static bilingual credit block under Clinical Authority.
   English name on top (bold), Arabic transliteration below.
   Self-contained — does NOT inherit Clinical Authority styles.
   ════════════════════════════════════════════════════════════ */
.about-team {
  margin: 10px 16px 20px;
  padding: 14px;
  border-radius: 10px;
  background: #f7f9fc;
  border: 1px solid #e2e8f0;
}

.about-team h3 {
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: #0b1f33;
}

.about-team p {
  margin: 8px 0;
  font-size: 0.82rem;
  color: #3a4b5c;
}

.about-team span {
  display: block;
  direction: rtl;
  font-size: 0.8rem;
  color: #5a6b7c;
}
.about-platforms { margin-top:14px; padding-top:12px; border-top:1px solid var(--line); }
.about-platforms-label { font-size:.74rem; font-weight:700; color:#5a6b7c; text-transform:uppercase; letter-spacing:.06em; margin-bottom:10px; }
.about-platforms-row { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.platform-logo { height:80px; width:auto; border-radius:8px; object-fit:contain; opacity:.9; transition:opacity .2s; }
.platform-logo:hover { opacity:1; }
.platform-logo[alt="SEVO.MAJIC"] { height:110px; }
