/* MS EPG admin cards */
.ms-epg-wrap .ms-epg-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin:20px 0}.ms-epg-card{background:#fff;border:1px solid #dcdcde;border-radius:10px;padding:18px}.ms-epg-card strong{display:block;color:#555}.ms-epg-card span{font-size:28px;font-weight:700;color:#111}.ms-epg-status{max-width:900px}.ms-epg-refresh-form{margin-top:24px;padding:18px;background:#fff;border:1px solid #dcdcde;border-radius:10px}

/* Public EPG layout - scoped to plugin only */
.ms-epg-public-wrap{max-width:1140px;margin:30px auto;padding:0 16px;box-sizing:border-box}.ms-epg-public-wrap *{box-sizing:border-box}.ms-epg-page{background:#fff;border:1px solid #e8e8e8;border-radius:18px;padding:24px;box-shadow:0 8px 24px rgba(0,0,0,.04)}.ms-epg-channel-head{display:flex;gap:18px;align-items:center;margin-bottom:22px}.ms-epg-logo{width:96px;height:72px;object-fit:contain;background:#f7f7f7;border:1px solid #eee;border-radius:14px;padding:8px}.ms-epg-page h1{margin:0 0 8px}.ms-epg-page h2{margin:22px 0 14px;font-size:22px}

/* Channel archive cards */
.ms-epg-channel-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(165px,1fr));gap:16px}.ms-epg-channel-card{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:150px;padding:18px;border:1px solid #eee;border-radius:16px;text-decoration:none;background:#fff;color:#111;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}.ms-epg-channel-card:hover{transform:translateY(-2px);box-shadow:0 10px 26px rgba(0,0,0,.08);border-color:#d8d8d8}.ms-epg-channel-card img{width:94px;height:66px;object-fit:contain;background:#f7f7f7;border-radius:12px;padding:7px}.ms-epg-channel-card span{font-weight:700;text-align:center;line-height:1.25}

/* EPG schedule table / rows */
.ms-epg-schedule{width:100%;border:1px solid #ececec;border-radius:16px;overflow:hidden;background:#fff}.ms-epg-schedule-row{display:grid;grid-template-columns:86px minmax(150px,220px) 1fr;gap:16px;align-items:center;padding:13px 16px;border-bottom:1px solid #eee}.ms-epg-schedule-row:last-child{border-bottom:0}.ms-epg-schedule-row:hover{background:#fafafa}.ms-epg-program-thumb{display:block;width:74px;height:54px;border-radius:12px;overflow:hidden;background:#f3f4f6;border:1px solid #e5e7eb;flex:0 0 auto}.ms-epg-program-thumb img{width:100%;height:100%;object-fit:cover;display:block}.ms-epg-time{color:#555;font-weight:700;white-space:nowrap;font-size:14px}.ms-epg-title a{font-weight:800;text-decoration:none;color:#111;line-height:1.35}.ms-epg-title a:hover{text-decoration:underline}.ms-epg-desc{margin-top:5px;color:#666;font-size:13px;line-height:1.45}

/* Program page */
.ms-epg-poster{display:block;max-width:380px;width:100%;height:auto;max-height:440px;object-fit:cover;border-radius:18px;background:#f3f4f6;border:1px solid #eee;margin:12px 0 22px;box-shadow:0 8px 22px rgba(0,0,0,.06)}.ms-epg-program-meta{display:grid;gap:8px;margin:14px 0 20px;padding:14px;border:1px solid #eee;border-radius:14px;background:#fafafa}.ms-epg-program-meta strong{color:#111}

@media(max-width:700px){.ms-epg-public-wrap{margin:16px auto;padding:0 10px}.ms-epg-page{padding:16px;border-radius:14px}.ms-epg-channel-head{align-items:flex-start;gap:12px}.ms-epg-logo{width:76px;height:58px}.ms-epg-schedule{border-radius:14px}.ms-epg-schedule-row{grid-template-columns:68px 1fr;gap:10px;padding:12px}.ms-epg-time{grid-column:2;font-size:13px;white-space:normal}.ms-epg-title{grid-column:2}.ms-epg-program-thumb{grid-row:1 / span 2;width:60px;height:46px;border-radius:10px}.ms-epg-channel-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.ms-epg-channel-card{min-height:132px;padding:12px}.ms-epg-channel-card img{width:78px;height:56px}.ms-epg-poster{max-width:100%;border-radius:14px}}

/* v1.4.0 Homepage and Today's Schedule shortcodes */
.ms-epg-home{display:grid;gap:22px}.ms-epg-home-section{margin-bottom:22px}.ms-epg-section-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:16px}.ms-epg-section-head h2{margin:0}.ms-epg-view-all{display:inline-flex;align-items:center;justify-content:center;padding:9px 14px;border-radius:999px;background:#111;color:#fff!important;text-decoration:none!important;font-weight:700;font-size:13px;white-space:nowrap}.ms-epg-view-all:hover{opacity:.9}.ms-epg-channel-grid--compact{grid-template-columns:repeat(auto-fit,minmax(135px,1fr));gap:12px}.ms-epg-channel-grid--compact .ms-epg-channel-card{min-height:130px;padding:14px}.ms-epg-channel-grid--compact .ms-epg-channel-card img{width:84px;height:60px}.ms-epg-muted{color:#666;margin-top:0}.ms-epg-empty{padding:16px;border:1px dashed #ddd;border-radius:14px;background:#fafafa;color:#666}.ms-epg-today-channel{margin-top:22px;padding-top:18px;border-top:1px solid #eee}.ms-epg-today-channel:first-of-type{border-top:0;padding-top:0}.ms-epg-today-channel-head{margin-bottom:12px}.ms-epg-today-channel-head a{display:flex;align-items:center;gap:12px;color:#111;text-decoration:none}.ms-epg-today-channel-head img{width:72px;height:52px;object-fit:contain;background:#f7f7f7;border:1px solid #eee;border-radius:12px;padding:6px}.ms-epg-today-channel-head strong{font-size:18px}.ms-epg-schedule--compact .ms-epg-schedule-row{grid-template-columns:72px minmax(120px,170px) 1fr;padding:10px 14px}.ms-epg-schedule--compact .ms-epg-program-thumb{width:58px;height:44px}.ms-epg-shortcode-box{max-width:950px;margin:16px 0 22px;padding:16px 18px;background:#fff;border:1px solid #dcdcde;border-radius:10px}.ms-epg-shortcode-box h2{margin-top:0}.ms-epg-shortcode-box code{display:inline-block;margin:2px 0;padding:4px 7px;background:#f6f7f7;border-radius:5px}
@media(max-width:700px){.ms-epg-section-head{align-items:flex-start;flex-direction:column}.ms-epg-view-all{width:100%}.ms-epg-schedule--compact .ms-epg-schedule-row{grid-template-columns:58px 1fr}.ms-epg-schedule-row--today .ms-epg-time{grid-column:2}.ms-epg-schedule-row--today .ms-epg-title{grid-column:2}.ms-epg-today-channel-head img{width:62px;height:46px}.ms-epg-today-channel-head strong{font-size:16px}}

/* v1.5.0 Modern Today's Schedule */
.ms-epg-today-modern{overflow:hidden}.ms-epg-today-hero{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}.ms-epg-today-hero h1{margin:0 0 6px}.ms-epg-today-count{min-width:92px;text-align:center;border:1px solid #eee;border-radius:18px;background:#fafafa;padding:12px 16px;font-size:28px;font-weight:900;color:#111}.ms-epg-today-count span{display:block;font-size:12px;font-weight:700;color:#666;text-transform:uppercase;letter-spacing:.04em}.ms-epg-date-tabs,.ms-epg-filter-row{display:flex;gap:8px;overflow-x:auto;padding:2px 0 12px;margin-bottom:8px;scrollbar-width:thin}.ms-epg-date-tabs a,.ms-epg-filter-pill{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;text-decoration:none!important;border:1px solid #e5e5e5;background:#fff;color:#111!important;border-radius:999px;padding:8px 13px;font-weight:800;font-size:13px}.ms-epg-date-tabs a.is-active,.ms-epg-filter-pill.is-active{background:#111;color:#fff!important;border-color:#111}.ms-epg-today-channel-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:12px;margin-top:14px}.ms-epg-today-logo-card{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;min-height:156px;text-align:center;text-decoration:none!important;color:#111!important;border:1px solid #eee;border-radius:18px;background:linear-gradient(180deg,#fff,#fafafa);padding:14px 10px;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}.ms-epg-today-logo-card:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(0,0,0,.08);border-color:#dcdcdc}.ms-epg-today-logo-card img{width:92px;height:64px;object-fit:contain;background:#fff;border:1px solid #eee;border-radius:14px;padding:7px;margin-bottom:10px}.ms-epg-today-logo-card strong{font-size:14px;line-height:1.22}.ms-epg-today-logo-card span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-top:6px;font-size:12px;line-height:1.25;color:#666}.ms-epg-today-details{margin-top:24px;display:grid;gap:12px}.ms-epg-today-details .ms-epg-today-channel{margin:0;padding:0;border:1px solid #eee;border-radius:18px;background:#fff;overflow:hidden}.ms-epg-today-details .ms-epg-today-channel[open]{box-shadow:0 8px 22px rgba(0,0,0,.05)}.ms-epg-today-details .ms-epg-today-channel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;padding:12px 14px;cursor:pointer;list-style:none;background:#fafafa}.ms-epg-today-details .ms-epg-today-channel-head::-webkit-details-marker{display:none}.ms-epg-today-details .ms-epg-today-channel-head span{display:flex;align-items:center;gap:12px}.ms-epg-today-details .ms-epg-today-channel-head a{font-size:13px;font-weight:800;text-decoration:none!important;color:#111;background:#fff;border:1px solid #e5e5e5;border-radius:999px;padding:7px 10px}.ms-epg-today-details .ms-epg-today-channel-head:after{content:'+';font-weight:900;font-size:20px;color:#555}.ms-epg-today-details .ms-epg-today-channel[open] .ms-epg-today-channel-head:after{content:'–'}.ms-epg-schedule-row.is-now{background:#fffdf2}.ms-epg-now-badge{display:inline-flex;vertical-align:middle;margin-right:7px;padding:3px 7px;border-radius:999px;background:#111;color:#fff;font-size:11px;font-weight:900;line-height:1}
@media(max-width:700px){.ms-epg-today-hero{align-items:flex-start;flex-direction:column}.ms-epg-today-count{width:100%;font-size:24px}.ms-epg-today-channel-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.ms-epg-today-logo-card{min-height:142px;padding:12px 8px}.ms-epg-today-logo-card img{width:78px;height:56px}.ms-epg-today-details .ms-epg-today-channel-head{align-items:flex-start}.ms-epg-today-details .ms-epg-today-channel-head a{display:none}.ms-epg-date-tabs a,.ms-epg-filter-pill{padding:8px 12px;font-size:12px}}

/* ── Program thumbnail fallback ─────────────────────────────────────── */
.ms-epg-program-thumb-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 54px;
    border-radius: 6px;
    background: hsl(var(--epg-hue, 220), 30%, 88%);
    color: hsl(var(--epg-hue, 220), 40%, 30%);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    padding: 4px 6px;
    word-break: break-word;
    overflow: hidden;
    box-sizing: border-box;
    vertical-align: middle;
    letter-spacing: 0.01em;
}

/* Larger variant used on the program poster (single-ms_program.php) */
.ms-epg-program-poster-fallback {
    width: 160px;
    height: 220px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    padding: 16px;
}


/* ── Taxonomy Browse Grid (genre / language / program category / list) ── */
.ms-epg-tax-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:14px;margin-top:4px}
.ms-epg-tax-card{display:flex;flex-direction:column;align-items:center;gap:10px;padding:18px 12px;border:1px solid #eee;border-radius:16px;text-decoration:none;background:#fff;color:#111;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;text-align:center}
.ms-epg-tax-card:hover{transform:translateY(-3px);box-shadow:0 10px 26px rgba(0,0,0,.09);border-color:#d0d0d0;color:#111}
.ms-epg-tax-icon{width:64px;height:64px;border-radius:14px;display:flex;align-items:center;justify-content:center;font-size:1.35rem;font-weight:800;letter-spacing:-.01em;flex-shrink:0;overflow:hidden}
.ms-epg-tax-icon img{width:100%;height:100%;object-fit:cover;border-radius:14px}
.ms-epg-tax-name{font-weight:700;font-size:.9rem;line-height:1.3;word-break:break-word}
.ms-epg-tax-count{font-size:.75rem;color:#888;background:#f4f4f4;border-radius:999px;padding:2px 10px;font-weight:600}
@media(max-width:700px){.ms-epg-tax-grid{grid-template-columns:repeat(auto-fill,minmax(95px,1fr));gap:10px}.ms-epg-tax-icon{width:52px;height:52px;font-size:1.1rem;border-radius:11px}.ms-epg-tax-name{font-size:.8rem}.ms-epg-tax-card{padding:14px 8px;gap:8px}}


/* v1.7.4 Single channel modern tabs + current show focus */
.ms-epg-channel-page-modern{padding-top:18px}
.ms-epg-channel-head--modern{margin-bottom:18px}
.ms-epg-channel-subtitle{font-size:14px}
.ms-epg-channel-copy>:last-child{margin-bottom:0}
.ms-epg-channel-tabs{display:flex;gap:0;overflow-x:auto;margin:4px 0 22px;padding:0;border-bottom:1px solid #ded7cf;scrollbar-width:thin}
.ms-epg-channel-tab{display:flex;flex-direction:column;min-width:88px;padding:12px 14px 10px;border:1px solid transparent;border-bottom:none;border-radius:12px 12px 0 0;text-decoration:none!important;color:#6b7280!important;line-height:1.1;position:relative;transform:translateY(1px)}
.ms-epg-channel-tab.is-active{background:#fff;border-color:#ded7cf;color:#ef4444!important}
.ms-epg-channel-tab-top{font-size:12px;font-weight:900;letter-spacing:.11em;text-transform:uppercase;margin-bottom:6px}
.ms-epg-channel-tab-bottom{font-size:14px;font-weight:800}
.ms-epg-slot-group{margin-bottom:18px}
.ms-epg-slot-group-title{font-size:13px!important;font-weight:900;text-transform:uppercase;letter-spacing:.09em;color:#5b5b5b;margin:0 0 10px;padding-bottom:10px;border-bottom:1px solid #ece7e0}
.ms-epg-schedule--channel-modern{border:none;background:transparent;display:grid;gap:8px;overflow:visible}
.ms-epg-schedule-row--channel{grid-template-columns:84px 96px minmax(0,1fr) auto;padding:10px 12px;background:#fff;border:1px solid #dedede;border-radius:8px;min-height:110px;align-items:center;box-shadow:none}
.ms-epg-schedule-row--channel:hover{background:#fff;box-shadow:0 6px 18px rgba(0,0,0,.04)}
.ms-epg-schedule-row--channel.is-now{border-color:#ff4d57;background:#fff6f6;box-shadow:0 0 0 1px rgba(255,77,87,.05)}
.ms-epg-program-thumb--channel,.ms-epg-schedule-row--channel .ms-epg-program-thumb{width:78px;height:78px;border-radius:6px;border:none;background:#f0f1f3}
.ms-epg-schedule-row--channel .ms-epg-program-thumb img,.ms-epg-schedule-row--channel .ms-epg-program-thumb-fallback{width:100%;height:100%;border-radius:6px}
.ms-epg-timeblock{display:flex;flex-direction:column;gap:4px;align-items:flex-start;justify-content:center}
.ms-epg-time-main{font-size:17px;font-weight:900;color:#111;line-height:1.1;white-space:nowrap}
.ms-epg-duration{font-size:14px;color:#666;white-space:nowrap}
.ms-epg-contentblock{min-width:0}
.ms-epg-title--channel a{font-size:17px;font-weight:900;text-decoration:none!important}
.ms-epg-subtime{margin-top:7px;font-size:12px;color:#6b7280}
.ms-epg-stateblock{display:flex;align-items:center;justify-content:flex-end;min-width:88px}
.ms-epg-now-badge--live{background:#ff2533;color:#fff;font-size:11px;padding:6px 10px;letter-spacing:.04em}
@media(max-width:860px){.ms-epg-schedule-row--channel{grid-template-columns:72px 1fr auto;gap:12px;min-height:unset}.ms-epg-timeblock{grid-column:2;grid-row:2;flex-direction:row;gap:8px;align-items:center}.ms-epg-time-main{font-size:15px}.ms-epg-contentblock{grid-column:2;grid-row:1}.ms-epg-stateblock{grid-column:3;grid-row:1 / span 2;align-self:center}.ms-epg-program-thumb--channel,.ms-epg-schedule-row--channel .ms-epg-program-thumb{width:60px;height:60px}.ms-epg-title--channel a{font-size:16px}.ms-epg-channel-tab{min-width:82px;padding:10px 12px 8px}}
@media(max-width:560px){.ms-epg-channel-page-modern{padding:14px}.ms-epg-channel-tabs{margin-bottom:16px}.ms-epg-channel-tab-top{font-size:11px}.ms-epg-channel-tab-bottom{font-size:13px}.ms-epg-schedule-row--channel{grid-template-columns:60px 1fr;gap:10px;padding:10px}.ms-epg-stateblock{grid-column:2;grid-row:3;justify-content:flex-start;min-width:0}.ms-epg-timeblock{grid-column:2;grid-row:2}.ms-epg-contentblock{grid-column:2;grid-row:1}.ms-epg-title--channel a{font-size:15px}}


/* EPG channel taxonomy buttons */
.ms-epg-channel-chips{display:flex;flex-wrap:wrap;gap:6px;align-items:center;justify-content:center;margin-top:9px;max-width:100%}
.ms-epg-channel-chip{display:inline-flex;align-items:center;gap:4px;border:1px solid #e7e7e7;border-radius:999px;background:#fff;color:#111;font-size:11px;font-weight:800;line-height:1;padding:5px 8px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ms-epg-channel-chip small{font-size:9px;font-weight:900;color:#777;text-transform:uppercase;letter-spacing:.03em}
.ms-epg-channel-head .ms-epg-channel-chips{justify-content:flex-start;margin-top:12px}
.ms-epg-channel-head .ms-epg-channel-chip{font-size:13px;padding:7px 11px;background:#fafafa}
.ms-epg-channel-card .ms-epg-channel-chips{margin-top:8px}
.ms-epg-channel-card .ms-epg-channel-chip{font-size:10px;padding:4px 7px}
.ms-epg-channel-card .ms-epg-channel-chip small{display:none}
@media(max-width:700px){.ms-epg-channel-head .ms-epg-channel-chip{font-size:12px;padding:6px 10px}.ms-epg-channel-card .ms-epg-channel-chips{gap:4px}.ms-epg-channel-card .ms-epg-channel-chip{font-size:9px;padding:4px 6px}}


.ms-epg-channel-main-link{display:flex;flex-direction:column;align-items:center;text-decoration:none!important;color:inherit!important}
.ms-epg-channel-chip{text-decoration:none!important}
.ms-epg-channel-chip:hover{border-color:#111;color:#111;background:#f7f7f7}










/* =========================================================
   MS EPG Responsive Modern UI Override
   Add this at the END of assets/css/ms-epg.css
   ========================================================= */

/* Better global public wrapper */
.ms-epg-public-wrap {
    width: 100%;
    max-width: 1280px;
    margin: 28px auto;
    padding: 0 18px;
}

/* Main white card/page */
.ms-epg-page {
    width: 100%;
    border-radius: 22px;
    padding: 28px;
    border: 1px solid #eeeeee;
    background: #ffffff;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.045);
}

/* Archive section heading */
.ms-epg-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
}

.ms-epg-section-head h1,
.ms-epg-page h1 {
    font-size: clamp(26px, 3vw, 42px);
    line-height: 1.12;
    letter-spacing: -0.035em;
    margin: 0;
    color: #071225;
}

.ms-epg-page h2 {
    font-size: clamp(20px, 2vw, 28px);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* =========================================================
   Channel grid: archive, genre, language, channel-list
   ========================================================= */

.ms-epg-channel-grid,
.ms-epg-tax-channel-grid,
.ms-epg-channel-grid--compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 16px;
    width: 100%;
}

/* More compact taxonomy archive pages */
.ms-epg-tax-channel-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}

/* Channel card */
.ms-epg-channel-card {
    position: relative;
    min-height: 138px;
    padding: 16px 12px;
    border-radius: 18px;
    border: 1px solid #ececec;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.025);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
}

.ms-epg-channel-card:hover {
    transform: translateY(-3px);
    border-color: #d7d7d7;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

/* Main card link */
.ms-epg-channel-main-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 100%;
    text-align: center;
    text-decoration: none !important;
    color: #111827 !important;
}

/* Logo box */
.ms-epg-channel-card img,
.ms-epg-channel-main-link img {
    width: 86px;
    height: 58px;
    object-fit: contain;
    padding: 7px;
    border-radius: 14px;
    background: #f7f7f7;
    border: 1px solid #f0f0f0;
}

/* Channel title */
.ms-epg-channel-card strong,
.ms-epg-channel-card span {
    display: block;
    max-width: 100%;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    color: #111827;
    overflow-wrap: anywhere;
}

/* Empty message */
.ms-epg-empty {
    padding: 18px;
    border: 1px dashed #d8d8d8;
    border-radius: 16px;
    background: #fafafa;
    color: #5f6673;
    font-size: 16px;
    text-align: center;
}

/* =========================================================
   Taxonomy browse cards: genre/language/list grid
   ========================================================= */

.ms-epg-tax-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 16px;
}

.ms-epg-tax-card {
    min-height: 132px;
    padding: 16px 12px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #fbfbfb);
    border: 1px solid #eeeeee;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.025);
}

.ms-epg-tax-card:hover {
    transform: translateY(-3px);
    border-color: #d7d7d7;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.ms-epg-tax-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
}

.ms-epg-tax-name {
    font-size: 14px;
    font-weight: 800;
}

/* =========================================================
   Today's schedule channel logo grid
   ========================================================= */

.ms-epg-today-channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 16px;
}

.ms-epg-today-logo-card {
    min-height: 148px;
    border-radius: 18px;
    padding: 14px 10px;
}

/* =========================================================
   Schedule rows responsive polish
   ========================================================= */

.ms-epg-schedule-row {
    border-radius: 0;
}

.ms-epg-schedule--channel-modern {
    gap: 10px;
}

.ms-epg-schedule-row--channel {
    border-radius: 14px;
    border-color: #eeeeee;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.025);
}

/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 1024px) {
    .ms-epg-public-wrap {
        max-width: 100%;
        padding: 0 16px;
    }

    .ms-epg-page {
        padding: 24px;
    }

    .ms-epg-channel-grid,
    .ms-epg-tax-channel-grid,
    .ms-epg-channel-grid--compact,
    .ms-epg-today-channel-grid {
        grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
        gap: 14px;
    }

    .ms-epg-channel-card {
        min-height: 132px;
        padding: 14px 10px;
    }

    .ms-epg-channel-card img,
    .ms-epg-channel-main-link img {
        width: 78px;
        height: 54px;
    }
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 700px) {
    .ms-epg-public-wrap {
        margin: 16px auto;
        padding: 0 10px;
    }

    .ms-epg-page {
        padding: 16px;
        border-radius: 18px;
    }

    .ms-epg-section-head {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 16px;
    }

    .ms-epg-section-head h1,
    .ms-epg-page h1 {
        font-size: 26px;
        line-height: 1.15;
    }

    /* Always 2 columns on mobile */
    .ms-epg-channel-grid,
    .ms-epg-tax-channel-grid,
    .ms-epg-channel-grid--compact,
    .ms-epg-today-channel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .ms-epg-channel-card {
        min-height: 124px;
        padding: 12px 8px;
        border-radius: 16px;
    }

    .ms-epg-channel-main-link {
        gap: 8px;
    }

    .ms-epg-channel-card img,
    .ms-epg-channel-main-link img {
        width: 70px;
        height: 48px;
        padding: 6px;
        border-radius: 12px;
    }

    .ms-epg-channel-card strong,
    .ms-epg-channel-card span {
        font-size: 13px;
        line-height: 1.22;
    }

    .ms-epg-tax-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .ms-epg-tax-card {
        min-height: 116px;
        padding: 12px 8px;
        border-radius: 16px;
    }

    .ms-epg-tax-icon {
        width: 48px;
        height: 48px;
        border-radius: 13px;
    }

    .ms-epg-tax-name {
        font-size: 13px;
    }

    .ms-epg-empty {
        font-size: 14px;
        padding: 14px;
    }
}

/* =========================================================
   Very small phones
   ========================================================= */

@media (max-width: 380px) {
    .ms-epg-public-wrap {
        padding: 0 8px;
    }

    .ms-epg-page {
        padding: 14px;
    }

    .ms-epg-channel-grid,
    .ms-epg-tax-channel-grid,
    .ms-epg-channel-grid--compact,
    .ms-epg-today-channel-grid {
        gap: 8px;
    }

    .ms-epg-channel-card {
        min-height: 116px;
        padding: 10px 6px;
    }

    .ms-epg-channel-card img,
    .ms-epg-channel-main-link img {
        width: 64px;
        height: 44px;
    }

    .ms-epg-channel-card strong,
    .ms-epg-channel-card span {
        font-size: 12.5px;
    }
}


/* =========================================================
   v1.8.13 Isolated /tv-channels-epg/ design
   Uses ONLY .ms-epg-lite* classes to avoid theme/plugin CSS conflict.
   ========================================================= */

.ms-epg-lite,
.ms-epg-lite *{
    box-sizing:border-box;
}

.ms-epg-lite{
    max-width:1140px;
    margin:24px auto 34px;
    padding:0 16px;
    font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
    color:#0f172a;
}

.ms-epg-lite-card{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:18px;
    padding:26px;
    box-shadow:0 10px 28px rgba(15,23,42,.05);
}

.ms-epg-lite-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:18px;
    padding-bottom:18px;
    margin-bottom:14px;
    border-bottom:1px solid #eef2f7;
}

.ms-epg-lite-kicker{
    margin:0 0 7px!important;
    color:#64748b!important;
    font-size:12px!important;
    line-height:1.2!important;
    font-weight:850!important;
    letter-spacing:.12em!important;
    text-transform:uppercase!important;
}

.ms-epg-lite-head h1{
    margin:0 0 8px!important;
    color:#0f172a!important;
    font-size:clamp(26px,3vw,38px)!important;
    line-height:1.12!important;
    letter-spacing:-.035em!important;
    font-weight:850!important;
}

.ms-epg-lite-head p{
    margin:0!important;
    color:#64748b!important;
    font-size:14px!important;
    line-height:1.55!important;
}

.ms-epg-lite-count{
    flex:0 0 auto;
    min-width:82px;
    padding:10px 12px;
    border-radius:14px;
    background:#0f172a;
    color:#fff;
    text-align:center;
    font-size:24px;
    line-height:1;
    font-weight:900;
}

.ms-epg-lite-count span{
    display:block;
    margin-top:5px;
    color:#cbd5e1;
    font-size:10px;
    line-height:1;
    font-weight:850;
    letter-spacing:.08em;
    text-transform:uppercase;
}

.ms-epg-lite-tabs,
.ms-epg-lite-filters{
    display:flex;
    flex-wrap:nowrap;
    gap:8px;
    overflow-x:auto;
    padding:2px 0 12px;
    margin:0 0 10px;
    scrollbar-width:thin;
}

.ms-epg-lite-tabs a,
.ms-epg-lite-filters a{
    display:inline-flex;
    flex:0 0 auto;
    align-items:center;
    justify-content:center;
    min-height:34px;
    padding:7px 13px;
    border:1px solid #e5e7eb;
    border-radius:999px;
    background:#fff;
    color:#0f172a!important;
    font-size:13px;
    line-height:1!important;
    font-weight:800;
    text-decoration:none!important;
    white-space:nowrap;
}

.ms-epg-lite-tabs a.is-active,
.ms-epg-lite-filters a.is-active{
    background:#2563eb!important;
    border-color:#2563eb!important;
    color:#fff!important;
}

.ms-epg-lite-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(135px,1fr));
    gap:12px;
    margin-top:12px;
}

.ms-epg-lite-item{
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:9px!important;
    min-height:132px!important;
    padding:12px 8px!important;
    border:1px solid #e5e7eb!important;
    border-radius:14px!important;
    background:#fff!important;
    color:#0f172a!important;
    text-align:center!important;
    text-decoration:none!important;
    box-shadow:0 4px 14px rgba(15,23,42,.035)!important;
    overflow:hidden!important;
    transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.ms-epg-lite-item:hover{
    transform:translateY(-2px);
    border-color:#cbd5e1!important;
    box-shadow:0 10px 22px rgba(15,23,42,.08)!important;
}

.ms-epg-lite-logo{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:86px!important;
    height:54px!important;
    padding:7px!important;
    border:1px solid #eef2f7!important;
    border-radius:13px!important;
    background:#f8fafc!important;
    overflow:hidden!important;
    flex:0 0 auto!important;
}

.ms-epg-lite-logo img{
    display:block!important;
    max-width:72px!important;
    max-height:40px!important;
    width:auto!important;
    height:auto!important;
    object-fit:contain!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
}

.ms-epg-lite-logo--text{
    color:#2563eb!important;
    font-size:18px!important;
    font-weight:900!important;
    letter-spacing:.02em!important;
}

.ms-epg-lite-item strong{
    display:-webkit-box!important;
    -webkit-line-clamp:2!important;
    -webkit-box-orient:vertical!important;
    overflow:hidden!important;
    min-height:34px!important;
    margin:0!important;
    color:#020617!important;
    font-size:13px!important;
    line-height:1.28!important;
    font-weight:850!important;
    text-align:center!important;
}

.ms-epg-lite-item span:not(.ms-epg-lite-logo){
    display:-webkit-box!important;
    -webkit-line-clamp:1!important;
    -webkit-box-orient:vertical!important;
    overflow:hidden!important;
    max-width:100%!important;
    padding:4px 8px!important;
    border-radius:999px!important;
    background:#f1f5f9!important;
    color:#64748b!important;
    font-size:10px!important;
    line-height:1.2!important;
    font-weight:750!important;
}

.ms-epg-lite-more-wrap{
    display:flex;
    justify-content:center;
    margin-top:18px;
}

.ms-epg-lite-more{
    min-height:42px;
    padding:10px 18px;
    border:0;
    border-radius:999px;
    background:#0f172a;
    color:#fff;
    font-size:14px;
    font-weight:850;
    cursor:pointer;
    box-shadow:0 8px 18px rgba(15,23,42,.14);
}

.ms-epg-lite-more:hover{
    background:#111827;
}

@media(max-width:760px){
    .ms-epg-lite{
        margin:14px auto 24px;
        padding:0 10px;
    }

    .ms-epg-lite-card{
        padding:14px;
        border-radius:16px;
    }

    .ms-epg-lite-head{
        flex-direction:column;
        gap:10px;
        margin-bottom:12px;
    }

    .ms-epg-lite-count{
        display:inline-flex;
        align-items:baseline;
        gap:6px;
        min-width:0;
        font-size:21px;
        padding:9px 12px;
    }

    .ms-epg-lite-count span{
        margin-top:0;
    }

    .ms-epg-lite-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:10px;
    }

    .ms-epg-lite-item{
        min-height:124px!important;
        padding:10px 7px!important;
    }

    .ms-epg-lite-logo{
        width:74px!important;
        height:48px!important;
    }

    .ms-epg-lite-logo img{
        max-width:62px!important;
        max-height:34px!important;
    }

    .ms-epg-lite-item strong{
        font-size:12.5px!important;
    }
}


/* v1.8.14: show all channel CPT items and use larger logos */
.ms-epg-lite-grid{
    grid-template-columns:repeat(auto-fill,minmax(150px,1fr))!important;
    gap:12px!important;
}

.ms-epg-lite-item{
    min-height:142px!important;
    padding:13px 10px!important;
}

.ms-epg-lite-logo{
    width:108px!important;
    height:70px!important;
    padding:7px!important;
}

.ms-epg-lite-logo img{
    max-width:94px!important;
    max-height:56px!important;
}

.ms-epg-lite-logo--text{
    font-size:21px!important;
}

.ms-epg-lite-item strong{
    font-size:13.5px!important;
    line-height:1.25!important;
}

@media(max-width:760px){
    .ms-epg-lite-grid{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:10px!important;
    }

    .ms-epg-lite-item{
        min-height:134px!important;
    }

    .ms-epg-lite-logo{
        width:96px!important;
        height:62px!important;
    }

    .ms-epg-lite-logo img{
        max-width:82px!important;
        max-height:48px!important;
    }
}


/* v1.8.15: directory mode fixes */
.ms-epg-lite-tabs{
    display:none!important;
}
.ms-epg-lite-head{
    margin-bottom:14px!important;
}
.ms-epg-lite-filters{
    margin-top:2px!important;
}


/* v1.8.16: Clean compact EPG directory layout */
.ms-epg-lite-filters,
.ms-epg-lite-tabs{
    display:none!important;
}

.page-prose .ms-epg-lite,
.page-content-card .ms-epg-lite,
.ms-epg-lite{
    max-width:100%!important;
    width:100%!important;
    margin:0 auto 18px!important;
    padding:0!important;
}

.page-content-card:has(.ms-epg-lite){
    padding:18px!important;
}

.page-prose:has(.ms-epg-lite){
    max-width:none!important;
}

.ms-epg-lite-card{
    width:100%!important;
    padding:18px!important;
    border-radius:18px!important;
}

.ms-epg-lite-head{
    padding-bottom:14px!important;
    margin-bottom:16px!important;
}

.ms-epg-lite-head h1{
    font-size:clamp(24px,2.6vw,34px)!important;
}

.ms-epg-lite-head p{
    max-width:620px!important;
}

.ms-epg-lite-grid{
    grid-template-columns:repeat(auto-fit,minmax(130px,1fr))!important;
    gap:10px!important;
}

.ms-epg-lite-item{
    min-height:132px!important;
    padding:11px 8px!important;
    border-radius:14px!important;
}

.ms-epg-lite-logo{
    width:100px!important;
    height:64px!important;
}

.ms-epg-lite-logo img{
    max-width:88px!important;
    max-height:52px!important;
}

/* On common content widths this gives around 5 columns; on wider pages it auto-fits more. */
@media(min-width:900px){
    .ms-epg-lite-grid{
        grid-template-columns:repeat(5,minmax(0,1fr))!important;
    }
}

@media(min-width:1180px){
    .ms-epg-lite-grid{
        grid-template-columns:repeat(6,minmax(0,1fr))!important;
    }
}

/* Small polish for the theme page + sidebar spacing when EPG shortcode is present */
.container:has(.ms-epg-lite){
    gap:22px!important;
}

.container:has(.ms-epg-lite) .page-content-card{
    margin-top:0!important;
}

@media(max-width:760px){
    .page-content-card:has(.ms-epg-lite){
        padding:12px!important;
    }

    .ms-epg-lite-card{
        padding:14px!important;
    }

    .ms-epg-lite-grid{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:10px!important;
    }

    .ms-epg-lite-head{
        gap:10px!important;
    }

    .ms-epg-lite-logo{
        width:92px!important;
        height:58px!important;
    }

    .ms-epg-lite-logo img{
        max-width:80px!important;
        max-height:46px!important;
    }
}


/* v1.8.17: Load More button renders after first 50 and is always clickable */
.ms-epg-lite-more-wrap{
    position:relative!important;
    z-index:3!important;
    display:flex!important;
    justify-content:center!important;
    width:100%!important;
    margin-top:20px!important;
}

.ms-epg-lite-more{
    position:relative!important;
    z-index:4!important;
    pointer-events:auto!important;
    cursor:pointer!important;
    user-select:none!important;
}

.ms-epg-lite-data{
    display:none!important;
}


/* v1.8.18: 20-channel first load + remove duplicate page heading space */
.ms-epg-hidden-page-title-wrap{
    display:none!important;
    margin:0!important;
    padding:0!important;
    min-height:0!important;
}

.ms-epg-lite{
    margin-top:0!important;
}

.ms-epg-lite-more-wrap{
    display:flex!important;
    justify-content:center!important;
    margin-top:18px!important;
}

.ms-epg-lite-more{
    min-height:42px!important;
    padding:10px 18px!important;
    border-radius:999px!important;
    cursor:pointer!important;
    pointer-events:auto!important;
}

