/* AiHaber ad units — AdSense-safe wrappers */
.aihaber-ad {
  position: relative;
  margin: 18px 0;
  padding: 12px;
  background: var(--paper-soft, #fafaf5);
  border: 1px solid var(--paper-line, #ebeae5);
  text-align: center;
  overflow: hidden;
  max-width: 100%;
}
.aihaber-ad__label {
  display: block;
  font: 700 9px/1 var(--font-mono, monospace);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 8px;
}
.aihaber-ad iframe,
.aihaber-ad ins {
  max-width: 100% !important;
}
.aihaber-ad--masthead,
.aihaber-ad--ad_masthead {
  margin: 0;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}
.aihaber-ad--ad_header,
.aihaber-ad--header {
  max-width: 970px;
  margin-left: auto;
  margin-right: auto;
}
.aihaber-ad--ad_320x250,
.aihaber-ad--ad_sidebar,
.aihaber-ad--ad_sidebar_left,
.aihaber-ad--ad_sidebar_right {
  max-width: 336px;
  margin-left: auto;
  margin-right: auto;
}
.aihaber-ad--in-content,
.aihaber-ad--ad_in_content {
  margin: 28px auto;
}

/* Popup */
.aihaber-ad-popup {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.aihaber-ad-popup[hidden] { display: none !important; }
.aihaber-ad-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}
.aihaber-ad-popup__dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid #ebeae5;
  padding: 28px 18px 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
.aihaber-ad-popup__close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #333;
}
.aihaber-ad-popup .aihaber-ad { border: 0; margin: 0; background: transparent; padding: 0; }

/* Bottom toast / sticky notice */
.aihaber-ad-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 99980;
  max-width: 420px;
  margin: 0 auto;
  background: #0a0a0a;
  color: #fff;
  border: 1px solid #222;
  padding: 14px 40px 14px 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
.aihaber-ad-toast[hidden] { display: none !important; }
.aihaber-ad-toast__close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #cdfa00;
  font-size: 20px;
  cursor: pointer;
}
.aihaber-ad-toast .aihaber-ad {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  color: inherit;
}
.aihaber-ad-toast .aihaber-ad__label { color: #888; }

@media (min-width: 900px) {
  .aihaber-ad-toast {
    left: auto;
    right: 24px;
    bottom: 24px;
    margin: 0;
  }
}

[data-theme="dark"] .aihaber-ad {
  background: #1c1c1c;
  border-color: #2a2a2a;
}
[data-theme="dark"] .aihaber-ad-popup__dialog {
  background: #1c1c1c;
  border-color: #333;
  color: #f5f5f0;
}
