/* ============================================================
   هديتك — Design System (monochrome white + ink, mobile-first, RTL)
   Shared across all pages. Cached after first load.
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

img, svg, video { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---------- Tokens ---------- */
:root {
    /* Ink scale (near-black → grey) — replaces old pink scale.
       Old --pink-* names kept (remapped) so inline styles stay monochrome. */
    --ink:        #0a0a0a;   /* primary: headings, buttons, icons */
    --ink-800:    #141417;
    --ink-700:    #1d1d21;
    --ink-600:    #2a2a2f;   /* primary hover */
    --text:       #3a3a40;   /* body */
    --text-soft:  #71717a;   /* muted */
    --line:       #ededef;   /* hairline border */
    --line-strong:#dcdce0;   /* stronger border */

    --pink-50:  #f6f6f7;
    --pink-100: #ededef;
    --pink-200: #e0e0e3;
    --pink-300: #cdcdd2;
    --pink-400: #0a0a0a;     /* focus border / accent rule */
    --pink-500: #0a0a0a;     /* primary */
    --pink-600: #2a2a2f;     /* primary hover */
    --pink-700: #141417;     /* accent text / links */

    /* Neutrals */
    --white: #ffffff;
    --bg: #ffffff;
    --bg-soft: #f7f7f8;      /* alternating section */
    --bg-blush: #f2f2f3;     /* subtle block */
    --border: #ededef;
    --border-strong: #dcdce0;

    /* Effects (neutral, no color tint) */
    --shadow-sm: 0 1px 2px rgba(10,10,12,.05), 0 1px 3px rgba(10,10,12,.05);
    --shadow:    0 6px 24px rgba(10,10,12,.07);
    --shadow-md: 0 14px 38px rgba(10,10,12,.10);
    --shadow-lg: 0 28px 64px rgba(10,10,12,.16);
    --ring: 0 0 0 4px rgba(10,10,12,.14);

    /* "gradients" are now subtle near-black / near-white — no color */
    --grad-pink: linear-gradient(180deg, #232328 0%, #0a0a0a 100%);
    --grad-pink-soft: linear-gradient(135deg, #fbfbfc, #f2f2f3);

    /* Radii */
    --r-sm: 12px; --r: 16px; --r-lg: 22px; --r-xl: 30px; --r-pill: 999px;

    /* Layout */
    --container: 1160px;
    --narrow: 820px;
    --nav-h: 68px;

    /* Easing */
    --ease: cubic-bezier(.22, .61, .36, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);

    --font: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
}

/* ---------- Base ---------- */
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.8;
    font-size: 16px;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; font-weight: 800; }
h1 { font-size: clamp(2.05rem, 6.2vw, 3.7rem); font-weight: 900; letter-spacing: -.5px; }
h2 { font-size: clamp(1.55rem, 4.4vw, 2.5rem); font-weight: 800; letter-spacing: -.3px; }
h3 { font-size: clamp(1.18rem, 2.6vw, 1.5rem); }
p  { color: var(--text); }

.gradient-text { color: var(--ink); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.container.narrow { max-width: var(--narrow); }
.section { padding-block: clamp(48px, 8vw, 96px); }
.section-soft { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 660px; margin-inline: auto; margin-bottom: clamp(28px, 5vw, 52px); }
.section-head p { color: var(--text-soft); font-size: 1.05rem; margin-top: 12px; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg-soft); color: var(--ink);
    border: 1px solid var(--border-strong);
    padding: 7px 16px; border-radius: var(--r-pill);
    font-size: .85rem; font-weight: 800; margin-bottom: 16px;
}
.eyebrow svg { width: 16px; height: 16px; }

/* ---------- Skip link (a11y) ---------- */
.skip-link {
    position: absolute; inset-inline-start: 16px; top: -100px;
    background: var(--ink); color: #fff; padding: 10px 18px;
    border-radius: var(--r-sm); z-index: 10001; transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* ---------- Header / Nav ---------- */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(255,255,255,.72);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
}
.site-header.is-scrolled {
    border-bottom-color: var(--border);
    box-shadow: 0 1px 0 rgba(10,10,12,.04), 0 8px 30px rgba(10,10,12,.05);
    background: rgba(255,255,255,.85);
}
.nav {
    height: var(--nav-h); display: flex; align-items: center;
    justify-content: space-between; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.32rem; color: var(--ink); }
.brand .brand-mark {
    width: 36px; height: 36px; border-radius: 11px; flex: none;
    background: var(--grad-pink); color: #fff; display: grid; place-items: center;
    box-shadow: var(--shadow-sm);
    transition: transform .3s var(--ease-out);
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }
.brand .brand-mark svg { width: 20px; height: 20px; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
    position: relative;
    padding: 9px 14px; border-radius: var(--r-sm); font-weight: 700; font-size: .95rem;
    color: var(--text); transition: color .18s var(--ease);
}
.nav-links a::after {
    content: ""; position: absolute; inset-inline: 14px; bottom: 5px; height: 2px;
    background: var(--ink); border-radius: 2px;
    transform: scaleX(0); transform-origin: inline-end;
    transition: transform .3s var(--ease-out);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); transform-origin: inline-start; }
.nav-links a.active { color: var(--ink); }

.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-links .mobile-cta { display: none; }
.nav-toggle {
    display: none; width: 44px; height: 44px; border-radius: var(--r-sm);
    align-items: center; justify-content: center; color: var(--ink);
    border: 1px solid var(--border-strong);
}
.nav-toggle svg { width: 24px; height: 24px; }

/* mobile nav */
@media (max-width: 920px) {
    .nav-toggle { display: inline-flex; }
    .nav-links {
        position: fixed; inset: var(--nav-h) 0 auto 0;
        flex-direction: column; align-items: stretch; gap: 2px;
        background: #fff; padding: 14px 18px 22px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        transform: translateY(-12px); opacity: 0; pointer-events: none;
        transition: opacity .22s var(--ease), transform .22s var(--ease);
    }
    .nav-links a { padding: 14px 12px; font-size: 1.05rem; border-radius: var(--r); }
    .nav-links a::after { display: none; }
    .nav-links a:hover, .nav-links a.active { background: var(--bg-soft); }
    .nav-open .nav-links { transform: translateY(0); opacity: 1; pointer-events: auto; }
    .nav-cta .nav-desktop-cta { display: none; }
    .nav-links .mobile-cta { display: inline-flex; margin-top: 10px; justify-content: center; }
    .nav-links .mobile-cta:hover { background: var(--ink-600); }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    font-weight: 800; font-size: 1rem; line-height: 1;
    padding: 14px 26px; border-radius: var(--r-pill);
    transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .2s, color .2s, border-color .2s;
    white-space: nowrap; border: 1.5px solid transparent;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--ink-600); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--ink); transform: translateY(-2px); }
.btn-soft { background: var(--bg-soft); color: var(--ink); border-color: var(--border); }
.btn-soft:hover { background: var(--pink-100); }
.btn-lg { padding: 17px 34px; font-size: 1.1rem; }
.btn-sm { padding: 10px 18px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, button:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- Cards ---------- */
.card {
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 26px;
    box-shadow: var(--shadow-sm); transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), border-color .3s var(--ease-out);
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 980px) { .grid-3 { grid-template-columns: repeat(3,1fr); } .grid-4 { grid-template-columns: repeat(4,1fr); } }

/* feature card */
.feature .feat-ic {
    width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
    color: var(--ink); background: var(--bg-soft); border: 1px solid var(--border-strong);
    margin-bottom: 16px; transition: transform .3s var(--ease-out), background .3s var(--ease-out), color .3s var(--ease-out);
}
.feature .feat-ic svg { width: 26px; height: 26px; }
.card-hover:hover .feat-ic, .feature:hover .feat-ic { transform: translateY(-2px); }
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--text-soft); font-size: .98rem; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(48px, 9vw, 104px); overflow: hidden; }
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(60% 50% at 50% -8%, rgba(10,10,12,.05), transparent 70%),
        radial-gradient(40% 40% at 92% 8%, rgba(10,10,12,.035), transparent 70%),
        var(--bg);
}
.hero-grid { display: grid; gap: 36px; align-items: center; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 44px; } }
.hero h1 { margin-bottom: 18px; }
.hero .lead { font-size: clamp(1.05rem, 2.4vw, 1.32rem); color: var(--text-soft); max-width: 560px; margin-bottom: 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 32px; color: var(--text-soft); font-size: .92rem; }
.hero-trust b { color: var(--ink); }
.hero-trust .ht { display: inline-flex; align-items: center; gap: 8px; }
.hero-trust .ht svg { width: 18px; height: 18px; color: var(--ink); flex: none; }

/* subtle float for the hero phone mock */
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.phone-float { animation: floaty 6s ease-in-out infinite; }

/* ---------- Pills / chips / filters ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
    padding: 9px 18px; border-radius: var(--r-pill); font-weight: 700; font-size: .92rem;
    background: #fff; border: 1.5px solid var(--border-strong); color: var(--text);
    transition: all .18s var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Template cards ---------- */
.tpl-grid { display: grid; gap: 18px; grid-template-columns: repeat(2,1fr); }
@media (min-width: 720px) { .tpl-grid { grid-template-columns: repeat(3,1fr); } }
@media (min-width: 1040px) { .tpl-grid { grid-template-columns: repeat(4,1fr); } }

.tpl-card {
    border-radius: var(--r-lg); overflow: hidden; background: #fff;
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out); display: flex; flex-direction: column;
}
.tpl-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.tpl-preview {
    aspect-ratio: 4/5; display: grid; place-items: center; position: relative;
    color: #fff; text-align: center; padding: 18px;
}
.tpl-preview .tpl-emoji { font-size: clamp(2.6rem, 9vw, 3.4rem); filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); transition: transform .3s var(--ease-out); }
.tpl-card:hover .tpl-emoji { transform: scale(1.08); }
.tpl-preview .tpl-mini-name { position: absolute; inset-block-end: 14px; inset-inline: 14px; font-weight: 800; font-size: .95rem; text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.tpl-badge {
    position: absolute; inset-block-start: 12px; inset-inline-start: 12px;
    background: rgba(10,10,12,.82); color: #fff; backdrop-filter: blur(4px);
    font-size: .72rem; font-weight: 800; padding: 4px 11px; border-radius: var(--r-pill);
}
.tpl-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.tpl-body h3 { font-size: 1.02rem; }
.tpl-cat { font-size: .82rem; color: var(--text-soft); }
.tpl-body .btn { margin-top: auto; }

/* category card */
.cat-card { display: flex; gap: 16px; align-items: center; }
.cat-ic {
    width: 58px; height: 58px; border-radius: 16px; flex: none; display: grid; place-items: center;
    color: var(--ink); background: var(--bg-soft); border: 1px solid var(--border-strong);
    transition: transform .3s var(--ease-out), background .3s var(--ease-out), color .3s var(--ease-out);
}
.cat-ic svg { width: 27px; height: 27px; }
.cat-card:hover .cat-ic { background: var(--ink); color: #fff; transform: translateY(-2px); }
.cat-card h3 { margin-bottom: 2px; }
.cat-card .cat-count { color: var(--text-soft); font-size: .9rem; }

/* ---------- Forms ---------- */
.field { margin-bottom: 22px; }
.field > label { display: block; font-weight: 800; color: var(--ink); margin-bottom: 9px; font-size: .98rem; }
.field .hint { color: var(--text-soft); font-size: .85rem; margin-top: 7px; }
.input, .textarea, select.input {
    width: 100%; padding: 14px 16px; background: #fff;
    border: 1.5px solid var(--border-strong); border-radius: var(--r);
    color: var(--ink); font-size: 1rem; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: #a7a7ae; }
.input:focus, .textarea:focus { border-color: var(--ink); box-shadow: var(--ring); outline: none; }
.textarea { min-height: 132px; resize: vertical; line-height: 1.8; }

/* ---------- Footer ---------- */
.site-footer { background: #0a0a0a; color: #d4d4d8; padding-block: 52px 30px; margin-top: 40px; }
.site-footer a { color: #c4c4cb; transition: color .15s; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: 30px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-brand .brand { color: #fff; margin-bottom: 12px; }
.footer-brand .brand-mark { background: #fff; color: #0a0a0a; }
.footer-brand p { color: #9a9aa3; font-size: .93rem; max-width: 320px; }
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.footer-col li { margin-bottom: 9px; font-size: .94rem; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1); margin-top: 34px; padding-top: 22px;
    display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
    color: #9a9aa3; font-size: .86rem;
}
.footer-bottom .foot-links { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Ad slots (CLS-safe: reserve space) ---------- */
.ad-slot {
    position: relative; margin-inline: auto; max-width: 760px;
    min-height: 110px; display: flex; align-items: center; justify-content: center;
    background: var(--bg-soft); border: 1px dashed var(--border-strong);
    border-radius: var(--r); padding: 12px; overflow: hidden;
}
.ad-slot::before {
    content: "إعلان"; position: absolute; inset-block-start: 8px; inset-inline-end: 14px;
    font-size: .68rem; color: var(--text-soft); letter-spacing: .5px;
}
.ad-slot .ad-fallback { color: #b8b8bf; font-size: .85rem; }

/* ---------- Toast ---------- */
.toast {
    position: fixed; inset-block-start: 22px; inset-inline-start: 50%; transform: translateX(50%);
    background: var(--ink); color: #fff; padding: 13px 24px; border-radius: var(--r-pill);
    font-weight: 700; z-index: 99999; box-shadow: var(--shadow-lg);
    animation: toastIn .3s var(--ease-out);
}
@keyframes toastIn { from { opacity: 0; transform: translate(50%, -10px); } }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .07s; } .reveal.d2 { transition-delay: .14s; }
.reveal.d3 { transition-delay: .21s; } .reveal.d4 { transition-delay: .28s; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .phone-float { animation: none; }
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- Misc utilities ---------- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-0{margin-top:0}.mt-1{margin-top:10px}.mt-2{margin-top:20px}.mt-3{margin-top:30px}.mt-4{margin-top:42px}
.mb-2{margin-bottom:20px}
.muted { color: var(--text-soft); }
.lead-soft { color: var(--text); font-size: clamp(1.02rem, 2vw, 1.18rem); line-height: 1.95; text-align: center; max-width: 720px; margin-inline: auto; }
.share-burst { color: var(--ink); display: flex; justify-content: center; margin-bottom: 6px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.center { display: flex; align-items: center; justify-content: center; }

/* breadcrumbs */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--text-soft); font-size: .88rem; padding-block: 18px; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { opacity: .5; }

/* scrollbar + selection */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: var(--pink-200); border-radius: 8px; border: 2px solid var(--bg-soft); }
::-webkit-scrollbar-thumb:hover { background: var(--pink-300); }
::selection { background: #0a0a0a; color: #fff; }

/* ============================================================
   BUILDER (create.html)
   ============================================================ */
.builder-layout { display: grid; gap: 28px; align-items: start; }
@media (min-width: 1024px) { .builder-layout { grid-template-columns: 1.1fr .9fr; gap: 40px; } }

.steps { display: flex; align-items: center; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.step { display: flex; align-items: center; gap: 9px; }
.step .dot {
    width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
    font-weight: 800; background: #fff; border: 2px solid var(--border-strong); color: var(--text-soft);
    transition: all .25s var(--ease); flex: none;
}
.step .step-name { font-weight: 700; font-size: .9rem; color: var(--text-soft); }
.step.active .dot { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.step.active .step-name { color: var(--ink); }
.step.done .dot { background: var(--ink-700); border-color: var(--ink-700); color: #fff; }
.step-line { width: 26px; height: 2px; background: var(--border-strong); }
@media (max-width: 560px) { .step .step-name { display: none; } .step-line { width: 16px; } }

.wizard-step { display: none; animation: fadeStep .35s var(--ease-out); }
.wizard-step.active { display: block; }
@keyframes fadeStep { from { opacity: 0; transform: translateY(10px); } }
.wizard-actions { display: flex; gap: 12px; margin-top: 26px; }
.wizard-actions .btn { flex: 1; }
@media (max-width: 560px) { .wizard-actions { flex-direction: column-reverse; } }

.emoji-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px,1fr)); gap: 10px; }
.emoji-item {
    aspect-ratio: 1; display: grid; place-items: center; font-size: 2rem;
    background: #fff; border: 1.5px solid var(--border-strong); border-radius: var(--r-sm);
    cursor: pointer; transition: all .18s var(--ease);
}
.emoji-item:hover { border-color: var(--ink); background: var(--bg-soft); transform: translateY(-2px); }
.emoji-item.selected { border-color: var(--ink); background: var(--bg-soft); box-shadow: var(--ring); }

.color-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px,1fr)); gap: 10px; }
.swatch { aspect-ratio: 1; border-radius: var(--r-sm); cursor: pointer; border: 3px solid transparent; position: relative; transition: transform .18s var(--ease); }
.swatch:hover { transform: translateY(-2px); }
.swatch.selected { border-color: #fff; box-shadow: 0 0 0 3px var(--ink); }
.swatch.selected::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.3rem; text-shadow: 0 1px 4px rgba(0,0,0,.5); }

.inline-tool { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.inline-tool label { font-size: .9rem; color: var(--text-soft); font-weight: 700; }
.color-input { width: 52px; height: 44px; border: 1.5px solid var(--border-strong); border-radius: var(--r-sm); padding: 3px; cursor: pointer; background: #fff; }
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: none; border-radius: 8px; }

.upload-btn {
    width: 100%; padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--r);
    background: var(--bg-soft); color: var(--ink); font-weight: 700; cursor: pointer;
    transition: background .15s, border-color .15s; text-align: center;
}
.upload-btn:hover { background: var(--pink-100); border-color: var(--ink); }
.thumb { margin-top: 12px; border-radius: var(--r); overflow: hidden; max-width: 240px; box-shadow: var(--shadow-sm); }
.thumb img { width: 100%; max-height: 150px; object-fit: cover; }
.ok-note { color: var(--ink); font-size: .88rem; margin-top: 8px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.ok-note svg { width: 16px; height: 16px; }

/* Phone preview */
.preview-wrap { position: sticky; top: calc(var(--nav-h) + 18px); }
.preview-wrap .preview-title { text-align: center; font-weight: 800; color: var(--ink); margin-bottom: 16px; }
.phone {
    max-width: 320px; margin-inline: auto; background: #0a0a0a; border-radius: 42px;
    padding: 12px; box-shadow: var(--shadow-lg);
}
.phone-screen { aspect-ratio: 9/19; border-radius: 32px; overflow: hidden; position: relative; background: #000; }
.canvas-card {
    width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center; padding: 46px 26px; gap: 8px;
    background-size: cover; background-position: center; transition: background .3s;
}
.canvas-card .c-emoji { font-size: 4rem; filter: drop-shadow(0 4px 10px rgba(0,0,0,.3)); }
.canvas-card .c-greet { color: rgba(255,255,255,.92); font-weight: 700; font-size: 1rem; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.canvas-card .c-name { color: #fff; font-weight: 900; font-size: 1.7rem; text-shadow: 0 2px 10px rgba(0,0,0,.5); word-break: break-word; }
.canvas-card .c-msg { color: rgba(255,255,255,.95); font-size: .95rem; line-height: 1.7; text-shadow: 0 2px 8px rgba(0,0,0,.5); word-break: break-word; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.canvas-card .c-sender { color: rgba(255,255,255,.9); font-style: italic; margin-top: 14px; text-shadow: 0 2px 8px rgba(0,0,0,.5); }

/* template quick-pick strip */
.tpl-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.tpl-strip::-webkit-scrollbar { height: 6px; }
.tpl-mini { flex: none; width: 92px; scroll-snap-align: start; cursor: pointer; text-align: center; }
.tpl-mini .tpl-mini-box { aspect-ratio: 4/5; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 1.9rem; color: #fff; box-shadow: var(--shadow-sm); transition: transform .18s var(--ease); }
.tpl-mini:hover .tpl-mini-box { transform: translateY(-3px); }
.tpl-mini span { font-size: .76rem; color: var(--text-soft); display: block; margin-top: 6px; font-weight: 700; }

/* ============================================================
   GIFT VIEW (gift.html)
   ============================================================ */
.gift-stage { min-height: calc(100vh - var(--nav-h)); display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.gift-box-wrap { text-align: center; }
.gift-box {
    width: 200px; height: 200px; margin: 0 auto 28px; border-radius: 36px; cursor: pointer;
    display: grid; place-items: center; color: #fff;
    background: var(--grad-pink); box-shadow: var(--shadow-lg);
    animation: giftPulse 2.4s ease-in-out infinite;
    transition: transform .3s var(--ease-out);
}
.gift-box svg { width: 96px; height: 96px; }
@keyframes giftPulse { 0%,100%{ transform: translateY(0) scale(1); } 50% { transform: translateY(-8px) scale(1.03); } }
.gift-box:hover { animation-play-state: paused; transform: scale(1.04); }
.gift-prompt { font-weight: 800; color: var(--ink); font-size: 1.15rem; }

.gift-card-opened { max-width: 560px; width: 100%; margin-inline: auto; border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-lg); animation: openUp .55s var(--ease-out); }
@keyframes openUp { from { opacity: 0; transform: translateY(24px) scale(.96); } }
.gift-card-inner { padding: 46px 28px; text-align: center; color: #fff; }
.gift-card-inner .g-emoji { font-size: 5rem; filter: drop-shadow(0 6px 14px rgba(0,0,0,.3)); }
.gift-card-inner .g-greet { font-weight: 700; font-size: 1.15rem; opacity: .95; margin-top: 10px; text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.gift-card-inner .g-name { font-weight: 900; font-size: clamp(2rem, 8vw, 3rem); margin: 6px 0 18px; text-shadow: 0 3px 12px rgba(0,0,0,.4); }
.gift-card-inner .g-msg { font-size: 1.12rem; line-height: 2; text-shadow: 0 2px 8px rgba(0,0,0,.35); white-space: pre-wrap; word-break: break-word; }
.gift-card-inner .g-img { border-radius: var(--r); margin: 22px auto 0; box-shadow: var(--shadow-md); max-height: 320px; }
.gift-card-inner .g-sender { font-style: italic; font-size: 1.1rem; margin-top: 26px; opacity: .95; text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.yt-embed { width: 100%; aspect-ratio: 16/9; border-radius: var(--r); overflow: hidden; margin-top: 22px; box-shadow: var(--shadow-md); }
.yt-embed iframe { width: 100%; height: 100%; border: 0; }

.viral-cta {
    max-width: 560px; margin: 24px auto 0; text-align: center;
    background: var(--bg-soft); border: 1px solid var(--border-strong);
    border-radius: var(--r-lg); padding: 28px 22px;
}
.viral-cta .vc-emoji { color: var(--ink); display: inline-grid; place-items: center; }
.viral-cta .vc-emoji svg { width: 40px; height: 40px; }
.viral-cta h3 { margin: 8px 0; }
.viral-cta p { color: var(--text-soft); margin-bottom: 16px; }
.viral-perks { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.viral-perks span { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--border-strong); padding: 6px 13px; border-radius: var(--r-pill); font-size: .82rem; font-weight: 700; color: var(--ink); }
.viral-perks span svg { width: 15px; height: 15px; }

.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 9999; }

/* loading */
.loading-stage { min-height: calc(100vh - var(--nav-h)); display: grid; place-items: center; text-align: center; }
.spinner { width: 56px; height: 56px; border: 5px solid var(--pink-100); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 22px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   LEGAL / RICH TEXT (about, privacy, terms)
   ============================================================ */
.prose { max-width: var(--narrow); margin-inline: auto; }
.prose h2 { font-size: 1.4rem; margin: 34px 0 12px; padding-inline-start: 14px; border-inline-start: 4px solid var(--ink); }
.prose h3 { margin: 22px 0 8px; }
.prose p, .prose li { color: var(--text); margin-bottom: 10px; }
.prose ul { padding-inline-start: 22px; list-style: disc; }
.prose ul li { margin-bottom: 8px; }
.prose strong { color: var(--ink); }
.prose .meta { color: var(--text-soft); font-size: .88rem; }
.prose a { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.prose a:hover { color: var(--text-soft); }

/* faq */
.faq-item { border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 12px; overflow: hidden; background: #fff; transition: border-color .2s var(--ease); }
.faq-item[open] { border-color: var(--line-strong); }
.faq-item summary { padding: 18px 20px; font-weight: 800; color: var(--ink); cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--ink); font-size: 1.5rem; font-weight: 400; transition: transform .25s var(--ease); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-a { padding: 0 20px 18px; color: var(--text-soft); }
