/* =====================================================================
   Pixel Prompt — design tokens (brand: midnight teal #041620 / fiery orange #eb5329)
   ===================================================================== */
:root {
  --bg: #041620;
  --bg-2: #061c28;
  --surface: #0a2230;
  --surface-2: #0f2b3b;
  --surface-3: #143546;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f4f1ec;
  --muted: #8ea3ae;
  --paper: #f9f9f9;
  --brand: #ff6114;
  --brand-2: #eb5329;
  --brand-soft: rgba(235, 83, 41, 0.14);
  --brand-glow: rgba(255, 97, 20, 0.35);
  --gold: #e9b44c;
  --silver: #c8d2d8;
  --ok: #3ccf91;
  --warn: #f2b84b;
  --bad: #ff5d5d;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --font-latin: 'Quicksand', var(--font);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand); color: #fff; }

.muted { color: var(--muted); }
.err { color: var(--bad); font-size: 13px; }
.center { display: flex; justify-content: center; align-items: center; }
.pad { padding: 48px 0; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; letter-spacing: 0.02em; }
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-gap { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.span-2 { grid-column: 1 / -1; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); display: inline-block; box-shadow: 0 0 0 4px var(--brand-soft); }

/* ------------------------------------------------------------------ logo */
.logo { display: inline-flex; align-items: center; gap: 10px; direction: ltr; }
.logo-word { display: flex; flex-direction: column; font-family: var(--font-latin); font-weight: 600; line-height: 0.95; }
.lw-pixel { color: var(--brand); font-size: 1.15em; }
.lw-prompt { color: var(--paper); padding-inline-start: 0.9em; }
.logo-mark rect { transform-box: fill-box; transform-origin: center; }
.logo:hover .lm-white { animation: pix-hop 0.6s ease; }
.logo:hover .lm-sq { animation: pix-hop 0.6s 0.1s ease; }
@keyframes pix-hop { 50% { transform: translateY(-14%); } }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 600; white-space: nowrap;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-brand { background: var(--brand); color: #fff; box-shadow: 0 10px 30px -10px var(--brand-glow); }
.btn-brand:hover:not(:disabled) { background: #ff7330; }
.btn-glass { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.btn-glass:hover { background: rgba(255, 255, 255, 0.1); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); }
.btn-ghost.danger:hover, .btn-danger { color: var(--bad); border: 1px solid rgba(255, 93, 93, 0.35); background: rgba(255, 93, 93, 0.08); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0;
  color: var(--text); transition: background 0.2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); }
.icon-btn.fav-on, .fav-on { color: var(--brand); }

.glass { background: rgba(10, 34, 48, 0.62); border: 1px solid var(--line-2); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); }

.spinner { display: inline-block; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.18); border-top-color: var(--brand); animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); white-space: nowrap; }
.tag-brand { background: var(--brand-soft); color: #ffb08a; border-color: rgba(255, 97, 20, 0.3); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--brand-soft); border: 1px solid rgba(255, 97, 20, 0.3); color: #ffb08a; font-size: 13px; font-weight: 500; }
.pill-sm { padding: 3px 10px; font-size: 12px; gap: 5px; }
.eyebrow { color: var(--brand); font-weight: 600; font-size: 13px; letter-spacing: 0.04em; }

.state-box { text-align: center; padding: 48px 20px; display: grid; justify-items: center; gap: 10px; max-width: 460px; margin: 0 auto; }
.state-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); }
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; }

/* ------------------------------------------------------------------ toasts */
.toasts { position: fixed; bottom: 24px; inset-inline: 0; display: grid; justify-items: center; gap: 8px; z-index: 100; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14px; animation: toast-in 0.25s ease; }
.toast-ok { border-color: rgba(60, 207, 145, 0.4); }
.toast-err { border-color: rgba(255, 93, 93, 0.5); color: #ffc2c2; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ------------------------------------------------------------------ sheet / modal */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(2, 10, 15, 0.66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade 0.2s ease;
}
.sheet {
  position: relative; width: min(520px, 100%); max-height: calc(100dvh - 40px); overflow: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-2); border-radius: 24px;
  box-shadow: var(--shadow); padding: 22px; animation: pop 0.28s cubic-bezier(.2, .9, .3, 1.2); outline: none;
}
.sheet-wide { width: min(880px, 100%); }
.sheet-grip { display: none; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sheet-head h2 { font-size: 20px; }
.sheet-head p { font-size: 13.5px; margin-top: 4px; }
.sheet-x { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; background: rgba(4, 22, 32, 0.6); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
@media (max-width: 640px) {
  .sheet-backdrop { align-items: flex-end; padding: 0; }
  .sheet, .sheet-wide { width: 100%; border-radius: 24px 24px 0 0; max-height: 92dvh; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); animation: slide-up 0.3s cubic-bezier(.2, .9, .3, 1); }
  .sheet-grip { display: block; width: 44px; height: 5px; border-radius: 9px; background: var(--line-2); margin: -6px auto 12px; }
}
@keyframes slide-up { from { transform: translateY(100%); } }

/* ------------------------------------------------------------------ forms */
.form { display: grid; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; font-size: 13.5px; align-content: start; }
.field > span { color: var(--muted); font-weight: 500; }
.field em { color: var(--brand); font-style: normal; }
input:not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: rgba(2, 14, 20, 0.55); border: 1px solid var(--line-2); outline: none; transition: border 0.2s, box-shadow 0.2s;
}
textarea { resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.has-err input { border-color: var(--bad); }
input[dir=ltr] { text-align: left; }
select option { background: var(--surface); }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { width: 42px; height: 24px; border-radius: 99px; background: var(--surface-3); position: relative; transition: background 0.2s; flex-shrink: 0; }
.toggle-ui::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.toggle input:checked + .toggle-ui { background: var(--brand); }
.toggle input:checked + .toggle-ui::after { transform: translateX(-18px); }
[dir=ltr] .toggle input:checked + .toggle-ui::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--brand); outline-offset: 2px; }

.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(2, 14, 20, 0.5); border: 1px solid var(--line); gap: 2px; }
.seg.wrap { flex-wrap: wrap; border-radius: 16px; }
.seg button { height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; transition: background 0.2s, color 0.2s; white-space: nowrap; }
.seg button.on { background: var(--brand); color: #fff; }

/* ------------------------------------------------------------------ animated prompt wall (landing background) */
.wall { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.wall-grid { position: absolute; inset: -12% -6%; display: grid; gap: 14px; transform: rotate(-8deg) scale(1.08); }
.wall-col { display: flex; flex-direction: column; animation: wall-up linear infinite; will-change: transform; }
.wall-col.down { animation-name: wall-down; }
.wall-set { display: flex; flex-direction: column; gap: 14px; padding-bottom: 14px; }
@keyframes wall-up { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes wall-down { from { transform: translateY(-50%); } to { transform: translateY(0); } }
.wall-tile { position: relative; margin: 0; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.wall-tile img, .wall-tile video { width: 100%; height: auto; min-height: 120px; object-fit: cover; }
.wall-tile figcaption { position: absolute; inset-inline: 0; bottom: 0; padding: 30px 12px 10px; font-size: 12px; font-weight: 600; background: linear-gradient(transparent, rgba(4, 22, 32, 0.9)); }
.wall-ph { aspect-ratio: 3 / 4; display: grid; place-items: center; }
.wall-ph.ph-1 { aspect-ratio: 1; } .wall-ph.ph-2 { aspect-ratio: 4 / 5; } .wall-ph.ph-3 { aspect-ratio: 9 / 14; }
.wall-ph span { position: absolute; background: var(--brand); opacity: 0.18; border-radius: 4px; }
.wall-ph span:first-child { width: 22%; height: 46%; inset-inline-start: 20%; top: 26%; }
.wall-ph span:last-child { width: 22%; aspect-ratio: 1; inset-inline-start: 50%; top: 26%; background: var(--paper); opacity: 0.12; }
.wall-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(4, 22, 32, 0.55), rgba(4, 22, 32, 0.92) 70%),
    linear-gradient(180deg, rgba(4, 22, 32, 0.5), rgba(4, 22, 32, 0.75) 40%, var(--bg) 92%);
}
@media (prefers-reduced-motion: reduce) {
  .wall-col, .marquee-track { animation: none !important; }
  .pcard { animation: none !important; }
}

/* ------------------------------------------------------------------ landing */
.landing { position: relative; min-height: 100vh; }
.landing > .hero, .landing > .steps, .landing > .section, .landing > .footer { position: relative; z-index: 1; }
.nav {
  position: sticky; top: 12px; z-index: 20; margin: 12px auto 0; width: min(1180px, calc(100% - 24px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px;
  border-radius: 999px; background: rgba(4, 22, 32, 0.6); border: 1px solid var(--line-2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.nav-links { display: flex; gap: 4px; }
.nav-links button { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; transition: color 0.2s, background 0.2s; }
.nav-links button:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
@media (max-width: 760px) { .nav-links { display: none; } }

.hero { min-height: min(86vh, 820px); display: grid; place-content: center; justify-items: center; text-align: center; gap: 22px; padding: 80px 16px 40px; }
.hero h1 { font-size: clamp(40px, 8vw, 92px); font-weight: 700; letter-spacing: -0.01em; background: linear-gradient(180deg, #fff 30%, #ffd2bd); -webkit-background-clip: text; background-clip: text; color: transparent; animation: rise 0.8s ease both; }
.hero-sub { max-width: 620px; font-size: clamp(15px, 2vw, 19px); color: #c5d2d8; animation: rise 0.8s 0.1s ease both; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; animation: rise 0.8s 0.2s ease both; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 18px; animation: rise 0.8s 0.3s ease both; }
.hero-stats div { display: grid; padding: 12px 22px; border-radius: 18px; background: rgba(10, 34, 48, 0.55); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); min-width: 130px; }
.hero-stats strong { font-size: 24px; color: var(--brand); }
.hero-stats span { font-size: 12.5px; color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.steps { width: min(1100px, calc(100% - 32px)); margin: 0 auto 30px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step { padding: 22px; border-radius: var(--radius); background: rgba(10, 34, 48, 0.7); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: grid; gap: 6px; }
.step-n { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.section { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 70px 0 30px; }
.section-head { text-align: center; display: grid; gap: 8px; margin-bottom: 30px; }
.section-head h2 { font-size: clamp(26px, 4vw, 38px); }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 360px)); gap: 18px; justify-content: center; }
.plan {
  --accent: var(--brand);
  position: relative; display: flex; flex-direction: column; gap: 18px; padding: 26px; border-radius: 26px; overflow: hidden;
  background: linear-gradient(170deg, color-mix(in srgb, var(--accent) 16%, var(--surface-2)), var(--surface) 55%);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); box-shadow: var(--shadow); transition: transform 0.3s ease;
}
.plan:hover { transform: translateY(-4px); }
.plan::before { content: ''; position: absolute; width: 220px; height: 220px; inset-inline-end: -80px; top: -90px; border-radius: 50%; background: var(--accent); opacity: 0.16; filter: blur(30px); }
.plan-silver { --accent: var(--silver); }
.plan-gold { --accent: var(--gold); }
.plan-teal { --accent: #3fb5c9; }
.plan-badge { position: absolute; top: 18px; inset-inline-end: 18px; padding: 4px 12px; border-radius: 99px; background: var(--accent); color: #1b1305; font-size: 12px; font-weight: 700; }
.plan-top { display: flex; gap: 14px; align-items: center; }
.plan-top h3 { font-size: 24px; color: var(--accent); }
.plan-img { width: 58px; height: 58px; border-radius: 16px; object-fit: cover; background: var(--surface-3); }
.plan-icon { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); flex-shrink: 0; }
.plan-price { display: flex; align-items: baseline; gap: 8px; }
.plan-price strong { font-size: 34px; }
.plan-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; flex: 1; align-content: start; }
.plan-features li { display: flex; gap: 10px; align-items: center; }
.plan-features svg { color: var(--accent); flex-shrink: 0; }
.plan .btn-brand { margin-top: auto; }
.plan-gold .btn-brand, .plan-silver .btn-brand { background: var(--accent); color: #12161a; box-shadow: none; }

/* checkout */
.methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.method { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(2, 14, 20, 0.4); font-weight: 600; transition: border 0.2s, background 0.2s; text-align: start; }
.method img { width: 28px; height: 28px; border-radius: 8px; object-fit: contain; background: #fff; }
.method-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); flex-shrink: 0; }
.method.on { border-color: var(--brand); background: var(--brand-soft); }
.method.on .method-dot { border-color: var(--brand); background: radial-gradient(var(--brand) 45%, transparent 50%); }
.pay-box { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: rgba(255, 97, 20, 0.07); border: 1px dashed rgba(255, 97, 20, 0.4); font-size: 13.5px; }
.pay-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pay-row > div { display: grid; }
.pay-row strong { font-size: 18px; letter-spacing: 0.03em; }
.drop { position: relative; display: grid; justify-items: center; gap: 6px; padding: 22px; border-radius: 16px; border: 1.5px dashed var(--line-2); background: rgba(2, 14, 20, 0.4); cursor: pointer; text-align: center; color: var(--muted); transition: border 0.2s; }
.drop:hover, .drop.has-file { border-color: var(--brand); color: var(--text); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop img { max-height: 180px; border-radius: 10px; object-fit: contain; }
.has-err .drop { border-color: var(--bad); }
.success { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 10px 0; }
.success-icon { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; box-shadow: 0 0 0 10px var(--brand-soft); animation: pop 0.4s ease; }
.order-number { font-family: var(--font-latin); font-weight: 700; font-size: 30px; letter-spacing: 0.08em; padding: 10px 22px; border-radius: 16px; background: rgba(2, 14, 20, 0.6); border: 1px dashed var(--brand); direction: ltr; }
.note { font-size: 13.5px; color: #c5d2d8; }
.status-box { display: grid; gap: 4px; margin-top: 14px; padding: 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(2, 14, 20, 0.45); font-size: 14px; }
.status-box.status-pending { border-color: rgba(242, 184, 75, 0.5); }
.status-box.status-rejected, .status-box.status-suspended, .status-box.status-expired { border-color: rgba(255, 93, 93, 0.5); }

/* ------------------------------------------------------------------ prompt cards (masonry) */
.masonry { column-count: 2; column-gap: 12px; }
@media (min-width: 720px) { .masonry { column-count: 3; column-gap: 14px; } }
@media (min-width: 1040px) { .masonry { column-count: 4; } }
@media (min-width: 1400px) { .masonry { column-count: 5; } }
.pcard { position: relative; break-inside: avoid; margin-bottom: 12px; border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); animation: card-in 0.5s ease both; transform: translateZ(0); }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
.pcard-hit { display: block; width: 100%; text-align: start; position: relative; }
.pcard-media { width: 100%; height: auto; min-height: 140px; object-fit: cover; transition: transform 0.6s ease; }
.pcard:hover .pcard-media { transform: scale(1.04); }
.pcard-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(4, 22, 32, 0.92)); }
.pcard-info { position: absolute; inset-inline: 0; bottom: 0; padding: 12px; display: grid; gap: 6px; }
.pcard-info strong { font-size: 15px; line-height: 1.35; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
.pcard-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.pcard-tags .tag { background: rgba(4, 22, 32, 0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.pcard-badge { position: absolute; top: 10px; inset-inline-start: 10px; display: inline-flex; gap: 4px; align-items: center; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; background: rgba(4, 22, 32, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.pcard-fav { position: absolute; top: 8px; inset-inline-end: 8px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(4, 22, 32, 0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: color 0.2s, transform 0.2s; }
.pcard-fav:active { transform: scale(0.85); }
.pcard-fav.on { color: var(--brand); }
.pcard-fav.static { position: static; flex-shrink: 0; }
.media-fallback { aspect-ratio: 4 / 5; width: 100%; background: linear-gradient(140deg, var(--surface-2), var(--surface)); position: relative; display: grid; place-items: center; color: var(--muted); }
.media-fallback span { position: absolute; background: var(--brand); opacity: 0.25; }
.media-fallback span:nth-child(1) { width: 12%; height: 40%; left: 34%; top: 30%; }
.media-fallback span:nth-child(2) { width: 14%; aspect-ratio: 1; left: 50%; top: 30%; background: var(--paper); opacity: 0.2; }
.media-fallback span:nth-child(3) { width: 13%; aspect-ratio: 1; left: 58%; top: 46%; }
.media-fallback.text { aspect-ratio: 16 / 9; }

.rows { display: grid; gap: 10px; }
.prow { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); animation: card-in 0.4s ease both; }
.prow-hit { flex: 1; display: flex; align-items: center; gap: 14px; padding: 10px; text-align: start; min-width: 0; }
.prow-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.prow-text { display: grid; gap: 3px; min-width: 0; flex: 1; justify-items: start; }
.prow-text .muted { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prow-chev { color: var(--muted); flex-shrink: 0; }

.skeleton { border-radius: 20px; margin-bottom: 12px; break-inside: avoid; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.sk-0 { height: 220px; } .sk-1 { height: 300px; } .sk-2 { height: 180px; } .sk-row { height: 76px; margin: 0; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* viewer */
.viewer { padding: 0; }
.viewer .sheet-body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.viewer-media { background: #000; display: grid; place-items: center; min-height: 100%; }
.viewer-media img, .viewer-media video { width: 100%; max-height: 80vh; object-fit: contain; }
.viewer-body { padding: 24px; display: grid; gap: 14px; align-content: start; }
.viewer-body:only-child { grid-column: 1 / -1; }
.viewer-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding-inline-end: 44px; }
.viewer-head h2 { font-size: 22px; margin-bottom: 8px; }
.prompt-box { border-radius: 16px; background: rgba(2, 14, 20, 0.6); border: 1px solid var(--line-2); overflow: hidden; }
.prompt-box-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.prompt-box pre { margin: 0; padding: 14px; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 13.5px; line-height: 1.75; max-height: 42vh; overflow: auto; }
.prompt-box .center { padding: 26px; }
.prompt-box.locked { position: relative; min-height: 190px; }
.locked-lines { padding: 18px; display: grid; gap: 10px; filter: blur(3px); }
.locked-lines span { height: 12px; border-radius: 6px; background: var(--surface-3); }
.locked-lines span:nth-child(2) { width: 80%; } .locked-lines span:nth-child(4) { width: 60%; }
.locked-cta { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; background: rgba(4, 22, 32, 0.55); color: var(--brand); }
.locked-cta strong { color: var(--text); }
@media (max-width: 760px) {
  .viewer .sheet-body { grid-template-columns: 1fr; }
  .viewer-media img, .viewer-media video { max-height: 52vh; }
  .viewer-body { padding: 18px 16px 8px; }
}

/* ------------------------------------------------------------------ library (subscriber) */
.library { width: min(1400px, 100%); margin: 0 auto; padding: 0 12px 30px; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; padding: 10px 0; background: linear-gradient(var(--bg) 60%, transparent); }
.topbar .icon-btn.glass { width: 44px; height: 44px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 999px; min-width: 0; color: var(--muted); }
.search:not(.glass) { background: rgba(2, 14, 20, 0.5); border: 1px solid var(--line-2); }
.search input { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; min-height: 0 !important; height: 100%; color: var(--text); }
.search button { color: var(--muted); display: grid; }
.topbar .seg { padding: 4px; }
.topbar .seg button { height: 34px; }
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; }
  .topbar .search { order: 5; flex-basis: 100%; }
  .topbar .seg { margin-inline-start: auto; }
}

.lib-hero {
  margin: 6px 0 16px; padding: 18px; border-radius: 26px; overflow: hidden; position: relative;
  background: radial-gradient(ellipse at top left, rgba(255, 97, 20, 0.22), transparent 55%), linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid rgba(255, 97, 20, 0.28); animation: rise 0.6s ease both;
}
.lib-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.lib-hero h1 { font-size: clamp(24px, 4vw, 34px); margin-top: 8px; }
.count-badge { display: grid; text-align: center; padding: 8px 16px; border-radius: 18px; background: rgba(2, 14, 20, 0.5); border: 1px solid var(--line-2); line-height: 1.2; }
.count-badge strong { font-size: 24px; color: var(--brand); font-family: var(--font-latin); }
.count-badge span { font-size: 11.5px; color: var(--muted); }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); direction: ltr; }
.marquee-track { display: flex; gap: 10px; width: max-content; animation: marquee 40s linear infinite; }
.marquee-item { width: 74px; height: 74px; border-radius: 16px; overflow: hidden; flex-shrink: 0; border: 1px solid var(--line-2); background: var(--surface-3); }
.marquee-item img, .marquee-item video, .marquee-item .media-fallback { width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto; }
.text-marquee .marquee-track { animation-duration: 30s; }
.text-marquee .tag { height: 32px; padding: 0 14px; font-size: 13px; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (min-width: 900px) { .marquee-item { width: 96px; height: 96px; } }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { height: 38px; padding: 0 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: #c8d5db; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; transition: background 0.2s, color 0.2s, border 0.2s; white-space: nowrap; }
.chip:hover { border-color: var(--line-2); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 8px 20px -10px var(--brand-glow); }
.chip.on .dot { background: #fff; box-shadow: none; }
@media (max-width: 560px) {
  .library .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -12px; padding-inline: 12px; scrollbar-width: none; }
  .library .chips::-webkit-scrollbar { display: none; }
}
.lib-main { min-height: 50vh; }

.to-top { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom)); inset-inline-start: 20px; z-index: 25; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; box-shadow: 0 12px 30px -10px var(--brand-glow); animation: pop 0.3s ease; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(2, 10, 15, 0.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 41; width: min(320px, 86vw); padding: 14px; display: flex; flex-direction: column; gap: 12px;
  background: var(--bg-2); border-inline-end: 1px solid var(--line-2); transform: translateX(100%); transition: transform 0.35s cubic-bezier(.2, .9, .3, 1); overflow-y: auto;
}
.drawer.open { transform: none; }
.drawer-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.drawer-user > div:nth-child(2) { flex: 1; display: grid; line-height: 1.3; }
.drawer-user small { color: var(--brand); font-family: var(--font-latin); text-align: start; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; font-size: 18px; }
.drawer-sub { display: flex; justify-content: space-between; padding: 10px 14px; border-radius: 14px; background: var(--brand-soft); color: #ffcdb5; font-size: 13.5px; }
.drawer-nav { display: grid; gap: 4px; flex: 1; align-content: start; }
.drawer-nav button { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 14px; text-align: start; font-weight: 500; transition: background 0.2s; }
.drawer-nav button:hover { background: rgba(255, 255, 255, 0.05); }
.drawer-nav button.on { background: var(--brand); color: #fff; }
.drawer-foot { display: grid; gap: 14px; justify-items: center; padding-top: 10px; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------------ footer */
.footer { width: min(1180px, calc(100% - 32px)); margin: 60px auto 0; padding-bottom: 30px; display: grid; gap: 18px; }
.library .footer { width: 100%; }
.about { padding: 28px; border-radius: 24px; background: rgba(10, 34, 48, 0.78); border: 1px solid var(--line); display: grid; gap: 10px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.about p { font-size: 16px; color: #d2dde2; white-space: pre-line; }
.footer-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px 22px; border-radius: 24px; background: var(--brand-2); color: #160a05; }
.footer-bar .lw-pixel, .footer-bar .lw-prompt { color: var(--bg); }
.footer-bar .logo-mark rect { fill: var(--bg); }
.footer-bar .logo-mark .lm-white { fill: var(--paper); }
.footer-bar .muted { color: rgba(4, 22, 32, 0.75); }
.socials { display: flex; gap: 8px; flex-wrap: wrap; }
.social { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 99px; background: rgba(4, 22, 32, 0.12); border: 1px solid rgba(4, 22, 32, 0.25); font-weight: 600; font-size: 13.5px; transition: background 0.2s; }
.social:hover { background: rgba(4, 22, 32, 0.22); }

/* ------------------------------------------------------------------ admin */
.admin { display: flex; min-height: 100vh; }
.admin-side { width: 250px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 18px 14px; background: var(--bg-2); border-inline-end: 1px solid var(--line); }
.admin-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 12px; border-bottom: 1px solid var(--line); }
.admin-side nav { display: grid; gap: 4px; flex: 1; align-content: start; }
.admin-side nav a { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border-radius: 12px; color: var(--muted); font-weight: 500; transition: background 0.2s, color 0.2s; }
.admin-side nav a:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.admin-side nav a.on { background: var(--brand-soft); color: #ffb08a; }
.admin-side-foot { display: grid; gap: 8px; }
.admin-side-foot small { overflow: hidden; text-overflow: ellipsis; text-align: center; }
.admin-main { flex: 1; min-width: 0; }
.admin-top { display: none; }
.admin-only-mobile { display: none; }
@media (max-width: 900px) {
  .admin-side { position: fixed; z-index: 50; inset-inline-start: 0; transform: translateX(100%); transition: transform 0.3s ease; }
  .admin-side.open { transform: none; }
  .admin-only-mobile { display: block; z-index: 45; }
  .admin-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; background: var(--bg); }
}
.admin-login .card { width: min(400px, 100%); justify-items: stretch; }
.admin-login .logo { justify-self: center; margin-bottom: 4px; }
.admin-login h1 { text-align: center; font-size: 22px; }

.card { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.card.inset { background: rgba(2, 14, 20, 0.45); display: grid; gap: 12px; }
.card h3 { font-size: 16px; }
.panel { padding: 24px; display: grid; gap: 18px; align-content: start; max-width: 1320px; }
@media (max-width: 640px) { .panel { padding: 16px 12px; } }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel-head h1 { font-size: 24px; }
.panel-head h2 { font-size: 18px; }
.panel-head.sub { margin-top: 12px; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.toolbar .chips { margin: 0; }
.toolbar .search { max-width: 380px; min-width: 220px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi { display: grid; gap: 4px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-size: 26px; font-weight: 700; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi-sub.up { color: var(--ok); } .kpi-sub.down { color: var(--bad); }
.kpi-link { transition: border 0.2s; border-color: rgba(255, 97, 20, 0.3); }
.kpi-link:hover { border-color: var(--brand); }
.kpi-link .kpi-value { color: var(--brand); }

.chart-card { display: grid; gap: 12px; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; overflow: visible; }
.grid-line { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.base-line { stroke: rgba(255, 255, 255, 0.2); stroke-width: 1; }
.axis-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.value-label { fill: var(--text); font-size: 12px; font-weight: 600; font-family: var(--font); }
.bar { fill: var(--brand-2); transition: fill 0.15s; }
.bar.hot { fill: #ff7a45; }
.tooltip { position: absolute; top: 0; transform: translateX(50%); display: grid; gap: 2px; padding: 8px 12px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 12.5px; pointer-events: none; white-space: nowrap; }
.chart-empty { padding: 30px 0; text-align: center; }
.barlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.barlist-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 6px; flex-wrap: wrap; }
.barlist-track { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.barlist-track span { display: block; height: 100%; border-radius: 99px; background: var(--brand-2); }

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: start; font-weight: 500; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--bg-2); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr { cursor: pointer; transition: background 0.15s; }
.table tbody tr:hover, .table tbody tr:focus-visible { background: rgba(255, 255, 255, 0.03); }
.table tbody tr:last-child td { border-bottom: 0; }
.status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pending { color: var(--warn); border-color: rgba(242, 184, 75, 0.35); background: rgba(242, 184, 75, 0.08); }
.status-active, .status-lifetime { color: var(--ok); border-color: rgba(60, 207, 145, 0.35); background: rgba(60, 207, 145, 0.08); }
.status-expired, .status-rejected { color: var(--bad); border-color: rgba(255, 93, 93, 0.35); background: rgba(255, 93, 93, 0.08); }
.status-suspended { color: var(--muted); border-color: var(--line-2); background: rgba(255, 255, 255, 0.04); }

.order-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 760px) { .order-grid { grid-template-columns: 1fr; } }
.order-info { display: grid; gap: 14px; align-content: start; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.dl .icon-btn { width: 30px; height: 30px; }
.receipt { display: grid; gap: 10px; align-content: start; }
.receipt img { width: 100%; border-radius: 14px; border: 1px solid var(--line-2); background: #fff; }
.actions-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.actions-row.end { justify-content: flex-end; }

.admin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.admin-card { border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; }
.admin-card.draft, .list-row.draft { opacity: 0.55; }
.admin-card-media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.admin-card-media img, .admin-card-media video, .admin-card-media .media-fallback { width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto; }
.admin-card-media .tag { position: absolute; top: 8px; inset-inline-start: 8px; background: rgba(4, 22, 32, 0.7); }
.admin-card-media .featured { inset-inline-start: auto; inset-inline-end: 8px; }
.admin-card-body { padding: 12px; display: grid; gap: 6px; }
.admin-card-body small { font-size: 12px; }

.list { display: grid; gap: 10px; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); flex-wrap: wrap; }
.list-thumb { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); overflow: hidden; flex-shrink: 0; }
.list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-main { flex: 1; display: grid; min-width: 180px; }
.list-main small { font-size: 12.5px; }
.social-row select { width: 150px; }
.social-row input { flex: 1; min-width: 160px; }
.social-row input.narrow { flex: 0 0 76px; min-width: 0; }

.media-input { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.media-input-preview { width: 96px; height: 96px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: rgba(2, 14, 20, 0.5); border: 1px dashed var(--line-2); color: var(--muted); flex-shrink: 0; }
.media-input-preview img, .media-input-preview video { width: 100%; height: 100%; object-fit: cover; }
.media-input-ctrl { flex: 1; display: grid; gap: 8px; min-width: 200px; justify-items: start; }
.media-input-ctrl input { min-height: 40px !important; font-size: 13px; }

/* ------------------------------------------------------------------ utilities (vanilla build) */
[hidden] { display: none !important; }
.setup-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.setup-checks .ok { color: var(--ok); }
.setup-checks .bad { color: var(--bad); }
.drop [data-drop-icon] { display: grid; place-items: center; }
.prow-chev { display: inline-grid; }
