/* ==========================================================================
   3Shape Digital Denture Manual — Editorial Spread Layout & Playbook Cards
   ========================================================================== */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 58px;
  background: var(--bg-chrome);
  border-top: 3px solid var(--accent-primary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
  z-index: 40;
}

.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-center { flex: 1; max-width: 480px; }

.brand-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 13px;
  white-space: nowrap;
}
.brand-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-primary);
}
.brand-tag {
  font-family: var(--font-display);
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--accent-primary);
  font-weight: 700;
}

.jump-back-btn {
  border-color: var(--accent-primary) !important;
  background: var(--accent-glow) !important;
  color: var(--accent-primary) !important;
  font-weight: 700 !important;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 35px;
  padding: 0 12px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}
.icon-btn:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.icon-btn.active {
  background: var(--accent-glow);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.divider-v { width: 1px; height: 22px; background: var(--border-subtle); margin: 0 2px; }

/* SEARCH BAR */
.search-shell { position: relative; width: 100%; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
#search-input {
  width: 100%;
  height: 36px;
  padding: 0 34px 0 36px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}
#search-input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-kbd {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-display); font-size: 11px; font-weight: 700; color: var(--text-muted);
  background: var(--bg-elevated); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-subtle);
}
.search-dropdown {
  position: absolute; top: 43px; left: 0; right: 0;
  max-height: 360px; overflow-y: auto;
  background: var(--bg-chrome); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); box-shadow: 0 18px 40px rgba(0,0,0,0.38);
  z-index: 60;
}
.search-item {
  padding: 11px 14px; border-bottom: 1px solid var(--border-subtle); cursor: pointer;
}
.search-item:hover { background: var(--bg-elevated); }
.search-item-head { display: flex; justify-content: space-between; font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--accent-primary); }
.search-item-snippet { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }

/* STAGE & MAGAZINE SPREAD */
.book-stage {
  position: fixed;
  top: 58px; bottom: 48px; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 56px;
  overflow: hidden;
}

.spread-viewport {
  width: 100%;
  height: 100%;
  max-width: 1460px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-container {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-page);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px var(--spine-shadow);
  overflow: hidden;
  position: relative;
}

.book-container::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 26px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.14) 48%, rgba(255,255,255,0.04) 50%, rgba(0,0,0,0.14) 52%, transparent);
  pointer-events: none;
  z-index: 5;
}

.book-container.flip-next { animation: slideNext 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
.book-container.flip-prev { animation: slidePrev 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes slideNext {
  0% { opacity: 0.5; transform: translateX(16px) scale(0.994); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes slidePrev {
  0% { opacity: 0.5; transform: translateX(-16px) scale(0.994); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

.magazine-page {
  height: 100%;
  padding: 26px 34px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  border-right: 1px solid var(--border-subtle);
}
.magazine-page:last-child { border-right: none; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.page-body { flex: 1; display: flex; flex-direction: column; gap: 13px; }

.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 2px;
}
.eyebrow-badge {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--accent-primary);
  font-size: 11px;
  font-weight: 700;
}
.eyebrow-badge.is-tech {
  background: var(--accent-teal-tint);
  color: var(--accent-secondary);
}

.page-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 2px 0 6px;
  color: var(--text-primary);
}

.page-lead {
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--text-secondary);
  margin: 0;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  margin-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/* STEP-BY-STEP INSTRUCTIONAL PLAYBOOK LIST */
.step-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.step-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 15px;
  background: var(--bg-page-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.step-num {
  flex-shrink: 0;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: var(--accent-contrast-text);
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.step-content h4 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}
.step-content p {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.54;
  color: var(--text-secondary);
}

/* INTERACTIVE CROSS-LINK PILLS (BOOT CAMP -> DEEP DIVE) */
.deep-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-teal-tint);
  border: 1px solid var(--accent-secondary);
  color: var(--accent-secondary);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.deep-link-pill:hover {
  transform: translateX(2px);
  filter: brightness(1.08);
}

/* SCENARIO DECISION CARDS */
.scenario-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.scenario-card {
  padding: 12px 15px;
  background: var(--bg-page-alt);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-secondary);
  border-radius: var(--radius-md);
}
.scenario-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.scenario-header strong {
  font-family: var(--font-display);
  font-size: 13.5px;
  color: var(--text-primary);
}
.scenario-tag {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-teal-tint);
  color: var(--accent-secondary);
  white-space: nowrap;
}
.scenario-card p {
  margin: 0;
  font-size: 13.2px;
  line-height: 1.52;
  color: var(--text-secondary);
}

/* Spec Cards & Parameter Tables */
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spec-card {
  background: var(--bg-page-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.spec-card h4 { margin: 0 0 4px; font-family: var(--font-display); font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.spec-card p { margin: 0; font-size: 13px; line-height: 1.52; color: var(--text-secondary); }
.mono-chip {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--accent-glow);
  color: var(--accent-primary);
}

.cad-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.cad-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-strong);
  font-family: var(--font-display);
  font-weight: 700;
}
.cad-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: top;
}

/* Video Walkthrough Card */
.video-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px 13px 18px;
  border-radius: 10px;
  background: var(--accent-glow);
  border: 1px solid var(--accent-primary);
  box-shadow: inset 4px 0 0 var(--accent-primary);
}
.video-callout-info strong { display: block; font-family: var(--font-display); font-size: 13px; color: var(--text-primary); }
.video-callout-info span { font-size: 12px; color: var(--text-secondary); }
.btn-watch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--accent-primary);
  color: var(--accent-contrast-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.btn-watch:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* Edge Navigation Arrows */
.edge-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 64px;
  background: var(--bg-chrome);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 30;
  transition: var(--transition);
}
.edge-nav:hover:not(:disabled) { border-color: var(--accent-primary); color: var(--accent-primary); }
.edge-nav:disabled { opacity: 0.28; cursor: not-allowed; }
.edge-prev { left: 10px; }
.edge-next { right: 10px; }

/* CONTINUOUS SCROLL MODE */
.book-stage.mode-scroll {
  position: relative;
  top: 58px;
  bottom: auto;
  height: auto;
  min-height: calc(100vh - 106px);
  padding: 24px 20px 72px;
  overflow-y: visible;
}
.book-stage.mode-scroll .edge-nav { display: none; }
.book-stage.mode-scroll .book-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: transparent;
  border: none;
  box-shadow: none;
  max-width: 920px;
}
.book-stage.mode-scroll .book-container::after { display: none; }
.book-stage.mode-scroll .magazine-page {
  background: var(--bg-page);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px var(--spine-shadow);
  height: auto;
  overflow: visible;
}

/* BOTTOM BAR */
.bottombar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 48px;
  background: var(--bg-chrome);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(0, auto) minmax(130px, 1fr);
  align-items: center;
  padding: 0 18px;
  gap: 20px;
  z-index: 40;
}
.bottom-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  min-width: 0;
}
.bottom-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  font-size: 12.5px;
}
.bottom-center {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.spread-segments {
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 2px 10px;
}
.spread-segments::-webkit-scrollbar { display: none; }
.spread-segments .seg-pill {
  flex: 0 0 auto;
  padding: 4px 9px;
  font-size: 11px;
}
.seg-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 34px;
  height: 28px;
  padding: 0 11px;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.seg-pill:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.seg-pill.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--accent-contrast-text);
}
.chapter-pill {
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px; background: var(--accent-glow); color: var(--accent-primary);
}
.section-title { color: var(--text-secondary); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-jump-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 4px 11px;
  cursor: pointer;
  transition: var(--transition);
}
.page-jump-btn:hover { border-color: var(--accent-primary); }
.page-counter { font-family: var(--font-display); font-size: 11.5px; font-weight: 700; color: var(--text-primary); }
.page-jump-input {
  width: 66px;
  height: 26px;
  padding: 0 6px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--accent-primary);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 11.5px;
  text-align: center;
}

/* DRAWER & MODALS */
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; width: 340px;
  background: var(--bg-chrome); border-right: 1px solid var(--border-strong);
  transform: translateX(-100%); transition: transform 0.25s ease;
  z-index: 70; display: flex; flex-direction: column; padding: 20px;
}
.drawer.open { transform: translateX(0); }
.drawer-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--border-subtle); }
.drawer-header h2 { margin: 2px 0 0; font-family: var(--font-display); font-size: 17px; }
.drawer-eyebrow, .drawer-label { font-family: var(--font-display); font-size: 11px; font-weight: 700; color: var(--accent-primary); letter-spacing: 0.05em; text-transform: uppercase; }
.drawer-section { padding: 14px 0; border-bottom: 1px solid var(--border-subtle); }
.bookmarks-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.empty-note { font-size: 13px; line-height: 1.45; color: var(--text-muted); }
.toc-nav { flex: 1; overflow-y: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }

.toc-part-divider {
  margin: 8px 0 4px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--accent-glow);
  color: var(--accent-primary);
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.toc-part-divider.is-part-two {
  background: var(--accent-teal-tint);
  color: var(--accent-secondary);
}

.toc-item {
  text-align: left; padding: 10px 12px; background: var(--bg-page-alt);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  color: var(--text-primary); cursor: pointer; font-family: var(--font-sans);
  font-size: 13.5px; line-height: 1.38; transition: var(--transition);
}
.toc-item strong { font-family: var(--font-display); font-weight: 700; color: var(--text-primary); display: block; }
.toc-item:hover, .toc-item.active { border-color: var(--accent-primary); background: var(--accent-glow); }
.toc-item small { display: block; font-family: var(--font-display); font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin-top: 4px; }

.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 65; }
.hidden { display: none !important; }

.modal {
  position: fixed; inset: 0; background: rgba(10, 10, 14, 0.86);
  backdrop-filter: blur(6px); z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-toolbar {
  width: 100%; max-width: 1280px; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; background: var(--bg-chrome); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.modal-title-group h3 { margin: 2px 0 0; font-family: var(--font-display); font-size: 15px; }
.modal-badge { font-family: var(--font-display); font-size: 11px; font-weight: 700; color: var(--accent-secondary); letter-spacing: 0.04em; text-transform: uppercase; }
.modal-controls { display: flex; align-items: center; gap: 8px; }
.zoom-readout { font-family: var(--font-display); font-size: 12px; font-weight: 700; min-width: 48px; text-align: center; }
.lightbox-canvas {
  width: 100%; max-width: 1280px; flex: 1; background: var(--svg-bg);
  border-left: 1px solid var(--border-strong); border-right: 1px solid var(--border-strong);
  overflow: hidden; display: flex; align-items: center; justify-content: center; cursor: grab;
}
.lightbox-stage { transition: transform 0.12s ease-out; width: 92%; max-width: 1080px; }
.lightbox-caption {
  width: 100%; max-width: 1280px; padding: 11px 18px;
  background: var(--bg-chrome); border: 1px solid var(--border-strong);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: 13px; color: var(--text-secondary);
}

.modal-card {
  width: 100%; max-width: 860px; background: var(--bg-chrome);
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg); overflow: hidden;
}
.modal-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 20px; border-bottom: 1px solid var(--border-subtle);
}
.modal-card-header h3 { margin: 2px 0 0; font-family: var(--font-display); font-size: 16px; }
.hotkey-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 20px; }
.hk-group h4 { margin: 0 0 10px; font-family: var(--font-display); font-size: 12.5px; color: var(--accent-primary); font-weight: 700; }
.hk-row { display: flex; flex-direction: column; gap: 4px; padding: 7px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13px; color: var(--text-secondary); }
.hk-row kbd { align-self: flex-start; font-family: var(--font-display); font-size: 11.5px; font-weight: 700; padding: 2px 8px; background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: 5px; color: var(--text-primary); }

.video-card { max-width: 920px; }
.hk-card-wide { max-width: 1180px; }
.hk-grid-expanded {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 4px;
}
@media (max-width: 1024px) { .hk-grid-expanded { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .hk-grid-expanded { grid-template-columns: 1fr; } }

.tooth-card { max-width: 1060px; }
.tooth-tabs { display: inline-flex; gap: 6px; }
.tooth-tabs .icon-btn.active {
  background: var(--accent-primary);
  color: var(--accent-contrast-text);
  border-color: var(--accent-primary);
}
.tooth-legend-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-secondary);
}
.tooth-hover-readout {
  margin-left: auto;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent-primary);
}
.tooth-arch-diagram {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.tooth-arch-diagram svg {
  width: 100%;
  height: auto;
  max-height: 280px;
  display: block;
}
.arch-tooth-node { cursor: pointer; transition: transform 0.12s ease; }
.arch-tooth-node:hover .arch-crown {
  stroke: var(--accent-primary);
  stroke-width: 2.2;
  fill: var(--accent-glow);
}
.tooth-table-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-height: 44vh;
  overflow-y: auto;
}
@media (max-width: 820px) { .tooth-table-wrap { grid-template-columns: 1fr; } }
.tooth-quadrant {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.tooth-quadrant h4 {
  margin: 0;
  padding: 8px 12px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-primary);
  border-bottom: 1px solid var(--border-subtle);
}
.tooth-grid-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tooth-grid-table th, .tooth-grid-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
.tooth-grid-table th { font-family: var(--font-display); font-size: 11px; color: var(--text-muted); font-weight: 700; }
.tooth-grid-table tr:last-child td { border-bottom: none; }
.tooth-badge-univ {
  display: inline-block;
  min-width: 34px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-glow);
  color: var(--accent-primary);
  font-family: var(--font-display);
  font-weight: 700;
  text-align: center;
}
.tooth-badge-fdi {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
}

.video-frame-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #0d0d11;
}
.video-frame-wrap::before {
  content: "Loading tutorial video...";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: #a1a1aa;
  z-index: 1;
}
.video-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

@media (max-width: 1024px) {
  .book-container { grid-template-columns: 1fr; max-width: 720px; }
  .book-container::after { display: none; }
  .btn-label { display: none; }
  .hotkey-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .book-stage { padding: 10px 12px; }
  .edge-nav { width: 30px; height: 50px; }
  .spec-grid { grid-template-columns: 1fr; }
}

/* Collapsible Chapter Accordions in Table of Contents */
.toc-chapter {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  margin-bottom: 6px;
  overflow: hidden;
}
.toc-chapter-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.toc-chapter-btn:hover { background: var(--accent-glow); }
.toc-chapter-meta { display: flex; flex-direction: column; gap: 2px; }
.toc-ch-num {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.toc-ch-title { font-family: var(--font-display); font-size: 0.8rem; font-weight: 700; line-height: 1.3; }
.toc-ch-chevron { font-size: 0.85rem; color: var(--text-muted); transition: transform 0.2s ease; flex-shrink: 0; }
.toc-chapter.is-open .toc-ch-chevron { transform: rotate(180deg); }
.toc-chapter-pages {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px 10px 8px;
  border-top: 1px solid var(--border);
  background: var(--bg-page);
}
.toc-chapter.is-open .toc-chapter-pages { display: flex; }
.toc-item.is-current {
  border-color: var(--accent-primary);
  background: var(--accent-glow);
}


/* ==========================================================================
   Doctor-to-Bench Jargon Translator Tooltips & Dictionary Badges
   ========================================================================== */
.jargon-term {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  color: var(--accent-primary);
  border-bottom: 1.5px dotted var(--accent-primary);
  cursor: help;
  padding: 0 2px;
  border-radius: 3px;
  transition: background 0.15s ease;
}
.jargon-term:hover,
.jargon-term:focus {
  background: var(--accent-glow);
  outline: none;
}
.jargon-term::after {
  content: "?" ;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: var(--accent-contrast-text);
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

#jargon-floating-tip {
  position: fixed;
  z-index: 9999;
  max-width: 310px;
  padding: 10px 13px;
  background: var(--bg-chrome);
  color: var(--text-primary);
  border: 1.5px solid var(--accent-primary);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.48);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}
#jargon-floating-tip.is-visible {
  opacity: 1;
  transform: translateY(0);
}
#jargon-floating-tip .jtip-label {
  display: block;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-secondary);
  margin-bottom: 3px;
}
#jargon-floating-tip .jtip-text {
  display: block;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-primary);
}
