/* ==========================================================================
   Beleme — site stylesheet

   Keeps the original identity — charcoal sidebar, yellow accent, Fira Sans,
   white cards on light grey — but modernised: softer radii, clearer
   typography, a real responsive layout instead of a fixed 220px column.
   ========================================================================== */

:root {
    --sidebar: #121212;
    --sidebar-soft: #1b1b1b;
    --sidebar-ink: #d7d7d7;
    --accent: #f0c620;
    --accent-ink: #1d1a05;
    --bg: #f4f4f5;
    --panel: #ffffff;
    --ink: #17181c;
    --ink-soft: #4a4c55;
    --muted: #7c8089;
    --line: #e6e6e9;
    --danger: #d4462b;
    --ok: #1f9d55;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 18, 24, .05), 0 8px 24px -16px rgba(16, 18, 24, .35);
    --sidebar-w: 248px;
    --font: "Fira Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
    outline: 2px solid #b08f00;
    outline-offset: 2px;
    border-radius: 6px;
}

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; top: -80px; left: 12px; z-index: 300;
    padding: 10px 16px; border-radius: 8px;
    background: var(--accent); color: var(--accent-ink);
    font-weight: 500; transition: top .18s ease;
}
.skip-link:focus { top: 12px; }

/* --- Sidebar ------------------------------------------------------------- */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 120;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    padding: 22px 14px 16px;
    background: var(--sidebar);
    color: var(--sidebar-ink);
    overflow-y: auto;
}

.sidebar__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 22px;
}
.sidebar__logo { width: 118px; height: auto; }
.sidebar__name {
    font-size: 21px;
    font-weight: 300;
    letter-spacing: .01em;
    color: #fff;
}

.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }

.sidebar__nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-ink);
    font-size: 14.5px;
    transition: background .15s ease, color .15s ease;
}
.sidebar__nav a img {
    width: 19px; height: 19px;
    opacity: .82;
    transition: opacity .15s ease;
}
.sidebar__nav a:hover { background: #1d1d1d; color: #fff; }
.sidebar__nav a:hover img { opacity: 1; }

.sidebar__nav a.is-active {
    background: #000;
    color: #fff;
}
.sidebar__nav a.is-active::before {
    content: "";
    position: absolute;
    left: 0; top: 10px; bottom: 10px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}
.sidebar__nav a.is-active img { opacity: 1; }

.sidebar__foot {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid #262626;
}
.sidebar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px 12px;
}
.sidebar__user-meta { display: flex; flex-direction: column; min-width: 0; }
.sidebar__user-name {
    color: #fff; font-size: 14px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar__logout { color: #9a9a9a; font-size: 12.5px; }
.sidebar__logout:hover { color: var(--accent); }

.sidebar__copyright {
    color: #6d6d6d;
    font-size: 12px;
    font-weight: 300;
    text-align: center;
}

/* --- Layout -------------------------------------------------------------- */
.layout {
    min-height: 100vh;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px clamp(18px, 3vw, 34px);
    background: rgba(244, 244, 245, .88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, .05);
}

.search {
    display: flex;
    flex: 1 1 auto;
    max-width: 560px;
    gap: 8px;
}
.search__input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 14.5px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.search__input::placeholder { color: #a4a7ae; }
.search__input:focus {
    outline: none;
    border-color: #d8c14a;
    box-shadow: 0 0 0 3px rgba(240, 198, 32, .22);
}
.search__button {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 0;
    border-radius: 999px;
    background: var(--sidebar);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s ease;
}
.search__button:hover { background: #2a2a2a; }

.topbar__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.content {
    flex: 1 1 auto;
    width: 100%;
    max-width: 1360px;
    padding: 26px clamp(18px, 3vw, 34px) 56px;
    margin: 0 auto;
}

/* --- Buttons & chips ----------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: background .16s ease, border-color .16s ease, transform .16s ease, color .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn img { width: 16px; height: 16px; filter: brightness(0) invert(1); opacity: .9; }

.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: #ffd83d; }
.btn--accent img { filter: none; }

.btn--ghost {
    background: #fff;
    border-color: var(--line);
    color: var(--ink-soft);
}
.btn--ghost:hover { border-color: #cfcfd4; color: var(--ink); }

.btn--sm { padding: 8px 15px; font-size: 13px; }
.btn--block { width: 100%; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-soft);
    font-size: 13.5px;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.chip:hover { border-color: #cfcfd4; color: var(--ink); }
.chip.is-active {
    background: var(--sidebar);
    border-color: var(--sidebar);
    color: #fff;
}
.chip--static { background: #f2f2f4; border-color: #f2f2f4; color: var(--ink-soft); }
.chip--user { gap: 8px; padding: 5px 12px 5px 5px; }

/* --- Panels -------------------------------------------------------------- */
.panel {
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(18px, 2.4vw, 26px);
    margin-bottom: 20px;
}

.panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.panel__kicker {
    font-size: 11.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}
.panel__title { font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
.panel__title--sm { font-size: 1.15rem; }
.panel__note { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.panel__link {
    font-size: 13.5px;
    color: var(--ink-soft);
    border-bottom: 1px dashed #cfcfd4;
    padding-bottom: 1px;
}
.panel__link:hover { color: var(--ink); border-color: var(--ink-soft); }

.counter {
    display: inline-block;
    min-width: 24px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #f2f2f4;
    color: var(--ink-soft);
    font-size: 12.5px;
    text-align: center;
    vertical-align: middle;
}

.crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--muted);
}
.crumbs a:hover { color: var(--ink); }

/* --- Filters ------------------------------------------------------------- */
.filters { margin-bottom: 22px; }
.filters__row { display: flex; flex-wrap: wrap; gap: 8px; }
.filters__reset {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    color: var(--muted);
    border-bottom: 1px dashed #d6d6da;
}
.filters__reset:hover { color: var(--ink); }

/* --- Episode grid -------------------------------------------------------- */
.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: 22px 20px;
}

.episode-card { display: flex; flex-direction: column; min-width: 0; }

.episode-card__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #e9e9ec;
}
.episode-card__media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.episode-card__media:hover img { transform: scale(1.04); }

.episode-card__placeholder {
    display: grid;
    place-items: center;
    width: 100%; height: 100%;
    background:
        radial-gradient(circle at 30% 25%, rgba(240, 198, 32, .22), transparent 60%),
        linear-gradient(150deg, #26262a, #141417);
}
.episode-card__placeholder img { filter: brightness(0) invert(1); opacity: .55; width: 34px; height: 34px; }

.episode-card__badge {
    position: absolute;
    left: 8px; top: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .68);
    color: #fff;
    font-size: 11.5px;
    font-weight: 500;
}

.episode-card__body { padding: 10px 2px 0; }
.episode-card__title { font-size: 15px; font-weight: 500; line-height: 1.35; }
.episode-card__title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.episode-card__channel {
    display: inline-block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--muted);
}
.episode-card__channel:hover { color: var(--ink-soft); }

.episode-card__stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 7px;
    font-size: 12px;
    color: var(--muted);
}
.episode-card__stats li { display: inline-flex; align-items: center; gap: 4px; }
.episode-card__stats img {
    width: 14px; height: 14px;
    filter: brightness(0) saturate(100%);
    opacity: .45;
}

/* --- Empty state --------------------------------------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 44px 20px 50px;
}
.empty-state__icon { opacity: .3; }
.empty-state__title { font-size: 1.2rem; }
.empty-state__text { color: var(--muted); max-width: 46ch; }
.empty-state .btn { margin-top: 12px; }

/* --- Pagination ---------------------------------------------------------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 28px;
}
.pagination__step {
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 13.5px;
    color: var(--ink-soft);
    transition: border-color .15s ease, color .15s ease;
}
.pagination__step:hover { border-color: #cfcfd4; color: var(--ink); }
.pagination__step.is-disabled { opacity: .45; pointer-events: none; }
.pagination__status { font-size: 13px; color: var(--muted); }

/* --- Channels ------------------------------------------------------------ */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.channel-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fbfbfc;
    border: 1px solid var(--line);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.channel-card:hover {
    transform: translateY(-3px);
    border-color: #dcdce1;
    box-shadow: 0 16px 30px -22px rgba(16, 18, 24, .5);
}

.channel-card__cover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 7;
    background-size: cover;
    background-position: center;
    background-color: #e9e9ec;
}
.channel-card__cover--empty {
    background-image: linear-gradient(140deg, #232326, #131316);
}
.channel-card__logo {
    position: absolute;
    left: 14px; bottom: -22px;
    display: grid;
    place-items: center;
    width: 52px; height: 52px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
    overflow: hidden;
}
.channel-card__logo img { width: 100%; height: 100%; object-fit: cover; }
.channel-card__cover--empty .channel-card__logo img { filter: brightness(0); opacity: .45; width: 26px; height: 26px; }

.channel-card__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 28px 16px 16px;
}
.channel-card__name { font-weight: 500; font-size: 15px; }
.channel-card__category { font-size: 12.5px; color: var(--muted); }
.channel-card__meta { font-size: 12.5px; color: var(--muted); }

/* --- Channel page -------------------------------------------------------- */
.panel--channel { padding: 0; overflow: hidden; }
.channel-hero {
    height: clamp(120px, 18vw, 210px);
    background-size: cover;
    background-position: center;
    background-color: #e9e9ec;
}
.channel-hero--empty {
    background-image:
        radial-gradient(circle at 20% 20%, rgba(240, 198, 32, .22), transparent 55%),
        linear-gradient(130deg, #232326, #131316);
}

.channel-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 clamp(18px, 2.4vw, 26px) 18px;
}
.channel-head--compact { align-items: center; }

.channel-head__logo {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 84px; height: 84px;
    /* Overlap the cover image without dragging the whole row up (that used to
       clip the channel name against the panel's overflow). */
    margin-top: -42px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--line);
    overflow: hidden;
    box-shadow: 0 8px 20px -14px rgba(0, 0, 0, .5);
}
.channel-head__logo img { width: 100%; height: 100%; object-fit: cover; }
.channel-head__logo img[width="34"] { width: 34px; height: 34px; filter: brightness(0); opacity: .4; }

.channel-head__meta { flex: 1 1 auto; min-width: 0; padding-top: 8px; }
.channel-head--compact .channel-head__meta { padding-top: 0; }
.channel-head__name { font-size: clamp(1.25rem, 2.2vw, 1.65rem); }
.channel-head__sub {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}
.channel-head__sub a:hover { color: var(--ink-soft); }
.channel-head__actions { flex: 0 0 auto; }

.channel-desc {
    padding: 0 clamp(18px, 2.4vw, 26px) 22px;
    color: var(--ink-soft);
    font-size: 14px;
    max-width: 78ch;
}
.channel-desc p + p { margin-top: 8px; }

.season-badge {
    display: grid;
    place-items: center;
    width: 56px; height: 56px;
    border-radius: 16px;
    background: var(--sidebar);
    color: var(--accent);
    font-size: 20px;
    font-weight: 500;
}

/* --- Season list --------------------------------------------------------- */
.season-list { display: flex; flex-direction: column; gap: 8px; }
.season-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfbfc;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.season-row:hover { border-color: #d8d8dd; background: #fff; transform: translateX(3px); }
.season-row__number {
    display: grid; place-items: center;
    width: 30px; height: 30px;
    border-radius: 9px;
    background: #f2f2f4;
    font-size: 13px;
    color: var(--ink-soft);
}
.season-row__name { flex: 1 1 auto; font-size: 14.5px; }
.season-row__count { font-size: 12.5px; color: var(--muted); }

/* --- Watch page ---------------------------------------------------------- */
.watch { margin-bottom: 20px; }

.watch__player {
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow);
}
.player {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}
.player--missing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #cfcfd4;
    background:
        radial-gradient(circle at 50% 40%, rgba(240, 198, 32, .12), transparent 60%),
        #111114;
    text-align: center;
    padding: 20px;
}
.player--missing img { filter: brightness(0) invert(1); opacity: .5; }
.player--missing p { font-size: 15px; color: #ededf0; }
.player--missing span { font-size: 13px; color: #8f9099; }

.watch__info {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(18px, 2.4vw, 26px);
    margin-top: 18px;
}
.watch__title { font-size: clamp(1.3rem, 2.4vw, 1.75rem); }
.watch__meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
}
.watch__meta li { display: inline-flex; align-items: center; gap: 5px; }
.watch__meta img { width: 15px; height: 15px; filter: brightness(0); opacity: .4; }

.watch__links {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin-top: 10px;
    font-size: 14px;
}
.watch__links a { color: var(--ink-soft); }
.watch__links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.watch__actions {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.watch__actions form { display: flex; }

.watch__description {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 14px;
    max-width: 82ch;
}
.watch__description p + p { margin-top: 8px; }

/* --- Comments ------------------------------------------------------------ */
.comment-form { display: flex; gap: 12px; margin-bottom: 22px; }
.comment-form__body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

.comments { display: flex; flex-direction: column; gap: 16px; }
.comment { display: flex; gap: 12px; }
.comment__body { min-width: 0; }
.comment__head {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
    font-size: 13px;
}
.comment__author { font-weight: 500; }
.comment__head time { color: var(--muted); font-size: 12.5px; }
.comment__text { margin-top: 3px; font-size: 14px; color: var(--ink-soft); }

/* --- Avatars ------------------------------------------------------------- */
.avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #e9e9ec;
    overflow: hidden;
    color: #6c6f78;
    font-weight: 500;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--xs { width: 24px; height: 24px; font-size: 11px; }
.avatar--sm { width: 38px; height: 38px; font-size: 15px; }
.avatar--lg { width: 88px; height: 88px; font-size: 30px; }
.avatar__initial { text-transform: uppercase; }

/* --- Profile ------------------------------------------------------------- */
.profile-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-head__meta { flex: 1 1 auto; min-width: 0; }
.profile-head__name { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.profile-head__line { margin-top: 4px; font-size: 14px; }
.profile-head__line--muted { color: var(--muted); font-size: 13px; }
.profile-head__actions { display: flex; gap: 10px; }

/* --- Settings ------------------------------------------------------------ */
.settings { display: grid; gap: 26px; }
.settings__block {
    display: grid;
    gap: 14px;
    max-width: 520px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}
.settings__block:last-child { border-bottom: 0; padding-bottom: 0; }
.settings__title { font-size: 1.05rem; }
.settings__block .btn { justify-self: start; }

.field { display: grid; gap: 6px; }
.field label { font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.field__hint { font-size: 12.5px; color: var(--muted); }
.field__error { font-size: 12.5px; color: var(--danger); }

.input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 14.5px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: #a4a7ae; }
.input:focus {
    outline: none;
    border-color: #d8c14a;
    box-shadow: 0 0 0 3px rgba(240, 198, 32, .22);
}
.input--area { min-height: 96px; resize: vertical; }

.switch {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--ink-soft);
    cursor: pointer;
}
.switch input { width: 18px; height: 18px; accent-color: #b08f00; }

/* --- Auth ---------------------------------------------------------------- */
.auth {
    display: flex;
    justify-content: center;
    padding: 8vh 0 12vh;
}
.auth__card {
    width: 100%;
    max-width: 420px;
    padding: clamp(24px, 3vw, 34px);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}
.auth__title { font-size: 1.6rem; text-align: center; }
.auth__lead {
    margin: 8px 0 22px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}
.auth__card form { display: grid; gap: 14px; }
.auth__alt {
    margin-top: 18px;
    text-align: center;
    font-size: 13.5px;
    color: var(--muted);
}
.auth__alt a { color: var(--ink); border-bottom: 1px dashed #cfcfd4; }
.auth__icon { margin: 0 auto 14px; opacity: .8; }
.auth__card--ban .auth__icon,
.auth__card--empty .auth__icon { opacity: .55; }

.form-error {
    margin-bottom: 16px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(212, 70, 43, .09);
    color: var(--danger);
    font-size: 13.5px;
}

/* --- Messages ------------------------------------------------------------ */
.messages {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 14px clamp(18px, 3vw, 34px) 0;
    display: grid;
    gap: 8px;
}
.message {
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    background: #fff;
    border-left: 3px solid var(--ok);
    box-shadow: var(--shadow);
    font-size: 14px;
}
.message--error { border-left-color: var(--danger); }
.message--info { border-left-color: #6b7cff; }

/* --- Drawer (mobile) ----------------------------------------------------- */
.drawer-toggle {
    position: fixed;
    top: 12px; left: 12px;
    z-index: 140;
    display: none;
    width: 42px; height: 42px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    background: var(--sidebar);
    cursor: pointer;
}
.drawer-toggle__bars { display: grid; gap: 4px; width: 18px; }
.drawer-toggle__bars i {
    display: block; height: 2px; border-radius: 2px;
    background: #fff;
    transition: transform .2s ease, opacity .2s ease;
}
.drawer-toggle[aria-expanded="true"] .drawer-toggle__bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.drawer-toggle[aria-expanded="true"] .drawer-toggle__bars i:nth-child(2) { opacity: 0; }
.drawer-toggle[aria-expanded="true"] .drawer-toggle__bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(8, 8, 10, .5);
    backdrop-filter: blur(2px);
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .24s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, .4);
    }
    .sidebar.is-open { transform: none; }
    .layout { margin-left: 0; }
    .drawer-toggle { display: inline-flex; }
    .topbar { padding-left: 66px; }
    .watch__info { padding: 18px; }
}

@media (max-width: 620px) {
    body { font-size: 14.5px; }
    .content { padding: 18px 14px 44px; }
    /* Tighter panel padding plus a smaller minimum gives two cards per row on
       a 390px screen instead of one oversized card. */
    .panel { padding: 14px; border-radius: 12px; }
    .episode-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px 12px; }
    .episode-card__title { font-size: 13.5px; }
    .episode-card__stats { gap: 8px; font-size: 11.5px; }
    .channel-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .channel-card__logo { width: 42px; height: 42px; left: 10px; bottom: -18px; border-radius: 11px; }
    .search__button { display: none; }
    /* Wrap instead of squeezing: the actions row keeps its own line so the
       search field never forces a horizontal scrollbar. */
    .topbar { flex-wrap: wrap; gap: 10px; }
    .search { flex: 1 1 100%; order: 2; }
    .topbar__actions { order: 1; margin-left: auto; }
    .topbar__actions .btn { padding: 8px 12px; font-size: 12.5px; }
    .channel-head { flex-wrap: wrap; }
    .channel-head__actions { width: 100%; }
    .channel-head__actions .btn { width: 100%; }
    .profile-head { gap: 14px; }
    .auth { padding: 4vh 0 8vh; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}
