/* =====================================================
   animal.css — Vibrant Nature wildlife encyclopedia
   ===================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --zp-green:        #22c55e;
  --zp-green-dark:   #15803d;
  --zp-teal:         #0d9488;
  --zp-amber:        #d97706;
  --zp-rose:         #e11d48;
  --zp-gradient:     linear-gradient(135deg, #22c55e 0%, #0d9488 100%);
  --zp-ink:          #0f172a;
  --zp-ink-soft:     #3f4a56;
  --zp-muted:        #8a97a3;
  --zp-surface:      #ffffff;
  --zp-surface-soft: #f3faf6;
  --zp-border:       #e3ede7;
  --zp-shadow-sm:    0 2px 10px rgba(15, 23, 42, .06);
  --zp-shadow-md:    0 12px 30px rgba(15, 23, 42, .12);
  --zp-shadow-glow:  0 8px 22px rgba(34, 197, 94, .32);
}

.ad-page {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  background: #f5f5f7;
  height: 100vh;
  overflow: hidden;
  color: var(--zp-ink);
}

.ad-not-found {
  padding: 80px 40px;
  text-align: center;
  color: #999;
  font-size: 18px;
}

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

/* ══════════════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════════════ */

.ad-layout {
  display: flex;
  height: 100vh;
  align-items: flex-start;
  overflow: hidden;
}

/* ── LEFT ── */

.ad-left {
  flex: 0 0 50%;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.ad-img-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

.ad-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ad-img-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.06) 40%, transparent 65%),
    linear-gradient(0deg, rgba(13,148,136,0.16) 0%, transparent 30%);
  pointer-events: none;
}

.ad-back {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15,23,42,0.45);
  color: rgba(255,255,255,0.92) !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(10px) saturate(160%);
  transition: background 0.25s, box-shadow 0.25s, border-color 0.25s, transform 0.2s;
}

.ad-back:hover {
  background: var(--zp-gradient);
  border-color: transparent;
  box-shadow: var(--zp-shadow-glow);
  color: #fff !important;
  transform: translateY(-1px);
}

.ad-photo-text {
  position: absolute;
  bottom: 32px;
  left: 28px;
  right: 28px;
  z-index: 10;
}

.ad-hname {
  margin: 0 0 6px;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -1px;
  color: #fff;
  line-height: 1.05;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.ad-hsci {
  margin: 0;
  font-style: italic;
  font-size: 15px;
  color: rgba(255,255,255,0.75);
  font-weight: 400;
}

/* ── RIGHT ── */

.ad-right {
  flex: 1;
  background:
    radial-gradient(900px circle at 105% -10%, rgba(34,197,94,0.09) 0%, transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #fbfefc 100%);
  padding: 52px 48px 80px;
  overflow-y: auto;
  height: 100vh;
}

.ad-right-inner {
  max-width: 100%;
}

/* ══════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════ */

.ad-header {
  margin-bottom: 40px;
  animation: zpFadeInUp .5s ease both;
}

.ad-name {
  margin: 0 0 8px;
  font-size: 50px;
  font-weight: 800;
  color: var(--zp-ink);
  line-height: 1.05;
  letter-spacing: -0.5px;
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .ad-name {
    background: var(--zp-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

.ad-scientific {
  margin: 0 0 32px;
  font-size: 17px;
  font-style: italic;
  color: var(--zp-teal);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ── META STRIP ── */

.ad-meta-strip {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--zp-border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--zp-surface);
  box-shadow: var(--zp-shadow-sm);
}

.ad-meta-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px;
  transition: background 0.2s;
}

.ad-meta-col:hover {
  background: var(--zp-surface-soft);
}

.ad-meta-sep {
  width: 1px;
  background: var(--zp-border);
  flex-shrink: 0;
}

.ad-meta-icon {
  width: 36px;
  height: 36px;
  padding: 8px;
  box-sizing: border-box;
  border-radius: 50%;
  stroke: var(--zp-green-dark);
  background: rgba(34,197,94,.12);
  flex-shrink: 0;
}

.ad-meta-col:nth-child(3) .ad-meta-icon { stroke: var(--zp-teal);  background: rgba(13,148,136,.12); }
.ad-meta-col:nth-child(5) .ad-meta-icon { stroke: var(--zp-amber); background: rgba(217,119,6,.12); }
.ad-meta-col:nth-child(7) .ad-meta-icon { stroke: var(--zp-rose);  background: rgba(225,29,72,.12); }

.ad-meta-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--zp-muted);
  text-transform: uppercase;
}

.ad-meta-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--zp-ink);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ad-iucn-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid;
  line-height: 1.4;
}

.ad-iucn-pill--lg {
  font-size: 18px;
  padding: 8px 18px;
  border-radius: 10px;
  box-shadow: 0 0 0 6px rgba(15,23,42,.03);
}

/* ══════════════════════════════════════════════════
   CARD
══════════════════════════════════════════════════ */

.ad-card {
  display: block;
  background: var(--zp-surface);
  border: 1px solid var(--zp-border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--zp-shadow-md);
  animation: zpFadeInUp .55s ease .08s both;
}

/* ══════════════════════════════════════════════════
   TABS
══════════════════════════════════════════════════ */

.ad-tabs {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 10px;
  background: var(--zp-surface-soft);
  border-bottom: 1px solid var(--zp-border);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.ad-tabs::-webkit-scrollbar { display: none; }

.ad-tab-indicator {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 10px;
  width: 0;
  border-radius: 14px;
  background: var(--zp-gradient);
  box-shadow: var(--zp-shadow-glow);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: left .32s cubic-bezier(.65,0,.35,1), width .32s cubic-bezier(.65,0,.35,1), opacity .2s;
}

.ad-tab-indicator.is-ready { opacity: 1; }

.ad-tab {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 10px;
  background: none;
  border: none;
  border-radius: 14px;
  margin: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--zp-muted);
  cursor: pointer;
  white-space: normal;
  transition: color 0.25s;
}

.ad-tab svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
  flex-shrink: 0;
  transition: transform 0.25s;
}

.ad-tab:hover {
  color: var(--zp-green-dark);
}

.ad-tab:hover svg {
  transform: translateY(-1px);
}

.ad-tab.active {
  color: #fff;
}

/* ══════════════════════════════════════════════════
   PANELS
══════════════════════════════════════════════════ */

.ad-panel { display: none; }

.ad-panel.active {
  display: block;
  animation: fadeUp 0.2s ease;
}

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

/* ── OVERVIEW ── */

.ad-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
}

.ad-overview-left {
  padding: 36px 32px;
  border-right: 1px solid var(--zp-border);
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.ad-overview-right {
  position: relative;
  padding: 36px 32px;
  overflow: hidden;
}

.ad-overview-right::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(34,197,94,.10), transparent 70%);
  pointer-events: none;
}

/* ── SECTIONS ── */

.ad-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ad-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--zp-ink-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}

.ad-section-title::before {
  content: '';
  width: 4px;
  height: 16px;
  border-radius: 4px;
  background: var(--zp-gradient);
  flex-shrink: 0;
}

.ad-body-text {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--zp-ink-soft);
  line-height: 1.75;
}

/* ── FUN FACTS ── */

.ad-funfacts {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ad-funfacts li {
  position: relative;
  padding-left: 30px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--zp-ink-soft);
  line-height: 1.6;
}

.ad-funfacts li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") no-repeat center / 11px 11px,
    var(--zp-gradient);
  box-shadow: 0 2px 8px rgba(34,197,94,.35);
}

/* ── QUICK INFO LIST ── */

.ad-qlist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ad-qrow {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--zp-border);
  border-radius: 14px;
  background: var(--zp-surface-soft);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.ad-qrow:hover {
  transform: translateY(-3px);
  box-shadow: var(--zp-shadow-md);
  border-color: rgba(34,197,94,.35);
}

.ad-qrow-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--zp-gradient);
}

.ad-qrow-icon svg {
  width: 15px;
  height: 15px;
  stroke: #fff;
  stroke-width: 2.5;
  flex-shrink: 0;
}

.ad-qrow:nth-child(4n+2) .ad-qrow-icon { background: linear-gradient(135deg, #0d9488, #0891b2); }
.ad-qrow:nth-child(4n+3) .ad-qrow-icon { background: linear-gradient(135deg, #d97706, #f59e0b); }
.ad-qrow:nth-child(4n+4) .ad-qrow-icon { background: linear-gradient(135deg, #e11d48, #f43f5e); }

.ad-qrow-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--zp-muted);
}

.ad-qrow-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--zp-ink);
  line-height: 1.3;
}

/* ── OTHER TAB CONTENT ── */

.ad-tab-content {
  padding: 36px 36px;
}

/* ── DEFINITION LIST ── */

.ad-dlist {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.ad-trow {
  position: relative;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  padding: 14px 0 14px 18px;
  border-bottom: 1px solid var(--zp-border);
  align-items: baseline;
  border-radius: 8px;
  transition: background 0.15s;
}

.ad-trow::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 3px;
  background: var(--zp-gradient);
  opacity: 0.55;
}

.ad-trow:hover {
  background: var(--zp-surface-soft);
}

.ad-trow:last-child { border-bottom: none; }

.ad-trow-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--zp-ink-soft);
}

.ad-trow-value {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--zp-ink-soft);
  line-height: 1.6;
  margin: 0;
}

.ad-dlist--mt {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--zp-border);
}

/* ── SIZE METRICS ── */

.ad-size-metrics {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.ad-size-metric {
  position: relative;
  flex: 1;
  min-width: 140px;
  background: linear-gradient(160deg, #f0fdf4 0%, #ecfeff 100%);
  border: 1px solid rgba(34,197,94,.22);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s;
}

.ad-size-metric::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--zp-gradient);
}

.ad-size-metric:hover {
  transform: translateY(-3px);
  box-shadow: var(--zp-shadow-md);
}

.ad-size-val {
  font-size: 24px;
  font-weight: 900;
  color: var(--zp-green-dark);
  line-height: 1.2;
  margin-bottom: 6px;
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .ad-size-val {
    background: var(--zp-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

.ad-size-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--zp-ink-soft);
}

/* ── IUCN BLOCK ── */

.ad-iucn-block {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #fafafa 0%, #f3faf6 100%);
  border: 1px solid var(--zp-border);
  border-radius: 16px;
  margin-bottom: 28px;
  box-shadow: var(--zp-shadow-sm);
}

.ad-iucn-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--zp-ink);
}

.ad-iucn-sub {
  font-size: 12px;
  color: var(--zp-muted);
  margin-top: 2px;
}

/* ══════════════════════════════════════════════════
   PREDATORS GRID
══════════════════════════════════════════════════ */

.ad-predators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  padding: 36px;
}

/* ══════════════════════════════════════════════════
   OTHER ANIMALS
══════════════════════════════════════════════════ */

.ad-others {
  margin-top: 40px;
}

.ad-others-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--zp-ink);
  margin: 0 0 16px;
  letter-spacing: -0.2px;
}

.ad-others-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin: 0 -48px;
  padding-left: 48px;
  padding-right: 48px;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}

.ad-others-grid::-webkit-scrollbar { height: 4px; }
.ad-others-grid::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.ad-other-card {
  flex: 0 0 180px;
  height: 240px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: #111;
  box-shadow: var(--zp-shadow-sm);
  transition: transform 0.22s, box-shadow 0.22s;
}

.ad-other-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 32px rgba(15,23,42,.20), 0 0 0 3px rgba(34,197,94,.35);
}

.ad-other-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  transition: transform 0.3s;
}

.ad-other-card:hover img { transform: scale(1.06); }

.ad-other-iucn {
  display: none;
}

.ad-other-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 12px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.74) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ad-other-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.ad-other-sci {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  font-style: italic;
}

/* ══════════════════════════════════════════════════
   LOCAL ZOOS
══════════════════════════════════════════════════ */

.ad-local-zoos {
  margin-top: 40px;
}

.ad-local-zoos-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--zp-ink);
  letter-spacing: -0.5px;
  margin: 0 0 20px;
}

.ad-local-zoos-title a {
  color: var(--zp-ink);
  text-decoration: none;
  transition: color 0.2s, opacity 0.2s;
}

.ad-local-zoos-title a:hover {
  color: var(--zp-green-dark);
  opacity: 0.85;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.ad-zoo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ad-zoo-card {
  display: flex;
  align-items: stretch;
  border-radius: 18px;
  overflow: hidden;
  background: var(--zp-surface);
  border: 1px solid var(--zp-border);
  text-decoration: none;
  height: 90px;
  box-shadow: var(--zp-shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.ad-zoo-card:hover {
  box-shadow: var(--zp-shadow-md);
  transform: translateY(-3px);
  border-color: rgba(34,197,94,.35);
}

.ad-zoo-img {
  width: 90px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.ad-zoo-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 10px 14px;
  min-width: 0;
}

.ad-zoo-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--zp-ink);
  line-height: 1.3;
  white-space: nowrap;
}

.ad-zoo-location {
  font-size: 11px;
  color: var(--zp-muted);
  font-weight: 500;
}

.ad-zoo-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--zp-ink-soft);
  margin-top: 2px;
}

/* Google Maps Platform required attribution — shared .gmaps-list-attribution styles live in global.css. */
.ad-local-zoos .gmaps-list-attribution {
  margin: 0 0 14px;
}

.ad-zoo-review-count {
  font-weight: 400;
  color: var(--zp-muted);
  font-size: 11px;
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════ */

@media (max-width: 1100px) {
  .ad-right { padding: 44px 36px 60px; }
  .ad-name { font-size: 38px; }
  .ad-others-grid { margin: 0 -36px; padding-left: 36px; padding-right: 36px; }
}

@media (max-width: 900px) {
  /* Let the page scroll naturally — no clipped viewport lock */
  .ad-page { height: auto; overflow-x: hidden; overflow-y: visible; }
  .ad-layout { flex-direction: column; height: auto; overflow: visible; align-items: stretch; }

  .ad-left {
    position: relative;
    flex: none;
    width: 100%;
    height: 300px;
  }

  /* Right panel scrolls with the page, not independently */
  .ad-right {
    width: 100%;
    height: auto;
    overflow-y: visible;
    padding: 36px 20px 60px;
    min-height: auto;
  }

  .ad-name { font-size: 32px; }

  .ad-meta-strip { flex-wrap: wrap; }
  .ad-meta-col { flex: 1 1 calc(50% - 1px); min-width: 0; }
  .ad-meta-sep:nth-child(4) { display: none; }

  .ad-overview { grid-template-columns: 1fr; }
  .ad-overview-left { border-right: none; border-bottom: 1px solid var(--zp-border); }

  .ad-others-grid { margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 600px) {
  .ad-left { height: 55vw; min-height: 220px; max-height: 320px; }

  .ad-back { font-size: 12px; padding: 8px 13px; top: 16px; left: 16px; }

  .ad-right { padding: 20px 16px 60px; }

  .ad-header { margin-bottom: 24px; }
  .ad-name { font-size: 24px; letter-spacing: -0.5px; }
  .ad-scientific { font-size: 13px; margin-bottom: 20px; }

  /* Meta strip: 2-column grid */
  .ad-meta-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--zp-border);
    border-radius: 14px;
    overflow: hidden;
  }
  .ad-meta-col {
    flex: unset;
    background: #fff;
    padding: 14px 14px;
    gap: 6px;
  }
  .ad-meta-sep { display: none; }
  .ad-meta-icon { width: 30px; height: 30px; padding: 6px; }
  .ad-meta-label { font-size: 9px; }
  .ad-meta-value { font-size: 12px; }
  .ad-iucn-pill { font-size: 10px; padding: 2px 7px; }

  /* Card */
  .ad-card { border-radius: 16px; }

  /* Tabs: icon-only for inactive, icon+label for active pill */
  .ad-tab {
    flex: 1;
    padding: 12px 2px;
    font-size: 0;       /* collapse text on inactive tabs */
    gap: 0;
    min-width: 0;
  }
  .ad-tab svg {
    display: block;
    width: 20px;
    height: 20px;
  }
  .ad-tab.active {
    font-size: 9px;
    gap: 5px;
    flex: 1.8;          /* active tab gets a little more width for the label */
  }

  /* Overview panels */
  .ad-overview-left, .ad-overview-right { padding: 20px 16px; }
  .ad-section-title { font-size: 11px; }
  .ad-body-text { font-size: 13px; }

  /* Quick info */
  .ad-qlist { gap: 8px; }
  .ad-qrow { padding: 12px; gap: 8px; }
  .ad-qrow-icon { width: 28px; height: 28px; }
  .ad-qrow-icon svg { width: 13px; height: 13px; }
  .ad-qrow-label { font-size: 9.5px; }
  .ad-qrow-value { font-size: 14px; }

  /* Tab panels */
  .ad-tab-content { padding: 20px 16px; }
  .ad-trow { grid-template-columns: 1fr; gap: 4px; padding: 11px 0 11px 14px; }
  .ad-trow-label { font-size: 10px; }
  .ad-trow-value { font-size: 13px; }

  /* Size metrics: stack 1 per row on very small screens */
  .ad-size-metrics { gap: 10px; }
  .ad-size-metric { min-width: 0; padding: 16px 14px; }
  .ad-size-val { font-size: 18px; }

  /* IUCN block */
  .ad-iucn-block { padding: 14px 16px; gap: 12px; }
  .ad-iucn-pill--lg { font-size: 14px; padding: 6px 12px; }
  .ad-iucn-name { font-size: 14px; }

  /* Predators grid */
  .ad-predators-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    padding: 16px;
  }
  .ad-other-card { height: 160px; }

  /* Zoo grid */
  .ad-zoo-grid { gap: 10px; }
  .ad-zoo-card { height: 80px; }
  .ad-zoo-img { width: 80px; }
  .ad-zoo-name { font-size: 12px; }
  .ad-zoo-location { font-size: 10px; }

  /* Others scroll strip */
  .ad-others-grid { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .ad-other-card { flex: 0 0 140px; height: 185px; }

  /* Local zoos section */
  .ad-local-zoos { margin-top: 28px; }
  .ad-local-zoos-title { font-size: 20px; margin-bottom: 14px; }

  /* Rounded pull-up overlap over photo */
  .ad-right {
    margin-top: -24px;
    border-radius: 24px 24px 0 0;
    position: relative;
    z-index: 2;
  }
  .ad-left { z-index: 1; }

  /* Back button: icon only on mobile */
  .ad-back-text { display: none; }
  .ad-back { padding: 9px 11px; gap: 0; }
}
