/* ---------- App shell ---------- */
.ap-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 768px) { .ap-wrap { padding: 0 16px; } }

.ap-bar { position: sticky; top: 0; z-index: 100; background: rgba(10,10,10,.82); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--zyn-border); }
.ap-bar-inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.ap-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; color: #fff; letter-spacing: -0.02em; }
.ap-nav { display: flex; gap: 4px; }
.ap-nav a { font-size: 14px; color: var(--zyn-muted); padding: 7px 12px; border-radius: 8px; }
.ap-nav a:hover { color: #fff; background: rgba(255,255,255,.04); }
.ap-nav a.is-active { color: #fff; background: var(--zyn-surface2); }
.ap-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.ap-credits { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--zyn-border); background: var(--zyn-surface); font-size: 13px; color: var(--zyn-muted); }
.ap-credits:hover { border-color: #3a3a3a; color: var(--zyn-muted); }
.ap-credits [data-lucide], .ap-credits .lucide { width: 14px; height: 14px; color: var(--zyn-warning); }
.ap-credits b { color: #fff; font-weight: 600; font-family: var(--font-mono); }

.ap-menu { position: relative; }
.ap-avatar { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--zyn-border); background: var(--zyn-gradient); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.ap-drop { position: absolute; right: 0; top: calc(100% + 10px); width: 240px; padding: 6px; border-radius: 12px; background: #141414; border: 1px solid var(--zyn-border); box-shadow: 0 20px 50px -12px rgba(0,0,0,.8); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s; }
.ap-menu.open .ap-drop { opacity: 1; visibility: visible; transform: none; }
.ap-drop-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--zyn-border); margin-bottom: 6px; }
.ap-drop-head b { display: block; font-size: 14px; font-weight: 500; color: #fff; }
.ap-drop-head small { font-size: 12px; color: var(--zyn-muted); word-break: break-all; }
.ap-drop a, .ap-drop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--zyn-text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.ap-drop a:hover, .ap-drop button:hover { background: var(--zyn-surface2); color: #fff; }
.ap-drop [data-lucide], .ap-drop .lucide { width: 16px; height: 16px; color: var(--zyn-muted); }
.ap-drop form { margin: 0; }

.ap-burger { display: none; width: 36px; height: 36px; border: 1px solid var(--zyn-border); border-radius: 9px; background: none; color: #fff; place-items: center; cursor: pointer; }
.ap-mobile { display: none; }

@media (max-width: 820px) {
  .ap-nav { display: none; }
  .ap-burger { display: grid; }
  .ap-credits span { display: none; }
  .ap-mobile { display: grid; gap: 2px; max-height: 0; overflow: hidden; padding: 0 16px; transition: max-height .25s var(--ease), padding .25s var(--ease); }
  .ap-mobile.open { max-height: 320px; padding: 8px 16px 16px; border-top: 1px solid var(--zyn-border); }
  .ap-mobile a { padding: 12px; border-radius: 10px; color: var(--zyn-muted); font-size: 15px; }
  .ap-mobile a.is-active { color: #fff; background: var(--zyn-surface2); }
}

.ap-main { padding: 40px 0 96px; }

/* ---------- Dashboard head ---------- */
.db-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.db-head h1 { font-size: clamp(26px, 3vw, 34px); margin: 0 0 6px; letter-spacing: -0.035em; }
.db-head p { margin: 0; color: var(--zyn-muted); }
.db-credit { display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 14px; border: 1px solid var(--zyn-border); border-radius: 14px; background: var(--zyn-surface); }
.db-credit-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(251,191,36,.1); color: var(--zyn-warning); }
.db-credit-text b { display: block; font-size: 18px; font-weight: 600; color: #fff; line-height: 1.1; font-family: var(--font-mono); }
.db-credit-text span { font-size: 12px; color: var(--zyn-muted); }

/* ---------- Feature cards ---------- */
.db-feats { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 14px; }
.db-feat {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  min-height: 200px; padding: 22px; border-radius: 18px;
  border: 1px solid var(--zyn-border); background: var(--zyn-surface); color: var(--zyn-text);
  font: inherit; cursor: pointer; overflow: hidden;
  opacity: 0; transform: translateY(10px);
  animation: db-in .6s var(--ease) forwards; animation-delay: calc(var(--i) * 70ms);
  transition: border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
}
@keyframes db-in { to { opacity: 1; transform: none; } }
.db-feat:hover { border-color: #3a3a3a; background: #151515; color: var(--zyn-text); }
.db-feat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--zyn-surface2); border: 1px solid var(--zyn-border); color: #fff; }
.db-feat-icon [data-lucide], .db-feat-icon .lucide { width: 20px; height: 20px; }
.db-feat-tags { position: absolute; top: 22px; right: 22px; display: flex; gap: 6px; }
.db-feat-title { margin-top: auto; padding-top: 28px; font-size: 17px; font-weight: 600; color: #fff; letter-spacing: -0.02em; }
.db-feat-desc { margin-top: 4px; font-size: 13.5px; color: var(--zyn-muted); line-height: 1.5; padding-right: 28px; }
.db-feat-go { position: absolute; right: 18px; bottom: 18px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--zyn-muted); transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease); }
.db-feat-go [data-lucide], .db-feat-go .lucide { width: 16px; height: 16px; }
.db-feat:hover .db-feat-go { background: rgba(255,255,255,.08); color: #fff; transform: translate(2px, -2px); }
.db-feat.is-soon .db-feat-icon { color: var(--zyn-muted); }

.db-feat.is-main { background: #fafafa; border-color: #fafafa; color: #0a0a0a; }
.db-feat.is-main::after { content: ""; position: absolute; width: 240px; height: 240px; right: -80px; top: -110px; border-radius: 50%; background: var(--zyn-gradient); opacity: .22; filter: blur(30px); pointer-events: none; }
.db-feat.is-main:hover { background: #fff; border-color: #fff; color: #0a0a0a; }
.db-feat.is-main .db-feat-icon { background: #0a0a0a; border-color: #0a0a0a; color: #fff; }
.db-feat.is-main .db-feat-title { color: #0a0a0a; }
.db-feat.is-main .db-feat-desc { color: #525252; }
.db-feat.is-main .db-feat-go { background: #0a0a0a; color: #fff; }

@media (max-width: 1000px) { .db-feats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .db-feats { grid-template-columns: 1fr; }
  .db-feat { min-height: 0; flex-direction: row; align-items: center; gap: 14px; padding: 16px; }
  .db-feat-title { margin: 0; padding: 0; font-size: 15px; }
  .db-feat-desc { display: none; }
  .db-feat-tags { position: static; order: 3; margin-left: auto; }
  .db-feat-go { position: static; order: 4; }
  .db-feat.is-main .db-feat-go { display: grid; }
  .db-feat:not(.is-main) .db-feat-go { display: none; }
}

/* ---------- Sections ---------- */
.db-section { margin-top: 56px; }
.db-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.db-section-head h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 0 0 4px; letter-spacing: -0.02em; }
.db-section-head h2 [data-lucide], .db-section-head h2 .lucide { width: 18px; height: 18px; color: var(--zyn-muted); }
.db-section-head p { margin: 0; font-size: 14px; color: var(--zyn-muted); }
.db-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--zyn-muted); white-space: nowrap; }
.db-link [data-lucide], .db-link .lucide { width: 15px; height: 15px; }
.db-link:hover { color: #fff; }

/* ---------- Hot niches ---------- */
.db-hot { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.db-hot-card { position: relative; display: flex; flex-direction: column; padding: 20px; border-radius: 16px; border: 1px solid var(--zyn-border); background: var(--zyn-surface); transition: border-color .25s var(--ease), background .25s var(--ease); }
.db-hot-card:hover { border-color: #3a3a3a; background: #151515; }
.db-hot-rank { position: absolute; top: 18px; right: 18px; font-family: var(--font-mono); font-size: 12px; color: var(--zyn-faint); }
.db-hot-card:first-child .db-hot-rank { color: var(--zyn-warning); }
.db-hot-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--zyn-surface2); border: 1px solid var(--zyn-border); color: #fff; margin-bottom: 18px; }
.db-hot-card b { font-size: 15.5px; font-weight: 600; color: #fff; }
.db-hot-card small { font-size: 13px; color: var(--zyn-muted); margin-top: 2px; line-height: 1.45; }
.db-hot-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 14px; margin-bottom: 0; } .db-hot-card small { margin-bottom: 18px; } .db-hot-foot { padding-top: 14px; border-top: 1px solid var(--zyn-border); font-size: 12.5px; color: var(--zyn-faint); }
.db-hot-cta { display: inline-flex; align-items: center; gap: 4px; color: var(--zyn-muted); transition: color .2s var(--ease), gap .2s var(--ease); }
.db-hot-cta [data-lucide], .db-hot-cta .lucide { width: 14px; height: 14px; }
.db-hot-card:hover .db-hot-cta { color: #fff; gap: 7px; }
@media (max-width: 1000px) { .db-hot { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .db-hot { grid-template-columns: 1fr; } }

/* ---------- Recent scripts ---------- */
.db-list { border: 1px solid var(--zyn-border); border-radius: 16px; background: var(--zyn-surface); overflow: hidden; }
.db-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--zyn-border); transition: background .2s var(--ease); }
.db-row:last-child { border-bottom: 0; }
.db-row:hover { background: #161616; }
.db-row-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--zyn-surface2); color: var(--zyn-muted); }
.db-row-main { flex: 1; min-width: 0; }
.db-row-main b { display: block; font-size: 14.5px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-row-main small { font-size: 12.5px; color: var(--zyn-muted); }
.db-row-time { font-size: 13px; color: var(--zyn-faint); white-space: nowrap; }
.db-row-chev { color: var(--zyn-faint); width: 16px !important; height: 16px !important; }
@media (max-width: 480px) { .db-row-time { display: none; } }

.db-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 24px; border: 1px dashed var(--zyn-border); border-radius: 16px; }
.db-empty-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--zyn-surface2); color: var(--zyn-muted); margin-bottom: 16px; }
.db-empty b { font-size: 16px; color: #fff; font-weight: 600; }
.db-empty p { margin: 4px 0 20px; color: var(--zyn-muted); font-size: 14px; }

/* Keep toasts below the sticky top bar on app pages */
.zyn-toasts { top: 76px; }

/* ---------- Create: niche picker ---------- */
.cr-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--zyn-muted); }
.cr-back:hover { color: #fff; }
.cr-back [data-lucide], .cr-back .lucide { width: 16px; height: 16px; }
.cr-head { margin-bottom: 28px; }
.cr-head h1 { font-size: clamp(26px, 3vw, 34px); margin: 18px 0 6px; letter-spacing: -0.035em; }
.cr-head p { margin: 0; color: var(--zyn-muted); max-width: 560px; }
.cr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cr-niche {
  display: flex; align-items: center; gap: 14px; padding: 18px; text-align: left; width: 100%;
  border-radius: 16px; border: 1px solid var(--zyn-border); background: var(--zyn-surface); color: var(--zyn-text);
  font: inherit; cursor: pointer;
  opacity: 0; transform: translateY(8px); animation: db-in .5s var(--ease) forwards; animation-delay: calc(var(--i) * 40ms);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.cr-niche:hover { border-color: #3a3a3a; background: #151515; color: var(--zyn-text); }
.cr-niche-icon { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--zyn-surface2); border: 1px solid var(--zyn-border); color: #fff; }
.cr-niche-text { flex: 1; min-width: 0; }
.cr-niche-text b { display: block; font-size: 15.5px; font-weight: 600; color: #fff; }
.cr-niche-text small { display: block; font-size: 13px; color: var(--zyn-muted); margin-top: 2px; }
.cr-niche-go { color: var(--zyn-faint); transition: transform .2s var(--ease), color .2s var(--ease); }
.cr-niche:hover .cr-niche-go { color: #fff; transform: translateX(3px); }
.cr-niche.is-soon .cr-niche-icon { color: var(--zyn-muted); }
@media (max-width: 900px) { .cr-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .cr-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .ap-wrap { padding: 0 20px; } .ap-main { padding-top: 24px; } }

/* ---------- App footer ---------- */
.ap-foot { border-top: 1px solid var(--zyn-border); padding: 22px 0 28px; font-size: 13px; color: var(--zyn-faint); }
.ap-foot a { color: var(--zyn-faint); }
.ap-foot a:hover { color: #fff; }

/* ---------- Dashboard: Your Channel mini dashboard ---------- */
.db-ch { margin-bottom: 28px; padding: 18px 20px; border-radius: 18px; border: 1px solid var(--zyn-border); background: var(--zyn-surface);
  box-shadow: 0 0 0 1px rgba(255,255,255,.03), 0 0 16px rgba(255,255,255,.07), inset 0 1px 0 rgba(255,255,255,.05); }
.db-ch-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.db-ch-who { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--zyn-text); }
.db-ch-who img, .db-ch-fallback { width: 44px; height: 44px; flex: none; border-radius: 50%; object-fit: cover; border: 1px solid var(--zyn-border); }
.db-ch-fallback { display: grid; place-items: center; font-weight: 600; color: #fff; background: var(--zyn-surface2); }
.db-ch-who b { display: block; font-size: 16px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-ch-who small { font-size: 13px; color: var(--zyn-muted); }
.db-ch-seg { display: inline-flex; padding: 3px; border-radius: 10px; border: 1px solid var(--zyn-border); background: var(--zyn-bg); }
.db-ch-seg button { height: 32px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--zyn-muted); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.db-ch-seg button.is-on { background: var(--zyn-surface2); color: #fff; }

.db-ch-body { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: stretch; }
.db-ch-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.db-ch-stats[hidden] { display: none; }
.db-ch-stat { padding: 14px; border-radius: 12px; background: var(--zyn-bg); border: 1px solid var(--zyn-border); min-width: 0; }
.db-ch-stat small { display: block; font-size: 12px; color: var(--zyn-muted); }
.db-ch-stat b { display: block; margin: 4px 0 2px; font-size: 24px; font-weight: 600; letter-spacing: -0.03em; color: #fff; }
.db-ch-stat span { font-size: 11.5px; color: var(--zyn-faint); }

.db-ch-latest { padding: 14px; border-radius: 12px; background: var(--zyn-bg); border: 1px solid var(--zyn-border); min-width: 0; }
.db-ch-label { display: block; font-size: 12px; color: var(--zyn-muted); margin-bottom: 10px; }
.db-ch-vid { display: flex; gap: 12px; color: var(--zyn-text); }
.db-ch-thumb { display: block; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--zyn-surface2); border: 1px solid var(--zyn-border); }
.db-ch-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.db-ch-vid .db-ch-thumb { width: 132px; flex: none; }
.db-ch-vid-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.db-ch-vid-text b { font-size: 13.5px; font-weight: 500; line-height: 1.35; color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.db-ch-vid-text small { font-size: 12px; color: var(--zyn-faint); }
.db-ch-vid-text em { font-style: normal; font-size: 12px; font-weight: 500; }
.db-ch-vid-text em.is-up { color: #4ade80; } .db-ch-vid-text em.is-down { color: #f87171; }
.db-ch-more { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.db-ch-more a { display: flex; flex-direction: column; gap: 4px; color: var(--zyn-faint); font-size: 11.5px; }

.db-ch-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 14px 0 0; font-size: 12px; color: var(--zyn-faint); }
.db-ch-foot [data-lucide], .db-ch-foot .lucide { width: 13px; height: 13px; }
.db-ch-foot a { color: var(--zyn-muted); text-decoration: underline; text-underline-offset: 2px; }

.db-ch-prompt { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--zyn-border); color: var(--zyn-text); transition: border-color .2s var(--ease); }
.db-ch-prompt:hover { border-color: #3d3d3d; }
.db-ch-prompt-icon { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; color: #ff4e45; background: rgba(255,78,69,.1); }
.db-ch-prompt-icon [data-lucide], .db-ch-prompt-icon .lucide { width: 18px; height: 18px; }
.db-ch-prompt > span:nth-child(2) { flex: 1; min-width: 0; }
.db-ch-prompt b { display: block; font-size: 14.5px; font-weight: 500; color: #fff; }
.db-ch-prompt small { font-size: 13px; color: var(--zyn-muted); }

@media (max-width: 900px) { .db-ch-body { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .db-ch { padding: 16px; }
  .db-ch-seg { width: 100%; } .db-ch-seg button { flex: 1; }
  .db-ch-stat b { font-size: 20px; }
  .db-ch-vid .db-ch-thumb { width: 112px; }
  .db-ch-prompt { flex-wrap: wrap; }
  .db-ch-prompt .zyn-btn { width: 100%; }
}
.db-ch-vid-text em.is-new { color: var(--zyn-muted); }
.db-ch-tag { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; color: var(--zyn-muted); border: 1px solid var(--zyn-border); background: var(--zyn-bg); }
.db-ch-stat .db-ch-up { display: inline-block; margin-top: 2px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: #4ade80; background: rgba(74,222,128,.1); }
.db-ch-stat .db-ch-up.is-down { color: #f87171; background: rgba(248,113,113,.1); }
.cr-niche-cost { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-style: normal; font-size: 12px; color: var(--zyn-faint); }
.cr-niche-cost [data-lucide], .cr-niche-cost .lucide { width: 12px !important; height: 12px !important; color: #fbbf24; }

/* Footer always sits at the bottom, even on short pages */
body.ap-body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body.ap-body > .ap-main { flex: 1 0 auto; }
body.ap-body > .ap-foot { flex-shrink: 0; }

/* Out of credits notice (dashboard, create, wizard) */
.ap-nocredits { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(251,191,36,.3); background: rgba(251,191,36,.07); }
.ap-nocredits-icon { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; color: #fbbf24; background: rgba(251,191,36,.12); }
.ap-nocredits-icon svg { width: 18px; height: 18px; }
.ap-nocredits > div { flex: 1; min-width: 0; }
.ap-nocredits b { display: block; color: #fff; font-size: 15px; font-weight: 600; }
.ap-nocredits span { font-size: 13.5px; color: var(--zyn-muted); }
.ap-nocredits .zyn-btn { flex: none; }
@media (max-width: 560px) { .ap-nocredits { flex-wrap: wrap; } .ap-nocredits .zyn-btn { width: 100%; } }
