:root {
    --bg: #0b1020;
    --panel: #121933;
    --panel-soft: #1b2549;
    --text: #eef2ff;
    --muted: #9fb0d8;
    --primary: #5aa7ff;
    --success: #1eb980;
    --error: #ff6b6b;
    --warning: #ffcc66;
    --border: rgba(255,255,255,0.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(180deg, #09101f, #131c36 65%, #10182d);
    color: var(--text);
}

h1, h2, h3, p { margin-top: 0; }
a { color: var(--primary); text-decoration: none; }
code {
    background: rgba(255,255,255,0.08);
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    word-break: break-all;
}

.page-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    padding: 1.5rem 1.25rem;
    background: rgba(0,0,0,0.22);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
}

.sidebar .compact {
    padding: 1rem;
    border-radius: 14px;
}

.brand {
    font-size: 1.35rem;
    font-weight: 700;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.nav-list a {
    background: rgba(255,255,255,0.04);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: var(--text);
    border: 1px solid transparent;
}

.nav-list a:hover,
.nav-list a.active {
    border-color: rgba(90, 167, 255, 0.35);
    background: rgba(90, 167, 255, 0.12);
}

.content-area {
    padding: 2rem;
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
}

.content-area-full {
    grid-column: 1 / -1;
    height: auto;
    overflow: visible;
}

.header-block {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.grid-cards,
.grid-2 {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.grid-cards {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 18px 45px rgba(0,0,0,0.18);
}

.soft-card {
    background: rgba(255,255,255,0.035);
}

.stat-card .label {
    display: block;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.stat-card strong {
    font-size: 2rem;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 480px;
}

.auth-card.large {
    max-width: 900px;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid label {
    display: grid;
    gap: 0.45rem;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
button,
.button-link,
.button-small {
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    padding: 0.9rem 1rem;
    font-size: 1rem;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

input[disabled] {
    opacity: 0.75;
}

button, .button-link, .button-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #5aa7ff, #3c7be0);
    color: #fff;
    border: none;
    cursor: pointer;
    padding: 0.95rem 1.2rem;
    border-radius: 12px;
    font-weight: 700;
}

.button-link.secondary,
.button-small.secondary {
    background: rgba(255,255,255,0.08);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.12);
}

.button-small {
    padding: 0.7rem 0.9rem;
    font-size: 0.92rem;
}

.button-small.danger {
    background: linear-gradient(180deg, #ff7e7e, #d95050);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.inline-actions form {
    margin: 0;
}

.form-actions,
.full-width {
    grid-column: 1 / -1;
}

.alert {
    padding: 0.95rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.alert.success {
    background: rgba(30, 185, 128, 0.15);
    border: 1px solid rgba(30, 185, 128, 0.35);
}

.alert.error {
    background: rgba(255, 107, 107, 0.14);
    border: 1px solid rgba(255, 107, 107, 0.32);
}

.muted {
    color: var(--muted);
}

.feature-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.65rem;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: 0.92rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    font-size: 0.85rem;
}

.tag-success {
    background: rgba(30, 185, 128, 0.18);
}

.tag-muted {
    background: rgba(255,255,255,0.08);
}

.tag-warn {
    background: rgba(255, 204, 102, 0.18);
    color: #ffe3a3;
}

.tag-danger {
    background: rgba(255, 107, 107, 0.18);
}

.color-chip {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-right: 0.35rem;
    border: 1px solid rgba(255,255,255,0.25);
}

.pairing-grid {
    align-items: start;
}

.qr-card {
    text-align: center;
}

.qr-box {
    margin: 1rem auto;
    display: inline-flex;
    padding: 1rem;
    border-radius: 18px;
    background: #ffffff;
}

.pair-code {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    letter-spacing: 0.35rem;
    font-size: 2rem;
    font-weight: 800;
    padding: 0.85rem 1.2rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
}

.copy-box {
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 0.85rem;
}

.detail-list {
    display: grid;
    gap: 0.75rem;
}

.detail-list > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.detail-list span {
    color: var(--muted);
}

.stack-xs {
    display: grid;
    gap: 0.35rem;
}

.soft-spacing {
    margin-top: 1rem;
}

@media (max-width: 840px) {
    .page-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
        gap: 1rem;
    }

    .form-grid.two-columns,
    .grid-2,
    .pairing-grid {
        grid-template-columns: 1fr;
    }

    .header-block {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-list > div {
        flex-direction: column;
        gap: 0.3rem;
    }
}

.kpi-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.checkbox-field { display:flex; align-items:center; gap:10px; }
.checkbox-field input { width:auto; margin:0; }
.public-body { margin:0; background:#0f172a; color:#fff; }
.public-shell { max-width:1200px; margin:0 auto; padding:24px; }
.public-header { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:20px; }
.public-card { background:#101827; border-color:#1f2937; }
.public-toolbar { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; margin-bottom:16px; }
.public-toolbar label { min-width:260px; }
.public-player-frame { display:flex; flex-direction:column; gap:12px; }
.player-stage { position:relative; width:100%; aspect-ratio:16/9; background:#020617; border-radius:16px; overflow:hidden; display:flex; align-items:center; justify-content:center; }
.player-placeholder { color:#cbd5e1; font-size:1.05rem; }
.stage-image-wrap,.stage-video { width:100%; height:100%; }
.stage-image,.stage-video { width:100%; height:100%; object-fit:cover; display:block; }
.player-caption { display:flex; flex-direction:column; gap:4px; }
.ad-badge { position:absolute; top:14px; left:14px; background:rgba(15,23,42,.85); color:#fff; padding:6px 10px; border-radius:999px; font-size:.8rem; font-weight:700; }
.ad-badge-floating { z-index:5; }
@media (max-width: 900px) { .public-header,.public-toolbar { flex-direction:column; align-items:flex-start; } }

.stack-xs{display:flex;flex-direction:column;gap:4px}.full-width{grid-column:1 / -1}.card.compact{padding:12px}.checkbox-field{display:flex;align-items:center;gap:8px}.checkbox-field input{width:auto}
.player-summary-grid{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
.stage-image-kenburns{animation:kenburns 14s ease-in-out infinite alternate}
@keyframes kenburns{from{transform:scale(1)}to{transform:scale(1.08)}}


.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.tv-shell{max-width:1600px;margin:0 auto}
.tv-header p{font-size:1rem}
.tv-card{padding:18px}
.tv-toolbar{justify-content:flex-start;margin-bottom:14px}
.tv-stage{aspect-ratio:16/9;min-height:70vh;border-radius:22px}
.player-overlay-caption{position:absolute;left:24px;right:24px;bottom:24px;display:flex;flex-direction:column;gap:10px;padding:22px 24px;background:linear-gradient(180deg,rgba(2,6,23,.08),rgba(2,6,23,.82));border-radius:20px;backdrop-filter:blur(4px);max-width:min(72%,1100px)}
.player-overlay-caption strong{font-size:1.9rem;line-height:1.1;color:#fff;text-shadow:0 2px 10px rgba(0,0,0,.55)}
.player-overlay-caption span{font-size:1.12rem;line-height:1.34;color:#e2e8f0;text-shadow:0 1px 6px rgba(0,0,0,.45);overflow:hidden;max-width:72ch}
.tv-stage .ad-badge{font-size:1rem;padding:8px 14px}
@media (max-width: 1100px){.tv-stage{min-height:55vh}.player-overlay-caption{max-width:calc(100% - 48px)}.player-overlay-caption strong{font-size:1.5rem}.player-overlay-caption span{font-size:1rem}}

.player-offline-shell{position:absolute;inset:0;display:flex;align-items:stretch;justify-content:stretch;background:#020617;z-index:1}
.offline-loop-video{width:100%;height:100%;object-fit:cover;opacity:.72;display:block}
.offline-overlay{position:absolute;inset:0;display:flex;align-items:flex-end;justify-content:space-between;padding:28px;background:linear-gradient(180deg,rgba(2,6,23,.04),rgba(2,6,23,.78))}
.offline-branding{display:flex;align-items:center;gap:16px;padding:16px 18px;border-radius:18px;background:rgba(15,23,42,.56);backdrop-filter:blur(8px);max-width:min(60vw,680px)}
.offline-branding strong{display:block;font-size:1.6rem;line-height:1.1}
.offline-branding span{display:block;margin-top:6px;color:#dbe4f1;font-size:1rem;line-height:1.4}
.offline-logo{width:72px;height:72px;border-radius:16px;object-fit:contain;background:rgba(255,255,255,.92);padding:8px}
.offline-watermark{align-self:flex-start;font-size:.95rem;letter-spacing:.08em;text-transform:uppercase;color:rgba(255,255,255,.75);padding:10px 14px;border-radius:999px;background:rgba(15,23,42,.44)}
.wifi-cta{position:absolute;right:20px;bottom:20px;z-index:4;border:none;border-radius:999px;padding:10px 16px;background:rgba(15,23,42,.72);color:#fff;font-weight:700;cursor:pointer;backdrop-filter:blur(8px);box-shadow:0 8px 24px rgba(0,0,0,.22)}
.wifi-panel{position:absolute;right:20px;bottom:70px;z-index:5;display:grid;gap:10px;width:min(300px,80vw);padding:18px;border-radius:18px;background:rgba(15,23,42,.88);backdrop-filter:blur(12px);box-shadow:0 18px 40px rgba(0,0,0,.35)}
.wifi-panel img{width:220px;max-width:100%;margin:0 auto;border-radius:12px;background:#fff;padding:8px}
.wifi-panel code{padding:10px 12px;border-radius:12px;background:rgba(255,255,255,.06);color:#dbe4f1;word-break:break-word}
.wifi-panel-close{position:absolute;top:10px;right:10px;border:none;background:transparent;color:#fff;font-size:1.35rem;cursor:pointer}
@media (max-width: 1100px){.offline-branding strong{font-size:1.25rem}.offline-branding span{font-size:.92rem}.offline-logo{width:58px;height:58px}}

@media (max-width: 840px) {
    .sidebar {
        position: relative;
        height: auto;
        overflow: visible;
    }
    .content-area {
        height: auto;
        overflow: visible;
    }
}

/* Pacote 14M */
.preset-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px}
.preset-card{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:8px;min-height:132px;text-align:left;white-space:normal;line-height:1.35;padding:18px;border-radius:16px;background:linear-gradient(180deg,#5aa7ff,#3c7be0);color:#fff;box-shadow:0 14px 30px rgba(0,0,0,.18)}
.preset-card strong{font-size:1.15rem;line-height:1.2}
.preset-card span{display:block;max-width:100%;font-weight:600;opacity:.95}
.wrap-row{flex-wrap:wrap}
.home-shell-v2{max-width:1700px}
.public-home-layout{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(320px,.9fr);gap:18px;align-items:start}
.public-main-column,.public-side-column{min-width:0}
.side-story-card h2{margin-bottom:0;font-size:1.8rem;line-height:1.15}
.side-story-card .button-row{margin-top:14px}
.story-list{display:grid;gap:12px;max-height:calc(100vh - 280px);overflow:auto;padding-right:4px}
.story-list-item{display:grid;gap:8px;width:100%;text-align:left;padding:14px 16px;border-radius:16px;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.04);color:var(--text);cursor:pointer}
.story-list-item strong{font-size:1.02rem;line-height:1.25}
.story-list-item span:last-child{color:var(--muted);line-height:1.35}
.story-list-item.active,.story-list-item:hover{border-color:rgba(90,167,255,.4);background:rgba(90,167,255,.1)}
.player-topbar{position:absolute;left:0;right:0;top:0;z-index:7;display:flex;justify-content:space-between;align-items:center;padding:16px 22px;background:linear-gradient(180deg,rgba(2,6,23,.72),rgba(2,6,23,.10));font-size:1rem;color:#fff}
.player-branding-inline{display:flex;align-items:center;gap:12px;font-weight:700;min-width:0}
.player-top-logo{width:34px;height:34px;border-radius:10px;object-fit:contain;background:rgba(255,255,255,.94);padding:4px}
.story-qr-dock{position:absolute;right:20px;top:76px;z-index:7;display:grid;gap:8px;width:min(156px,22vw);padding:12px;border-radius:18px;background:rgba(15,23,42,.82);backdrop-filter:blur(10px);box-shadow:0 18px 40px rgba(0,0,0,.28)}
.story-qr-dock strong{font-size:.95rem;line-height:1.2}.story-qr-dock img{width:100%;border-radius:12px;background:#fff;padding:8px}.story-qr-dock span{font-size:.82rem;line-height:1.25}
.detail-qr-box{display:grid;gap:10px;justify-items:start;margin-top:16px}.detail-qr-box img{width:170px;max-width:100%;padding:8px;border-radius:14px;background:#fff}
.player-overlay-caption{z-index:6;transition:opacity .2s ease}.player-overlay-caption[hidden]{opacity:0;pointer-events:none}
.player-overlay-caption strong{max-width:24ch}.player-overlay-caption span{max-width:92ch}
.player-placeholder{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(2,6,23,.35);z-index:5}
.sidebar{min-width:0}.nav-list a{min-width:0;overflow-wrap:anywhere}
input[type="file"]{padding:.7rem .8rem;background:rgba(255,255,255,.04)}
.logo-upload-preview{display:flex;align-items:center;gap:12px;padding:12px;border-radius:14px;background:rgba(255,255,255,.04)}
.logo-upload-preview img{width:64px;height:64px;border-radius:14px;object-fit:contain;background:#fff;padding:6px}
.logo-upload-preview span{color:var(--muted);line-height:1.35}
@media (max-width: 1200px){.public-home-layout{grid-template-columns:1fr}.story-list{max-height:none}.story-qr-dock{width:min(140px,28vw)}}
@media (max-width: 900px){.player-topbar{padding:12px 14px;font-size:.9rem}.player-overlay-caption{left:14px;right:14px;bottom:14px;padding:16px}.player-overlay-caption strong{font-size:1.45rem}.player-overlay-caption span{font-size:1rem;-webkit-line-clamp:5}.story-qr-dock{top:60px;right:12px}.wifi-panel{right:12px;bottom:64px}.wifi-cta{right:12px;bottom:12px}}

/* Pacote 15A */
.brand-with-logo{display:flex;align-items:center;gap:14px;min-width:0;margin-bottom:10px}.brand-logo{width:72px;height:72px;border-radius:18px;object-fit:contain;background:#fff;padding:6px;flex:none;box-shadow:0 10px 26px rgba(0,0,0,.22)}
.settings-section{padding:4px 0 2px;border-top:1px solid rgba(255,255,255,.08);margin-top:4px}.settings-section h3{margin-bottom:6px;font-size:1.08rem}
.preset-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px;align-items:stretch}.preset-card{width:100%;min-width:0;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:8px;text-align:left;white-space:normal;overflow-wrap:anywhere;word-break:normal;line-height:1.35;padding:16px 18px;border-radius:16px;background:linear-gradient(180deg,#5aa7ff,#3c7be0);color:#fff;box-shadow:0 12px 24px rgba(0,0,0,.18)}.preset-card strong,.preset-card span{display:block;max-width:100%}.preset-card strong{font-size:1.1rem}.preset-card span{font-weight:600;opacity:.96}
.public-home-layout{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(330px,.95fr);gap:18px;align-items:start}.story-detail-rich{display:grid;gap:12px;margin-top:18px}.detail-block{display:grid;gap:8px;padding:14px;border-radius:14px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.07)}.detail-block ul{margin:0;padding-left:1.1rem;display:grid;gap:6px}.detail-block-text{margin:0;color:#dbe4f1;line-height:1.55}.detail-meta-line{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:12px;background:rgba(255,255,255,.04)}
.story-list-item{transition:background .18s ease,border-color .18s ease,transform .18s ease}.story-list-item:hover{transform:translateY(-1px)}
.player-topbar{background:linear-gradient(180deg,rgba(2,6,23,.70),rgba(2,6,23,.15));font-size:1.02rem}.player-branding-inline{display:flex;align-items:center;gap:10px}.player-top-logo{width:36px;height:36px;border-radius:12px;object-fit:contain;background:#fff;padding:4px}.story-qr-dock{width:min(172px,23vw);padding:12px;border-radius:18px;background:rgba(15,23,42,.82);backdrop-filter:blur(10px)}.story-qr-dock img{width:100%;border-radius:12px;background:#fff;padding:8px}.stage-web{width:100%;height:100%;border:0;display:block;background:#020617}
.player-overlay-caption{max-width:min(74%,1160px);padding:20px 22px 18px;border-radius:18px;background:linear-gradient(180deg,rgba(2,6,23,.12),rgba(2,6,23,.82));z-index:6}.player-overlay-caption strong{font-size:1.78rem;line-height:1.12;max-width:28ch}.player-overlay-caption span{font-size:1.02rem;line-height:1.42;max-width:90ch;display:block;overflow:hidden}
.wifi-panel,.story-qr-dock,.offline-branding{box-shadow:0 16px 34px rgba(0,0,0,.32)}
.logo-upload-preview{display:flex;align-items:center;gap:12px;padding:12px;border-radius:14px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.07)}.logo-upload-preview img{width:72px;height:72px;border-radius:16px;object-fit:contain;background:#fff;padding:6px}
.button-row.wrap-row{display:flex;flex-wrap:wrap;gap:10px}.side-story-card h2{font-size:1.62rem}
@media (max-width:1200px){.public-home-layout{grid-template-columns:1fr}.player-overlay-caption{max-width:calc(100% - 48px)}.story-list{max-height:none}}
@media (max-width:900px){.brand-logo{width:58px;height:58px}.player-topbar{padding:12px 14px;font-size:.9rem}.player-overlay-caption{left:14px;right:14px;bottom:14px;padding:16px}.player-overlay-caption strong{font-size:1.38rem}.player-overlay-caption span{font-size:.96rem}.story-qr-dock{top:64px;right:12px;width:min(134px,32vw)}}

/* --- Pacote 15B: portal público e ajustes do painel --- */
.preset-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px;align-items:stretch}
.preset-grid > *{min-width:0;max-width:100%}
.preset-card{width:100%;min-width:0;max-width:100%;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:8px;text-align:left;white-space:normal;overflow:hidden;overflow-wrap:anywhere;word-break:break-word;line-height:1.35;padding:16px 18px;border-radius:16px;background:linear-gradient(180deg,#5aa7ff,#3c7be0);color:#fff;box-shadow:0 12px 24px rgba(0,0,0,.18)}
.preset-card strong,.preset-card span{display:block;max-width:100%;white-space:normal!important}
.preset-card span{font-weight:600;opacity:.96}

.portal-shell{max-width:1480px;padding:22px 22px 34px;margin:0 auto}
.portal-header{margin-bottom:18px}
.portal-top-grid{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(360px,.82fr);gap:18px;align-items:start;margin-bottom:20px}
.portal-top-grid-detail{grid-template-columns:minmax(0,1.12fr) minmax(360px,.8fr)}
.portal-story-hero{min-height:100%;display:grid;gap:14px;padding:22px}
.portal-hero-grid{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(320px,.9fr);gap:18px;align-items:start}
.portal-hero-copy{min-width:0}
.portal-story-hero h2{font-size:clamp(1.9rem,3vw,3rem);line-height:1.04;margin:0;max-width:18ch}
.portal-story-hero .muted{font-size:1.02rem;line-height:1.6;color:var(--muted)}
.portal-hero-media-shell{display:grid;align-items:start}
.portal-detail-media{position:relative;aspect-ratio:16/9;min-height:240px;border-radius:18px;overflow:hidden;background:#081224;border:1px solid rgba(255,255,255,.08)}
.portal-detail-media img,.portal-detail-media video,.portal-detail-media iframe{width:100%;height:100%;display:block;border:0;object-fit:cover;background:#020617}
.portal-detail-grid{display:grid;grid-template-columns:220px minmax(0,1fr);gap:18px;align-items:start}
.story-detail-rich{display:grid;gap:12px}
.story-detail-rich p{margin:0;color:var(--muted);line-height:1.6}
.detail-meta-line{display:flex;flex-wrap:wrap;gap:10px;align-items:center;padding:10px 12px;border-radius:14px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.06)}
.portal-player-card{position:sticky;top:18px;padding:16px}
.portal-player-frame{aspect-ratio:16/9;min-height:0}
.portal-sections{display:grid;gap:18px}
.portal-section-card{padding:18px}
.portal-section-card h2{margin-bottom:0}
.portal-card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.portal-story-card{display:grid;grid-template-rows:170px auto;gap:0;padding:0;border-radius:18px;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.035);color:var(--text);overflow:hidden;cursor:pointer;box-shadow:0 12px 24px rgba(0,0,0,.16);text-align:left}
.portal-story-card.compact{grid-template-rows:140px auto}
.portal-story-card:hover,.portal-story-card.active{border-color:rgba(90,167,255,.45);background:rgba(90,167,255,.09);transform:translateY(-1px)}
.portal-story-media{position:relative;background:#09101f}
.portal-story-media img{width:100%;height:100%;object-fit:cover;display:block}
.portal-play-badge{position:absolute;right:12px;bottom:12px;display:grid;place-items:center;width:38px;height:38px;border-radius:999px;background:rgba(2,6,23,.72);color:#fff;font-size:1rem;border:1px solid rgba(255,255,255,.2)}
.portal-story-copy{display:grid;gap:8px;padding:14px 16px 16px}
.portal-story-copy strong{font-size:1.05rem;line-height:1.22;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.portal-story-copy span:last-child{color:var(--muted);line-height:1.42;font-size:.95rem;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.story-mode .portal-story-hero h2{font-size:clamp(2.1rem,3.6vw,3.7rem)}
.detail-qr-box{display:grid;gap:10px;justify-items:center;padding:14px;border-radius:16px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08)}
.detail-qr-box img{width:180px;max-width:100%;padding:8px;background:#fff;border-radius:12px}
.player-topbar{background:linear-gradient(180deg,rgba(2,6,23,.78),rgba(2,6,23,.16));font-size:.98rem}
.player-overlay-caption{max-width:min(72%,920px)}
.player-overlay-caption strong{font-size:1.8rem;line-height:1.08}
.player-overlay-caption span{font-size:1.05rem;line-height:1.45}
.story-qr-dock{width:min(170px,24vw);top:74px;right:18px}
.wifi-panel{right:18px;bottom:64px}
.wifi-cta{right:18px;bottom:18px}
.logo-upload-preview{display:flex;gap:14px;align-items:center;padding:14px;border-radius:14px;background:rgba(255,255,255,.04);border:1px dashed rgba(255,255,255,.12)}
.logo-upload-preview img{width:88px;height:88px;object-fit:contain;border-radius:16px;background:#fff;padding:8px}

@media (max-width:1280px){
  .portal-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:1180px){
  .portal-top-grid,.portal-top-grid-detail,.portal-hero-grid,.portal-detail-grid{grid-template-columns:1fr}
  .portal-player-card{position:relative;top:auto}
}
@media (max-width:900px){
  .portal-shell{padding:18px}
  .portal-story-hero{padding:18px}
  .portal-story-hero h2{font-size:2rem}
  .portal-card-grid{grid-template-columns:1fr}
  .player-overlay-caption{max-width:calc(100% - 32px)}
}

/* --- Pacote 15K: refatoração completa do portal público --- */
.portal-shell-v3{max-width:1600px;padding:24px 24px 40px;margin:0 auto}
.portal-header-v3{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:22px}
.portal-title-stack{max-width:980px}
.portal-title-stack .eyebrow{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;background:rgba(90,167,255,.12);border:1px solid rgba(90,167,255,.22);color:#cfe0ff;font-size:.88rem;font-weight:700;letter-spacing:.02em;text-transform:uppercase;margin-bottom:12px}
.portal-title-stack h1{font-size:clamp(2rem,3.6vw,3.35rem);line-height:1.04;margin:0 0 12px;max-width:24ch}
.portal-title-stack p{margin:0;max-width:78ch;font-size:1.02rem;line-height:1.55}
.portal-shell-v3 .portal-top-grid{grid-template-columns:minmax(0,1.28fr) minmax(380px,.9fr);gap:20px;align-items:start;margin-bottom:24px}
.portal-shell-v3.story-mode .portal-top-grid{grid-template-columns:minmax(0,1.34fr) minmax(360px,.82fr)}
.portal-story-hero-v3{padding:24px;background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(255,255,255,.03));}
.portal-shell-v3 .portal-hero-grid{grid-template-columns:minmax(0,1fr) minmax(380px,.92fr);gap:20px;align-items:start}
.portal-shell-v3.story-mode .portal-hero-grid{grid-template-columns:minmax(0,1fr)}
.portal-shell-v3 .portal-story-hero h2{font-size:clamp(2rem,4vw,4rem);line-height:1.02;max-width:14ch;margin:0 0 8px}
.portal-shell-v3 .portal-story-hero .muted{font-size:1.06rem;line-height:1.68;max-width:70ch}
.portal-shell-v3 .portal-detail-media{min-height:320px;border-radius:22px;background:#0b1328;border:1px solid rgba(255,255,255,.08);box-shadow:inset 0 0 0 1px rgba(255,255,255,.02)}
.portal-shell-v3 .portal-detail-grid{grid-template-columns:250px minmax(0,1fr);gap:20px;margin-top:20px}
.portal-shell-v3.story-mode .portal-detail-grid{grid-template-columns:260px minmax(0,1fr)}
.portal-shell-v3 .detail-qr-box{justify-items:center;padding:18px;border-radius:20px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08)}
.portal-shell-v3 .detail-qr-box img{width:192px;padding:10px;border-radius:16px;background:#fff}
.portal-shell-v3 .story-detail-rich{display:grid;gap:14px;align-content:start}
.portal-shell-v3 .detail-block,.portal-shell-v3 .detail-meta-line{background:rgba(255,255,255,.035);border:1px solid rgba(255,255,255,.07);border-radius:18px}
.portal-shell-v3 .detail-block{padding:16px 18px}
.portal-shell-v3 .detail-block-text{font-size:1rem;line-height:1.68;color:#d8e2f7}
.portal-shell-v3 .detail-meta-line{padding:12px 14px}
.portal-shell-v3 .portal-player-card{position:sticky;top:16px;padding:14px 14px 16px;overflow:hidden}
.portal-shell-v3 .portal-player-frame{aspect-ratio:9/16;min-height:760px}
.portal-shell-v3 .tv-stage{min-height:760px;border-radius:22px}
.portal-shell-v3 .player-overlay-caption{max-width:calc(100% - 32px);left:16px;right:16px;bottom:18px;padding:18px 18px 16px;border-radius:18px;background:linear-gradient(180deg,rgba(2,6,23,.14),rgba(2,6,23,.84))}
.portal-shell-v3 .player-overlay-caption strong{font-size:1.25rem;line-height:1.12;max-width:none}
.portal-shell-v3 .player-overlay-caption span{font-size:.96rem;line-height:1.42;max-width:none}
.portal-shell-v3 .player-topbar{padding:14px 16px;font-size:.96rem}
.portal-shell-v3 .story-qr-dock{top:68px;right:14px;width:168px;padding:12px 12px 10px}
.portal-shell-v3 .story-qr-dock img{padding:8px}
.portal-shell-v3 .wifi-cta{right:14px;bottom:14px}
.portal-shell-v3 .wifi-panel{right:14px;bottom:60px}
.portal-shell-v3 .portal-sections{display:grid;gap:22px}
.portal-shell-v3.story-mode .portal-sections{grid-template-columns:1fr 1fr;align-items:start}
.portal-shell-v3.story-mode #newsSectionWrap{grid-column:1 / -1}
.portal-shell-v3 .portal-section-card{padding:20px}
.portal-shell-v3 .compact-header{margin-bottom:16px}
.portal-shell-v3 .compact-header h2{font-size:1.7rem;line-height:1.1;margin:0 0 4px}
.portal-shell-v3 .portal-card-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.portal-shell-v3 .portal-card-grid-featured{grid-template-columns:repeat(3,minmax(0,1fr))}
.portal-shell-v3 .portal-story-card{grid-template-rows:190px auto;border-radius:22px;transition:transform .18s ease,border-color .18s ease,background .18s ease;box-shadow:none;background:rgba(255,255,255,.04)}
.portal-shell-v3 .portal-story-card.compact{grid-template-rows:170px auto}
.portal-shell-v3 .portal-story-card:hover,.portal-shell-v3 .portal-story-card.active{transform:translateY(-2px);border-color:rgba(90,167,255,.42);background:rgba(90,167,255,.08)}
.portal-shell-v3 .portal-story-media{aspect-ratio:16/9;min-height:190px;background:#091428}
.portal-shell-v3 .portal-story-media img{width:100%;height:100%;object-fit:cover;background:#091428}
.portal-shell-v3 .portal-story-copy{padding:16px 18px 18px;gap:10px}
.portal-shell-v3 .portal-story-copy .tag{width:max-content}
.portal-shell-v3 .portal-story-copy strong{font-size:1.08rem;line-height:1.24;-webkit-line-clamp:3}
.portal-shell-v3 .portal-story-copy span:last-child{font-size:.95rem;line-height:1.48;-webkit-line-clamp:4}
.portal-shell-v3.story-mode .portal-story-copy strong{font-size:1.02rem}
.portal-shell-v3 .portal-detail-video,.portal-shell-v3 .portal-detail-iframe{border-radius:22px}
.portal-shell-v3 .soft-spacing{margin-top:0}
@media (max-width:1440px){.portal-shell-v3 .portal-card-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.portal-shell-v3 .portal-card-grid-featured{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:1220px){.portal-shell-v3 .portal-top-grid,.portal-shell-v3.story-mode .portal-top-grid{grid-template-columns:1fr}.portal-shell-v3 .portal-player-card{position:relative;top:auto}.portal-shell-v3 .portal-player-frame,.portal-shell-v3 .tv-stage{min-height:540px;aspect-ratio:16/9}.portal-shell-v3.story-mode .portal-sections{grid-template-columns:1fr}.portal-shell-v3 .portal-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:900px){.portal-shell-v3{padding:18px 14px 28px}.portal-header-v3{flex-direction:column;align-items:flex-start}.portal-shell-v3 .portal-hero-grid,.portal-shell-v3 .portal-detail-grid{grid-template-columns:1fr}.portal-shell-v3 .portal-detail-media{min-height:240px}.portal-shell-v3 .portal-story-hero h2{font-size:2.2rem}.portal-shell-v3 .portal-card-grid,.portal-shell-v3 .portal-card-grid-featured{grid-template-columns:1fr}.portal-shell-v3 .player-overlay-caption{left:12px;right:12px;bottom:12px;padding:14px}.portal-shell-v3 .story-qr-dock{width:132px;top:60px;right:10px}.portal-shell-v3 .portal-player-frame,.portal-shell-v3 .tv-stage{min-height:420px}}

/* Pacote 15L / v4 portal refresh */
.portal-shell-v4{max-width:1480px;margin:0 auto;padding:20px 20px 36px;display:grid;gap:18px}
.portal-header-v4{display:flex;align-items:flex-end;justify-content:space-between;gap:18px}
.portal-header-copy{max-width:980px}
.portal-header-copy .eyebrow{display:inline-flex;align-items:center;padding:8px 12px;border-radius:999px;background:rgba(90,167,255,.12);border:1px solid rgba(90,167,255,.22);color:#d6e4ff;font-size:.85rem;font-weight:700;letter-spacing:.02em;text-transform:uppercase;margin-bottom:12px}
.portal-header-copy h1{margin:0 0 12px;font-size:clamp(1.9rem,3.4vw,3.1rem);line-height:1.04;max-width:18ch}
.portal-header-copy p{margin:0;max-width:74ch;font-size:1.02rem;line-height:1.6;color:var(--muted)}
.portal-layout-v4{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(360px,.92fr);gap:18px;align-items:start}
.portal-main-v4{display:grid;gap:18px;min-width:0}
.portal-player-card-v4{position:sticky;top:14px;padding:12px;overflow:hidden}
.portal-player-frame-v4{aspect-ratio:9/16;min-height:680px}
.portal-shell-v4 .tv-stage{min-height:680px;border-radius:22px}
.portal-shell-v4 .player-overlay-caption{max-width:calc(100% - 32px);left:16px;right:16px;bottom:18px;padding:18px 18px 16px;border-radius:18px;background:linear-gradient(180deg,rgba(2,6,23,.14),rgba(2,6,23,.84))}
.portal-shell-v4 .player-overlay-caption strong{font-size:1.22rem;line-height:1.12;max-width:none}
.portal-shell-v4 .player-overlay-caption span{font-size:.96rem;line-height:1.42;max-width:none}
.portal-shell-v4 .player-topbar{padding:14px 16px;font-size:.96rem}
.portal-shell-v4 .story-qr-dock{top:68px;right:14px;width:168px;padding:12px 12px 10px}
.portal-shell-v4 .story-qr-dock img{padding:8px}
.portal-shell-v4 .wifi-cta{right:14px;bottom:14px}
.portal-shell-v4 .wifi-panel{right:14px;bottom:60px}
.portal-hero-v4{display:grid;grid-template-columns:minmax(0,1.02fr) minmax(300px,.98fr);gap:18px;padding:20px;background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(255,255,255,.03))}
.portal-hero-copy-v4{display:grid;align-content:start;gap:12px;min-width:0}
.portal-hero-copy-v4 h2{margin:0;font-size:clamp(1.8rem,3.1vw,3rem);line-height:1.05;max-width:14ch}
.portal-hero-copy-v4 .muted{font-size:1rem;line-height:1.58;color:var(--muted);max-width:62ch}
.portal-hero-media-v4{min-height:260px;border-radius:20px;overflow:hidden;background:#081224;border:1px solid rgba(255,255,255,.08)}
.portal-hero-media-v4 img,.portal-hero-media-v4 video,.portal-hero-media-v4 iframe{display:block;width:100%;height:100%;object-fit:cover;background:#020617;border:0}
.portal-story-extras-v4{display:grid;grid-template-columns:220px minmax(0,1fr);gap:16px;padding:16px}
.portal-shell-v4 .detail-qr-box{justify-items:center;padding:18px;border-radius:20px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08)}
.portal-shell-v4 .detail-qr-box img{width:192px;padding:10px;border-radius:16px;background:#fff}
.portal-shell-v4 .story-detail-rich{display:grid;gap:12px;align-content:start}
.portal-shell-v4 .detail-block,.portal-shell-v4 .detail-meta-line{background:rgba(255,255,255,.035);border:1px solid rgba(255,255,255,.07);border-radius:18px}
.portal-shell-v4 .detail-block{padding:16px 18px}
.portal-shell-v4 .detail-block-text{font-size:1rem;line-height:1.68;color:#d8e2f7;margin:0}
.portal-shell-v4 .detail-meta-line{padding:12px 14px}
.portal-section-card-v4{padding:16px}
.section-head-v4{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:14px}
.section-head-v4 h2{margin:0 0 4px;font-size:1.55rem;line-height:1.08}
.section-head-v4 p{margin:0;color:var(--muted)}
.portal-card-grid-v4{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.portal-card-grid-featured-v4{grid-template-columns:repeat(2,minmax(0,1fr))}
.portal-story-card-v4{display:grid;grid-template-columns:120px minmax(0,1fr);gap:12px;align-items:stretch;padding:12px;border-radius:18px;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.035);color:var(--text);overflow:hidden;cursor:pointer;box-shadow:none;text-align:left;transition:transform .16s ease,border-color .16s ease,background .16s ease}
.portal-story-card-v4:hover,.portal-story-card-v4.active{transform:translateY(-1px);border-color:rgba(90,167,255,.42);background:rgba(90,167,255,.08)}
.portal-story-thumb-v4{position:relative;border-radius:14px;overflow:hidden;background:#091428;min-height:84px}
.portal-story-thumb-v4 img{display:block;width:100%;height:100%;object-fit:cover;background:#091428}
.portal-story-copy-v4{display:grid;align-content:start;gap:8px;min-width:0}
.portal-story-copy-v4 strong{font-size:1rem;line-height:1.24;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.portal-story-copy-v4 span:last-child{color:var(--muted);line-height:1.4;font-size:.92rem;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.portal-shell-v4 .portal-play-badge{position:absolute;right:10px;bottom:10px;display:grid;place-items:center;width:34px;height:34px;border-radius:999px;background:rgba(2,6,23,.72);color:#fff;font-size:.95rem;border:1px solid rgba(255,255,255,.2)}
.portal-shell-v4.story-mode .portal-layout-v4{grid-template-columns:minmax(0,1fr) minmax(360px,.76fr)}
.portal-shell-v4.story-mode .portal-main-v4{gap:18px}
.portal-shell-v4.story-mode .portal-hero-v4{grid-template-columns:1fr}
.portal-shell-v4.story-mode .portal-hero-copy-v4 h2{max-width:none}
.portal-shell-v4.story-mode .portal-card-grid-v4{grid-template-columns:repeat(2,minmax(0,1fr))}
@media (max-width:1320px){.portal-layout-v4,.portal-shell-v4.story-mode .portal-layout-v4{grid-template-columns:1fr}.portal-player-card-v4{position:relative;top:auto}.portal-player-frame-v4,.portal-shell-v4 .tv-stage{min-height:520px;aspect-ratio:16/9}}
@media (max-width:980px){.portal-shell-v4{padding:16px 12px 24px}.portal-header-v4{flex-direction:column;align-items:flex-start}.portal-hero-v4,.portal-story-extras-v4{grid-template-columns:1fr}.portal-hero-media-v4{min-height:220px}.portal-card-grid-v4,.portal-card-grid-featured-v4,.portal-shell-v4.story-mode .portal-card-grid-v4{grid-template-columns:1fr}.portal-story-card-v4{grid-template-columns:104px minmax(0,1fr)}.portal-shell-v4 .story-qr-dock{width:132px;top:60px;right:10px}.portal-shell-v4 .player-overlay-caption{left:12px;right:12px;bottom:12px;padding:14px}.portal-player-frame-v4,.portal-shell-v4 .tv-stage{min-height:400px}.portal-hero-copy-v4 h2{font-size:2.1rem}}

.portal-story-card-v4.is-generic-visual{border-color:rgba(255,255,255,.05)}
.portal-story-card-v4.has-real-visual .portal-story-thumb-v4{box-shadow:inset 0 0 0 1px rgba(90,167,255,.12)}
