/* AdsLibrary — glass UI, mobile-first. No build step needed. */
:root {
  --bg: #070a17;
  --bg-2: #0d1230;
  --glass: rgba(255, 255, 255, .06);
  --glass-2: rgba(255, 255, 255, .1);
  --stroke: rgba(255, 255, 255, .12);
  --text: #eef1ff;
  --muted: #9aa3c7;
  --brand: #7c5cff;
  --brand-2: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 18px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .35);
  --grad: linear-gradient(135deg, var(--brand), var(--brand-2));
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--bg);
  font: 15px/1.55 "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  overflow-x: hidden;
}
body::before, body::after {
  content: ""; position: fixed; z-index: -1; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(90px); opacity: .35; pointer-events: none;
}
body::before { background: #5b3dff; top: -25vmax; left: -20vmax; }
body::after { background: #0ea5b7; bottom: -30vmax; right: -25vmax; opacity: .25; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.02em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Glass */
.glass {
  background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
}
.card { padding: 18px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

/* Layout */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.app { display: block; padding-bottom: 84px; }
.sidebar { display: none; }
.main { padding: 16px; max-width: 1100px; margin: 0 auto; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 0; border-width: 0 0 1px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; }
.brand-mark .icon { color: #fff; width: 18px; height: 18px; }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: space-around; padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; border-width: 1px 0 0; }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; color: var(--muted); padding: 4px 2px; border-radius: 12px; min-width: 0; flex: 1; }
.bottom-nav a.active { color: var(--text); }
.bottom-nav a.active .icon { color: var(--brand-2); }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--muted); font-weight: 600; }
.nav-link:hover { background: var(--glass); color: var(--text); }
.nav-link.active { background: var(--glass-2); color: var(--text); }
.nav-link.active .icon { color: var(--brand-2); }

@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 250px 1fr; padding-bottom: 0; }
  .sidebar { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 16px; height: calc(100vh - 32px); margin: 16px; padding: 18px 12px; }
  .sidebar .brand { padding: 4px 10px 18px; }
  .sidebar .spacer { flex: 1; }
  .bottom-nav, .topbar .brand { display: none; }
  .topbar { position: static; background: none; border: 0; box-shadow: none; backdrop-filter: none; padding: 24px 16px 0; max-width: 1100px; margin: 0 auto; }
  .main { padding: 20px 16px 40px; }
}

/* Grid */
.grid { display: grid; gap: 16px; }
.grid-2, .grid-3 { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grid-4 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 28px; }

/* Stats */
.stat { padding: 16px; }
.stat .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .82rem; font-weight: 600; }
.stat .value { font-size: 1.6rem; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
.stat .icon-wrap { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--glass-2); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 12px;
  border: 1px solid var(--stroke); background: var(--glass-2); color: var(--text); font: inherit; font-weight: 700;
  cursor: pointer; transition: transform .15s ease, opacity .15s ease, background .15s ease; white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, .16); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 24px rgba(124, 92, 255, .35); }
.btn-primary:hover { opacity: .92; background: var(--grad); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--bad); }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--stroke); background: rgba(5, 8, 25, .55);
  color: var(--text); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124, 92, 255, .25); }
.error { color: var(--bad); font-size: .82rem; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.check input { margin-top: 3px; accent-color: var(--brand); }

/* Choice tiles (goals / platforms) */
.tiles { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; border: 1px solid var(--stroke); background: var(--glass); cursor: pointer; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile:has(input:checked) { border-color: var(--brand); background: rgba(124, 92, 255, .14); box-shadow: inset 0 0 0 1px var(--brand); }
.tile.disabled { opacity: .45; cursor: not-allowed; }
.tile .icon-wrap { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--glass-2); flex: none; }

/* Badges + alerts */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--glass-2); border: 1px solid var(--stroke); text-transform: capitalize; }
.badge.ok { color: var(--ok); border-color: rgba(52, 211, 153, .35); }
.badge.warn { color: var(--warn); border-color: rgba(251, 191, 36, .35); }
.badge.bad { color: var(--bad); border-color: rgba(248, 113, 113, .35); }
.badge.info { color: var(--brand-2); border-color: rgba(34, 211, 238, .35); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; margin-bottom: 16px; border: 1px solid; }
.alert.ok { background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .3); }
.alert.bad { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .3); }
.alert.info { background: rgba(34, 211, 238, .08); border-color: rgba(34, 211, 238, .25); }

/* Lists / tables */
.list > * { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--stroke); }
.list > *:last-child { border-bottom: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--stroke); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .icon { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--brand-2); }

/* Bars */
.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.chart .col { flex: 1; min-width: 6px; background: var(--grad); border-radius: 6px 6px 2px 2px; opacity: .85; position: relative; }
.chart .col:hover { opacity: 1; }

/* Landing */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.nav-links { display: none; gap: 26px; color: var(--muted); font-weight: 600; }
@media (min-width: 860px) { .nav-links { display: flex; } }
.hero { padding: 40px 0 30px; text-align: center; }
.hero h1 { font-size: clamp(2.1rem, 7vw, 3.9rem); max-width: 860px; margin: 18px auto 16px; letter-spacing: -.035em; }
.hero p.lead { font-size: clamp(1rem, 2.4vw, 1.2rem); color: var(--muted); max-width: 640px; margin: 0 auto 26px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.logos { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 30px; }
.logos span { padding: 8px 14px; border-radius: 12px; font-weight: 700; font-size: .85rem; color: var(--muted); }
.section { padding: 56px 0; }
.section-title { text-align: center; max-width: 680px; margin: 0 auto 32px; }
.feature .icon-wrap { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); margin-bottom: 14px; }
.feature .icon-wrap .icon { color: #fff; }
.step-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--grad); color: #fff; margin-bottom: 12px; }
.price { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; }
.mock { padding: 16px; max-width: 900px; margin: 34px auto 0; text-align: left; }
.footer { padding: 30px 0 40px; border-top: 1px solid var(--stroke); color: var(--muted); font-size: .88rem; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 440px; padding: 26px 22px; }
.divider { height: 1px; background: var(--stroke); margin: 16px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
details summary { cursor: pointer; font-weight: 700; list-style: none; }
details summary::-webkit-details-marker { display: none; }
.preview { border-radius: 14px; overflow: hidden; background: rgba(255,255,255,.04); border: 1px solid var(--stroke); }
.preview .ph { aspect-ratio: 1.91/1; background: rgba(255,255,255,.06); display: grid; place-items: center; color: var(--muted); }
.preview .ph img { width: 100%; height: 100%; object-fit: cover; }
.preview .body { padding: 12px; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Ads Manager */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--stroke); background: var(--glass); color: var(--muted); font-weight: 600; font-size: .85rem; white-space: nowrap; }
.tab.active { background: var(--grad); color: #fff; border-color: transparent; }
.obj { display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--stroke); }
.obj:last-child { border-bottom: 0; }
.obj-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.obj-title { font-weight: 700; word-break: break-word; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 760px) { .metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.metric { background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 10px; padding: 8px 10px; }
.metric b { display: block; font-size: .95rem; }
.metric span { color: var(--muted); font-size: .72rem; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form .input { padding: 7px 10px; width: 110px; }
.thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; background: var(--glass-2); }
.score { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; flex: none;
  background: conic-gradient(var(--brand-2) calc(var(--v) * 1%), rgba(255,255,255,.08) 0); position: relative; }
.score::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--bg-2); }
.score span { position: relative; z-index: 1; }
.finding { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--stroke); }
.finding:last-child { border-bottom: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; }
.dot.good { background: var(--ok); } .dot.warning { background: var(--warn); } .dot.critical { background: var(--bad); }
.code { background: rgba(0,0,0,.45); border: 1px solid var(--stroke); border-radius: 12px; padding: 12px; font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; color: #cfe3ff; max-height: 260px; overflow: auto; }
.post-card .ph { aspect-ratio: 1/1; }

/* Creative Studio */
.studio-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .studio-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.studio-canvas-wrap { background: repeating-conic-gradient(rgba(255,255,255,.04) 0 25%, transparent 0 50%) 0 0/24px 24px; border: 1px solid var(--stroke); border-radius: 16px; padding: 10px; display: grid; place-items: center; }
.studio-canvas-wrap canvas { width: 100%; height: auto; max-height: 560px; object-fit: contain; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.gallery { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.thumb-btn { width: 64px; height: 64px; border-radius: 12px; border: 2px solid var(--stroke); background: center/cover no-repeat var(--glass-2); cursor: pointer; padding: 0; }
.thumb-btn.active { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(34,211,238,.25); }
button.tab { cursor: pointer; font: inherit; font-weight: 600; font-size: .85rem; }
.autofilled { border-color: rgba(52,211,153,.6) !important; box-shadow: 0 0 0 3px rgba(52,211,153,.15); }
.link-hero { display: flex; gap: 10px; flex-wrap: wrap; }
.link-hero .input { flex: 1; min-width: 0; font-size: 1rem; padding: 14px 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--stroke); background: var(--glass); color: var(--text); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.chip:hover { background: var(--glass-2); }
.estimate { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: rgba(34,211,238,.08); border: 1px solid rgba(34,211,238,.25); font-size: .9rem; }
.ai-pro { padding: 14px; border-radius: 14px; border: 1px solid rgba(124,92,255,.35); background: linear-gradient(135deg, rgba(124,92,255,.12), rgba(34,211,238,.06)); margin-top: 12px; }
.ai-pro:first-child { margin-top: 0; }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; }
.thumb-btn.ai { position: relative; }
.thumb-btn.ai::after { content: "AI"; position: absolute; right: 4px; bottom: 4px; font-size: 10px; font-weight: 800; background: var(--grad); color: #fff; padding: 1px 5px; border-radius: 6px; }
[dir="rtl"] .sidebar, [dir="rtl"] .main { text-align: right; }
[hidden] { display: none !important; }
