:root {
    --ink: #f7fbff;
    --muted: #aeb8c6;
    --line: rgba(214, 232, 255, 0.16);
    --panel: rgba(18, 25, 33, 0.82);
    --panel-solid: #141d28;
    --panel-soft: rgba(28, 40, 54, 0.86);
    --blue: #1d8dff;
    --blue-soft: rgba(29, 141, 255, 0.28);
    --green: #16e6a7;
    --pink: #e7348d;
    --orange: #ff9148;
    --red: #f13d52;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
}

body,
button,
input,
select {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: #05070b;
    color: var(--ink);
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

[hidden] {
    display: none !important;
}

.login-view {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    background:
        linear-gradient(110deg, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 42%),
        linear-gradient(135deg, #3716ff 0%, #9d24cf 45%, #ff3a2e 100%);
}

.login-view::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(80deg, transparent 0 22%, rgba(255, 255, 255, 0.12) 23%, transparent 33%),
        linear-gradient(155deg, transparent 0 54%, rgba(255, 255, 255, 0.13) 55%, transparent 62%);
    pointer-events: none;
}

.login-box {
    position: relative;
    z-index: 1;
    width: min(380px, 92vw);
    display: grid;
    gap: 10px;
}

.login-heading {
    text-align: center;
    margin-bottom: 6px;
}

.login-heading h1 {
    margin: 0 0 4px;
    font-size: 1.42rem;
    font-weight: 900;
}

.login-heading p {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
}

.login-box input,
.login-box select {
    width: 100%;
    min-height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.72);
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    padding: 0 13px;
    outline: none;
}

.login-box input::placeholder {
    color: rgba(255, 255, 255, 0.74);
}

.login-box input:focus,
.login-box select:focus {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.24);
}

.login-box select {
    appearance: none;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.1;
}

.login-portal-select {
    background:
        linear-gradient(45deg, transparent 50%, #fff 50%) right 18px center / 8px 8px no-repeat,
        linear-gradient(135deg, #fff 50%, transparent 50%) right 12px center / 8px 8px no-repeat,
        rgba(255, 255, 255, 0.18);
    letter-spacing: 0;
}

.login-portal-select option {
    background: #141821;
    color: #fff;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    font-weight: 800;
}

.brand-logo {
    display: block;
    object-fit: contain;
}

.login-logo {
    width: min(110px, 28vw);
    max-height: 78px;
    margin: 0 auto 10px;
}

.password-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 4px;
}

.password-field button {
    min-height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.72);
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.eye-icon {
    width: 22px;
    height: 14px;
    display: inline-block;
    border: 2px solid currentColor;
    border-radius: 999px / 700px;
    position: relative;
}

.eye-icon::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    left: 50%;
    top: 50%;
    border-radius: 50%;
    background: currentColor;
    transform: translate(-50%, -50%);
}

.add-user-button,
.list-users-button,
.refresh-button,
.back-button,
.format-button,
.secondary-button,
.danger-button {
    min-height: 42px;
    border: 0;
    border-radius: 3px;
    padding: 0 18px;
    font-weight: 800;
}

.add-user-button {
    background: rgba(255, 255, 255, 0.92);
    color: #4b5165;
}

.list-users-button {
    position: absolute;
    z-index: 2;
    left: max(7vw, 28px);
    bottom: 25vh;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #647089;
    background: rgba(255, 255, 255, 0.92);
}

.mini-users {
    width: 22px;
    height: 16px;
    position: relative;
    display: inline-block;
}

.mini-users::before,
.mini-users::after {
    content: "";
    position: absolute;
    top: 1px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8c98ad;
}

.mini-users::before {
    left: 2px;
}

.mini-users::after {
    right: 2px;
}

.login-message {
    min-height: 22px;
    margin: 0;
    color: #fff2a8;
    font-weight: 800;
    text-align: center;
}

.app-view {
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-rows: 66px minmax(0, 1fr);
    overflow: hidden;
    background:
        radial-gradient(circle at 28% 14%, rgba(31, 133, 255, 0.18), transparent 28%),
        radial-gradient(circle at 78% 88%, rgba(22, 230, 167, 0.1), transparent 28%),
        linear-gradient(135deg, rgba(13, 18, 26, 0.98), rgba(2, 4, 8, 1));
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 28px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(4, 7, 12, 0.62);
}

.app-name {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 900;
}

.header-logo {
    width: 34px;
    height: 34px;
}

.header-status {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
    font-size: 0.9rem;
}

.icon-button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    position: relative;
    background: transparent;
    color: #fff;
}

.icon-button::before,
.icon-button::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: currentColor;
}

.account-icon {
    color: #fff;
}

.account-icon::before {
    top: 7px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.account-icon::after {
    bottom: 6px;
    width: 28px;
    height: 16px;
    border-radius: 16px 16px 7px 7px;
}

.users-icon {
    color: #fff;
}

.users-icon::before {
    top: 8px;
    width: 26px;
    height: 14px;
    border-radius: 50%;
    box-shadow: -11px 9px 0 -1px currentColor, 11px 9px 0 -1px currentColor;
}

.users-icon::after {
    bottom: 7px;
    width: 36px;
    height: 14px;
    border-radius: 14px 14px 6px 6px;
}

.settings-icon {
    color: #fff;
}

.settings-icon::before {
    top: 10px;
    width: 22px;
    height: 22px;
    border: 4px solid currentColor;
    border-radius: 50%;
    background: transparent;
    box-shadow:
        0 -11px 0 -7px currentColor,
        0 11px 0 -7px currentColor,
        -11px 0 0 -7px currentColor,
        11px 0 0 -7px currentColor,
        8px 8px 0 -7px currentColor,
        -8px 8px 0 -7px currentColor,
        8px -8px 0 -7px currentColor,
        -8px -8px 0 -7px currentColor;
}

.settings-icon::after {
    top: 18px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.refresh-button,
.back-button,
.secondary-button {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(11, 24, 59, 0.72);
    color: #fff;
}

.danger-button {
    background: rgba(241, 61, 82, 0.92);
    color: #fff;
}

.app-main {
    width: 100%;
    max-width: 100vw;
    min-height: 0;
    display: grid;
    grid-template-columns: clamp(190px, 15vw, 252px) minmax(0, 1fr);
    overflow: hidden;
}

.tv-sidebar {
    min-width: 0;
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 22px 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.09);
    background: linear-gradient(180deg, rgba(17, 23, 31, 0.94), rgba(7, 10, 15, 0.86));
}

.rail-heading {
    display: grid;
    gap: 2px;
    margin: 0 8px 18px;
    color: #fff;
    letter-spacing: 0;
}

.rail-logo {
    width: 54px;
    height: 54px;
    margin-bottom: 6px;
}

.rail-heading span {
    color: var(--green);
    font-size: 0.72rem;
    font-weight: 900;
}

.rail-heading strong {
    font-size: 1.14rem;
    font-weight: 950;
}

.rail-item {
    min-width: 0;
    min-height: 46px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #d7e0ec;
    padding: 0 12px;
    text-align: left;
    font-weight: 900;
}

.rail-item:hover,
.rail-item:focus-visible,
.rail-item.active {
    border-color: rgba(103, 178, 255, 0.42);
    background: linear-gradient(90deg, rgba(29, 141, 255, 0.34), rgba(29, 141, 255, 0.08));
    color: #fff;
    outline: none;
}

.rail-icon {
    width: 24px;
    height: 24px;
    position: relative;
    display: inline-block;
    color: currentColor;
}

.search-glyph {
    border: 3px solid currentColor;
    border-radius: 50%;
}

.search-glyph::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 3px;
    right: -7px;
    bottom: 0;
    background: currentColor;
    transform: rotate(45deg);
}

.tv-glyph {
    border: 3px solid currentColor;
    border-radius: 5px;
}

.tv-glyph::before,
.tv-glyph::after {
    content: "";
    position: absolute;
    top: -10px;
    width: 3px;
    height: 13px;
    background: currentColor;
}

.tv-glyph::before {
    left: 7px;
    transform: rotate(-36deg);
}

.tv-glyph::after {
    right: 7px;
    transform: rotate(36deg);
}

.movie-glyph,
.series-glyph {
    border: 3px solid currentColor;
    border-radius: 50%;
}

.movie-glyph::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 6px;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid currentColor;
}

.series-glyph {
    border-radius: 4px;
}

.series-glyph::before {
    content: "";
    position: absolute;
    left: -3px;
    right: -3px;
    top: -9px;
    height: 6px;
    border: 3px solid currentColor;
    border-bottom: 0;
    transform: rotate(-10deg);
    transform-origin: left bottom;
}

.list-glyph {
    border-top: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
}

.list-glyph::before,
.list-glyph::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: currentColor;
}

.list-glyph::before {
    top: 9px;
}

.list-glyph::after {
    bottom: 9px;
}

.recordings-glyph {
    border: 3px solid currentColor;
    border-radius: 3px;
}

.recordings-glyph::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 8px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: currentColor;
}

.gear-glyph {
    border: 4px solid currentColor;
    border-radius: 50%;
}

.home-view {
    position: relative;
    grid-column: 2;
    height: 100%;
    display: grid;
    align-content: center;
    place-items: center;
    gap: 28px;
    padding: 42px;
}

.home-search {
    position: absolute;
    z-index: 8;
    top: 24px;
    left: 50%;
    width: min(880px, calc(100% - 84px));
    transform: translateX(-50%);
}

.home-search input {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 4px;
    background: rgba(2, 9, 28, 0.82);
    color: #fff;
    padding: 0 15px;
    outline: none;
    font-size: 1rem;
}

.home-search input::placeholder {
    color: #9eb4dc;
}

.home-search-status {
    min-height: 22px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.global-search-results {
    max-height: min(52vh, 520px);
    overflow: auto;
    border: 1px solid var(--line);
    background: rgba(5, 14, 35, 0.96);
    box-shadow: var(--shadow);
}

.global-result-row {
    min-height: 68px;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
}

.global-result-row:hover {
    background: rgba(34, 152, 255, 0.18);
}

.global-result-details {
    min-width: 0;
}

.global-result-details strong,
.global-result-details span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-result-details span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.82rem;
}

.global-result-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.global-result-button {
    min-height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 0 10px;
    font-weight: 900;
}

.global-result-button.active {
    border-color: #ffd84a;
    background: #ffd84a;
    color: #071322;
}

.my-list-panel {
    min-height: 0;
}

.my-list-sections {
    min-height: 0;
    overflow: auto;
    padding: 12px;
}

.my-list-section {
    border: 1px solid rgba(176, 204, 255, 0.16);
    background: rgba(6, 13, 24, 0.52);
}

.my-list-section + .my-list-section {
    margin-top: 12px;
}

.my-list-section-head {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(18, 37, 67, 0.58);
    color: #fff;
}

.my-list-section-head strong,
.my-list-section-head span {
    font-weight: 900;
}

.my-list-rows {
    display: grid;
    gap: 8px;
    padding: 10px;
}

.my-list-row {
    min-height: 62px;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(176, 204, 255, 0.2);
    border-radius: 3px;
    background: rgba(14, 20, 30, 0.88);
    color: #fff;
    padding: 9px;
    cursor: pointer;
}

.my-list-row:hover,
.my-list-row:focus-visible {
    border-color: rgba(79, 170, 255, 0.9);
    background: linear-gradient(90deg, rgba(26, 107, 202, 0.9), rgba(20, 58, 106, 0.82));
    outline: none;
}

.my-list-details {
    min-width: 0;
}

.my-list-details strong,
.my-list-details span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.my-list-details span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.82rem;
}

.my-list-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.recordings-panel {
    min-height: 0;
}

.recordings-list {
    min-height: 0;
    overflow: auto;
    display: grid;
    gap: 8px;
    padding: 12px;
}

.recording-row {
    min-height: 66px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(176, 204, 255, 0.2);
    border-radius: 3px;
    background: rgba(14, 20, 30, 0.88);
    padding: 10px;
}

.recording-details {
    min-width: 0;
}

.recording-details strong,
.recording-details span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recording-details span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.82rem;
}

.recording-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.home-tiles {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr;
    align-items: center;
    gap: clamp(18px, 3vw, 34px);
    width: min(980px, 90vw);
}

.home-tile {
    height: 190px;
    border: 0;
    border-radius: 7px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 18px;
    color: #fff;
    font-size: 1.45rem;
    font-weight: 900;
    box-shadow: var(--shadow);
}

.tile-live {
    height: 290px;
    background: linear-gradient(180deg, #10e0a9 0%, #2477f3 52%, #411dff 100%);
}

.tile-movies {
    background: linear-gradient(135deg, #ed1f80 0%, #ff9b37 100%);
}

.tile-series {
    background: linear-gradient(135deg, #9d28d6 0%, #38a9ff 100%);
}

.tile-symbol {
    width: 74px;
    height: 62px;
    display: block;
    position: relative;
}

.tv-symbol {
    border: 6px solid #fff;
    border-radius: 14px;
}

.tv-symbol::before,
.tv-symbol::after {
    content: "";
    position: absolute;
    top: -25px;
    width: 4px;
    height: 28px;
    background: #fff;
    transform-origin: bottom;
}

.tv-symbol::before {
    left: 22px;
    transform: rotate(-42deg);
}

.tv-symbol::after {
    right: 22px;
    transform: rotate(42deg);
}

.play-symbol {
    border: 6px solid #fff;
    border-radius: 50%;
}

.play-symbol::after {
    content: "";
    position: absolute;
    left: 28px;
    top: 18px;
    width: 0;
    height: 0;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    border-left: 20px solid #fff;
}

.clapper-symbol {
    border: 5px solid #fff;
    border-radius: 5px;
    height: 54px;
    margin-top: 8px;
}

.clapper-symbol::before {
    content: "";
    position: absolute;
    left: -5px;
    top: -19px;
    width: 76px;
    height: 16px;
    border: 5px solid #fff;
    border-bottom: 0;
    transform: rotate(-14deg);
    transform-origin: left bottom;
}

.home-footer {
    position: absolute;
    left: 42px;
    right: 42px;
    bottom: 24px;
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-size: 0.8rem;
}

.detail-view {
    width: 100%;
    max-width: 100%;
    grid-column: 2;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: 52px minmax(220px, 31vh) minmax(0, 1fr);
    gap: 10px;
    padding: 0 18px 16px;
}

.section-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(240px, 340px);
    align-items: center;
    gap: 14px;
}

.section-bar h2 {
    margin: 0;
    text-align: center;
    font-size: 1.22rem;
}

.section-tools input,
.modal-card input {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: rgba(2, 7, 19, 0.82);
    color: var(--ink);
    padding: 0 12px;
    outline: none;
}

.section-tools input::placeholder {
    color: #7892be;
}

.player-dock {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(360px, 46vw) minmax(0, 1fr);
    border: 1px solid var(--line);
    background: linear-gradient(90deg, rgba(10, 14, 20, 0.98), rgba(17, 27, 41, 0.96));
    box-shadow: var(--shadow);
}

.video-frame {
    position: relative;
    min-height: 0;
    background: #000;
}

.video-frame video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

.video-frame .video-js,
.video-frame .avm-video-js,
.video-frame .video-js .vjs-tech {
    width: 100%;
    height: 100%;
    background: #000;
}

.video-frame .video-js {
    position: absolute;
    inset: 0;
}

.video-frame .video-js[hidden] {
    display: none;
}

.video-frame .video-js .vjs-control-bar {
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.72));
}

.video-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 8px;
    text-align: center;
    padding: 20px;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        #02040b;
    background-size: 32px 32px;
}

.video-empty strong {
    font-size: 1.2rem;
}

.video-empty span,
.now-row p {
    color: var(--muted);
}

.now-row {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px;
}

.label-green {
    display: block;
    color: var(--green);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.now-row h3 {
    margin: 4px 0 4px;
    font-size: 1.32rem;
}

.now-row p {
    margin: 0;
}

.format-controls {
    display: flex;
    gap: 8px;
}

.now-actions {
    display: grid;
    justify-items: end;
    gap: 9px;
}

.playback-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.compact-button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.82rem;
}

.compact-button.recording,
.epg-record-button.recording {
    border-color: rgba(255, 77, 103, 0.9);
    background: #e83256;
    color: #fff;
}

.format-button {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.format-button.active {
    background: var(--blue);
}

.live-browser,
.vod-browser,
.my-list-browser,
.recordings-browser {
    min-height: 0;
    display: grid;
    gap: 10px;
    overflow: hidden;
}

.live-browser {
    grid-template-columns: minmax(220px, 300px) minmax(340px, 1fr) minmax(280px, 400px);
}

.vod-browser {
    grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
}

.my-list-browser,
.recordings-browser {
    grid-template-columns: minmax(0, 1fr);
}

.list-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    background: rgba(10, 14, 20, 0.8);
    overflow: hidden;
}

.panel-title {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    color: #fff;
    font-weight: 900;
    border-bottom: 1px solid var(--line);
    background: rgba(27, 37, 50, 0.86);
}

.panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.panel-actions select {
    min-height: 30px;
    max-width: 190px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 3px;
    background: rgba(3, 10, 27, 0.92);
    color: #fff;
    padding: 0 30px 0 10px;
    outline: none;
    font-weight: 800;
}

.category-list,
.channel-list,
.epg-list,
.poster-grid {
    min-height: 0;
    overflow: auto;
}

.category-list {
    padding: 8px;
}

.category-button {
    width: 100%;
    min-height: 38px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: #cbd6e2;
    padding: 0 8px;
    text-align: left;
    font-weight: 800;
}

.category-button.active {
    color: #fff;
    background: var(--blue-soft);
    box-shadow: inset 3px 0 0 var(--blue);
}

.category-button span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-list {
    padding: 9px;
}

.channel-card {
    width: 100%;
    min-height: 54px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    border: 1px solid rgba(176, 204, 255, 0.18);
    border-radius: 3px;
    background: var(--panel-soft);
    color: #fff;
    padding: 7px 9px;
    margin-bottom: 8px;
    text-align: left;
    cursor: pointer;
}

.channel-card.active,
.channel-card:hover,
.poster-card:hover,
.poster-card.active {
    border-color: rgba(79, 170, 255, 0.9);
    background: linear-gradient(90deg, rgba(26, 107, 202, 0.94), rgba(20, 58, 106, 0.9));
}

.logo-box {
    width: 46px;
    height: 40px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #d4e0fb;
    font-weight: 900;
    font-size: 0.78rem;
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.item-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 900;
}

.item-subtitle {
    margin-top: 3px;
    color: #9fb6df;
    font-size: 0.78rem;
}

.favorite-button {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.18);
    color: #b7c5e0;
    font-weight: 900;
}

.favorite-button.active {
    color: #071322;
    background: #ffd84a;
    border-color: #ffd84a;
}

.epg-list {
    padding: 12px;
}

.epg-card {
    padding: 11px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.epg-card strong {
    display: block;
    color: #fff;
    font-size: 0.92rem;
}

.epg-card span,
.epg-card p {
    color: var(--muted);
    font-size: 0.78rem;
}

.epg-card p {
    margin: 5px 0 0;
    line-height: 1.35;
}

.epg-actions {
    margin-top: 8px;
}

.epg-record-button {
    min-height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 0 9px;
    font-size: 0.74rem;
    font-weight: 900;
}

.epg-record-button:disabled {
    color: #94a3bb;
    opacity: 0.72;
}

.poster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 12px;
}

.poster-feature {
    grid-column: 1 / -1;
    min-height: 190px;
    display: grid;
    align-content: end;
    justify-items: start;
    gap: 8px;
    border: 1px solid rgba(176, 204, 255, 0.2);
    border-radius: 4px;
    background:
        linear-gradient(90deg, rgba(8, 12, 18, 0.96), rgba(8, 12, 18, 0.72), rgba(8, 12, 18, 0.34)),
        linear-gradient(135deg, rgba(29, 141, 255, 0.28), rgba(22, 230, 167, 0.12));
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 24px;
    cursor: pointer;
}

.poster-feature:hover,
.poster-feature:focus-visible {
    border-color: rgba(79, 170, 255, 0.9);
    outline: none;
}

.poster-feature strong {
    max-width: 760px;
    font-size: clamp(1.45rem, 2vw, 2.35rem);
    font-weight: 950;
    line-height: 1.08;
}

.poster-feature p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.poster-card {
    min-width: 0;
    display: grid;
    gap: 8px;
    border: 1px solid rgba(176, 204, 255, 0.24);
    border-radius: 3px;
    background: rgba(14, 20, 30, 0.88);
    color: #fff;
    padding: 8px;
    text-align: left;
    cursor: pointer;
}

.season-card {
    background: rgba(17, 37, 84, 0.9);
}

.poster-art {
    position: relative;
    aspect-ratio: 2 / 3;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(23, 105, 190, 0.76), rgba(230, 50, 119, 0.62));
    color: #fff;
    font-size: 1.8rem;
    font-weight: 900;
}

.season-art {
    aspect-ratio: 16 / 10;
    font-size: 1.25rem;
}

.poster-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster-info {
    min-width: 0;
}

.poster-title {
    min-height: 38px;
    font-weight: 900;
    line-height: 1.22;
}

.poster-meta {
    margin-top: 4px;
    color: #9fb6df;
    font-size: 0.78rem;
    line-height: 1.35;
    white-space: pre-line;
}

.poster-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 18px;
    color: var(--muted);
    text-align: center;
}

.modal-layer {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.62);
}

.modal-card {
    width: min(420px, 94vw);
    max-height: 82vh;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #09142d;
    box-shadow: var(--shadow);
    padding: 18px;
}

.modal-card.wide {
    width: min(640px, 94vw);
}

.modal-card.media-modal {
    width: min(980px, 94vw);
}

.modal-card.settings-modal {
    width: min(980px, 94vw);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.modal-head h2 {
    margin: 0;
    font-size: 1rem;
}

.modal-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.account-grid {
    display: grid;
    gap: 10px;
}

.account-grid.compact {
    gap: 8px;
}

.account-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.account-row span:first-child {
    color: var(--muted);
}

.users-list {
    display: grid;
    gap: 10px;
}

.user-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(4, auto);
    gap: 8px;
    align-items: center;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    padding: 10px;
}

.user-row strong,
.user-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-row span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.82rem;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.modal-actions.inline {
    justify-content: flex-start;
}

.settings-shell {
    min-height: 440px;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 16px;
}

.settings-menu {
    display: grid;
    align-content: start;
    gap: 7px;
    border-right: 1px solid var(--line);
    padding-right: 12px;
}

.settings-tab {
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #d8e7ff;
    padding: 0 12px;
    text-align: left;
    font-weight: 900;
}

.settings-tab:hover,
.settings-tab.active {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(34, 152, 255, 0.18);
    color: #fff;
}

.settings-panels {
    min-width: 0;
}

.settings-panel {
    display: none;
    gap: 10px;
}

.settings-panel.active {
    display: grid;
}

.setting-row {
    min-height: 54px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 260px);
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 12px;
    color: #fff;
    font-weight: 800;
}

.setting-row > span {
    min-width: 0;
}

.setting-row input[type="checkbox"] {
    width: 22px;
    height: 22px;
    justify-self: end;
}

.setting-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.setting-actions small {
    flex: 1 1 100%;
    color: var(--muted);
    font-weight: 800;
}

.setting-row select,
.setting-row input[type="number"],
.setting-row input[type="password"] {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: rgba(2, 7, 19, 0.82);
    color: var(--ink);
    padding: 0 10px;
    outline: none;
    font-weight: 800;
}

.setting-row button {
    justify-self: start;
}

.settings-status {
    min-height: 22px;
    margin: 12px 0 0;
    color: #fff2a8;
    font-weight: 800;
}

.media-info-layout {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.media-info-poster {
    aspect-ratio: 2 / 3;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    background: linear-gradient(145deg, rgba(23, 105, 190, 0.76), rgba(230, 50, 119, 0.62));
    color: #fff;
    font-size: 2rem;
    font-weight: 900;
}

.media-info-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-info-body {
    min-width: 0;
}

.media-info-meta {
    color: var(--green);
    font-weight: 900;
    font-size: 0.86rem;
}

.media-info-plot {
    margin: 12px 0 14px;
    color: #d8e6ff;
    line-height: 1.55;
}

.media-info-details {
    display: grid;
    gap: 7px;
}

.media-detail-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.media-detail-row span:first-child {
    color: var(--muted);
}

.media-detail-row span:last-child,
.media-detail-row a {
    color: #fff;
    min-width: 0;
    overflow-wrap: anywhere;
}

.media-info-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.trailer-box {
    margin-top: 18px;
    border: 1px solid var(--line);
}

.trailer-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.trailer-frame iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

.trailer-frame .empty-state {
    height: 100%;
    display: grid;
    place-items: center;
}

@media (max-width: 1080px) {
    .app-main {
        grid-template-columns: 86px minmax(0, 1fr);
    }

    .tv-sidebar {
        padding-left: 8px;
        padding-right: 8px;
    }

    .rail-heading {
        place-items: center;
        margin-left: 0;
        margin-right: 0;
    }

    .rail-heading span,
    .rail-heading strong,
    .rail-item {
        font-size: 0;
    }

    .rail-logo {
        width: 44px;
        height: 44px;
    }

    .rail-item {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 0;
        padding: 0;
    }

    .live-browser {
        grid-template-columns: minmax(190px, 240px) minmax(280px, 1fr);
    }

    .epg-panel {
        display: none;
    }
}

@media (max-width: 760px) {
    html,
    body {
        width: 100%;
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .app-view {
        width: 100%;
        max-width: 100vw;
        min-height: 100vh;
        height: auto;
        grid-template-rows: auto auto;
        overflow: visible;
    }

    .app-main {
        width: 100%;
        max-width: 100vw;
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .tv-sidebar {
        position: sticky;
        top: 0;
        z-index: 20;
        grid-column: 1;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        padding: 8px 12px;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .rail-heading {
        display: none;
    }

    .rail-item {
        min-width: max-content;
        grid-template-columns: 22px auto;
        min-height: 40px;
        padding: 0 10px;
        font-size: 0.9rem;
    }

    .rail-icon {
        width: 20px;
        height: 20px;
    }

    .app-header,
    .section-bar,
    .home-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .app-header {
        position: sticky;
        top: 0;
        z-index: 30;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-content: start;
        flex-wrap: initial;
        min-height: 0;
        gap: 8px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .header-status {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .header-status .icon-button {
        width: 36px;
        height: 36px;
    }

    .refresh-button {
        min-height: 36px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .home-view {
        grid-column: 1;
        min-height: calc(100vh - 112px);
        padding: 82px 16px 72px;
    }

    .home-search {
        top: 16px;
        width: calc(100vw - 32px);
    }

    .global-result-row {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .global-result-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .global-result-button {
        flex: 1 1 0;
    }

    .home-tiles {
        grid-template-columns: 1fr;
    }

    .home-tile,
    .tile-live {
        height: 156px;
    }

    .detail-view {
        grid-column: 1;
        width: 100%;
        max-width: 100vw;
        height: auto;
        min-height: calc(100vh - 112px);
        display: grid;
        grid-template-rows: auto auto auto;
        padding: 0 12px 16px;
    }

    .section-bar {
        grid-template-columns: auto 1fr;
    }

    .section-tools {
        grid-column: 1 / -1;
    }

    .player-dock {
        position: static;
        grid-template-columns: 1fr;
    }

    .now-row {
        align-items: stretch;
        flex-direction: column;
    }

    .now-actions,
    .playback-actions {
        justify-items: stretch;
        justify-content: stretch;
    }

    .playback-actions .compact-button {
        flex: 1 1 130px;
    }

    .video-frame {
        aspect-ratio: 16 / 9;
    }

    .live-browser,
    .vod-browser,
    .my-list-browser,
    .recordings-browser {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .list-panel {
        min-height: 220px;
    }

    .category-list,
    .channel-list,
    .poster-grid,
    .my-list-sections,
    .recordings-list {
        max-height: 50vh;
    }

    .my-list-row {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .my-list-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .my-list-actions .compact-button {
        flex: 1 1 0;
    }

    .recording-row {
        grid-template-columns: 1fr;
    }

    .recording-actions {
        justify-content: stretch;
    }

    .recording-actions .compact-button,
    .recording-actions .danger-button {
        flex: 1 1 0;
    }

    .media-info-layout {
        grid-template-columns: 1fr;
    }

    .media-info-poster {
        width: min(220px, 62vw);
    }

    .settings-shell {
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .settings-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding-right: 0;
        padding-bottom: 12px;
    }

    .setting-row {
        grid-template-columns: 1fr;
    }

    .setting-row input[type="checkbox"] {
        justify-self: start;
    }

    .user-row {
        grid-template-columns: 1fr 1fr;
    }

    .user-row > div {
        grid-column: 1 / -1;
    }

    .list-users-button {
        position: static;
        justify-self: start;
        align-self: end;
        margin-bottom: 18px;
    }

    .login-view {
        align-content: center;
        gap: 18px;
    }
}
