/* ============================================================
   AD DETAIL MODAL — Modern Sheet Layout
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- Overlay --- */
#ad-detail-modal {
  --ad-modal-sheet-height: min(88vh, 920px);
  --ad-modal-backdrop-hover-shift: 16px;
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  /* Blur applied after open (see .ad-modal--blur-ready) so we don't
     sample a tall live ads feed during the slide-up frame. */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
#ad-detail-modal.open {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
#ad-detail-modal.open.ad-modal--blur-ready {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    backdrop-filter 0.18s ease-out,
    -webkit-backdrop-filter 0.18s ease-out;
}

/* Dismiss hint — shown when hovering the backdrop (outside the sheet) */
.ad-modal-dismiss-hint {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(var(--ad-modal-sheet-height) + 18px);
  z-index: 2;
  margin: 0;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
#ad-detail-modal.open .ad-modal-dismiss-hint {
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-12px);
  transition:
    opacity 0.2s ease,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.2s;
}
#ad-detail-modal.open.ad-modal--backdrop-hover .ad-modal-dismiss-hint {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(var(--ad-modal-backdrop-hover-shift));
}
#ad-detail-modal.open.ad-modal--closing .ad-modal-dismiss-hint {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-8px);
  transition:
    opacity 0.12s ease-out,
    transform 0.18s ease-out,
    visibility 0.12s ease-out;
}
.ad-modal-dismiss-hint kbd {
  display: inline-block;
  margin-right: 2px;
  padding: 1px 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

#ad-detail-modal.open.ad-modal--closing {
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  pointer-events: none;
}

/* --- Sheet Container (bottom sheet) --- */
.ad-modal-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: min(1840px, 100vw);
  height: var(--ad-modal-sheet-height);
  min-height: var(--ad-modal-sheet-height);
  max-height: var(--ad-modal-sheet-height);
  margin: 0 auto;
  margin-bottom: 0;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  will-change: transform, margin-bottom;
  transform: translateY(100%);
  transition:
    transform 0.34s cubic-bezier(0.32, 0.72, 0, 1),
    margin-bottom 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

#ad-detail-modal.open.ad-modal--closing .ad-modal-sheet {
  animation: none;
  margin-bottom: 0;
  transform: translateY(100%);
}

/* Backdrop hover — push sheet down (margin avoids fighting open/close transform) */
#ad-detail-modal.open.ad-modal--backdrop-hover:not(.ad-modal--closing) .ad-modal-sheet {
  margin-bottom: calc(-1 * var(--ad-modal-backdrop-hover-shift));
}

.ad-modal-inner {
  display: flex;
  flex-direction: row;
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

/* ============================================================
   LEFT PANEL — Media + Ad Card
   ============================================================ */
.ad-modal-left {
  flex: 1;
  min-width: 400px;
  min-height: 0;
  max-height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  border-bottom-left-radius: 0;
  overflow: hidden;
}

.ad-modal-left-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  padding: 24px;
  display: flex;
  flex-direction: column;
  /* flex-start so overflow scrolls from the top; card uses margin auto to center when shorter */
  justify-content: flex-start;
  align-items: center;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* --- Floating Action Buttons (vertical icon row: Share · Copy · Download · Open link) --- */
.ad-modal-floating-actions-wrap {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: auto;
  max-width: calc(100% - 32px);
  overflow: visible;
}
.ad-modal-floating-actions {
  position: relative;
  top: auto;
  right: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: fit-content;
  background: #fff;
  padding: 6px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08);
  overflow: visible;
}
.ad-modal-floating-actions .ad-modal-copy-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
.ad-modal-ask-claude-btn.wh-btn-primary {
  --wh-primary-bg: #cc785c;
  --wh-primary-hover: #b86a50;
  --wh-primary-shadow: inset 0 1px 1px 0 hsla(0, 0%, 100%, .2), inset 0 6px 12px 0 hsla(0, 0%, 100%, .12), 0 1px 2px 0 rgba(8, 8, 8, .2), 0 4px 4px 0 rgba(8, 8, 8, .08);
  flex-shrink: 0;
  width: auto;
  min-width: 0;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 10px;
  white-space: nowrap;
  border: 1px solid transparent;
  background: var(--wh-primary-bg);
  background-color: var(--wh-primary-bg);
  box-shadow: var(--wh-primary-shadow);
  transition: background 0.3s ease, transform 0.12s ease, color 0.15s ease, box-shadow 0.12s ease;
}
.ad-modal-ask-claude-btn.wh-btn-primary:hover {
  background: var(--wh-primary-hover);
  background-color: var(--wh-primary-hover);
  color: #fff;
}
.ad-modal-ask-claude-btn.wh-btn-primary:active {
  transform: translateY(1px);
}
.ad-modal-ask-claude-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.ad-modal-ask-claude-icon svg {
  width: 16px;
  height: 16px;
}
.ad-float-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #52525b;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.ad-float-icon-btn:hover {
  background: #f4f4f5;
  color: #0a0a0a;
}
.ad-float-icon-btn:active {
  background: #e4e4e7;
}
.ad-float-icon-btn.is-downloading {
  opacity: 0.55;
  cursor: progress;
}
.ad-float-icon-btn.is-downloading svg {
  animation: ad-modal-dl-bounce 0.9s ease-in-out infinite;
}
@keyframes ad-modal-dl-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(2px); }
}
.ad-float-icon-btn svg {
  width: 18px;
  height: 18px;
}
/*
 * Float-action tooltips must win over global [data-tooltip] rules
 * (e.g. brand-details.css on Sales Tracker) which add a second ::before
 * tooltip and leave left/bottom set — causing double / clipped "Download".
 */
.ad-float-icon-btn[data-tooltip]::before {
  content: none !important;
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 0 !important;
  height: 0 !important;
  max-width: 0 !important;
  box-shadow: none !important;
  background: none !important;
}
.ad-float-icon-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  bottom: auto;
  left: auto;
  right: calc(100% + 8px);
  transform: translateY(-50%) translateX(-4px);
  background: #1a1a1a;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  border: none;
  margin: 0;
  width: auto;
  max-width: none;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  line-height: 1.25;
  box-shadow: none;
  visibility: visible;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 2000;
}
.ad-float-icon-btn[data-tooltip]:hover::after {
  visibility: visible;
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.ad-modal-copy-wrap {
  position: relative;
}
.ad-modal-copy-menu {
  position: absolute;
  right: calc(100% + 8px);
  top: 0;
  z-index: 2001;
  min-width: 168px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e4e4e7;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}
.ad-modal-copy-option {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #18181b;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.ad-modal-copy-option:hover:not(:disabled) {
  background: #f4f4f5;
  color: #0a0a0a;
}
.ad-modal-copy-option:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.ad-modal-copy-option.is-copied {
  color: #15803d;
}
.ad-modal-copy-wrap .ad-float-icon-btn.is-open[data-tooltip]::after {
  opacity: 0;
}
.text-subdued {
  color: #6b6b74;
  font-weight: 400;
}
.text-mono {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-weight: 500;
  color: #1a1a1a;
}

/* ============================================================
   AD CARD — Mirrors Feed Card Layout
   ============================================================ */
.ad-modal-ad-card {
  flex-shrink: 0;
  max-width: 340px;
  width: min(100%, 340px);
  margin: auto 0;
  padding-bottom: 24px;
  z-index: 10;
  background: #fff;
  border: 1px solid #f2f2f2;
  border-radius: 15px;
  overflow: hidden;
  cursor: grab;
  will-change: transform;
}
.ad-modal-ad-card.is-dragging {
  cursor: grabbing;
  user-select: none;
}
.ad-modal-ad-card a,
.ad-modal-ad-card button,
.ad-modal-ad-card video {
  user-select: auto;
}

/* Top badges row */
.adm-badges-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px 0;
}
.adm-badges-right {
  display: flex;
  gap: 6px;
  align-items: center;
  height: 25px;
}
.adm-days-badge {
  background: #fafafa;
  color: #171717;
  border: 1px solid #e5e5e5;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  height: 100%;
}
.adm-score-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  height: 100%;
}
.adm-score-badge[data-score="winning"],
.adm-score-badge[data-score="established"] {
  background: #dcfce7;
  color: #15803d;
}
.adm-score-badge[data-score="scaling"],
.adm-score-badge[data-score="has-potential"] {
  background: #dbeafe;
  color: #1d4ed8;
}
.adm-score-badge[data-score="testing"],
.adm-score-badge[data-score="unestablished"] {
  background: #fef9c3;
  color: #a16207;
}
.adm-score-badge[data-score="to-be-determined"] {
  background: #f4f4f5;
  color: #71717a;
}

/* Adsets + EU stats row */
.adm-adsets-row {
  display: block;
  padding: 0 10px;
}
.adm-adsets-text {
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
  padding-top: 2px;
}
.adm-adsets-text > div + div {
  margin-top: 3px;
}
.adm-adsets-text .currentamountofadsets {
  font-size: 15px;
  font-weight: 700;
}
.adm-eu-stats {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 20px;
  padding-left: 0;
  font-size: 12px;
  font-weight: 600;
  color: #6b6b74;
  margin-top: 2px;
}

/* Page info row */
.adm-page-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid #f2f2f2;
  border-bottom: 1px solid #f2f2f2;
  cursor: pointer;
  text-decoration: none;
  gap: 4px;
  transition: background 0.15s;
}
.adm-page-row:hover {
  background: #fafafa;
}
.adm-page-row.adm-page-row--static {
  cursor: default;
}
.adm-page-row.adm-page-row--static:hover {
  background: transparent;
}
.adm-page-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e9eaeb;
  flex-shrink: 0;
  margin-right: 4px;
}
.adm-page-avatar--initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
  font-size: 13px;
  font-weight: 700;
  color: #4338ca;
  line-height: 1;
  box-sizing: border-box;
}
.adm-page-meta {
  flex: 1;
  min-width: 0;
}
.adm-page-name {
  font-size: 11px;
  font-weight: 700;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-page-sub {
  font-size: 10px;
  color: #374151;
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.adm-page-sub img {
  height: 11px;
  width: 11px;
  vertical-align: middle;
  pointer-events: none;
}
.adm-page-chevron {
  color: currentColor;
  flex-shrink: 0;
  margin-left: auto;
}

/* Primary copy */
.adm-copy-section {
  padding: 0;
}
.ad-modal-ad-card .primary-copy.fw-ad-card-ad-copy {
  padding: 0 12px;
}
.ad-modal-ad-card .primary-copy-cutoff {
  position: relative;
  overflow: hidden;
  padding-bottom: 0;
  font-size: 13px;
  --primary-copy-line-height: 16px;
  line-height: var(--primary-copy-line-height);
  white-space: wrap;
}
.ad-modal-ad-card .primary-copy-cutoff::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24px;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.9) 24%,
    rgba(255, 255, 255, 0.62) 50%,
    rgba(255, 255, 255, 0.22) 76%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
}
.ad-modal-ad-card .primary-copy-cutoff p {
  margin: 0;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  min-height: calc(var(--primary-copy-line-height) * 2);
  overflow: hidden;
}
.ad-modal-ad-card .primary-copy-read-full-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  display: flex;
  justify-content: center;
  z-index: 2;
  pointer-events: auto;
}
.ad-modal-ad-card .primary-copy-read-full-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  background: #fff;
  color: #111827;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.ad-modal-ad-card .primary-copy-read-full-pill:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #111827;
}
.ad-modal-ad-card .primary-copy-cutoff.no-read-full::after {
  display: none;
}
.ad-modal-ad-card .primary-copy-cutoff.no-read-full .primary-copy-read-full-wrap {
  display: none;
}
.ad-modal-ad-card .primary-copy-cutoff.is-expanded::after {
  display: none;
}
.ad-modal-ad-card .primary-copy-cutoff.is-expanded .primary-copy-read-full-wrap {
  display: none;
}
.ad-modal-ad-card .primary-copy-cutoff.is-expanded p {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  min-height: 0;
  overflow: visible;
}
.adm-copy-text {
  padding: 6px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #1a1a1a;
  max-height: 80px;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}
.adm-copy-text.expanded {
  max-height: none;
}
.adm-copy-read-full-wrap {
  text-align: center;
  padding: 0 12px 4px;
}
.adm-copy-read-full {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: #71717a;
  background: #f4f4f5;
  padding: 2px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.adm-copy-read-full:hover {
  background: #e5e5e5;
  color: #1a1a1a;
}

/* Divider */
.adm-divider {
  width: 92%;
  margin: 0 auto;
  border: none;
  border-top: 1px solid #f2f2f2;
}

/* Media */
.adm-media-wrap {
  position: relative;
}
.adm-media {
  position: relative;
  width: 100%;
  background: #000;
  min-height: 180px;
  max-height: 500px;
  overflow: hidden;
}
.adm-media img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
}
.adm-media video {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  display: block;
}

/* Facebook CTA bar */
.adm-cta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-top: 1px solid #f2f2f2;
  border-bottom: 1px solid #f2f2f2;
}
.adm-cta-left {
  max-width: 70%;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.adm-cta-domain {
  font-size: 8px;
  color: #606770;
  line-height: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-cta-caption {
  font-size: 10px;
  font-weight: 500;
  color: #1c1e21;
  line-height: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.adm-cta-desc {
  font-size: 9px;
  color: #606770;
  line-height: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.adm-cta-right {
  flex-shrink: 0;
}
.adm-cta-button {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
  background: #f4f4f5;
  transition: background 0.15s;
  white-space: nowrap;
}
.adm-cta-button:hover {
  background: #e5e5e5;
}

/* Product info row */
.adm-product-row {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  gap: 4px;
  background: #fff;
  cursor: pointer;
}
.adm-product-row:hover {
  background: #fafafa;
}
.adm-product-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e9eaeb;
  flex-shrink: 0;
  margin-right: 4px;
}
.adm-product-meta {
  flex: 1;
  min-width: 0;
}
.adm-product-title {
  font-size: 12px;
  font-weight: 500;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-product-sub {
  font-size: 11px;
  color: #374151;
  display: flex;
  gap: 4px;
  align-items: center;
}

/* Ad information section */
.adm-info-section {
  padding: 6px 12px 4px;
}
.adm-info-label {
  font-size: 11px;
  color: #374151;
  margin: 0 0 4px;
}
.adm-info-rows {
  font-size: 12px;
  color: #3f3f46;
  line-height: 1.6;
}
.adm-info-rows div {
  padding: 1px 0;
}
.adm-info-rows .info-bold {
  font-weight: 700;
  color: #1a1a1a;
}
.adm-info-rows img {
  height: 12px;
  width: 12px;
  border-radius: 50%;
  vertical-align: middle;
  display: inline;
  border: none;
}

/* Bottom actions */
.adm-bottom-actions {
  display: flex;
  gap: 8px;
  padding: 8px 12px 0;
  border-top: 1px solid #f2f2f2;
}
.adm-btn-save {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  border: 1px solid #e1e4ea;
  border-radius: 8px;
  background: #fff;
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.adm-btn-save:hover {
  background: #fafafa;
  border-color: #d4d4d8;
}
.adm-btn-save svg {
  width: 16px;
  height: 16px;
}

/* Carousel */
.ad-modal-carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}
.ad-modal-carousel-track::-webkit-scrollbar { display: none; }
.ad-modal-carousel-track { scrollbar-width: none; }
.ad-modal-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.ad-modal-carousel-slide img,
.ad-modal-carousel-slide video {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  display: block;
}
.ad-modal-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.1);
  transition: background 0.2s;
}
.ad-modal-carousel-dot.active {
  background: #fff;
  transform: scale(1.15);
}

/* ============================================================
   RIGHT PANEL — Info
   ============================================================ */
.ad-modal-right {
  position: relative;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 600px;
  height: 100%;
  background: #fff;
  border-left: 1px solid #e5e5e5;
  border-top-right-radius: 16px;
  border-bottom-right-radius: 0;
  min-height: 0;
  overflow: hidden;
}

.ad-modal-right-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px 10px;
  min-height: 0;
}
.ad-modal-right-scroll::-webkit-scrollbar-thumb {
  background: #d4d4d8;
  border-radius: 3px;
}
.ad-modal-right-scroll::-webkit-scrollbar-thumb:hover {
  background: #a1a1aa;
}

/* Close button */
.ad-modal-close {
  position: absolute;
  top: 6px;
  right: 12px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: #f5f5f5;
  color: #71717a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-modal-close:hover {
  background: #e5e5e5;
  color: #1a1a1a;
}

/* Other-user view counts (top right, left of close) */
.ad-modal-views {
  position: absolute;
  top: 6px;
  right: 48px;
  z-index: 20;
  overflow: visible;
}
.ad-modal-views[hidden] {
  display: none !important;
}
.ad-modal-views-inner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px 0 9px;
  border-radius: 8px;
  background: #f5f5f5;
  color: #52525b;
  cursor: help;
  outline: none;
}
.ad-modal-views-icon,
.ad-modal-views-help {
  flex-shrink: 0;
  color: #71717a;
}
.ad-modal-views-help {
  color: #a1a1aa;
}
.ad-modal-views-text {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: #3f3f46;
  white-space: nowrap;
}
.ad-modal-views-period {
  font-size: 11px;
  font-weight: 500;
  color: #71717a;
}
.ad-modal-views-sep {
  margin: 0 2px;
  font-weight: 500;
  color: #a1a1aa;
}
.ad-modal-views.is-loading .ad-modal-views-text {
  color: #a1a1aa;
}
.ad-modal-views-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  max-width: min(18rem, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 10px;
  background: #111827;
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 30;
}
.ad-modal-views-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 18px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #111827;
}
.ad-modal-views-tooltip-title {
  margin: 0 0 4px;
  font-weight: 600;
  color: #fff;
}
.ad-modal-views-tooltip p {
  margin: 0;
}
.ad-modal-views-tooltip-why {
  margin-top: 8px !important;
  padding-top: 8px;
  border-top: 1px solid #374151;
  color: #d1d5db;
}
.ad-modal-views-tooltip-why span {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: #f3f4f6;
}
.ad-modal-views-inner:hover + .ad-modal-views-tooltip,
.ad-modal-views-inner:focus + .ad-modal-views-tooltip,
.ad-modal-views-inner:focus-within + .ad-modal-views-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* --- Breadcrumb --- */
.ad-info-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 210px 2px 6px;
  margin-bottom: 4px;
}
.ad-breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.15s;
}
.ad-breadcrumb-item:hover {
  background: #f5f5f5;
}
.ad-modal-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 7px 4px 5px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #fff;
  color: #3f3f46;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ad-modal-back-btn:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #225aea;
}
.ad-modal-top-back-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 20;
  padding: 7px 10px 7px 8px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}
.breadcrumb-logo {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}
.breadcrumb-label {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-modal-view-store-btn {
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  color: #225aea;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ad-modal-view-store-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

/* --- Right panel tabs --- */
.ad-modal-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  gap: 3px;
  padding: 3px;
  margin: 0 4px 8px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #fafafa;
  overflow: hidden;
}
.ad-modal-tab {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  border-radius: 7px;
  padding: 7px 4px;
  background: transparent;
  color: #71717a;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.ad-modal-tab-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}
.ad-modal-tab:hover {
  color: #1a1a1a;
}
.ad-modal-tab.active {
  background: #fff;
  color: #225aea;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.ad-modal-tab-panel[hidden] {
  display: none !important;
}
.ad-modal-tab-panel {
  min-width: 0;
}
.ad-modal-section-hidden {
  display: none !important;
}

/* --- Similar ads tab --- */
.ad-modal-similar-card {
  background: #fafafa;
  border-radius: 10px;
  padding: 3px;
  min-height: 260px;
  min-width: 0;
}
.ad-modal-similar-card > .ad-info-card-header {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px 8px;
}
.ad-modal-similar-card .ad-info-card-title-row {
  flex: 0 1 auto;
  min-width: 0;
}
.ad-modal-similar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 200px;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.ad-modal-similar-country-filter {
  position: relative;
  flex-shrink: 0;
}
.ad-modal-similar-country-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 150px;
  height: 28px;
  padding: 4px 9px;
  border: 1px solid #e4e4e7;
  border-radius: 999px;
  background: #fff;
  color: #52525b;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  cursor: pointer;
}
.ad-modal-similar-country-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-modal-similar-country-button::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.65;
}
.ad-modal-similar-country-button:hover,
.ad-modal-similar-country-filter.is-open .ad-modal-similar-country-button {
  border-color: #bfdbfe;
  color: #225aea;
}
.ad-modal-similar-country-button:focus {
  outline: 2px solid rgba(147, 197, 253, 0.45);
  outline-offset: 2px;
}
.ad-modal-similar-country-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10;
  min-width: 150px;
  max-height: 220px;
  overflow: auto;
  padding: 4px;
  border: 1px solid #e4e4e7;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}
.ad-modal-similar-country-search {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 2px 2px 6px;
  margin-bottom: 2px;
  background: #fff;
  border-bottom: 1px solid #f1f1f4;
}
.ad-modal-similar-country-search-input {
  width: 100%;
  height: 30px;
  padding: 4px 10px;
  border: 1px solid #e4e4e7;
  border-radius: 7px;
  background: #fff;
  color: #3f3f46;
  font-size: 12px;
  line-height: 1.2;
  outline: none;
  box-sizing: border-box;
}
.ad-modal-similar-country-search-input::placeholder {
  color: #717c92;
}
.ad-modal-similar-country-search-input:focus {
  border-color: #bfdbfe;
  box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.35);
}
.ad-modal-similar-country-option {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #3f3f46;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.ad-modal-similar-country-option[hidden] {
  display: none;
}
.ad-modal-similar-country-option:hover,
.ad-modal-similar-country-option.active {
  background: #f4f7ff;
  color: #225aea;
}
.ad-modal-similar-country-empty {
  padding: 8px;
  color: #6b6b74;
  font-size: 12px;
  text-align: center;
}
.ad-modal-similar-filter-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border: 1px solid #e4e4e7;
  border-radius: 7px;
  background: #fff;
  color: #52525b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ad-modal-similar-filter-toggle:hover {
  border-color: #86efac;
  color: #15803d;
}
.ad-modal-similar-filter-toggle.active {
  border-color: #86efac;
  background: #dcfce7;
  color: #15803d;
}
.ad-modal-similar-body {
  min-height: 180px;
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
  overflow-x: hidden;
}
.ad-modal-similar-grid,
.ad-modal-similar-skeleton {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.ad-modal-similar-item {
  display: flex;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 7px;
  border: 1px solid #eef0f4;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.ad-modal-similar-item:hover {
  border-color: #bfdbfe;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
.ad-modal-similar-hover-preview {
  position: fixed;
  z-index: 100020;
  width: 300px;
  height: 534px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid #dbe3ef;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.97);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.ad-modal-similar-hover-preview.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}
.ad-modal-similar-hover-preview-media-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 9px;
  overflow: hidden;
  background: #09090b;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-modal-similar-hover-preview-video,
.ad-modal-similar-hover-preview-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: none;
  background: transparent;
}
.ad-modal-similar-hover-preview-video.is-visible,
.ad-modal-similar-hover-preview-image.is-visible {
  display: block;
}
.ad-modal-similar-hover-preview-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(9, 9, 11, 0.7);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ad-modal-similar-thumb {
  width: 54px;
  height: 68px;
  border-radius: 8px;
  background: #f4f4f5;
  object-fit: cover;
  flex-shrink: 0;
}
.ad-modal-similar-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ad-modal-similar-brand {
  color: #18181b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-modal-similar-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}
.ad-modal-similar-topline .ad-modal-similar-brand {
  flex: 1;
  min-width: 0;
}
.ad-modal-similar-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 999px;
  background: #f4f4f5;
  color: #71717a;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}
.ad-modal-similar-live--live {
  background: #dcfce7;
  color: #15803d;
}
.ad-modal-similar-live--live .ad-modal-similar-live-dot {
  animation: ad-modal-live-pulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
}
.ad-modal-similar-live--inactive {
  background: #fee2e2;
  color: #b91c1c;
}
.ad-modal-similar-live--unknown {
  background: #f4f4f5;
  color: #71717a;
}
.ad-modal-similar-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}
@keyframes ad-modal-live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  }
  70% {
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}
.ad-modal-similar-copy {
  color: #52525b;
  font-size: 11px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ad-modal-similar-stat {
  color: #52525b;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}
.ad-modal-similar-countries {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 12px;
}
.ad-modal-similar-country-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 4px;
  border-radius: 999px;
  background: #f4f4f5;
  color: #52525b;
  font-size: 10px;
  font-weight: 600;
}
.ad-modal-similar-country-flag {
  width: 14px;
  height: 10px;
  border-radius: 1px;
  object-fit: cover;
  flex-shrink: 0;
}
.ad-modal-similar-country-text,
.ad-modal-similar-country-more {
  color: #71717a;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}
.ad-modal-similar-country-more {
  padding: 1px 4px;
  border-radius: 4px;
  background: #f4f4f5;
}
.ad-modal-similar-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
}
.ad-modal-similar-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 calc(33.333% - 3px);
  min-width: 72px;
  padding: 5px 6px;
  border-radius: 7px;
  background: #f4f4f5;
}
.ad-modal-similar-metric-label {
  color: #71717a;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
}
.ad-modal-similar-metric-value {
  color: #18181b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  overflow: visible;
  white-space: normal;
  word-break: break-word;
}
.ad-modal-similar-metric strong,
.ad-modal-similar-metric-value {
  color: #18181b;
  font-weight: 700;
}
.ad-modal-similar-footer {
  margin-top: 10px;
  padding: 10px;
  color: #71717a;
  font-size: 12px;
  text-align: center;
}
.ad-modal-similar-loading {
  color: #225aea;
  font-weight: 600;
}
.ad-modal-similar-error-inline {
  color: #b91c1c;
}
.ad-modal-similar-empty,
.ad-modal-similar-error {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: center;
  padding: 18px;
  color: #71717a;
  font-size: 13px;
  text-align: center;
}
.ad-modal-similar-error {
  color: #b91c1c;
}
.ad-modal-similar-skeleton-row {
  display: flex;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 7px;
  border: 1px solid #eef0f4;
  border-radius: 10px;
}
.ad-modal-similar-skeleton-thumb,
.ad-modal-similar-skeleton-line {
  border-radius: 8px;
  background: linear-gradient(90deg, #f1f5f9 0%, #e8edf3 45%, #f8fafc 55%, #f1f5f9 100%);
  background-size: 200% 100%;
  animation: ad-modal-similar-pulse 1.35s ease-in-out infinite;
}
.ad-modal-similar-skeleton-thumb {
  width: 54px;
  height: 68px;
  flex-shrink: 0;
}
.ad-modal-similar-skeleton-lines {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 3px;
}
.ad-modal-similar-skeleton-line {
  height: 9px;
  max-width: 100%;
}
@keyframes ad-modal-similar-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Transcript tab --- */
.ad-modal-transcript-card {
  background: #fafafa;
  border-radius: 10px;
  padding: 3px;
  min-height: 260px;
}
.ad-modal-transcript-toolbar {
  display: none;
  padding: 6px;
}
.ad-modal-transcript-toolbar:not(:empty) {
  display: flex;
}
.ad-modal-transcript-body {
  min-height: 180px;
  padding: 10px 8px 8px;
  border-radius: 8px;
  background: #fff;
  color: #3f3f46;
  font-size: 13px;
  line-height: 1.55;
}
.ad-modal-transcript-footer {
  padding: 8px 6px 6px;
}
.ad-modal-transcript-action {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  box-shadow: inset 0 1px 1px 0 hsla(0, 0%, 100%, .2), inset 0 6px 12px 0 hsla(0, 0%, 100%, .12), 0 1px 2px 0 rgba(8, 8, 8, .2), 0 4px 4px 0 rgba(8, 8, 8, .08);
  transition: background 0.3s ease, transform 0.12s ease, opacity 0.15s;
}
.ad-modal-transcript-action:hover {
  background: #1d4ed8;
}
.ad-modal-transcript-action:active:not(:disabled) {
  transform: translateY(1px);
}
.ad-modal-transcript-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.ad-modal-transcript-body .ad-transcript-segment {
  position: relative;
  padding: 12px 34px 12px 8px;
}
.ad-modal-transcript-body .ad-transcript-segment + .ad-transcript-segment {
  border-top: 1px solid #f3f4f6;
}
.ad-modal-transcript-body .ad-transcript-segment:hover {
  background: #fafafa;
}
.ad-modal-transcript-body .ad-transcript-segment--seekable {
  cursor: pointer;
}
.ad-modal-transcript-body .ad-transcript-segment--seekable:active {
  background: #f0f4ff;
}
.ad-modal-transcript-body .ad-transcript-segment--seekable:focus-visible {
  outline: 2px solid #d1e3ff;
  outline-offset: -2px;
}
.ad-modal-transcript-body .ad-transcript-line {
  margin: 0;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}
.ad-modal-transcript-body .ad-transcript-ts {
  display: inline-block;
  margin-right: 10px;
  color: #225aea;
  font-size: 12px;
  font-weight: 700;
  vertical-align: top;
}
.ad-modal-transcript-body .ad-transcript-copy-icon-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #5b6b82;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.15s ease, background 0.15s, color 0.15s;
}
.ad-modal-transcript-body .ad-transcript-segment:hover .ad-transcript-copy-icon-btn,
.ad-modal-transcript-body .ad-transcript-copy-icon-btn:focus {
  opacity: 1;
}
.ad-modal-transcript-body .ad-transcript-copy-icon-btn:hover {
  background: #e6efff;
  color: #225aea;
}
.ad-modal-transcript-body .ad-script-analysis-section details {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
  background: #fff;
}
.ad-modal-transcript-body .ad-script-analysis-section details summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.ad-modal-transcript-body .ad-script-analysis-section details summary::-webkit-details-marker {
  display: none;
}
.ad-modal-transcript-body .ad-script-analysis-section .ad-script-analysis-chevron,
.ad-modal-transcript-body .ad-similar-script-acc .ad-similar-script-chevron {
  transition: transform 0.2s ease;
}
.ad-modal-transcript-body .ad-script-analysis-section details[open] .ad-script-analysis-chevron,
.ad-modal-transcript-body .ad-similar-script-acc details[open] .ad-similar-script-chevron {
  transform: rotate(-90deg);
}

/* --- Brands announcement (Meta Ad Library modal only) --- */
.ad-modal-announcement-bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 10px;
  border: 1px solid #fde68a;
  background: #fffbeb;
}
.ad-modal-announcement-inner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.ad-modal-announcement-icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: #b45309;
  width: 16px;
  height: 16px;
}
.ad-modal-announcement-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #78350f;
  font-weight: 500;
}

/* Modal Save Ad button: ensure children never swallow clicks */
#ad-modal-save-btn-card.save-ad-lid > * {
  pointer-events: none;
}
#ad-modal-save-btn-card.loading {
  opacity: 0.8;
  cursor: default;
}

/* Ellipsis loader (used inside Save Ad button while saving/removing) */
.ad-modal-sheet .ellipsis-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
}
.ad-modal-sheet .ellipsis-loader span {
  background-color: currentColor;
  border-radius: 50%;
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 2px;
  opacity: 0;
  animation: ad-modal-ellipsis-fade 1.4s infinite ease-in-out;
}
.ad-modal-sheet .ellipsis-loader span:nth-child(1) { animation-delay: 0s; }
.ad-modal-sheet .ellipsis-loader span:nth-child(2) { animation-delay: 0.2s; }
.ad-modal-sheet .ellipsis-loader span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ad-modal-ellipsis-fade {
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

/* --- Adspend + Demographics Card --- */
.ad-info-spend-card {
  display: flex;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 6px;
}
.ad-spend-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 14px;
  gap: 2px;
  min-width: 0;
  cursor: pointer;
  transition: background 0.15s ease;
}
.ad-spend-left:hover,
.ad-spend-left:focus-visible {
  background: #f8fafc;
}
.ad-spend-left:focus-visible {
  outline: 2px solid #bfdbfe;
  outline-offset: -2px;
}
.ad-spend-title-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ad-spend-label {
  font-size: 13px;
  font-weight: 500;
  color: #3f3f46;
}
.ad-spend-value {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.1;
}
.ad-spend-metrics-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.ad-spend-metrics-separator {
  font-size: 18px;
  font-weight: 500;
  color: #6b6b74;
  line-height: 1;
}
.ad-spend-estimate-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #1a1a1a;
  white-space: nowrap;
}
.ad-spend-estimate-label {
  font-size: 20px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.1;
}
.ad-spend-estimate-value {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.1;
}
.ad-spend-daily {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ad-spend-daily-label {
  font-size: 14px;
  font-weight: 500;
  color: #3f3f46;
}
.ad-spend-daily-value {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
}
.ad-spend-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 3px;
  background: #fafafa;
  min-width: 0;
}
.ad-spend-demo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  padding: 5px 10px;
  background: #fff;
}
.demo-label {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
}
.demo-value {
  font-size: 13px;
  font-weight: 500;
  color: #71717a;
}
.demo-value .country-flag {
  width: 16px;
  height: auto;
  border-radius: 2px;
  border: 0.5px solid rgba(0,0,0,0.1);
  vertical-align: middle;
  margin-right: 4px;
}
.ad-modal-country-info-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.ad-modal-country-flags-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.ad-modal-country-flags-wrap--reach-popup {
  cursor: pointer;
}
.ad-modal-country-flags-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  outline: none;
}
.ad-modal-country-flags-trigger:focus-visible {
  border-radius: 6px;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}
#ad-detail-modal .ad-spend-demo-row:has(.ad-modal-country-flags-wrap--reach-popup) {
  overflow: visible;
}
#ad-detail-modal .ad-spend-right {
  overflow: visible;
}
/* Portaled country reach flyout: keep nested metrics readable on dark .custom-popup */
.ad-modal-info-flyout.custom-popup .ad-modal-reach-country-name,
.ad-modal-info-flyout.custom-popup .ad-modal-reach-country-metric,
.ad-modal-info-flyout.custom-popup .ad-modal-reach-country-pct,
.ad-modal-info-flyout.custom-popup .ad-modal-reach-country-more {
  color: #f5f5f5;
}
.ad-modal-info-flyout.custom-popup .ad-modal-reach-country-metric {
  color: #e4e4e7;
}
.ad-modal-info-flyout.custom-popup .ad-modal-reach-country-metric-icon {
  color: #a3a3a3;
}
.ad-modal-info-flyout.custom-popup .ad-modal-reach-country-line {
  background: rgba(255, 255, 255, 0.14);
}
.ad-modal-info-flyout.custom-popup .ad-modal-reach-country-line-fill {
  background: #60a5fa;
}
.ad-modal-reach-country-list {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 220px;
  width: 100%;
}
.ad-modal-reach-country-entry {
  display: grid;
  grid-template-columns: minmax(64px, auto) minmax(48px, 1fr) auto auto;
  align-items: center;
  gap: 6px;
}
.ad-modal-reach-country-metrics {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.ad-modal-reach-country-metric {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  line-height: 1;
}
.ad-modal-reach-country-metric-icon {
  flex: 0 0 auto;
  color: #64748b;
}
.ad-modal-reach-country-metric-icon--eye {
  display: block;
}
.ad-modal-reach-country-metric-icon--dollar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 11px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.ad-modal-reach-country-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
/* Flyouts portal to document.body, so .info-row-value .country-flag no longer
   applies — without this, PNGs render at intrinsic size (huge). */
.ad-modal-info-flyout .country-flag,
.ad-modal-reach-country-label .country-flag,
.ad-modal-country-flags-wrap .country-flag,
.ad-modal-country-flags-trigger .country-flag {
  width: 14px;
  height: 14px;
  max-width: 14px;
  max-height: 14px;
  object-fit: cover;
  border-radius: 50%;
  border: none;
  flex-shrink: 0;
  vertical-align: middle;
}
.ad-modal-reach-country-name {
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-modal-reach-country-line {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: #e4e4e7;
  overflow: hidden;
}
.ad-modal-reach-country-line-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: #6366f1;
}
.ad-modal-reach-country-pct {
  color: #334155;
  font-weight: 600;
  white-space: nowrap;
}
.ad-modal-reach-country-more {
  font-size: 11px;
  color: #71717a;
  text-align: right;
}

/* --- Info Cards Row --- */
.ad-info-cards-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
#ad-modal-info-cards-row {
  flex-direction: column;
}
#ad-modal-info-cards-row > .ad-page-overview-grid {
  width: 100%;
}
.ad-info-card {
  flex: 1;
  background: #fafafa;
  border-radius: 10px;
  padding: 3px;
  min-width: 0;
}
.ad-page-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
}
.ad-page-overview-grid.has-traffic-chart,
.ad-page-overview-grid.has-page-charts {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.86fr);
}
.ad-page-overview-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ad-page-overview-main .ad-info-card-rows {
  flex: 1 1 auto;
}
.ad-page-overview-charts {
  display: none;
  box-sizing: border-box;
  min-width: 0;
  min-height: 100%;
  height: 100%;
  width: 100%;
  gap: 6px;
}
/* Stack monthly visits above active ads (explicit column — inline display:flex was row) */
.ad-page-overview-charts.ad-page-overview-charts--visible {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-flow: row;
  align-content: stretch;
  align-items: stretch;
}
.ad-page-overview-charts.ad-page-overview-charts--visible.ad-page-overview-charts--dual {
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}
.ad-page-overview-charts.ad-page-overview-charts--visible.ad-page-overview-charts--single {
  grid-template-rows: minmax(0, 1fr);
}
.ad-page-overview-charts > .ad-page-traffic-chart-card {
  width: 100%;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  display: none;
  flex-direction: column;
}
.ad-page-overview-charts > .ad-page-traffic-chart-card.ad-page-traffic-chart-card--visible {
  display: flex !important;
  flex-direction: column;
}
.ad-page-overview-charts .ad-page-traffic-chart-canvas-wrap,
.ad-page-overview-charts .ad-page-active-ads-chart-canvas-wrap {
  flex: 1 1 auto;
  min-height: 48px;
  height: auto;
  max-height: none;
}
.ad-info-card-header {
  padding: 5px 6px 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ad-info-card-title-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.info-card-icon {
  width: 16px;
  height: 16px;
  color: #3f3f46;
}
.info-card-title {
  font-size: 13px;
  font-weight: 500;
  color: #3f3f46;
}
.info-card-brand-logo {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e5e5e5;
  flex-shrink: 0;
}

/* Info Badges */
.ad-info-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ad-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
  max-height: 24px;
}
.ad-status-badge[data-status="active"] {
  background: #dcfce7;
  color: #15803d;
}
.ad-status-badge[data-status="active"] .status-dot {
  background: #22c55e;
}
.ad-status-badge[data-status="inactive"] {
  background: #f5f5f5;
  color: #3f3f46;
}
.ad-status-badge[data-status="inactive"] .status-dot {
  background: #9ca3af;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Info Rows */
.ad-info-card-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ad-page-overview-main .ad-info-card-rows {
  gap: 7px;
}
.ad-modal-metric-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px;
}
.ad-modal-metric-tile {
  min-width: 0;
}
#ad-modal-brand-card {
  order: 1;
}
#ad-modal-page-card {
  order: 2;
}
.ad-modal-metric-tile .ad-info-card-header {
  padding-bottom: 4px;
}
.ad-modal-page-card-header {
  padding-bottom: 4px;
}
.ad-modal-page-identity-inner {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  max-width: calc(100% - 48px);
  margin-left: auto;
}
.ad-modal-page-card-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e5e5e5;
  flex-shrink: 0;
}
.ad-modal-page-card-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: #18181b;
  line-height: 1.3;
}
.ad-modal-page-adlibrary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}
.ad-modal-page-adlibrary-link:hover {
  opacity: 1;
}
.ad-modal-page-adlibrary-link img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  display: block;
}
.ad-modal-metric-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
}
.ad-modal-metric-grid .ad-info-row {
  min-width: 0;
  gap: 8px;
  padding: 4px 8px;
}
.ad-modal-metric-grid .info-row-label {
  min-width: 0;
  font-size: 12px;
}
.ad-modal-metric-grid .info-row-value {
  min-width: 0;
  justify-content: flex-end;
  text-align: right;
  font-size: 12px;
}
.ad-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  padding: 5px 10px;
  background: #fff;
}
.info-row-label {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
}
.info-row-label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ad-modal-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: #6b6b74;
  cursor: pointer;
  line-height: 0;
  flex-shrink: 0;
}
.ad-modal-info-btn:hover {
  color: #52525b;
}
.ad-modal-info-btn svg {
  width: 14px;
  height: 14px;
}

/* Fixed-position flyout: same card style as .custom-popup elsewhere; escapes modal overflow clipping */
.ad-modal-info-flyout.custom-popup {
  bottom: auto;
  right: auto;
  left: auto;
  width: auto;
  min-width: 220px;
  max-width: min(290px, calc(100vw - 16px));
  text-align: left;
  font-weight: 400;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  transform: none;
  pointer-events: none;
  transition: none;
}
.ad-modal-info-flyout.custom-popup.is-open {
  pointer-events: auto;
}
.ad-modal-info-flyout.custom-popup:not(.is-open) {
  display: none !important;
  pointer-events: none !important;
}
.info-row-value {
  font-size: 13px;
  font-weight: 500;
  color: #71717a;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ad-modal-page-metric-value {
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}
#ad-modal-page-active-ads.ad-modal-page-metric-value {
  flex-wrap: wrap;
  row-gap: 2px;
}
.ad-modal-page-metric-count {
  font-size: 13px;
  font-weight: 500;
  color: #71717a;
  white-space: nowrap;
  flex-shrink: 0;
}
.ad-modal-page-metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.ad-modal-page-metric-trend[hidden] {
  display: none !important;
}
.ad-modal-page-metric-spark {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  flex-shrink: 0;
}
.ad-modal-page-metric-spark.is-spark-hover {
  cursor: crosshair;
}
.ad-modal-page-metric-spark svg {
  display: block;
  width: 56px;
  height: 18px;
}
.ad-modal-page-metric-spark-tip {
  position: fixed;
  z-index: 100010;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 8px));
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(17, 24, 39, 0.94);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.ad-modal-page-metric-pct {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.ad-modal-page-metric-pct.is-up {
  color: #15803d;
}
.ad-modal-page-metric-pct.is-down {
  color: #e11d48;
}
.ad-modal-page-metric-pct.is-flat {
  color: #5b6b82;
}
.ad-modal-page-social-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-left: 2px;
  border-radius: 5px;
  color: #71717a;
  border: 1px solid #e4e4e7;
  background: #fff;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.ad-modal-page-social-open-link:hover {
  color: #18181b;
  border-color: #d4d4d8;
  background: #fafafa;
}
.ad-modal-page-social-open-link svg {
  display: block;
}
.info-row-value .active-dot-sm {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}
.info-row-value .ad-modal-runtime-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a1a1aa;
  flex-shrink: 0;
}
.info-row-value .ad-modal-runtime-dot.is-live {
  background: #22c55e;
  animation: ad-modal-live-pulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
}
.info-row-value .ad-modal-runtime-dot.is-inactive {
  background: #ef4444;
}
.info-row-value .ad-modal-runtime-days {
  color: #6b6b74;
  white-space: nowrap;
}
.info-row-value .platform-icon {
  width: 14px;
  height: 14px;
  transition: color 0.2s;
}
.info-row-value .platform-icon:hover {
  color: #3f3f46;
}
.info-row-value .country-flag {
  width: 14px;
  height: auto;
  border-radius: 2px;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  vertical-align: middle;
}
.info-row-value .ad-modal-country-info-stack {
  width: 100%;
}
.info-row-value .ad-modal-reach-country-name {
  max-width: 106px;
}
.info-row-value .markets-entry {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #52525b;
  white-space: nowrap;
}
.info-row-value .markets-pct {
  font-weight: 600;
  color: #18181b;
}
.info-row-value .markets-sep {
  margin: 0 6px;
  color: #d4d4d8;
}
.ad-modal-trustpilot-link {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.ad-modal-trustpilot-link:hover {
  color: #00b67a;
}
.ad-modal-trustpilot-link-inner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ad-modal-trustpilot-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  object-fit: contain;
}
.ad-rank-modal-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 700;
  cursor: help;
}
.ad-rank-modal-pill--declining {
  background: #fee2e2;
  color: #b91c1c;
}
.ad-rank-modal-pill--rising {
  background: #dcfce7;
  color: #15803d;
}
.ad-rank-modal-trend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.ad-rank-current-value .ad-rank-modal-trend {
  font-size: 18px;
  transform: translateY(-2px);
}
.ad-rank-modal-trend--declining {
  color: #b91c1c;
}
.ad-rank-modal-trend--rising {
  color: #15803d;
}
.info-row-value.ad-rank-modal-value,
.info-row-value.ad-rank-modal-value .ad-rank-modal-pill {
  color: #2563eb;
  font-weight: 700;
}
.ad-rank-history-card {
  margin-top: 8px;
  padding: 6px 10px 8px;
  border-radius: 8px;
  background: #fff;
}
.ad-rank-history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #18181b;
}
.ad-rank-history-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ad-rank-history-head small {
  font-size: 10px;
  font-weight: 600;
  color: #71717a;
}
.ad-rank-current-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 0 6px;
}
.ad-rank-current-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: #2563eb;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.ad-rank-current-value--pending {
  color: #52525b;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
}
.ad-rank-current-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #a1a1aa;
  transform: translateY(-4px);
  flex-shrink: 0;
}
.ad-rank-current-percent {
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}
.ad-rank-current-percent-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ad-rank-current-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  cursor: help;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  transform: translateY(-1px);
}
.ad-rank-current-info-btn {
  border: none;
  padding: 0;
}
.ad-rank-history-canvas-wrap {
  position: relative;
  height: 64px;
  margin-top: 4px;
  border: 1px solid #e3edff;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7faff 0%, #ffffff 100%);
  overflow: visible;
}
#ad-modal-rank-canvas {
  width: 100% !important;
  height: 100% !important;
}
.ad-rank-history-explainer {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.35;
  color: #52525b;
}
.ad-rank-history-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.ad-rank-history-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border: 1px solid #e4e4e7;
  border-radius: 999px;
  background: #fafafa;
  color: #71717a;
  font-size: 10px;
  line-height: 1.25;
  white-space: nowrap;
}
.ad-rank-history-stat strong {
  color: #3f3f46;
  font-weight: 700;
}
.ad-rank-history-stat--good {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}
.ad-rank-history-stat--good strong {
  color: #166534;
}
.ad-rank-history-stat--bad {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}
.ad-rank-history-stat--bad strong {
  color: #991b1b;
}
.ad-page-traffic-chart-card {
  padding: 6px 10px 8px;
  border-radius: 8px;
  background: #fff;
  min-width: 0;
}
.ad-modal-partner-pages-card {
  margin-top: 8px;
  padding: 6px 10px 8px;
  border-radius: 8px;
  background: #fff;
}
.ad-modal-breadcrumb-associated-wrap {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
}
.ad-modal-has-popup {
  position: relative;
}
.ad-modal-associated-domains-flyout {
  padding: 0;
  overflow: hidden;
  max-width: min(320px, calc(100vw - 16px));
}
.ad-modal-associated-domains-flyout-head {
  padding: 8px 10px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #f4f4f5;
}
.ad-modal-associated-domains-flyout-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
}
.ad-modal-associated-domains-flyout-body .ad-modal-associated-domain {
  padding: 7px 8px;
}
.ad-page-traffic-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #18181b;
}
.ad-page-traffic-chart-head small {
  font-size: 10px;
  font-weight: 600;
  color: #71717a;
}
.ad-modal-monthly-visits-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 0 6px;
}
.ad-modal-monthly-visits-value {
  color: #18181b;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
#ad-modal-monthly-visits-growth.ad-modal-monthly-visits-growth,
#ad-modal-active-ads-growth.ad-modal-monthly-visits-growth {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  flex-shrink: 0;
}
#ad-modal-monthly-visits-growth[hidden],
#ad-modal-active-ads-growth[hidden] {
  display: none !important;
}
.ad-modal-monthly-visits-growth-item {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}
.ad-modal-monthly-visits-change {
  color: #2563eb;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}
.ad-modal-monthly-visits-change--down {
  color: #dc2626;
}
.ad-modal-monthly-visits-change--neutral {
  color: #71717a;
}
.ad-modal-monthly-visits-change--na {
  color: #6b6b74;
  font-weight: 600;
}
#ad-modal-monthly-visits-growth .ad-modal-monthly-visits-period,
#ad-modal-active-ads-growth .ad-modal-monthly-visits-period {
  color: #6b6b74;
  font-size: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}
.ad-modal-monthly-visits-label {
  color: #71717a;
  font-size: 11px;
  font-weight: 600;
}
.ad-page-traffic-chart-canvas-wrap {
  height: 64px;
  margin-top: 4px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  overflow: hidden;
}
#ad-modal-traffic-canvas-wrap {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}
.ad-page-overview-charts .ad-page-traffic-chart-canvas-wrap,
.ad-page-overview-charts .ad-page-active-ads-chart-canvas-wrap {
  height: auto;
}
#ad-modal-traffic-canvas,
#ad-modal-active-ads-canvas,
#ad-modal-product-active-ads-canvas {
  width: 100% !important;
  height: 100% !important;
}
.ad-modal-product-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}
.ad-modal-product-overview-grid.has-active-ads-chart {
  grid-template-columns: minmax(0, 1fr) minmax(200px, 0.78fr);
}
.ad-modal-product-overview-main,
.ad-modal-product-overview-chart {
  min-width: 0;
}
.ad-modal-product-overview-chart {
  display: flex;
  flex-direction: column;
}
.ad-modal-product-overview-chart .ad-page-traffic-chart-card {
  margin-top: 0;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: none;
  flex-direction: column;
}
.ad-modal-product-overview-chart .ad-page-traffic-chart-card.ad-page-traffic-chart-card--visible {
  display: flex !important;
}
.ad-modal-product-overview-chart .ad-page-active-ads-chart-canvas-wrap {
  flex: 1 1 auto;
  min-height: 120px;
  height: auto;
}
.ad-modal-product-actions {
  margin-bottom: 12px;
}
.ad-modal-product-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
}
.ad-modal-product-image {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid #e5e7eb;
}
.ad-modal-product-hero-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.35;
}
.ad-modal-product-hero-price {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #047857;
}
.ad-modal-product-targeting-value {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}
.ad-modal-product-target-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 11px;
  font-weight: 600;
  color: #374151;
}
.ad-modal-product-target-pill small {
  font-weight: 500;
  color: #6b7280;
}
.ad-modal-product-screenshot-wrap {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}
.ad-modal-product-screenshot-link {
  display: block;
  margin-top: 8px;
}
.ad-modal-product-screenshot {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  object-position: top;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}
.ad-modal-product-sample-ads {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}
.ad-modal-product-sample-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.ad-modal-product-sample-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.ad-modal-product-sample-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}
.ad-modal-product-sample-brand {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ad-page-traffic-chart-explainer {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.35;
  color: #52525b;
}
.ad-page-traffic-chart-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.ad-page-traffic-chart-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border: 1px solid #e4e4e7;
  border-radius: 999px;
  background: #fafafa;
  color: #71717a;
  font-size: 10px;
  line-height: 1.25;
  white-space: nowrap;
}
.ad-page-traffic-chart-stat strong {
  color: #3f3f46;
  font-weight: 700;
}
.ad-page-traffic-chart-stat--good {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}
.ad-page-traffic-chart-stat--good strong {
  color: #166534;
}
.ad-page-traffic-chart-stat--bad {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}
.ad-page-traffic-chart-stat--bad strong {
  color: #991b1b;
}
.ad-modal-partner-pages-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.ad-modal-partner-page {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 6px;
  border: 1px solid #eef0f4;
  border-radius: 8px;
  background: #fafafa;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.ad-modal-partner-page:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.ad-modal-partner-page-open {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1 1 auto;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.ad-modal-partner-page-lib {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 4px 8px;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  background: #fff;
  color: #52525b;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ad-modal-partner-page-lib:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #225aea;
}
.ad-modal-partner-page-lib svg {
  flex-shrink: 0;
}
.ad-modal-associated-domain {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px;
  border: 1px solid #eef0f4;
  border-radius: 8px;
  background: #fafafa;
  transition: background 0.15s, border-color 0.15s;
}
.ad-modal-associated-domain:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.ad-modal-associated-domain-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  color: inherit;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  padding: 0;
  font: inherit;
  width: 100%;
}
.ad-modal-associated-domain-visit {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 4px 8px;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  background: #fff;
  color: #52525b;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ad-modal-associated-domain-visit:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #225aea;
}
.ad-modal-associated-domain-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #18181b;
  font-size: 11px;
  font-weight: 700;
}
.ad-modal-associated-domain-count {
  flex-shrink: 0;
  color: #71717a;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.ad-modal-associated-domain-traffic {
  flex-shrink: 0;
  color: #71717a;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.ad-modal-partner-page img {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
}
.ad-modal-partner-page-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ad-modal-partner-page-nameline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ad-modal-partner-page-name {
  color: #18181b;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.ad-modal-partner-page-sub {
  color: #71717a;
  font-size: 10px;
  font-weight: 600;
}
.ad-modal-partner-page-inactive {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.ad-modal-partner-page-status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #b91c1c;
  flex-shrink: 0;
}
.ad-modal-partner-pages-empty,
.ad-modal-partner-pages-error,
.ad-modal-associated-domains-empty,
.ad-modal-associated-domains-error {
  padding: 8px 0 2px;
  color: #71717a;
  font-size: 12px;
}
.ad-modal-partner-pages-error,
.ad-modal-associated-domains-error {
  color: #b91c1c;
}
.ad-modal-partner-pages-show-more {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 2px;
  padding: 5px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 999px;
  background: #fff;
  color: #52525b;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.ad-modal-partner-pages-show-more:hover {
  border-color: #bfdbfe;
  color: #225aea;
}

/* --- Chart Card --- */
.ad-info-chart-card {
  background: #fafafa;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 6px;
}
.ad-chart-canvas-wrap {
  padding: 2px 6px 6px;
}
.ad-euuk-history-row {
  display: none;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
  margin-bottom: 6px;
}
.ad-euuk-history-row.is-visible {
  display: grid;
}
.ad-euuk-history-row.is-single {
  grid-template-columns: minmax(0, 1fr);
}
.ad-euuk-history-chart-card {
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  padding: 6px 10px 8px;
  margin-bottom: 0;
  min-width: 0;
  box-sizing: border-box;
}
.ad-euuk-history-chart-canvas-wrap {
  height: 64px;
  margin-top: 4px;
}
.ad-euuk-history-chart-card .ad-modal-monthly-visits-card {
  padding: 4px 0 2px;
}
.ad-euuk-history-chart-card .ad-modal-monthly-visits-value {
  font-size: 24px;
}
#ad-modal-canvas,
#ad-modal-spend-canvas {
  width: 100% !important;
  height: 100% !important;
  max-height: none;
}

/* --- Landing Page Card --- */
.ad-overview-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  margin-bottom: 6px;
}
.ad-overview-details-grid.has-rank-history {
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.82fr);
}
.ad-overview-details-main {
  min-width: 0;
  order: 1;
}
.ad-overview-details-grid.has-rank-history .ad-overview-details-main {
  grid-column: 1;
  grid-row: 1;
}
.ad-overview-details-grid .ad-info-landing-card {
  order: 3;
  grid-column: 1 / -1;
}
.ad-overview-details-grid .ad-info-text-card {
  order: 4;
  grid-column: 1 / -1;
}
.ad-overview-details-grid .ad-rank-history-card {
  order: 2;
  margin-top: 0;
}
.ad-overview-details-grid.has-rank-history .ad-rank-history-card {
  grid-column: 2;
  grid-row: 1;
}
.ad-info-landing-card {
  background: #fafafa;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 0;
  min-width: 0;
}
.ad-landing-url-row {
  padding: 0 4px 4px;
  min-width: 0;
}
.ad-landing-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #fff;
  border-radius: 8px;
  text-decoration: none;
  color: #1a1a1a;
  transition: color 0.15s;
  min-width: 0;
}
.ad-landing-link:hover {
  color: #2563eb;
}
.landing-url-text {
  font-size: 13px;
  color: inherit;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.landing-ext-icon {
  width: 16px;
  height: 16px;
  color: #6b6b74;
  flex-shrink: 0;
  margin-top: 2px;
}

/* --- Text Card (Description) --- */
.ad-info-text-card {
  background: #fafafa;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 0;
  min-width: 0;
}
.ad-info-text-body {
  padding: 0 8px 6px;
  font-size: 12px;
  line-height: 1.5;
  color: #3f3f46;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
}
.ad-info-text-body::-webkit-scrollbar {
  width: 4px;
}
.ad-info-text-body::-webkit-scrollbar-thumb {
  background: #d4d4d8;
  border-radius: 2px;
}

/* --- Price Card --- */
.ad-info-price-card {
  background: #fafafa;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 6px;
}
.ad-price-compare {
  text-decoration: line-through;
  color: #6b6b74 !important;
}
.ad-price-discount {
  color: #15803d !important;
  font-weight: 600 !important;
}

/* --- Quick Actions Card --- */
.ad-info-actions-card {
  background: #fafafa;
  border-radius: 10px;
  padding: 6px;
  margin-bottom: 8px;
}
.ad-actions-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
}
.ad-actions-layout > .ad-action-item {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.ad-actions-layout > .ad-action-item.ad-action-item--solo {
  grid-column: 1 / -1;
}
.ad-actions-primary-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
}
.ad-actions-primary-row > .ad-action-item:only-child {
  grid-column: 1 / -1;
}
.ad-actions-primary-row:empty {
  display: none;
}
.ad-action-item.ad-action-item--primary {
  justify-content: flex-start;
  gap: 8px;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #18181b;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.015em;
  white-space: normal;
  text-align: left;
  line-height: 1.25;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.ad-action-item.ad-action-item--primary > span {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.ad-action-item.ad-action-item--primary svg {
  width: 16px;
  height: 16px;
  color: #fff;
  flex-shrink: 0;
}
.ad-action-item.ad-action-item--primary > img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
}
.ad-action-item.ad-action-item--primary:hover {
  background: #27272a;
  color: #fff;
}
.ad-action-item.ad-action-item--primary:hover svg {
  color: #fff;
}
.ad-action-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #18181b;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  font-size: 12px;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  text-align: left;
  line-height: 1.25;
  min-width: 0;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.ad-action-item > span {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}
.ad-action-item:hover {
  background: #27272a;
  color: #fff;
}
.ad-action-item svg {
  width: 16px;
  height: 16px;
  color: #fff;
  transition: color 0.15s;
}
.ad-action-item:hover svg {
  color: #fff;
}

/* ============================================================
   BOTTOM BAR
   ============================================================ */
.ad-modal-bottom-bar {
  position: relative;
  flex-shrink: 0;
  padding: 0 12px 10px;
  background: #fff;
}
.ad-bottom-bar-inner {
  position: relative;
}
.ad-bottom-bar-gradient {
  pointer-events: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: 32px;
  background: linear-gradient(to top, #fff, transparent);
}
.ad-bottom-bar-pill {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #0a0a0a;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  outline: 1px solid rgba(255,255,255,0.1);
}
.ad-bottom-save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: rgba(255,255,255,0.8);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.ad-bottom-save-btn:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}
.ad-bottom-save-btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */
@media (max-width: 1024px) {
  #ad-detail-modal {
    --ad-modal-sheet-height: min(92vh, calc(100dvh - env(safe-area-inset-bottom, 0px) - 12px));
  }
  .ad-modal-sheet {
    margin: 0;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
  }
  .ad-modal-inner {
    flex-direction: column;
  }
  .ad-modal-left {
    flex: 0 1 42%;
    min-width: 0;
    min-height: 200px;
  }
  .ad-modal-right {
    flex: 1 1 58%;
    min-height: 0;
    width: 100%;
    border-left: none;
    border-top: 1px solid #e5e5e5;
    border-top-right-radius: 0;
  }
  .ad-modal-ad-card {
    max-width: 320px;
    width: min(100%, 320px);
  }
  .ad-modal-floating-actions-wrap {
    margin-right: 12px;
  }
  .ad-info-breadcrumb {
    padding-right: 180px;
  }
  .ad-info-cards-row {
    flex-direction: column;
  }
  .ad-page-overview-grid,
  .ad-page-overview-grid.has-traffic-chart,
  .ad-page-overview-grid.has-page-charts {
    grid-template-columns: 1fr;
  }
  .ad-modal-product-overview-grid,
  .ad-modal-product-overview-grid.has-active-ads-chart {
    grid-template-columns: 1fr;
  }
  .ad-modal-product-overview-chart .ad-page-active-ads-chart-canvas-wrap {
    min-height: 100px;
    height: 100px;
  }
  .ad-modal-metric-tiles {
    grid-template-columns: 1fr;
  }
  .ad-page-overview-charts.ad-page-overview-charts--visible {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    height: auto;
    min-height: 0;
  }
  .ad-page-overview-charts.ad-page-overview-charts--visible.ad-page-overview-charts--dual {
    grid-template-rows: auto auto;
  }
  .ad-page-overview-charts > .ad-page-traffic-chart-card.ad-page-traffic-chart-card--visible {
    min-height: auto;
  }
  .ad-page-overview-charts .ad-page-traffic-chart-canvas-wrap,
  .ad-page-overview-charts .ad-page-active-ads-chart-canvas-wrap {
    height: 64px;
    flex: none;
  }
  .ad-page-traffic-chart-card {
    margin-top: 6px;
  }
  .ad-overview-details-grid,
  .ad-overview-details-grid.has-copy-column,
  .ad-overview-details-grid.has-rank-history {
    grid-template-columns: 1fr;
  }
  .ad-overview-details-grid.has-rank-history .ad-overview-details-main,
  .ad-overview-details-grid.has-rank-history .ad-rank-history-card,
  .ad-overview-details-grid .ad-info-landing-card,
  .ad-overview-details-grid .ad-info-text-card {
    grid-column: auto;
    grid-row: auto;
  }
  .ad-overview-details-grid .ad-rank-history-card {
    margin-top: 6px;
  }
}

@media (max-width: 640px) {
  #ad-detail-modal {
    --ad-modal-sheet-height: min(94vh, calc(100dvh - env(safe-area-inset-bottom, 0px) - 8px));
  }
  .ad-modal-sheet {
    margin: 0;
    max-width: 100%;
  }
  .ad-modal-left {
    flex-basis: 38%;
    min-height: 180px;
  }
  .ad-modal-dismiss-hint {
    bottom: calc(var(--ad-modal-sheet-height) + 12px);
    font-size: 12px;
  }
  .ad-modal-right {
    width: 100%;
  }
  .ad-info-spend-card {
    flex-direction: column;
  }
  .ad-euuk-history-row.is-visible,
  .ad-euuk-history-row.is-visible.is-dual {
    grid-template-columns: minmax(0, 1fr);
  }
  .ad-modal-partner-pages-body {
    grid-template-columns: 1fr;
  }
  .ad-spend-left {
    border-bottom: 1px solid #e5e5e5;
  }
}

/* ============================================================
   SCROLLBAR HIDE UTILITY
   ============================================================ */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { scrollbar-width: none; }

/* ============================================================
   FADE IN ANIMATION
   ============================================================ */
@keyframes adModalSlideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
#ad-detail-modal.open:not(.ad-modal--closing) .ad-modal-sheet {
  animation: adModalSlideUp 0.36s cubic-bezier(0.32, 0.72, 0, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  #ad-detail-modal.open {
    transition-duration: 0.01ms !important;
  }
  .ad-modal-sheet {
    transition-duration: 0.01ms !important;
  }
  #ad-detail-modal.open:not(.ad-modal--closing) .ad-modal-sheet {
    animation-duration: 0.01ms !important;
    transform: translateY(0);
  }
  #ad-detail-modal.open.ad-modal--backdrop-hover:not(.ad-modal--closing) .ad-modal-sheet {
    margin-bottom: 0;
  }
  #ad-detail-modal.open.ad-modal--backdrop-hover .ad-modal-dismiss-hint {
    transform: translateX(-50%);
  }
}

/* Trustpilot insights (ad modal) */
.ad-modal-trustpilot-value-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ad-modal-tp-insights-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ad-modal-tp-insights-btn[hidden] {
  display: none !important;
}
.ad-modal-tp-insights-btn:hover {
  background: #fff;
  border-color: #cbd5e1;
}
.ad-modal-tp-insights-btn-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.ad-modal-tp-layer {
  position: fixed;
  inset: 0;
  z-index: 11050;
}
.ad-modal-tp-layer[hidden] {
  display: none !important;
}
.ad-modal-tp-layer.out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.ad-modal-tp-layer.in {
  opacity: 1;
  visibility: visible;
}
.ad-modal-tp-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(15, 23, 42, 0.55);
}
.ad-modal-tp-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: min(28rem, calc(100% - 32px));
  max-height: 90vh;
  min-height: 22rem;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.ad-modal-tp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.ad-modal-tp-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  line-height: 1.3;
}
.ad-modal-tp-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
}
.ad-modal-tp-close svg {
  width: 1.25rem;
  height: 1.25rem;
}
.ad-modal-tp-close:hover {
  background: #f1f5f9;
  color: #334155;
}
.ad-modal-tp-intro {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0 0 14px;
  line-height: 1.45;
  flex-shrink: 0;
}
.ad-modal-tp-insights-reply-wrap {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  width: 100%;
}
.ad-modal-tp-insights-reply-wrap[hidden] {
  display: none !important;
}
.ad-modal-tp-insights-reply-heading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin: 0 0 10px;
}
.ad-modal-tp-reply-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  width: 100%;
}
.ad-modal-tp-reply-stat-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5b6b82;
  line-height: 1.3;
  margin-bottom: 1px;
}
.ad-modal-tp-reply-stat-value {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.35;
}
.ad-modal-tp-reply-stat-value--sub {
  font-size: 10px;
  font-weight: 500;
  color: #64748b;
}
.ad-modal-tp-reply-stat--full {
  grid-column: 1 / -1;
}
.ad-modal-tp-scroll {
  flex: 1;
  min-height: 16rem;
  max-height: min(52vh, 28rem);
  overflow-y: auto;
  position: relative;
}
.ad-modal-tp-scroll::-webkit-scrollbar {
  width: 6px;
}
.ad-modal-tp-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.ad-modal-tp-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px 0;
}
.ad-modal-tp-skeleton[hidden] {
  display: none !important;
}
.ad-modal-tp-skel-shimmer {
  background: linear-gradient(90deg, #f1f5f9 0%, #e8edf3 45%, #f1f5f9 90%);
  background-size: 200% 100%;
  animation: adModalTpShimmer 1.15s ease-in-out infinite;
}
@keyframes adModalTpShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.ad-modal-tp-insight-skel {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.ad-modal-tp-insight-skel-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.ad-modal-tp-insight-skel-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.ad-modal-tp-skel-line {
  height: 10px;
  border-radius: 4px;
}
.ad-modal-tp-skel-line--md {
  width: 88%;
}
.ad-modal-tp-skel-line--sm {
  width: 62%;
}
.ad-modal-tp-insights-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}
.ad-modal-tp-insights-list[hidden] {
  display: none !important;
}
.ad-modal-tp-insight-row {
  position: relative;
  margin-bottom: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.ad-modal-tp-insight-row:last-child {
  margin-bottom: 0;
}
.ad-modal-tp-insight-row::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 15px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #00B67A;
  z-index: 1;
}
.ad-modal-tp-insight-head,
.ad-modal-tp-insight-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px 10px 26px;
  margin: 0;
  border: 0;
  background: transparent;
  font-size: 0.8125rem;
  color: #334155;
  line-height: 1.45;
  text-align: left;
  box-sizing: border-box;
}
.ad-modal-tp-insight-toggle {
  cursor: pointer;
}
.ad-modal-tp-insight-toggle:hover {
  background: #f1f5f9;
}
.ad-modal-tp-insight-text {
  flex: 1;
  min-width: 0;
}
.ad-modal-tp-insight-count {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #475569;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
.ad-modal-tp-insight-chevron {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #94a3b8;
  border-bottom: 1.5px solid #94a3b8;
  transform: rotate(45deg);
  margin-top: -2px;
  transition: transform 0.15s ease;
}
.ad-modal-tp-insight-row.is-expanded .ad-modal-tp-insight-chevron {
  transform: rotate(225deg);
  margin-top: 2px;
}
.ad-modal-tp-insight-reviews {
  border-top: 1px solid #e2e8f0;
  padding: 8px 10px 10px;
  background: #fff;
}
.ad-modal-tp-gap-review-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #f8fafc;
}
.ad-modal-tp-gap-review-card:last-child {
  margin-bottom: 0;
}
.ad-modal-tp-gap-review-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.ad-modal-tp-gap-review-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1e293b;
}
.ad-modal-tp-gap-review-date {
  font-size: 0.6875rem;
  color: #64748b;
}
.ad-modal-tp-gap-review-stars {
  display: flex;
  align-items: center;
  gap: 1px;
  margin: 2px 0 0;
  line-height: 0;
}
.ad-modal-tp-gap-review-stars .st-tp-star {
  display: block;
  flex-shrink: 0;
}
.ad-modal-tp-gap-review-text {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: #475569;
  line-height: 1.45;
}
.ad-modal-tp-insight-reviews-loading,
.ad-modal-tp-insight-reviews-empty {
  font-size: 0.75rem;
  color: #64748b;
  padding: 4px 2px 6px;
}
.ad-modal-tp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  min-height: 12rem;
  padding: 16px 12px;
}
.ad-modal-tp-empty[hidden] {
  display: none !important;
}
.ad-modal-tp-empty-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  margin: 0;
}
.ad-modal-tp-empty-hint {
  font-size: 0.75rem;
  color: #5b6b82;
  margin: 0;
  max-width: 16rem;
  line-height: 1.45;
}
.ad-modal-tp-footer {
  flex-shrink: 0;
  padding-top: 12px;
  min-height: 46px;
}
.ad-modal-tp-load-more-wrap {
  display: flex;
  justify-content: center;
}
.ad-modal-tp-load-more-wrap[hidden] {
  display: none !important;
}
.ad-modal-tp-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.ad-modal-tp-load-more:hover:not(:disabled) {
  border-color: #cbd5e1;
  color: #1e293b;
}
.ad-modal-tp-load-more:disabled {
  opacity: 0.7;
  cursor: default;
}
body.ad-modal-tp-open {
  overflow: hidden;
}

/* =============================================================================
   Dark mode — Transcript tab only (ad-modal.css loads after dark-mode.css)
   ============================================================================= */

/* --- Transcript tab (segments, script analysis, similar scripts) --- */
html[data-theme="dark"] .ad-modal-transcript-card {
  background: var(--dk-surface-2, #0f172a) !important;
}
html[data-theme="dark"] .ad-modal-transcript-body {
  background: var(--dk-surface, #1e293b) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-transcript-segment + .ad-transcript-segment {
  border-top-color: var(--dk-border, #334155) !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-transcript-segment:hover {
  background: var(--dk-surface-2, #0f172a) !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-transcript-segment--seekable:active {
  background: rgba(34, 90, 234, 0.18) !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-transcript-segment--seekable:focus-visible {
  outline-color: rgba(91, 140, 255, 0.55) !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-transcript-line {
  color: #ffffff !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-transcript-ts {
  color: #5b8cff !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-transcript-copy-icon-btn {
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-transcript-copy-icon-btn:hover {
  background: rgba(34, 90, 234, 0.22) !important;
  color: #93c5fd !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-script-analysis-section,
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-scripts-section {
  border-top-color: var(--dk-border, #334155) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-script-analysis-section h4,
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-scripts-section h4 {
  color: #ffffff !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-script-analysis-section details {
  background: var(--dk-surface-2, #0f172a) !important;
  border-color: var(--dk-border, #334155) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-script-analysis-section details summary,
html[data-theme="dark"] .ad-modal-transcript-body .ad-script-analysis-section details summary span,
html[data-theme="dark"] .ad-modal-transcript-body .ad-script-analysis-section .ad-script-analysis-chevron {
  color: #ffffff !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-script-analysis-section details > div {
  background: var(--dk-surface, #1e293b) !important;
  color: #ffffff !important;
  border-top-color: var(--dk-border, #334155) !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-script-analysis-section details > div strong,
html[data-theme="dark"] .ad-modal-transcript-body .ad-script-analysis-section details > div p {
  color: #ffffff !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-script-plus-btn {
  background: var(--dk-surface-2, #0f172a) !important;
  border-color: var(--dk-border, #334155) !important;
  color: #5b8cff !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-script-acc {
  border-color: var(--dk-border, #334155) !important;
  background: var(--dk-surface-2, #0f172a) !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-script-acc > summary {
  background: var(--dk-surface-2, #0f172a) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-script-acc > summary span,
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-script-acc .ad-similar-script-chevron {
  color: #ffffff !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-script-acc > div {
  background: var(--dk-surface, #1e293b) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-script-acc table,
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-script-acc th,
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-script-acc td {
  color: #ffffff !important;
  border-color: var(--dk-border, #334155) !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-script-acc th {
  background: var(--dk-surface-2, #0f172a) !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-script-generations-quota {
  background: rgba(34, 90, 234, 0.14) !important;
  border-color: rgba(91, 140, 255, 0.35) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .ad-modal-transcript-toolbar button {
  background: var(--dk-surface-3, #334155) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .ad-modal-transcript-action {
  background: #2563eb !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .ad-modal-transcript-action:hover {
  background: #1d4ed8 !important;
}

/* Similar scripts (inside Transcript tab) — catch remaining light inline cards */
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-scripts-section,
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-scripts-section * {
  border-color: var(--dk-border, #334155);
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-scripts-section a {
  color: #93c5fd !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-scripts-section > div,
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-script-acc,
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-script-acc > summary,
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-script-acc > div {
  background: var(--dk-surface-2, #0f172a) !important;
  color: #ffffff !important;
  border-color: var(--dk-border, #334155) !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-script-acc > div {
  background: var(--dk-surface, #1e293b) !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-script-acc th {
  background: var(--dk-surface-2, #0f172a) !important;
  color: #ffffff !important;
  border-bottom-color: var(--dk-border, #334155) !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-script-acc td {
  color: #ffffff !important;
  border-bottom-color: var(--dk-border, #334155) !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-similar-script-plus-btn + span {
  background: var(--dk-surface, #1e293b) !important;
  border-color: var(--dk-border, #334155) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-script-csv-dl-btn {
  background: var(--dk-surface-3, #334155) !important;
  border-color: var(--dk-border-strong, #475569) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .ad-modal-transcript-body .ad-script-csv-dl-btn:hover {
  background: var(--dk-border-strong, #475569) !important;
}
/* Beat inline light styles on Similar Scripts empty/upgrade cards */
html[data-theme="dark"] #ad-detail-modal .ad-similar-scripts-section > div,
html[data-theme="dark"] #ad-detail-modal .ad-similar-scripts-section h4 {
  background: var(--dk-surface-2, #0f172a) !important;
  color: #ffffff !important;
  border-color: var(--dk-border, #334155) !important;
}
html[data-theme="dark"] #ad-detail-modal .ad-similar-scripts-section a {
  color: #93c5fd !important;
}
html[data-theme="dark"] #ad-detail-modal .ad-similar-script-acc th {
  background: var(--dk-surface-2, #0f172a) !important;
  color: #ffffff !important;
  border-bottom-color: var(--dk-border, #334155) !important;
}
html[data-theme="dark"] #ad-detail-modal .ad-similar-script-acc td {
  color: #ffffff !important;
  border-bottom-color: var(--dk-border, #334155) !important;
}

/* Create similar script popup (opened from ad modal Transcript) */
html[data-theme="dark"] #ad-similar-script-modal .ad-similar-script-modal-inner {
  background: var(--dk-surface, #1e293b) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}
html[data-theme="dark"] #ad-similar-script-modal .ad-similar-script-modal-inner > div:first-child {
  border-bottom-color: var(--dk-border, #334155) !important;
}
html[data-theme="dark"] #ad-similar-script-modal h3,
html[data-theme="dark"] #ad-similar-script-modal label,
html[data-theme="dark"] #ad-similar-script-modal .ad-similar-script-modal-close {
  color: #ffffff !important;
}
html[data-theme="dark"] #ad-similar-script-modal input,
html[data-theme="dark"] #ad-similar-script-modal textarea,
html[data-theme="dark"] #ad-similar-script-modal select {
  background: var(--dk-surface-2, #0f172a) !important;
  border-color: var(--dk-border-strong, #334155) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] #ad-similar-script-modal input::placeholder,
html[data-theme="dark"] #ad-similar-script-modal textarea::placeholder {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .ad-modal-views-inner {
  background: var(--dk-surface-3, #334155);
  color: #e5e7eb;
}
html[data-theme="dark"] .ad-modal-views-icon,
html[data-theme="dark"] .ad-modal-views-help {
  color: #94a3b8;
}
html[data-theme="dark"] .ad-modal-views-text {
  color: #f1f5f9;
}
html[data-theme="dark"] .ad-modal-views-period,
html[data-theme="dark"] .ad-modal-views-sep,
html[data-theme="dark"] .ad-modal-views.is-loading .ad-modal-views-text {
  color: #94a3b8;
}
