/* Payanam AR Viewer — ar.css
 * DOM contract: see docs/AR.md for expected markup structure.
 * Designed to work with Google <model-viewer> and the Go templ renderer.
 */

:root {
  --ar-primary: #1a5632;
  --ar-primary-light: #2d7a4a;
  --ar-accent: #c97b1e;
  --ar-bg: #0f1419;
  --ar-surface: #1c2128;
  --ar-surface-alt: #252d38;
  --ar-text: #e6edf3;
  --ar-text-muted: #8b949e;
  --ar-border: #30363d;
  --ar-radius: 12px;
  --ar-radius-sm: 8px;
  --ar-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --ar-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--ar-font);
  background: var(--ar-bg);
  color: var(--ar-text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Model Viewer Container */
#ar-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#ar-viewer model-viewer {
  width: 100%;
  height: 100%;
  --poster-color: var(--ar-bg);
}

/* AR Button */
#ar-button {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--ar-primary);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--ar-font);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(26, 86, 50, 0.5);
  transition: all 0.2s ease;
  white-space: nowrap;
}

#ar-button:hover {
  background: var(--ar-primary-light);
  transform: translateX(-50%) scale(1.05);
}

#ar-button:active {
  transform: translateX(-50%) scale(0.98);
}

#ar-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Header Bar */
#ar-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(to bottom, rgba(15, 20, 25, 0.95), rgba(15, 20, 25, 0));
}

#ar-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--ar-surface);
  border: 1px solid var(--ar-border);
  border-radius: 50%;
  color: var(--ar-text);
  cursor: pointer;
  flex-shrink: 0;
}

#ar-back-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

#ar-header-info {
  flex: 1;
  min-width: 0;
}

#ar-site-name {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#ar-site-tamil {
  font-size: 12px;
  color: var(--ar-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#ar-era-badge {
  display: inline-block;
  padding: 4px 10px;
  background: var(--ar-accent);
  color: white;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Bottom Sheet */
#ar-bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  max-height: 70vh;
  background: var(--ar-surface);
  border-top-left-radius: var(--ar-radius);
  border-top-right-radius: var(--ar-radius);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
  transform: translateY(calc(100% - 80px));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

#ar-bottom-sheet.expanded {
  transform: translateY(0);
  overflow-y: auto;
}

#ar-sheet-handle {
  display: flex;
  justify-content: center;
  padding: 12px;
  cursor: pointer;
}

#ar-sheet-handle span {
  width: 40px;
  height: 4px;
  background: var(--ar-border);
  border-radius: 2px;
}

#ar-sheet-peek {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 12px;
}

#ar-sheet-title {
  font-size: 18px;
  font-weight: 700;
}

#ar-sheet-subtitle {
  font-size: 13px;
  color: var(--ar-text-muted);
  margin-top: 2px;
}

#ar-expand-hint {
  font-size: 12px;
  color: var(--ar-accent);
  font-weight: 600;
}

/* Tab Navigation */
#ar-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--ar-border);
  padding: 0 20px;
}

.ar-tab {
  flex: 1;
  padding: 12px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--ar-text-muted);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--ar-font);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.ar-tab.active {
  color: var(--ar-accent);
  border-bottom-color: var(--ar-accent);
}

/* Tab Content */
.ar-tab-content {
  display: none;
  padding: 20px;
  max-height: calc(70vh - 200px);
  overflow-y: auto;
}

.ar-tab-content.active {
  display: block;
}

/* Story Tab */
#ar-story-content {
  line-height: 1.7;
  font-size: 14px;
  color: var(--ar-text);
}

#ar-story-content h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 20px 0 8px;
  color: var(--ar-accent);
}

#ar-story-content h2:first-child {
  margin-top: 0;
}

#ar-story-content p {
  margin-bottom: 12px;
}

#ar-story-content h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 16px 0 6px;
  color: var(--ar-text);
}

#ar-story-content ul, #ar-story-content ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

#ar-story-content ul { list-style-type: disc; }
#ar-story-content ol { list-style-type: decimal; }

#ar-story-content li { margin-bottom: 4px; }

#ar-story-content blockquote {
  border-left: 3px solid var(--ar-accent);
  padding: 8px 12px;
  margin: 12px 0;
  font-style: italic;
  color: var(--ar-text-muted);
}

#ar-story-content a {
  color: var(--ar-accent);
  text-decoration: underline;
}

#ar-story-content strong { font-weight: 700; }

/* Timeline Tab */
.ar-timeline {
  list-style: none;
  position: relative;
  padding-left: 24px;
}

.ar-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ar-border);
}

.ar-timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.ar-timeline-item::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 4px;
  width: 12px;
  height: 12px;
  background: var(--ar-primary);
  border: 2px solid var(--ar-primary-light);
  border-radius: 50%;
}

.ar-timeline-year {
  font-size: 13px;
  font-weight: 700;
  color: var(--ar-accent);
  margin-bottom: 2px;
}

.ar-timeline-event {
  font-size: 14px;
  color: var(--ar-text);
  line-height: 1.5;
}

/* Facts Tab */
.ar-facts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ar-fact-card {
  background: var(--ar-surface-alt);
  border: 1px solid var(--ar-border);
  border-radius: var(--ar-radius-sm);
  padding: 14px;
}

.ar-fact-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ar-text-muted);
  margin-bottom: 4px;
}

.ar-fact-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ar-text);
  line-height: 1.4;
}

/* Hotspots */
.ar-hotspot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--ar-primary);
  color: white;
  border: 2px solid white;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s;
}

.ar-hotspot:hover {
  transform: scale(1.15);
  background: var(--ar-accent);
}

.ar-hotspot-tooltip {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ar-surface);
  color: var(--ar-text);
  padding: 8px 14px;
  border-radius: var(--ar-radius-sm);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--ar-shadow);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.ar-hotspot:hover .ar-hotspot-tooltip,
.ar-hotspot:focus .ar-hotspot-tooltip {
  opacity: 1;
}

/* Book CTA */
#ar-book-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 40px);
  margin: 16px 20px;
  padding: 14px;
  background: var(--ar-accent);
  color: white;
  border: none;
  border-radius: var(--ar-radius-sm);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--ar-font);
  cursor: pointer;
  transition: all 0.2s;
}

#ar-book-cta:hover {
  filter: brightness(1.1);
}

#ar-book-cta svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Desktop Fallback — compact card bottom-left on wide screens */
#ar-desktop-fallback {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 300;
  background: var(--ar-surface);
  border: 1px solid var(--ar-border);
  border-radius: var(--ar-radius);
  padding: 16px;
  text-align: center;
  max-width: 200px;
  box-shadow: var(--ar-shadow);
}

#ar-desktop-fallback.visible {
  display: block;
}

#ar-desktop-fallback h3 {
  font-size: 14px;
  margin-bottom: 4px;
}

#ar-desktop-fallback p {
  font-size: 11px;
  color: var(--ar-text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

#ar-qr-container {
  width: 140px;
  height: 140px;
  margin: 0 auto 8px;
  background: white;
  border-radius: var(--ar-radius-sm);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#ar-qr-container canvas,
#ar-qr-container img {
  max-width: 100%;
  max-height: 100%;
}

/* On narrow screens show full-modal centered */
@media (max-width: 479px) {
  #ar-desktop-fallback {
    bottom: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 320px;
    padding: 24px;
  }
  #ar-desktop-fallback h3 { font-size: 18px; margin-bottom: 8px; }
  #ar-desktop-fallback p { font-size: 14px; margin-bottom: 16px; line-height: 1.6; }
  #ar-qr-container { width: 180px; height: 180px; padding: 12px; margin-bottom: 12px; }
}

/* Placeholder notice */
.ar-placeholder-notice {
  display: inline-block;
  padding: 6px 12px;
  background: var(--ar-surface-alt);
  border: 1px solid var(--ar-border);
  border-radius: var(--ar-radius-sm);
  font-size: 11px;
  color: var(--ar-text-muted);
  margin-top: 12px;
}

/* Loading */
#ar-loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  background: var(--ar-bg);
  z-index: 500;
  transition: opacity 0.4s;
}

#ar-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Kolam spinner (components.Spinner): the 3x3 kutti sikku traced continuously.
   ar.css stands alone (the viewer does not load app.css), so the trace CSS is
   repeated here. */
.ar-spinner {
  display: inline-flex;
  width: 44px;
  height: 44px;
  color: var(--ar-primary);
}
.ar-spinner svg { width: 100%; height: 100%; overflow: visible; }
.ar-spinner .kv-kolam-pulli { opacity: 0.6; }
.ar-spinner .kv-kodu-ghost { opacity: 0.2; }
.ar-spinner .kv-kodu { stroke-dasharray: 0.26 0.74; animation: ar-trace 1.6s linear infinite; }
@keyframes ar-trace { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .ar-spinner .kv-kodu { animation: none; stroke-dasharray: none; }
}

#ar-loading-text {
  font-size: 14px;
  color: var(--ar-text-muted);
}

/* Responsive */
@media (min-width: 768px) {
  #ar-bottom-sheet {
    max-width: 480px;
    left: auto;
    right: 20px;
    bottom: 20px;
    border-radius: var(--ar-radius);
    max-height: 60vh;
    transform: translateY(0);
  }

  #ar-bottom-sheet.expanded {
    transform: translateY(0);
  }

  #ar-sheet-handle {
    display: none;
  }

  #ar-expand-hint {
    display: none;
  }

  #ar-button {
    bottom: 40px;
    left: 20px;
    transform: none;
  }

  #ar-button:hover {
    transform: scale(1.05);
  }
}

/* Tamil (<html lang="ta">): Noto Sans Tamil for Tamil glyphs, and let the
   ~30% longer labels wrap instead of clipping. */
:root:lang(ta) {
  --ar-font: 'Inter', 'Noto Sans Tamil', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

:lang(ta) #ar-button {
  white-space: normal;
  text-align: center;
  line-height: 1.3;
  max-width: calc(100vw - 32px);
  width: max-content;
}

:lang(ta) .ar-tab {
  font-size: 13px;
  line-height: 1.3;
  padding: 10px 4px;
}

:lang(ta) #ar-sheet-peek {
  gap: 12px;
}

:lang(ta) #ar-expand-hint {
  text-align: right;
  line-height: 1.3;
}

:lang(ta) #ar-book-cta {
  text-align: center;
  line-height: 1.35;
}

:lang(ta) .ar-hotspot-tooltip {
  white-space: normal;
  width: max-content;
  max-width: 220px;
  line-height: 1.4;
}

:lang(ta) #ar-desktop-fallback {
  max-width: 240px;
}

/* 3D model licence credit (CC-BY / CC-BY-SA require visible attribution) */
#ar-model-credit {
  position: fixed;
  top: calc(max(12px, env(safe-area-inset-top)) + 60px);
  left: 12px;
  right: 12px;
  z-index: 190;
  font-size: 10px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Then & Now (docs/THEN_AND_NOW.md) ─────────────────────────────────
   Era timeline under the model. Mobile: a card above the bottom-sheet peek
   (the AR button moves above it). Desktop: bottom-left, beside the sheet. */
#ar-then-now {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(80px + 10px + env(safe-area-inset-bottom));
  z-index: 140;
  padding: 10px 14px 10px;
  background: rgba(28, 33, 40, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--ar-border);
  border-radius: var(--ar-radius);
  box-shadow: var(--ar-shadow);
}

body.has-eras #ar-button { bottom: calc(80px + 10px + 236px); }

/* Mobile: keep the whole monument above the era card. */
@media (max-width: 767px) {
  body.has-eras #ar-viewer model-viewer { height: calc(100% - 300px); }
}

#ar-tn-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-height: 22px;
}

.ar-tn-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ar-accent);
}

#ar-tn-year {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

#ar-tn-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ar-text);
}

#ar-tn-progress {
  font-size: 11px;
  color: var(--ar-text-muted);
  padding: 1px 8px;
  border: 1px solid var(--ar-border);
  border-radius: 999px;
}

#ar-tn-compare-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font: 600 12px var(--ar-font);
  color: var(--ar-text);
  background: var(--ar-surface-alt);
  border: 1px solid var(--ar-border);
  border-radius: 999px;
  cursor: pointer;
}

#ar-tn-compare-btn svg { width: 14px; height: 14px; fill: currentColor; }

#ar-tn-compare-btn.ar-tn-has-photo {
  background: var(--ar-accent);
  border-color: var(--ar-accent);
  color: #fff;
}

#ar-tn-slider {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 28px;
  margin: 4px 0 0;
  background: transparent;
  cursor: pointer;
}

#ar-tn-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--ar-accent), var(--ar-primary-light));
}

#ar-tn-slider::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--ar-accent), var(--ar-primary-light));
}

#ar-tn-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -9px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--ar-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

#ar-tn-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--ar-accent);
}

#ar-tn-ticks {
  list-style: none;
  display: flex;
  justify-content: space-between;
  margin: -2px -6px 0;
}

#ar-tn-ticks li { flex: 1 1 0; display: flex; justify-content: center; min-width: 0; }
#ar-tn-ticks li:first-child { justify-content: flex-start; }
#ar-tn-ticks li:last-child { justify-content: flex-end; }

.ar-tn-tick {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  font: 600 11px var(--ar-font);
  font-variant-numeric: tabular-nums;
  color: var(--ar-text-muted);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.ar-tn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ar-border);
}

.ar-tn-tick.past .ar-tn-dot { background: var(--ar-accent); }
.ar-tn-tick.active { color: #fff; background: rgba(201, 123, 30, 0.25); }
.ar-tn-tick.active .ar-tn-dot { background: #fff; }
.ar-tn-photo-mark { color: var(--ar-accent); font-size: 10px; }

#ar-tn-desc {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ar-text);
  min-height: 2.9em;
}

#ar-tn-ghost-hint {
  margin-top: 4px;
  font-size: 10px;
  color: var(--ar-text-muted);
}

/* Older eras: sepia "albumen print" tint + vignette over the 3D view. */
#ar-viewer model-viewer { transition: filter 0.5s ease; }
#ar-viewer.ar-era-historic model-viewer { filter: sepia(0.55) saturate(0.85) contrast(0.95); }
#ar-viewer::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(60, 40, 15, 0.45) 100%);
}
#ar-viewer.ar-era-historic::after { opacity: 1; }

/* Then / Now photo comparison dialog */
#ar-compare {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 8, 12, 0.82);
}

#ar-compare[hidden] { display: none; }

.ar-compare-card {
  width: min(920px, 100%);
  max-height: 100%;
  overflow: auto;
  background: var(--ar-surface);
  border: 1px solid var(--ar-border);
  border-radius: var(--ar-radius);
  box-shadow: var(--ar-shadow);
  padding: 12px;
}

.ar-compare-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#ar-compare-title { display: block; font-size: 16px; }
#ar-compare-sub { font-size: 12px; color: var(--ar-text-muted); }

#ar-compare-close {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--ar-text);
  background: var(--ar-surface-alt);
  border: 1px solid var(--ar-border);
  border-radius: 50%;
  cursor: pointer;
}

#ar-compare-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 68vh;
  overflow: hidden;
  border-radius: var(--ar-radius-sm);
  background: #0b0d10;
  user-select: none;
  touch-action: none;
}

#ar-compare-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Historic prints and modern photos rarely share an aspect ratio: show
     both whole rather than cropping the monument out of one of them. */
  object-fit: contain;
  pointer-events: none;
}

#ar-compare-then-wrap {
  position: absolute;
  inset: 0;
  background: #0b0d10; /* hide the Now photo behind letterboxed Then prints */
  clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
}

#ar-compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos, 50%);
  width: 3px;
  margin-left: -1.5px;
  background: #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

#ar-compare-divider span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

#ar-compare-divider span::before,
#ar-compare-divider span::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  transform: translateY(-50%);
}
#ar-compare-divider span::before { left: 5px; border-right-color: var(--ar-accent); }
#ar-compare-divider span::after { right: 5px; border-left-color: var(--ar-accent); }

#ar-compare-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
}
#ar-compare-range::-webkit-slider-thumb { -webkit-appearance: none; width: 44px; height: 100vh; }

.ar-compare-tag {
  position: absolute;
  top: 10px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 999px;
  pointer-events: none;
}
.ar-compare-tag-then { left: 10px; background: rgba(120, 80, 30, 0.85); }
.ar-compare-tag-now { right: 10px; background: rgba(26, 86, 50, 0.85); }

.ar-compare-hint { margin-top: 6px; font-size: 11px; color: var(--ar-text-muted); text-align: center; }

#ar-compare-credits {
  margin-top: 6px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ar-text-muted);
}
#ar-compare-credits a { color: var(--ar-text-muted); }
.ar-compare-credit-label { font-weight: 700; margin-right: 4px; }

@media (min-width: 768px) {
  #ar-then-now {
    left: 20px;
    right: auto;
    bottom: 20px;
    width: min(560px, calc(100vw - 540px));
    min-width: 320px;
  }
  body.has-eras #ar-button { bottom: auto; top: 96px; left: 20px; }
  body.has-eras #ar-desktop-fallback { bottom: auto; top: 150px; }
}

:lang(ta) #ar-tn-label { font-size: 13px; }
:lang(ta) #ar-tn-desc { font-size: 12.5px; line-height: 1.6; }
:lang(ta) #ar-tn-compare-btn { font-size: 11px; }
