/* ============================================================
   ad-link.css — «Реклама из ссылки» (/ad-link). Самодостаточно.
   ============================================================ */

body[data-page="ad-link"] .studio-empty,
body[data-page="ad-link"] .composer-wrap { display: none !important; }

.al-root { display: flex; flex-direction: column; gap: 14px; max-width: 600px; margin: 0 auto; width: 100%; padding: 8px 0 40px; }

.al-head { text-align: center; margin-bottom: 4px; }
.al-head-ic { width: 50px; height: 50px; margin: 0 auto 8px; color: var(--accent, #E4F482); }
.al-head-ic svg { width: 100%; height: 100%; }
.al-head h2 { margin: 0 0 6px; font-family: var(--font-display, inherit); font-size: 21px; font-weight: 700; }
.al-head p { margin: 0; color: var(--text-3, #8a8a93); font-size: 13.5px; line-height: 1.5; }

.al-urlrow { display: flex; gap: 9px; }
.al-url {
  flex: 1; background: rgba(255,255,255,.04); border: 1px solid var(--line, rgba(255,255,255,.08));
  border-radius: 13px; padding: 14px 16px; color: var(--text, #fff); font-family: inherit; font-size: 14px;
}
.al-url:focus { outline: none; border-color: var(--accent, #E4F482); }
.al-load { width: auto !important; white-space: nowrap; padding: 13px 18px !important; }

.al-or { text-align: center; color: var(--text-3, #8a8a93); font-size: 13px; }
.al-up { background: none; border: 0; color: var(--accent, #E4F482); font-family: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; padding: 0; }

/* сцена */
.al-stage-wrap { position: relative; border-radius: 16px; overflow: hidden; background: rgba(0,0,0,.2); }
.al-base { display: block; width: 100%; height: auto; max-height: 52vh; object-fit: contain; }
.al-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(10,10,14,.74); backdrop-filter: blur(4px); z-index: 5; }
.al-overlay span { color: var(--text-2, #c7c7cf); font-size: 13.5px; }

.lg-name {
  background: rgba(255,255,255,.04); border: 1px solid var(--line, rgba(255,255,255,.08));
  border-radius: 13px; padding: 13px 16px; color: var(--text, #fff);
  font-family: inherit; font-size: 15px; font-weight: 600;
}
.lg-name:focus { outline: none; border-color: var(--accent, #E4F482); }
.lg-name::placeholder { color: var(--text-3, #8a8a93); font-weight: 400; }

.pc-label { font-family: var(--font-ui, inherit); font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3, #8a8a93); }
.al-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 9px; }
.pc-style {
  display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center;
  background: rgba(255,255,255,.04); color: var(--text-2, #c7c7cf);
  border: 1px solid var(--line, rgba(255,255,255,.08)); border-radius: 13px;
  padding: 13px 8px; font-family: inherit; font-weight: 600; font-size: 12px; cursor: pointer;
  transition: background .14s, color .14s, border-color .14s;
}
.pc-style svg { width: 22px; height: 22px; }
.pc-style:hover { background: rgba(255,255,255,.07); }
.pc-style.active { background: #ffffff; color: var(--accent-ink, #1a1f05); border-color: transparent; }

.al-formats { display: flex; flex-wrap: wrap; gap: 8px; }
.al-formats .pc-fmt {
  background: rgba(255,255,255,.04); color: var(--text-2, #c7c7cf);
  border: 1px solid var(--line, rgba(255,255,255,.08)); border-radius: 11px;
  padding: 9px 14px; font-family: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer;
  transition: background .14s, color .14s, border-color .14s;
}
.al-formats .pc-fmt:hover { background: rgba(255,255,255,.07); }
.al-formats .pc-fmt.active { background: #ffffff; color: var(--accent-ink, #1a1f05); border-color: transparent; }

.al-actions { display: flex; gap: 10px; }
.al-actions .ie-rbtn { flex: none; }
.al-actions .ie-apply { flex: 1; }

.al-result { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.al-result img { max-width: 100%; max-height: 66vh; border-radius: 16px; border: 1px solid var(--line, rgba(255,255,255,.08)); }

.al-spin { width: 16px; height: 16px; border-width: 2px; vertical-align: middle; margin-right: 2px; }

/* ---------- общие .ie-* ---------- */
.ie-apply {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: #ffffff; color: var(--accent-ink, #1a1f05);
  border: 0; border-radius: 13px; padding: 14px 22px;
  font-family: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer;
  box-shadow: 0 10px 26px -12px var(--accent-ring, rgba(228,244,130,.5));
  transition: filter .15s, transform .1s, opacity .15s;
}
.ie-apply:hover { filter: brightness(1.05); }
.ie-apply:active { transform: scale(.98); }
.ie-apply:disabled { opacity: .6; cursor: default; box-shadow: none; }
.ie-apply svg { width: 18px; height: 18px; }
.ie-result-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.ie-rbtn {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.05); color: var(--text, #fff);
  border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: 12px;
  padding: 11px 18px; font-family: inherit; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none;
  transition: background .15s;
}
.ie-rbtn:hover { background: rgba(255,255,255,.09); }
.ie-rbtn.primary { background: #ffffff; color: var(--accent-ink, #1a1f05); border-color: transparent; }
.ie-rbtn svg { width: 16px; height: 16px; }
.ie-spin { display: inline-block; width: 38px; height: 38px; border: 3px solid rgba(255,255,255,.18); border-top-color: var(--accent, #E4F482); border-radius: 50%; animation: ie-spin 1s linear infinite; vertical-align: middle; }
.al-load .ie-spin { border-color: rgba(0,0,0,.18); border-top-color: var(--accent-ink, #1a1f05); }
@keyframes ie-spin { to { transform: rotate(360deg); } }
.ie-err { color: #ff6b8a; font-size: 13px; text-align: center; padding: 4px 0; }

@media (max-width: 820px) {
  .al-root { padding-bottom: 30px; }
  .al-styles { grid-template-columns: repeat(3, 1fr); }
  .al-urlrow { flex-direction: column; }
  .al-load { width: 100% !important; }
}
