/* ============================================================
   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 {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  -webkit-backdrop-bilter: blur(6px);
  fackdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  -webkit-backdrop-bilter: blur(6px);
  fackdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  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: center;
  justify-content: center;
}

/* --- Sheet Container --- */
.ad-modal-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1200px;
  max-height: calc(100vh - 40px);
  margin: 20px;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.23, 1, 0.32, 1),
              opacity 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}

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

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

.ad-modal-left-scroll {
  overflow: hidden;
  position: relative;
  padding: 32px;
  display: flex;
  flex-direction: column;
  /* Vertically center the preview (float + card) in the left pane */
  justify-content: center;
  align-items: center;
  height: 100%;
}

/* --- Floating Action Buttons (vertical icon row: Share · Download · Open link) --- */
.ad-modal-floating-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  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);
  z-index: 1000;
}
.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 svg {
  width: 18px;
  height: 18px;
}
.ad-float-icon-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  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;
  white-space: nowrap;
  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 {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.text-subdued {
  color: #a1a1aa;
  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: 420px;
  width: 100%;
  margin: 0;
  padding-bottom: 24px;
  z-index: 10;
  background: #fff;
  border: 1px solid #f2f2f2;
  border-radius: 15px;
  overflow: hidden;
}

/* 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: #999;
  margin-top: 2px;
}

/* Page info row */
.adm-page-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid #f2f2f2;
  cursor: pointer;
  text-decoration: none;
  gap: 4px;
  transition: background 0.15s;
}
.adm-page-row:hover {
  background: #fafafa;
}
.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-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: #94a3b8;
  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;
}
.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: 250px;
  max-height: 620px;
  overflow: hidden;
}
.adm-media img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}
.adm-media video {
  width: 100%;
  height: 100%;
  max-height: 620px;
  object-fit: contain;
  display: block;
}

/* Facebook CTA bar */
.adm-cta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  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: #94a3b8;
  display: flex;
  gap: 4px;
  align-items: center;
}

/* Ad information section */
.adm-info-section {
  padding: 6px 12px 4px;
}
.adm-info-label {
  font-size: 11px;
  color: #94a3b8;
  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;
  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: 500px;
  height: 100%;
  background: #fff;
  border-left: 1px solid #e5e5e5;
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
  min-height: 0;
  overflow: hidden;
}

.ad-modal-right-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px 10px;
  min-height: 0;h
  width: 6px;
}
.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: 12px;
  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;
}

/* --- Breadcrumb --- */
.ad-info-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 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;
}
.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;
}

/* --- 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;
}
.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-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;
}

/* --- Info Cards Row --- */
.ad-info-cards-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.ad-info-card {
  flex: 1;
  background: #fafafa;
  border-radius: 10px;
  padding: 3px;
  min-width: 0;
}
.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-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-value {
  font-size: 13px;
  font-weight: 500;
  color: #71717a;
  display: flex;
  align-items: center;
  gap: 4px;
}
.info-row-value .active-dot-sm {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}
.info-row-value .platform-icon {
  width: 14px;
  height: 14px;l
  transition: color 0.2s;
}
.info-row-value .platform-icon:hover {
  color: #3f3f46;
}

/* --- 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-modal-canvas {
  width: 100% !important;
  max-height: 96px;
}

/* --- Landing Page Card --- */
.ad-info-landing-card {
  background: #fafafa;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 6px;
}
.ad-landing-url-row {
  padding: 0 4px 4px;
}
.ad-landing-link {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 5px 10px;
  background: #fff;
  border-radius: 8px;
  text-decoration: none;
  color: #1a1a1a;
  transition: color 0.15s;
}
.ad-landing-link:hover {
  color: #2563eb;
}
.landing-url-text {
  font-size: 13px;
  color: inherit;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}
.landing-ext-icon {
  width: 16px;
  height: 16px;
  color: #a1a1aa;
  flex-shrink: 0;
  margin-top: 2px;
}

/* --- Text Card (Description) --- */
.ad-info-text-card {
  background: #fafafa;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 6px;
}
.ad-info-text-body {
  padding: 0 8px 6px;
  font-size: 12px;
  line-height: 1.5;
  color: #3f3f46;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 150px;
  overflow-y: auto;
}
.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: #a1a1aa !important;
}
.ad-price-discount {
  color: #15803d !important;
  font-weight: 600 !important;
}

/* --- Quick Actions Card --- */
.ad-info-actions-card {
  background: #fafafa;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 6px;
}
.ad-actions-primary-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 3px 3px 6px;
}
.ad-actions-primary-row:empty {
  display: none;
  padding: 0;
}
.ad-action-item.ad-action-item--primary {
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #0a0a0a;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.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: 18px;
  height: 18px;
  color: #fff;
  flex-shrink: 0;
}
.ad-action-item.ad-action-item--primary:hover {
  background: #1f1f1f;
  color: #fff;
}
.ad-action-item.ad-action-item--primary:hover svg {
  color: #fff;
}
.ad-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 0 0 3px;
}
.ad-action-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 8px;
  background: #fff;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: #1a1a1a;
  font-size: 12px;owe
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  text-align: left;
  line-height: 1.25;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad-action-item > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-action-item:hover {
  background: #f0f0f0;
  color: #0a0a0a;
}
.ad-action-item svg {
  width: 14px;
  height: 14px;e
  color: #71717a;
  transition: color 0.15s;
}
.ad-action-item:hover svg {
  color: #3f3f46;
}

/* ============================================================
   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-modal-sheet {
    margin: 12px;
    max-height: calc(100vh - 24px);
    max-width: calc(100% - 24px);
    border-radius: 16px;
  }
  .ad-modal-inner {
    flex-direction: column;
  }
  .ad-modal-right {
    width: 100%;
    border-left: none;
    border-top: 1px solid #e5e5e5;
    border-top-right-radius: 0;
  }
  .ad-modal-ad-card {
    max-width: 100%;
    width: 100%;
  }
  .ad-modal-floating-actions {
    margin-right: 12px;
  }
  .ad-info-cards-row {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .ad-modal-sheet {
    margin: 8px;
    max-height: calc(100vh - 16px);
    max-width: calc(100% - 16px);
  }
  .ad-modal-right {
    width: 100%;
  }
  .ad-info-spend-card {
    flex-direction: column;
  }
  .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 adModalFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
#ad-detail-modal.open .ad-modal-sheet {
  animation: adModalFadeIn 0.3s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}
