/* AINext Prompt Library. Builds on directory.css (shared colours, hero, search, chips, pagination). */
.ainext-prompts { padding-bottom: 72px; }
.ainext-dir.ainext-prompts .ainext-hero__title { text-transform: none; letter-spacing: -.01em; font-size: clamp(2.1rem, 5.5vw, 3.6rem); line-height: 1.1; }
.ainext-prompts .ainext-hero { padding-bottom: 70px; }

/* Hero quick links */
.ainext-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 760px; margin: 22px auto 0; }
.ainext-quick a { padding: 7px 16px; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); color: #fff; font-size: .88rem; font-weight: 600; transition: background .15s, transform .15s; }
.ainext-quick a:hover { background: rgba(255, 255, 255, .26); transform: translateY(-1px); }

/* Browse by platform */
.ainext-platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.ainext-platform { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; text-align: center; background: var(--ad-surface); border: 1px solid var(--ad-border); border-radius: 16px; box-shadow: var(--ad-shadow); color: var(--ad-text); transition: transform .18s, box-shadow .18s, border-color .18s; }
.ainext-platform:hover { transform: translateY(-3px); box-shadow: var(--ad-shadow-hover); border-color: rgba(91, 91, 240, .45); }
.ainext-platform__logo { width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border-radius: 13px; background: hsl(var(--h, 250) 70% 94%); color: hsl(var(--h, 250) 60% 38%); font-size: 1.25rem; font-weight: 800; }
.ainext-platform__logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ainext-platform__name { font-weight: 700; font-size: .98rem; }
.ainext-platform__count { color: var(--ad-muted); font-size: .8rem; }
.ainext-chip__n { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(91, 91, 240, .12); color: var(--ad-accent); font-size: .75rem; font-weight: 700; }
.ainext-chip.is-active .ainext-chip__n { background: rgba(255, 255, 255, .25); color: #fff; }

/* Prompt cards */
.ainext-pgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.ainext-pcard { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 20px; background: var(--ad-surface); border: 1px solid var(--ad-border); border-radius: 18px; box-shadow: var(--ad-shadow); transition: transform .18s, box-shadow .18s, border-color .18s; }
.ainext-pcard:hover { transform: translateY(-4px); box-shadow: var(--ad-shadow-hover); border-color: rgba(91, 91, 240, .45); }
.ainext-pcard__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ainext-pcard__icon { flex: none; width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border-radius: 13px; background: hsl(var(--h, 250) 70% 94%); color: hsl(var(--h, 250) 60% 38%); font-size: 1.25rem; font-weight: 800; }
.ainext-pcard__icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ainext-pcard__badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.ainext-pbadge { padding: 3px 9px; border-radius: 999px; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.ainext-pbadge--editors { background: #fef3c7; color: #92400e; }
.ainext-pbadge--featured { background: #e0e7ff; color: #3730a3; }
.ainext-pbadge--premium { background: #f3e8ff; color: #6b21a8; }
.ainext-dir .ainext-pcard__title { margin: 0; font-size: 1.06rem; font-weight: 700; line-height: 1.3; }
.ainext-pcard__title a { color: var(--ad-text); }
.ainext-pcard__title a:hover { color: var(--ad-accent); }
.ainext-pcard__desc { flex: 1; margin: 0; color: var(--ad-muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ainext-pcard__meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ainext-pcard__meta li { margin: 0; padding: 3px 9px; border-radius: 7px; background: rgba(127, 127, 150, .12); color: var(--ad-muted); font-size: .75rem; font-weight: 600; }
.ainext-pcard__meta .ainext-pcard__platform { background: rgba(91, 91, 240, .1); color: var(--ad-accent); }
.ainext-diff--beginner { background: #dcfce7 !important; color: #166534 !important; }
.ainext-diff--intermediate { background: #fef3c7 !important; color: #92400e !important; }
.ainext-diff--advanced { background: #ffe4e6 !important; color: #9f1239 !important; }
.ainext-pcard__actions { display: flex; gap: 8px; padding-top: 14px; border-top: 1px solid var(--ad-border); }
.ainext-dir .ainext-copy-btn, .ainext-view-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; margin: 0; padding: 10px 12px; border-radius: 12px; font-size: .86rem; font-weight: 700; line-height: 1.2; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.ainext-dir .ainext-copy-btn { border: 0; background: linear-gradient(135deg, var(--ad-accent), var(--ad-accent-2)); color: #fff; }
.ainext-dir .ainext-copy-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(91, 91, 240, .35); }
.ainext-dir .ainext-copy-btn.is-copied { background: #16a34a; }
.ainext-view-btn { border: 1px solid var(--ad-border); background: transparent; color: var(--ad-text); }
.ainext-view-btn:hover { border-color: var(--ad-accent); color: var(--ad-accent); }

/* CTA */
.ainext-cta { padding: 44px 28px; text-align: center; border-radius: 22px; color: #fff; background: radial-gradient(60% 90% at 10% 0%, rgba(139, 92, 246, .55), transparent 60%), linear-gradient(135deg, #17104f 0%, #3a2aa8 60%, #6d3df0 100%); }
.ainext-dir .ainext-cta h2 { margin: 0 0 8px; font-size: clamp(1.4rem, 3vw, 2rem); color: #fff; }
.ainext-cta p { max-width: 520px; margin: 0 auto 22px; color: rgba(255, 255, 255, .8); }

@media (max-width: 1100px) { .ainext-pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .ainext-pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) {
  .ainext-pgrid { grid-template-columns: 1fr; }
  .ainext-platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ainext-quick { gap: 6px; }
}

/* Prompt archive pages (category / platform / use case) */
.ainext-grid--one { grid-template-columns: minmax(0, 340px); }
.ainext-prompts.ainext-term .ainext-hero { padding: 40px 0 70px; }
.ainext-prompts .ainext-backlink { margin-top: 40px; }
@media (max-width: 540px) { .ainext-grid--one { grid-template-columns: 1fr; } }

/* ===== Single prompt page ===== */
.ainext-byline { margin: 18px 0 0; font-size: .88rem; color: rgba(255, 255, 255, .72); }
.ainext-sprompt { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.ainext-diff-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.ainext-tool-meta .ainext-pbadge { padding: 4px 12px; font-size: .78rem; }

/* The prompt box: dark in both light and dark site modes so it always stands out */
.ainext-prompt { overflow: hidden; border-radius: 18px; background: #12142a; border: 1px solid #2b2f55; box-shadow: var(--ad-shadow); }
.ainext-prompt__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 20px; background: #1a1d3b; border-bottom: 1px solid #2b2f55; }
.ainext-dir .ainext-prompt__label { margin: 0; color: #a5b4fc; font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.ainext-prompt__text { max-height: 560px; margin: 0; padding: 20px; overflow: auto; background: transparent; border: 0; border-radius: 0; color: #e8eaff; font: 400 .95rem/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; tab-size: 4; }
.ainext-prompt__text:focus-visible { outline: 2px solid #8b5cf6; outline-offset: -2px; }
.ainext-prompt__text mark.ainext-var { padding: 1px 4px; border-radius: 5px; background: rgba(139, 92, 246, .28); color: #ddd6fe; }
.ainext-dir .ainext-copy-btn--lg { flex: none; padding: 10px 20px; font-size: .9rem; }

/* Content blocks */
.ainext-block h2 { margin: 0 0 14px; font-size: 1.2rem; font-weight: 800; color: var(--ad-text); }
.ainext-block h3 { margin: 20px 0 8px; font-size: .95rem; font-weight: 700; color: var(--ad-muted); text-transform: uppercase; letter-spacing: .06em; }
.ainext-block__intro { margin: 0 0 12px; color: var(--ad-muted); }
.ainext-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.ainext-steps li { position: relative; margin: 0 0 12px; padding-left: 42px; counter-increment: step; line-height: 1.65; }
.ainext-steps li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--ad-accent), var(--ad-accent-2)); color: #fff; font-size: .8rem; font-weight: 800; }
.ainext-vars { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.ainext-vars li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 0; padding: 10px 14px; border: 1px solid var(--ad-border); border-radius: 12px; }
.ainext-vars code { padding: 2px 8px; border-radius: 6px; background: rgba(139, 92, 246, .14); color: var(--ad-accent); font-weight: 700; }
.ainext-vars span { color: var(--ad-muted); }
.ainext-example { padding: 16px 18px; border: 1px solid var(--ad-border); border-radius: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.ainext-example--in { background: rgba(127, 127, 150, .08); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }
.ainext-example--out { border-left: 4px solid var(--ad-accent); }
.ainext-tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.ainext-tips li { position: relative; margin: 0; padding-left: 28px; line-height: 1.65; }
.ainext-tips li::before { content: "✓"; position: absolute; left: 0; top: 0; color: #16a34a; font-weight: 800; }
.ainext-callout { margin: 0 0 12px; padding: 14px 16px; border-radius: 12px; background: rgba(91, 91, 240, .08); border: 1px solid rgba(91, 91, 240, .25); }
.ainext-callout:last-child { margin-bottom: 0; }
.ainext-callout--warn { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .35); }
.ainext-callout strong { display: block; margin-bottom: 4px; }
.ainext-callout p { margin: 0 0 8px; }
.ainext-callout p:last-child { margin: 0; }

/* Details card extras */
.ainext-tags--left { justify-content: flex-start; }
.ainext-aside-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--ad-border); }
.ainext-dir .ainext-aside-block h3 { margin: 0 0 10px; font-size: .85rem; font-weight: 700; color: var(--ad-muted); text-transform: uppercase; letter-spacing: .06em; }
.ainext-share { display: flex; flex-wrap: wrap; gap: 8px; }
.ainext-share a, .ainext-share button { margin: 0; padding: 7px 14px; border: 1px solid var(--ad-border); border-radius: 999px; background: transparent; color: var(--ad-text); font-size: .82rem; font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s; }
.ainext-share a:hover, .ainext-share button:hover { border-color: var(--ad-accent); color: var(--ad-accent); }
.ainext-share button.is-copied { border-color: #16a34a; color: #16a34a; }
.ainext-aside-links { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; font-weight: 600; font-size: .92rem; }
.ainext-aside-links a { color: var(--ad-accent); }
.ainext-aside-links a:hover { text-decoration: underline; }

/* Sticky copy bar (phones) */
.ainext-sticky-copy { display: none; }
@media (max-width: 760px) {
  .ainext-single-prompt { padding-bottom: 92px; }
  .ainext-sticky-copy { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--ad-surface); border-top: 1px solid var(--ad-border); box-shadow: 0 -8px 24px rgba(16, 24, 40, .12); }
  .ainext-sticky-copy .ainext-copy-btn { width: 100%; padding: 14px; font-size: 1rem; }
  .ainext-prompt__text { max-height: 420px; padding: 16px; font-size: .9rem; }
  .ainext-prompt__bar .ainext-copy-btn { display: none; } /* the sticky bar takes over on phones */
}

/* ===== Filter bar, sorting and active filters ===== */
.ainext-filterbar { padding: 22px 0 0; }
.ainext-filters__toggle { display: none; align-items: center; gap: 8px; margin: 0; padding: 10px 18px; border: 1px solid var(--ad-border); border-radius: 999px; background: var(--ad-surface); color: var(--ad-text); font-size: .92rem; font-weight: 700; cursor: pointer; }
.ainext-filters__n { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--ad-accent); color: #fff; font-size: .75rem; text-align: center; }
.ainext-filters__n[hidden] { display: none; }
.ainext-filters { padding: 16px 18px; background: var(--ad-surface); border: 1px solid var(--ad-border); border-radius: 18px; box-shadow: var(--ad-shadow); }
.ainext-filters__head, .ainext-filters__backdrop { display: none; }
.ainext-filters__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.ainext-filter { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ainext-filter > span { color: var(--ad-muted); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ainext-dir .ainext-filter select { width: 100%; height: auto; margin: 0; padding: 10px 12px; border: 1px solid var(--ad-border); border-radius: 12px; background-color: var(--ad-bg); color: var(--ad-text); font-size: .92rem; line-height: 1.3; }
.ainext-dir .ainext-filter select:focus { outline: 2px solid var(--ad-accent); outline-offset: 1px; }
.ainext-filters__foot { display: none; gap: 10px; align-items: center; margin-top: 16px; }
.ainext-filters__apply { flex: 1; padding: 12px; border: 0; border-radius: 12px; background: linear-gradient(135deg, var(--ad-accent), var(--ad-accent-2)); color: #fff; font-weight: 700; cursor: pointer; }
.ainext-filters__clear { color: var(--ad-muted); font-weight: 600; font-size: .9rem; }

.ainext-active { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.ainext-fchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(91, 91, 240, .1); color: var(--ad-accent); font-size: .82rem; font-weight: 600; }
.ainext-fchip:hover { background: rgba(91, 91, 240, .2); }
.ainext-fchip--clear { background: transparent; color: var(--ad-muted); text-decoration: underline; }
.ainext-pdyn { transition: opacity .15s; }
.ainext-pdyn.is-loading { opacity: .45; pointer-events: none; }

/* Phones: the filters become a bottom drawer */
@media (max-width: 760px) {
  .ainext-filters__toggle { display: inline-flex; }
  .ainext-filters { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001; max-height: 86vh; overflow-y: auto; padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0; transform: translateY(105%); transition: transform .25s ease; box-shadow: 0 -16px 40px rgba(16, 24, 40, .25); }
  .ainext-filters.is-open { transform: translateY(0); }
  .ainext-filters__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 1.05rem; color: var(--ad-text); }
  .ainext-filters__close { margin: 0; padding: 0 8px; border: 0; background: transparent; color: var(--ad-muted); font-size: 1.8rem; line-height: 1; cursor: pointer; }
  .ainext-filters__grid { grid-template-columns: 1fr 1fr; }
  .ainext-filter--sort { grid-column: 1 / -1; }
  .ainext-filters__foot { display: flex; }
  .ainext-filters__backdrop { position: fixed; inset: 0; z-index: 1000; display: block; margin: 0; padding: 0; border: 0; background: rgba(10, 8, 40, .55); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .ainext-filters-open ~ .ainext-filters__backdrop, .ainext-filters-open .ainext-filters__backdrop { opacity: 1; pointer-events: auto; }
}
html.ainext-lock { overflow: hidden; }

/* ===== Copy feedback and prompt box controls ===== */
.ainext-dir .ainext-copy-btn.is-failed { background: #dc2626; }
.ainext-share button.is-failed { border-color: #dc2626; color: #dc2626; }
.ainext-prompt__actions { display: flex; align-items: center; gap: 10px; }
.ainext-prompt__expand { margin: 0; padding: 8px 14px; border: 1px solid #3a3f6e; border-radius: 10px; background: transparent; color: #c7d2fe; font-size: .82rem; font-weight: 600; cursor: pointer; }
.ainext-prompt__expand:hover { background: rgba(255, 255, 255, .08); }
.ainext-prompt__expand[hidden] { display: none; }
.ainext-prompt__text.is-expanded { max-height: none; }

/* ===== Recommended AI tool ===== */
.ainext-rtool__card { display: flex; align-items: center; gap: 18px; padding: 18px; border: 1px solid var(--ad-border); border-radius: 16px; background: linear-gradient(135deg, rgba(91, 91, 240, .07), rgba(139, 92, 246, .04)); }
.ainext-rtool__card .ainext-card__logo { flex: none; width: 64px; height: 64px; border-radius: 16px; font-size: 1.6rem; }
.ainext-rtool__body { flex: 1; min-width: 0; }
.ainext-rtool__eyebrow { margin: 0 0 2px; color: var(--ad-muted); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ainext-block .ainext-rtool__name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--ad-text); font-size: 1.2rem; letter-spacing: 0; text-transform: none; }
.ainext-rtool__desc { margin: 0; color: var(--ad-muted); font-size: .92rem; }
.ainext-rtool__actions { display: flex; flex-direction: column; gap: 8px; flex: none; }
.ainext-rtool .ainext-btn { padding: 10px 20px; font-size: .88rem; white-space: nowrap; }
.ainext-rtool .ainext-btn--primary { background: linear-gradient(135deg, var(--ad-accent), var(--ad-accent-2)); color: #fff; box-shadow: none; }
.ainext-rtool .ainext-btn--outline { border: 1px solid var(--ad-border); background: transparent; color: var(--ad-text); }
.ainext-rtool .ainext-btn--outline:hover { border-color: var(--ad-accent); color: var(--ad-accent); }
@media (max-width: 640px) {
  .ainext-rtool__card { flex-direction: column; align-items: flex-start; }
  .ainext-rtool__actions { width: 100%; }
  .ainext-rtool .ainext-btn { width: 100%; }
}

/* ===== Mobile polish and accessibility ===== */
@media (max-width: 760px) {
  .ainext-dir .ainext-copy-btn, .ainext-view-btn, .ainext-filters__toggle, .ainext-share a, .ainext-share button { min-height: 44px; }
  .ainext-prompts .ainext-hero { padding: 44px 0 52px; }
  .ainext-search { margin-top: 24px; }
  .ainext-pcard { padding: 16px; }
  .ainext-panel { padding: 20px; }
  .ainext-vars li { flex-direction: column; gap: 4px; }
}
.ainext-dir a:focus-visible, .ainext-dir button:focus-visible, .ainext-dir select:focus-visible { outline: 2px solid var(--ad-accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .ainext-prompts *, .ainext-filters, .ainext-pdyn { transition: none !important; }
}
