.amir-anatomy-scope {
  --ink: #2f2a27;
  --muted: #8d847c;
  --canvas: #f7f0e7;
  --paper: rgba(255, 251, 244, 0.82);
  --line: rgba(117, 91, 70, 0.18);
  --coral: #eb7c6b;
  --lavender: #8d6bcc;
  --sage: #769d74;
  --shadow: 0 18px 48px rgba(87, 62, 43, 0.06);
}

.amir-anatomy-scope * { box-sizing: border-box; }

.amir-anatomy-scope { background: #e9ddd0; }

.amir-anatomy-scope {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 48% 22%, rgba(255, 255, 255, 0.96), transparent 34%),
    linear-gradient(135deg, #f7f1e8, #fdf9f2 48%, #f2e9dd);
  color: var(--ink);
  font-family: var(--font-sans), sans-serif;
  font-size: 14px;
}

.amir-anatomy-scope button, .amir-anatomy-scope input { font: inherit; }
.amir-anatomy-scope button { color: inherit; }
.amir-anatomy-scope button:focus-visible, .amir-anatomy-scope input:focus-visible, .amir-anatomy-scope canvas:focus-visible {
  outline: 2px solid #8b6fc4;
  outline-offset: 3px;
}

.amir-anatomy-scope .app-shell {
  min-height: 100vh;
  padding: 22px 24px 24px;
  overflow: hidden;
}

.amir-anatomy-scope .topbar {
  height: 68px;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 22px;
  max-width: 1720px;
  margin: 0 auto;
}

.amir-anatomy-scope .brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: right;
  min-width: 0;
  overflow: hidden;
}

.amir-anatomy-scope .brand strong {
  font: 500 clamp(24px, 2.2vw, 42px)/1 var(--font-serif), serif;
  letter-spacing: -0.04em;
  white-space: nowrap;
  flex: none;
}

.amir-anatomy-scope .brand sup { color: var(--coral); font: 400 14px var(--font-sans), sans-serif; padding-right: 3px; }
.amir-anatomy-scope .brand em, .amir-anatomy-scope .info-panel em, .amir-anatomy-scope .learning-cards em, .amir-anatomy-scope .learning-modal > em {
  color: var(--lavender);
  font-family: "Comic Sans MS", "Bradley Hand", cursive;
  font-style: italic;
  letter-spacing: .01em;
}
/* The Persian tagline runs longer than the original English copy, so it
   needs to truncate gracefully instead of overflowing into the nav/search
   columns next to it (that overflow was the "garbled text" overlap bug). */
.amir-anatomy-scope .brand em {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 0 1 auto;
}

.amir-anatomy-scope .main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.amir-anatomy-scope .main-nav button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 12px 15px;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}
.amir-anatomy-scope .main-nav button.active { background: rgba(238, 124, 106, .075); box-shadow: inset 0 0 0 1px rgba(215, 112, 91, .12); }

.amir-anatomy-scope .search-box {
  justify-self: end;
  width: min(100%, 280px);
  height: 44px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.28);
  color: var(--muted);
}
.amir-anatomy-scope .search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.amir-anatomy-scope .search-box input::placeholder { color: #a49b93; }

.amir-anatomy-scope .profile, .amir-anatomy-scope .mobile-library-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.amir-anatomy-scope .profile span {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(82,64,50,.5);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #c46854, #efb59c);
  color: white;
  font: 600 11px var(--font-serif), serif;
  box-shadow: inset 0 0 0 3px #f7eee5;
}
.amir-anatomy-scope .mobile-library-trigger { display: none; }

.amir-anatomy-scope .workspace {
  max-width: 1720px;
  height: min(760px, calc(100vh - 128px));
  min-height: 620px;
  margin: 12px auto 0;
  display: grid;
  grid-template-columns: 285px minmax(620px, 1fr) 330px;
  gap: 18px;
}

.amir-anatomy-scope .organ-library, .amir-anatomy-scope .viewer-shell, .amir-anatomy-scope .info-panel {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.75);
}

.amir-anatomy-scope .organ-library { padding: 16px 14px 14px; display: flex; flex-direction: column; min-height: 0; }
.amir-anatomy-scope .panel-heading { height: 33px; display: flex; align-items: center; justify-content: space-between; padding: 0 5px 10px; }
.amir-anatomy-scope .panel-heading > span, .amir-anatomy-scope .info-kicker, .amir-anatomy-scope .info-panel h2 {
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: 10px;
  font-weight: 600;
}
.amir-anatomy-scope .panel-heading button { border: 1px solid var(--line); background: rgba(255,255,255,.3); width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; cursor: pointer; }
.amir-anatomy-scope .panel-heading .mobile-close { display: none; }
.amir-anatomy-scope .organ-list { display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow: auto; scrollbar-width: none; }
.amir-anatomy-scope .organ-item {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: 54px 1fr 18px;
  align-items: center;
  gap: 8px;
  text-align: right;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  cursor: pointer;
}
.amir-anatomy-scope .organ-item.active { background: rgba(253,234,226,.72); border-color: color-mix(in srgb, var(--item-accent), transparent 55%); box-shadow: 0 8px 20px rgba(195,91,70,.07); }
.amir-anatomy-scope .organ-glyph {
  width: 47px;
  height: 47px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 35% 28%, #fff, color-mix(in srgb, var(--item-accent), white 84%));
  box-shadow: inset 0 0 0 1px rgba(121,86,67,.07);
}
.amir-anatomy-scope .organ-glyph img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; transform: scale(1.14); }
.amir-anatomy-scope .organ-item b { display: block; font: 500 17px/1.1 var(--font-serif), serif; }
.amir-anatomy-scope .organ-item small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.amir-anatomy-scope .organ-item .favorite { color: #ef8d7d; }
/* `:not(.organ-card-image)` keeps the clickable artwork out of the footer
   button styling — both are direct children of the card. */
.amir-anatomy-scope .view-all, .amir-anatomy-scope .learning-cards article > button:not(.organ-card-image) {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.24);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  cursor: pointer;
  font: 500 12px var(--font-serif), serif;
}
.amir-anatomy-scope .organ-library .view-all { margin-top: 9px; }
.amir-anatomy-scope .organ-library blockquote { display: none; }

.amir-anatomy-scope .viewer-shell {
  position: relative;
  overflow: hidden;
  min-width: 0;
  background:
    radial-gradient(circle at 55% 45%, rgba(255,255,255,.92), rgba(255,250,242,.72) 45%, rgba(246,236,224,.7)),
    var(--paper);
}
.amir-anatomy-scope .viewer-shell:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 90px rgba(124,82,51,.04);
}
.amir-anatomy-scope .viewer-glow { position: absolute; width: 420px; height: 420px; right: 50%; top: 47%; transform: translate(-50%,-50%); border-radius: 50%; background: color-mix(in srgb, var(--organ-accent), transparent 94%); filter: blur(72px); opacity: .55; }
.amir-anatomy-scope .three-mount { position: absolute; inset: 0; }
.amir-anatomy-scope .three-mount canvas { width: 100%; height: 100%; display: block; touch-action: none; }

.amir-anatomy-scope .viewer-tools {
  position: absolute;
  right: 18px;
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
  width: 62px;
  padding: 8px 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(253,250,244,.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 30px rgba(75,54,40,.08);
}
.amir-anatomy-scope .tool-button { height: 60px; border: 0; border-radius: 12px; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; cursor: pointer; font: 500 9px/1 var(--font-serif), serif; }
.amir-anatomy-scope .tool-button.active { color: var(--coral); background: rgba(238,124,106,.08); }
.amir-anatomy-scope .tool-button:nth-last-child(1) { border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }

.amir-anatomy-scope .tip-note {
  position: absolute;
  left: 16px;
  top: 18px;
  z-index: 2;
  width: 155px;
  min-height: 140px;
  padding: 14px 17px;
  transform: rotate(-4deg);
  background: #fff2c9;
  box-shadow: 0 7px 13px rgba(93,69,43,.13);
  color: #534a43;
}
.amir-anatomy-scope .tip-note span { display: flex; align-items: center; gap: 4px; color: var(--lavender); font: italic 12px "Comic Sans MS", cursive; }
.amir-anatomy-scope .tip-note p { margin: 8px 0 0; font: 500 14px/1.55 var(--font-serif), serif; }

/* Anchor point only — the viewer writes the transform each frame so tracking a
   spinning model costs no React renders. The dots themselves live in the canvas. */
.amir-anatomy-scope .hotspot-callout {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 5;
  width: 0;
  height: 0;
  will-change: transform;
}
.amir-anatomy-scope .callout-body {
  position: absolute;
  top: -30px;
  width: 168px;
  padding: 10px 26px 11px 12px;
  border: 1px solid rgba(116,89,67,.14);
  border-radius: 13px;
  background: rgba(255,252,247,.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--hotspot-color), transparent 78%), 0 12px 28px rgba(83,59,42,.12);
  animation: callout-in .26s cubic-bezier(.2,.85,.3,1);
  transition: opacity .2s ease;
}
.amir-anatomy-scope .hotspot-callout[data-side="left"] .callout-body { right: 22px; }
.amir-anatomy-scope .hotspot-callout[data-side="right"] .callout-body { left: 22px; }
.amir-anatomy-scope .hotspot-callout[data-behind="true"] .callout-body { opacity: .3; }
.amir-anatomy-scope .callout-body:before {
  content: "";
  position: absolute;
  top: 32px;
  width: 18px;
  height: 1px;
  background: var(--hotspot-color);
  opacity: .55;
}
.amir-anatomy-scope .hotspot-callout[data-side="left"] .callout-body:before { left: 100%; }
.amir-anatomy-scope .hotspot-callout[data-side="right"] .callout-body:before { right: 100%; }
.amir-anatomy-scope .callout-body b { display: block; padding-right: 13px; font: 500 13px var(--font-serif), serif; }
.amir-anatomy-scope .callout-body b:before { content: ""; position: absolute; right: 12px; top: 15px; width: 7px; height: 7px; border-radius: 50%; background: var(--hotspot-color); }
.amir-anatomy-scope .callout-body small { display: block; margin-top: 3px; padding-right: 13px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.amir-anatomy-scope .callout-close { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.amir-anatomy-scope .callout-close:hover { background: rgba(116,89,67,.09); }
@keyframes callout-in { from { opacity: 0; transform: translateX(-6px) scale(.96); } }

.amir-anatomy-scope .hotspot-index { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.amir-anatomy-scope .auto-rotate {
  position: absolute;
  left: 17px;
  bottom: 16px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 8px 10px 8px 12px;
  background: rgba(255,252,247,.88);
  box-shadow: 0 5px 14px rgba(65,45,32,.08);
  cursor: pointer;
  font: 500 10px var(--font-serif), serif;
}
.amir-anatomy-scope .switch { width: 29px; height: 17px; padding: 2px; border-radius: 99px; background: #c8c2bb; }
.amir-anatomy-scope .switch i { display: block; width: 13px; height: 13px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.17); }
.amir-anatomy-scope .switch.on { background: #70a9cb; }
.amir-anatomy-scope .switch.on i { margin-right: 12px; }
.amir-anatomy-scope .view-caption { position: absolute; right: 98px; bottom: 17px; display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.amir-anatomy-scope .view-caption strong { color: var(--ink); font: 500 13px var(--font-serif), serif; text-transform: none; letter-spacing: 0; }

.amir-anatomy-scope .model-loader { position: absolute; inset: 0; z-index: 6; display: grid; place-content: center; justify-items: center; gap: 8px; background: rgba(251,246,238,.45); backdrop-filter: blur(4px); }
.amir-anatomy-scope .model-loader strong { font: 500 18px var(--font-serif), serif; }
.amir-anatomy-scope .model-loader span { color: var(--muted); font-size: 10px; }
.amir-anatomy-scope .model-error { position: absolute; inset: 0; z-index: 7; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; background: rgba(251,246,238,.92); backdrop-filter: blur(6px); }
.amir-anatomy-scope .model-error strong { font: 500 17px var(--font-serif), serif; color: var(--ink); }
.amir-anatomy-scope .model-error span { color: var(--muted); font-size: 12px; max-width: 320px; line-height: 1.9; }
.amir-anatomy-scope .model-error button { border: 1px solid var(--line); border-radius: 999px; padding: 8px 20px; background: #fff; color: var(--ink); cursor: pointer; font: inherit; font-size: 13px; }
.amir-anatomy-scope .model-error button:hover { background: var(--coral); color: #fff; border-color: var(--coral); }
.amir-anatomy-scope .loader-orbit { width: 48px; height: 48px; border: 1px dashed var(--coral); border-radius: 50%; display: grid; place-items: center; color: var(--coral); animation: orbit 2.4s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }

.amir-anatomy-scope .info-panel { padding: 21px 20px 17px; overflow: auto; scrollbar-width: none; }
.amir-anatomy-scope .info-kicker { display: flex; align-items: center; gap: 7px; color: #795c55; }
.amir-anatomy-scope .info-kicker svg { color: #ee8a7a; }
.amir-anatomy-scope .info-title-row { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 15px; }
.amir-anatomy-scope .info-title-row h1 { margin: 0; font: 500 44px/.95 var(--font-serif), serif; letter-spacing: -.02em; }
.amir-anatomy-scope .info-title-row em { display: block; margin-top: 8px; font-size: 13px; }
.amir-anatomy-scope .specimen-stamp { width: 86px; height: 86px; display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: radial-gradient(circle, #fff 25%, rgba(237,142,120,.12)); }
.amir-anatomy-scope .specimen-stamp img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; animation: card-art-in .45s cubic-bezier(.2,.8,.3,1); }
.amir-anatomy-scope .description { margin: 22px 0 16px; font: 500 15px/1.42 var(--font-serif), serif; }
.amir-anatomy-scope .rule { height: 1px; background: var(--line); }
.amir-anatomy-scope .info-panel h2 { margin: 17px 0 10px; font-style: italic; font-weight: 500; }
.amir-anatomy-scope .key-facts { margin: 0; display: flex; flex-direction: column; gap: 11px; }
.amir-anatomy-scope .key-facts > div { display: grid; grid-template-columns: 105px 1fr; gap: 8px; align-items: baseline; }
.amir-anatomy-scope .key-facts dt { display: flex; gap: 8px; font: 500 13px var(--font-serif), serif; }
.amir-anatomy-scope .key-facts dt span { color: var(--coral); width: 16px; }
.amir-anatomy-scope .key-facts dd { margin: 0; color: var(--muted); font: 500 12px/1.35 var(--font-serif), serif; }
.amir-anatomy-scope .medical-note, .amir-anatomy-scope .fun-note { margin-top: 15px; display: flex; gap: 9px; padding: 10px; border-radius: 12px; }
.amir-anatomy-scope .medical-note { background: rgba(142,109,197,.065); color: #6d568f; }
.amir-anatomy-scope .fun-note { background: rgba(198,154,94,.09); color: #86663c; }
.amir-anatomy-scope .medical-note p, .amir-anatomy-scope .fun-note p { margin: 0; font: 500 11px/1.35 var(--font-serif), serif; }
.amir-anatomy-scope .medical-note b, .amir-anatomy-scope .fun-note b { display: block; margin-bottom: 2px; color: var(--ink); }
.amir-anatomy-scope .medical-note svg, .amir-anatomy-scope .fun-note svg { flex: none; }
.amir-anatomy-scope .lesson-button { width: 100%; min-height: 42px; margin-top: 14px; padding: 0 16px; display: flex; justify-content: space-between; align-items: center; border: 0; border-radius: 10px; background: linear-gradient(110deg, #ed8a72, #e87868); color: white; cursor: pointer; box-shadow: 0 9px 20px rgba(208,90,70,.16); font-size: 11px; }
.amir-anatomy-scope .action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.amir-anatomy-scope .action-grid button { min-height: 36px; border: 1px solid #c9b3df; border-radius: 9px; background: rgba(255,255,255,.18); display: flex; gap: 8px; align-items: center; justify-content: center; color: #8062b6; cursor: pointer; font-size: 10px; }
.amir-anatomy-scope .action-grid button:nth-child(2) { border-color: #bdcfaa; color: #789067; }
.amir-anatomy-scope .action-grid button:last-child { grid-column: 1/-1; border-color: #b9c6e3; color: #6e88bd; }
.amir-anatomy-scope .action-grid button.active { background: rgba(111,137,192,.1); box-shadow: inset 0 0 0 1px #8ca2d0; }

.amir-anatomy-scope .learning-cards {
  /* Cap on the artwork box. The source illustrations are square, so this is
     both the height and the width they letterbox into — raising it fills more
     of the card but makes every card taller. */
  --art-max: 220px;
  /* One rhythm for every card: the same gap below the header and above the
     footer button, whether the body is artwork or a list. */
  --card-gap-top: 8px;
  --card-gap-bottom: 12px;
  max-width: 1720px;
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: 1.05fr repeat(5, 1fr);
  gap: 16px;
}
.amir-anatomy-scope .learning-cards article { min-height: 212px; min-width: 0; border: 1px solid var(--line); border-radius: 23px; background: rgba(255,251,244,.68); box-shadow: var(--shadow); padding: 13px 14px 12px; display: flex; flex-direction: column; overflow: hidden; }
.amir-anatomy-scope .learning-cards article > header { display: flex; align-items: flex-start; justify-content: space-between; min-height: 38px; flex: none; }
.amir-anatomy-scope .learning-cards em { display: block; text-transform: uppercase; font-size: 10px; }
.amir-anatomy-scope .learning-cards h3 { margin: 3px 0 0; font: 500 13px/1.2 var(--font-serif), serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amir-anatomy-scope .learning-cards article > button:not(.organ-card-image) { margin-top: auto; width: 100%; min-height: 30px; }
.amir-anatomy-scope .curiosity-card { justify-content: center; padding-right: 28px !important; background: linear-gradient(145deg, rgba(255,247,234,.7), rgba(247,231,210,.86)) !important; }
.amir-anatomy-scope .curiosity-card span { color: #c8a0b8; font-size: 28px; }
.amir-anatomy-scope .curiosity-card p { margin: 5px 0 10px; font: 500 16px/1.4 var(--font-serif), serif; }
.amir-anatomy-scope .curiosity-card em { text-transform: none; font-size: 13px; }
/* The artwork is square, so a square box spanning the full card width shows it
   whole and as large as the column allows — never cropped, never stretched.
   The cap keeps the cards sane when a breakpoint makes the columns very wide. */
/* Stand-in for organs that ship as a 3D model without the painted asset set. */
.amir-anatomy-scope .art-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: radial-gradient(circle at 40% 32%, #fff, color-mix(in srgb, var(--art-accent), white 84%));
  color: color-mix(in srgb, var(--art-accent), #5f4034 26%);
  font-family: var(--font-serif), serif;
  font-size: 34px;
  line-height: 1;
}
.amir-anatomy-scope .organ-card-image .art-fallback { font-size: 42px; }
.amir-anatomy-scope .organ-glyph .art-fallback { font-size: 21px; }
.amir-anatomy-scope .compare-organ > .art-fallback { position: absolute; right: 0; top: 50%; width: 38px; height: 38px; border-radius: 50%; transform: translateY(-50%); font-size: 17px; }
.amir-anatomy-scope .microscope-visual .art-fallback { font-size: 40px; }
.amir-anatomy-scope .modal-demo .art-fallback { font-size: 52px; }

/* A square box matches the square source art, so the illustration fills the
   card's full width — up to --art-max, which stops wide columns from making
   the cards enormous. `contain` means nothing is ever cut. */
.amir-anatomy-scope .organ-card-image { position: relative; overflow: hidden; isolation: isolate; flex: none; width: min(100%, var(--art-max)); max-width: 100%; aspect-ratio: 1; margin: var(--card-gap-top) auto var(--card-gap-bottom); }
.amir-anatomy-scope .organ-card-image img { width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; mix-blend-mode: multiply; animation: card-art-in .52s cubic-bezier(.2,.8,.3,1); }
@keyframes card-art-in { from { opacity: 0; transform: scale(.96) translateY(4px); } to { opacity: 1; transform: scale(1) translateY(0); } }
/* The tissue swatch is a circular crop by design, so it keeps filling its mask
   and stays square to avoid becoming an ellipse. */
.amir-anatomy-scope .microscope-visual { width: min(var(--art-max), 100%); max-height: none; border-radius: 50%; box-shadow: inset 0 0 0 5px rgba(255,255,255,.38), 0 6px 18px rgba(121,72,73,.08); }
.amir-anatomy-scope .microscope-visual img { border-radius: 50%; object-fit: cover; }
.amir-anatomy-scope .comparison-visual { border-radius: 12px; }
/* No footer button on this card, so the artwork centres in the leftover space. */
/* Reset for the two artwork boxes that are themselves buttons. */
.amir-anatomy-scope button.organ-card-image { border: 0; padding: 0; background: transparent; cursor: pointer; font: inherit; }
.amir-anatomy-scope button.organ-card-image:focus-visible { outline: 2px solid #8b6fc4; outline-offset: 2px; }
.amir-anatomy-scope .function-visual { position: relative; display: grid; place-items: center; cursor: pointer; }
/* Centred grid items are not stretched, so `height: 100%` would resolve against
   an indefinite row and overflow the card. Pin the artwork to the box instead. */
.amir-anatomy-scope .function-visual > img, .amir-anatomy-scope .function-visual > .art-fallback { position: absolute; inset: 0; }
.amir-anatomy-scope .function-pulse { position: absolute; width: 84px; height: 84px; border: 1px solid rgba(235,124,107,.32); border-radius: 50%; animation: organ-pulse 2.2s ease-out infinite; pointer-events: none; }
@keyframes organ-pulse { 0% { opacity: .7; transform: scale(.62); } 80%,100% { opacity: 0; transform: scale(1.35); } }
.amir-anatomy-scope .play-badge { position: absolute; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; background: rgba(255,255,255,.7); color: #b4a99f; display: grid; place-items: center; box-shadow: 0 3px 12px rgba(0,0,0,.1); pointer-events: none; }
/* Same top and bottom gap as an artwork card, so the footer buttons line up. */
.amir-anatomy-scope .learning-cards ul { list-style: none; padding: 0; margin: var(--card-gap-top) 0 var(--card-gap-bottom); flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 9px; font: 500 11px var(--font-serif), serif; }
.amir-anatomy-scope .learning-cards li:before { content: "♥"; color: #e9968b; margin-left: 7px; }
/* Sits directly under the header like every other card, rather than being
   pushed down by an auto top margin. */
.amir-anatomy-scope .system-visual { overflow: hidden; border-radius: 12px; }

.amir-anatomy-scope .compare-strip { position: fixed; z-index: 20; right: 50%; bottom: 22px; transform: translateX(-50%); width: min(760px, calc(100% - 28px)); padding: 13px 16px; display: grid; grid-template-columns: 1fr auto 1fr 1.5fr auto; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,251,245,.94); backdrop-filter: blur(18px); box-shadow: 0 22px 60px rgba(64,43,29,.2); }
.amir-anatomy-scope .compare-strip > div { display: flex; flex-direction: column; }
.amir-anatomy-scope .compare-strip .compare-organ { position: relative; padding-right: 45px; min-height: 38px; justify-content: center; }
.amir-anatomy-scope .compare-organ > img { position: absolute; right: 0; top: 50%; width: 38px; height: 38px; border-radius: 50%; object-fit: cover; transform: translateY(-50%); mix-blend-mode: multiply; }
.amir-anatomy-scope .compare-strip span { color: var(--lavender); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.amir-anatomy-scope .compare-strip strong { font: 500 20px var(--font-serif), serif; }
.amir-anatomy-scope .compare-strip small { color: var(--muted); font-size: 9px; }
.amir-anatomy-scope .compare-strip dl { margin: 0; display: flex; gap: 16px; }
.amir-anatomy-scope .compare-strip dl div { max-width: 130px; }
.amir-anatomy-scope .compare-strip dt { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.amir-anatomy-scope .compare-strip dd { margin: 3px 0 0; font: 500 10px/1.2 var(--font-serif), serif; }
.amir-anatomy-scope .compare-strip > button { border: 0; background: transparent; cursor: pointer; }

.amir-anatomy-scope .modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(52,39,30,.24); backdrop-filter: blur(8px); }
.amir-anatomy-scope .learning-modal { width: min(460px, 100%); max-height: min(92vh, 900px); overflow: auto; scrollbar-width: none; position: relative; padding: 32px; border: 1px solid var(--line); border-radius: 26px; background: #fffaf2; box-shadow: 0 30px 90px rgba(63,42,28,.24); text-align: center; animation: modal-in .35s cubic-bezier(.2,.85,.3,1); }
.amir-anatomy-scope .learning-modal.wide { width: min(540px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.amir-anatomy-scope .modal-close { position: absolute; top: 13px; left: 13px; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.amir-anatomy-scope .modal-icon { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; background: rgba(237,126,105,.1); color: var(--coral); font: 500 26px var(--font-serif), serif; }
.amir-anatomy-scope .learning-modal h2 { margin: 6px 0 12px; font: 500 34px var(--font-serif), serif; }
.amir-anatomy-scope .learning-modal > p, .amir-anatomy-scope .quiz-options p { color: #6e655f; font: 500 15px/1.5 var(--font-serif), serif; }
.amir-anatomy-scope .modal-demo { width: 135px; height: 135px; margin: 18px auto 8px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle, #fff, #f5ded6); }
.amir-anatomy-scope .modal-demo img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.amir-anatomy-scope .modal-demo.moving img { animation: heartbeat 1.1s ease-in-out infinite; }
@keyframes heartbeat { 0%,100%{transform:scale(1)} 15%{transform:scale(1.13)} 28%{transform:scale(1)} 40%{transform:scale(1.08)} }
/* The full-figure view: square like the source art, contained so the body
   diagram is never cropped. */
.amir-anatomy-scope .modal-figure { margin: 18px 0 4px; aspect-ratio: 1; max-height: 46vh; display: grid; place-items: center; overflow: hidden; border-radius: 20px; background: radial-gradient(circle at 50% 42%, #fff, #f8ecdf); }
.amir-anatomy-scope .modal-figure img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.amir-anatomy-scope .modal-figure .art-fallback { font-size: 64px; }
.amir-anatomy-scope .modal-facts { margin: 14px 0 4px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: right; }
.amir-anatomy-scope .modal-facts dt { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.amir-anatomy-scope .modal-facts dd { margin: 4px 0 0; font: 500 12px/1.3 var(--font-serif), serif; }
.amir-anatomy-scope .learning-modal.wide .lesson-button { margin-top: 16px; }

.amir-anatomy-scope .quiz-options { display: flex; flex-direction: column; gap: 8px; text-align: right; }
.amir-anatomy-scope .quiz-options button { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.5); cursor: pointer; }
.amir-anatomy-scope .drawer-backdrop { display: none; }

@media (max-width: 1350px) {
  .amir-anatomy-scope .app-shell { padding: 16px; }
  .amir-anatomy-scope .topbar { grid-template-columns: 1fr auto auto; gap: 12px; }
  .amir-anatomy-scope .brand em { display: none; }
  .amir-anatomy-scope .search-box { display: none; }
  .amir-anatomy-scope .workspace { grid-template-columns: 250px minmax(500px,1fr) 300px; height: min(700px, calc(100vh - 105px)); }
  .amir-anatomy-scope .learning-cards { grid-template-columns: repeat(3, 1fr); --art-max: 300px; }
}

@media (max-width: 1040px) {
  .amir-anatomy-scope .topbar { grid-template-columns: 1fr auto auto; }
  .amir-anatomy-scope .main-nav button span { display: none; }
  .amir-anatomy-scope .main-nav button { padding: 10px; }
  .amir-anatomy-scope .workspace { grid-template-columns: 210px minmax(450px,1fr); height: 690px; }
  .amir-anatomy-scope .info-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px 22px; max-height: none; }
  .amir-anatomy-scope .info-panel .description, .amir-anatomy-scope .info-panel .rule, .amir-anatomy-scope .info-panel h2, .amir-anatomy-scope .key-facts, .amir-anatomy-scope .medical-note { grid-column: 2; }
  .amir-anatomy-scope .info-kicker, .amir-anatomy-scope .info-title-row { grid-column: 1; }
  .amir-anatomy-scope .info-panel { height: 330px; }
  .amir-anatomy-scope .workspace { height: auto; }
  .amir-anatomy-scope .organ-library, .amir-anatomy-scope .viewer-shell { height: 650px; }
}

@media (max-width: 760px) {
  .amir-anatomy-scope .app-shell { padding: 10px; overflow: hidden; }
  .amir-anatomy-scope .topbar { height: 58px; grid-template-columns: 1fr auto auto; }
  .amir-anatomy-scope .brand strong { font-size: 29px; }
  .amir-anatomy-scope .main-nav { display: none; }
  .amir-anatomy-scope .profile span { width: 34px; height: 34px; }
  .amir-anatomy-scope .mobile-library-trigger { display: flex; }
  .amir-anatomy-scope .workspace { display: block; margin-top: 8px; }
  .amir-anatomy-scope .viewer-shell { height: 68vh; min-height: 520px; border-radius: 22px; }
  .amir-anatomy-scope .organ-library {
    position: fixed;
    z-index: 42;
    right: 8px;
    left: 8px;
    bottom: 8px;
    height: min(76vh, 650px);
    transform: translateY(110%);
    border-radius: 26px;
    background: #fffaf3;
  }
  .amir-anatomy-scope .organ-library.open { transform: translateY(0); }
  .amir-anatomy-scope .panel-heading .mobile-close { display: grid; margin-right: auto; margin-left: 7px; }
  .amir-anatomy-scope .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 40; border: 0; background: rgba(52,39,30,.24); backdrop-filter: blur(5px); }
  .amir-anatomy-scope .organ-list { display: grid; grid-template-columns: 1fr 1fr; }
  .amir-anatomy-scope .organ-item { min-height: 76px; }
  .amir-anatomy-scope .info-panel { height: auto; margin-top: 10px; display: block; border-radius: 22px; }
  .amir-anatomy-scope .learning-cards { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; --art-max: 320px; }
  .amir-anatomy-scope .learning-cards article { border-radius: 20px; }
  .amir-anatomy-scope .curiosity-card { display: none !important; }
  .amir-anatomy-scope .viewer-tools { top: auto; bottom: 12px; right: 10px; left: 10px; transform: none; width: auto; height: 61px; flex-direction: row; justify-content: space-around; padding: 4px; border-radius: 15px; }
  .amir-anatomy-scope .tool-button { width: 51px; height: 51px; }
  .amir-anatomy-scope .tool-button:nth-last-child(1) { border: 0; border-radius: 12px; }
  .amir-anatomy-scope .tool-button span { display: none; }
  .amir-anatomy-scope .auto-rotate { bottom: 82px; left: 10px; }
  .amir-anatomy-scope .view-caption { right: 12px; bottom: 84px; }
  .amir-anatomy-scope .tip-note { width: 130px; min-height: 113px; padding: 11px; }
  .amir-anatomy-scope .tip-note p { font-size: 12px; }
  .amir-anatomy-scope .callout-body { width: 148px; top: -26px; }
  .amir-anatomy-scope .compare-strip { grid-template-columns: 1fr auto 1fr auto; }
  .amir-anatomy-scope .compare-strip dl { display: none; }
}

@media (max-width: 470px) {
  .amir-anatomy-scope .brand strong { font-size: 25px; }
  .amir-anatomy-scope .viewer-shell { min-height: 485px; height: 66vh; }
  .amir-anatomy-scope .organ-list { grid-template-columns: 1fr; }
  .amir-anatomy-scope .learning-cards { grid-template-columns: 1fr; --art-max: 360px; }
  .amir-anatomy-scope .organ-library .view-all { margin-bottom: 8px; }
  .amir-anatomy-scope .tip-note { display: none; }
  .amir-anatomy-scope .specimen-stamp { width: 68px; height: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  .amir-anatomy-scope *, .amir-anatomy-scope *:before, .amir-anatomy-scope *:after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* ===================== فارسی‌سازی و فونت یکان ===================== */
@font-face {
  font-family: "Yekan";
  src: url("../fonts/Yekan.woff2") format("woff2"),
       url("../fonts/Yekan.woff") format("woff");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

.amir-anatomy-scope {
  --font-sans: "Yekan", Tahoma, sans-serif;
  --font-serif: "Yekan", Tahoma, sans-serif;
  font-family: "Yekan", Tahoma, sans-serif;
  direction: rtl;
  unicode-bidi: isolate;
}

.amir-anatomy-scope,
.amir-anatomy-scope * {
  font-family: "Yekan", Tahoma, sans-serif !important;
}

/* Yekan has no distinct weights/italics to speak of — trade the Latin
   display face's tight negative tracking and cursive accents for settings
   that actually read well in Persian. */
.amir-anatomy-scope .brand strong,
.amir-anatomy-scope .info-title-row h1 {
  letter-spacing: 0;
}
.amir-anatomy-scope .brand em,
.amir-anatomy-scope .info-panel em,
.amir-anatomy-scope .learning-cards em,
.amir-anatomy-scope .learning-modal > em,
.amir-anatomy-scope .tip-note span {
  font-family: "Yekan", Tahoma, sans-serif !important;
  font-style: normal;
}
.amir-anatomy-scope .panel-heading > span,
.amir-anatomy-scope .info-kicker,
.amir-anatomy-scope .info-panel h2,
.amir-anatomy-scope .compare-strip span,
.amir-anatomy-scope .modal-facts dt,
.amir-anatomy-scope .key-facts dt,
.amir-anatomy-scope .view-caption,
.amir-anatomy-scope .learning-cards em {
  letter-spacing: 0.02em;
}

/* Inline icon wrapper used by the plugin's own SVG set. */
.amir-anatomy-scope .ai { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.amir-anatomy-scope .ai svg { width: 100%; height: 100%; display: block; }
.amir-anatomy-scope button .ai { pointer-events: none; }

/* Numerals read better as Persian glyphs at this weight; keep them crisp. */
.amir-anatomy-scope { font-variant-numeric: normal; }

/* The reference app renders on a full page; inside a WordPress post/page the
   widget needs to be a bounded, well-behaved block instead of 100vh. */
.amir-anatomy-scope { display: block; }
.amir-anatomy-scope .app-shell {
  min-height: var(--amir-anatomy-height, 760px);
  border-radius: 28px;
}
.amir-anatomy-scope .workspace {
  height: var(--amir-anatomy-height, min(760px, 82vh));
}
@media (max-width: 1040px) {
  .amir-anatomy-scope .workspace { height: auto; }
}

.amir-anatomy-boot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 420px;
  border-radius: 28px;
  background: linear-gradient(135deg, #f7f1e8, #fdf9f2 48%, #f2e9dd);
  color: #8d847c;
  font-family: "Yekan", Tahoma, sans-serif;
  direction: rtl;
}
.amir-anatomy-boot-mark { color: #eb7c6b; font-size: 20px; }

/* Several elements above set their own `display` (grid/flex/block) so they
   can be shown via JS toggling the native `hidden` attribute. But a class
   selector like `.model-error { display: grid }` has equal-or-higher
   specificity than the browser's built-in `[hidden] { display: none }` rule
   and loads after it, so it silently won — those elements were showing
   unconditionally regardless of the hidden attribute. This single rule
   guarantees `hidden` always wins, for these and any future cases. */
.amir-anatomy-scope [hidden] { display: none !important; }
