/* ==========================================================================
   EQUUS A–Z — Award-Winning Editorial Design & Physics Motion System
   ========================================================================== */

:root {
  /* Warm Alabaster Editorial Palette (Light Mode Default for Readability) */
  --bg-primary: #FAF7F2;
  --bg-secondary: #F2ECE1;
  --bg-card: #FFFFFF;
  --bg-glass: rgba(250, 247, 242, 0.84);
  --bg-elevated: #EBE3D5;
  
  --text-primary: #161412;
  --text-secondary: #4A443E;
  --text-muted: #7C7369;
  
  --accent-primary: #9E472A;      /* Saddle Terracotta */
  --accent-secondary: #C59B27;    /* Champagne Gold */
  --accent-soft: rgba(158, 71, 42, 0.10);
  
  --border-subtle: rgba(22, 20, 18, 0.09);
  --border-strong: rgba(22, 20, 18, 0.18);
  
  --shadow-card: 0 12px 34px -8px rgba(22, 20, 18, 0.07), 0 2px 6px rgba(22, 20, 18, 0.03);
  --shadow-hover: 0 28px 60px -12px rgba(22, 20, 18, 0.16), 0 6px 18px rgba(158, 71, 42, 0.08);
  --shadow-modal: 0 40px 90px -15px rgba(12, 10, 8, 0.45);
  
  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Motion Easings */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;
}

[data-theme="dark"] {
  --bg-primary: #0E0D0C;
  --bg-secondary: #161412;
  --bg-card: #1C1917;
  --bg-glass: rgba(14, 13, 12, 0.85);
  --bg-elevated: #26221E;
  
  --text-primary: #F6F2EB;
  --text-secondary: #C4BCB3;
  --text-muted: #8A8177;
  
  --accent-primary: #E07A5F;
  --accent-secondary: #E2B857;
  --accent-soft: rgba(224, 122, 95, 0.14);
  
  --border-subtle: rgba(246, 242, 235, 0.09);
  --border-strong: rgba(246, 242, 235, 0.20);
  
  --shadow-card: 0 14px 36px -8px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 30px 64px -10px rgba(0, 0, 0, 0.72), 0 0 28px rgba(224, 122, 95, 0.12);
}

/* Reset & Base Readability */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background-color 0.5s var(--ease-out-expo), color 0.5s var(--ease-out-expo);
}

/* Subtle Film Grain Overlay */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Top Scroll Progress Indicator */
.scroll-progress-track {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 10000;
  background: transparent;
}

.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 0.08s linear;
}

/* Custom Interactive Horseshoe Cursor Follower (Desktop) */
.cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  width: 62px;
  height: 66px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%) scale(0) rotate(-14deg);
  transition: transform 0.36s var(--ease-spring), opacity 0.25s ease;
  opacity: 0;
  filter: drop-shadow(0 8px 18px rgba(158, 71, 42, 0.45));
}

.cursor-follower .horseshoe-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cursor-follower.active {
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
  opacity: 1;
}

@media (hover: none), (max-width: 900px) {
  .cursor-follower {
    display: none !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   Unified Top Header: Attached Logo · Search Dock · Hexagon A–Z Carousel
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.4s var(--ease-out-expo);
}

.nav-inner {
  max-width: 1540px;
  margin: 0 auto;
  padding: 0.65rem 1.6rem 0.6rem;
  display: grid;
  grid-template-columns: auto minmax(220px, 320px) 1fr auto;
  align-items: center;
  gap: 1.25rem;
}

.header-lang-dock {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 0.2rem;
}

.header-lang-dock .lang-selector-group {
  box-shadow: 0 4px 14px -3px rgba(42, 32, 22, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 68px;
  width: auto;
  max-width: 310px;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
  transition: transform 0.3s var(--ease-out-expo);
}

[data-theme="dark"] .brand-logo-img {
  mix-blend-mode: normal;
  filter: invert(1) hue-rotate(180deg) brightness(1.08);
}

.brand-logo:hover .brand-logo-img {
  transform: scale(1.02);
}

/* Center Neumorphic Search Pill + Connected Sub-Dock */
.search-dock-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.search-pill-shell {
  width: 100%;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1.5px solid rgba(180, 166, 148, 0.36);
  border-radius: 999px;
  padding: 0.28rem 0.32rem 0.28rem 1.15rem;
  box-shadow:
    0 8px 22px -6px rgba(42, 32, 22, 0.09),
    inset 0 1px 2px rgba(255, 255, 255, 0.8);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-pill-shell:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 10px 26px -6px rgba(176, 62, 32, 0.18);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-submit-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #BA4626, #983318);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(158, 71, 42, 0.34);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.search-submit-btn svg {
  width: 17px;
  height: 17px;
}

.search-submit-btn:hover {
  transform: scale(1.06);
  filter: brightness(1.08);
}

.search-sub-dock {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-secondary);
  border: 1px solid rgba(180, 166, 148, 0.35);
  border-top: none;
  padding: 0.2rem 0.55rem 0.24rem;
  border-radius: 0 0 16px 16px;
  margin-top: -1px;
  box-shadow: 0 6px 14px -4px rgba(42, 32, 22, 0.08);
}

.sub-dock-btn {
  width: 32px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sub-dock-btn:hover {
  color: var(--accent-primary);
}

.sub-dock-btn.active {
  background: var(--bg-card);
  color: var(--accent-primary);
  border-color: rgba(158, 71, 42, 0.28);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Right Hexagon + Swipeable A–Z Carousel */
.alphabet-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.alphabet-carousel-shell {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.carousel-nav-btn {
  width: 30px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--accent-primary);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.carousel-nav-btn:hover {
  background: var(--accent-soft);
  transform: scale(1.1);
}

/* Active Hexagon Letter Indicator */
.active-hex-wrapper {
  position: relative;
  width: 78px;
  height: 82px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #BA4626, #983318);
  clip-path: polygon(50% 0%, 96% 24%, 96% 76%, 50% 100%, 4% 76%, 4% 24%);
  padding: 2.5px;
  box-shadow: 0 10px 24px rgba(158, 71, 42, 0.24);
  z-index: 2;
}

.active-hex-inner {
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  clip-path: polygon(50% 0%, 96% 24%, 96% 76%, 50% 100%, 4% 76%, 4% 24%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
}

.hex-letter {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 0.92;
  color: var(--text-primary);
}

.hex-count {
  font-family: var(--font-sans);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 0.18rem;
}

/* Swipeable Segmented A-Z Track */
.alphabet-track {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid rgba(180, 166, 148, 0.38);
  border-radius: 16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 0.22rem 0.3rem;
  cursor: grab;
  user-select: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.alphabet-track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
}

.alphabet-track::-webkit-scrollbar {
  display: none;
}

.alpha-btn {
  scroll-snap-align: center;
  min-width: 44px;
  height: 46px;
  padding: 0.25rem 0.4rem;
  border: none;
  border-right: 1px solid rgba(180, 166, 148, 0.28);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.06rem;
  flex-shrink: 0;
  border-radius: 10px;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.alpha-btn:last-child {
  border-right: none;
}

.alpha-letter {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1;
}

.alpha-count {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1;
}

.alpha-btn:hover {
  background: rgba(158, 71, 42, 0.1);
  color: var(--accent-primary);
}

.alpha-btn.active {
  background: var(--accent-primary);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(158, 71, 42, 0.28);
}

.alpha-btn.active .alpha-count {
  color: rgba(255, 255, 255, 0.9);
}

.alpha-btn.dimmed {
  opacity: 0.28;
  pointer-events: none;
}

/* ==========================================================================
   Two-Column Inspired Hero Section (Left Triptych Card + Right 4-Layer Anatomy Card)
   ========================================================================== */
.hero {
  position: relative;
  max-width: 1460px;
  margin: 0 auto;
  padding: 1.35rem 1.8rem 1.15rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

/* Left Card: Organic 3-Horse Triptych Showcase */
.hero-discover-card {
  position: relative;
  background: linear-gradient(160deg, #FBF8F3 0%, #F2ECE1 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 26px;
  padding: 1.5rem 1.8rem 1.65rem;
  box-shadow:
    0 18px 42px -12px rgba(56, 42, 28, 0.11),
    0 2px 8px rgba(56, 42, 28, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  min-height: 445px;
}

[data-theme="dark"] .hero-discover-card {
  background: linear-gradient(160deg, #1E1B18 0%, #151311 100%);
  border-color: var(--border-subtle);
}

.orbital-decor {
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  border: 1.5px solid rgba(197, 155, 39, 0.16);
  pointer-events: none;
  transform: rotate(-18deg) scaleX(1.25);
}

.discover-top-pill {
  position: relative;
  z-index: 3;
  background: var(--bg-card);
  border: 1px solid rgba(180, 166, 148, 0.35);
  padding: 0.42rem 1.25rem;
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  box-shadow: 0 6px 16px rgba(42, 32, 22, 0.06);
}

.discover-top-pill strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* 3-Horse Organic Triptych Collage */
.triptych-stage {
  position: relative;
  width: 100%;
  max-width: 540px;
  height: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem 0;
  z-index: 2;
}

.triptych-circle {
  position: absolute;
  width: 195px;
  height: 195px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 30px rgba(32, 22, 12, 0.16);
  cursor: pointer;
  transition: transform 0.45s var(--ease-out-expo), box-shadow 0.35s ease;
  z-index: 1;
}

.triptych-circle.left {
  left: 4%;
  transform: translateY(4px);
}

.triptych-circle.right {
  right: 4%;
  transform: translateY(4px);
}

.triptych-circle:hover {
  transform: translateY(-4px) scale(1.04);
  z-index: 4;
}

.triptych-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Center Organic Amoeba / Pebble Frame with Terracotta Double Border */
.triptych-organic-center {
  position: relative;
  width: 262px;
  height: 238px;
  z-index: 3;
  cursor: pointer;
  border-radius: 43% 57% 47% 53% / 54% 43% 57% 46%;
  padding: 5px;
  background: linear-gradient(135deg, #B84323 0%, #8E2E14 100%);
  box-shadow:
    0 20px 44px rgba(142, 46, 20, 0.28),
    0 0 0 6px rgba(184, 67, 35, 0.12);
  transition: transform 0.5s var(--ease-out-expo), border-radius 0.6s ease;
}

.triptych-organic-center:hover {
  transform: scale(1.035);
  border-radius: 48% 52% 52% 48% / 48% 52% 48% 52%;
}

.organic-center-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% center;
  border-radius: inherit;
  border: 3px solid #FFF9F2;
  display: block;
}

/* Bottom Terracotta CTA Pill Button */
.discover-atlas-btn {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 440px;
  padding: 0.92rem 1.5rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #B64526 0%, #9A3418 100%);
  color: #FFFFFF;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow:
    0 14px 28px -6px rgba(154, 52, 24, 0.42),
    inset 0 1px 1px rgba(255, 255, 255, 0.28);
  transition: transform 0.28s var(--ease-out-expo), filter 0.25s ease, box-shadow 0.28s ease;
}

.discover-atlas-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 18px 34px -6px rgba(154, 52, 24, 0.52);
}

.compass-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.92;
}

.discover-btn-text {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.discover-arrow {
  font-size: 1.25rem;
  line-height: 1;
}

/* ==========================================================================
   Right Card: Light-Studio 4-Layer Single-Horse Anatomy Inspector
   ========================================================================== */
.hero-anatomy-card {
  background: linear-gradient(160deg, #FBF8F3 0%, #F2ECE1 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 26px;
  padding: 0.85rem;
  box-shadow:
    0 18px 42px -12px rgba(56, 42, 28, 0.11),
    0 2px 8px rgba(56, 42, 28, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

[data-theme="dark"] .hero-anatomy-card {
  background: linear-gradient(160deg, #1E1B18 0%, #151311 100%);
  border-color: var(--border-subtle);
}

.anatomy-stage {
  --beam-x: 43%;
  --beam-y: 26%;
  --beam-size: 240px;
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 575px;
  height: clamp(575px, 72vh, 710px);
  max-height: 720px;
  border-radius: 22px;
  overflow: hidden;
  background: #F6F2EA;
  border: 1px solid rgba(180, 166, 148, 0.35);
  cursor: crosshair;
  user-select: none;
  touch-action: pan-y;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.75rem 1.5rem;
}

/* Subtle Medical Square Grid Overlay */
.medical-grid-bg {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image:
    linear-gradient(rgba(140, 120, 95, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 120, 95, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* Left Vertical Tool Rail */
.anatomy-left-rail {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 14;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rail-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(180, 166, 148, 0.42);
  background: rgba(255, 252, 247, 0.94);
  color: #3D2B22;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(42, 32, 22, 0.07);
  transition: all 0.2s ease;
}

.rail-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateX(2px);
}

.rail-btn.active {
  border: 2px solid var(--accent-primary);
  background: #FFFDF9;
  color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(176, 62, 32, 0.2);
}

/* Aspect-Locked 16:9 Horse Viewport (Ensures 100% Pin Registration & Keeps Horse Clear of the Loupe) */
.horse-stage-viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  height: 98%;
  max-width: calc(100% - 310px);
  flex-shrink: 0;
  z-index: 4;
  overflow: hidden;
  border-radius: 16px;
  user-select: none;
  touch-action: pan-y;
}

.horse-stage-viewport.is-zoomed {
  cursor: grab;
  touch-action: none;
}

.horse-stage-viewport.is-panning {
  cursor: grabbing !important;
}

/* Scalable and Pannable Horse Canvas Container */
.horse-zoom-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  transition: transform 0.24s cubic-bezier(0.2, 0, 0, 1);
  will-change: transform;
}

.horse-zoom-canvas.is-dragging {
  transition: none !important;
}

/* Minimalist Floating Zoom Pill on Horse Canvas */
.horse-zoom-pill {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 252, 247, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(180, 166, 148, 0.45);
  border-radius: 999px;
  padding: 0.25rem 0.5rem 0.25rem 0.6rem;
  box-shadow: 0 4px 14px rgba(42, 32, 22, 0.1);
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.horse-zoom-pill:hover {
  background: #FFFDF9;
  border-color: var(--accent-primary);
  box-shadow: 0 6px 18px rgba(42, 32, 22, 0.14);
}

.zoom-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: #2E221B;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 999px;
  transition: color 0.15s ease;
}

.zoom-pill-btn:hover {
  color: var(--accent-primary);
}

.zoom-pill-btn svg {
  color: var(--accent-primary);
}

.zoom-pill-step {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(180, 166, 148, 0.4);
  background: #FFFFFF;
  color: #2E221B;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: all 0.15s ease;
}

.zoom-pill-step:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: #FAF7F2;
}

.zoom-pill-pct {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-primary);
  padding: 0 0.2rem;
  min-width: 38px;
  text-align: center;
}

.zoom-pill-reset {
  display: inline-flex;
  align-items: center;
  background: rgba(180, 166, 148, 0.18);
  border: none;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #4A3A30;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zoom-pill-reset:hover {
  background: var(--accent-primary);
  color: #FFFFFF;
}

[data-theme="dark"] .horse-zoom-pill {
  background: rgba(26, 22, 19, 0.92);
  border-color: rgba(180, 166, 148, 0.25);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .zoom-pill-btn {
  color: #EDE5DA;
}

[data-theme="dark"] .zoom-pill-step {
  background: #25201B;
  border-color: rgba(180, 166, 148, 0.25);
  color: #EDE5DA;
}

[data-theme="dark"] .zoom-pill-reset {
  background: rgba(255, 255, 255, 0.1);
  color: #EDE5DA;
}

/* Registered Horse Photo Layers */
.anatomy-canvas {
  position: absolute;
  inset: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.horse-photo-layer {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  pointer-events: none;
  user-select: none;
}

.base-ghost-overlay {
  position: absolute;
  inset: 0;
  padding: 0;
  opacity: 0.34;
}

/* Layer 2: Flashlight X-Ray / Magnifier Beam */
.anatomy-lit {
  z-index: 3;
  -webkit-mask-image: radial-gradient(
    circle var(--beam-size) at var(--beam-x) var(--beam-y),
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.96) 68%,
    rgba(0, 0, 0, 0) 100%
  );
  mask-image: radial-gradient(
    circle var(--beam-size) at var(--beam-x) var(--beam-y),
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.96) 68%,
    rgba(0, 0, 0, 0) 100%
  );
}

.anatomy-stage.full-light .anatomy-lit {
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

/* Layer 3: Numbered Pins on the Horse (1–12) */
.anatomy-hotspots {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.body-node {
  position: absolute;
  transform: translate(-50%, -50%) scale(calc(1 / var(--stage-zoom, 1)));
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid rgba(160, 142, 120, 0.65);
  background: rgba(252, 249, 242, 0.96);
  color: #2B241E;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 10px rgba(32, 24, 16, 0.2);
  transition: transform 0.25s var(--ease-spring), background-color 0.2s ease, box-shadow 0.2s ease;
}

.body-node::before {
  content: "";
  position: absolute;
  top: -7px;
  bottom: -7px;
  left: -7px;
  right: -7px;
  border-radius: 50%;
}

.body-node:hover,
.body-node.active {
  background: linear-gradient(145deg, #FFD24C, #F2A318);
  border-color: #FFF4CE;
  color: #1E160C;
  transform: translate(-50%, -50%) scale(calc(1.22 / var(--stage-zoom, 1)));
  box-shadow:
    0 0 0 6px rgba(242, 163, 24, 0.3),
    0 6px 16px rgba(32, 24, 16, 0.28);
  z-index: 8;
}

/* Flashlight Optical Ring */
.flashlight-ring {
  position: absolute;
  top: var(--beam-y);
  left: var(--beam-x);
  width: calc(var(--beam-size) * 1.9);
  height: calc(var(--beam-size) * 1.9);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(184, 67, 35, 0.42);
  box-shadow: 0 0 35px rgba(242, 163, 24, 0.18);
  pointer-events: none;
  z-index: 5;
  transition: width 0.2s ease, height 0.2s ease, opacity 0.25s ease;
}

.anatomy-stage.full-light .flashlight-ring {
  opacity: 0;
}

/* Dynamic SVG Leader Line connecting Active Pin -> Circular Loupe */
.loupe-leader-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  overflow: visible;
}

.loupe-leader-svg line {
  stroke: #C85A28;
  stroke-width: 2;
  stroke-dasharray: 5 4;
  opacity: 0.78;
  transition: all 0.28s var(--ease-out-expo);
}

.loupe-leader-svg circle {
  fill: #F2A318;
  stroke: #FFFDF9;
  stroke-width: 2;
  transition: all 0.28s var(--ease-out-expo);
}

/* ==========================================================================
   Interactive Circular Magnifying Glass (Lupa) + Short Callout Pill
   Positioned in the Open Studio Margin so it NEVER Covers the Horse!
   ========================================================================== */
.anatomy-loupe-inspector {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 288px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  pointer-events: none;
  transition: top 0.32s var(--ease-out-expo), transform 0.32s var(--ease-out-expo);
}

.loupe-glass-assembly {
  position: relative;
  width: 194px;
  height: 194px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Circular Optical Magnifying Glass Lens */
.popover-zoom-box.loupe-circle-lens {
  position: relative;
  width: 184px;
  height: 184px;
  border-radius: 50%;
  border: 6px solid #C85A28;
  outline: 3px solid rgba(255, 248, 231, 0.92);
  background-color: #F6F2EA;
  background-image: url("horse-light-exterior.jpg");
  background-repeat: no-repeat;
  background-size: 420%;
  background-position: 43% 25%;
  overflow: hidden;
  box-shadow:
    0 20px 42px -8px rgba(42, 28, 16, 0.32),
    inset 0 0 22px rgba(32, 20, 12, 0.22),
    inset 0 2px 5px rgba(255, 255, 255, 0.75);
  transition: background-position 0.35s var(--ease-out-expo), background-image 0.25s ease;
  z-index: 2;
}

/* Subtle Optical Glass Reflection inside the Circular Loupe */
.loupe-glass-shine {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(255, 255, 255, 0.08) 32%,
    transparent 52%
  );
  pointer-events: none;
}

/* Optical Target Reticle at Center of Magnifying Glass */
.loupe-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px dashed rgba(242, 163, 24, 0.85);
  box-shadow: 0 0 0 2px rgba(30, 22, 12, 0.15);
  pointer-events: none;
}

.loupe-reticle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #F2A318;
}

/* Classic Angled Magnifying Glass Handle */
.loupe-handle {
  position: absolute;
  bottom: -14px;
  right: 6px;
  width: 18px;
  height: 58px;
  border-radius: 10px;
  background: linear-gradient(90deg, #5A2816 0%, #9E472A 48%, #3B180C 100%);
  border: 2px solid #E8C382;
  transform: rotate(-42deg);
  transform-origin: top center;
  box-shadow: 0 8px 16px rgba(30, 18, 10, 0.28);
  z-index: 1;
}

.zoom-tag {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(31, 25, 21, 0.82);
  color: #FFE49E;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.52rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* Compact Floating Callout Pill Under the Circular Loupe */
.loupe-caption-pill {
  width: 100%;
  background: rgba(253, 250, 244, 0.94);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(186, 70, 38, 0.32);
  border-radius: 18px;
  padding: 0.72rem 0.95rem;
  box-shadow: 0 12px 28px -8px rgba(38, 28, 18, 0.16);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.popover-badge {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--accent-primary);
  text-transform: uppercase;
}

.popover-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #1F1915;
  line-height: 1.18;
}

.popover-desc {
  font-size: 0.74rem;
  line-height: 1.38;
  color: #4A443E;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Bottom 4-Layer Segmented Pill Switcher */
.anatomy-bottom-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}

.hud-btn {
  padding: 0.62rem 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(180, 166, 148, 0.38);
  background: #F6F1E7;
  color: #3D352E;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.hud-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.hud-btn.active {
  background: linear-gradient(180deg, #B64526 0%, #9A3418 100%);
  border-color: #9A3418;
  color: #FFFFFF;
  box-shadow: 0 6px 14px rgba(154, 52, 24, 0.28);
}

/* ==========================================================================
   Category Icon Cards Row + Sculpted Status Bar (Matching Inspiration UI)
   ========================================================================== */
.controls-section {
  max-width: 1460px;
  margin: 0 auto;
  padding: 0.35rem 1.8rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.category-pills {
  display: grid;
  grid-template-columns: 160px repeat(3, minmax(180px, 1fr));
  gap: 0.9rem;
  align-items: center;
}

.cat-pill {
  height: 76px;
  padding: 0.6rem 0.75rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(180deg, #FBF8F3 0%, #F1EAE0 100%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  box-shadow: 0 8px 20px -6px rgba(42, 32, 22, 0.08);
  transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s ease, border-color 0.25s ease;
}

[data-theme="dark"] .cat-pill {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}

.cat-pill svg {
  width: 22px;
  height: 22px;
  color: #2B221B;
  transition: transform 0.25s ease, color 0.25s ease;
}

[data-theme="dark"] .cat-pill svg {
  color: var(--text-primary);
}

.cat-pill:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
  box-shadow: 0 12px 24px -6px rgba(158, 71, 42, 0.16);
}

/* First "ALL BREEDS" Hexagon Card */
.cat-pill.hex-card {
  height: 94px;
  clip-path: polygon(50% 0%, 96% 24%, 96% 76%, 50% 100%, 4% 76%, 4% 24%);
  border-radius: 0;
  border: none;
}

.cat-pill.active {
  background: linear-gradient(160deg, #B84526 0%, #943015 100%);
  color: #FFFFFF;
  border-color: #943015;
  box-shadow: 0 12px 26px rgba(154, 52, 24, 0.34);
}

.cat-pill.active svg {
  color: #FFFFFF;
}

/* Sculpted Status Arch Bar + PL/EN & SUN/MOON Switches */
.status-arch-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0.25rem;
  min-height: 42px;
}

.status-arch-center {
  background: var(--bg-secondary);
  border: 1px solid rgba(180, 166, 148, 0.32);
  padding: 0.45rem 2.2rem;
  border-radius: 24px 24px 12px 12px;
  box-shadow: 0 -4px 14px rgba(42, 32, 22, 0.04);
}

.results-counter {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
}

.status-toggles-right {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

/* 3-Way Language Selector PL / EN / DE */
.lang-selector-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid rgba(180, 166, 148, 0.45);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
  box-shadow: 0 2px 6px rgba(42, 32, 22, 0.05);
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.lang-btn:hover {
  color: var(--accent-primary);
}

.lang-btn.active {
  background: linear-gradient(180deg, #B64526 0%, #9A3418 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(154, 52, 24, 0.32);
}

.pill-switch-group {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.switch-label.muted {
  color: var(--text-muted);
}

.MiniSwitch {
  width: 48px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(180, 166, 148, 0.45);
  background: linear-gradient(180deg, #B64526 0%, #9A3418 100%);
  color: #FFF;
  padding: 2px 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  transition: all 0.25s ease;
}

.MiniSwitch.switched {
  justify-content: flex-end;
}

.MiniSwitch.sun-switch {
  background: var(--bg-secondary);
  color: #D48C28;
}

.switch-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #9A3418;
  font-size: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1180px) and (min-width: 769px) {
  .nav-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.85rem;
    align-items: center;
  }
  .search-dock-unit {
    width: 100%;
  }
  .alphabet-bar {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }
  .category-pills {
    grid-template-columns: repeat(4, 1fr);
  }
  .status-arch-bar {
    justify-content: space-between;
  }
}

/* ==========================================================================
   A–Z Breed Sections & Editorial Cards
   ========================================================================== */
.catalog-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

.letter-group {
  padding-top: 3.5rem;
  margin-bottom: 2.5rem;
  border-top: 1px solid var(--border-subtle);
  scroll-margin-top: 130px;
}

.letter-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.letter-display {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
}

.giant-letter {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 6vw, 5.2rem);
  font-weight: 700;
  line-height: 0.9;
  color: var(--accent-primary);
}

.letter-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.breeds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 2.25rem;
}

.catalog-container.reading-comfort .breeds-grid {
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
}

.catalog-container.reading-comfort .card-desc {
  font-size: 1.08rem;
  line-height: 1.78;
}

/* Breed Card with 3D Tilt & Image Reveal */
.breed-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 0.7s var(--ease-out-expo),
    transform 0.7s var(--ease-out-expo),
    box-shadow 0.4s var(--ease-out-expo),
    border-color 0.35s ease;
  will-change: transform, opacity;
}

.breed-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.breed-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-primary);
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #141210;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-media::before {
  content: "";
  position: absolute;
  inset: -12px;
  background-image: var(--card-bg-img);
  background-size: cover;
  background-position: center;
  filter: blur(18px) brightness(0.48) saturate(1.15);
  z-index: 0;
  pointer-events: none;
}

.card-media img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.85s var(--ease-out-expo), filter 0.5s ease;
}

.breed-card:hover .card-media img {
  transform: scale(1.04);
}

.card-letter-badge {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(18, 16, 14, 0.78);
  backdrop-filter: blur(10px);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.card-category-tag {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(18, 16, 14, 0.78);
  backdrop-filter: blur(10px);
  color: #F6F2EB;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-body {
  padding: 1.65rem 1.75rem 1.75rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-origin {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.card-subtitle {
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.card-desc {
  font-size: 0.98rem;
  line-height: 1.68;
  color: var(--text-secondary);
  margin-bottom: 1.4rem;
  flex: 1;
}

.card-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.spec-box {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.spec-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
}

.spec-val {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.42;
  color: var(--text-primary);
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ==========================================================================
   Deep-Read Editorial Modal Drawer
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(10, 9, 8, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out-expo);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.15fr);
  transform: translateY(28px) scale(0.96);
  transition: transform 0.42s var(--ease-spring), opacity 0.28s ease;
  position: relative;
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}

.modal-dialog:active {
  cursor: grabbing;
}

.modal-dialog.swiping {
  transition: none !important;
}

.modal-dialog.swipe-next-anim {
  animation: swipeSlideNext 0.36s var(--ease-spring);
}

.modal-dialog.swipe-prev-anim {
  animation: swipeSlidePrev 0.36s var(--ease-spring);
}

@keyframes swipeSlideNext {
  0% {
    opacity: 0.35;
    transform: translateX(64px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes swipeSlidePrev {
  0% {
    opacity: 0.35;
    transform: translateX(-64px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.modal-backdrop.open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 1.15rem;
  right: 1.15rem;
  z-index: 20;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, background-color 0.25s ease;
}

.modal-close:hover {
  transform: rotate(90deg);
  background: var(--accent-primary);
  color: #FFF;
}

.modal-media {
  position: relative;
  min-height: 500px;
  height: 100%;
  background: #12100E;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.85rem 0.85rem 2.2rem;
}

.modal-media::before {
  content: "";
  position: absolute;
  inset: -24px;
  background-image: var(--modal-bg-img);
  background-size: cover;
  background-position: center;
  filter: blur(26px) brightness(0.42) saturate(1.2);
  z-index: 0;
  pointer-events: none;
}

.modal-media img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-height: 80vh;
  object-fit: contain;
  object-position: center;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.modal-media-caption {
  position: absolute;
  z-index: 2;
  bottom: 0.5rem;
  left: auto;
  right: 0.75rem;
  max-width: calc(100% - 1.5rem);
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: rgba(12, 10, 8, 0.65);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#modalLibraryNotice {
  display: none;
}

.modal-media-caption a {
  color: #F4C95D;
  font-weight: 500;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-content {
  padding: 2.5rem 2.75rem 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 90vh;
  min-width: 0;
}

.modal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-primary);
  font-weight: 600;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.08;
  color: var(--text-primary);
}

.modal-subtitle {
  font-size: 1.08rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-top: -0.65rem;
}

.modal-description {
  font-size: 1.06rem;
  line-height: 1.76;
  color: var(--text-primary);
  font-weight: 400;
}

.modal-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1.4rem;
  background: var(--bg-secondary);
  padding: 1.35rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
}

.modal-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.modal-highlights li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-primary);
  font-weight: 500;
}

.modal-highlights li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--accent-primary);
}

.modal-nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.modal-nav-arrow-btn,
#modalPrevBtn,
#modalNextBtn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  color: #FFFFFF;
  background: linear-gradient(135deg, #BA4626 0%, #8E2F16 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  cursor: pointer;
  box-shadow:
    0 8px 18px -3px rgba(154, 52, 24, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.4);
  transition: transform 0.24s var(--ease-spring), box-shadow 0.24s ease, filter 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}

.modal-nav-arrow-btn svg,
#modalPrevBtn svg,
#modalNextBtn svg {
  width: 22px;
  height: 22px;
  stroke: #FFFFFF;
  display: block;
  transition: transform 0.2s var(--ease-spring);
}

#modalPrevBtn:hover {
  transform: scale(1.08) translateY(-2px);
  background: linear-gradient(135deg, #CA4F2D 0%, #9B3319 100%);
  box-shadow:
    0 12px 24px -3px rgba(154, 52, 24, 0.52),
    0 4px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.5);
  filter: brightness(1.06);
}

#modalPrevBtn:hover svg {
  transform: translateX(-2px);
}

#modalNextBtn:hover {
  transform: scale(1.08) translateY(-2px);
  background: linear-gradient(135deg, #CA4F2D 0%, #9B3319 100%);
  box-shadow:
    0 12px 24px -3px rgba(154, 52, 24, 0.52),
    0 4px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.5);
  filter: brightness(1.06);
}

#modalNextBtn:hover svg {
  transform: translateX(2px);
}

#modalPrevBtn:active,
#modalNextBtn:active {
  transform: scale(0.93) translateY(1px);
  box-shadow:
    0 3px 10px -2px rgba(154, 52, 24, 0.35),
    inset 0 1px 3px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .modal-nav-arrow-btn,
[data-theme="dark"] #modalPrevBtn,
[data-theme="dark"] #modalNextBtn {
  background: linear-gradient(135deg, #B64526 0%, #7A240E 100%);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow:
    0 8px 22px -4px rgba(0, 0, 0, 0.55),
    inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] #modalPrevBtn:hover,
[data-theme="dark"] #modalNextBtn:hover {
  background: linear-gradient(135deg, #C94E2C 0%, #8D2A11 100%);
  box-shadow:
    0 12px 28px -3px rgba(186, 70, 38, 0.42),
    inset 0 1px 2px rgba(255, 255, 255, 0.35);
}

#modalSwipeHint {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  text-transform: uppercase;
  background: var(--bg-card);
  padding: 0.38rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(180, 166, 148, 0.35);
  box-shadow: 0 2px 6px rgba(42, 32, 22, 0.04);
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.4rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 4px 12px rgba(42, 32, 22, 0.06);
}

.btn-pill:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(154, 52, 24, 0.16);
}

.btn-pill.accent {
  background: linear-gradient(135deg, #BA4626 0%, #8E2F16 100%);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(154, 52, 24, 0.32);
}

.btn-pill.accent:hover {
  filter: brightness(1.08);
  color: #FFFFFF;
  box-shadow: 0 10px 24px rgba(154, 52, 24, 0.45);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  display: none;
}

.empty-state.visible {
  display: block;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  padding: 3rem 2rem 3rem;
  margin-top: 4.5rem;
}

.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-brand-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-logo-title {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.footer-summary-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  max-width: 780px;
}

.footer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  flex-wrap: wrap;
}

.footer-legal-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.footer-credits {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: right;
}

.footer-credits p {
  margin: 0;
}

@media (max-width: 768px) {
  .site-footer {
    padding: 2.25rem 1.25rem 2.5rem;
    margin-top: 3rem;
  }
  .footer-bottom-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    padding-top: 1rem;
  }
  .footer-credits {
    text-align: left;
  }
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsiveness (Viewports <= 980px, <= 768px, <= 480px)
   ========================================================================== */

/* 1. Medium Tablets and Large Foldables (<= 980px) */
@media (max-width: 980px) {
  .hero {
    padding: 1.25rem 1rem 1.5rem;
    gap: 1rem;
  }
  .hero-anatomy-card {
    padding: 0.75rem;
    border-radius: 20px;
    gap: 0.75rem;
  }
  .anatomy-stage {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    height: auto;
    min-height: auto;
    max-height: none;
    padding: 0.65rem;
    gap: 0.6rem;
  }
  .horse-zoom-pill {
    position: static;
    align-self: flex-end;
    padding: 0.2rem 0.5rem;
    gap: 0.28rem;
    max-width: 100%;
    flex-wrap: nowrap;
    z-index: 12;
  }
  .zoom-pill-btn {
    font-size: 0.74rem;
    padding: 0.12rem 0.25rem;
    white-space: nowrap;
  }
  .horse-stage-viewport {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border-radius: 14px;
  }
  .loupe-leader-svg {
    display: none !important;
  }
  .anatomy-loupe-inspector {
    position: static;
    transform: none;
    width: 100%;
    max-width: 100%;
    z-index: 10;
    pointer-events: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 252, 247, 0.95);
    border: 1.5px solid rgba(186, 70, 38, 0.28);
    border-radius: 16px;
    padding: 0.65rem 0.85rem;
    box-shadow: 0 4px 16px rgba(42, 28, 16, 0.08);
  }
  [data-theme="dark"] .anatomy-loupe-inspector {
    background: rgba(30, 27, 24, 0.95);
    border-color: rgba(224, 122, 95, 0.35);
  }
  .loupe-glass-assembly {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
  }
  .popover-zoom-box.loupe-circle-lens {
    width: 84px;
    height: 84px;
    border-width: 3.5px;
    outline-width: 2px;
  }
  .loupe-handle {
    display: none;
  }
  .zoom-tag {
    font-size: 0.52rem;
    padding: 0.1rem 0.4rem;
    bottom: 5px;
  }
  .loupe-caption-pill {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    text-align: left;
    gap: 0.18rem;
  }
  .popover-title {
    font-size: 1rem;
    line-height: 1.2;
  }
  .popover-desc {
    font-size: 0.74rem;
    line-height: 1.38;
    -webkit-line-clamp: 2;
  }

  .modal-dialog {
    display: flex;
    flex-direction: column;
    max-height: 92vh;
    height: 92vh;
    overflow: hidden;
  }
  .modal-media {
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    min-height: 240px;
    max-height: 44vh;
    padding: 0;
  }
  .modal-media img {
    width: 100%;
    height: 100%;
    max-height: 44vh;
    object-fit: contain;
    border-radius: 0;
    box-shadow: none;
  }
  .modal-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.25rem 1.4rem 1.8rem;
  }
}

/* 2. Standard Mobile Devices (<= 768px) */
@media (max-width: 768px) {
  /* Compact Sticky Nav */
  .top-nav {
    position: sticky;
    top: 0;
    z-index: 900;
  }
  .nav-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.85rem;
    gap: 0.5rem;
  }
  .brand-logo {
    order: 1;
  }
  .brand-logo-img {
    height: 34px;
    max-width: 140px;
    object-fit: contain;
  }
  .header-lang-dock {
    order: 2;
  }
  .lang-selector-group {
    padding: 2px;
    gap: 2px;
  }
  .lang-btn {
    padding: 0.25rem 0.55rem;
    font-size: 0.72rem;
  }
  .search-dock-unit {
    width: 100%;
    order: 3;
    margin: 0;
  }
  .search-pill-shell {
    height: 38px;
    padding: 0 0.6rem 0 0.85rem;
  }
  .search-input {
    font-size: 0.86rem;
  }
  .alphabet-bar {
    width: 100%;
    order: 4;
    padding-top: 0.1rem;
  }
  .alphabet-carousel-shell {
    gap: 0.25rem;
  }
  .active-hex-wrapper {
    width: 36px;
    height: 40px;
    padding: 1.5px;
  }
  .hex-count {
    display: none;
  }
  .hex-letter {
    font-size: 0.95rem;
    line-height: 1;
  }
  .carousel-nav-btn {
    width: 26px;
    height: 30px;
    font-size: 1.3rem;
  }
  .alpha-pill {
    min-width: 28px;
    height: 30px;
    font-size: 0.76rem;
    padding: 0 0.35rem;
  }

  /* Anatomy Pins & Tabs */
  .body-node {
    width: 20px;
    height: 20px;
    font-size: 0.62rem;
    border-width: 1px;
  }
  .body-node:hover,
  .body-node.active {
    box-shadow:
      0 0 0 3.5px rgba(242, 163, 24, 0.32),
      0 3px 8px rgba(32, 24, 16, 0.25);
  }
  .anatomy-bottom-tabs {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
  }
  .hud-btn {
    padding: 0.55rem 0.35rem;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    border-radius: 10px;
  }

  /* Category Filters (2x2 Grid) */
  .controls-section {
    padding: 0.5rem 0.85rem 1rem;
    gap: 0.75rem;
  }
  .category-pills {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .cat-pill {
    height: 64px;
    padding: 0.45rem 0.65rem;
    border-radius: 14px;
  }
  .cat-icon-frame {
    width: 32px;
    height: 32px;
  }
  .cat-icon-svg {
    width: 18px;
    height: 18px;
  }
  .cat-label {
    font-size: 0.78rem;
  }
  .cat-count {
    font-size: 0.68rem;
  }
  .status-arch-bar {
    flex-direction: row;
    justify-content: space-between;
    padding: 0.25rem 0.5rem;
    min-height: auto;
  }
  .status-arch-center {
    font-size: 0.78rem;
  }

  /* Catalog Container & Breed Cards */
  .catalog-container {
    padding: 0 0.85rem 5rem;
  }
  .letter-group {
    padding-top: 1.75rem;
    margin-bottom: 1.5rem;
    scroll-margin-top: 115px;
  }
  .letter-header {
    margin-bottom: 1.15rem;
  }
  .letter-char {
    font-size: 2.6rem;
  }
  .letter-subtitle {
    font-size: 0.82rem;
  }
  .letter-count {
    font-size: 0.72rem;
  }
  .breeds-grid,
  .catalog-container.reading-comfort .breeds-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .breed-card {
    min-width: 0;
    width: 100%;
    border-radius: 16px;
  }
  .card-media {
    aspect-ratio: 16 / 10;
  }
  .card-body {
    padding: 1.15rem;
    gap: 0.65rem;
  }
  .card-title {
    font-size: 1.45rem;
  }
  .card-subtitle {
    font-size: 0.82rem;
  }
  .card-desc {
    font-size: 0.86rem;
    line-height: 1.5;
    -webkit-line-clamp: 3;
  }
  .card-specs {
    gap: 0.45rem;
  }
  .spec-box {
    padding: 0.5rem 0.65rem;
  }
  .spec-label {
    font-size: 0.65rem;
  }
  .spec-val {
    font-size: 0.78rem;
  }

  /* Mobile Modal Dialog */
  .modal-backdrop {
    padding: 0.5rem;
    align-items: flex-end;
  }
  .modal-dialog {
    border-radius: 20px 20px 12px 12px;
    max-height: 94vh;
    height: 94vh;
    border-bottom: none;
  }
  .modal-close {
    top: 0.65rem;
    right: 0.65rem;
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
    background: rgba(18, 16, 14, 0.78);
    color: #fff;
    backdrop-filter: blur(8px);
    z-index: 25;
  }
  .modal-media {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    min-height: 230px;
    max-height: 42vh;
    padding: 0;
  }
  .modal-media img {
    width: 100%;
    height: 100%;
    max-height: 42vh;
    object-fit: contain;
    border-radius: 0;
    box-shadow: none;
  }
  .modal-media-caption {
    bottom: 0.35rem;
    left: auto;
    right: 0.45rem;
    max-width: calc(100% - 0.9rem);
    padding: 0.14rem 0.48rem;
    font-size: 0.54rem;
    background: rgba(12, 10, 8, 0.56);
    border-radius: 999px;
  }
  .modal-content {
    padding: 0.95rem 1.1rem 1.5rem;
    gap: 0.7rem;
  }
  .modal-kicker {
    font-size: 0.68rem;
  }
  .modal-title {
    font-size: 1.65rem;
    line-height: 1.1;
  }
  .modal-subtitle {
    font-size: 0.84rem;
    margin-top: -0.15rem;
  }
  .modal-description {
    font-size: 0.92rem;
    line-height: 1.56;
  }
  .modal-specs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .modal-highlights li {
    font-size: 0.82rem;
    padding: 0.35rem 0 0.35rem 1.25rem;
  }
  .modal-nav-footer {
    padding-top: 0.5rem;
    margin-top: 0.25rem;
    gap: 0.5rem;
  }
  #modalSwipeHint {
    font-size: 0.6rem;
    padding: 0.3rem 0.65rem;
    letter-spacing: 0.04em;
    text-align: center;
  }
  .modal-nav-arrow-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  /* Floating Feedback & Modal */
  .floating-feedback-btn {
    bottom: 1.1rem !important;
    right: 1.1rem !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    justify-content: center !important;
    background: #a85834 !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4) !important;
  }
  .feedback-btn-text {
    display: none !important;
  }
  .feedback-icon {
    width: 1.35rem !important;
    height: 1.35rem !important;
    stroke: #ffffff !important;
    stroke-width: 2.2 !important;
    flex-shrink: 0 !important;
    margin: 0 auto !important;
  }
  .legal-modal-card {
  max-width: 540px;
}

.legal-modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.legal-modal-subtitle {
  font-size: 0.85rem;
  color: var(--accent-primary);
  margin: 0.25rem 0 0 0;
  font-weight: 600;
}

.legal-modal-body {
  margin-top: 1.25rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.legal-modal-body p {
  margin: 0 0 0.85rem 0;
}

.legal-modal-body strong {
  color: var(--text-primary);
}

.footer-legal-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.legal-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  color: var(--accent-primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.legal-link-btn:hover {
  opacity: 0.8;
}

.legal-sep {
  color: var(--border-color);
  font-size: 0.8rem;
}

.feedback-modal-backdrop {
    padding: 0.5rem;
    align-items: flex-end;
  }
  .feedback-modal-card {
    border-radius: 20px 20px 12px 12px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.4rem 1.15rem 1.75rem;
  }
  .star-btn {
    font-size: 1.55rem;
  }

  .site-footer {
    padding: 2.25rem 1rem;
    margin-top: 2.5rem;
  }
}

/* 3. Small Mobile Phones (<= 480px) */
@media (max-width: 480px) {
  .nav-inner {
    padding: 0.4rem 0.6rem;
    gap: 0.4rem;
  }
  .brand-logo-img {
    height: 30px;
    max-width: 125px;
  }
  .lang-btn {
    padding: 0.2rem 0.45rem;
    font-size: 0.68rem;
  }
  .search-pill-shell {
    height: 36px;
    padding: 0 0.5rem 0 0.75rem;
  }
  .active-hex-wrapper {
    width: 32px;
    height: 36px;
  }
  .hex-letter {
    font-size: 0.88rem;
  }
  .alpha-pill {
    min-width: 25px;
    height: 28px;
    font-size: 0.72rem;
    padding: 0 0.25rem;
  }
  .body-node {
    width: 18px;
    height: 18px;
    font-size: 0.56rem;
  }
  .anatomy-bottom-tabs {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
  }
  .hud-btn {
    padding: 0.48rem 0.25rem;
    font-size: 0.64rem;
  }
  .loupe-glass-assembly {
    width: 76px;
    height: 76px;
  }
  .popover-zoom-box.loupe-circle-lens {
    width: 72px;
    height: 72px;
  }
  .popover-title {
    font-size: 0.92rem;
  }
  .popover-desc {
    font-size: 0.7rem;
  }
  .modal-title {
    font-size: 1.55rem;
  }
  .modal-media {
    aspect-ratio: 4 / 3;
    height: auto;
    min-height: 215px;
    max-height: 40vh;
    padding: 0;
  }
}

/* ==========================================================================
   Floating Anonymous Feedback System
   ========================================================================== */
.floating-feedback-btn {
  position: fixed;
  bottom: 1.8rem;
  right: 1.8rem;
  z-index: 8500;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 48px !important;
  height: 48px !important;
  padding: 0 !important;
  background: #a85834 !important;
  color: #ffffff !important;
  border: 2.5px solid rgba(255, 255, 255, 0.95) !important;
  border-radius: 50% !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
  cursor: pointer !important;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-feedback-btn:hover {
  transform: translateY(-2px) scale(1.05);
  background: #8e4726 !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45) !important;
}

.feedback-btn-text {
  display: none !important;
}

.feedback-icon {
  width: 1.4rem !important;
  height: 1.4rem !important;
  stroke: #ffffff !important;
  stroke-width: 2.2 !important;
  flex-shrink: 0 !important;
  display: block !important;
  margin: 0 auto !important;
}

.legal-modal-card {
  max-width: 540px;
}

.legal-modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.legal-modal-subtitle {
  font-size: 0.85rem;
  color: var(--accent-primary);
  margin: 0.25rem 0 0 0;
  font-weight: 600;
}

.legal-modal-body {
  margin-top: 1.25rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.legal-modal-body p {
  margin: 0 0 0.85rem 0;
}

.legal-modal-body strong {
  color: var(--text-primary);
}

.footer-legal-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.legal-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  color: var(--accent-primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.legal-link-btn:hover {
  opacity: 0.8;
}

.legal-sep {
  color: var(--border-color);
  font-size: 0.8rem;
}

.feedback-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9600;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  animation: fadeInModal 0.2s ease-out;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.feedback-modal-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
  color: var(--text-primary);
  animation: slideUpModal 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpModal {
  from { transform: translateY(18px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.feedback-modal-close {
  position: absolute;
  top: 1.15rem;
  right: 1.15rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.35rem;
  line-height: 1;
  border-radius: 50%;
  transition: all 0.18s ease;
}

.feedback-modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.feedback-badge-anon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  background: rgba(46, 125, 50, 0.15);
  color: #4caf50;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.feedback-modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.feedback-modal-header p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 1.25rem;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.feedback-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.feedback-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.star-rating {
  display: flex;
  gap: 0.35rem;
}

.star-btn {
  background: none;
  border: none;
  font-size: 1.85rem;
  color: var(--border-color);
  cursor: pointer;
  padding: 0 0.15rem;
  transition: transform 0.15s ease, color 0.15s ease;
  line-height: 1;
}

.star-btn:hover,
.star-btn.hover,
.star-btn.active {
  color: #ffb300;
  transform: scale(1.15);
}

.topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.topic-pill {
  padding: 0.4rem 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.topic-pill:hover,
.topic-pill.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.feedback-field textarea {
  width: 100%;
  padding: 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.45;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.18s ease;
}

.feedback-field textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.feedback-privacy-note {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  color: var(--text-tertiary);
  line-height: 1.35;
}

.feedback-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.feedback-submit-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.feedback-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.feedback-success-state {
  text-align: center;
  padding: 1.5rem 0;
  animation: fadeInModal 0.25s ease-out;
}

.feedback-success-icon {
  width: 54px;
  height: 54px;
  line-height: 54px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  font-size: 1.85rem;
  font-weight: 700;
}

.feedback-success-state h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 0.45rem;
  color: var(--text-primary);
}

.feedback-success-state p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

