/*
 * Painel de Aulas — acabamento visual v5
 * Otimizado para leitura a distância em TVs 16:9 de 70 polegadas.
 */

:root {
    --senac-orange: #f7941d;
    --senac-orange-soft: #ffc46b;
    --senac-orange-deep: #df7200;
    --senac-blue: #004c99;
    --senac-blue-vivid: #005ca9;
    --senac-blue-bright: #2f9bff;
    --tv-bg: #020813;
    --tv-surface: #08172a;
    --tv-surface-raised: #0d1f35;
    --tv-text: #f5f9ff;
    --tv-text-soft: #bdd0e5;
    --tv-text-muted: #7890aa;
    --tv-success: #35d28c;
    --tv-danger: #fb7185;
    --tv-amber: #fbbf24;
    --tv-night: #60a5fa;
    --tv-city: #5eead4;
    --tv-border: rgba(141, 190, 237, 0.2);
    --tv-border-strong: rgba(91, 168, 240, 0.34);
    --tv-panel-shadow: 0 18px 46px rgba(0, 0, 0, 0.3);
}

html,
body {
    background: var(--tv-bg);
}

body {
    color: var(--tv-text);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.bg-layer {
    background:
        radial-gradient(ellipse 54% 44% at 5% -4%, rgba(247, 148, 29, 0.2), transparent 66%),
        radial-gradient(ellipse 62% 54% at 102% 108%, rgba(0, 92, 169, 0.34), transparent 68%),
        linear-gradient(112deg, transparent 0 47%, rgba(47, 155, 255, 0.035) 47% 48%, transparent 48% 100%),
        linear-gradient(rgba(89, 153, 215, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(89, 153, 215, 0.04) 1px, transparent 1px),
        linear-gradient(145deg, #020813 0%, #051325 54%, #03101f 100%);
    background-size: auto, auto, auto, 72px 72px, 72px 72px, auto;
}

.bg-layer::before {
    content: '';
    position: absolute;
    left: -8vw;
    top: 18vh;
    width: 32vw;
    height: 7px;
    transform: rotate(-18deg);
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(247, 148, 29, 0.35), transparent);
    box-shadow: 0 0 28px rgba(247, 148, 29, 0.16);
}

/* Cabeçalho com os elementos essenciais priorizados */
.header {
    height: clamp(112px, 6vw, 210px);
    padding-inline: clamp(22px, 1.65vw, 58px);
    background:
        linear-gradient(100deg, rgba(247, 148, 29, 0.055), transparent 27%),
        linear-gradient(180deg, rgba(4, 16, 31, 0.995), rgba(3, 12, 24, 0.985));
    border-bottom: 1px solid rgba(92, 160, 224, 0.2);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.header::before {
    width: 38%;
    height: 4px;
    background: linear-gradient(90deg, var(--senac-orange), rgba(247, 148, 29, 0.48), transparent);
}

.header::after {
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--senac-orange) 0%,
        var(--senac-orange-soft) 31%,
        var(--senac-blue-bright) 70%,
        var(--senac-blue) 100%
    );
    box-shadow: 0 0 18px rgba(47, 155, 255, 0.22);
}

.logo-wrap {
    height: clamp(66px, 3.75vw, 126px);
    padding: clamp(8px, 0.55vw, 18px) clamp(14px, 0.8vw, 28px);
    border-radius: clamp(15px, 0.85vw, 26px);
    border: 2px solid rgba(247, 148, 29, 0.28);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.28),
        0 0 26px rgba(247, 148, 29, 0.13);
}

.logo-img {
    height: clamp(46px, 2.65vw, 88px);
}

.header-sep {
    height: clamp(58px, 3.4vw, 108px);
    margin-inline: clamp(16px, 1.1vw, 34px);
}

.header-title {
    column-gap: clamp(16px, 1.15vw, 36px);
}

.header-title h1 {
    font-size: clamp(1.55rem, 1.72vw, 2.3rem);
    letter-spacing: 0.045em;
}

.header-title h2 {
    margin-top: 8px;
    font-size: clamp(0.78rem, 0.82vw, 1.18rem);
    letter-spacing: 0.13em;
    color: var(--senac-orange-soft);
}

.view-context {
    min-width: clamp(182px, 10.5vw, 340px);
    min-height: clamp(62px, 3.55vw, 116px);
    padding: clamp(10px, 0.65vw, 20px) clamp(15px, 0.85vw, 28px);
    border-left-width: 4px;
    border-radius: 0 16px 16px 0;
    background:
        linear-gradient(90deg, rgba(247, 148, 29, 0.2), rgba(247, 148, 29, 0.035));
    box-shadow: inset 0 0 0 1px rgba(247, 148, 29, 0.08);
}

.view-context strong {
    font-size: clamp(0.95rem, 0.88vw, 1.3rem);
    letter-spacing: 0.09em;
}

.view-context span {
    margin-top: 5px;
    font-size: clamp(0.72rem, 0.68vw, 1rem);
    color: var(--tv-text-soft);
}

.header-right {
    gap: clamp(8px, 0.65vw, 20px);
}

/* Clima temático — a cor acompanha a condição retornada pela API */
.weather-widget {
    position: relative;
    isolation: isolate;
    display: flex !important;
    min-width: clamp(184px, 10.4vw, 340px);
    height: clamp(76px, 4.25vw, 142px);
    min-height: 0;
    padding: clamp(7px, 0.45vw, 14px) clamp(12px, 0.72vw, 23px)
             clamp(7px, 0.45vw, 14px) clamp(7px, 0.42vw, 14px);
    gap: clamp(7px, 0.45vw, 14px);
    overflow: hidden;
    opacity: 1;
    pointer-events: auto;
    border: 2px solid rgba(47, 155, 255, 0.34);
    border-radius: clamp(18px, 1vw, 30px);
    color: #fff;
    background: linear-gradient(135deg, #074d89, #08233d);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
    transition: background 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease;
}

.weather-widget::before {
    content: '';
    position: absolute;
    z-index: -1;
    right: -24%;
    top: -65%;
    width: 78%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.13);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.08);
}

.weather-widget::after {
    content: '';
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: 0;
    height: 3px;
    border-radius: 99px 99px 0 0;
    background: rgba(255, 255, 255, 0.46);
}

.weather-visual {
    position: relative;
    display: grid;
    place-items: center;
    width: clamp(58px, 3.2vw, 106px);
    height: clamp(58px, 3.2vw, 106px);
    flex: 0 0 auto;
}

.weather-icon-img {
    position: relative;
    z-index: 2;
    width: clamp(58px, 3.3vw, 110px);
    height: clamp(58px, 3.3vw, 110px);
    object-fit: contain;
    filter: drop-shadow(0 7px 8px rgba(0, 0, 0, 0.22));
}

.weather-fallback-icon {
    position: absolute;
    z-index: 1;
    display: none;
    font-size: clamp(2.25rem, 2.45vw, 4rem);
    line-height: 1;
    text-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.weather-widget.icon-fallback .weather-icon-img,
.weather-widget.is-loading .weather-icon-img {
    display: none;
}

.weather-widget.icon-fallback .weather-fallback-icon,
.weather-widget.is-loading .weather-fallback-icon {
    display: block;
}

.weather-widget.is-loading .weather-fallback-icon {
    opacity: 0.55;
}

.weather-info {
    position: relative;
    z-index: 2;
    min-width: 0;
    gap: 1px;
}

.weather-eyebrow {
    display: block;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(0.59rem, 0.54vw, 0.8rem);
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
}

.weather-temp {
    font-size: clamp(1.85rem, 1.75vw, 2.65rem);
    line-height: 0.93;
    letter-spacing: -0.06em;
    color: #fff;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.weather-desc {
    max-width: clamp(90px, 5.3vw, 180px);
    margin-top: 3px;
    font-size: clamp(0.68rem, 0.62vw, 0.94rem);
    line-height: 1.05;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
}

.weather-widget[data-weather='clear'] {
    color: var(--tv-bg);
    border-color: rgba(255, 219, 143, 0.88);
    background: linear-gradient(135deg, #f7941d 0%, #fbbf24 58%, #ffd68a 100%);
    box-shadow: 0 12px 30px rgba(247, 148, 29, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.weather-widget[data-weather='clear'] .weather-temp,
.weather-widget[data-weather='clear'] .weather-desc,
.weather-widget[data-weather='clear'] .weather-eyebrow {
    color: #17202b;
    text-shadow: none;
}

.weather-widget[data-weather='clear'] .weather-eyebrow { opacity: 0.76; }
.weather-widget[data-weather='clear']::after { background: rgba(23, 32, 43, 0.38); }

.weather-widget[data-weather='partly-cloudy'] {
    border-color: rgba(135, 207, 255, 0.68);
    background: linear-gradient(135deg, #0074bd, #2f9bff 62%, #6cc8ff);
}

.weather-widget[data-weather='cloudy'] {
    border-color: rgba(166, 205, 238, 0.55);
    background: linear-gradient(135deg, #315a7d, #547b9d 62%, #7698b5);
}

.weather-widget[data-weather='rain'] {
    border-color: rgba(71, 174, 255, 0.58);
    background: linear-gradient(135deg, #004c99, #075080 56%, #0b263f);
}

.weather-widget[data-weather='storm'] {
    border-color: rgba(255, 196, 107, 0.7);
    background: linear-gradient(135deg, #322b68, #194a79 58%, #10223e);
    box-shadow: 0 12px 30px rgba(21, 55, 104, 0.32), inset 4px 0 0 var(--senac-orange);
}

.weather-widget[data-weather='snow'],
.weather-widget[data-weather='mist'] {
    border-color: rgba(94, 234, 212, 0.55);
    background: linear-gradient(135deg, #28627a, #3a8190 55%, #5aa6a7);
}

.weather-widget[data-period='night'] {
    border-color: rgba(121, 158, 255, 0.52);
    background: linear-gradient(135deg, #111d4d 0%, #153a68 56%, #07172c 100%);
}

.weather-widget[data-period='night']::before {
    background: rgba(164, 190, 255, 0.18);
}

.weather-widget[data-period='night'] .weather-temp,
.weather-widget[data-period='night'] .weather-desc,
.weather-widget[data-period='night'] .weather-eyebrow {
    color: #fff;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
}

.weather-widget.is-stale {
    border-color: var(--senac-orange-soft);
    box-shadow: 0 0 0 2px rgba(247, 148, 29, 0.22), 0 12px 28px rgba(0, 0, 0, 0.24);
}

.weather-widget.is-error {
    border-color: rgba(251, 113, 133, 0.48);
    background: linear-gradient(135deg, #46233a, #192033);
}

/* Controles auxiliares do cabeçalho */
.qr-mic-wrap {
    min-width: clamp(70px, 4vw, 128px);
    min-height: clamp(76px, 4.25vw, 142px);
    padding: clamp(5px, 0.35vw, 11px);
    border: 2px solid rgba(247, 148, 29, 0.46);
    border-radius: clamp(16px, 0.9vw, 28px);
    background: linear-gradient(160deg, #fff 0%, #f5f8fb 100%);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.qr-mic-img {
    width: clamp(54px, 3vw, 100px);
    height: clamp(54px, 3vw, 100px);
}

.qr-mic-label {
    max-width: 92px;
    font-size: clamp(0.5rem, 0.45vw, 0.7rem);
    font-weight: 900;
    line-height: 1.05;
    color: #7a3e00;
}

#model-loader-pill {
    min-height: 38px !important;
    padding: 7px 11px !important;
    border-color: rgba(47, 155, 255, 0.3) !important;
    color: #9ed1ff !important;
    background: rgba(0, 76, 153, 0.15) !important;
    box-shadow: inset 0 0 0 1px rgba(47, 155, 255, 0.05) !important;
}

.sync-pill {
    min-height: 38px;
    border-color: rgba(126, 177, 226, 0.2);
}

.sync-text {
    font-size: clamp(0.62rem, 0.55vw, 0.8rem);
}

.clock-block {
    min-width: clamp(126px, 7.25vw, 240px);
}

.clock-time {
    font-size: clamp(2.75rem, 2.9vw, 4.7rem);
    color: #fff;
    text-shadow: 0 7px 24px rgba(0, 76, 153, 0.35);
}

.clock-date {
    max-width: none;
    margin-top: 5px;
    font-size: clamp(0.74rem, 0.68vw, 1rem);
    font-weight: 650;
    color: var(--tv-text-soft);
}

/* Grade com mais respiro e leitura à distância */
.main-board {
    gap: clamp(12px, 0.8vw, 28px);
    padding: clamp(14px, 0.9vw, 32px);
    background:
        linear-gradient(180deg, rgba(3, 12, 24, 0.12), rgba(2, 8, 19, 0.62));
}

.main-board.has-media-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(clamp(300px, 16vw, 580px), 0.92fr);
}

.main-board.has-city-panel:not(.has-media-panel) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(clamp(285px, 15vw, 540px), 0.86fr);
}

.main-board.has-city-panel.has-media-panel {
    grid-template-columns:
        repeat(3, minmax(0, 1fr))
        minmax(clamp(270px, 14.2vw, 520px), 0.82fr)
        minmax(clamp(295px, 15.5vw, 565px), 0.9fr);
}

.shift-col,
.slide-panel {
    border-width: 2px;
    border-color: var(--tv-border);
    border-radius: clamp(20px, 1.15vw, 36px);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 34%),
        linear-gradient(180deg, rgba(12, 32, 55, 0.985), rgba(5, 17, 32, 0.99));
    box-shadow: var(--tv-panel-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.shift-col::before {
    content: '';
    position: absolute;
    top: 0;
    left: 7%;
    right: 7%;
    z-index: 3;
    height: clamp(4px, 0.24vw, 8px);
    border-radius: 0 0 99px 99px;
}

.col-manha { border-color: rgba(247, 148, 29, 0.34); }
.col-tarde { border-color: rgba(251, 191, 36, 0.3); }
.col-noite { border-color: rgba(47, 155, 255, 0.34); }
.col-manha::before { background: linear-gradient(90deg, transparent, var(--senac-orange), transparent); }
.col-tarde::before { background: linear-gradient(90deg, transparent, var(--tv-amber), transparent); }
.col-noite::before { background: linear-gradient(90deg, transparent, var(--senac-blue-bright), transparent); }

.shift-header {
    min-height: clamp(86px, 4.8vw, 150px);
    padding: clamp(13px, 0.8vw, 26px);
    gap: clamp(10px, 0.58vw, 18px);
    border-bottom-color: rgba(145, 189, 232, 0.18);
}

.col-manha .shift-header {
    background: linear-gradient(112deg, rgba(247, 148, 29, 0.24), rgba(247, 148, 29, 0.04) 74%);
}

.col-tarde .shift-header {
    background: linear-gradient(112deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.035) 74%);
}

.col-noite .shift-header {
    background: linear-gradient(112deg, rgba(0, 92, 169, 0.35), rgba(47, 155, 255, 0.045) 74%);
}

.shift-icon {
    width: clamp(42px, 2.35vw, 76px);
    height: clamp(42px, 2.35vw, 76px);
    flex-basis: clamp(42px, 2.35vw, 76px);
    font-size: clamp(1.35rem, 1.25vw, 2rem);
    border-radius: clamp(13px, 0.72vw, 22px);
    background: rgba(255, 255, 255, 0.085);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.11), 0 8px 18px rgba(0, 0, 0, 0.13);
}

.shift-title {
    font-size: clamp(1.12rem, 1.08vw, 1.62rem);
    letter-spacing: 0.11em;
}

.shift-badge {
    padding: clamp(5px, 0.32vw, 10px) clamp(9px, 0.5vw, 16px);
    font-size: clamp(0.66rem, 0.58vw, 0.86rem);
    font-weight: 800;
    color: var(--tv-text-soft);
    border-color: rgba(172, 205, 236, 0.22);
}

.free-rooms-container {
    padding: 6px 9px;
    border: 1px solid rgba(145, 189, 232, 0.13);
    background: rgba(1, 8, 17, 0.52);
}

.free-rooms-label {
    font-size: clamp(0.58rem, 0.5vw, 0.74rem);
    color: #a1b5ca;
}

.marquee-content {
    font-size: clamp(0.69rem, 0.6vw, 0.88rem);
    color: #d4e1ee;
}

.shift-body {
    padding: clamp(11px, 0.68vw, 22px);
    gap: clamp(10px, 0.65vw, 21px);
}

/* Cards neutros com leitura forte e cores de turno apenas como orientação */
.tv-card {
    min-height: clamp(154px, 7.8vw, 300px);
    padding: clamp(15px, 0.9vw, 29px) clamp(15px, 0.85vw, 28px)
             clamp(14px, 0.82vw, 27px) clamp(20px, 1.12vw, 38px);
    border-color: rgba(159, 197, 233, 0.2);
    border-radius: clamp(17px, 0.9vw, 28px);
    background:
        linear-gradient(112deg, rgba(255, 255, 255, 0.045), transparent 42%),
        rgba(11, 30, 51, 0.96);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.19), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.col-manha .tv-card {
    background:
        linear-gradient(112deg, rgba(247, 148, 29, 0.085), transparent 43%),
        rgba(11, 30, 51, 0.96);
}

.col-tarde .tv-card {
    background:
        linear-gradient(112deg, rgba(251, 191, 36, 0.07), transparent 43%),
        rgba(11, 30, 51, 0.96);
}

.col-noite .tv-card {
    background:
        linear-gradient(112deg, rgba(47, 155, 255, 0.095), transparent 43%),
        rgba(11, 30, 51, 0.96);
}

.tv-card::before {
    top: 14px;
    bottom: 14px;
    left: 6px;
    width: clamp(4px, 0.25vw, 8px);
}

.tv-card.live-now {
    border-color: rgba(53, 210, 140, 0.55);
    background:
        linear-gradient(118deg, rgba(53, 210, 140, 0.18), rgba(11, 30, 51, 0.97) 58%);
    box-shadow: 0 0 0 2px rgba(53, 210, 140, 0.08), 0 16px 34px rgba(0, 0, 0, 0.22);
}

.card-topline {
    min-height: clamp(22px, 1.2vw, 39px);
    padding-right: clamp(70px, 4vw, 134px);
    margin-bottom: clamp(5px, 0.36vw, 11px);
    gap: 7px;
}

.card-kicker,
.city-chip,
.shift-chip {
    min-height: clamp(22px, 1.2vw, 38px);
    padding: 4px 9px;
    font-size: clamp(0.65rem, 0.59vw, 0.88rem);
}

.card-kicker {
    color: #b8cbe0;
}

.card-title {
    margin-bottom: clamp(7px, 0.42vw, 13px);
    font-size: clamp(1.03rem, 1.07vw, 1.62rem);
    line-height: 1.2;
    color: #fff;
}

.card-instructor {
    margin-bottom: clamp(9px, 0.55vw, 18px);
    gap: 7px;
    font-size: clamp(0.8rem, 0.76vw, 1.15rem);
    font-weight: 600;
    color: #b7d5f2;
}

.card-instructor > span {
    font-size: clamp(0.5rem, 0.43vw, 0.68rem);
}

.card-meta {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: clamp(7px, 0.45vw, 14px);
    padding: 0;
    border: 0;
    background: transparent;
}

.meta-item {
    min-width: 0;
    padding: clamp(7px, 0.44vw, 14px) clamp(9px, 0.55vw, 18px);
    border: 1px solid rgba(134, 181, 224, 0.18);
    border-radius: clamp(10px, 0.58vw, 18px);
    background: rgba(1, 9, 19, 0.48);
}

.meta-label {
    font-size: clamp(0.62rem, 0.55vw, 0.82rem);
    color: #99aec4;
}

.meta-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(0.84rem, 0.77vw, 1.15rem);
    font-weight: 750;
    color: #fff;
}

.live-badge {
    top: clamp(13px, 0.75vw, 24px);
    right: clamp(12px, 0.72vw, 23px);
    padding: clamp(5px, 0.32vw, 10px) clamp(8px, 0.45vw, 15px);
    font-size: clamp(0.58rem, 0.5vw, 0.74rem);
}

.weekly-view .tv-card {
    min-height: clamp(148px, 7.2vw, 280px);
}

.weekly-view .card-title {
    font-size: clamp(0.98rem, 0.98vw, 1.48rem);
}

.compact-card {
    min-height: clamp(154px, 7.8vw, 300px);
}

.empty-state {
    min-height: clamp(210px, 16vh, 360px);
}

.empty-icon {
    font-size: clamp(1.7rem, 1.5vw, 2.5rem);
}

.empty-text {
    font-size: clamp(0.86rem, 0.78vw, 1.15rem);
    color: #a6bad0;
}

/* Cidade e galeria preservam a mesma hierarquia visual dos turnos */
.city-panel {
    border-color: rgba(94, 234, 212, 0.34);
}

.city-panel::before {
    background: linear-gradient(90deg, transparent, var(--tv-city), transparent);
}

.city-header {
    background: linear-gradient(112deg, rgba(45, 212, 191, 0.24), rgba(0, 92, 169, 0.06) 78%);
}

.city-header .shift-title {
    color: #a5fff1;
}

.city-panel-subtitle {
    max-width: clamp(145px, 8vw, 270px);
    font-size: clamp(0.64rem, 0.56vw, 0.84rem);
    color: #a4d4d2;
}

.slide-panel {
    border-color: rgba(47, 155, 255, 0.34);
}

.slide-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 7%;
    right: 7%;
    z-index: 3;
    height: clamp(4px, 0.24vw, 8px);
    border-radius: 0 0 99px 99px;
    background: linear-gradient(90deg, transparent, var(--senac-blue-bright), var(--senac-orange), transparent);
}

.slide-panel-header {
    min-height: clamp(78px, 4.35vw, 140px);
    padding: clamp(12px, 0.72vw, 24px);
    background: linear-gradient(108deg, rgba(0, 92, 169, 0.36), rgba(247, 148, 29, 0.14));
}

.slide-panel-title {
    font-size: clamp(0.78rem, 0.7vw, 1.05rem);
    color: #fff;
}

.slide-counter {
    font-size: clamp(0.66rem, 0.58vw, 0.86rem);
}

.slide-item::before {
    inset: -8px;
    filter: saturate(0.7) brightness(0.52);
    opacity: 0.52;
}

.slide-media-frame {
    border-width: 2px;
    border-color: rgba(190, 221, 250, 0.24);
    border-radius: clamp(16px, 0.9vw, 30px);
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.42);
}

.slide-caption {
    left: clamp(13px, 0.75vw, 24px);
    right: clamp(13px, 0.75vw, 24px);
    bottom: clamp(12px, 0.7vw, 22px);
    min-height: clamp(62px, 3.6vw, 116px);
    padding: clamp(11px, 0.7vw, 23px);
    border-width: 2px;
    border-color: rgba(147, 190, 232, 0.22);
}

.slide-caption strong {
    font-size: clamp(0.9rem, 0.82vw, 1.24rem);
}

.slide-caption span {
    font-size: clamp(0.74rem, 0.66vw, 0.98rem);
    color: #b3c8dc;
}

.slide-dots {
    min-height: clamp(30px, 1.75vw, 56px);
}

.dot {
    width: clamp(8px, 0.42vw, 14px);
    height: clamp(8px, 0.42vw, 14px);
}

.dot.active {
    width: clamp(28px, 1.5vw, 50px);
}

/* Avisos grandes e com contraste correto sobre o laranja */
.footer {
    height: clamp(68px, 3.7vw, 126px);
    border-top-width: 2px;
    background: linear-gradient(90deg, #071426, #03101f 58%, #06182a);
}

.footer-label {
    min-width: clamp(150px, 8.6vw, 290px);
    padding-inline: clamp(18px, 1.15vw, 38px);
    font-size: clamp(0.78rem, 0.7vw, 1.05rem);
    color: #17202b;
    background: linear-gradient(135deg, var(--senac-orange), var(--tv-amber));
    box-shadow: 10px 0 24px rgba(247, 148, 29, 0.22);
}

.marquee-track .aviso {
    font-size: clamp(1.12rem, 1.08vw, 1.65rem);
    font-weight: 600;
    color: #edf6ff;
}

.marquee-track .sep {
    margin-inline: clamp(1.2rem, 1vw, 2rem);
    color: var(--senac-orange-soft);
}

/* Estados acionados por voz */
body.mercurito-muted #mercurito-status::after {
    content: ' · SOM DESATIVADO';
    color: var(--senac-orange-soft);
    font-weight: 900;
}

.voice-command-highlight {
    animation: voice-command-highlight 1.05s ease-in-out 3;
}

@keyframes voice-command-highlight {
    0%,
    100% {
        box-shadow: var(--tv-panel-shadow);
    }
    50% {
        border-color: var(--senac-orange-soft);
        box-shadow:
            0 0 0 4px rgba(247, 148, 29, 0.2),
            0 0 36px rgba(247, 148, 29, 0.34);
    }
}

.main-board.voice-focus-shift {
    grid-template-columns: minmax(0, 1fr) !important;
}

.main-board.voice-focus-shift > .shift-col,
.main-board.voice-focus-shift > .slide-panel {
    display: none;
}

.main-board.voice-focus-shift.focus-manha > .col-manha,
.main-board.voice-focus-shift.focus-tarde > .col-tarde,
.main-board.voice-focus-shift.focus-noite > .col-noite {
    display: flex;
}

.main-board.voice-focus-shift .shift-body {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    overflow-y: auto;
}

.main-board.voice-focus-shift .tv-card {
    min-height: clamp(180px, 9vw, 330px);
}

.slide-panel.is-paused::after {
    content: 'GALERIA PAUSADA';
    position: absolute;
    inset: 42% 12%;
    z-index: 7;
    display: grid;
    place-items: center;
    border: 2px solid rgba(255, 196, 107, 0.58);
    border-radius: 999px;
    color: #fff2dc;
    background: rgba(3, 13, 26, 0.9);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
    font-size: clamp(0.72rem, 0.68vw, 1rem);
    font-weight: 900;
    letter-spacing: 0.14em;
}

body.reading-mode .card-title {
    -webkit-line-clamp: 3;
    font-size: clamp(1.22rem, 1.3vw, 1.9rem);
}

body.reading-mode .card-instructor {
    font-size: clamp(0.96rem, 0.92vw, 1.35rem);
}

body.reading-mode .meta-label {
    font-size: clamp(0.72rem, 0.68vw, 1rem);
}

body.reading-mode .meta-value {
    font-size: clamp(1rem, 0.94vw, 1.4rem);
}

body.reading-mode .tv-card {
    min-height: clamp(184px, 9.5vw, 350px);
    border-color: rgba(190, 221, 250, 0.34);
}

body.reading-mode .shift-body {
    gap: clamp(14px, 0.85vw, 28px);
}

body.reading-mode .marquee-track,
body.reading-mode .marquee-content,
body.reading-mode .clock-colon,
body.reading-mode .live-dot {
    animation-play-state: paused !important;
}

/* Ajuda visual aberta pelo comando “O que você sabe fazer?” */
#command-help-overlay {
    position: fixed;
    inset: 0;
    z-index: 99960;
    display: grid;
    place-items: center;
    padding: clamp(30px, 4vw, 90px);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    background:
        radial-gradient(circle at 12% 8%, rgba(247, 148, 29, 0.22), transparent 34%),
        radial-gradient(circle at 90% 94%, rgba(0, 92, 169, 0.35), transparent 38%),
        rgba(2, 8, 19, 0.92);
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

#command-help-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.command-help-card {
    width: min(1380px, 92vw);
    max-height: 88vh;
    padding: clamp(30px, 2.5vw, 60px);
    overflow: hidden;
    border: 2px solid rgba(91, 168, 240, 0.38);
    border-radius: clamp(24px, 1.6vw, 46px);
    color: var(--tv-text);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.045), transparent 38%),
        linear-gradient(160deg, rgba(13, 35, 60, 0.995), rgba(4, 15, 29, 0.995));
    box-shadow: 0 36px 90px rgba(0, 0, 0, 0.55), inset 5px 0 0 var(--senac-orange);
}

.command-help-header {
    display: grid;
    margin-bottom: clamp(22px, 1.7vw, 42px);
}

.command-help-kicker {
    margin-bottom: 8px;
    font-size: clamp(0.7rem, 0.72vw, 1.05rem);
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--senac-orange-soft);
}

.command-help-header strong {
    font-size: clamp(2rem, 3.2vw, 4.4rem);
    line-height: 1;
}

.command-help-header > span:last-child {
    margin-top: 10px;
    font-size: clamp(0.9rem, 1vw, 1.4rem);
    color: var(--tv-text-soft);
}

.command-help-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 1vw, 24px);
}

.command-help-grid article {
    min-width: 0;
    padding: clamp(18px, 1.35vw, 32px);
    border: 1px solid rgba(145, 189, 232, 0.22);
    border-radius: clamp(16px, 1vw, 28px);
    background: rgba(2, 12, 24, 0.55);
}

.command-help-grid b {
    display: block;
    margin-bottom: 8px;
    font-size: clamp(1rem, 1.08vw, 1.55rem);
    color: #fff;
}

.command-help-grid span {
    display: block;
    font-size: clamp(0.82rem, 0.84vw, 1.2rem);
    line-height: 1.35;
    color: var(--tv-text-soft);
}

.command-help-card > footer {
    margin-top: clamp(18px, 1.4vw, 34px);
    font-size: clamp(0.72rem, 0.72vw, 1.05rem);
    color: var(--tv-text-muted);
}

/* Resoluções compactas: cidade e galeria dividem uma coluna auxiliar */
@media (max-width: 1650px) {
    .header {
        height: 104px;
        padding-inline: 18px;
    }

    .logo-wrap { height: 60px; }
    .logo-img { height: 41px; }
    .header-title h1 { font-size: 1.45rem; }
    .view-context { min-width: 132px; min-height: 52px; }
    .view-context strong { font-size: 0.82rem; }
    .view-context span { display: none; }

    .weather-widget {
        min-width: 126px;
        width: 126px;
        height: 62px;
        padding: 5px 8px 5px 4px;
        border-radius: 15px;
    }

    .weather-visual {
        width: 48px;
        height: 48px;
    }

    .weather-icon-img {
        width: 50px;
        height: 50px;
    }

    .weather-fallback-icon { font-size: 2rem; }
    .weather-eyebrow,
    .weather-desc { display: none; }
    .weather-temp { font-size: 1.55rem; }

    .qr-mic-wrap {
        min-width: 58px;
        min-height: 62px;
        padding: 4px;
    }

    .qr-mic-img {
        width: 48px;
        height: 48px;
    }

    .qr-mic-label,
    #model-loader-pill,
    .sync-pill {
        display: none !important;
    }

    .clock-block { min-width: 102px; }
    .clock-time { font-size: 2.5rem; }
    .clock-date { font-size: 0.68rem; }

    .main-board.has-city-panel.has-media-panel {
        grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(230px, 0.82fr);
        grid-template-rows: repeat(2, minmax(0, 1fr));
    }

    .main-board.has-city-panel.has-media-panel > .col-manha,
    .main-board.has-city-panel.has-media-panel > .col-tarde,
    .main-board.has-city-panel.has-media-panel > .col-noite {
        grid-row: 1 / -1;
    }

    .main-board.has-city-panel.has-media-panel > .city-panel {
        grid-column: 4;
        grid-row: 1;
    }

    .main-board.has-city-panel.has-media-panel > .slide-panel {
        grid-column: 4;
        grid-row: 2;
    }

    .main-board.has-city-panel.has-media-panel .city-panel .shift-header,
    .main-board.has-city-panel.has-media-panel .slide-panel-header {
        min-height: 58px;
    }

    .main-board.has-city-panel.has-media-panel .city-panel .tv-card {
        min-height: 126px;
    }

    .main-board.has-city-panel.has-media-panel .slide-item {
        padding-bottom: 58px;
    }

    .main-board.has-city-panel.has-media-panel .slide-caption {
        min-height: 46px;
        padding: 8px 10px;
    }

    .shift-header {
        min-height: 76px;
        padding: 11px;
    }

    .shift-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .shift-title { font-size: 1rem; }
    .free-rooms-container,
    .shift-badge { display: none; }

    .tv-card {
        min-height: 144px;
        padding: 13px 12px 12px 18px;
    }

    .card-title { font-size: 1rem; }
    .card-instructor { font-size: 0.76rem; }
    .meta-label { font-size: 0.6rem; }
    .meta-value { font-size: 0.8rem; }
    .card-meta { grid-template-columns: 1fr; }

    .main-board.voice-focus-shift .shift-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 1366px) {
    .header {
        height: 92px;
        padding-inline: 12px;
    }

    .header-sep {
        margin-inline: 10px;
    }

    .header-title h1 { font-size: 1.25rem; }
    .view-context { min-width: 104px; min-height: 46px; }
    .weather-widget {
        display: flex !important;
        min-width: 108px;
        width: 108px;
        height: 54px;
    }

    .weather-visual {
        width: 40px;
        height: 40px;
    }

    .weather-icon-img {
        width: 43px;
        height: 43px;
    }

    .weather-temp { font-size: 1.3rem; }
    .qr-mic-wrap { min-height: 54px; min-width: 50px; }
    .qr-mic-img { width: 42px; height: 42px; }

    .main-board.has-city-panel.has-media-panel {
        grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(205px, 0.78fr);
    }

    .shift-header { min-height: 62px; }
    .tv-card { min-height: 136px; }
    .card-title { font-size: 0.95rem; }
    .footer { height: 58px; }
    .footer-label { min-width: 122px; }
    .marquee-track .aviso { font-size: 1rem; }

    .command-help-card {
        overflow-y: auto;
    }
}

/* Em 4K real, o painel cresce junto com a distância de leitura. */
@media (min-width: 2560px) {
    html { font-size: 24px; }

    .main-board.has-city-panel.has-media-panel .free-rooms-container,
    .main-board.has-city-panel.has-media-panel .shift-badge {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .weather-widget,
    .weather-icon-img {
        transition: none;
    }
}

/* Mercurito em tela inteira
   Esta folha é carregada por último para impedir que o palco antigo do canto
   inferior direito volte a limitar o canvas. */
#mercurito-shell {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: block !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

#mercurito-avatar-wrap {
    position: fixed !important;
    inset: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    display: block !important;
    pointer-events: none !important;
}

#mercurito-canvas {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    display: block !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    pointer-events: none !important;
}

#mercurito-status {
    display: none !important;
    visibility: hidden !important;
}

.mercurito-arrival-effect {
    display: none !important;
}

/* Legenda discreta, centralizada no limite superior da TV. */
.mercurito-subtitle {
    position: fixed !important;
    top: clamp(6px, 0.65vw, 14px) !important;
    bottom: auto !important;
    left: 50% !important;
    width: auto !important;
    max-width: min(76vw, 1400px) !important;
    max-height: 14vh !important;
    padding: clamp(7px, 0.45vw, 11px) clamp(14px, 0.85vw, 24px) !important;
    overflow: hidden !important;
    transform: translate(-50%, -8px) !important;
    border: 1px solid rgba(132, 194, 247, 0.28) !important;
    border-radius: 12px !important;
    background: rgba(2, 13, 27, 0.88) !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32) !important;
    color: #f4f9ff !important;
    font-size: clamp(0.8rem, 0.88vw, 1.15rem) !important;
    line-height: 1.28 !important;
    font-weight: 650 !important;
    text-align: center !important;
    text-wrap: balance;
    z-index: 99998 !important;
}

.mercurito-subtitle.is-long {
    font-size: clamp(0.72rem, 0.76vw, 1rem) !important;
    line-height: 1.22 !important;
}

.mercurito-subtitle::before {
    content: none !important;
    display: none !important;
}

.mercurito-subtitle.is-visible {
    transform: translate(-50%, 0) !important;
}

/* Modo leve: vídeo WebM com transparência no lugar do WebGL/GLB. */
#mercurito-video {
    --mercurito-travel-duration: 9s;
    --mercurito-x: 50vw;
    --mercurito-y: 68vh;
    position: fixed !important;
    left: 0;
    top: 0;
    z-index: 2;
    display: block;
    width: auto;
    height: clamp(150px, 18vh, 360px);
    max-width: 28vw;
    max-height: 24vh;
    object-fit: contain;
    background: transparent;
    border: 0;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(var(--mercurito-x), var(--mercurito-y), 0) translate(-50%, -50%);
    backface-visibility: hidden;
    will-change: transform, opacity;
    transition:
        transform var(--mercurito-travel-duration) linear,
        opacity 0.2s ease;
    pointer-events: none;
}

#mercurito-shell.video-mode #mercurito-canvas {
    display: none !important;
}

#mercurito-shell.video-mode.active #mercurito-video {
    opacity: 1;
    visibility: visible;
}

#mercurito-shell.video-mode[data-video-role="thinking"] #mercurito-video {
    opacity: 0.94;
}

#mercurito-shell.video-mode[data-video-role="talking"] #mercurito-video,
#mercurito-shell.video-mode[data-video-role="alert"] #mercurito-video {
    opacity: 1;
}

/* Algumas Smart TVs reproduzem VP9, mas descartam o plano alfa do WebM.
   Como o matte dos clipes é preto, screen torna esse preto invisível sem
   reprocessar cada quadro em canvas. */
#mercurito-shell.video-mode.video-alpha-screen {
    mix-blend-mode: screen !important;
}

#mercurito-shell.video-mode.video-alpha-screen #mercurito-video {
    mix-blend-mode: normal !important;
    background: #000 !important;
    filter: none !important;
}

/* Rolagem contínua dos turnos: somente transform, sem scrollTop, timers ou
   pausas. A duração é calculada no JS para manter 375 px/s em qualquer TV. */
.shift-body {
    --schedule-card-gap: clamp(10px, 0.65vw, 21px);
    display: block !important;
    min-height: 0;
    overflow: hidden !important;
    contain: layout paint;
}

.shift-scroll-track {
    width: 100%;
    transform: translate3d(0, 0, 0);
}

.shift-scroll-track.is-scrolling {
    animation: schedule-roll var(--schedule-scroll-duration, 4s) linear infinite;
    will-change: transform;
}

.shift-scroll-group {
    display: flex;
    flex-direction: column;
    gap: var(--schedule-card-gap);
    padding-bottom: var(--schedule-card-gap);
}

.shift-scroll-track:not(.is-scrolling) .shift-scroll-clone {
    display: none;
}

.shift-scroll-track:not(.is-scrolling) .shift-scroll-group:first-child {
    padding-bottom: 0;
}

@keyframes schedule-roll {
    to { transform: translate3d(0, var(--schedule-scroll-distance, -100%), 0); }
}

.main-board.voice-focus-shift .shift-body {
    display: block !important;
    overflow: hidden !important;
}

.main-board.voice-focus-shift .shift-scroll-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
}

body.reading-mode .shift-body {
    --schedule-card-gap: clamp(14px, 0.85vw, 28px);
}

body.reading-mode .shift-scroll-track {
    animation: none !important;
    transform: translate3d(0, 0, 0) !important;
}

body.reading-mode .shift-scroll-clone {
    display: none !important;
}

/* A barra de mídia agora cresce no compositor, sem recalcular largura. */
.slide-progress {
    width: 100% !important;
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
    transition-property: transform !important;
}

/* Destaques acionados por voz sem blur/sombras animadas sobre painéis grandes. */
.voice-command-highlight {
    outline: 3px solid transparent;
    outline-offset: -3px;
    animation: voice-command-highlight-lite 0.72s ease-in-out 3 !important;
}

@keyframes voice-command-highlight-lite {
    0%, 100% { outline-color: rgba(247, 148, 29, 0); }
    50% { outline-color: rgba(255, 196, 107, 0.95); }
}

.main-board.voice-focus-shift.focus-manha > .col-manha,
.main-board.voice-focus-shift.focus-tarde > .col-tarde,
.main-board.voice-focus-shift.focus-noite > .col-noite {
    animation: shift-focus-enter 0.18s ease-out both;
}

@keyframes shift-focus-enter {
    from { opacity: 0.45; transform: translate3d(0, 8px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Perfil padrão para a TV de 70\". Mantém a identidade visual, reduzindo
   gradientes, sombras e transições que repintavam a tela inteira. */
html.tv-performance-mode .bg-layer {
    background:
        radial-gradient(ellipse 58% 50% at 100% 100%, rgba(0, 92, 169, 0.25), transparent 70%),
        linear-gradient(145deg, #020813 0%, #051325 55%, #03101f 100%);
}

html.tv-performance-mode .bg-layer::before {
    display: none;
}

html.tv-performance-mode .layout {
    transition: none !important;
}

html.tv-performance-mode #view-transition {
    transform: none !important;
    transition: opacity 0.16s ease, visibility 0.16s ease !important;
    background: linear-gradient(115deg, #d8780c, #07192d 54%, #07589c);
    will-change: opacity;
}
