/* ======================
   ACCORDION
====================== */
.accordion-root {
  width: 100%;
  border-radius: var(--radius, 0.5rem);
}

.accordion-item {
  border-bottom: 1px solid hsl(var(--border, 0 0% 89.8%));
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-heading {
  margin: 0;
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  font-size: 1rem;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: hsl(var(--foreground, 0 0% 3.9%));
  transition: all 0.2s ease;
}

.accordion-trigger:hover {
  text-decoration: underline;
}

.accordion-trigger:focus-visible {
  outline: 2px solid hsl(var(--ring, 222.2 84% 4.9%));
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.accordion-trigger-icon {
  flex-shrink: 0;
  margin-left: 0.5rem;
  font-size: 1.2em;
  transition: transform 0.2s ease;
}

.accordion-trigger--open .accordion-trigger-icon {
  transform: rotate(180deg);
}

.accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.2s ease;
  overflow: hidden;
}

.accordion-content--open {
  grid-template-rows: 1fr;
}

.accordion-content > * {
  min-height: 0;
  padding-bottom: 1rem;
}

.accordion-content[hidden] {
  display: none;
}

/* ======================
   ALERT
====================== */
.alert {
  position: relative;
  width: 100%;
  border-radius: var(--radius, 0.5rem);
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.alert--default {
  background: hsl(var(--muted, 0 0% 96.1%));
  color: hsl(var(--foreground, 0 0% 3.9%));
}

.alert--destructive {
  background: hsl(0 84.2% 60.2% / 0.1);
  color: hsl(0 84.2% 60.2%);
  border: 1px solid hsl(0 84.2% 60.2% / 0.2);
}

.alert--border {
  border: 1px solid hsl(var(--border, 0 0% 89.8%));
}

.alert-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.alert-description {
  font-size: 0.875rem;
  line-height: 1.5;
  opacity: 0.9;
}

/* ======================
   AVATAR
====================== */
.avatar-root,
.avatar-group-root {
  display: inline-block;
}

.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: hsl(var(--muted, 0 0% 96.1%));
  color: hsl(var(--muted-foreground, 0 0% 45.1%));
  font-weight: 500;
}

.avatar--shape-circle {
  border-radius: 50%;
}

.avatar--shape-square {
  border-radius: var(--radius, 0.5rem);
}

.avatar--xs {
  width: 24px;
  height: 24px;
  font-size: 0.625rem;
}

.avatar--sm {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

.avatar--md {
  width: 40px;
  height: 40px;
  font-size: 0.875rem;
}

.avatar--lg {
  width: 48px;
  height: 48px;
  font-size: 1rem;
}

.avatar--xl {
  width: 64px;
  height: 64px;
  font-size: 1.25rem;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-image--grayscale {
  filter: grayscale(100%);
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-transform: uppercase;
}

.avatar-group {
  display: inline-flex;
  align-items: center;
}

.avatar-group--overlap .avatar {
  margin-left: -8px;
  border: 2px solid white;
}

.avatar-group--overlap .avatar:first-child {
  margin-left: 0;
}

.avatar-group--grayscale .avatar-image {
  filter: grayscale(100%);
}

/* ======================
   BADGE
====================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: var(--radius, 0.5rem);
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.badge-pill {
  border-radius: 9999px;
}

.badge-icon {
  font-size: 0.875em;
}

.badge-default {
  background: hsl(var(--secondary, 0 0% 96.1%));
  color: hsl(var(--secondary-foreground, 0 0% 9%));
}

.badge-secondary {
  background: hsl(var(--secondary, 0 0% 96.1%));
  color: hsl(var(--secondary-foreground, 0 0% 9%));
}

.badge-destructive {
  background: hsl(0 84.2% 60.2%);
  color: white;
}

.badge-outline {
  background: transparent;
  border: 1px solid hsl(var(--border, 0 0% 89.8%));
  color: hsl(var(--foreground, 0 0% 3.9%));
}

/* ======================
   DEVICES
====================== */
.devices {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 2rem auto;
  padding: 2rem;
}

.devices--layout-desktop-mobile {
  flex-direction: row;
}

.devices--layout-desktop-only,
.devices--layout-mobile-only {
  flex-direction: column;
}

.device-browser {
  flex: 1;
  max-width: 800px;
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.devices--frame-dark .device-browser {
  background: #1f2937;
}

.device-browser-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
}

.devices--frame-dark .device-browser-bar {
  background: #374151;
  border-bottom-color: #4b5563;
}

.device-browser-dots {
  display: flex;
  gap: 0.5rem;
}

.device-browser-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d1d5db;
}

.device-browser-dots span:nth-child(1) {
  background: #ef4444;
}

.device-browser-dots span:nth-child(2) {
  background: #f59e0b;
}

.device-browser-dots span:nth-child(3) {
  background: #10b981;
}

.device-browser-url {
  flex: 1;
  padding: 0.375rem 0.75rem;
  background: white;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.devices--frame-dark .device-browser-url {
  background: #1f2937;
  color: #9ca3af;
}

.device-browser-body {
  background: white;
}

.devices--frame-dark .device-browser-body {
  background: #111827;
}

.device-browser-image {
  width: 100%;
  height: auto;
  display: block;
}

.device-phone {
  flex-shrink: 0;
  width: 280px;
}

.device-phone-frame {
  position: relative;
  padding: 1rem 0.75rem;
  background: #1f2937;
  border-radius: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.devices--frame-light .device-phone-frame {
  background: #f3f4f6;
}

.device-phone-screen {
  width: 100%;
  height: auto;
  border-radius: 1.25rem;
  display: block;
}

@media (max-width: 768px) {
  .devices--layout-desktop-mobile {
    flex-direction: column;
  }
  
  .device-phone {
    width: 240px;
  }
}

/* ======================
   TABS
====================== */
.tabs-root {
  width: 100%;
  margin: 1.5rem 0;
}

.tabs-list {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid hsl(var(--border, 0 0% 89.8%));
  margin-bottom: 1rem;
}

.tabs-root--align-center .tabs-list {
  justify-content: center;
}

.tabs-root--align-right .tabs-list {
  justify-content: flex-end;
}

.tabs-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: hsl(var(--muted-foreground, 0 0% 45.1%));
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tabs-trigger:hover {
  color: hsl(var(--foreground, 0 0% 3.9%));
}

.tabs-trigger:focus-visible {
  outline: 2px solid hsl(var(--ring, 222.2 84% 4.9%));
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.tabs-trigger--active {
  color: hsl(var(--foreground, 0 0% 3.9%));
  border-bottom-color: hsl(var(--primary, 222.2 47.4% 11.2%));
}

.tabs-root--card .tabs-trigger {
  border: 1px solid hsl(var(--border, 0 0% 89.8%));
  border-bottom: 1px solid hsl(var(--border, 0 0% 89.8%));
  border-radius: 0.5rem 0.5rem 0 0;
  margin-bottom: -1px;
}

.tabs-root--card .tabs-trigger--active {
  background: white;
  border-bottom-color: white;
}

.tabs-trigger-icon {
  font-size: 1.1em;
}

.tabs-contents {
  margin-top: 1rem;
}

.tabs-content {
  display: none;
}

.tabs-content--active {
  display: block;
}

.tabs-content--card {
  padding: 1.5rem;
  border: 1px solid hsl(var(--border, 0 0% 89.8%));
  border-radius: var(--radius, 0.5rem);
}

/* ======================
   TIMELINE
====================== */
.timeline {
  width: 100%;
  margin: 2rem 0;
}

.timeline--vertical {
  display: flex;
  flex-direction: column;
}

.timeline--horizontal {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  overflow-x: auto;
}

.timeline-heading {
  padding: 1rem 0;
}

.timeline-heading-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(var(--foreground, 0 0% 3.9%));
  margin: 0;
}

.timeline-row {
  display: flex;
  gap: 1rem;
  position: relative;
}

.timeline--vertical .timeline-row {
  padding-bottom: 2rem;
}

.timeline--vertical .timeline-row:last-child {
  padding-bottom: 0;
}

.timeline-icon-col {
  position: relative;
  flex-shrink: 0;
  width: 40px;
}

.timeline:not(.timeline--no-line) .timeline-icon-col::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 40px;
  bottom: -2rem;
  width: 2px;
  background: hsl(var(--border, 0 0% 89.8%));
  transform: translateX(-50%);
}

.timeline--vertical .timeline-row:last-child .timeline-icon-col::after {
  display: none;
}

.timeline-icon-wrapper {
  position: relative;
  z-index: 1;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: hsl(var(--primary, 222.2 47.4% 11.2%));
  border: 2px solid white;
  box-shadow: 0 0 0 2px hsl(var(--border, 0 0% 89.8%));
  margin: 4px auto;
}

.timeline-dot--icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  background: hsl(var(--primary, 222.2 47.4% 11.2%));
  color: white;
}

.timeline-dot--avatar {
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0 auto;
  background: transparent;
  box-shadow: none;
}

.timeline-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.timeline-inline-icon {
  font-size: 1rem;
}

.timeline-main {
  flex: 1;
  min-width: 0;
}

.timeline-date {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground, 0 0% 45.1%));
  margin-bottom: 0.25rem;
}

.timeline-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: hsl(var(--foreground, 0 0% 3.9%));
}

.timeline-title-leading-icon {
  font-size: 1.25rem;
}

.timeline-title-text {
  flex: 1;
}

.timeline-body {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: hsl(var(--foreground, 0 0% 3.9%));
  margin-bottom: 0.75rem;
}

.timeline-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.timeline-meta-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.timeline-meta-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background: hsl(var(--secondary, 0 0% 96.1%));
  color: hsl(var(--secondary-foreground, 0 0% 9%));
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.timeline-meta-text {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground, 0 0% 45.1%));
}

@media (max-width: 768px) {
  .timeline--horizontal {
    flex-direction: column;
  }
}

/* ======================
   CHARTS
====================== */
.chart-container {
  width: 100%;
  margin: 2rem auto;
  padding: 1.5rem;
  background: hsl(var(--card, 0 0% 100%));
  border: 1px solid hsl(var(--border, 0 0% 89.8%));
  border-radius: var(--radius, 0.5rem);
}

.chart-container canvas {
  max-width: 100%;
  height: 100% !important;
  /* Improve rendering on high-DPI displays */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Chart color variables */
:root {
  --chart-1: 222.2 47.4% 11.2%;
  --chart-2: 210 40% 96.1%;
  --chart-3: 215 20.2% 65.1%;
  --chart-4: 142 71% 45%;
  --chart-5: 48 96% 53%;
}

.dark {
  --chart-1: 220 70% 50%;
  --chart-2: 160 60% 45%;
  --chart-3: 30 80% 55%;
  --chart-4: 280 65% 60%;
  --chart-5: 340 75% 55%;
}

/* Responsive */
@media (max-width: 640px) {
  .chart-container {
    padding: 1rem;
    margin: 1rem auto;
  }
}

/* Touch improvements for mobile */
@media (hover: none) and (pointer: coarse) {
  .chart-container canvas {
    touch-action: pan-y;
  }
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .chart-container canvas {
    animation: none;
    transition: none;
  }
}

/* Print styles */
@media print {
  .chart-container {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* ======================
   DETAILED LIST
====================== */
.detailed-list {
  width: 100%;
  margin: 1.5rem 0;
  overflow: hidden;
  border-radius: var(--radius, 0.5rem);
}

.detailed-list-item {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 2fr;
  gap: 1rem;
  padding: 0.875rem 1rem;
  transition: background-color 0.2s ease;
}

.detailed-list-term {
  font-weight: 600;
  font-size: 0.875rem;
  color: hsl(var(--foreground, 0 0% 3.9%));
  margin: 0;
}

.detailed-list-definition {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground, 0 0% 45.1%));
  margin: 0;
  line-height: 1.6;
}

/* Base Style */
.detailed-list--base .detailed-list-item {
  border-bottom: 1px solid hsl(var(--border, 0 0% 89.8%));
}

.detailed-list--base .detailed-list-item:last-child {
  border-bottom: none;
}

/* Striped Style */
.detailed-list--striped .detailed-list-item:nth-child(even) {
  background: hsl(var(--muted, 0 0% 96.1%) / 0.5);
}

/* Bordered Style */
.detailed-list--bordered {
  border: 1px solid hsl(var(--border, 0 0% 89.8%));
}

.detailed-list--bordered .detailed-list-item {
  border-bottom: 1px solid hsl(var(--border, 0 0% 89.8%));
}

.detailed-list--bordered .detailed-list-item:last-child {
  border-bottom: none;
}

/* Striped and Bordered */
.detailed-list--striped-bordered {
  border: 1px solid hsl(var(--border, 0 0% 89.8%));
}

.detailed-list--striped-bordered .detailed-list-item {
  border-bottom: 1px solid hsl(var(--border, 0 0% 89.8%));
}

.detailed-list--striped-bordered .detailed-list-item:nth-child(even) {
  background: hsl(var(--muted, 0 0% 96.1%) / 0.5);
}

.detailed-list--striped-bordered .detailed-list-item:last-child {
  border-bottom: none;
}

/* Dark Variant */
.detailed-list--dark {
  background: hsl(0 0% 9%);
  color: hsl(0 0% 98%);
}

.detailed-list--dark .detailed-list-term {
  color: hsl(0 0% 98%);
}

.detailed-list--dark .detailed-list-definition {
  color: hsl(0 0% 70%);
}

.detailed-list--dark.detailed-list--base .detailed-list-item {
  border-bottom-color: hsl(0 0% 20%);
}

.detailed-list--dark.detailed-list--striped .detailed-list-item:nth-child(even) {
  background: hsl(0 0% 15%);
}

.detailed-list--dark.detailed-list--bordered {
  border-color: hsl(0 0% 20%);
}

.detailed-list--dark.detailed-list--bordered .detailed-list-item {
  border-bottom-color: hsl(0 0% 20%);
}

.detailed-list--dark.detailed-list--striped-bordered {
  border-color: hsl(0 0% 20%);
}

.detailed-list--dark.detailed-list--striped-bordered .detailed-list-item {
  border-bottom-color: hsl(0 0% 20%);
}

.detailed-list--dark.detailed-list--striped-bordered .detailed-list-item:nth-child(even) {
  background: hsl(0 0% 15%);
}

/* Highlight Item */
.detailed-list-item--highlight .detailed-list-term {
  color: hsl(var(--primary, 222.2 47.4% 11.2%));
}

.detailed-list--dark .detailed-list-item--highlight .detailed-list-term {
  color: hsl(222.2 84% 70%);
}

/* Responsive */
@media (max-width: 640px) {
  .detailed-list-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1rem;
  }
  
  .detailed-list-term {
    font-size: 0.8125rem;
  }
  
  .detailed-list-definition {
    font-size: 0.8125rem;
    padding-top: 0.25rem;
  }
}

/* ======================
   IMAGE COMPARISON
====================== */
.image-diff {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 2rem auto;
  overflow: hidden;
  border-radius: var(--radius, 0.5rem);
  user-select: none;
  -webkit-user-select: none;
  cursor: ew-resize;
}

.image-diff:focus {
  outline: 2px solid hsl(var(--ring, 222.2 84% 4.9%));
  outline-offset: 2px;
}

.image-diff-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.image-diff-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

.image-diff-item-1 {
  z-index: 1;
}

.image-diff-item-2 {
  z-index: 2;
  clip-path: inset(0 0 0 50%);
}

.image-diff-resizer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background: white;
  z-index: 3;
  cursor: ew-resize;
  box-shadow: 
    0 0 0 1px rgba(0, 0, 0, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-diff-resizer:focus {
  outline: 2px solid hsl(var(--ring, 222.2 84% 4.9%));
  outline-offset: 2px;
}

.image-diff-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 0 0 1px rgba(0, 0, 0, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.image-diff-handle svg {
  width: 24px;
  height: 24px;
  color: #333;
}

.image-diff-label {
  position: absolute;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.25rem;
  pointer-events: none;
  z-index: 4;
}

.image-diff-label-1 {
  top: 1rem;
  left: 1rem;
}

.image-diff-label-2 {
  top: 1rem;
  right: 1rem;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .image-diff {
    margin: 1rem auto;
  }
  
  .image-diff-handle {
    width: 40px;
    height: 40px;
  }
  
  .image-diff-handle svg {
    width: 20px;
    height: 20px;
  }
  
  .image-diff-label {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }
}

/* ======================
   IMAGE HOTSPOT
====================== */
.image-hotspot-container {
  width: 100%;
  margin: 2rem auto;
}

.image-hotspot-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.image-hotspot-wrapper--right {
  flex-direction: row;
  align-items: flex-start;
}

.image-hotspot-wrapper--left {
  flex-direction: row-reverse;
  align-items: flex-start;
}

.image-hotspot-wrapper--right .image-hotspot,
.image-hotspot-wrapper--left .image-hotspot {
  flex: 1;
}

.image-hotspot-wrapper--right .image-hotspot-legend,
.image-hotspot-wrapper--left .image-hotspot-legend {
  flex: 0 0 300px;
}

/* Image */
.image-hotspot {
  position: relative;
  width: 100%;
  display: inline-block;
}

.image-hotspot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius, 0.5rem);
}

/* Hotspot Marker */
.image-hotspot-marker {
  z-index: 10;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-hotspot-marker:hover,
.image-hotspot-marker:focus {
  transform: translate(-50%, -50%) scale(1.1);
  z-index: 20;
}

.image-hotspot-marker:focus {
  outline: 2px solid var(--marker-color);
  outline-offset: 4px;
  border-radius: 50%;
}

.image-hotspot-marker--active {
  transform: translate(-50%, -50%) scale(1.15);
  z-index: 20;
}

/* Marker Dot */
.image-hotspot-marker--dot {
  width: 32px;
  height: 32px;
  position: relative;
}

.image-hotspot-marker-dot {
  display: block;
  width: 32px;
  height: 32px;
  background: var(--marker-color);
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.image-hotspot-marker--dot:hover .image-hotspot-marker-dot {
  transform: scale(1.1);
}

/* Marker Number */
.image-hotspot-marker--number {
  width: 32px;
  height: 32px;
  position: relative;
}

.image-hotspot-marker--number .image-hotspot-marker-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--marker-color);
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 2px solid white;
}

/* Marker Icon */
.image-hotspot-marker--icon {
  width: 32px;
  height: 32px;
  position: relative;
}

.image-hotspot-marker--icon .image-hotspot-marker-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--marker-color);
  color: white;
  border-radius: 50%;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 2px solid white;
}

/* Pulse Animation */
.image-hotspot-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--marker-color);
  opacity: 0;
  animation: hotspot-pulse 2s ease-out infinite;
  pointer-events: none;
}

@keyframes hotspot-pulse {
  0% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2);
  }
}

/* Tooltip */
.image-hotspot-tooltip {
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  transform: translateY(4px);
}

.image-hotspot-tooltip--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.image-hotspot-tooltip-content {
  background: white;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  max-width: 300px;
  border: 1px solid hsl(var(--border, 0 0% 89.8%));
}

.image-hotspot-tooltip-content::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  background: white;
  border-right: 1px solid hsl(var(--border, 0 0% 89.8%));
  border-bottom: 1px solid hsl(var(--border, 0 0% 89.8%));
  transform: translateX(-50%) rotate(45deg);
  z-index: -1;
}

.image-hotspot-tooltip-title {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
  color: hsl(var(--foreground, 0 0% 3.9%));
}

.image-hotspot-tooltip-description {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: hsl(var(--muted-foreground, 0 0% 45.1%));
}

.image-hotspot-tooltip-link {
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
  color: hsl(var(--primary, 222.2 47.4% 11.2%));
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.image-hotspot-tooltip-link:hover {
  color: hsl(var(--primary, 222.2 47.4% 11.2%));
  text-decoration: underline;
}

/* Legend */
.image-hotspot-legend {
  background: hsl(var(--card, 0 0% 100%));
  border: 1px solid hsl(var(--border, 0 0% 89.8%));
  border-radius: var(--radius, 0.5rem);
  padding: 1.25rem;
}

.image-hotspot-legend-title {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--foreground, 0 0% 3.9%));
}

.image-hotspot-legend-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.image-hotspot-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.image-hotspot-legend-marker {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--marker-color);
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-top: 0.125rem;
}

.image-hotspot-legend-marker--dot {
  width: 16px;
  height: 16px;
  margin-top: 0.375rem;
}

.image-hotspot-legend-content {
  flex: 1;
}

.image-hotspot-legend-content strong {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
  color: hsl(var(--foreground, 0 0% 3.9%));
}

.image-hotspot-legend-content p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: hsl(var(--muted-foreground, 0 0% 45.1%));
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .image-hotspot-wrapper--right,
  .image-hotspot-wrapper--left {
    flex-direction: column;
  }
  
  .image-hotspot-wrapper--right .image-hotspot-legend,
  .image-hotspot-wrapper--left .image-hotspot-legend {
    flex: 1;
    width: 100%;
  }
  
  .image-hotspot-tooltip-content {
    min-width: 180px;
    max-width: 250px;
    font-size: 0.875rem;
  }
  
  .image-hotspot-marker--number,
  .image-hotspot-marker--icon {
    width: 28px;
    height: 28px;
  }
  
  .image-hotspot-marker--number .image-hotspot-marker-content,
  .image-hotspot-marker--icon .image-hotspot-marker-content {
    width: 28px;
    height: 28px;
    font-size: 0.8125rem;
  }
}


/* ======================
   METRICS / KPI
====================== */

.jg-metrics {
  margin-block: 2.5rem;
}

.jg-metrics-grid {
  display: grid;
  gap: 1rem;
}

.jg-metrics-cols-1 { grid-template-columns: minmax(0, 1fr); }
.jg-metrics-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.jg-metrics-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.jg-metrics-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 768px) {
  .jg-metrics-cols-2,
  .jg-metrics-cols-3,
  .jg-metrics-cols-4 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.jg-metric-card {
  border-radius: var(--radius, 0.75rem);
  border: 1px solid hsl(var(--border, 0 0% 89.8%));
  background-color: hsl(var(--card, 0 0% 100%));
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.jg-metric-header {
  margin-bottom: 0.25rem;
}

.jg-metric-label {
  font-size: 0.8rem;
  line-height: 1.2;
  color: hsl(var(--muted-foreground, 0 0% 45.1%));
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.jg-metric-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.1rem;
}

.jg-metric-value {
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: hsl(var(--foreground, 0 0% 3.9%));
}

.jg-metric-unit {
  margin-left: 0.1rem;
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground, 0 0% 45.1%));
}

.jg-metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
}

.jg-metric-trend-icon {
  font-size: 0.9rem;
}

.jg-metric-trend--up {
  color: hsl(142 70% 40%);
}

.jg-metric-trend--down {
  color: hsl(0 72% 50%);
}

.jg-metric-note {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground, 0 0% 45.1%));
}

/* Tone accents */
.jg-metrics--positive .jg-metric-card {
  border-color: hsl(142 76% 90%);
  background-image: linear-gradient(
    135deg,
    hsl(142 76% 97%) 0,
    hsl(var(--card, 0 0% 100%)) 40%
  );
}

.jg-metrics--warning .jg-metric-card {
  border-color: hsl(35 92% 90%);
  background-image: linear-gradient(
    135deg,
    hsl(35 92% 97%) 0,
    hsl(var(--card, 0 0% 100%)) 40%
  );
}

/* ======================
   STANDARDS CHIPS (WCAG / ADA / EAA)
====================== */

.jg-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  background: hsl(var(--muted, 0 0% 96.1%));
  color: hsl(var(--foreground, 0 0% 3.9%));
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease,
    color 0.2s ease, box-shadow 0.2s ease;
}

.jg-chip-main {
  display: inline-flex;
  align-items: center;
}

.jg-chip-meta {
  opacity: 0.75;
  font-weight: 400;
}

.jg-chip--standard {
  background: hsl(var(--card, 0 0% 100%));
  border-color: hsl(var(--border, 0 0% 89.8%));
}

.jg-chip--standard:hover {
  background: hsl(var(--muted, 0 0% 96.1%));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Accent by standard */
.jg-chip--wcag {
  border-color: hsl(221 83% 65%);
}

.jg-chip--ada {
  border-color: hsl(160 84% 39%);
}

.jg-chip--eaa {
  border-color: hsl(39 88% 55%);
}

/* ======================
   MEDIA PLAYER + TRANSCRIPT
====================== */

.jg-media {
  margin-block: 2.5rem;
}

.jg-media-shell {
  border-radius: var(--radius, 0.75rem);
  border: 1px solid hsl(var(--border, 0 0% 89.8%));
  background: linear-gradient(
    135deg,
    hsl(var(--muted, 0 0% 96.1%)),
    hsl(var(--card, 0 0% 100%))
  );
  padding: 1rem;
  max-width: 56rem;
}

.jg-media-element {
  width: 100%;
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
}

/* Main UI shell */

.jg-media-ui {
  border-radius: 0.75rem;
  background: hsl(222 47% 11%);
  color: hsl(0 0% 100%);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.jg-media-top {
  display: flex;
  gap: 0.75rem;
}

.jg-media-btn {
  border-radius: 9999px;
  border: 1px solid transparent;
  font-size: 0.85rem;
  padding: 0.35rem 0.9rem;
  line-height: 1.3;
  cursor: pointer;
  background: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.jg-media-btn--primary {
  background: hsl(0 0% 100%);
  color: hsl(222 47% 11%);
  font-weight: 500;
}

.jg-media-btn--ghost {
  border-color: hsl(220 3% 31%);
  background: transparent;
}

.jg-media-btn--ghost:hover {
  background: hsl(220 3% 20%);
}

.jg-media-btn--active {
  background: hsl(var(--muted, 0 0% 96.1%));
  color: hsl(222 47% 11%);
}

.jg-media-icon--pause {
  display: none;
}

.jg-media--playing .jg-media-icon--play {
  display: none;
}

.jg-media--playing .jg-media-icon--pause {
  display: inline;
}

.jg-media-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
}

.jg-media-title {
  font-size: 0.95rem;
  font-weight: 500;
}

.jg-media-desc {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Progress bar */

.jg-media-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
}

.jg-media-time {
  font-size: 0.75rem;
  opacity: 0.9;
}

.jg-media-scrubber {
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.jg-media-scrubber-track {
  position: relative;
  height: 0.35rem;
  border-radius: 999px;
  background: hsl(220 5% 25%);
  overflow: hidden;
}

.jg-media-scrubber-fill,
.jg-media-scrubber-thumb {
  --jg-media-progress: 0;
}

.jg-media-scrubber-fill {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(var(--jg-media-progress));
  background: linear-gradient(
    90deg,
    hsl(222 84% 56%),
    hsl(262 83% 58%)
  );
}

.jg-media-scrubber-thumb {
  position: absolute;
  top: 50%;
  left: calc(var(--jg-media-progress) * 100%);
  transform: translate(-50%, -50%);
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: hsl(0 0% 100%);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.6);
}

/* Bottom controls */

.jg-media-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
}

.jg-media-controls-left,
.jg-media-controls-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.jg-media-volume input[type="range"] {
  width: 90px;
}

/* Transcript */

.jg-media-transcript {
  margin-top: 1rem;
  border-radius: var(--radius, 0.75rem);
  border: 1px solid hsl(var(--border, 0 0% 89.8%));
  padding: 0.75rem 1rem;
  background: hsl(var(--card, 0 0% 100%));
}

.jg-media-transcript summary {
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
}

.jg-media-transcript-body {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground, 0 0% 45.1%));
}

/* Screen-reader only */

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

/* Responsive */

@media (max-width: 640px) {
  .jg-media-shell {
    padding: 0.75rem;
  }

  .jg-media-top {
    flex-direction: column;
  }

  .jg-media-title {
    font-size: 0.9rem;
  }
}
