/* =========================================================================
   BlackCream Manage — admin console styling
   ========================================================================= */

/* ---- Auth screen ------------------------------------------------- */
.is-auth { background: var(--cream-deep); }
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 34px 30px;
    width: 100%;
    max-width: 380px;
    text-align: center;
}
.auth-logo-link { display: block; text-align: center; margin-bottom: 16px; }
.auth-logo { height: 42px; width: auto; margin: 0 auto; display: block; }
.auth-card h1 { font-size: 1.3rem; }
.auth-card form { text-align: left; margin-top: 12px; }
.auth-foot { color: var(--muted); font-size: .8rem; margin-top: 18px; }

/* ---- Shell / layout ---------------------------------------- */
.is-manage { background: var(--cream-deep); }
.m-shell { display: flex; min-height: 100vh; }

.m-side {
    width: 224px;
    flex-shrink: 0;
    background: var(--ink);
    color: #efe7d8;
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;              /* the nav scrolls, not the whole rail */
}
.m-brand img { height: 42px; }

/* Only the link list scrolls — brand, company switcher and sign-out stay put.
   min-height:0 lets this flex child shrink below its content height. */
.m-nav {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .22) transparent;
}
.m-nav::-webkit-scrollbar { width: 8px; }
.m-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 8px; }
.m-nav::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .3); }
.m-nav a {
    color: #d8cdb9;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .92rem;
    text-decoration: none;
}
.m-nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.m-nav a.is-active { background: var(--pink-deep); color: #fff; }

.m-side-foot { border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; font-size: .85rem; }
.m-who { display: block; color: #cabda3; margin-bottom: 8px; }
.m-logout {
    background: transparent; border: 1px solid rgba(255,255,255,.25);
    color: #efe7d8; padding: 7px 12px; border-radius: 999px; cursor: pointer;
    font-family: var(--font); font-size: .82rem; width: 100%;
}
.m-logout:hover { background: rgba(255,255,255,.1); }

.m-main { flex: 1; min-width: 0; padding: 28px 32px 60px; }
.m-main h1 { font-size: 1.6rem; }

/* Mobile nav chrome — hidden on desktop, the sidebar shows inline. */
.m-topbar, .m-scrim { display: none; }

/* ---- Page header row ----------------------------------- */
.m-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; margin-bottom: 20px; flex-wrap: wrap;
}

/* ---- Stат cards --------------------------------------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}
.stat .k { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 1.9rem; font-weight: 800; margin-top: 4px; }
.stat .v.accent { color: var(--pink-deep); }

/* ---- Tables ------------------------------------------ */
.table-wrap { overflow-x: auto; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover, table.data tbody tr:hover { background: var(--cream); }
table.data td.wrap { white-space: normal; }

.badge {
    font-size: .72rem; font-weight: 700; letter-spacing: .04em;
    padding: 3px 9px; border-radius: 999px; text-transform: uppercase;
}
.badge--issued { background: #E9F6EA; color: #2F6D34; }
.badge--redeemed { background: var(--cream-deep); color: var(--brown); }
.badge--expired { background: #FBE6E5; color: #A5322C; }
.badge--void { background: #FBE6E5; color: #A5322C; }
.badge--on { background: #E9F6EA; color: #2F6D34; }
.badge--off { background: #eee; color: #888; }

/* ---- Filters / toolbar ------------------------------ */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.toolbar .input, .toolbar .select { width: auto; }
.chip {
    padding: 7px 14px; border-radius: 999px; background: var(--white);
    border: 1px solid var(--line); font-size: .85rem; font-weight: 600; color: var(--ink-soft);
    text-decoration: none;
}
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---- Forms in manage ------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.form-grid .field.col-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; margin-top: 12px; }
.img-preview {
    width: 120px; height: 90px; object-fit: cover; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--cream-deep);
}

/* ---- Scanner --------------------------------------- */
.scan-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
#scan-view {
    width: 100%; aspect-ratio: 1/1; background: #000; border-radius: var(--radius);
    overflow: hidden; position: relative;
}
#scan-view video, #scan-view img { width: 100% !important; height: 100% !important; object-fit: cover; }
.scan-result { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; min-height: 200px; }
.scan-result.is-ok { box-shadow: 0 0 0 3px var(--green); }
.scan-result.is-bad { box-shadow: 0 0 0 3px var(--danger); }
.scan-result h2 { margin-top: 0; }
.scan-big { font-size: 1.3rem; font-weight: 800; }
.scan-meta { font-size: .9rem; color: var(--ink-soft); }
.scan-meta div { margin: 3px 0; }
.scan-actions { margin-top: 16px; display: flex; gap: 10px; }

.manual-row { display: flex; gap: 8px; margin-top: 14px; }
.manual-row .input { flex: 1; }

@media (max-width: 900px) {
    :root { --m-drawer: min(85vw, 320px); --m-topbar-h: 54px; }

    body { overflow-x: hidden; }

    /* Fixed top bar with the hamburger — always above the drawer */
    .m-topbar {
        display: flex; align-items: center; gap: 10px;
        position: fixed; top: 0; left: 0; right: 0; z-index: 70;
        height: var(--m-topbar-h); padding: 0 8px;
        background: var(--ink); color: #fff;
    }
    .m-topbar__brand { color: #fff; font-weight: 800; letter-spacing: -.01em; text-decoration: none; }
    .m-burger {
        width: 42px; height: 42px; flex: none;
        display: flex; flex-direction: column; justify-content: center; gap: 5px;
        padding: 0 9px;
        background: transparent; border: 0; cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .m-burger span {
        display: block; height: 2px; width: 100%; border-radius: 2px;
        background: #fff; transition: transform .24s ease, opacity .2s ease;
    }
    body.m-nav-open .m-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    body.m-nav-open .m-burger span:nth-child(2) { opacity: 0; }
    body.m-nav-open .m-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* Page content sits below the fixed bar. It — not .m-shell — slides,
       so the drawer's own position:fixed stays anchored to the viewport
       (a transformed ancestor would re-anchor it). */
    .m-shell { display: block; padding-top: var(--m-topbar-h); }
    .m-main { transition: transform .28s ease; will-change: transform; }
    body.m-nav-open { overflow: hidden; }
    body.m-nav-open .m-main { transform: translateX(var(--m-drawer)); }

    /* Sidebar becomes an off-canvas drawer */
    .m-side {
        position: fixed; top: 0; left: 0; z-index: 60;
        width: var(--m-drawer); height: 100vh; height: 100dvh;
        padding-top: calc(var(--m-topbar-h) + 12px);
        transform: translateX(-100%);
        transition: transform .28s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    body.m-nav-open .m-side { transform: translateX(0); }
    /* natural height inside the scrolling drawer — don't let flex squash it */
    .m-nav { flex: 0 0 auto; flex-direction: column; overflow: visible; }
    .m-side-foot { flex: 0 0 auto; margin-top: 16px; }

    /* Tap-catcher behind the drawer */
    .m-scrim {
        display: block;
        position: fixed; inset: 0; z-index: 50;
        background: rgba(0,0,0,.45);
        opacity: 0; pointer-events: none;
        transition: opacity .28s ease;
    }
    body.m-nav-open .m-scrim { opacity: 1; pointer-events: auto; }

    .m-main { padding: 20px 16px 50px; }
    .form-grid, .scan-layout { grid-template-columns: 1fr; }
}

/* ---- CocoaCool multi-tenant additions --------------------------- */
.m-brand-word, .auth-logo-word {
    font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em;
}
.m-brand-word { color: #fff; }
.auth-logo-word { color: var(--ink); text-align: center; display: block; margin-bottom: 14px; font-size: 1.25rem; }

/* company switcher */
.m-company { margin-top: 16px; }
.m-company details { background: rgba(255,255,255,.06); border-radius: var(--radius-sm); }
.m-company summary {
    list-style: none; cursor: pointer; padding: 10px 12px;
    display: flex; flex-direction: column; gap: 2px;
}
.m-company summary::-webkit-details-marker { display: none; }
.m-company--single summary { cursor: default; }
.m-company__name { color: #fff; font-weight: 700; font-size: .92rem; }
.m-company__role { color: #b7a98c; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.m-company__list { padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.m-company__list form { margin: 0; }
.m-company__list button {
    width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer;
    color: #d8cdb9; font: inherit; font-size: .86rem; padding: 8px 10px; border-radius: 8px;
}
.m-company__list button:hover { background: rgba(255,255,255,.09); color: #fff; }
.m-company__list button.is-current { color: #fff; font-weight: 700; }
.m-company__switch { display: block; padding: 8px 10px; font-size: .8rem; color: #b7a98c; }

.m-nav__sep {
    margin: 14px 0 4px; padding: 0 14px; font-size: .68rem; letter-spacing: .12em;
    text-transform: uppercase; color: #7d7259;
}

/* company chooser page (auth layout) */
.switch-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.switch-item {
    width: 100%; text-align: left; background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 14px 16px; cursor: pointer; font: inherit;
}
.switch-item:hover { border-color: var(--pink-deep); }
.switch-item.is-current { border-color: var(--pink-deep); box-shadow: 0 0 0 2px rgba(244,169,192,.25); }
.switch-item__name { display: block; font-weight: 700; }
.switch-item__meta { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; }

/* theme preset grid */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.preset {
    display: block; border: 2px solid var(--line); border-radius: var(--radius-sm);
    padding: 12px; cursor: pointer; text-align: center;
}
.preset.is-active { border-color: var(--pink-deep); box-shadow: 0 0 0 2px rgba(244,169,192,.25); }
.preset input { position: absolute; opacity: 0; }
.preset__swatches { display: flex; height: 26px; border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.preset__swatches span { flex: 1; }
.preset__name { font-weight: 600; font-size: .85rem; }

/* page editor location rows */
.loc-row { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin-top: 10px; }
.loc-row__remove { margin-top: 8px; }

/* game / generic choice cards */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.choice {
    display: block; border: 2px solid var(--line); border-radius: var(--radius-sm);
    padding: 14px; cursor: pointer;
}
.choice.is-active, .choice:has(input:checked) { border-color: var(--pink-deep); box-shadow: 0 0 0 2px rgba(244,169,192,.25); }
.choice.is-locked { opacity: .78; }
.choice.is-locked.is-previewing { opacity: 1; border-color: var(--ink); border-style: dashed; box-shadow: 0 0 0 2px rgba(43,43,43,.14); }
.choice input { position: absolute; opacity: 0; }
.choice__title { display: block; font-weight: 700; }
.choice__desc { display: block; font-size: .82rem; color: var(--muted); margin-top: 4px; }

/* sticker-pack cards */
.sticker-thumbs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.sticker-thumbs img {
    width: 34px; height: 34px; object-fit: contain;
    background: var(--ink); border-radius: 6px; padding: 2px;
}
.sticker-price {
    display: flex; align-items: center; gap: 8px;
    margin-top: 8px; font-weight: 700; font-size: .9rem;
}
.btn--sm { padding: 5px 12px; font-size: .82rem; }
.btn--wa { background: #25D366; color: #04310f; box-shadow: none; }
.btn--wa:hover { background: #1fb857; }

/* "Request a custom pack" CTA on /manage/stickers */
.sticker-cta {
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px; flex-wrap: wrap;
}
.sticker-cta h3 { margin: 0 0 4px; font-size: 1.02rem; }
.sticker-cta p { margin: 0; max-width: 52ch; }
.sticker-cta .btn { flex: 0 0 auto; }

/* ---- Game picker + live preview (below the Save button) -------- */
.game-preview {
    background: var(--ink);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    max-width: 420px;
}
.game-preview canvas {
    width: 100%;
    max-width: 380px;
    aspect-ratio: 1 / 1;
    height: auto;
    border-radius: var(--radius-sm);
    display: block;
    margin: 0 auto;
    background: #12261f;
}
.game-preview__cap {
    display: block;
    margin-top: 8px;
    font-size: .8rem;
    font-weight: 600;
    color: #cabda3;
}

/* ---- /manage/game + /manage/stickers — full-height 2-col picker - */
body.is-picker .m-main {
    height: 100vh;
    max-width: none;
    display: flex;
    flex-direction: column;
    padding-bottom: 24px;
    overflow: hidden;
}
body.is-picker .m-head { flex-shrink: 0; }
body.is-picker .flash,
body.is-picker .flash__item--info { flex-shrink: 0; }

.game-layout {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
    gap: 22px;
    align-items: stretch;
}
.game-layout__list {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
}
.game-layout__scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    align-content: start;
    padding-right: 6px;
    scrollbar-width: thin;
}
.choice-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.game-layout__foot {
    flex-shrink: 0;
    border-top: 1px solid var(--line);
    margin-top: 14px;
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.game-layout__foot .form-actions { margin-top: 0; }
.game-layout__preview {
    align-self: center;
    justify-self: stretch;
    min-width: 0;
}
.game-layout__preview .game-preview { max-width: none; }
.game-layout__preview .game-preview canvas { max-width: min(420px, 52vh); }
.preview-game-pick {
    display: block;
    margin-top: 12px;
    text-align: center;
    font-size: .85rem;
    color: var(--muted);
}
.preview-game-pick .select { width: auto; margin-left: 8px; }

@media (max-width: 1200px) {
    .choice-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    body.is-picker .m-main { height: auto; overflow: visible; display: block; }
    .game-layout { display: block; }
    .game-layout__list { min-height: 0; }
    .game-layout__scroll { overflow: visible; }
    .choice-grid--2, .choice-grid--3 { grid-template-columns: 1fr; }
    .game-layout__preview { margin-top: 16px; }
}

/* /manage/stickers carries more chrome than /manage/game (an info note + the
   custom-pack CTA), so a pinned single-viewport layout clips its footer /
   preview. This one flows and scrolls with the page (same as the <=900px
   fallback, at every width); the preview sticks alongside the pack list
   instead of the list scrolling on its own. */
body.is-stickers .m-main { height: auto; overflow: visible; display: block; }
body.is-stickers .game-layout { align-items: start; }
body.is-stickers .game-layout__scroll { overflow: visible; }
body.is-stickers .game-layout__preview { align-self: start; position: sticky; top: 24px; }
@media (max-width: 900px) {
    body.is-stickers .game-layout__preview { position: static; }
}

/* ---- /manage/insights report ----------------------------------- */
.ins-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ins-cols .panel { margin: 0; }
@media (max-width: 900px) { .ins-cols { grid-template-columns: 1fr; } }

.ins-legend { display: flex; gap: 16px; font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.ins-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.ins-chart-wrap { width: 100%; overflow-x: auto; }
.ins-chart { width: 100%; height: 170px; display: block; }

.funnel-row { display: grid; grid-template-columns: 150px 1fr 90px; align-items: center; gap: 12px; margin: 8px 0; }
.funnel-row__label { font-size: .85rem; font-weight: 600; }
.funnel-row__bar { background: var(--cream-deep); border-radius: 999px; height: 22px; overflow: hidden; }
.funnel-row__bar > span { display: block; height: 100%; background: var(--pink-deep); border-radius: 999px; }
.funnel-row__num { font-weight: 700; text-align: right; font-size: .9rem; }
.funnel-row__num small { display: block; font-weight: 600; color: var(--muted); font-size: .72rem; }
@media (max-width: 640px) { .funnel-row { grid-template-columns: 110px 1fr 70px; } }

/* ---- Trial / subscription nudge bar --------------------------- */
.m-trialbar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 12px 16px; margin-bottom: 16px;
    border-radius: var(--radius-sm); font-size: .92rem; font-weight: 600;
}
.m-trialbar span { flex: 1; min-width: 200px; }
.m-trialbar .btn { padding: 8px 18px; font-size: .88rem; box-shadow: none; }
.m-trialbar__hint { flex: 0 0 auto; font-weight: 500; opacity: .8; }
.m-trialbar--warn  { background: #FFF3E0; color: #7A4B12; }
.m-trialbar--error { background: #FBE6E5; color: #A5322C; }

/* ---- Dashboard subscription reminder (prominent) ------------- */
.sub-alert {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 16px 18px; margin-bottom: 22px;
    border-radius: var(--radius-sm);
    border: 1px dashed currentColor;
    border-left: 5px solid currentColor;
}
.sub-alert__body { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 3px; }
.sub-alert__body strong { font-size: 1.02rem; }
.sub-alert__body span { font-weight: 500; opacity: .85; font-size: .9rem; }
.sub-alert .btn { flex: 0 0 auto; box-shadow: none; }
.sub-alert--warn  { background: #FFF3E0; color: #7A4B12; }
.sub-alert--error { background: #FBE6E5; color: #A5322C; }

/* ---- Locked module: full black "renew" overlay -------------- */
.m-nav a.is-locked { opacity: .5; }
.m-nav a.is-locked span { font-size: .8em; }

.sub-lock {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(8, 8, 8, .97);
    display: grid; place-items: center;
    padding: 24px;
}
.sub-lock__card {
    max-width: 420px; width: 100%;
    background: var(--white, #fff);
    border-radius: var(--radius, 16px);
    padding: 34px 28px 28px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
}
.sub-lock__icon { font-size: 2.4rem; line-height: 1; margin-bottom: 8px; }
.sub-lock__card h1 { font-size: 1.35rem; margin: 0 0 10px; }
.sub-lock__card p { color: var(--ink-soft, #5a5a5a); font-size: .94rem; margin: 0 0 20px; }
.sub-lock__card .btn { width: 100%; }
.sub-lock__back {
    display: inline-block; margin-top: 14px;
    font-size: .88rem; font-weight: 600; color: var(--muted, #888);
}

/* ---- Platform admin "acting as a client" bar ----------------- */
.m-scope {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-wrap: wrap;
    padding: 8px 14px; margin-bottom: 14px;
    background: var(--ink); color: #fff;
    border-radius: var(--radius-sm); font-size: .86rem;
}
.m-scope form { margin: 0; }
.m-scope .btn { background: rgba(255, 255, 255, .12); border-color: transparent; color: #fff; }
.m-scope .btn:hover { background: rgba(255, 255, 255, .22); }

/* platform companies list: keep action buttons from stretching the row */
.m-row-actions .btn { margin-left: 4px; }
.m-row-actions form { display: inline; margin: 0; }
.billing-steps { margin: 10px 0 0; padding-left: 20px; font-size: .9rem; color: var(--ink-soft); }
.billing-steps li { margin: 4px 0; }

/* ---- "How to price a reward" guide (Rewards list + form) ------ */
.guide {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin: 0 0 18px;
    font-size: .92rem;
}
.guide > summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 18px;
    font-weight: 700;
    color: var(--ink);
}
.guide > summary::-webkit-details-marker { display: none; }
.guide > summary::after { content: " ▸"; color: var(--muted); font-weight: 400; }
.guide[open] > summary::after { content: " ▾"; }
.guide[open] > summary { border-bottom: 1px solid var(--line); }
.guide__body { padding: 6px 20px 18px; max-width: 70ch; }
.guide__body p { margin: 12px 0; color: var(--ink-soft); }
.guide__body ol { margin: 12px 0; padding-left: 22px; }
.guide__body ol > li { margin: 10px 0; }
.guide__body ul { margin: 6px 0; padding-left: 20px; }
.guide__body ul > li { margin: 4px 0; color: var(--ink-soft); }
.guide__tbl {
    width: 100%; border-collapse: collapse; margin: 14px 0 6px; font-size: .88rem;
}
.guide__tbl th, .guide__tbl td {
    text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line);
}
.guide__tbl th {
    font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}
.guide__tbl td:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.guide__note { font-size: .85rem; color: var(--muted); }

/* -- Callout hint: soft blue info panel (for standalone <p class="hint hint--note">) */
.hint--note {
    display: block;
    margin: 12px 0 0;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: #E7F3F8;
    color: #2C6274;
    font-size: .82rem;
    line-height: 1.55;
}
.hint--note code {
    background: rgba(255, 255, 255, .6);
    padding: 1px 5px;
    border-radius: 5px;
    font-size: .95em;
}
.hint--note a { color: inherit; text-decoration: underline; }
.hint--note strong { color: inherit; }

/* ---- Profile links editor (/manage/links) --------------------- */
.lnk-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-top: 10px;
    background: var(--white);
}
.lnk-row.is-dragging { opacity: .6; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.lnk-row.is-off { opacity: .55; }
.lnk-row__grip {
    cursor: grab;
    touch-action: none;
    user-select: none;
    font-size: 1.1rem;
    line-height: 40px;
    color: var(--muted);
    padding: 0 4px;
}
.lnk-row__grip:active { cursor: grabbing; }
.lnk-row__fields { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lnk-row__toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    color: var(--ink-soft);
    white-space: nowrap;
    padding-top: 10px;
}
.lnk-row__remove { align-self: center; }
@media (max-width: 640px) {
    .lnk-row { flex-wrap: wrap; }
    .lnk-row__fields { flex-basis: 100%; order: 3; }
    .lnk-row__toggle { padding-top: 0; }
}

/* ---- Ads generator ------------------------------------------- */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.ads-card {
    display: block;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .12s ease, box-shadow .12s ease;
}
a.ads-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.ads-card__thumb {
    aspect-ratio: 1 / 1;
    background: var(--cream-deep);
    overflow: hidden;
}
.ads-card__thumb--wide { aspect-ratio: 16 / 9; }
.ads-card__thumb--tall { aspect-ratio: 9 / 16; }
.ads-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ads-card__body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.ads-card__title { font-size: .94rem; line-height: 1.3; }
.ads-card__meta { font-size: .78rem; }

.ads-editor { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.ads-editor__fields { flex: 1 1 420px; min-width: 320px; }
.ads-editor__preview { flex: 0 0 340px; position: sticky; top: 16px; }

.ads-tpl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.ads-tpl {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--white);
}
.ads-tpl input { position: absolute; opacity: 0; pointer-events: none; }
.ads-tpl.is-selected { border-color: var(--pink-deep); box-shadow: 0 0 0 1px var(--pink-deep); }
.ads-tpl__thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    background: var(--cream-deep);
}
.ads-tpl__label { font-weight: 700; font-size: .86rem; }
.ads-tpl__photo-badge { font-size: .78rem; opacity: .75; }
.ads-tpl__blurb { font-size: .74rem; line-height: 1.3; }

.ads-preview-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream-deep);
    border-radius: var(--radius-sm);
    padding: 12px;
    min-height: 200px;
}
.ads-preview-frame img { max-width: 100%; max-height: 60vh; border-radius: 6px; box-shadow: var(--shadow-sm); }

@media (max-width: 900px) {
    .ads-editor__preview { position: static; flex-basis: 100%; }
}

/* ---------- Help & guide (/manage/help) ---------- */
.help-search { max-width: 280px; }
.help-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.help-toc {
    position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px;
    max-height: calc(100vh - 32px); overflow-y: auto; padding: 14px 10px;
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.help-toc__title { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 8px 6px; }
.help-toc a { padding: 6px 8px; border-radius: 8px; font-size: .88rem; color: var(--ink-soft); font-weight: 500; }
.help-toc a:hover { background: var(--cream-deep); text-decoration: none; }
.help-toc a.is-current { background: var(--cream-deep); color: var(--ink); font-weight: 700; }
.help-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.help-body [hidden] { display: none !important; }
.help-group { margin: 12px 0 -4px; font-size: 1.05rem; color: var(--ink-soft); }
.help-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px 24px; scroll-margin-top: 16px; }
.help-card h2 { margin: 0; font-size: 1.15rem; }
.help-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.help-lead { margin: 8px 0 14px; color: var(--ink-soft); line-height: 1.55; }
.help-steps { margin: 0 0 14px; padding-left: 1.3em; display: flex; flex-direction: column; gap: 8px; line-height: 1.55; }
.help-steps li::marker { color: var(--pink-deep); font-weight: 700; }
.help-steps code, .help-faq code, .help-lead code, .help-tips code {
    background: var(--cream-deep); border-radius: 6px; padding: 1px 6px; font-size: .85em;
}
.help-tips { margin: 0; }
.help-tips ul { margin: 6px 0 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; }
.help-welcome {
    display: flex; flex-direction: column; gap: 3px; padding: 14px 18px; margin-bottom: 16px;
    border-radius: var(--radius-sm); background: #E7F3F8; color: #2C6274;
}
.help-journey { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.help-journey li { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--radius-sm); background: var(--cream); font-size: .86rem; line-height: 1.45; }
.help-journey strong { font-size: .95rem; }
.help-journey__n {
    width: 26px; height: 26px; border-radius: 50%; background: var(--pink-deep); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
}
.help-progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.help-progress-label { font-size: .85rem; font-weight: 700; color: var(--pink-deep); }
.help-progress { height: 8px; border-radius: 99px; background: var(--cream-deep); margin: 10px 0 14px; overflow: hidden; }
.help-progress i { display: block; height: 100%; width: 0; background: var(--pink-deep); border-radius: 99px; transition: width .3s; }
.help-check { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.help-check li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.help-check li:last-child { border-bottom: 0; }
.help-check__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.help-check__text span { font-size: .85rem; color: var(--ink-soft); }
.help-check li.is-done .help-check__text strong { text-decoration: line-through; color: var(--muted); }
.help-check__box { position: relative; flex: 0 0 auto; display: inline-flex; cursor: pointer; }
.help-check__box input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.help-check__box span {
    width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line);
    display: inline-flex; align-items: center; justify-content: center; color: transparent; font-size: .8rem; font-weight: 800;
}
.help-check__box span::after { content: '✓'; }
.help-check li.is-done .help-check__box span { background: var(--green); border-color: var(--green); color: #fff; }
.help-check li:not([data-manual]) .help-check__box { cursor: default; }
.help-check__note { font-size: .8rem; margin: 10px 0 0; }
.help-roles td, .help-roles th { text-align: center; }
.help-roles td:first-child, .help-roles th:first-child { text-align: left; }
.help-yes { color: #2F6D34; font-weight: 800; }
.help-no { color: var(--muted); }
.help-faq { border-bottom: 1px solid var(--line); padding: 4px 0; }
.help-faq:last-child { border-bottom: 0; }
.help-faq summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.help-faq p { margin: 0 0 12px; color: var(--ink-soft); line-height: 1.55; }
.help-none { text-align: center; color: var(--muted); padding: 20px; }

/* dashboard "new here?" nudge */
.help-nudge {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px;
    border-radius: var(--radius-sm); background: #E7F3F8; color: #2C6274;
}
.help-nudge span { flex: 1; min-width: 200px; }
.help-nudge .btn { box-shadow: none; }
.help-nudge__x { background: none; border: 0; color: inherit; font-size: 1.2rem; cursor: pointer; line-height: 1; padding: 4px 8px; }

@media (max-width: 1100px) {
    .help-layout { grid-template-columns: 1fr; }
    .help-toc { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .help-toc__title { width: 100%; }
    .help-search { max-width: none; width: 100%; }
}

@media (max-width: 600px) {
    .help-card { padding: 16px 16px; }
    /* contents become a single swipeable strip instead of a screen-tall block */
    .help-toc { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding: 8px; gap: 2px; -webkit-overflow-scrolling: touch; }
    .help-toc__title { display: none; }
    .help-toc a { white-space: nowrap; flex: 0 0 auto; }
    /* checklist: text gets the full row, button drops beneath it */
    .help-check li { flex-wrap: wrap; align-items: flex-start; gap: 6px 12px; }
    .help-check__text { flex: 1 1 calc(100% - 40px); }
    .help-check li .btn { margin-left: 36px; }
    table.data.help-roles td, table.data.help-roles th { padding: 10px 6px; }
    table.data.help-roles th { font-size: .66rem; letter-spacing: 0; }
    table.data.help-roles td:first-child { white-space: normal; min-width: 0; width: 42%; }
    .help-card__head { align-items: flex-start; }
    .help-steps { padding-left: 1.15em; }
}
