/* ==========================================================================
   ZYAD Survival Handbook — Interactive wiki layout
   ========================================================================== */

html:has(body.handbook-page) {
  scroll-behavior: auto;
}

.handbook-page main {
  padding: 0;
}

.handbook-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.handbook-page .handbook-layout {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.handbook-footer {
  flex-shrink: 0;
  margin-top: 0;
  background: rgba(13, 15, 14, 0.98);
  border-top: 1px solid var(--border-subtle);
  padding: 0.55rem 1.25rem;
}

.handbook-footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.handbook-footer-links {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.handbook-footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.handbook-footer-links a:hover {
  color: var(--accent-orange);
}

.handbook-footer-sep {
  opacity: 0.55;
  user-select: none;
}

@media (max-width: 500px) {
  .handbook-footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* --- Top toolbar --- */
.handbook-toolbar {
  position: sticky;
  top: var(--header-height);
  z-index: 100;
  background: rgba(13, 15, 14, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.25rem;
}

.handbook-toolbar-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.handbook-toolbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.06em;
  margin-right: auto;
}

.handbook-toolbar-title span {
  color: var(--accent-orange);
}

.handbook-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.handbook-sidebar-toggle:hover {
  border-color: var(--accent-green);
  background: var(--bg-card-hover);
}

.handbook-search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 420px;
}

.handbook-search {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.handbook-search:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.2);
}

.handbook-search-wrap::before {
  content: "⌕";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.handbook-search-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 200;
  display: none;
}

.handbook-search-suggest.is-open {
  display: block;
}

.handbook-suggest-item {
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition);
}

.handbook-suggest-item:last-child {
  border-bottom: none;
}

.handbook-suggest-item:hover,
.handbook-suggest-item.active {
  background: rgba(74, 124, 89, 0.15);
}

.handbook-suggest-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.handbook-suggest-path {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.handbook-lang {
  display: flex;
  gap: 0.35rem;
}

.handbook-lang button {
  padding: 0.45rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.handbook-lang button:hover {
  color: var(--text-primary);
  border-color: var(--accent-green);
}

.handbook-lang button.active {
  color: var(--accent-orange);
  border-color: var(--accent-orange);
  background: rgba(232, 168, 56, 0.1);
}

.handbook-overview-btn {
  padding: 0.5rem 0.9rem;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.handbook-overview-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-green);
}

/* --- Shell: sidebar + content --- */
.handbook-shell {
  flex: 1;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 0 1.75rem;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
  align-items: start;
}

/* --- Sidebar --- */
.handbook-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 52px);
  align-self: start;
  max-height: calc(100vh - var(--header-height) - 52px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0.5rem 1.5rem 0;
  border-right: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(20, 24, 22, 0.5), transparent 120px);
}

.handbook-sidebar-brand {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-green-light);
  padding: 0 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.handbook-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.handbook-nav-group {
  margin-bottom: 0.25rem;
}

.handbook-nav-parent-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.55rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  border-radius: var(--radius-sm);
}

.handbook-nav-parent-btn:hover {
  background: rgba(74, 124, 89, 0.12);
  color: var(--text-primary);
}

.handbook-nav-parent-btn.active,
.handbook-nav-group.is-active-group > .handbook-nav-parent-btn {
  background: rgba(74, 124, 89, 0.18);
  color: var(--accent-orange);
  box-shadow: inset 3px 0 0 var(--accent-orange);
}

.handbook-nav-group.is-active-group:not(.is-expanded) > .handbook-nav-parent-btn {
  background: rgba(232, 168, 56, 0.06);
}

.handbook-nav-icon {
  width: 1.35rem;
  text-align: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  line-height: 1;
}

.handbook-nav-label {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.handbook-nav-chevron {
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-muted);
  transition: transform var(--transition), color var(--transition);
  pointer-events: none;
}

.handbook-nav-parent-btn:hover .handbook-nav-chevron {
  color: var(--accent-orange);
}

.handbook-nav-group.is-expanded .handbook-nav-chevron {
  transform: rotate(90deg);
  color: var(--accent-green-light);
}

.handbook-nav-children {
  display: none;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.2rem 0 0.3rem 0.35rem;
  margin: 0.15rem 0 0.35rem 1.65rem;
  border-left: 2px solid rgba(74, 124, 89, 0.3);
}

.handbook-nav-group.is-expanded .handbook-nav-children {
  display: flex;
}

.handbook-nav-child {
  display: block;
  width: 100%;
  padding: 0.4rem 0.6rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.handbook-nav-child:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.handbook-nav-child.active {
  color: var(--accent-orange);
  background: rgba(232, 168, 56, 0.08);
}

.handbook-nav-group.is-hidden,
.handbook-nav-child.is-hidden {
  display: none;
}

.handbook-scroll-anchor {
  position: relative;
  height: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

/* --- Main content area --- */
.handbook-main {
  min-width: 0;
  padding: 0.75rem 0 2.5rem;
  overflow: visible;
}

.handbook-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  min-height: 1.25rem;
}

.handbook-breadcrumb a,
.handbook-breadcrumb button {
  color: var(--text-muted);
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition);
}

.handbook-breadcrumb a:hover,
.handbook-breadcrumb button:hover {
  color: var(--accent-orange);
}

.handbook-breadcrumb-sep {
  opacity: 0.5;
}

.handbook-breadcrumb-current {
  color: var(--text-secondary);
}

.handbook-content-area {
  min-height: 320px;
  padding-top: 0.35rem;
  overflow: visible;
}

/* --- Content panel --- */
.handbook-content-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), 0 0 40px rgba(74, 124, 89, 0.06);
  padding: 1.75rem 2rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  max-width: 920px;
  overflow: visible;
}

.handbook-content-panel.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Overview welcome */
.handbook-overview {
  text-align: center;
  max-width: 100%;
  margin: 0 auto;
  padding: 1.25rem 0.5rem 1rem;
}

.handbook-overview h1 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}

.handbook-overview h1 span {
  color: var(--accent-orange);
}

.handbook-overview-lead {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}

.handbook-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  text-align: left;
  margin-bottom: 1.25rem;
}

.handbook-feature-card {
  padding: 1rem 1.1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.handbook-feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.handbook-feature-card .feat-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.handbook-feature-card h3 {
  font-size: 1rem;
  color: var(--accent-green-light);
  margin-bottom: 0.35rem;
}

.handbook-feature-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.handbook-tip-banner {
  padding: 1rem 1.25rem;
  background: rgba(74, 124, 89, 0.12);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Article typography */
.handbook-article h1 {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  margin-bottom: 1.25rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.handbook-prose {
  color: var(--text-secondary);
  line-height: 1.72;
  font-size: 0.94rem;
  max-width: 72ch;
  overflow: visible;
}

.handbook-prose > *:first-child {
  margin-top: 0;
}

.handbook-prose h3 {
  color: var(--accent-green-light);
  font-size: 1.08rem;
  font-weight: 700;
  margin: 1.75rem 0 0.55rem;
  padding-top: 0.5rem;
  letter-spacing: 0.03em;
}

.handbook-prose h3:first-child {
  margin-top: 0;
  padding-top: 0;
}

.handbook-prose h4 {
  color: var(--text-primary);
  font-size: 0.98rem;
  font-weight: 600;
  margin: 1.35rem 0 0.45rem;
}

.handbook-prose p {
  margin-bottom: 0.8rem;
}

.handbook-prose ul,
.handbook-prose ol {
  margin: 0.35rem 0 1rem 0;
  padding-left: 0;
  list-style: none;
}

.handbook-prose ul > li {
  position: relative;
  padding-left: 1.15rem;
  margin: 0.4rem 0;
}

.handbook-prose ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-green);
  opacity: 0.85;
}

.handbook-prose ol {
  counter-reset: hb-ol;
  list-style: none;
}

.handbook-prose ol > li {
  position: relative;
  padding-left: 1.5rem;
  margin: 0.4rem 0;
  counter-increment: hb-ol;
}

.handbook-prose ol > li::before {
  content: counter(hb-ol) ".";
  position: absolute;
  left: 0;
  color: var(--accent-orange);
  font-weight: 600;
  font-size: 0.85em;
}

.handbook-prose ul ul,
.handbook-prose ol ul {
  margin: 0.35rem 0 0.5rem 0.5rem;
}

.handbook-prose b,
.handbook-prose strong {
  color: var(--text-primary);
}

.handbook-prose a {
  color: var(--accent-orange);
}

/* Item image tooltips from guides.json */
.handbook-prose .tooltip,
.handbook-prose .handbook-item-tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
  border-bottom: 1px dashed var(--accent-green);
  z-index: 1;
  vertical-align: baseline;
}

.handbook-prose .tooltip:hover,
.handbook-prose .handbook-item-tooltip:hover {
  z-index: 300;
}

.handbook-prose .tooltip-image,
.handbook-prose .handbook-tooltip-preview {
  visibility: hidden;
  opacity: 0;
  display: block;
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: 210px;
  min-width: 210px;
  max-width: min(210px, calc(100vw - 2rem));
  padding: 10px;
  background: rgba(8, 10, 9, 0.97);
  border: 1px solid rgba(74, 124, 89, 0.5);
  border-radius: var(--radius-md);
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.6),
    0 0 28px rgba(74, 124, 89, 0.18);
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 301;
  pointer-events: auto;
  text-align: center;
  box-sizing: border-box;
}

/* Invisible bridge — keeps :hover active when moving cursor up to the preview */
.handbook-prose .tooltip-image::before,
.handbook-prose .handbook-tooltip-preview::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 100%;
  width: 140%;
  height: 16px;
}

.handbook-prose .tooltip:hover .tooltip-image,
.handbook-prose .handbook-item-tooltip:hover .handbook-tooltip-preview,
.handbook-prose .handbook-item-tooltip:hover .tooltip-image {
  visibility: visible;
  opacity: 1;
}

/* Explicit px sizes — img excluded from global max-width:100% via .handbook-tooltip-img */
.handbook-prose .tooltip-image img,
.handbook-prose .handbook-tooltip-img {
  display: block;
  width: 180px;
  min-width: 180px;
  max-width: none;
  height: 180px;
  min-height: 180px;
  max-height: none;
  margin: 0 auto;
  object-fit: contain;
  flex: none;
  transform: none;
}

@media (max-width: 768px) {
  .handbook-prose .tooltip-image,
  .handbook-prose .handbook-tooltip-preview {
    width: 160px;
    min-width: 160px;
    max-width: min(160px, calc(100vw - 1.5rem));
    padding: 8px;
    bottom: calc(100% + 10px);
  }

  .handbook-prose .tooltip-image img,
  .handbook-prose .handbook-tooltip-img {
    width: 130px;
    min-width: 130px;
    max-width: none;
    height: 130px;
    min-height: 130px;
    max-height: none;
  }
}

/* Callout boxes — enhanced tips/notes in prose */
.handbook-prose em,
.handbook-prose i {
  color: var(--text-muted);
}

.handbook-callout {
  padding: 0.9rem 1rem 0.9rem 1.1rem;
  margin: 1.1rem 0;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  border-left-width: 4px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.handbook-callout strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.handbook-callout-tip {
  background: rgba(74, 124, 89, 0.14);
  border-color: rgba(74, 124, 89, 0.45);
  border-left-color: var(--accent-green);
  color: var(--text-secondary);
}

.handbook-callout-tip strong {
  color: var(--accent-green-light);
}

.handbook-callout-warning {
  background: rgba(232, 168, 56, 0.1);
  border-color: rgba(232, 168, 56, 0.35);
  border-left-color: var(--accent-orange);
  color: var(--text-secondary);
}

.handbook-callout-warning strong {
  color: var(--accent-orange);
}

.handbook-callout-info {
  background: rgba(100, 140, 200, 0.1);
  border-color: rgba(107, 159, 212, 0.35);
  border-left-color: #6b9fd4;
  color: var(--text-secondary);
}

.handbook-callout-info strong {
  color: #8eb8e8;
}

.handbook-empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* Mobile backdrop */
.handbook-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: rgba(0, 0, 0, 0.6);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.handbook-sidebar-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* --- Responsive --- */
@media (min-width: 1100px) {
  .handbook-shell {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 0 2rem;
    max-width: 1380px;
  }
}

@media (max-width: 900px) {
  .handbook-shell {
    grid-template-columns: 1fr;
    padding: 0 0.85rem;
    gap: 0;
  }

  .handbook-sidebar-toggle {
    display: inline-flex;
  }

  .handbook-sidebar {
    position: fixed;
    top: calc(var(--header-height) + 52px);
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    z-index: 160;
    max-height: none;
    transform: translateX(-100%);
    transition: transform var(--transition);
    background: var(--bg-secondary);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }

  .handbook-sidebar.is-open {
    transform: translateX(0);
  }

  .handbook-sidebar-backdrop {
    display: block;
  }

  .handbook-main {
    padding: 0.35rem 0 2rem;
  }

  .handbook-content-panel {
    padding: 1.15rem 1rem;
    max-width: none;
  }

  .handbook-prose {
    max-width: none;
  }

  .handbook-toolbar-title {
    display: none;
  }
}

@media (max-width: 500px) {
  .handbook-search-wrap {
    max-width: none;
    order: 3;
    flex: 1 1 100%;
  }
}

/* Scrollbar — handbook areas */
.handbook-sidebar::-webkit-scrollbar,
.handbook-search-suggest::-webkit-scrollbar {
  width: 8px;
}

.handbook-sidebar::-webkit-scrollbar-thumb,
.handbook-search-suggest::-webkit-scrollbar-thumb {
  background: var(--accent-green);
  border-radius: 4px;
}

/* ==========================================================================
   Item tooltip hard overrides — beats global img { max-width: 100% }
   Root cause: inline .tooltip + max-width:100% on img capped preview to word width
   ========================================================================== */

.handbook-page .handbook-prose .tooltip,
.handbook-page .handbook-prose .handbook-item-tooltip,
.handbook-page .handbook-prose .item-tooltip,
.handbook-page .handbook-prose .guide-tooltip {
  display: inline-block !important;
}

.handbook-page .handbook-prose .tooltip-image,
.handbook-page .handbook-prose .handbook-tooltip-preview,
.handbook-page .handbook-prose .hover-preview,
.handbook-page .handbook-prose .image-tooltip {
  display: block !important;
  width: 210px !important;
  min-width: 210px !important;
  max-width: 210px !important;
  height: 210px !important;
  min-height: 210px !important;
  max-height: 210px !important;
  padding: 10px !important;
  z-index: 9999 !important;
}

.handbook-page .handbook-prose .tooltip-image img,
.handbook-page .handbook-prose .handbook-tooltip-img,
.handbook-page .handbook-prose .item-tooltip img,
.handbook-page .handbook-prose .guide-tooltip img,
.handbook-page .handbook-prose .hover-preview img,
.handbook-page .handbook-prose .image-tooltip img,
.handbook-page .handbook-prose [data-tooltip] img,
.handbook-page .handbook-prose [data-preview] img {
  display: block !important;
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 180px !important;
  min-height: 180px !important;
  max-height: 180px !important;
  object-fit: contain !important;
  flex: none !important;
  transform: none !important;
  scale: 1 !important;
}

@media (max-width: 768px) {
  .handbook-page .handbook-prose .tooltip-image,
  .handbook-page .handbook-prose .handbook-tooltip-preview,
  .handbook-page .handbook-prose .hover-preview,
  .handbook-page .handbook-prose .image-tooltip {
    width: 160px !important;
    min-width: 160px !important;
    max-width: 160px !important;
    height: 160px !important;
    min-height: 160px !important;
    max-height: 160px !important;
  }

  .handbook-page .handbook-prose .tooltip-image img,
  .handbook-page .handbook-prose .handbook-tooltip-img,
  .handbook-page .handbook-prose .hover-preview img,
  .handbook-page .handbook-prose .image-tooltip img {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
    height: 130px !important;
    min-height: 130px !important;
    max-height: 130px !important;
  }
}

/* Final cascade — targets the REAL visible img inside any tooltip wrapper */
.handbook-page .tooltip-image,
.handbook-page .handbook-tooltip-preview {
  width: 210px !important;
  height: 210px !important;
  min-width: 210px !important;
  min-height: 210px !important;
  max-width: 210px !important;
  max-height: 210px !important;
}

.handbook-page .tooltip img,
.handbook-page .tooltip-image img,
.handbook-page .handbook-tooltip-img,
.handbook-page .handbook-tooltip-preview img,
.handbook-page [class*="tooltip"] img {
  width: 180px !important;
  height: 180px !important;
  min-width: 180px !important;
  min-height: 180px !important;
  max-width: 180px !important;
  max-height: 180px !important;

  display: block !important;
  object-fit: contain !important;

  transform: none !important;
  scale: 1 !important;

  flex: none !important;
}

@media (max-width: 768px) {
  .handbook-page .tooltip-image,
  .handbook-page .handbook-tooltip-preview {
    width: 160px !important;
    height: 160px !important;
    min-width: 160px !important;
    min-height: 160px !important;
    max-width: 160px !important;
    max-height: 160px !important;
  }

  .handbook-page .tooltip img,
  .handbook-page .tooltip-image img,
  .handbook-page .handbook-tooltip-img,
  .handbook-page .handbook-tooltip-preview img,
  .handbook-page [class*="tooltip"] img {
    width: 130px !important;
    height: 130px !important;
    min-width: 130px !important;
    min-height: 130px !important;
    max-width: 130px !important;
    max-height: 130px !important;
  }
}
