/* MotionVault — premium UI (AtomX-inspired). */

:root {
    --bg-0: #0d0d11;
    --bg-1: #15151c;
    --bg-2: #1c1c25;
    --bg-3: #25252f;
    --bg-4: #2f2f3a;
    --line: #2a2a34;
    --txt-0: #ececf1;
    --txt-1: #b3b3bf;
    --txt-2: #76767f;
    --acc:   #2563eb;
    --acc-2: #1d4ed8;
    --warn:  #ffb84a;
    --danger:#ff5566;
    --radius: 6px;

    /* === Motion Suite design tokens (Chunk 1 + T1 align c/ plugin-legendas) ===
       Os valores aqui replicam plugin-legendas/css/ep.css :root (linhas 1349-1369)
       pra paridade visual TOTAL com o Legendas (referência oficial da Suite). */
    --bg:        #0d0d11;
    --bg-2:      #15151c;
    --bg-3:      #1c1c25;
    --bg-hover:  #25252f;
    --line:      #2a2a34;
    --line-soft: #1f1f28;
    --txt:       #ececf1;
    --txt-2:     #c4c7d4;
    --mut:       #8590a8;
    --mut-2:     #5d6678;
    --acc-bright:#3b82f6;
    --acc-soft:  rgba(37, 99, 235, 0.12);
    --acc-line:  rgba(37, 99, 235, 0.35);
    --ok:        #10b981;
    --ok-soft:   rgba(16, 185, 129, 0.12);
    --err:       #ff5566;
    --err-soft:  rgba(255, 85, 102, 0.12);
    --warn-soft: rgba(245, 158, 11, 0.15);
    --radius-lg: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    width: 100%; height: 100%;
    background: var(--bg-0);
    color: var(--txt-0);
    font: 12px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; outline: none; }
input { font: inherit; color: inherit; outline: none; border: none; background: transparent; }

body {
    display: grid;
    grid-template-columns: 188px 1fr;
    grid-template-rows: 58px 32px 30px 1fr 24px;
    grid-template-areas:
        "head head"
        "tabs tabs"
        "bread bread"
        "side grid"
        "stat stat";
}

/* ============ HEADER BAR ============ */
.headbar {
    grid-area: head;
    background: linear-gradient(180deg, #1a1a23 0%, #131319 100%);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 14px;
    position: relative;
}
.headbar::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--acc) 40%, var(--acc) 60%, transparent);
    opacity: 0.18;
}

.headbar__brand { display: flex; align-items: center; gap: 9px; }
.headbar__logo {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(37, 99, 235,0.08);
    border-radius: 8px;
}
.headbar__text { display: flex; flex-direction: column; }
.headbar__name {
    font-weight: 800;
    font-size: 13.5px;
    letter-spacing: -0.2px;
    color: var(--txt-0);
    line-height: 1.15;
}
.headbar__sub {
    font-size: 9.5px;
    color: var(--txt-2);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1px;
}

.headbar__tools {
    display: flex;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 2px;
    gap: 1px;
}
.tool {
    width: 28px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--txt-2);
    border-radius: 5px;
    transition: background 0.12s, color 0.12s;
}
.tool:hover { color: var(--txt-0); background: var(--bg-3); }
.tool.active { background: var(--bg-4); color: var(--acc); }

.headbar__search {
    flex: 1;
    max-width: 380px;
    display: flex; align-items: center;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0 11px;
    height: 30px;
    color: var(--txt-2);
    gap: 7px;
}
.headbar__search:focus-within {
    border-color: var(--acc);
    color: var(--acc);
    box-shadow: 0 0 0 3px rgba(37, 99, 235,0.08);
}
.headbar__search input {
    flex: 1;
    color: var(--txt-0);
    font-size: 12px;
}
.headbar__search input::placeholder { color: var(--txt-2); }
.q-clear {
    color: var(--txt-2);
    font-size: 16px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
}
.q-clear:hover { color: var(--danger); background: rgba(255,85,102,0.12); }

.headbar__actions { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.iconbtn {
    width: 30px; height: 30px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--txt-1);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.12s;
}
.iconbtn:hover { background: var(--bg-3); color: var(--acc); border-color: var(--acc); }

/* ── Botao Config destacado (era so iconbtn anonimo) ── */
.btn-config-pill {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 12px;
    background: linear-gradient(135deg, var(--acc) 0%, #1d4fd7 100%);
    border: 1px solid var(--acc);
    border-radius: 7px;
    color: #fff;
    font: 600 12px/1 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 6px rgba(37,99,235,0.25);
}
.btn-config-pill:hover {
    background: linear-gradient(135deg, #1d4fd7 0%, var(--acc) 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(37,99,235,0.4);
}
.btn-config-pill svg { stroke: #fff; opacity: 0.95; }
.btn-config-pill__label { letter-spacing: 0.3px; }

/* ============ PACK TABS ============ */
.tabs {
    grid-area: tabs;
    background: var(--bg-1);
    border-bottom: 1px solid var(--line);
    display: flex;
    overflow-x: auto;
    padding: 0 6px;
    scrollbar-width: thin;
}
.tab {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 0 14px;
    height: 100%;
    font-size: 11.5px;
    color: var(--txt-2);
    white-space: nowrap;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.12s, border-color 0.12s;
}
.tab:hover { color: var(--txt-0); }
.tab.on {
    color: var(--acc);
    border-bottom-color: var(--acc);
    font-weight: 600;
}
.tab__count {
    padding: 1px 7px;
    background: var(--bg-3);
    color: var(--txt-2);
    border-radius: 99px;
    font-size: 9.5px;
    font-weight: 600;
}
.tab.on .tab__count { background: rgba(37, 99, 235,0.2); color: var(--acc); }

/* ============ BREADCRUMB ============ */
.breadcrumb {
    grid-area: bread;
    background: var(--bg-1);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center;
    padding: 0 14px;
    font-size: 10.5px;
    color: var(--txt-2);
    gap: 6px;
    white-space: nowrap; overflow-x: auto;
}
.crumb { color: var(--txt-1); }
.crumb.last { color: var(--acc); font-weight: 600; }
.crumb__sep { color: var(--txt-2); margin: 0 2px; opacity: 0.5; }

/* ============ SIDEBAR ============ */
.sidebar {
    grid-area: side;
    background: var(--bg-1);
    border-right: 1px solid var(--line);
    overflow-y: auto;
    padding: 6px 0;
}
.cat {
    display: flex; align-items: center;
    padding: 5px 12px 5px 8px;
    cursor: pointer;
    font-size: 11px;
    color: var(--txt-1);
    gap: 6px;
    line-height: 1.45;
    border-left: 2px solid transparent;
}
.cat:hover { background: var(--bg-2); color: var(--txt-0); }
.cat.on {
    background: rgba(37, 99, 235,0.1);
    color: var(--acc);
    border-left-color: var(--acc);
}
.cat__chev {
    width: 12px; text-align: center;
    color: var(--txt-2);
    font-size: 10px;
    transition: transform 0.12s;
    flex-shrink: 0;
}
.cat__chev.open { transform: rotate(90deg); }
.cat--root { font-weight: 600; color: var(--txt-0); padding-left: 8px; font-size: 11px; }
.cat--child { padding-left: 22px; color: var(--txt-1); font-size: 10.5px; }
.cat--child2 { padding-left: 36px; color: var(--txt-2); font-size: 10.5px; }
.cat__name {
    flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cat__num {
    color: var(--txt-2);
    font-size: 9.5px;
    font-weight: 500;
    padding-left: 4px;
}

/* ============ GRID ============ */
/* AtomX-style layout: FIXED PIXEL WIDTHS per card.
 * Flexbox auto-wraps cards into rows. No CSS Grid, no aspect-ratio, no math.
 * Image inside cards gets the same fixed pixel width, height auto = natural ratio. */
.grid {
    grid-area: grid;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-content: start;
    background: var(--bg-0);
}

.card {
    /* AtomX style: every card EXACTLY this wide, image inside has the same fixed width */
    width: 240px;
    flex: 0 0 240px;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
    position: relative;
}
body.dense .card { width: 170px; flex: 0 0 170px; }
body.wide  .card { width: 320px; flex: 0 0 320px; }
.card:hover {
    transform: translateY(-2px);
    border-color: var(--acc);
    box-shadow: 0 8px 28px rgba(0,0,0,0.5), 0 0 0 1px rgba(37, 99, 235,0.12);
    z-index: 1;
}

/* AtomX-style thumb: width matches card, image fills width with natural height.
 * No height calculation, no aspect-ratio, no padding-bottom — IMG dictates height. */
.card__thumb {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    background-color: #15151a;
    min-height: 135px;  /* placeholder while img loads — 16:9 of 240px */
}
body.dense .card__thumb { min-height: 96px; }
body.wide  .card__thumb { min-height: 180px; }

/* Sound FX: card de áudio (sem thumbnail de vídeo) — waveform centralizado */
.card__thumb--audio { display: flex; align-items: center; justify-content: center; }
.card__thumb--audio .card__wave {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    z-index: 1; opacity: 0.9;
}
.card__thumb--audio .card__wave svg { filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }

.card__thumb > img.frame {
    display: block;
    width: 100%;
    height: auto;   /* browser computes from natural aspect ratio */
}
.card__thumb > video,
.card__thumb > canvas {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1;
}
.card__thumb > video.live { z-index: 3; background: #000; }
.card__thumb .playicon {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.55) 100%);
    transition: opacity 0.15s;
    pointer-events: none;
    cursor: pointer;
    z-index: 5;
}
.card:hover .card__thumb .playicon { opacity: 1; pointer-events: auto; }
.card__thumb .playicon:hover svg { transform: scale(1.15); transition: transform 0.12s; }
.card__thumb .badge {
    position: absolute;
    top: 7px; left: 7px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: var(--txt-0);
    font-size: 9px; font-weight: 700;
    padding: 2.5px 7px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.15s;
}
.card:hover .card__thumb .badge { opacity: 1; }
.card__thumb .duration {
    position: absolute;
    bottom: 7px; right: 7px;
    background: rgba(0,0,0,0.75);
    color: #fff;
    font-size: 9.5px; font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 4;
    font-variant-numeric: tabular-nums;
}
.card__fav {
    position: absolute;
    top: 7px; right: 7px;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    border-radius: 99px;
    z-index: 4;
    opacity: 0;
    color: var(--txt-1);
    transition: opacity 0.15s, color 0.15s;
}
.card:hover .card__fav { opacity: 1; }
.card__fav:hover { color: var(--warn); }
.card__fav.on { color: var(--warn); opacity: 1; }

.card__name {
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--txt-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--bg-1);
}
.card:hover .card__name { color: var(--txt-0); }

.empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--txt-2);
}
.empty h3 { color: var(--txt-1); font-weight: 500; margin-bottom: 6px; font-size: 14px; }
.empty p { font-size: 11px; }

.load-more {
    grid-column: 1 / -1;
    padding: 14px;
    background: var(--bg-2);
    color: var(--acc);
    border: 1px dashed var(--bg-4);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.12s, border-color 0.12s;
}
.load-more:hover { background: var(--bg-3); border-color: var(--acc); }

/* ============ STATUS BAR ============ */
.statusbar {
    grid-area: stat;
    background: var(--bg-1);
    border-top: 1px solid var(--line);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 14px;
    font-size: 10.5px;
    color: var(--txt-1);
    gap: 14px;
    overflow: hidden;
}
.muted { color: var(--txt-2); }

/* ════════════════ STATUS BAR DOTS (Chunk 7) ════════════════ */
.statusbar__dots {
    display: flex; align-items: center;
    gap: 4px;
    flex-shrink: 0;
    font-size: 10px;
    color: var(--txt-2);
    letter-spacing: 0.4px;
}
.statusbar__dots .dot-label {
    margin-right: 10px;
    margin-left: 1px;
}
.statusbar__dots .dot-label:last-of-type { margin-right: 0; }
.statusbar .dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--mut-2);
    flex-shrink: 0;
    transition: background 0.2s, box-shadow 0.2s;
}
.statusbar .dot.ok   { background: var(--ok);   box-shadow: 0 0 6px var(--ok); }
.statusbar .dot.warn { background: var(--warn); box-shadow: 0 0 5px var(--warn); }
.statusbar .dot.err  { background: var(--err);  box-shadow: 0 0 5px var(--err); }
.statusbar .dot.off  { background: var(--mut-2); box-shadow: none; }

/* ════════════════ SUITE PILL no statusbar (Chunk 8) ════════════════ */
.suite-pill {
    display: inline-flex; align-items: center;
    padding: 2px 9px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: var(--acc-soft);
    color: var(--acc-bright);
    border: 1px solid var(--acc-line);
    cursor: pointer;
    transition: all 0.15s;
    margin-left: 8px;
    font-family: 'Inter', system-ui, sans-serif;
}
.suite-pill:hover { background: var(--acc); color: #fff; transform: translateY(-1px); }

/* ════════════════ CROSS-SELL SUITE (Chunk 8) ════════════════ */
.cross-sell { font-size: 12.5px; color: var(--txt-2); line-height: 1.5; }
.cross-sell__default { padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.cross-sell__row { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.cross-sell__link {
    color: var(--acc-bright);
    text-decoration: none;
    font-weight: 600;
    padding: 6px 12px;
    background: var(--acc-soft);
    border: 1px solid var(--acc-line);
    border-radius: var(--radius);
    transition: all 0.15s;
}
.cross-sell__link:hover {
    background: var(--acc);
    color: #fff;
    border-color: var(--acc);
    transform: translateY(-1px);
}
.cross-sell__owned-list {
    background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(37,99,235,0.06));
    border: 1px solid var(--ok-soft);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.cross-sell__owned-hd {
    font-size: 12px;
    font-weight: 700;
    color: var(--ok);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}
.cross-sell__owned {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--line-soft);
}
.cross-sell__owned:first-of-type { border-top: 0; padding-top: 4px; }
.cross-sell__owned-icon { font-size: 26px; flex-shrink: 0; }
.cross-sell__owned-body { flex: 1; min-width: 0; }
.cross-sell__owned-name { font-weight: 700; color: var(--txt); font-size: 13px; }
.cross-sell__owned-sub  { font-size: 11px; color: var(--mut); margin-top: 2px; }

/* ════════════════ DIAGNÓSTICO OUTPUT (Chunk 7) ════════════════ */
.diag-output {
    margin-top: 14px;
    background: #0a0c12;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    color: var(--txt);
    white-space: pre-wrap;
    max-height: 420px;
    overflow: auto;
    line-height: 1.5;
}

/* ============ TOAST ============ */
.toast {
    position: fixed;
    bottom: 40px; left: 50%;
    transform: translateX(-50%);
    padding: 9px 18px;
    background: var(--bg-3);
    color: var(--txt-0);
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 500;
    box-shadow: 0 8px 26px rgba(0,0,0,0.55);
    animation: toast-in 0.18s ease;
    z-index: 50;
    border: 1px solid var(--line);
}
.toast.ok { background: linear-gradient(180deg, #2cb86c, #1f9856); color: #fff; border-color: rgba(0,0,0,0.2); }
.toast.err { background: linear-gradient(180deg, #ff5566, #d9384a); color: #fff; border-color: rgba(0,0,0,0.2); }
@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ============ LOG ============ */
.log {
    position: fixed;
    bottom: 30px; left: 8px; right: 8px;
    max-height: 240px;
    background: rgba(8,8,12,0.97);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    z-index: 80;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    display: flex; flex-direction: column;
}
.log.hidden { display: none; }
.log__head {
    display: flex; justify-content: space-between;
    padding: 6px 11px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    font-size: 11px;
    color: var(--txt-1);
}
.log__head button { color: var(--txt-2); font-size: 16px; }
.log__body {
    overflow-y: auto;
    padding: 8px 11px;
    font: 10.5px/1.5 ui-monospace, "Cascadia Code", Consolas, monospace;
    color: #6cfb9a;
}
.log__body .err { color: var(--danger); }
.log__body .warn { color: var(--warn); }
.log__line { white-space: pre-wrap; word-break: break-all; }
.log__line--err { color: var(--danger); }
.log__line--warn { color: var(--warn); }

/* ============ SCROLLBARS ============ */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-4); }

/* ============ MISC ============ */
.hidden { display: none !important; }

/* ============ LOGIN GATE (Motion IA-style · Chunk 1) ============ */
.gate {
    position: fixed; inset: 0;
    background: radial-gradient(ellipse at top, rgba(37,99,235,0.10), transparent 60%), var(--bg);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 24px;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.gate__box {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 36px;
    width: 100%; max-width: 380px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
.gate__brand {
    text-align: center;
    margin-bottom: 6px;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.5px;
    color: var(--txt);
}
.gate__brand span { color: var(--acc); }
.gate__tagline {
    text-align: center;
    font-size: 11px;
    color: var(--mut);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 28px;
}
.gate__tabs {
    display: flex;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 22px;
}
.gate__tab {
    flex: 1;
    background: transparent;
    border: 0;
    color: var(--mut);
    padding: 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
    cursor: pointer;
}
.gate__tab.active { background: var(--acc); color: #fff; }
.gate__msg {
    margin-top: 12px;
    font-size: 12px;
    text-align: center;
    min-height: 18px;
    color: var(--mut);
}
.gate__msg.err { color: var(--err); }
.gate__msg.ok  { color: var(--ok); }
.gate__foot {
    text-align: center;
    margin-top: 16px;
    font-size: 11px;
    color: var(--mut);
}
.gate__foot a {
    color: var(--mut);
    text-decoration: none;
    transition: color 0.15s;
}
.gate__foot a:hover { color: var(--acc-bright); }
.gate__sep {
    display: flex; align-items: center; gap: 10px;
    margin: 18px 0 14px;
    font-size: 10px; color: var(--mut);
    text-transform: uppercase; letter-spacing: 1px;
}
.gate__sep::before, .gate__sep::after {
    content: ""; flex: 1; height: 1px; background: var(--line);
}

/* ============ FIELDS (Motion IA-style) ============ */
.field { margin-bottom: 14px; }
.field label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--mut);
    font-weight: 700;
    margin-bottom: 6px;
}
.field input, .field select, .field textarea {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--txt);
    padding: 10px 13px;
    border-radius: var(--radius);
    font-size: 13px;
    transition: border 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--acc);
    box-shadow: 0 0 0 3px var(--acc-soft);
}
.field .hint { font-size: 11px; color: var(--mut); margin-top: 6px; }

/* ============ BUTTONS (Motion IA-style) ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--txt);
    padding: 9px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}
.btn:hover { background: var(--bg-3); border-color: var(--mut-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn--primary:hover { background: var(--acc-bright); border-color: var(--acc-bright); }
.btn--full { width: 100%; padding: 12px; }
.btn--sm { padding: 6px 12px; font-size: 12px; }
.btn--danger { background: var(--err-soft); border-color: var(--err); color: var(--err); }
.btn--danger:hover { background: var(--err); color: #fff; }
.btn--ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.btn--ghost { border-color: transparent; color: var(--mut); }
.btn--ghost:hover { background: var(--bg-3); color: var(--txt); }

/* ========== TRIAL BAR (header strip) ========== */
.trialbar{
    display:flex;align-items:center;justify-content:space-between;
    background:linear-gradient(90deg,#1d4ed8,#2563eb);
    color:#fff;padding:8px 14px;
    font:600 11px/1 'Inter',-apple-system,sans-serif;
    letter-spacing:.3px;
    border-bottom:1px solid #1e40af;
    flex-shrink:0;
}
.trialbar.hidden{display:none !important}
.trialbar__info{display:flex;align-items:center;gap:8px}
.trialbar.warn{background:linear-gradient(90deg,#c2410c,#ea580c);border-bottom-color:#9a3412}
.trialbar.expired{background:linear-gradient(90deg,#991b1b,#dc2626);border-bottom-color:#7f1d1d}
.trialbar__cta{
    background:#fff;color:#1d4ed8;
    border:none;border-radius:4px;
    padding:5px 12px;font:700 10.5px/1 'Inter',sans-serif;
    cursor:pointer;letter-spacing:.3px;
    transition:transform .12s,box-shadow .15s;
}
.trialbar__cta:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(0,0,0,.25)}
.trialbar.expired .trialbar__cta{color:#991b1b}
.trialbar.warn .trialbar__cta{color:#c2410c}

/* ========== PAYWALL (overlay) ========== */
.paywall{
    position:fixed;inset:0;z-index:9999;
    background:rgba(0,0,0,.85);backdrop-filter:blur(6px);
    display:flex;align-items:center;justify-content:center;
    padding:20px;
}
.paywall.hidden{display:none !important}
.paywall__box{
    background:#1a1a1f;border:1px solid #2a2a30;
    border-radius:12px;padding:32px 28px;
    max-width:420px;width:100%;text-align:center;
    box-shadow:0 30px 80px rgba(0,0,0,.6);
}
.paywall__icon{font-size:40px;margin-bottom:14px}
.paywall__title{
    font:800 22px/1.1 'Inter',sans-serif;color:#f0f1f5;
    letter-spacing:-.5px;margin:0 0 10px;
}
.paywall__sub{
    color:#a0a0aa;font:400 13px/1.5 'Inter',sans-serif;
    margin:0 0 24px;
}
.paywall__plans{
    display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:22px;
}
.paywall__plan{
    background:#22222a;border:1px solid #2a2a30;
    border-radius:8px;padding:14px 12px;
}
.paywall__plan--feat{border-color:#2563EB;background:rgba(37,99,235,.08)}
.paywall__plan-name{font:600 10px 'Inter';color:#7e8395;letter-spacing:1.5px;text-transform:uppercase;margin-bottom:6px}
.paywall__plan-price{font:800 20px/1 'Inter';color:#f0f1f5;letter-spacing:-.5px}
.paywall__plan-price small{font:500 11px 'Inter';color:#a0a0aa;margin-left:3px;letter-spacing:0}
.paywall__plan-sub{font:500 10.5px 'Inter';color:#7e8395;margin-top:4px}
.paywall__btn{
    width:100%;background:#2563EB;color:#fff;border:none;
    border-radius:6px;padding:13px;cursor:pointer;
    font:700 13px 'Inter';letter-spacing:.3px;
    transition:background .15s;
}
.paywall__btn:hover{background:#1d4ed8}
.paywall__logout{
    background:none;border:none;color:#7e8395;
    margin-top:14px;cursor:pointer;
    font:500 11px 'Inter';text-decoration:underline;
}
.paywall__logout:hover{color:#f0f1f5}

/* ========== SIGNUP EXTRA FIELDS (nome, telefone, optin) ========== */
.signup-only[hidden]{display:none !important}
.g-optin{
    display:flex;align-items:flex-start;gap:8px;
    font:400 11.5px/1.4 'Inter',sans-serif;color:#a0a0aa;
    padding:6px 2px;cursor:pointer;
}
.g-optin input{
    margin:1px 0 0;cursor:pointer;
    accent-color:#2563EB;
}

/* ========== EMAIL VERIFY BANNER ========== */
.verifybar{
    display:flex;align-items:center;justify-content:space-between;gap:10px;
    background:linear-gradient(90deg,#f59e0b,#ea580c);
    color:#fff;padding:7px 14px;
    font:600 11px/1.2 'Inter',sans-serif;
    border-bottom:1px solid #c2410c;
    flex-shrink:0;
}
.verifybar.hidden{display:none !important}
.verifybar__info{flex:1}
.verifybar__cta{
    background:#fff;color:#c2410c;
    border:none;border-radius:4px;
    padding:5px 11px;font:700 10.5px/1 'Inter',sans-serif;
    cursor:pointer;letter-spacing:.3px;
    transition:transform .12s,box-shadow .15s;
    flex-shrink:0;
}
.verifybar__cta:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(0,0,0,.25)}
.verifybar__dismiss{
    background:transparent;color:#fff;border:none;
    width:22px;height:22px;border-radius:50%;
    cursor:pointer;font-size:16px;line-height:1;
    opacity:.7;flex-shrink:0;
}
.verifybar__dismiss:hover{opacity:1;background:rgba(0,0,0,.15)}

/* ============ REAUTH BAR (sessão expirou no backend — não desloga, só reconecta) ============ */
.reauthbar{
    display:flex;align-items:center;justify-content:space-between;gap:10px;
    background:linear-gradient(90deg,#3b82f6,#1d4ed8);
    color:#fff;padding:7px 14px;
    font:600 11px/1.2 'Inter',sans-serif;
    border-bottom:1px solid #1e40af;
    flex-shrink:0;
}
.reauthbar.hidden{display:none !important}
.reauthbar__info{flex:1}
.reauthbar__cta{
    background:#fff;color:#1d4ed8;
    border:none;border-radius:4px;
    padding:5px 11px;font:700 10.5px/1 'Inter',sans-serif;
    cursor:pointer;letter-spacing:.3px;
    transition:transform .12s,box-shadow .15s;
    flex-shrink:0;
}
.reauthbar__cta:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(0,0,0,.25)}

/* ════════════════ CONFIG DRAWER (slide-over · Chunk 4) ════════════════ */
.cfg-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(2px);
    z-index: 8999;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
}
.cfg-backdrop.open { opacity: 1; pointer-events: auto; }

.cfg-drawer {
    position: fixed;
    top: 0; right: -460px;
    width: 100%; max-width: 440px;
    height: 100vh;
    background: var(--bg);
    border-left: 1px solid var(--line);
    box-shadow: -16px 0 48px rgba(0,0,0,0.55);
    z-index: 9000;
    transition: right 0.25s ease;
    display: flex; flex-direction: column;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--txt);
}
.cfg-drawer.open { right: 0; }

.cfg-drawer__head {
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--line);
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 14px;
    flex-shrink: 0;
}
.cfg-drawer__title {
    font-size: 16px; font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--txt);
}
.cfg-drawer__sub {
    font-size: 11px; color: var(--mut);
    margin-top: 4px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    word-break: break-all;
}
.cfg-drawer__close {
    background: transparent; border: 0;
    color: var(--mut);
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px; line-height: 1;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.cfg-drawer__close:hover { background: var(--bg-3); color: var(--txt); }

.cfg-drawer__body {
    padding: 20px 22px 32px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.18) transparent;
}
.cfg-drawer__body::-webkit-scrollbar { width: 10px; }
.cfg-drawer__body::-webkit-scrollbar-track { background: transparent; }
.cfg-drawer__body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.18);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.cfg-drawer__body::-webkit-scrollbar-thumb:hover {
    background: rgba(37,99,235,0.55);
    background-clip: padding-box;
}

/* Custom scrollbar geral pro plugin Titles (catalogo, grid, etc) */
.scrollable, .grid-wrap, #grid {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.18) transparent;
}
.scrollable::-webkit-scrollbar,
.grid-wrap::-webkit-scrollbar,
#grid::-webkit-scrollbar { width: 10px; }
.scrollable::-webkit-scrollbar-track,
.grid-wrap::-webkit-scrollbar-track,
#grid::-webkit-scrollbar-track { background: transparent; }
.scrollable::-webkit-scrollbar-thumb,
.grid-wrap::-webkit-scrollbar-thumb,
#grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.scrollable::-webkit-scrollbar-thumb:hover,
.grid-wrap::-webkit-scrollbar-thumb:hover,
#grid::-webkit-scrollbar-thumb:hover {
    background: rgba(37,99,235,0.5);
    background-clip: padding-box;
}

/* ── License card (porta do plugin-ia) ── */
.card__title {
    font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--mut);
}
.license-card {
    background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
    border: 1px solid var(--line);
    border-left: 4px solid var(--ok);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin-bottom: 18px;
}
.license-card.inactive,
.license-card.not_activated { border-left-color: var(--mut-2); }
.license-card.expired,
.license-card.revoked,
.license-card.suspended,
.license-card.invalid,
.license-card.wrong_product { border-left-color: var(--err); }
.license-card__row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--line-soft);
    gap: 12px;
}
.license-card__row:last-child { border-bottom: none; }
.license-card__label {
    color: var(--mut);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}
.license-card__value {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--txt);
    text-align: right;
    word-break: break-all;
}
.license-card__status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.license-card__status.active    { background: var(--ok-soft); color: var(--ok); }
.license-card__status.inactive,
.license-card__status.not_activated { background: rgba(133,144,168,0.15); color: var(--mut); }
.license-card__status.expired,
.license-card__status.revoked,
.license-card__status.suspended,
.license-card__status.invalid,
.license-card__status.wrong_product { background: var(--err-soft); color: var(--err); }

/* ════════════════ TIER GATING (Chunk 5) ════════════════ */
.tier-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: 8px;
    transition: all 0.15s;
    font-family: 'Inter', system-ui, sans-serif;
}
.tier-badge:hover { transform: translateY(-1px); }
.tier-badge.tier-free     { background: rgba(133,144,168,0.15); color: var(--mut); }
.tier-badge.tier-basic    { background: rgba(245,158,11,0.15); color: #f59e0b; }
.tier-badge.tier-pro      { background: var(--acc-soft); color: var(--acc-bright); }
.tier-badge.tier-lifetime { background: var(--ok-soft); color: var(--ok); }

/* Visual lock nos cards quando tier não cobre */
.card.is-locked { position: relative; opacity: 0.62; }
.card.is-locked::after {
    content: "🔒";
    position: absolute;
    top: 8px; left: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 12px;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    z-index: 4;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.card.is-locked:hover { opacity: 0.85; }
.card.is-locked .playicon { background: rgba(245,158,11,0.18); }

/* ============ ATOMX-STYLE BADGES (NEW pill + dot azul) ============ */
@keyframes mv_opacity_blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}

/* Pill NEW na pasta top-level (Transitions, Color Grading, Effects&Overlays) */
.cat__name .is_new_group {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 5px;
    border-radius: 25px;
    background: linear-gradient(0deg, #0e6aff 0%, #109ad1 100%);
    color: #fff;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.8px;
    line-height: 1;
    vertical-align: middle;
    box-shadow: 0 0 6px rgba(49,151,255,0.45),
                inset -2px 1px 4px rgba(87,92,255,0.4);
    animation: mv_opacity_blink 4.2s linear infinite;
}

/* Dot azul nas subcategorias is_new */
.cat__name .is_new {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-left: 6px;
    border-radius: 50%;
    background: linear-gradient(0deg, #0e6aff 0%, #109ad1 100%);
    vertical-align: middle;
    box-shadow: 0 0 6px rgba(49,151,255,0.55),
                inset -2px 1px 3px rgba(87,92,255,0.4);
    animation: mv_opacity_blink 4.2s linear infinite;
}

/* ============ HOVER GIF (AtomX style — sem decode de vídeo) ============ */
.card__thumb > img.live {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 3;
    background: #000;
    pointer-events: none;
}
.card__thumb > .live--gif {
    image-rendering: auto;
}
