/* Linkra: one input, live progress, files you can use. Dark, glowing, RTL first. */

:root {
  --bg: #07060d;
  --bg-2: #0d0b18;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-2: rgba(255, 255, 255, 0.17);
  --text: #f4f2ff;
  --muted: #a6a1c4;
  --faint: #6d6890;
  --violet: #8b5cf6;
  --pink: #ff4fa3;
  --cyan: #22d3ee;
  --lime: #b6ff5c;
  --amber: #ffb547;
  --red: #ff5c7a;
  --grad: linear-gradient(110deg, var(--pink), var(--violet) 45%, var(--cyan));
  --radius: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --display: 'Rubik', 'Heebo', system-ui, sans-serif;
  --body: 'Heebo', 'Rubik', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--body); font-size: 17px; line-height: 1.6; overflow-x: hidden; -webkit-font-smoothing: antialiased;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: rgba(139, 92, 246, .55); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 8px; }

/* ---------- living background ---------- */
.aurora { position: fixed; inset: 0; z-index: -3; overflow: hidden; filter: blur(70px) saturate(140%); opacity: .75; }
.blob { position: absolute; border-radius: 50%; mix-blend-mode: screen; animation: drift 26s var(--ease) infinite alternate; }
.b1 { width: 52vmax; height: 52vmax; background: radial-gradient(circle, #6d28d9 0, transparent 65%); top: -22vmax; right: -12vmax; }
.b2 { width: 44vmax; height: 44vmax; background: radial-gradient(circle, #db2777 0, transparent 65%); top: 18vh; left: -18vmax; animation-duration: 32s; }
.b3 { width: 38vmax; height: 38vmax; background: radial-gradient(circle, #0891b2 0, transparent 65%); bottom: -16vmax; right: 18vw; animation-duration: 38s; }
.b4 { width: 26vmax; height: 26vmax; background: radial-gradient(circle, #4f46e5 0, transparent 65%); top: 50vh; right: 45vw; animation-duration: 22s; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6vw, 4vh, 0) scale(1.12); }
  100% { transform: translate3d(-4vw, -6vh, 0) scale(.94); }
}
.grain {
  position: fixed; inset: -50%; z-index: -1; pointer-events: none; opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%,100% { transform: translate(0,0); } 30% { transform: translate(-3%,2%); } 60% { transform: translate(2%,-3%); } }
.grid-lines {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 30%, #000 30%, transparent 75%);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 14px); z-index: 20;
  width: min(1100px, 100%); margin: 14px auto 0;
  display: flex; align-items: center; gap: 12px; padding: 9px 10px 9px 16px;
  background: rgba(13, 11, 24, .55); backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--stroke); border-radius: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; filter: drop-shadow(0 0 14px rgba(139, 92, 246, .55)); transition: transform .5s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-12deg) scale(1.06); }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.02em; direction: ltr; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(182,255,92,.6); } 70% { box-shadow: 0 0 0 9px rgba(182,255,92,0); } 100% { box-shadow: 0 0 0 0 rgba(182,255,92,0); } }
.quota-pill {
  margin-right: auto; display: flex; align-items: center; gap: 7px; cursor: pointer; font: inherit; color: var(--muted);
  padding: 5px 12px 5px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--stroke); white-space: nowrap; transition: all .2s var(--ease);
}
.quota-pill:hover { border-color: var(--stroke-2); color: var(--text); }
.quota-pill b { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.quota-pill .q-of { font-size: 13px; margin-inline-start: -6px; }
.q-ring {
  --p: 1; width: 24px; height: 24px; border-radius: 50%;
  background: conic-gradient(var(--lime) calc(var(--p) * 360deg), rgba(255,255,255,.1) 0);
  -webkit-mask: radial-gradient(circle, transparent 7px, #000 8px); mask: radial-gradient(circle, transparent 7px, #000 8px);
  transition: background .4s;
}
.quota-pill.low .q-ring { background: conic-gradient(var(--amber) calc(var(--p) * 360deg), rgba(255,255,255,.1) 0); }
.quota-pill.empty { border-color: var(--pink); color: var(--text); animation: nudge 2.4s ease-in-out infinite; }
.quota-pill.empty .q-ring { background: var(--pink); }
@keyframes nudge { 0%,100% { box-shadow: 0 0 0 0 rgba(255,79,163,.0); } 50% { box-shadow: 0 0 0 6px rgba(255,79,163,.18); } }

/* ---------- paywall ---------- */
.paywall { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(4,3,10,.82); backdrop-filter: blur(10px); animation: fade .25s both; }
.pay-card {
  position: relative; width: min(380px, 100%); padding: 34px 26px 24px; text-align: center; border-radius: 28px;
  background: linear-gradient(180deg, rgba(139,92,246,.16), rgba(13,11,24,.96) 55%); border: 1px solid var(--stroke-2);
  box-shadow: 0 30px 90px rgba(0,0,0,.6), 0 0 80px rgba(255,79,163,.12); animation: rise .5s var(--ease) both;
}
.pay-close { position: absolute; top: 12px; left: 12px; }
.pay-meter { font-family: var(--display); font-weight: 900; font-size: 64px; line-height: 1; letter-spacing: -.03em; }
.pay-meter small { font-size: 26px; color: var(--faint); }
.pay-card h2 { font-family: var(--display); font-size: 20px; margin: 10px 0 22px; }
.pack {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; font: inherit;
  padding: 18px 22px; border-radius: 18px; border: 0; color: #07060d; background: var(--grad); background-size: 160% 100%;
  box-shadow: 0 12px 40px rgba(255,79,163,.3); transition: transform .2s var(--ease), background-position .6s;
}
.pack:hover { transform: translateY(-2px); background-position: 100% 0; }
.pack:disabled { opacity: .6; cursor: wait; }
.pack-n { font-weight: 700; font-size: 17px; }
.pack-price { font-family: var(--display); font-weight: 900; font-size: 30px; }
.pack-price i { font-family: Arial, var(--body); font-style: normal; font-weight: 700; font-size: .8em; margin-inline-end: 2px; }
.pay-note { margin: 14px 0 0; font-size: 13px; color: var(--faint); }

.pay-icon { font-size: 44px; line-height: 1; }
.pay-sub { margin: -14px 0 20px; color: var(--muted); }
.phone-step { display: grid; gap: 12px; }
.big-input {
  width: 100%; padding: 15px 18px; border-radius: 16px; font: 600 22px var(--display); letter-spacing: .04em; text-align: center;
  color: var(--text); background: rgba(255,255,255,.06); border: 1px solid var(--stroke-2); outline: none; transition: border-color .2s;
}
.big-input:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(139,92,246,.18); }
.big-input.code { font-size: 30px; letter-spacing: .35em; }
.big-input.bad { border-color: var(--red); animation: shake .4s; }
.call-btn { justify-content: center; font-weight: 800; font-size: 17px; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }
.acct { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--stroke); display: grid; gap: 10px; font-size: 14px; color: var(--muted); text-align: start; }
.acct-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.acct-row b { color: var(--text); }
.mini-form { display: flex; gap: 8px; }
.mini-form input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; font: inherit; color: var(--text); background: rgba(255,255,255,.05); border: 1px solid var(--stroke); outline: none; }
.mini-form input:focus { border-color: var(--violet); }
.mini-btn { padding: 0 14px; border-radius: 12px; border: 1px solid var(--stroke-2); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }

/* ---------- email delivery: the page shows progress, the files go to the inbox ---------- */
.recents, #open-history, .results, .job-actions { display: none !important; }
.mail-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 10px 14px 4px; border-top: 1px solid var(--stroke); }
.mail-row input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font: inherit; font-size: 17px; text-align: right; }
.mail-row input:placeholder-shown { direction: rtl; }
.mail-row input:not(:placeholder-shown) { text-align: left; }
.mail-row input::placeholder { color: var(--faint); }
.mail-row.bad { animation: shake .4s; }
.mail-row.bad input::placeholder { color: var(--pink); }
.job-mail { margin-top: 14px; padding: 12px 16px; border-radius: 14px; font-weight: 600; background: var(--surface); border: 1px solid var(--stroke); color: var(--muted); }
.job-mail.sent { color: var(--lime); border-color: rgba(182,255,92,.35); background: rgba(182,255,92,.06); }
.job-mail.failed { color: var(--red); border-color: rgba(255,92,122,.35); }
.job-mail b { direction: ltr; unicode-bidi: isolate; }

.mail-direct {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 16px;
  padding: 10px 18px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 15px;
  background: var(--surface); border: 1px solid var(--stroke); transition: all .2s var(--ease);
}
.mail-direct b { color: var(--text); font-weight: 700; word-break: break-all; }
.mail-direct:hover { border-color: var(--pink); color: var(--text); }
.mail-direct:hover b { color: var(--pink); }

.history-btn {
  position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--stroke-2); transition: all .2s var(--ease);
}
.history-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.history-btn:hover { background: var(--text); color: var(--bg); }
.hb-count {
  position: absolute; top: -6px; left: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--pink); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center;
}

/* ---------- hero ---------- */
main { width: min(1100px, 100%); margin: 0 auto; }
.hero { padding: clamp(56px, 12vh, 130px) 0 30px; text-align: center; }
.headline {
  font-family: var(--display); font-weight: 900; letter-spacing: -.04em; line-height: .95;
  font-size: clamp(48px, 9.5vw, 128px); margin: 0 0 18px; text-wrap: balance;
}
.sub { margin: 0 auto clamp(26px, 4vh, 40px); color: var(--muted); font-size: clamp(17px, 2.2vw, 21px); animation: rise 1s .24s var(--ease) both; }
.trust { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 0; font-size: 13px; color: var(--faint); }
.trust span { white-space: nowrap; }
.headline .line { display: block; animation: rise 1s var(--ease) both; }
.headline .line:nth-child(2) { animation-delay: .12s; }
.gradient-text {
  font-style: normal; background: var(--grad); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 8s ease-in-out infinite; filter: drop-shadow(0 6px 40px rgba(255, 79, 163, .25));
}
@keyframes shimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* ---------- composer: one line, one button ---------- */
.composer { position: relative; max-width: 760px; margin: 0 auto; border-radius: 24px; padding: 1.5px; isolation: isolate; text-align: right; }
.composer-glow {
  position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: conic-gradient(from var(--angle, 0deg), var(--pink), var(--violet), var(--cyan), var(--lime), var(--pink));
  animation: rotate 6s linear infinite; opacity: .8;
}
.composer-glow::after { content: ''; position: absolute; inset: -18px; border-radius: 40px; background: inherit; filter: blur(30px); opacity: .45; }
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes rotate { to { --angle: 360deg; } }
.composer-inner { background: rgba(10, 9, 20, .94); border-radius: 23px; padding: 8px; }
.composer-row { display: flex; align-items: center; gap: 8px; }
#links {
  flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; color: var(--text);
  font: 500 clamp(17px, 2vw, 20px)/1.45 var(--body); padding: 12px 10px; max-height: 180px; direction: ltr; text-align: left;
}
#links:placeholder-shown { direction: rtl; text-align: right; }
#links::placeholder { color: #5d5884; }
.count-badge { font-size: 13px; color: var(--cyan); background: rgba(34,211,238,.1); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.cta {
  flex: none; position: relative; overflow: hidden; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 17px; padding: 14px 22px; background: var(--text); color: var(--bg); font: 800 18px var(--display);
  transition: transform .25s var(--ease), box-shadow .25s; box-shadow: 0 10px 40px -10px rgba(255, 79, 163, .65);
}
.cta::before { content: ''; position: absolute; inset: 0; background: var(--grad); opacity: 0; transition: opacity .3s; }
.cta > * { position: relative; }
.cta:hover { transform: translateY(-2px); color: #fff; }
.cta:hover::before { opacity: 1; }
.cta-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s var(--ease); }
.cta:hover .cta-icon { transform: translateX(-4px); }
.cta:disabled { opacity: .55; cursor: progress; transform: none; }
.drop-overlay {
  position: absolute; inset: 0; border-radius: inherit; display: grid; place-items: center;
  background: rgba(139, 92, 246, .3); backdrop-filter: blur(6px); font: 800 22px var(--display);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.composer.dragging .drop-overlay { opacity: 1; }
.composer.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }

.site-chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; flex: none;
  padding: 4px 11px 4px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--stroke-2);
  white-space: nowrap; direction: ltr;
}
.site-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--violet)); box-shadow: 0 0 12px var(--c, var(--violet)); }
.site-chip.pop { animation: pop .45s var(--ease); }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* three tiny steps */
.steps { list-style: none; display: flex; justify-content: center; gap: clamp(16px, 4vw, 40px); padding: 0; margin: 24px 0 0; color: var(--muted); font-size: 15px; }
.steps li { display: flex; align-items: center; gap: 8px; }
.step-ico { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--stroke); font: 700 13px var(--display); color: var(--text); direction: ltr; }

/* ---------- recents rail ---------- */
.recents { display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 26px auto 0; }
.recents-track { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding: 4px 2px; mask-image: linear-gradient(270deg, #000 85%, transparent); }
.recents-track::-webkit-scrollbar { display: none; }
.recent {
  position: relative; flex: none; width: 52px; height: 52px; border-radius: 14px; cursor: pointer; padding: 0;
  background: #000 center / cover no-repeat; border: 1px solid var(--stroke-2); transition: transform .25s var(--ease), border-color .2s;
  display: grid; place-items: center; font-size: 18px; color: var(--muted); animation: pop .4s var(--ease) both;
}
.recent:hover { transform: translateY(-3px) scale(1.06); border-color: var(--text); }
.recent .badge { position: absolute; bottom: -4px; left: -4px; width: 14px; height: 14px; border-radius: 50%; background: var(--c, var(--violet)); border: 2px solid var(--bg); }
.recent.failed { background: #160a12; color: var(--red); }
.recent.pending { background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 300% 100%; animation: sk 1.4s infinite; }
.recents-all { flex: none; cursor: pointer; padding: 8px 14px; border-radius: 999px; font-size: 14px; background: var(--surface); border: 1px solid var(--stroke-2); color: var(--muted); }
.recents-all:hover { color: var(--bg); background: var(--text); }

/* ---------- marquee ---------- */
.platforms { margin: 40px auto 0; max-width: 900px; }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 10px; width: max-content; animation: marquee 38s linear infinite; direction: ltr; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee .site-chip { font-size: 13px; padding: 6px 13px 6px 11px; background: var(--surface); opacity: .8; }

/* ---------- jobs ---------- */
.jobs { display: grid; gap: 18px; max-width: 980px; margin: 30px auto 0; text-align: right; }
.job {
  position: relative; border-radius: var(--radius); padding: 18px 20px 20px; min-width: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
  border: 1px solid var(--stroke); backdrop-filter: blur(16px); animation: rise .6s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.job-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.job-url { color: var(--muted); font-size: 14px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; text-align: left; }
.job-url:hover { color: var(--text); }
.job-time { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.timeline { list-style: none; display: flex; padding: 0; margin: 22px 0 6px; position: relative; }
.timeline li { flex: 1; position: relative; text-align: center; font-size: 13px; color: var(--faint); padding-top: 34px; transition: color .3s; min-width: 0; }
.timeline li::before {
  content: ''; position: absolute; top: 6px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%;
  background: var(--bg-2); border: 2px solid var(--stroke-2); z-index: 1; transition: all .35s var(--ease);
}
.timeline li::after { content: ''; position: absolute; top: 14px; left: 50%; width: 100%; height: 2px; background: var(--stroke); }
.timeline li:first-child::after { display: none; }
.timeline li .beam { position: absolute; top: 14px; left: 50%; height: 2px; width: 100%; background: var(--grad); z-index: 0; transform: scaleX(0); transform-origin: right; transition: transform .6s var(--ease); }
.timeline li:first-child .beam { display: none; }
.timeline li.done, .timeline li.active { color: var(--text); }
.timeline li.done::before { background: var(--lime); border-color: var(--lime); box-shadow: 0 0 16px rgba(182,255,92,.5); }
.timeline li.done .beam, .timeline li.active .beam { transform: scaleX(1); }
.timeline li.active::before { border-color: var(--pink); background: var(--bg); box-shadow: 0 0 0 6px rgba(255,79,163,.18), 0 0 22px rgba(255,79,163,.6); animation: breathe 1.2s ease-in-out infinite; }
.timeline li.failed::before { background: var(--red); border-color: var(--red); box-shadow: 0 0 16px rgba(255,92,122,.5); }
.timeline li.failed { color: var(--red); }
.timeline li.skipped { opacity: .3; }
.timeline .step-label { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.timeline .step-time { display: block; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; min-height: 16px; }
@keyframes breathe { 50% { transform: scale(1.18); } }

.job-msg { margin-top: 12px; padding: 11px 14px; border-radius: 14px; font-size: 15px; background: rgba(255,92,122,.08); border: 1px solid rgba(255,92,122,.25); color: #ffc2cd; }
.job-msg.info { background: rgba(34,211,238,.07); border-color: rgba(34,211,238,.2); color: #b9f3ff; }

.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 16px; }
.results:empty { display: none; }
.media-card {
  position: relative; border-radius: 18px; overflow: hidden; background: #000; aspect-ratio: 1; max-width: 100%;
  border: 1px solid var(--stroke); animation: rise .6s var(--ease) both; transition: transform .35s var(--ease), box-shadow .35s;
}
.media-card:hover { box-shadow: 0 30px 60px -20px rgba(139,92,246,.55); }
.media-card img, .media-card video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-card .open { position: absolute; inset: 0; z-index: 1; background: none; border: 0; cursor: zoom-in; }
.media-card .meta {
  position: absolute; inset: auto 0 0 0; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 30px 10px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.85)); font-size: 12px; color: #ddd;
}
.media-card .type { font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(255,255,255,.14); text-transform: uppercase; letter-spacing: .04em; direction: ltr; }
.media-card .size { font-variant-numeric: tabular-nums; }
.card-btn {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; border: 0; cursor: pointer;
  background: rgba(255,255,255,.16); color: #fff; text-decoration: none; font-weight: 900; font-size: 15px; transition: transform .2s, background .2s;
}
.card-btn.first { margin-inline-start: auto; }
.card-btn.dl { background: var(--text); color: var(--bg); }
.card-btn:hover { transform: scale(1.1); }

.job-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.pill-btn {
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 15px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--stroke-2); transition: all .2s var(--ease);
}
.pill-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.modesty-badge { margin-inline-start: auto; font-size: 13px; color: var(--lime); padding: 6px 12px; border-radius: 999px; background: rgba(182,255,92,.08); border: 1px solid rgba(182,255,92,.2); }
.skeleton { aspect-ratio: 1; border-radius: 18px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 300% 100%; animation: sk 1.4s ease-in-out infinite; border: 1px solid var(--stroke); }
@keyframes sk { to { background-position: -150% 0; } }

/* ---------- history drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(4,3,10,.6); backdrop-filter: blur(4px); animation: fade .25s both; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 41; width: min(420px, 100vw);
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 18px calc(env(safe-area-inset-bottom, 0px) + 20px) max(18px, env(safe-area-inset-left, 0px));
  background: rgba(13, 11, 24, .96); border-inline-end: 1px solid var(--stroke-2); backdrop-filter: blur(20px);
  display: flex; flex-direction: column; gap: 14px; transform: translateX(-102%); transition: transform .45s var(--ease);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-head h2 { margin: 0; font: 800 22px var(--display); }
.search { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 13px; background: var(--surface); border: 1px solid var(--stroke); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { background: transparent; border: 0; outline: 0; color: var(--text); font: 15px var(--body); width: 100%; min-width: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { cursor: pointer; padding: 6px 13px; border-radius: 999px; font-size: 14px; background: var(--surface); border: 1px solid var(--stroke); color: var(--muted); transition: all .2s; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700; }
.history-list { display: grid; gap: 8px; overflow-y: auto; min-height: 0; flex: 1; padding-inline-end: 2px; }
.h-row {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--stroke);
  transition: border-color .2s, background .2s; animation: rise .4s var(--ease) both;
}
.h-row:hover { border-color: var(--stroke-2); background: var(--surface-2); }
.h-row .recent { animation: none; }
.h-info { min-width: 0; flex: 1; }
.h-info .site { font-weight: 700; font-size: 14px; }
.h-info .when { color: var(--faint); font-size: 12px; }
.h-actions { display: flex; gap: 4px; }
.icon-btn { cursor: pointer; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: transparent; border: 1px solid transparent; font-size: 15px; color: var(--muted); text-decoration: none; transition: all .2s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--stroke); }
.icon-btn.on { color: var(--amber); }
.empty { color: var(--faint); text-align: center; margin-top: 30px; }

/* ---------- studio ---------- */
.studio { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) 16px; background: rgba(4,3,10,.82); backdrop-filter: blur(10px); animation: fade .25s both; }
.studio-panel {
  width: min(1040px, 100%); max-height: calc(100vh - 32px); display: grid; grid-template-columns: 1fr 360px; overflow: hidden;
  border-radius: 26px; background: var(--bg-2); border: 1px solid var(--stroke-2); box-shadow: 0 50px 120px -30px #000;
  animation: rise .45s var(--ease) both;
}
.studio-preview { position: relative; display: grid; place-items: center; min-height: 300px; background: repeating-conic-gradient(#14121f 0 25%, #0f0d18 0 50%) 0 0 / 22px 22px; padding: 18px; min-width: 0; }
.studio-preview img, .studio-preview video { max-width: 100%; max-height: calc(100vh - 80px); border-radius: 12px; box-shadow: 0 20px 50px -20px #000; transition: aspect-ratio .4s var(--ease); }
.studio-preview .crop-frame { position: absolute; border: 2px solid var(--text); border-radius: 6px; box-shadow: 0 0 0 9999px rgba(4,3,10,.6); pointer-events: none; transition: all .4s var(--ease); }
.studio-side { display: flex; flex-direction: column; gap: 14px; padding: 18px; min-width: 0; overflow-y: auto; }
.studio-head { display: flex; align-items: center; justify-content: space-between; }
.studio-head h2 { margin: 0; font: 800 22px var(--display); }
.tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 6px; }
.tab { cursor: pointer; display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--stroke); font-size: 13px; color: var(--muted); transition: all .2s; }
.tab b { font-size: 20px; line-height: 1; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.tab-body { display: grid; gap: 12px; }
.option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.option { cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--stroke); text-align: right; transition: all .2s; }
.option:hover { border-color: var(--stroke-2); }
.option.active { border-color: var(--pink); background: rgba(255,79,163,.1); }
.option .ratio { flex: none; border: 2px solid currentColor; border-radius: 4px; opacity: .8; }
.option small { display: block; color: var(--faint); font-size: 12px; direction: ltr; text-align: right; }
.range-row { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.range-row input { flex: 1; accent-color: var(--pink); }
.big-btn { cursor: pointer; padding: 14px; border-radius: 16px; border: 0; background: var(--grad); color: #fff; font: 800 17px var(--display); box-shadow: 0 14px 40px -14px rgba(255,79,163,.7); transition: transform .2s; }
.big-btn:hover { transform: translateY(-2px); }
.size-note { color: var(--muted); font-size: 14px; text-align: center; font-variant-numeric: tabular-nums; }
.size-note b { color: var(--lime); }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.swatch { cursor: pointer; border: 1px solid var(--stroke-2); border-radius: 14px; overflow: hidden; background: var(--surface); padding: 0; text-align: center; transition: transform .2s; }
.swatch:hover { transform: translateY(-3px); }
.swatch i { display: block; height: 58px; }
.swatch span { display: block; padding: 6px; font: 600 13px var(--display); direction: ltr; }
.qr-box { display: grid; justify-items: center; gap: 10px; color: var(--muted); font-size: 14px; text-align: center; }
.qr-box canvas, .qr-box img { width: 220px; height: 220px; border-radius: 16px; background: #fff; padding: 12px; image-rendering: pixelated; }

/* ---------- footer, toasts, confetti, lightbox ---------- */
.footer { width: min(1100px, 100%); margin: 70px auto 26px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 14px; padding-top: 20px; border-top: 1px solid var(--stroke); }
.muted { color: var(--faint); }
.bookmarklet { text-decoration: none; padding: 8px 14px; border-radius: 999px; background: var(--surface-2); border: 1px dashed var(--stroke-2); cursor: grab; font-weight: 600; }
.bookmarklet:hover { border-color: var(--pink); color: var(--text); }
.toast-zone { position: fixed; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); left: 50%; translate: -50% 0; z-index: 80; display: grid; gap: 8px; justify-items: center; }
.toast { padding: 11px 18px; border-radius: 14px; background: rgba(20,18,36,.94); border: 1px solid var(--stroke-2); backdrop-filter: blur(12px); font-size: 15px; animation: rise .4s var(--ease) both; box-shadow: 0 20px 40px -12px #000; }
.toast.ok { border-color: rgba(182,255,92,.4); }
.toast.err { border-color: rgba(255,92,122,.5); }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; }
.lightbox { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(4,3,10,.88); backdrop-filter: blur(10px); animation: fade .25s both; padding: 24px; }
.lightbox img, .lightbox video { max-width: min(1100px, 100%); max-height: 86vh; border-radius: 16px; box-shadow: 0 40px 100px -20px #000; }
@keyframes fade { from { opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .studio-panel { grid-template-columns: 1fr; overflow-y: auto; }
  .studio-preview { min-height: 220px; }
  .studio-preview img, .studio-preview video { max-height: 42vh; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .quota-pill { padding: 4px 10px 4px 5px; }
  .footer { justify-content: center; text-align: center; }
  .cta { padding: 13px 16px; }
  .cta-label { display: none; }
  .timeline li { font-size: 11px; }
  .timeline .step-time { display: none; }
  .steps { font-size: 14px; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
