/* ============================================================
   Cardodo · emerald / black / white
   ============================================================ */

:root {
    --bg: #ffffff;
    --bg-2: #f6faf8;
    --panel: #f6faf8;
    --panel-2: #eef5f1;
    --line: #e1ebe5;
    --line-strong: #c4d6cc;
    --text: #0b1f16;
    --muted: #55695f;
    --em: #0a8a5c;
    --em-2: #067a4f;
    --em-3: #04573c;
    --em-glow: rgba(10, 138, 92, .22);
    --danger: #d92d45;
    --warn: #b7791f;
    --radius: 22px;
    --radius-sm: 14px;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
h1, h2, h3 { margin: 0 0 .4em; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); font-weight: 900; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85em; color: #bff5dc; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--em); color: #03130c; }

.muted { color: var(--muted); }
.small { font-size: .86rem; }
.hidden { display: none !important; }
.grad {
    background: linear-gradient(110deg, #d7ffe9 0%, var(--em) 45%, #00ffb2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Ambient background ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.bg-orbs span {
    position: absolute; border-radius: 50%; filter: blur(90px); opacity: .32;
    animation: drift 22s ease-in-out infinite alternate;
}
.bg-orbs span:nth-child(1) { width: 46vw; height: 46vw; background: #0fbf7a; top: -14vw; left: -10vw; }
.bg-orbs span:nth-child(2) { width: 38vw; height: 38vw; background: #06643f; bottom: -12vw; right: -8vw; animation-delay: -6s; }
.bg-orbs span:nth-child(3) { width: 22vw; height: 22vw; background: #39ffb0; top: 40%; left: 55%; opacity: .14; animation-delay: -11s; }
.bg-grid {
    position: fixed; inset: 0; z-index: -1; 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: 56px 56px;
    mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%);
}
@keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(4vw, 3vh, 0) scale(1.08); }
}

/* ---------- Icons & buttons ---------- */
.icon {
    width: 1.2em; height: 1.2em; flex: none; display: inline-block; vertical-align: -.2em;
    fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.brand-icon { width: 1.6em; height: 1.6em; color: var(--em); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    padding: .8em 1.3em; border-radius: 999px; border: 1px solid transparent;
    font-weight: 700; font-size: .97rem; text-decoration: none; cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary {
    color: #03130c;
    background: linear-gradient(135deg, #5ff7c2, var(--em) 40%, var(--em-2));
    box-shadow: 0 10px 30px -8px var(--em-glow), inset 0 1px 0 rgba(255,255,255,.5);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 40px -8px var(--em-glow); }
.btn-ghost {
    background: var(--panel-2); border-color: var(--line-strong); color: var(--text);
    backdrop-filter: blur(10px);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--em); color: var(--em); }
.btn-lg { padding: 1em 1.7em; font-size: 1.02rem; }
.btn-block { width: 100%; }
.icon-btn {
    display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
    background: var(--panel-2); border: 1px solid var(--line); color: var(--text); cursor: pointer;
    transition: all .2s;
}
.icon-btn:hover { border-color: var(--em); color: var(--em); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- Public site ---------- */
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px clamp(16px, 4vw, 48px);
    background: rgba(3, 7, 5, .6); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .5em; font-weight: 900; font-size: 1.2rem; text-decoration: none; letter-spacing: -.02em; }
.balance {
    display: inline-flex; align-items: center; gap: .5em;
    padding: .5em 1em; border-radius: 999px;
    background: rgba(23, 229, 155, .1); border: 1px solid rgba(23, 229, 155, .35);
    color: var(--em); box-shadow: 0 0 24px -6px var(--em-glow);
}
.balance strong { color: var(--text); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.balance small { color: var(--muted); }
.balance.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.08); } }

main { position: relative; }
.hero {
    text-align: center; padding: clamp(64px, 12vw, 120px) 20px clamp(40px, 6vw, 70px);
    max-width: 980px; margin: 0 auto;
    animation: rise .8s ease both;
}
.eyebrow {
    display: inline-flex; align-items: center; gap: .5em; padding: .45em 1em; border-radius: 999px;
    background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font-size: .9rem;
    margin-bottom: 1.4em;
}
.eyebrow .icon { color: var(--em); }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 640px; margin: 0 auto 2em; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.section { max-width: 1120px; margin: 0 auto; padding: clamp(40px, 7vw, 80px) 20px; }
.section-head { margin-bottom: 28px; }
.section-head p { color: var(--muted); margin: 0; }

.grid { display: grid; gap: 20px; }
.packages { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
    border: 1px solid var(--line); border-radius: var(--radius);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255,255,255,.05);
}

.pkg {
    position: relative; padding: 26px; display: flex; flex-direction: column; gap: 12px;
    transition: transform .3s ease, border-color .3s, box-shadow .3s;
    animation: rise .6s ease both; animation-delay: var(--d, 0ms);
}
.pkg:hover { transform: translateY(-6px); border-color: rgba(23, 229, 155, .45); box-shadow: 0 30px 70px -30px var(--em-glow); }
.pkg.featured {
    border-color: rgba(23, 229, 155, .6);
    background: radial-gradient(120% 80% at 50% 0%, rgba(23,229,155,.22), transparent 60%), linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
    box-shadow: 0 30px 80px -30px var(--em-glow);
}
.pkg-top { display: flex; align-items: center; gap: 10px; color: var(--em); }
.pkg-top h3 { color: var(--text); margin: 0; }
.pkg-amount { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 2px; }
.pkg-amount strong { font-size: 3.2rem; font-weight: 900; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.pkg-amount span { color: var(--muted); font-weight: 600; }
.pkg p { margin: 0; }
.pkg-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.price { color: var(--muted); font-size: .9rem; font-weight: 600; }
.tag {
    display: inline-block; align-self: flex-start; padding: .3em .8em; border-radius: 999px; font-size: .75rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .06em; color: #03130c; background: var(--em);
}
.pkg .tag { position: absolute; top: 18px; right: 18px; }
.fine { display: flex; align-items: center; justify-content: center; gap: .5em; color: var(--muted); font-size: .9rem; margin-top: 28px; }
.fine .icon { color: var(--em); }

.vault {
    display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center;
    padding: clamp(26px, 5vw, 48px); position: relative; overflow: hidden;
}
.vault::before {
    content: ""; position: absolute; inset: -40% -20% auto auto; width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle, rgba(23,229,155,.25), transparent 65%); pointer-events: none;
}
.vault-icon {
    width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center;
    background: linear-gradient(145deg, rgba(23,229,155,.25), rgba(4,87,60,.3));
    border: 1px solid rgba(23,229,155,.5); color: var(--em);
    box-shadow: 0 0 50px -10px var(--em-glow);
}
.vault-icon .icon { width: 38px; height: 38px; }
.vault.revealed .vault-icon { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 70px -4px var(--em-glow); } }
.vault-body h2 { margin-bottom: .3em; }
.vault-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 12px; }

.pin-slots { display: flex; gap: clamp(8px, 2vw, 14px); flex-wrap: wrap; margin: 22px 0 4px; }
.slot {
    min-width: clamp(56px, 12vw, 76px); height: clamp(72px, 14vw, 92px); padding: 0 14px;
    display: grid; place-items: center; border-radius: 18px;
    background: #03100a; border: 1px solid rgba(23,229,155,.4);
    font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 900; font-variant-numeric: tabular-nums;
    color: var(--em); text-shadow: 0 0 22px var(--em-glow);
    box-shadow: inset 0 0 30px rgba(23,229,155,.08), 0 14px 30px -18px var(--em-glow);
    animation: slotIn .6s cubic-bezier(.2,.9,.3,1.3) both; animation-delay: var(--d, 0ms);
}
.slot.ghost { color: var(--muted); text-shadow: none; border-color: var(--line); animation: none; font-size: 2rem; }
@keyframes slotIn {
    from { opacity: 0; transform: translateY(18px) rotateX(-70deg); }
    to   { opacity: 1; transform: none; }
}

.footer {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
    max-width: 1120px; margin: 40px auto 0; padding: 26px 20px 40px; border-top: 1px solid var(--line);
    font-weight: 700;
}
.footer span:first-child { display: inline-flex; align-items: center; gap: .5em; }
.footer .icon { color: var(--em); }

.skeleton {
    height: 280px; border-radius: var(--radius);
    background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.08), rgba(255,255,255,.03));
    background-size: 200% 100%; animation: shimmer 1.4s infinite linear;
    border: 1px solid var(--line);
}
.skeleton.tall { height: 60vh; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { color: var(--muted); text-align: center; padding: 28px; }

.toasts { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 10px; max-width: calc(100vw - 36px); }
.toast {
    display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 16px;
    background: #07140e; border: 1px solid var(--line-strong); box-shadow: 0 20px 50px -20px #000;
    animation: rise .35s ease both; transition: opacity .4s, transform .4s;
}
.toast .icon { color: var(--em); }
.toast.error { border-color: rgba(255,95,112,.6); }
.toast.error .icon { color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(8px); }

@keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Forms ---------- */
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > span { font-weight: 600; font-size: .92rem; color: #d6eee2; }
.field small { color: var(--muted); }
input[type="text"], input[type="password"], input[type="number"], input[type="search"], input:not([type]), textarea, select {
    width: 100%; padding: .75em 1em; border-radius: 14px;
    background: rgba(0,0,0,.45); border: 1px solid var(--line-strong); outline: none;
    transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--em); box-shadow: 0 0 0 4px rgba(23,229,155,.15); }
textarea { resize: vertical; min-height: 84px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; margin: 4px 0 16px; }
.check input { width: 18px; height: 18px; accent-color: var(--em); }
.form-error { color: var(--danger); min-height: 1.2em; font-size: .92rem; }

/* ---------- Admin login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 36px; text-align: left; }
.login-icon {
    width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 18px;
    background: linear-gradient(145deg, rgba(23,229,155,.3), rgba(4,87,60,.35)); color: var(--em);
    border: 1px solid rgba(23,229,155,.5); box-shadow: 0 0 40px -8px var(--em-glow);
}
.login-icon .icon { width: 30px; height: 30px; }
.login-card h1 { font-size: 1.8rem; }
.back-link { display: block; margin-top: 18px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.back-link:hover { color: var(--em); }

/* ---------- Admin shell ---------- */
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px;
    padding: 22px 16px; background: rgba(4, 10, 7, .8); backdrop-filter: blur(18px);
    border-right: 1px solid var(--line);
}
.sidebar .brand { padding: 0 8px; }
.brand em { font-style: normal; color: var(--em); font-weight: 700; font-size: .7em; text-transform: uppercase; letter-spacing: .12em; margin-left: 4px; }
.nav { display: grid; gap: 6px; }
.nav-item {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border-radius: 14px;
    background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer;
    font-weight: 600; text-align: left; transition: all .2s;
}
.nav-item:hover { color: var(--text); background: var(--panel-2); }
.nav-item.active { color: #03130c; background: linear-gradient(135deg, #5ff7c2, var(--em) 50%, var(--em-2)); box-shadow: 0 10px 26px -10px var(--em-glow); }
.nav-item.active .icon { color: #03130c; }
.sidebar .logout { margin-top: auto; }
.main { padding: clamp(18px, 3vw, 40px); min-width: 0; }
.view { max-width: 1200px; margin: 0 auto; animation: rise .4s ease both; }

.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.panel-head p { color: var(--muted); margin: 0; }
.alert {
    display: flex; gap: 10px; align-items: center; padding: 14px 18px; border-radius: 16px; margin-bottom: 14px;
    background: rgba(255, 209, 102, .08); border: 1px solid rgba(255, 209, 102, .4); color: #ffe7a6;
}
.alert .icon { color: var(--warn); }

.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 22px; }
.stat { padding: 20px; }
.stat .icon { color: var(--em); width: 1.4em; height: 1.4em; }
.stat strong { display: block; font-size: 2rem; font-weight: 900; letter-spacing: -.03em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .9rem; font-weight: 600; }

.split { display: grid; gap: 20px; grid-template-columns: 1.4fr 1fr; }
.panel { padding: 22px; }
.panel h3 { margin-bottom: 14px; }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 210px; padding-top: 10px; }
.bar-col { flex: 1; display: grid; grid-template-rows: 1fr auto; gap: 8px; height: 100%; min-width: 0; }
.bars2 { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 100%; }
.bars2 .bar { width: 42%; min-height: 3px; border-radius: 8px 8px 4px 4px; transition: height .6s cubic-bezier(.2,.9,.3,1); }
.bar.visit { background: linear-gradient(180deg, #5ff7c2, var(--em-2)); box-shadow: 0 0 16px -4px var(--em-glow); }
.bar.click { background: linear-gradient(180deg, #e8fff5, #8fb8a6); opacity: .75; }
.bar-col small { text-align: center; color: var(--muted); font-size: .7rem; white-space: nowrap; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: .85rem; margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }

.feed { display: grid; gap: 10px; }
.feed-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-size: .92rem; }
.feed-row .muted { margin-left: auto; font-size: .8rem; white-space: nowrap; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(0,0,0,.25); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; background: rgba(255,255,255,.02); }
tbody tr { transition: background .2s; }
tbody tr:hover { background: rgba(23,229,155,.05); }
tbody tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .icon-btn + .icon-btn { margin-left: 6px; }

.pill { display: inline-block; padding: .25em .7em; border-radius: 999px; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: rgba(23,229,155,.15); color: var(--em); }
.pill.off { background: rgba(255,255,255,.06); color: var(--muted); }
.pill.type-visit { background: rgba(120,200,255,.14); color: #9fd8ff; }
.pill.type-click { background: rgba(255,255,255,.1); color: #fff; }
.pill.type-buy { background: rgba(23,229,155,.2); color: var(--em); }
.pill.type-reveal { background: rgba(255,209,102,.16); color: var(--warn); }
.pill.type-grant { background: rgba(255,95,112,.14); color: #ffb3bb; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    padding: .5em 1em; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line);
    color: var(--muted); cursor: pointer; font-weight: 600; font-size: .88rem;
}
.chip:hover { color: var(--text); }
.chip.on { color: #03130c; background: var(--em); border-color: var(--em); }
.search { width: min(320px, 100%); padding: .65em 1em; border-radius: 999px; }
.search::placeholder { color: #5d7568; }

.link-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.link-card { padding: 22px; display: grid; gap: 14px; }
.link-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.link-head > div { display: flex; align-items: center; gap: 10px; color: var(--em); }
.link-head h3 { color: var(--text); margin: 0; }
.url { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 14px; background: rgba(0,0,0,.45); border: 1px solid var(--line); }
.url code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; }
.mini-stats div { padding: 10px 4px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.mini-stats strong { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.mini-stats span { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }

.form-grid { padding: 26px; display: grid; gap: 4px; max-width: 760px; }
.form-grid .field { margin-bottom: 14px; }
.form-actions { margin-top: 8px; }
.card.form-grid + .card.form-grid { margin-top: 20px; }
.stack { display: grid; gap: 20px; max-width: 760px; }

/* Modal */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
    background: rgba(0,0,0,.6); backdrop-filter: blur(8px); animation: fade .25s ease both;
}
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 24px; animation: rise .35s ease both; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
@keyframes fade { from { opacity: 0; } }

/* ---------- Code panel (after purchase) ---------- */
.code-section { padding-top: 0; }
.code-card {
    max-width: 640px; margin: 0 auto; padding: clamp(22px, 5vw, 36px); text-align: center;
    border-color: rgba(23,229,155,.5); box-shadow: 0 30px 80px -30px var(--em-glow);
    animation: rise .5s ease both;
}
.code-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.code-card .code-top { justify-content: center; }
.timer {
    font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.1rem; padding: .3em .8em; border-radius: 12px;
    background: rgba(0,0,0,.4); border: 1px solid var(--line-strong);
}
.timer.urgent { color: var(--danger); border-color: rgba(255,95,112,.6); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .5; } }
.code-display {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-weight: 800;
    font-size: clamp(2rem, 9vw, 3.4rem); letter-spacing: .12em; color: var(--em);
    padding: 18px 12px; margin: 10px 0 20px; border-radius: 18px; word-break: break-all;
    background: #02100a; border: 1px dashed rgba(23,229,155,.5);
    text-shadow: 0 0 24px var(--em-glow);
}
.code-display.expired { color: var(--muted); text-decoration: line-through; text-shadow: none; border-color: var(--line); }
.code-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.code-card .small { margin: 0; }

.code-form { margin-top: 6px; }
.code-form input {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 1.3rem; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase; text-align: center; padding: .7em 1em;
}
.code-form .field { margin-bottom: 4px; }
.code-form .vault-actions { justify-content: flex-start; }
.balance-use {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line);
}
.balance-use p { margin: 0; }

/* ---------- Multi-page layout ---------- */
html, body { max-width: 100%; overflow-x: hidden; }
/* Decorative orbs are bigger than the screen. Clip them so they never widen the page. */
.bg-orbs, .bg-grid { contain: paint; width: 100vw; max-width: 100vw; }
.bg-orbs { left: 0; right: auto; }
.topbar { gap: 12px; flex-wrap: nowrap; }
.site-nav { display: flex; gap: 6px; flex: 1; justify-content: center; min-width: 0; }
.site-nav-link {
    display: inline-flex; align-items: center; gap: .45em; padding: .5em .9em; border-radius: 999px;
    color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap;
    border: 1px solid transparent; transition: all .2s;
}
.site-nav-link:hover { color: var(--text); background: var(--panel-2); }
.site-nav-link.active { color: #03130c; background: var(--em); box-shadow: 0 8px 22px -8px var(--em-glow); }
.balance { flex: none; }

.page { min-height: calc(100vh - 150px); padding-bottom: 20px; }
.page-head { max-width: 760px; margin: 0 auto; padding: clamp(40px, 8vw, 80px) 20px 24px; text-align: center; animation: rise .6s ease both; }
.page-head h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); font-weight: 900; }
.page-head .eyebrow { margin-bottom: 1em; }
.center { text-align: center; }
.big { width: 52px; height: 52px; color: var(--em); }

/* Home steps */
.steps { max-width: 1040px; margin: 0 auto; padding: 24px 20px; display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
.step { padding: 26px; position: relative; display: grid; gap: 8px; animation: rise .6s ease both; }
.step > .icon { width: 30px; height: 30px; color: var(--em); }
.step h3 { margin: 6px 0 0; }
.step p { margin: 0; }
.step-num {
    position: absolute; top: 18px; right: 20px; font-weight: 900; font-size: 1.6rem; color: rgba(23,229,155,.25);
}
.fine-wrap { padding: 8px 20px 40px; }

/* Buy page: package cards */
.packages-grid {
    max-width: 1120px; margin: 0 auto; padding: 0 20px;
    display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.pack { position: relative; padding: 28px; display: flex; flex-direction: column; gap: 14px; animation: rise .6s ease both; animation-delay: var(--d, 0ms); transition: transform .3s, border-color .3s, box-shadow .3s; }
.pack:hover { transform: translateY(-5px); border-color: rgba(23,229,155,.45); }
.pack.featured { border-color: rgba(23,229,155,.6); box-shadow: 0 30px 80px -30px var(--em-glow); background: radial-gradient(120% 80% at 50% 0%, rgba(23,229,155,.2), transparent 60%), linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); }
.pack .tag { position: absolute; top: 18px; right: 18px; }
.pack-name { display: flex; align-items: center; gap: 10px; color: var(--em); }
.pack-name h3 { color: var(--text); margin: 0; }
.pack-amount { display: flex; align-items: baseline; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pack-amount strong { font-size: clamp(2.6rem, 6vw, 3.4rem); font-weight: 900; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.pack-amount span { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.pack-desc { margin: 0; min-height: 3em; }
.pack-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--muted); font-size: .92rem; }
.pack-facts li { display: flex; align-items: center; gap: 8px; }
.pack-facts .icon { color: var(--em); width: 1.1em; height: 1.1em; }
.pack-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 6px; }
.pack-foot .btn { flex: 1 1 auto; }

/* Code page: ticket */
.code-page { max-width: 560px; margin: 0 auto; padding: 0 20px 40px; }
.ticket { padding: clamp(24px, 5vw, 36px); text-align: center; border-color: rgba(23,229,155,.5); box-shadow: 0 30px 80px -30px var(--em-glow); animation: rise .5s ease both; }
.ticket-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ticket-top .timer { font-size: 1.3rem; }
.ticket-meta { color: var(--muted); margin: 6px 0 4px; }
.ticket-meta span { color: var(--text); font-weight: 700; }
.ticket-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin: 18px 0 22px; }
.ticket-bar span { display: block; height: 100%; width: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--em-2), var(--em)); transition: width 1s linear; }
.code-page .code-display { margin: 8px 0 0; }
.empty-card { padding: 36px 24px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.empty-card h2 { margin: 0; }
.code-page .code-actions .btn { flex: 1 1 180px; }
.timer.urgent { color: var(--danger); }

/* Reveal page */
.reveal-page { max-width: 560px; margin: 0 auto; padding: 0 20px 40px; }
.reveal-page .vault { display: block; padding: clamp(24px, 5vw, 36px); text-align: center; }
.reveal-page .vault::before { display: none; }
.reveal-page .pin-slots { justify-content: center; }
.reveal-page .code-form { display: grid; gap: 14px; text-align: left; }
.reveal-actions { margin-top: 16px; display: flex; justify-content: center; }
.reveal-page .vault.revealed { border-color: rgba(23,229,155,.5); }

/* Responsive ---------- */
@media (max-width: 900px) {
    .steps { grid-template-columns: 1fr; }
    .site-nav-link span { display: none; }
    .site-nav-link { padding: .55em .7em; }
}
@media (max-width: 680px) {
    .topbar { padding: 10px 14px; }
    .site-nav { gap: 4px; }
    .brand span { display: none; }
    .balance small { display: none; }
    .balance { padding: .4em .8em; }
    .page-head { padding: 36px 16px 18px; }
    .packages-grid, .code-page, .reveal-page, .steps { padding-left: 16px; padding-right: 16px; }
    .packages-grid { grid-template-columns: 1fr; }
    .pack { padding: 22px; }
    .pack-foot .btn { width: 100%; }
    .ticket-top .timer { font-size: 1.1rem; }
    .code-page .code-actions { flex-direction: column; }
    .code-page .code-actions .btn { width: 100%; }
}

/* ---------- Payment method picker (buy page) ---------- */
.method-section { max-width: 1120px; margin: 0 auto; padding: 0 20px; display: grid; gap: 14px; }
.method-label { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; color: var(--muted); }
.method-label .icon { color: var(--em); }
.method-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.method-chips .chip { padding: .7em 1.2em; font-size: .95rem; }
.method-details { padding: 18px 20px; }
.method-details pre, .method-card pre {
    margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; font-family: inherit;
    font-size: .98rem; color: #e6fff2; line-height: 1.6;
}
.method-grid { margin-bottom: 26px; }
.method-card { padding: 22px; display: grid; gap: 10px; }
.method-card h3 { color: var(--text); margin: 0; }
.method-actions { display: flex; gap: 6px; }
.section-gap { margin-top: 30px; }

/* ---------- Payment panel and reference (never styled like a code) ---------- */
.payment-panel { max-width: 720px; margin: 0 auto; padding: 0 20px 24px; }
.payment-card { padding: clamp(20px, 4vw, 30px); display: grid; gap: 14px; animation: rise .5s ease both; }
.payment-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ref-line { margin: 4px 0; color: var(--muted); font-size: .95rem; }
.ref-line strong { color: var(--text); font-family: inherit; font-size: 1.05rem; letter-spacing: .04em; margin-left: 4px; }
.picker-note { margin: 4px 0 0; }
.notice-box {
    margin: 0; padding: 12px 14px; border-radius: 14px; font-size: .92rem; line-height: 1.5;
    background: rgba(255,209,102,.08); border: 1px solid rgba(255,209,102,.4); color: #ffe7a6;
}
.notice-box strong { color: #fff3c4; }
.access-label { margin: 14px 0 0; color: var(--em); font-weight: 700; font-size: .85rem; letter-spacing: .03em; }
.waiting-steps { display: grid; gap: 10px; margin-top: 14px; padding: 16px 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.waiting-steps p { margin: 0; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.step-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.2); flex: none; }
.step-dot.done { background: var(--em); box-shadow: 0 0 12px var(--em-glow); }
.payment-card .wallet-box { margin-top: 4px; }
@media (max-width: 680px) { .payment-panel { padding: 0 16px 20px; } }

/* ---------- Crypto wallets ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.wallet-box {
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center;
    padding: 20px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line);
}
.wallet-qr {
    width: 168px; height: 168px; object-fit: contain; border-radius: 14px; background: #fff; padding: 8px;
    box-shadow: 0 0 40px -12px var(--em-glow);
}
.wallet-info { min-width: 0; }
.wallet-info p { margin: 0 0 8px; }
.addr-row { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.addr {
    flex: 1; min-width: 0; word-break: break-all; padding: 10px 12px; border-radius: 12px;
    background: rgba(0,0,0,.45); border: 1px solid var(--line); font-size: .85rem; color: #d7fbe9;
}
.qr-thumb {
    width: 130px; height: 130px; object-fit: contain; background: #fff; border-radius: 14px; padding: 6px;
    display: block; margin: 4px 0 10px;
}
.method-card .addr { display: block; }
.method-picker-note { color: var(--muted); }
@media (max-width: 680px) {
    .wallet-box { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .wallet-info { width: 100%; }
    .addr-row { flex-direction: column; align-items: stretch; }
    .addr-row .icon-btn { align-self: center; }
    .chip-row { justify-content: center; }
}

/* ---------- Manual payments ---------- */
.pill.pending { background: rgba(255, 209, 102, .16); color: var(--warn); }
.pay-instructions {
    white-space: pre-line; text-align: left; margin: 18px 0 8px; padding: 14px 16px; border-radius: 14px;
    background: var(--panel); border: 1px solid var(--line); color: #d6eee2; font-size: .95rem;
}
.small-btn { padding: .45em .9em; font-size: .85rem; }
td.actions .small-btn + .small-btn { margin-left: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .sidebar { position: sticky; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 12px; overflow-x: auto; }
    .sidebar .brand span { display: none; }
    .nav { display: flex; gap: 6px; }
    .nav-item { width: auto; white-space: nowrap; padding: 10px 12px; }
    .nav-item span { display: none; }
    .sidebar .logout { margin-top: 0; }
    .sidebar .logout span { display: none; }
    .split { grid-template-columns: 1fr; }
    .mini-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
    .topbar { padding: 12px 16px; }
    .brand { font-size: 1.05rem; }
    .hero { padding: 48px 16px 32px; }
    .section { padding: 36px 16px; }
    .packages { grid-template-columns: 1fr; }
    .pkg { padding: 22px; }
    .pkg-amount strong { font-size: 2.6rem; }
    .vault { grid-template-columns: 1fr; text-align: center; padding: 24px 20px; gap: 18px; }
    .vault-icon { margin: 0 auto; }
    .vault-body .muted { margin-left: auto; margin-right: auto; }
    .pin-slots, .vault-actions, .code-actions { justify-content: center; }
    .code-form .vault-actions { justify-content: center; }
    .code-form .vault-actions .btn { width: 100%; }
    .vault-actions .btn { flex: 1 1 100%; }
    .balance-use { justify-content: center; text-align: center; }
    .balance-use .btn { width: 100%; }
    .code-actions .btn { flex: 1 1 100%; }
    .balance small { display: none; }
    .cta .btn { flex: 1 1 100%; }
    .footer { justify-content: center; text-align: center; }
    .bars { height: 170px; }
    .panel-head { flex-direction: column; align-items: stretch; }
    .panel-head .btn { width: 100%; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .search { width: 100%; }
    .link-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { padding: 20px; }
    .form-actions .btn { width: 100%; }
    .modal-foot .btn { flex: 1; }
    .toasts { left: 16px; right: 16px; bottom: 16px; max-width: none; }
    .toast { font-size: .95rem; }
    .login-card { padding: 26px 22px; }
    .feed-row { flex-wrap: wrap; }
    .feed-row .muted { margin-left: 0; }
    .main { padding: 16px; }
    .card { border-radius: 18px; }
}
@media (max-width: 380px) {
    h1 { font-size: 2rem; }
    .stat-grid { grid-template-columns: 1fr; }
    .mini-stats { grid-template-columns: repeat(2, 1fr); }
    .slot { min-width: 48px; height: 64px; }
}
/* ==========================================================
   Admin: responsive layout, phone navigation, quick actions
   (these rules come last so they override the older admin rules)
   ========================================================== */
.admin-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.admin-col { min-width: 0; display: flex; flex-direction: column; }
.admin-shell .main { padding: clamp(20px, 2.6vw, 36px); min-width: 0; }
.admin-shell .view { max-width: none; width: 100%; }
.sidebar {
    position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 20px;
    padding: 22px 14px; background: rgba(4, 10, 7, .85); backdrop-filter: blur(18px); border-right: 1px solid var(--line);
}
.sidebar .nav { display: grid; gap: 6px; }
.sidebar .nav-item span { display: inline; }
.sidebar .logout { margin-top: auto; }
.app-bar, .bottom-nav, .more-sheet { display: none; }

/* Quick action tiles on Home */
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
@media (min-width: 1400px) { .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cardy td:has(> div) { flex-direction: column; align-items: flex-end; gap: 2px; }
.feed-row { flex-wrap: wrap; }
.feed-row > span:nth-child(2) { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.feed-row > .muted { margin-left: auto; font-size: .8rem; white-space: nowrap; }
.feed-row .pill { flex: none; }
.quick {
    display: flex; align-items: center; gap: 14px; padding: 18px; min-width: 0; text-align: left; cursor: pointer;
    background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
    border: 1px solid var(--line); border-radius: 20px; color: var(--text); font: inherit;
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
.quick:hover { transform: translateY(-3px); border-color: rgba(23,229,155,.5); box-shadow: 0 18px 40px -20px var(--em-glow); }
.quick:active { transform: scale(.98); }
.quick-ic {
    flex: none; width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center;
    background: linear-gradient(145deg, rgba(23,229,155,.28), rgba(4,87,60,.35)); color: var(--em);
    border: 1px solid rgba(23,229,155,.45);
}
.quick-ic .icon { width: 22px; height: 22px; }
.quick-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.quick-text strong { font-size: 1rem; }
.quick-text small { color: var(--muted); font-size: .85rem; line-height: 1.35; }
.quick-text strong { line-height: 1.25; }
.quick-go { color: var(--muted); flex: none; }
.quick.hot { border-color: rgba(255,209,102,.55); }
.quick.hot .quick-ic { color: var(--warn); background: rgba(255,209,102,.14); border-color: rgba(255,209,102,.5); }
.quick.hot .quick-text small { color: #ffe7a6; }

.split { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.section-head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 26px 0 12px; }
.section-head-row h3 { margin: 0; }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.chip-count { display: inline-block; min-width: 1.6em; margin-left: .35em; padding: 0 .4em; border-radius: 99px; background: rgba(255,255,255,.12); font-size: .78rem; text-align: center; }
.chip.on .chip-count { background: rgba(0,0,0,.2); }
.btn-sm { padding: .5em .9em; font-size: .85rem; }

.pin-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 22px; margin-bottom: 20px; }
.pin-current { font-family: ui-monospace, Consolas, monospace; font-size: 2rem; font-weight: 800; letter-spacing: .15em; color: var(--em); margin-top: 4px; }

.badge {
    position: absolute; top: 6px; right: calc(50% - 22px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
    background: var(--warn); color: #1d1500; font-size: .72rem; font-weight: 800; display: inline-grid; place-items: center;
}

.badge[hidden] { display: none !important; }

/* Desktop and tablet (960px and up) */
@media (min-width: 960px) {
    .admin-shell { grid-template-columns: 248px minmax(0, 1fr); }
    .sidebar { display: flex; }
}

/* Below desktop: sidebar becomes a top bar and a bottom bar */
@media (max-width: 959px) {
    .admin-shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { display: none; }
    .app-bar {
        position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
        padding: 12px 16px; background: rgba(3,7,5,.85); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
    }
    .app-title { flex: 1; margin: 0; font-size: 1.15rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .admin-shell .main { padding: 18px 16px 112px; }
    .bottom-nav {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr);
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(4,10,7,.94);
        backdrop-filter: blur(18px); border-top: 1px solid var(--line);
    }
    .bn-item {
        position: relative; display: grid; justify-items: center; gap: 3px; padding: 8px 4px; border: 0; background: transparent;
        color: var(--muted); font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; border-radius: 14px; min-height: 56px;
    }
    .bn-item .icon { width: 22px; height: 22px; }
    .bn-item.active { color: #03130c; background: var(--em); }
    .bn-item .badge { top: 2px; right: calc(50% - 26px); }
    .more-sheet {
        position: fixed; left: 12px; right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 50;
        display: block; padding: 10px; border-radius: 22px; background: #06100b; border: 1px solid var(--line-strong);
        box-shadow: 0 30px 80px -20px #000; animation: rise .25s ease both; max-height: 70vh; overflow-y: auto;
    }
    .more-sheet.hidden { display: none !important; }
    .more-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .more-item {
        display: flex; align-items: center; gap: 10px; padding: 14px; min-height: 52px; border-radius: 16px; border: 1px solid var(--line);
        background: var(--panel); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; text-align: left;
    }
    .more-item .icon { color: var(--em); }
    .more-item:active { background: var(--panel-2); }
    .more-item.danger { width: 100%; margin-top: 8px; color: #ffb3bb; justify-content: center; }
    .more-item.danger .icon { color: #ffb3bb; }
    .more-sheet::after { content: ""; }
    .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .split { grid-template-columns: minmax(0, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tables become stacked cards on small screens */
@media (max-width: 760px) {
    .table-wrap { border: 0; background: transparent; overflow: visible; }
    .cardy { min-width: 0; }
    .cardy thead { display: none; }
    .cardy, .cardy tbody, .cardy tr, .cardy td { display: block; width: 100%; }
    .cardy tr {
        margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px;
        background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
    }
    .cardy tbody tr:hover { background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)); }
    .cardy td {
        display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 7px 0;
        border-bottom: 1px dashed rgba(255,255,255,.06); text-align: right; word-break: break-word;
    }
    .cardy td:last-child { border-bottom: 0; }
    .cardy td::before {
        content: attr(data-label); flex: none; color: var(--muted); font-size: .72rem; font-weight: 700;
        text-transform: uppercase; letter-spacing: .07em; text-align: left;
    }
    .cardy td:not([data-label]) { justify-content: flex-end; }
    .cardy td.actions { justify-content: flex-end; }
    .cardy td.actions::before { content: none; }
    .cardy td.empty { display: block; text-align: center; color: var(--muted); padding: 22px 0; border: 0; }
    .cardy td.empty::before { content: none; }
    .cardy td.small { font-size: .85rem; }
    .cardy td.actions .btn, .cardy td.actions .icon-btn { flex: 1; }
    .cardy td.actions { flex-wrap: wrap; }
    .cardy td.actions .icon-btn { flex: 0 0 44px; }
    .cardy .small-btn { min-height: 40px; }
    .cardy td:not(.actions) > code { max-width: 60%; overflow-wrap: anywhere; }
}

/* Phones */
@media (max-width: 480px) {
    .quick { flex-direction: column; align-items: flex-start; padding: 14px; gap: 12px; }
    .quick-ic { width: 42px; height: 42px; border-radius: 14px; }
    .quick-text strong { font-size: .95rem; }
    .quick-text small { font-size: .8rem; }
    .quick-go { display: none; }
    .stat-grid { gap: 10px; }
    .stat { padding: 14px; }
    .stat strong { font-size: 1.5rem; }
    .panel-head .btn { width: 100%; }
    .pin-current { font-size: 1.6rem; }
    .pin-card .btn { width: 100%; }
    .form-grid { padding: 18px; }
    .modal { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================
   White theme. Every page uses a white background.
   These rules come last so they replace the older dark values.
   ========================================================== */
html { background: #ffffff; }
body { background: #ffffff; color: var(--text); }
.bg-orbs, .bg-grid { display: none; }
::selection { background: #0a8a5c; color: #ffffff; }
.grad {
    background: linear-gradient(110deg, #064d35 0%, #0a8a5c 50%, #0fa874 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
code { color: #0b5a3c; background: #eef7f2; padding: .1em .35em; border-radius: 6px; }

/* Header and navigation */
.topbar { background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); }
.balance { background: #e9f8f1; border-color: #a9e3c8; box-shadow: none; }
.site-nav-link.active { color: #ffffff; background: #0a8a5c; box-shadow: 0 8px 20px -10px rgba(10, 138, 92, .5); }
.site-nav-link:hover { background: #eef5f1; }

/* Cards and surfaces */
.card {
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: 0 12px 32px -20px rgba(11, 31, 22, .22);
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
.eyebrow { background: #eef5f1; color: var(--muted); }
.pkg:hover, .pack:hover { border-color: #8fd6b5; }
.pkg.featured, .pack.featured {
    border-color: #0a8a5c;
    background: radial-gradient(120% 80% at 50% 0%, rgba(10, 138, 92, .10), transparent 60%), #ffffff;
    box-shadow: 0 24px 60px -30px rgba(10, 138, 92, .45);
}
.pack.featured { background: radial-gradient(120% 80% at 50% 0%, rgba(10, 138, 92, .10), transparent 60%), #ffffff; }
.tag { color: #ffffff; background: #0a8a5c; }
.vault::before { background: radial-gradient(circle, rgba(10, 138, 92, .10), transparent 65%); }
.vault-icon, .login-icon, .quick-ic {
    background: #e9f8f1; border-color: #a9e3c8; color: #0a8a5c; box-shadow: none;
}
.quick { background: #ffffff; border-color: var(--line); }
.quick:hover { border-color: #8fd6b5; box-shadow: 0 18px 40px -22px rgba(10, 138, 92, .35); }
.quick.hot { border-color: #e8c46a; }
.quick.hot .quick-ic { background: #fff4d6; border-color: #e8c46a; color: var(--warn); }
.quick.hot .quick-text small { color: #7a5200; }
.code-card, .ticket { border-color: #8fd6b5; box-shadow: 0 24px 60px -32px rgba(10, 138, 92, .45); }
.reveal-page .vault.revealed { border-color: #8fd6b5; }
.empty-card { background: #ffffff; }

/* Reveal and code displays */
.slot { background: #f2fbf7; border-color: #8fd6b5; text-shadow: none; box-shadow: 0 10px 24px -18px rgba(10, 138, 92, .5); }
.slot.ghost { background: #f6faf8; color: var(--muted); }
.code-display { background: #f2fbf7; border-color: #8fd6b5; text-shadow: none; color: #0a8a5c; }
.code-display.expired { background: #f6faf8; }
.timer { background: #f6faf8; }
.timer.urgent { background: #fff0f2; }
.ticket-bar { background: #e3ece7; }
.ticket-bar span { background: linear-gradient(90deg, #067a4f, #0a8a5c); }
.step-dot { background: #cfdcd5; }
.step-dot.done { background: #0a8a5c; box-shadow: none; }
.step-num { color: rgba(10, 138, 92, .18); }

/* Notices and alerts */
.notice-box, .alert { background: #fff8e1; border-color: #efd27a; color: #6b4a00; }
.notice-box strong { color: #4a3300; }
.alert .icon { color: var(--warn); }
.pill.pending { background: #fff4d6; color: #7a5200; }
.pill.off { background: #eef3f0; color: var(--muted); }
.pill.type-visit { background: #e3f2ff; color: #1d5f8f; }
.pill.type-click { background: #eef3f0; color: #1d3a2e; }
.pill.type-buy { background: #dff5ea; color: #0a8a5c; }
.pill.type-reveal { background: #fff4d6; color: #7a5200; }
.pill.type-grant { background: #ffe6e9; color: #a3263a; }

/* Forms */
.field > span { color: #1d3a2e; }
input[type="text"], input[type="password"], input[type="number"], input[type="search"], input:not([type]), textarea, select {
    background: #ffffff; border-color: var(--line-strong); color: var(--text);
}
input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 4px rgba(10, 138, 92, .14); }
.search::placeholder { color: #8aa397; }
.check input { accent-color: #0a8a5c; }
.addr { background: #f6faf8; color: #0b3d2a; border-color: var(--line); }
.url { background: #f6faf8; }
.pay-instructions { background: #f6faf8; color: #1d3a2e; }
.method-details pre, .method-card pre { color: #0b3d2a; }
.wallet-box, .waiting-steps, .balance-use, .feed-row, .mini-stats div { background: #f6faf8; }
.wallet-qr, .qr-thumb { background: #ffffff; box-shadow: 0 0 0 1px var(--line); }

/* Buttons */
.btn-ghost { background: #ffffff; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover:not(:disabled) { border-color: #0a8a5c; color: #0a8a5c; }
.icon-btn { background: #ffffff; }
.chip { background: #ffffff; color: var(--muted); }
.chip.on { color: #ffffff; background: #0a8a5c; border-color: #0a8a5c; }
.chip-count { background: rgba(0, 0, 0, .07); }
.chip.on .chip-count { background: rgba(255, 255, 255, .25); }
.nav-item.active { color: #ffffff; background: #0a8a5c; box-shadow: 0 10px 22px -12px rgba(10, 138, 92, .6); }
.nav-item.active .icon { color: #ffffff; }
.bn-item.active { color: #ffffff; background: #0a8a5c; }

/* Admin shell */
.sidebar { background: #ffffff; border-right: 1px solid var(--line); }
.app-bar { background: rgba(255, 255, 255, .95); border-bottom: 1px solid var(--line); }
.bottom-nav { background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); }
.more-sheet { background: #ffffff; border-color: var(--line-strong); box-shadow: 0 24px 60px -20px rgba(11, 31, 22, .3); }
.more-item { background: #f6faf8; color: var(--text); }
.more-item.danger { color: #b4232f; background: #fff3f4; }
.more-item.danger .icon { color: #b4232f; }
.sidebar .brand em { color: #0a8a5c; }
.modal-backdrop { background: rgba(15, 35, 25, .35); }
.skeleton { background: linear-gradient(90deg, #eef4f1, #e2ebe6, #eef4f1); background-size: 200% 100%; }
.toast { background: #ffffff; box-shadow: 0 16px 40px -18px rgba(11, 31, 22, .35); }
.toast .icon { color: #0a8a5c; }
.toast.error .icon { color: var(--danger); }

/* Tables */
.table-wrap { background: #ffffff; }
th { background: #f6faf8; }
tbody tr:hover { background: #f1faf5; }
td, th { border-bottom-color: var(--line); }
.cardy tr { background: #ffffff; }
.cardy tbody tr:hover { background: #ffffff; }
.cardy td { border-bottom-color: #e6eee9; }

/* Mobile: stacked cards and phone bars */
@media (max-width: 680px) {
    .card { box-shadow: 0 10px 26px -18px rgba(11, 31, 22, .2); }
}

/* Primary buttons: white text on a deeper green */
.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, #0fa874, #0a8a5c 45%, #067a4f);
    box-shadow: 0 10px 26px -10px rgba(10, 138, 92, .55), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 16px 34px -10px rgba(10, 138, 92, .6); }
.btn-primary .icon { color: #ffffff; }
.tag { color: #ffffff; }

/* ==========================================================
   Interaction states for the white theme.
   Hover, focus and pressed states use green tints, never white glows.
   ========================================================== */
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus { outline: none; }
:focus-visible { outline: 3px solid rgba(10, 138, 92, .45); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }

/* Primary buttons: remove the white highlight, darken on hover/focus/press */
.btn-primary,
.btn-primary:focus,
.btn-primary:active {
    color: #ffffff;
    background: linear-gradient(135deg, #0a8a5c, #067a4f 50%, #055d3c);
    box-shadow: 0 10px 24px -12px rgba(10, 138, 92, .6);
}
.btn-primary:hover:not(:disabled),
.btn-primary:focus-visible:not(:disabled) {
    color: #ffffff;
    background: linear-gradient(135deg, #067a4f, #055d3c 50%, #044730);
    box-shadow: 0 14px 30px -12px rgba(10, 138, 92, .7);
}
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(.98); }

/* Outline buttons: pale green on hover and focus */
.btn-ghost,
.btn-ghost:focus,
.btn-ghost:active {
    background: #ffffff; color: var(--text); border-color: var(--line-strong);
}
.btn-ghost:hover:not(:disabled),
.btn-ghost:focus-visible:not(:disabled) {
    background: #eef7f2; color: #066b47; border-color: #0a8a5c;
}

/* Icon buttons, chips and menu items */
.icon-btn:hover, .icon-btn:focus-visible { background: #eef7f2; border-color: #0a8a5c; color: #066b47; }
.chip:hover, .chip:focus-visible { background: #eef7f2; color: #066b47; border-color: #8fd6b5; }
.chip.on:hover, .chip.on:focus-visible { background: #067a4f; border-color: #067a4f; color: #ffffff; }
.nav-item:hover, .nav-item:focus-visible { background: #eef7f2; color: #066b47; }
.nav-item.active:hover, .nav-item.active:focus-visible { background: #067a4f; color: #ffffff; }
.site-nav-link:hover, .site-nav-link:focus-visible { background: #eef7f2; color: #066b47; }
.site-nav-link.active:hover, .site-nav-link.active:focus-visible { background: #067a4f; color: #ffffff; }
.bn-item:hover, .bn-item:focus-visible { background: #eef7f2; color: #066b47; }
.bn-item.active:hover, .bn-item.active:focus-visible { background: #067a4f; color: #ffffff; }
.more-item:hover, .more-item:focus-visible { background: #eef7f2; border-color: #8fd6b5; color: #066b47; }
.more-item.danger:hover, .more-item.danger:focus-visible { background: #ffe6e9; border-color: #f0b3bc; color: #a3263a; }
.back-link:hover, .back-link:focus-visible { color: #066b47; }
.quick:focus-visible { border-color: #0a8a5c; }

/* ==========================================================
   Responsive fixes: content wraps on phones instead of overflowing.
   ========================================================== */
img, svg, video { max-width: 100%; }
.main, .view, .admin-col, .admin-shell > * { min-width: 0; max-width: 100%; }
.card { max-width: 100%; }
.panel-head > div { min-width: 0; }
.panel-head h2 { overflow-wrap: anywhere; }
.panel-head .btn { flex: none; }

/* Link cards */
.link-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.link-card { min-width: 0; }
.link-head { min-width: 0; }
.link-head > div { min-width: 0; flex: 1 1 auto; flex-wrap: wrap; }
.link-head h3 { overflow-wrap: anywhere; min-width: 0; }
.link-head .icon-btn { flex: none; }
.url { flex-wrap: wrap; align-items: center; min-width: 0; }
.url code {
    flex: 1 1 180px; min-width: 0; white-space: normal;
    overflow-wrap: anywhere; word-break: break-all;
}
.url .icon-btn { flex: none; margin-left: auto; }
.mini-stats { grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); }
.mini-stats div { min-width: 0; }
.mini-stats span { overflow-wrap: anywhere; }

/* Chips and filter rows wrap instead of running off the screen */
.chips { min-width: 0; max-width: 100%; }
.section-head-row { min-width: 0; }
.toolbar > * { min-width: 0; }

/* Phones: stack the header actions and give form cards full width */
@media (max-width: 680px) {
    .panel-head { flex-direction: column; align-items: stretch; gap: 12px; }
    .panel-head .btn { width: 100%; justify-content: center; }
    .link-head { flex-direction: row; }
    .link-head h3 { font-size: 1.05rem; }
    .url code { font-size: .8rem; }
    .url .icon-btn { margin-left: 0; }
    .form-grid, .stack { max-width: 100%; }
    .chips { flex-wrap: wrap; }
    .section-head-row { flex-direction: column; align-items: stretch; }
    .section-head-row .chips { width: 100%; }
}

/* Reveal page: help for people who do not have a code yet */
.no-code-help {
    margin-top: 22px; padding: 16px; border-radius: 16px; background: #f6faf8; border: 1px solid var(--line);
    text-align: center; display: grid; gap: 12px;
}
.no-code-help p { margin: 0; }
.no-code-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.no-code-actions .btn { flex: 1 1 140px; }
