/* =====================================================================
   Doramy — iOS-style theme for DLE 17.0
   Bootstrap 5.3.8 + Bootstrap Icons 1.13 · Human Interface inspired
   ===================================================================== */

:root {
    /* iOS system palette (light) */
    --ios-blue: #0a84ff;
    --ios-indigo: #5e5ce6;
    --ios-purple: #bf5af2;
    --ios-pink: #ff375f;
    --ios-red: #ff453a;
    --ios-orange: #ff9f0a;
    --ios-yellow: #ffd60a;
    --ios-green: #30d158;
    --ios-teal: #40c8e0;

    /* Dorama accent — soft rose on classic iOS surfaces */
    --accent: var(--ios-pink);
    --accent-2: #ff6b8a;
    --accent-grad: linear-gradient(135deg, #ff375f 0%, #ff9f0a 100%);
    --accent-grad-warm: linear-gradient(135deg, #ff375f 0%, #ff9f0a 100%);

    /* Surfaces */
    --bg: #f2f2f7;            /* iOS systemGroupedBackground */
    --bg-elevated: #ffffff;
    --card: rgba(255, 255, 255, 0.72);
    --card-solid: #ffffff;
    --card-2: #f7f7fb;
    --separator: rgba(60, 60, 67, 0.12);
    --separator-strong: rgba(60, 60, 67, 0.22);

    /* Text */
    --label: #1c1c1e;
    --label-2: rgba(60, 60, 67, 0.7);
    --label-3: rgba(60, 60, 67, 0.45);
    --on-accent: #ffffff;

    /* Glass blur */
    --blur: saturate(180%) blur(20px);

    /* Radii (iOS continuous corners) */
    --r-xs: 8px;
    --r-sm: 12px;
    --r-md: 16px;
    --r-lg: 22px;
    --r-xl: 28px;
    --r-pill: 999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.16);
    --shadow-accent: 0 8px 24px rgba(255, 55, 95, 0.35);

    --maxw: 1280px;
    --header-h: 60px;

    /* ---- Bridge variables expected by DLE engine.css / legacy popups ---- */
    --ui-bg: var(--card-solid);
    --ui-bg-darker: var(--card-2);
    --ui-bg-darkest: #e9e9ee;
    --ui-accent: var(--accent);
    --ui-bdc: var(--separator);
    --ui-tt-fade: var(--label-2);
    --ui-bsh: var(--shadow-lg);
    --ui-bsh-inset: inset 0 1px 2px rgba(0, 0, 0, 0.06);
    --ui-bdrs: var(--r-sm);
    --ui-red: var(--ios-red);
    --ui-green: var(--ios-green);
    --tt: var(--label);
    --bdrs: var(--r-md);
    --accent-red: var(--ios-pink);
    --bg-btn: var(--accent);
    --tt-btn: #fff;
    --bs-body-bg: #f2f2f7;
    --bs-body-color: #1c1c1e;
    --bs-border-color: rgba(60, 60, 67, 0.12);
    color-scheme: light;
}

/* ===== Light (явный override, в т.ч. когда OS в dark) ===== */
:root.light,
html[data-theme="light"] {
    --bg: #f2f2f7;
    --bg-elevated: #ffffff;
    --card: rgba(255, 255, 255, 0.86);
    --card-solid: #ffffff;
    --card-2: #f7f7fb;
    --separator: rgba(60, 60, 67, 0.12);
    --separator-strong: rgba(60, 60, 67, 0.22);
    --label: #1c1c1e;
    --label-2: rgba(60, 60, 67, 0.7);
    --label-3: rgba(60, 60, 67, 0.45);
    --ui-bg: #ffffff;
    --ui-bg-darker: #f7f7fb;
    --ui-bg-darkest: #e5e5ea;
    --ui-bdc: rgba(60, 60, 67, 0.12);
    --tt: #1c1c1e;
    --bs-body-bg: #f2f2f7;
    --bs-body-color: #1c1c1e;
    --bs-border-color: rgba(60, 60, 67, 0.12);
    color-scheme: light;
}

/* ===== Dark mode (auto + manual .dark) ===== */
@media (prefers-color-scheme: dark) {
    :root:not(.light):not([data-theme="light"]) {
        --bg: #000000;
        --bg-elevated: #1c1c1e;
        --card: rgba(28, 28, 30, 0.86);
        --card-solid: #1c1c1e;
        --card-2: #2c2c2e;
        --separator: rgba(84, 84, 88, 0.4);
        --separator-strong: rgba(84, 84, 88, 0.65);
        --label: #ffffff;
        --label-2: rgba(235, 235, 245, 0.6);
        --label-3: rgba(235, 235, 245, 0.35);
        --ui-bg: #1c1c1e;
        --ui-bg-darker: #2c2c2e;
        --ui-bg-darkest: #3a3a3c;
        --ui-bdc: rgba(84, 84, 88, 0.4);
        --tt: #ffffff;
        --bs-body-bg: #000000;
        --bs-body-color: #ffffff;
        --bs-border-color: rgba(84, 84, 88, 0.4);
        color-scheme: dark;
    }
}
:root.dark,
html[data-theme="dark"] {
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --card: rgba(28, 28, 30, 0.86);
    --card-solid: #1c1c1e;
    --card-2: #2c2c2e;
    --separator: rgba(84, 84, 88, 0.4);
    --separator-strong: rgba(84, 84, 88, 0.65);
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, 0.6);
    --label-3: rgba(235, 235, 245, 0.35);
    --ui-bg: #1c1c1e;
    --ui-bg-darker: #2c2c2e;
    --ui-bg-darkest: #3a3a3c;
    --ui-bdc: rgba(84, 84, 88, 0.4);
    --tt: #ffffff;
    --bs-body-bg: #000000;
    --bs-body-color: #ffffff;
    --bs-border-color: rgba(84, 84, 88, 0.4);
    color-scheme: dark;
}

/* Bootstrap / DLE leftovers that stay white in dark mode */
html.dark .scriptcode,
html.dark .title_spoiler,
html.dark .text_spoiler,
html.dark .hide,
html.dark .inhide,
html.dark #dropmenudiv,
html.dark .ui-menu,
html[data-theme="dark"] .scriptcode,
html[data-theme="dark"] .title_spoiler,
html[data-theme="dark"] .text_spoiler,
html[data-theme="dark"] .hide,
html[data-theme="dark"] .inhide,
html[data-theme="dark"] #dropmenudiv,
html[data-theme="dark"] .ui-menu {
    background: var(--card-2) !important;
    background-color: var(--card-2) !important;
    color: var(--label) !important;
    border-color: var(--separator) !important;
}

/* ===================== Base ===================== */
* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    background: var(--bg);
}
html.light, html[data-theme="light"] { color-scheme: light; }
html.dark, html[data-theme="dark"] { color-scheme: dark; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--label);
    background: var(--bg) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    padding-top: var(--header-h);
}

a { color: var(--accent); text-decoration: none; transition: color .2s, opacity .2s; }
a:hover { opacity: .85; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5 { margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
::selection { background: var(--accent); color: #fff; }

.container-ios { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* Bootstrap Icons sizing helpers */
.bi { line-height: 1; vertical-align: -0.08em; display: inline-block; }
.ios-nav .bi, .tabbar .bi, .section__title .bi, .widget__title .bi,
.btn-pill .bi, .icon-btn .bi, .stat-pill .bi { margin-right: 0; }
.section__title .bi, .widget__title .bi { margin-right: 6px; color: var(--accent); }
.ios-nav a .bi { margin-right: 6px; font-size: 16px; }
.btn-pill .bi { margin-right: 6px; font-size: 16px; }
.icon-btn .bi { font-size: 20px; }
.anime-card__play .bi { font-size: 32px; margin-left: 2px; }
.bi-sz-18, .ms-18 { font-size: 18px !important; }
.bi-sz-20, .ms-20 { font-size: 20px !important; }
.bi-sz-22, .ms-22 { font-size: 22px !important; }
.bi-sz-28, .ms-28 { font-size: 28px !important; }
.bi-sz-40, .ms-40 { font-size: 40px !important; }

/* ===================== Header (frosted) ===================== */
.ios-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    z-index: 1000;
    background: var(--card);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border-bottom: 0.5px solid var(--separator);
}
.ios-header__inner {
    height: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.ios-logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--label);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0;
}
.ios-logo span {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.ios-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.ios-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--r-pill);
    color: var(--label-2);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}
.ios-nav a:hover { background: var(--separator); color: var(--label); opacity: 1; }
.ios-nav a.is-active { background: var(--accent); color: #fff; }

/* Fullscreen mobile menu (outside header) */
.ios-menu { display: none; }
.ios-menu.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1400;
    background: var(--bg);
    overflow-y: auto;
    overscroll-behavior: contain;
    animation: iosMenuIn .28s cubic-bezier(.22, 1, .36, 1);
}
.ios-menu__panel {
    min-height: 100%;
    min-height: 100dvh;
    padding:
        calc(12px + env(safe-area-inset-top))
        calc(16px + env(safe-area-inset-right))
        calc(24px + env(safe-area-inset-bottom))
        calc(16px + env(safe-area-inset-left));
}
.ios-menu__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    margin-bottom: 18px;
}
.ios-menu__title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--label);
}
.ios-menu__group {
    display: flex;
    flex-direction: column;
    background: var(--card-solid);
    border-radius: var(--r-lg);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.ios-menu__group a {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 54px;
    padding: 12px 16px;
    font-size: 17px;
    font-weight: 500;
    color: var(--label);
    border-bottom: 0.5px solid var(--separator);
}
.ios-menu__group a:last-child { border-bottom: 0; }
.ios-menu__group a:active { background: var(--separator); }
.ios-menu__ico {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
    background: var(--accent-grad);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 55, 95, 0.28);
}
.ios-menu__ico .bi { margin: 0; font-size: 17px; color: #fff; line-height: 1; }
.ios-menu__chev { margin-left: auto; font-size: 14px; color: var(--label-3); }
body.menu-open { overflow: hidden; touch-action: none; }

.icon-btn {
    width: 40px; height: 40px;
    flex: 0 0 40px;
    display: inline-grid;
    place-items: center;
    border-radius: var(--r-pill);
    background: var(--separator);
    color: var(--label);
    border: 0;
    cursor: pointer;
    transition: background .2s, transform .1s;
}
.icon-btn:hover { background: var(--separator-strong); }
.icon-btn:active { transform: scale(0.92); }

.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--r-pill);
    border: 0;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-accent);
    transition: transform .12s ease, filter .2s, box-shadow .2s;
    white-space: nowrap;
}
.btn-pill:hover { filter: brightness(1.05); color: #fff; opacity: 1; }
.btn-pill:active { transform: scale(0.96); }
.btn-pill--ghost { background: var(--separator); color: var(--label); box-shadow: none; }
.btn-pill--grad { background: var(--accent-grad); }
.btn-pill--warm { background: var(--accent-grad-warm); box-shadow: 0 8px 24px rgba(255,55,95,.35); }

/* Header search */
.ios-search { position: relative; flex: 1; max-width: 360px; }
.ios-search input {
    width: 100%;
    height: 40px;
    border: 0;
    border-radius: var(--r-pill);
    background: var(--separator);
    padding: 0 16px 0 42px;
    color: var(--label);
    font-size: 15px;
}
.ios-search input::placeholder { color: var(--label-3); }
.ios-search .bi {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--label-2); font-size: 22px; pointer-events: none;
}

/* ===================== Layout ===================== */
.layout {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 20px 16px 90px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 22px;
    align-items: start;
}
.layout__main { min-width: 0; }
.layout__side { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 18px; }

/* ===================== Cards / sections ===================== */
.surface {
    background: var(--card-solid);
    border: 0.5px solid var(--separator);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}
.section { margin-bottom: 22px; }
.section__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.section__title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section__title .bi { color: var(--accent); }
.section__more { font-size: 14px; font-weight: 600; color: var(--accent); }

/* Speedbar / breadcrumbs */
.speedbar {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--label-2);
    margin-bottom: 14px; flex-wrap: wrap;
}
.speedbar a { color: var(--label-2); font-weight: 600; }

/* ===================== Hero carousel ===================== */
.hero { margin-bottom: 24px; }
.hero__track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding: 4px;
    padding: 4px 4px 12px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.hero__track::-webkit-scrollbar { display: none; }
.hero-card {
    position: relative;
    flex: 0 0 220px;
    aspect-ratio: 2/3;
    border-radius: var(--r-lg);
    overflow: hidden;
    scroll-snap-align: start;
    box-shadow: var(--shadow-md);
    transition: transform .25s ease;
}
.hero-card:hover { transform: translateY(-4px) scale(1.01); }
.hero-card img { width: 100%; height: 100%; object-fit: cover; }
.hero-card__overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.1) 55%, transparent 100%);
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 14px;
}
.hero-card__title { color: #fff; font-weight: 700; font-size: 16px; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-card__rank {
    position: absolute; top: 10px; left: 10px;
    background: var(--accent-grad-warm); color: #fff;
    font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: var(--r-pill);
    box-shadow: var(--shadow-sm);
}

/* ===================== Grid of cards ===================== */
.view-toolbar { display: flex; gap: 4px; background: var(--separator); border-radius: var(--r-pill); padding: 3px; }
.view-toolbar button {
    width: 36px; height: 32px; border: 0; background: transparent; border-radius: var(--r-pill);
    color: var(--label-2); cursor: pointer; display: inline-grid; place-items: center;
}
.view-toolbar button.active { background: var(--card-solid); color: var(--accent); box-shadow: var(--shadow-sm); }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
}
.cards-grid.grid-2 { grid-template-columns: repeat(2, 1fr); }
.cards-grid.list { grid-template-columns: 1fr; }
/* non-card children (pagination, profile, banners, system msgs) span the full row */
#dle-content > :not(.grid-item) { grid-column: 1 / -1; }

/* Anime poster card */
.anime-card {
    background: var(--card-solid);
    border: 0.5px solid var(--separator);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
    display: flex;
    flex-direction: column;
}
.anime-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.anime-card__poster { position: relative; aspect-ratio: 2/3; overflow: hidden; background: var(--card-2); }
.anime-card__poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.anime-card:hover .anime-card__poster img { transform: scale(1.06); }
.anime-card__badges { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.anime-card__play {
    position: absolute; inset: 0; display: grid; place-items: center;
    opacity: 0; transition: opacity .2s; background: rgba(0,0,0,.25);
}
.anime-card:hover .anime-card__play { opacity: 1; }
.anime-card__play span {
    width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
    background: rgba(255,255,255,.9); color: #000; box-shadow: var(--shadow-md);
}
.anime-card__body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.anime-card__title {
    font-size: 15px; font-weight: 700; line-height: 1.25; color: var(--label);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.anime-card__meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--label-2); margin-top: auto; }
.anime-card__meta .mi { display: inline-flex; align-items: center; gap: 3px; }

/* badges */
.badge-ios {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: var(--r-pill);
    background: rgba(0,0,0,.55); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.badge-ios--accent { background: var(--accent); }
.badge-ios--green { background: var(--ios-green); }
.badge-ios--red { background: var(--ios-red); }
.badge-ios--orange { background: var(--ios-orange); }
.badge-ios--shiki { background: linear-gradient(135deg,#3b5bdb,#5e5ce6); }
.badge-ios--imdb { background: #f5c518; color: #000; }

/* list view variant */
.cards-grid.list .anime-card { flex-direction: row; }
.cards-grid.list .anime-card__poster { flex: 0 0 110px; aspect-ratio: 2/3; }
.cards-grid.list .anime-card__body { padding: 14px 16px; }

/* ===================== Sidebar widgets ===================== */
.widget { padding: 16px; }
.widget__title { font-size: 17px; font-weight: 800; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.widget__title .bi { color: var(--accent); }
.genre-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.genre-chips a {
    font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: var(--r-pill);
    background: var(--separator); color: var(--label);
}
.genre-chips a:hover { background: var(--accent); color: #fff; opacity: 1; }

.mini-list { display: flex; flex-direction: column; gap: 12px; }
.mini-item { display: flex; gap: 12px; align-items: center; }
.mini-item__img { flex: 0 0 48px; width: 48px; height: 68px; border-radius: var(--r-xs); overflow: hidden; background: var(--card-2); }
.mini-item__img img { width: 100%; height: 100%; object-fit: cover; }
.mini-item__title { font-size: 14px; font-weight: 700; line-height: 1.25; color: var(--label);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-item__meta { font-size: 12px; color: var(--label-2); display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.mini-item__meta .bi { font-size: 15px; color: var(--ios-orange); }

/* ===================== Full story (anime page) ===================== */
.detail {
    position: relative;
    border-radius: var(--r-xl);
    overflow: hidden;
    margin-bottom: 22px;
    box-shadow: var(--shadow-md);
    background: #0b0b12; /* fallback so white text is always readable */
    isolation: isolate;
}
.detail__backdrop { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.detail__backdrop img { width: 100%; height: 100%; object-fit: cover; filter: blur(26px) saturate(150%); transform: scale(1.25); opacity: .6; }
/* Always-dark scrim guarantees contrast for white text in BOTH themes */
.detail__backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(105deg, rgba(0,0,0,.82) 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,.35) 100%),
        linear-gradient(0deg, rgba(0,0,0,.65) 0%, rgba(0,0,0,.1) 60%);
}
.detail__inner { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 22px; padding: 28px; }
.detail__head { display: flex; gap: 26px; align-items: flex-start; }
.detail__poster { flex: 0 0 220px; max-width: 220px; }
.detail__poster img { width: 100%; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); aspect-ratio: 2/3; object-fit: cover; display: block; }
.detail__info { flex: 1; min-width: 0; color: #fff; }
.detail__info .detail__title,
.detail__info a { color: #fff; }
.detail__info .detail__title { font-size: clamp(22px, 3vw, 32px); font-weight: 800; text-shadow: 0 2px 14px rgba(0,0,0,.55); margin-bottom: 6px; }
.detail__orig { color: rgba(255,255,255,.72); font-size: 15px; margin-bottom: 16px; }
.detail__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.detail__stats { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 18px; }
.stat-pill { display: flex; align-items: center; gap: 7px; color: #fff; font-weight: 700; font-size: 15px; }
.stat-pill .bi { font-size: 20px; }
.stat-pill--star .bi { color: var(--ios-yellow); }
.detail__props { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 20px; margin-bottom: 22px; }
.prop { font-size: 14px; color: rgba(255,255,255,.95); line-height: 1.45; }
.prop b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: rgba(255,255,255,.6); font-weight: 700; margin-bottom: 3px; }
.prop a { color: #fff; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255,255,255,.35); text-underline-offset: 2px; }
.detail__actions { display: flex; flex-wrap: wrap; gap: 12px; }
/* кнопки поверх тёмного hero — всегда контрастные (фикс светлой темы) */
.detail__actions .btn-pill--ghost {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.detail__actions .btn-pill--ghost .bi { color: #fff; }
.detail__actions .btn-pill--ghost:hover { background: rgba(255, 255, 255, 0.3); color: #fff; }
.detail__actions .fav-wrap { display: inline-flex; }
.detail__actions .fav-wrap > a { text-decoration: none; display: inline-flex; }
.detail__actions .fav-wrap .is-in-fav { background: rgba(48, 209, 88, 0.9); color: #fff; }
.detail__actions .btn-pill.is-listed { background: rgba(10, 132, 255, 0.9); color: #fff; }

/* description */
.prose { color: var(--label); font-size: 16px; line-height: 1.7; }
.prose p { margin: 0 0 1em; }

/* ===================== Segmented control / player tabs ===================== */
.segmented {
    display: inline-flex;
    background: var(--separator);
    border-radius: var(--r-md);
    padding: 4px;
    gap: 4px;
}
.segmented button {
    border: 0; background: transparent; cursor: pointer;
    padding: 8px 18px; border-radius: calc(var(--r-md) - 4px);
    font-size: 14px; font-weight: 600; color: var(--label-2);
    transition: all .2s;
}
.segmented button.is-active { background: var(--card-solid); color: var(--label); box-shadow: var(--shadow-sm); }

.player-card { padding: 16px; margin-bottom: 22px; }
.player-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.player-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 16px;
    border-radius: var(--r-pill);
    background: var(--accent-grad);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
    box-shadow: var(--shadow-accent);
}
.player-chip .bi { font-size: 15px; margin: 0; color: #fff; line-height: 1; }
.player-stage {
    position: relative;
    border-radius: var(--r-md);
    overflow: hidden;
    background: #000;
    /* Video.js v10 default is 2rem — match site radius */
    --media-border-radius: var(--r-md);
    --media-video-border-radius: var(--r-md);
}
.video-responsive { position: relative; padding-top: 56.25%; }
.video-responsive iframe,
.video-responsive video-player,
.video-responsive .player-vjs,
.player-stage iframe,
.player-stage .player-vjs {
    position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.player-vjs,
.player-vjs video-player,
.player-vjs video-skin,
.player-vjs hlsjs-video {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
}
.player-stage video-skin,
.player-stage .media-default-skin,
.player-stage hlsjs-video,
.player-stage video {
    border-radius: var(--r-md) !important;
}
video-player, #cdnvideohubvideoplayer { display: block; width: 100%; aspect-ratio: 16/9; }
.player-stage.is-loading::after {
    content: '';
    position: absolute; inset: 0; z-index: 3;
    background: rgba(0,0,0,.35);
    pointer-events: none;
}
.player-vjs-error {
    position: absolute; inset: 0; z-index: 4;
    display: grid; place-items: center;
    padding: 20px; text-align: center;
    color: #fff; background: rgba(0,0,0,.72);
    font-size: 14px; font-weight: 600;
}
iframe.player-iframe-fallback[hidden] { display: none !important; }
.tab-pane { display: none; }
.tab-pane.is-active { display: block; }

/* click-to-play poster placeholder (so the player is never an empty black void) */
.player-poster {
    position: absolute; inset: 0; z-index: 2; cursor: pointer;
    background-size: cover; background-position: center;
    display: flex; align-items: flex-end; justify-content: center;
    border-radius: inherit; overflow: hidden;
}
.player-poster::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.55) 100%);
    -webkit-backdrop-filter: saturate(120%); backdrop-filter: saturate(120%);
}
.player-poster__btn {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 76px; height: 76px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(255,255,255,.92); color: #000;
    display: grid; place-items: center; box-shadow: var(--shadow-lg);
    transition: transform .15s ease, background .2s;
}
.player-poster__btn .bi { font-size: 40px; margin-left: 3px; }
.player-poster:hover .player-poster__btn { transform: translate(-50%,-50%) scale(1.08); background: #fff; }
.player-poster__label {
    position: relative; z-index: 1; color: #fff; font-weight: 700; font-size: 15px;
    padding: 0 16px 16px; text-align: center; text-shadow: 0 2px 8px rgba(0,0,0,.6);
    display: flex; align-items: center; gap: 8px;
}
.player-stage.is-playing .player-poster { display: none; }

/* episode navigation buttons */
.episode-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 18px 0; }
.episode-nav a { display: inline-flex; align-items: center; gap: 6px; }

.episodes-list { display: flex; flex-wrap: wrap; gap: 8px; }
.episodes-list a {
    padding: 9px 15px; border-radius: var(--r-sm); background: var(--separator);
    color: var(--label); font-size: 14px; font-weight: 600;
}
.episodes-list a:hover, .episodes-list a.is-active { background: var(--accent); color: #fff; opacity: 1; }

/* rating box */
.rate-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.rate-box__label { font-weight: 700; display: flex; align-items: center; gap: 6px; color: var(--label-2); }
.rate-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
    border-radius: var(--r-pill); border: 0; cursor: pointer; font-weight: 700;
    background: var(--separator); color: var(--label);
}
.rate-btn--like:hover { background: var(--ios-green); color: #fff; }
.rate-btn--dislike:hover { background: var(--ios-red); color: #fff; }

.complaint-link { display: inline-flex; align-items: center; gap: 6px; color: var(--label-2); font-size: 14px; font-weight: 600; }

/* ===================== Countdown ===================== */
.countdown { padding: 18px; margin-bottom: 22px; text-align: center; }
.countdown__title { font-weight: 700; color: var(--label-2); margin-bottom: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.countdown__blocks { display: flex; align-items: center; justify-content: center; gap: 10px; }
.countdown__block { background: var(--card-2); border-radius: var(--r-md); padding: 12px 4px; min-width: 70px; }
.countdown__num { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.countdown__lbl { font-size: 12px; color: var(--label-2); text-transform: uppercase; letter-spacing: .04em; }
.countdown__sep { font-size: 26px; font-weight: 800; color: var(--label-3); }

/* ===================== Comments ===================== */
.comments-wrap { padding: 18px; }
#dle-comments-list,
.page__comments-list { margin: 0; padding: 0; }

/* DLE wraps comments in <ol>/<li> — hide browser numbers */
ol.comments-tree-list,
.comments-tree-list {
    list-style: none !important;
    margin: 0;
    padding: 0;
    counter-reset: none;
}
.comments-tree-item {
    list-style: none !important;
    margin: 0;
    padding: 0;
}
.comments-tree-item::marker,
.comments-tree-list::marker { content: none; display: none; }
.comments-tree-list .comments-tree-list {
    padding-left: 28px;
    margin-top: 4px;
    border-left: 2px solid var(--separator);
}

.comment { display: flex; gap: 12px; padding: 12px 0; }
.comment__avatar {
    flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
    background: var(--card-2); border: 2px solid var(--separator);
}
.comment__avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment__body { flex: 1; min-width: 0; }
.comment__bubble {
    background: var(--card-2);
    border-radius: 4px var(--r-md) var(--r-md) var(--r-md);
    padding: 12px 16px;
}
.comment--admin .comment__bubble { background: color-mix(in srgb, var(--accent) 8%, var(--card-2)); border: 0.5px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.comment__news {
    display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
    color: var(--accent); margin-bottom: 6px;
}
.comment__head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.comment__author,
.comment__author a {
    font-weight: 800; font-size: 14px; color: var(--label);
}
.comment--admin .comment__author,
.comment--admin .comment__author a { color: var(--accent); }
.comment__badge {
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
    background: var(--accent); color: #fff; padding: 2px 8px; border-radius: var(--r-pill);
}
.comment__online { width: 8px; height: 8px; border-radius: 50%; background: var(--ios-green); box-shadow: 0 0 0 2px rgba(48,209,88,.25); }
.comment__date { font-size: 12px; color: var(--label-3); }
.comment__rating { margin-left: auto; display: inline-flex; gap: 10px; }
.comment__rate { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; }
.comment__rate--up { color: var(--ios-green); }
.comment__rate--down { color: var(--ios-red); }
.comment__rate a { color: inherit; display: inline-flex; }
.comment__text { font-size: 15px; line-height: 1.6; word-break: break-word; color: var(--label); }
.comment__text img { max-width: 100%; border-radius: var(--r-sm); }
.comment__actions {
    display: flex; align-items: center; gap: 14px; margin: 8px 0 0 4px;
    font-size: 13px; color: var(--label-2); flex-wrap: wrap;
}
.comment__action { display: inline-flex; align-items: center; gap: 4px; }
.comment__action a { color: var(--label-2); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.comment__action a:hover { color: var(--accent); opacity: 1; }
.comment__ctrl { margin-left: auto; display: inline-flex; align-items: center; gap: 12px; }
.comment__ctrl .bi, .comment__ctrl a { color: var(--label-3); cursor: pointer; }
.comment__ctrl a:hover, .comment__ctrl .bi:hover { color: var(--ios-red); opacity: 1; }
.comment__ctrl input[type="checkbox"] {
    width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer;
}

/* Mass moderation bar */
.mass_comments_action {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--card-2);
    border-radius: var(--r-md);
    border: 0.5px solid var(--separator);
    font-size: 14px;
    font-weight: 600;
    color: var(--label-2);
}
.mass_comments_action select {
    min-height: 40px;
    border: 0;
    border-radius: var(--r-sm);
    background: var(--bg-elevated);
    color: var(--label);
    padding: 0 12px;
    font-size: 14px;
    font-weight: 600;
}
.mass_comments_action input.bbcodes,
.mass_comments_action .bbcodes {
    min-height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--r-pill);
    background: var(--accent-grad);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-accent);
}
.mass_comments_action input.bbcodes:hover { filter: brightness(1.05); }

.cform__footer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cform__hint { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; flex: 1; min-width: 200px; }
.cform__row--column { flex-direction: column; align-items: stretch; gap: 6px; }

.cform { display: flex; flex-direction: column; gap: 12px; }
.cform__row { display: flex; gap: 12px; flex-wrap: wrap; }
.field {
    width: 100%; height: 44px; border: 0.5px solid var(--separator); border-radius: var(--r-sm);
    background: var(--bg-elevated); color: var(--label); padding: 0 14px; font-size: 15px;
}
.field:focus { outline: 2px solid var(--accent); border-color: transparent; }
textarea.field { height: auto; min-height: 100px; padding: 12px 14px; resize: vertical; }

.info-banner {
    display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--label-2);
    background: var(--card-2); border-radius: var(--r-sm); padding: 10px 14px;
}

/* ===================== Carousel nav buttons ===================== */
.carousel-nav { display: flex; gap: 8px; }
.carousel-nav .icon-btn[disabled] { opacity: .35; pointer-events: none; }

/* ===================== Episodes: search & sort ===================== */
.episodes-search {
    position: relative;
    margin-bottom: 14px;
}
.episodes-search__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    color: var(--label-3);
    pointer-events: none;
    z-index: 2;
}
.episodes-search__icon .bi {
    position: static !important;
    transform: none !important;
    margin: 0 !important;
    font-size: 16px;
    line-height: 1;
    color: inherit;
}
.episodes-search input {
    width: 100%;
    height: 44px;
    border: 0.5px solid var(--separator);
    border-radius: var(--r-pill);
    background: var(--bg-elevated);
    color: var(--label);
    padding: 0 18px 0 46px !important;
    font-size: 15px;
    text-indent: 0;
}
.episodes-search input::placeholder { color: var(--label-3); opacity: 1; }
.episodes-search input:focus { outline: 2px solid var(--accent); border-color: transparent; }
[data-episodes-sort].is-desc .bi { transform: rotate(180deg); }
[data-episodes-sort] .bi { transition: transform .25s; }

/* ===================== Jikan episode timeline ===================== */
.jikan-timeline { display: flex; flex-direction: column; position: relative; }
.jikan-item {
    display: flex; align-items: center; gap: 14px; padding: 9px 0;
    position: relative; padding-left: 26px;
}
.jikan-item::before {
    content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px;
    background: var(--separator);
}
.jikan-item:first-child::before { top: 50%; }
.jikan-item:last-child::before { bottom: 50%; }
.jikan-item::after {
    content: ''; position: absolute; left: 3px; top: 50%; transform: translateY(-50%);
    width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.jikan-item--future::after { background: var(--label-3); box-shadow: 0 0 0 3px var(--separator); }
.jikan-item__num {
    flex: 0 0 auto; min-width: 44px; text-align: center; font-weight: 800; font-size: 13px;
    background: var(--separator); border-radius: var(--r-pill); padding: 4px 10px;
}
.jikan-item__title {
    flex: 1; min-width: 0; font-size: 14px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.jikan-item__date { flex: 0 0 auto; font-size: 13px; color: var(--label-2); display: inline-flex; align-items: center; gap: 5px; }
.jikan-item__score { flex: 0 0 auto; font-size: 13px; font-weight: 700; color: var(--ios-orange); display: inline-flex; align-items: center; gap: 3px; }
.jikan-item--filler .jikan-item__num { background: var(--ios-orange); color: #fff; }

/* ===================== Filter panel ===================== */
.filter-panel { margin-bottom: 18px; overflow: hidden; }
.filter-panel__summary {
    display: flex; align-items: center; gap: 8px; padding: 14px 18px;
    font-weight: 700; font-size: 15px; cursor: pointer; list-style: none; user-select: none;
}
.filter-panel__summary::-webkit-details-marker { display: none; }
.filter-panel__chev { margin-left: auto; transition: transform .25s; color: var(--label-3); }
.filter-panel[open] .filter-panel__chev { transform: rotate(90deg); }
.filter-panel__body {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px; padding: 4px 18px 16px;
}
.filter-panel__row { display: flex; flex-direction: column; gap: 5px; }
.filter-panel__row .form__label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--label-2); }
.filter-panel__actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }

/* ===================== Watch history ===================== */
.history-track {
    display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.history-track::-webkit-scrollbar { display: none; }
.history-card {
    flex: 0 0 210px; display: flex; gap: 10px; align-items: center;
    background: var(--card-solid); border: 0.5px solid var(--separator);
    border-radius: var(--r-md); padding: 8px; box-shadow: var(--shadow-sm);
    color: var(--label); transition: transform .2s, box-shadow .2s;
}
.history-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); opacity: 1; }
.history-card__img { flex: 0 0 44px; width: 44px; height: 60px; border-radius: var(--r-xs); overflow: hidden; background: var(--card-2); }
.history-card__img img { width: 100%; height: 100%; object-fit: cover; }
.history-card__title {
    font-size: 13px; font-weight: 700; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.history-card__ep { font-size: 12px; color: var(--accent); font-weight: 700; margin-top: 2px; display: inline-flex; align-items: center; gap: 4px; }

/* ===================== My lists ===================== */
.sheet--wide { width: min(560px, calc(100vw - 32px)); max-height: 86vh; overflow-y: auto; }
.lists-tabs { width: 100%; margin: 4px 0 14px; }
.lists-tabs button { flex: 1; padding: 8px 6px; font-size: 13px; }
.lists-items { display: flex; flex-direction: column; gap: 8px; }
.list-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--card-2); border-radius: var(--r-md); padding: 8px 10px;
}
.list-item__img { flex: 0 0 40px; width: 40px; height: 56px; border-radius: var(--r-xs); overflow: hidden; background: var(--separator); }
.list-item__img img { width: 100%; height: 100%; object-fit: cover; }
.list-item__img .bi { width: 100%; height: 100%; display: grid; place-items: center; color: var(--label-3); }
.list-item__body { flex: 1; min-width: 0; }
.list-item__title { font-size: 14px; font-weight: 700; color: var(--label); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item__meta { font-size: 12px; color: var(--label-2); }
.list-item__remove { color: var(--label-3); cursor: pointer; flex: 0 0 auto; }
.list-item__remove:hover { color: var(--ios-red); }
.lists-import__row { display: flex; gap: 10px; flex-wrap: wrap; }
.lists-import__row .field { flex: 1; min-width: 180px; }
.fav-wrap .is-in-fav { background: color-mix(in srgb, var(--ios-green) 18%, var(--separator)); color: var(--ios-green); }

/* list-add popover (status chooser) */
.list-choose {
    position: fixed; z-index: 1300; background: var(--card-solid);
    border: 0.5px solid var(--separator); border-radius: var(--r-md);
    box-shadow: var(--shadow-lg); padding: 6px; min-width: 230px;
    opacity: 0; transform: translateY(-6px) scale(.97);
    transition: opacity .18s ease, transform .18s ease;
}
.list-choose.is-open { opacity: 1; transform: translateY(0) scale(1); }
.list-choose__title {
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--label-2); padding: 8px 12px 6px;
}
.list-choose button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    background: transparent; border: 0; cursor: pointer;
    padding: 11px 12px; border-radius: var(--r-sm);
    color: var(--label); font-size: 14px; font-weight: 600; text-align: left;
    transition: background .15s;
}
.list-choose button:hover { background: var(--separator); }
.list-choose button .bi { color: var(--accent); font-size: 20px; flex: 0 0 auto; }
.list-choose__label { flex: 1; }
.list-choose__check { color: var(--ios-green) !important; }
.list-choose button.is-current { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.list-choose__hr { height: 0.5px; background: var(--separator); margin: 4px 8px; }
.list-choose__danger, .list-choose__danger .bi { color: var(--ios-red) !important; }
.btn-pill.is-listed { background: color-mix(in srgb, var(--accent) 16%, var(--separator)); color: var(--accent); }

/* ===================== My lists: grid variant + full page ===================== */
.lists-items--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.lists-items--grid .list-item { background: var(--card-2); }
.mylists-page {
    position: fixed; inset: 0; z-index: 1150; overflow-y: auto;
    background: var(--bg);
    padding: calc(var(--header-h) + 16px) 16px 40px;
}
.mylists-page__inner { max-width: 900px; margin: 0 auto; }
.mylists-page__head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.mylists-page .lists-tabs { width: 100%; margin-bottom: 16px; }
.mylists-page .lists-tabs button { flex: 1; }

/* ===================== Profile charts ===================== */
.profile-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.chart-card { min-width: 0; }
a.chart-card--link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: transform .15s, box-shadow .2s;
}
a.chart-card--link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    opacity: 1;
    color: inherit;
}
a.chart-card--link .widget__title {
    display: flex;
    align-items: center;
    gap: 8px;
}
a.chart-card--link .chart-card__go {
    margin-left: auto;
    font-size: 14px;
    color: var(--label-3);
}
.chart-donut-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.chart-donut { width: 130px; height: 130px; display: block; }
.chart-donut circle { transition: stroke-dasharray .6s ease; }
.chart-donut__num { font-size: 26px; font-weight: 800; fill: var(--label); }
.chart-donut__cap { font-size: 11px; fill: var(--label-2); }
.chart-legend { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 120px; }
.chart-legend__item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--label-2); }
.chart-legend__item b { color: var(--label); margin-left: auto; }
.chart-legend__dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.chart-empty { display: grid; place-items: center; height: 130px; color: var(--label-3); }
.chart-bars { display: flex; align-items: stretch; gap: 8px; height: 140px; padding-top: 8px; }
.chart-bar { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.chart-bar__col { flex: 1; display: flex; align-items: flex-end; background: var(--card-2); border-radius: var(--r-xs); overflow: hidden; }
.chart-bar__fill { width: 100%; background: var(--accent-grad); border-radius: var(--r-xs) var(--r-xs) 0 0; transition: height .5s ease; }
.chart-bar__label { text-align: center; font-size: 11px; color: var(--label-2); font-weight: 600; }

/* ===================== Live search results ===================== */
#search-suggest { background: var(--card-solid); border-radius: var(--r-md); box-shadow: var(--shadow-lg); overflow: hidden; }
#search-suggest:empty { display: none; }
.fs-results { max-height: min(430px, 60vh); overflow-y: auto; padding: 6px; }
.fs-item {
    display: flex; align-items: center; gap: 12px; padding: 8px 10px;
    border-radius: var(--r-sm); color: var(--label); transition: background .15s;
}
.fs-item:hover { background: var(--separator); opacity: 1; }
.fs-item__img { flex: 0 0 42px; width: 42px; height: 58px; border-radius: var(--r-xs); overflow: hidden; background: var(--card-2); }
.fs-item__img img { width: 100%; height: 100%; object-fit: cover; }
.fs-item__body { flex: 1; min-width: 0; }
.fs-item__title { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-item__meta { display: flex; gap: 10px; font-size: 12px; color: var(--label-2); }
.fs-item__rating { color: var(--ios-orange); font-weight: 700; display: inline-flex; align-items: center; gap: 2px; }
.fs-item__go { color: var(--label-3); flex: 0 0 auto; }
.fs-results .seperator { display: block; padding: 10px; text-align: center; }
.fs-results .seperator a { font-weight: 700; font-size: 14px; }
.fs-results .notfound { display: block; padding: 14px; text-align: center; color: var(--label-2); font-size: 14px; }
.fs-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px; color: var(--label-2); font-size: 14px; }
.fs-all { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; margin-top: 4px; font-weight: 700; font-size: 14px; color: var(--accent); border-top: 0.5px solid var(--separator); }
.fs-all:hover { background: var(--separator); opacity: 1; }

.spinner {
    width: 18px; height: 18px; border-radius: 50%; display: inline-block;
    border: 2.5px solid var(--separator); border-top-color: var(--accent);
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== Filter results bar ===================== */
.filter-result-bar {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 15px; margin-bottom: 14px;
    padding: 12px 16px; background: var(--card-solid);
    border: 0.5px solid var(--separator); border-radius: var(--r-md); box-shadow: var(--shadow-sm);
}

@media (max-width: 700px) {
    .profile-charts { grid-template-columns: 1fr; }
    .lists-items--grid { grid-template-columns: 1fr; }
    .mylists-page { padding: calc(var(--header-h) + 10px) 12px 90px; }
    .mylists-page .lists-tabs button { font-size: 12px; padding: 8px 4px; }
}

/* ===================== Info card ({info}) ===================== */
.info-card {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 18px 20px; margin-bottom: 18px;
    border-left: 4px solid var(--accent);
}
.info-card__icon {
    flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.info-card__title { font-weight: 800; font-size: 16px; margin-bottom: 2px; }
.info-card__text { color: var(--label-2); font-size: 14px; line-height: 1.6; }
.info-card__text a { font-weight: 600; }

/* ===================== Toast ===================== */
.toast-wrap {
    position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom));
    transform: translateX(-50%); z-index: 1500;
    display: flex; flex-direction: column; gap: 10px; align-items: center;
    width: max-content; max-width: calc(100vw - 24px); pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex; align-items: center; gap: 12px;
    background: var(--card-solid); color: var(--label);
    border: 0.5px solid var(--separator); border-left: 4px solid var(--accent);
    border-radius: var(--r-md); box-shadow: var(--shadow-lg);
    padding: 13px 14px 13px 16px; min-width: 280px; max-width: 460px;
    opacity: 0; transform: translateY(20px) scale(.96);
    transition: opacity .3s ease, transform .3s cubic-bezier(.22,1,.36,1);
}
.toast.is-open { opacity: 1; transform: translateY(0) scale(1); }
.toast__icon { flex: 0 0 auto; font-size: 24px; color: var(--accent); }
.toast--success { border-left-color: var(--ios-green); }
.toast--success .toast__icon { color: var(--ios-green); }
.toast--error { border-left-color: var(--ios-red); }
.toast--error .toast__icon { color: var(--ios-red); }
.toast--warning { border-left-color: var(--ios-orange); }
.toast--warning .toast__icon { color: var(--ios-orange); }
.toast__text { flex: 1; font-size: 14px; font-weight: 600; line-height: 1.4; }
.toast__close { flex: 0 0 auto; background: transparent; border: 0; cursor: pointer; color: var(--label-3); font-size: 20px; padding: 0; }
.toast__close:hover { color: var(--label); }
@media (max-width: 560px) {
    .toast-wrap { left: 12px; right: 12px; transform: none; width: auto; }
    .toast { min-width: 0; width: 100%; }
}

/* ===================== iOS alert (DLEalert replacement) ===================== */
.ios-alert-backdrop {
    position: fixed; inset: 0; z-index: 1400;
    background: rgba(0,0,0,.45);
    -webkit-backdrop-filter: saturate(160%) blur(8px); backdrop-filter: saturate(160%) blur(8px);
    display: grid; place-items: center; padding: 16px;
    opacity: 0; transition: opacity .2s;
}
.ios-alert-backdrop.is-open { opacity: 1; }
.ios-alert {
    width: min(340px, 100%); background: var(--card-solid);
    border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
    text-align: center; overflow: hidden;
    transform: scale(1.08); transition: transform .2s;
}
.ios-alert-backdrop.is-open .ios-alert { transform: scale(1); }
.ios-alert__body { padding: 22px 20px 18px; }
.ios-alert__icon { font-size: 40px; margin-bottom: 8px; color: var(--accent); }
.ios-alert__title { font-weight: 800; font-size: 17px; margin-bottom: 6px; color: var(--label); }
.ios-alert__text { font-size: 14px; color: var(--label-2); line-height: 1.5; word-break: break-word; }
.ios-alert__input { margin-top: 14px; }
.ios-alert__buttons { display: flex; border-top: 0.5px solid var(--separator); }
.ios-alert__buttons button {
    flex: 1; padding: 14px; background: transparent; border: 0; cursor: pointer;
    font-size: 16px; font-weight: 600; color: var(--accent);
}
.ios-alert__buttons button + button { border-left: 0.5px solid var(--separator); font-weight: 800; }
.ios-alert__buttons button:hover { background: var(--separator); }

/* ===================== SEO text block ===================== */
.seo-block { padding: 22px; margin-top: 22px; }
.seo-block h1, .seo-block h2 { color: var(--label); }
.seo-block h1 { font-size: 24px; }
.seo-block h2 { font-size: 20px; margin-top: 1em; }
.seo-block p { color: var(--label-2); line-height: 1.75; margin: 0 0 1em; }
.seo-block ul { display: flex; flex-direction: column; gap: 10px; margin: 0 0 1em; }
.seo-block ul li { position: relative; padding-left: 28px; color: var(--label-2); line-height: 1.6; }
.seo-block ul li::before {
    content: "\f26a";
    font-family: bootstrap-icons !important;
    position: absolute; left: 0; top: 1px;
    color: var(--ios-green); font-size: 20px;
    speak: never; font-style: normal; font-weight: 400 !important;
    font-variant: normal; text-transform: none; line-height: 1;
    -webkit-font-smoothing: antialiased;
}
.seo-block ul li strong { color: var(--label); }

/* ===================== Profile page ===================== */
.profile { width: 100%; max-width: 100%; margin: 0; }
.profile-hero {
    position: relative;
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 18px;
    background: var(--card-solid);
    border: 0.5px solid var(--separator);
}
.profile-hero__cover { height: 140px; background: var(--accent-grad); position: relative; }
.profile-hero__cover::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 120% at 80% 0%, rgba(255,255,255,.25), transparent 60%); }
.profile-hero__body { padding: 0 24px 22px; margin-top: -52px; position: relative; }
.profile-hero__avatar {
    width: 104px; height: 104px; border-radius: 50%; overflow: hidden;
    border: 4px solid var(--card-solid); box-shadow: var(--shadow-md); background: var(--card-2);
}
.profile-hero__avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero__name { font-size: 24px; font-weight: 800; margin: 12px 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--label-2); }
.profile-status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--label-3); }
.profile-status.on .dot { background: var(--ios-green); box-shadow: 0 0 0 3px rgba(48,209,88,.25); }
.profile-status.on { color: var(--ios-green); }
.profile-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); background: var(--separator); color: var(--label); }
.profile-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.profile-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
.profile-stat { background: var(--card-solid); border: 0.5px solid var(--separator); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.profile-stat__num { font-size: 26px; font-weight: 800; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.profile-stat__lbl { font-size: 13px; color: var(--label-2); font-weight: 600; }

.info-list { display: flex; flex-direction: column; }
.info-list li { display: flex; gap: 12px; padding: 13px 0; border-bottom: 0.5px solid var(--separator); font-size: 15px; align-items: flex-start; }
.info-list li:last-child { border-bottom: 0; }
.info-list li > span:first-child { flex: 0 0 150px; color: var(--label-2); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.info-list li .bi { color: var(--accent); font-size: 20px; }

/* Auth pages (registration / lost password) */
.auth-page { max-width: 620px; margin: 0 auto; }
.auth-page__title { font-size: clamp(24px, 4vw, 30px); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 14px; }
.auth-page__footnote { margin: 14px 0 0; font-size: 14px; color: var(--label-2); text-align: center; }
.auth-page__footnote a { color: var(--accent); font-weight: 600; }
.auth-page__submit { height: 48px; margin-top: 4px; width: 100%; justify-content: center; }
.auth-social-block:not(:has(.login__social a)) { display: none; }
.auth-social { padding: 8px 0; }
.auth-page select,
.ios-row select {
    width: 100%; height: 44px; border: 0.5px solid var(--separator); border-radius: var(--r-sm);
    background: var(--bg-elevated); color: var(--label); padding: 0 14px; font-size: 15px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238e8e93' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.auth-page select:focus,
.ios-row select:focus { outline: 2px solid var(--accent); border-color: transparent; }
.auth-page .field--file,
.ios-row .field--file {
    height: auto; min-height: 44px; padding: 10px 14px;
    font-size: 14px; color: var(--label-2);
}
.auth-page .field--file::file-selector-button {
    margin-right: 12px; border: 0; border-radius: var(--r-pill);
    background: var(--card-2); color: var(--label); font-weight: 700;
    padding: 8px 14px; cursor: pointer;
}
.ios-row__field { display: flex; gap: 10px; flex: 1; min-width: 0; flex-wrap: wrap; }
.ios-row__field .field { flex: 1; min-width: 0; }
.ios-row__field .btn-pill { flex: 0 0 auto; height: 44px; }

/* Search page */
.search-page { max-width: 760px; margin: 0 auto; }
.search-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.search-bar__field { flex: 1; min-width: 140px; }
.search-bar__field input, .search-bar__field select, .searchtable input[type="text"], .searchtable select { width: 100%; }
.search-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.has-radiobox label, .checkbox { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 560px) {
    .search-bar { flex-direction: column; align-items: stretch; }
    .search-bar .btn-pill { width: 100%; justify-content: center; height: 48px; }
    .search-actions .btn-pill { flex: 1 1 100%; justify-content: center; height: 48px; }
}
.auth-social { display: flex; flex-wrap: wrap; gap: 10px; }
#result-registration:not(:empty) { font-size: 13px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--card-2); color: var(--label-2); }

/* iOS grouped form sections (profile edit) */
.ios-group { background: var(--card-solid); border: 0.5px solid var(--separator); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 6px 16px; margin-bottom: 16px; }
.ios-group__title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--label-2); margin: 14px 4px 8px; }
.ios-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 0.5px solid var(--separator); flex-wrap: wrap; }
.ios-row:last-child { border-bottom: 0; }
.ios-row > label, .ios-row > .form__label, .ios-row .form__caption { flex: 0 0 180px; font-weight: 600; color: var(--label); }
.ios-row input[type="text"], .ios-row input[type="password"], .ios-row input[type="email"],
.ios-row select, .ios-row textarea, .ios-row .form__content { flex: 1; min-width: 200px; }

/* ===================== Calendar / Ongoings ===================== */
.content__title { margin-bottom: 18px; }
.content__title h1 {
    font-size: clamp(22px, 3vw, 28px); font-weight: 800; letter-spacing: -0.02em;
    display: flex; align-items: center; gap: 10px; margin: 0;
}
.content__title h1::before {
    content: "\f214";
    font-family: bootstrap-icons !important;
    color: var(--accent); font-size: 30px;
    speak: never; font-style: normal; font-weight: 400 !important;
    font-variant: normal; text-transform: none; line-height: 1;
    -webkit-font-smoothing: antialiased;
}

.next-series { margin-bottom: 26px; }
.next-series__title {
    font-size: 19px; font-weight: 800; letter-spacing: -0.02em;
    margin: 0 0 14px; display: flex; align-items: center; gap: 10px;
    text-transform: capitalize; color: var(--label);
}
.next-series__title::before {
    content: ''; width: 5px; height: 20px; border-radius: 3px;
    background: var(--accent-grad); flex: 0 0 auto;
}

.next-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}
.next-card {
    background: var(--card-solid);
    border: 0.5px solid var(--separator);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.next-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.next-card__link { display: flex; align-items: center; gap: 14px; padding: 10px; color: var(--label); }
.next-card__cover {
    position: relative; flex: 0 0 70px; width: 70px; height: 94px;
    border-radius: var(--r-sm); overflow: hidden; background: var(--card-2);
}
.next-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.next-card__content { display: flex; flex-direction: column; gap: 7px; min-width: 0; flex: 1; }
.next-card__title {
    font-weight: 700; font-size: 15px; line-height: 1.3; color: var(--label);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.next-card__episode {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: var(--r-pill);
    background: var(--accent); color: #fff; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.next-card__episode::before {
    content: "\f4f3";
    font-family: bootstrap-icons !important;
    font-size: 15px; line-height: 1;
    speak: never; font-style: normal; font-weight: 400 !important;
    font-variant: normal; text-transform: none;
    -webkit-font-smoothing: antialiased;
}
.next-card__watched { display: none; }

/* "release" (overdue) section gets a warm accent bar */
.next-series[aria-label="Уже должно выйти"] .next-series__title::before { background: var(--accent-grad-warm); }
.next-series[aria-label="Сегодня"] .next-card__episode { background: var(--ios-green); }

.message-info__title { font-weight: 800; font-size: 16px; color: var(--label); margin-bottom: 4px; }
.message-info__content { color: var(--label-2); }

/* Site rules */
.rules {
    display: flex; flex-direction: column; gap: 16px;
    max-width: 820px; margin: 0 auto;
}
.rules__intro {
    color: var(--label-2); font-size: 15px; line-height: 1.65;
    padding: 4px 2px 8px;
}
.rules__card {
    background: var(--card-solid); border: 0.5px solid var(--separator);
    border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 18px 20px;
}
.rules__card-head {
    display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.rules__card-ico {
    flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center; font-size: 20px;
    background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.rules__card-ico--warn {
    background: color-mix(in srgb, var(--ios-orange, #ff9f0a) 16%, transparent);
    color: var(--ios-orange, #ff9f0a);
}
.rules__card-ico--ok {
    background: color-mix(in srgb, var(--ios-green, #30d158) 16%, transparent);
    color: var(--ios-green, #30d158);
}
.rules__card-title {
    font-size: 17px; font-weight: 800; letter-spacing: -0.01em; margin: 0; color: var(--label);
}
.rules__card p {
    margin: 0 0 10px; color: var(--label-2); font-size: 14px; line-height: 1.65;
}
.rules__card p:last-child { margin-bottom: 0; }
.rules__list {
    margin: 0; padding: 0; list-style: none;
    display: flex; flex-direction: column; gap: 10px;
}
.rules__list li {
    position: relative; padding-left: 28px;
    color: var(--label-2); font-size: 14px; line-height: 1.55;
}
.rules__list li::before {
    content: "";
    position: absolute; left: 0; top: 0.35em;
    width: 18px; height: 18px; border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.rules__list li::after {
    content: "";
    position: absolute; left: 5px; top: 0.7em;
    width: 8px; height: 5px; border-left: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.rules__list--ban li::before {
    background: color-mix(in srgb, var(--ios-red, #ff453a) 14%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ios-red, #ff453a) 35%, transparent);
}
.rules__list--ban li::after {
    content: "×"; left: 0; top: 0.2em; width: 18px; height: 18px;
    border: 0; transform: none; color: var(--ios-red, #ff453a);
    font-size: 14px; font-weight: 800; display: grid; place-items: center;
    line-height: 1;
}
.rules__note {
    font-size: 13px; color: var(--label-2); line-height: 1.55;
    padding: 12px 14px; border-radius: var(--r-md);
    background: var(--card-2); border: 0.5px solid var(--separator);
}
.rules__actions { text-align: center; margin-top: 8px; }

@media (max-width: 600px) {
    .next-list { grid-template-columns: 1fr; gap: 10px; }
    .next-series__title { font-size: 17px; }
}

/* ===================== Footer ===================== */
.ios-footer {
    border-top: 0.5px solid var(--separator);
    padding: 26px 16px;
    text-align: center;
    color: var(--label-2);
    font-size: 14px;
}
.ios-footer a { font-weight: 600; }

/* ===================== Mobile bottom tab bar ===================== */
.tabbar { display: none; }

/* ===================== Pagination ===================== */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
    margin: 24px 0;
}
.pagination span, .pagination a, .pagination .nav_block {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 12px; border-radius: var(--r-pill);
    background: var(--separator); color: var(--label); font-weight: 700; font-size: 15px;
    flex: 0 0 auto;
}
.pagination a:hover { background: var(--accent); color: #fff; opacity: 1; }
.pagination .thisclass, .pagination b { background: var(--accent); color: #fff; }

@media (max-width: 560px) {
    /* horizontal scroll strip so many pages never overflow / wrap messily */
    .pagination {
        flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto;
        gap: 8px; padding: 4px 2px 10px; margin: 18px 0;
        -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
        scrollbar-width: none; scroll-snap-type: x proximity;
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
        mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
    }
    .pagination::-webkit-scrollbar { display: none; }
    .pagination span, .pagination a, .pagination .nav_block {
        min-width: 44px; height: 44px; font-size: 16px; scroll-snap-align: center;
    }
    .pagination .thisclass, .pagination b { scroll-snap-align: center; }
}

/* ===================== Search overlay ===================== */
.search-overlay {
    position: fixed; inset: 0; z-index: 1100; display: none;
    background: rgba(0,0,0,.4); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.search-overlay.is-open { display: block; }
.search-overlay__panel {
    max-width: 640px; margin: 80px auto 0; padding: 0 16px;
}
.search-overlay__box { display: flex; align-items: center; gap: 10px; background: var(--card-solid); border-radius: var(--r-md); padding: 8px 14px; box-shadow: var(--shadow-lg); }
.search-overlay__box form { flex: 1; min-width: 0; width: 100%; margin: 0; }
.search-overlay__box input,
.search-overlay__box #story {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
    font-size: 18px;
    color: var(--label);
    -webkit-appearance: none;
    appearance: none;
}
.search-overlay__box input:focus,
.search-overlay__box #story:focus {
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}
#search-suggest { margin-top: 12px; }

/* ===================== Login sheet ===================== */
.sheet-backdrop { position: fixed; inset: 0; z-index: 1100; background: rgba(0,0,0,.4); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: none; }
.sheet-backdrop.is-open { display: block; }
.sheet {
    position: fixed; z-index: 1101; left: 50%; top: 50%; transform: translate(-50%,-50%) scale(.96);
    width: min(420px, calc(100vw - 32px)); background: var(--card-solid); border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg); padding: 24px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.sheet.is-open { opacity: 1; pointer-events: auto; transform: translate(-50%,-50%) scale(1); }
.sheet__title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.sheet__sub { color: var(--label-2); font-size: 14px; margin-bottom: 18px; }
.sheet__close { position: absolute; top: 16px; right: 16px; }
.form-stack { display: flex; flex-direction: column; gap: 12px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--label-2); cursor: pointer; }
.login-sheet__links { text-align: center; font-size: 14px; color: var(--label-2); }
.login-sheet__links a { color: var(--accent); font-weight: 600; }
.sheet .login__social { justify-content: center; margin-top: 4px; }
.sheet .login__social:not(:has(a)) { display: none; }
.tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; flex: 1; background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
    padding: 0; min-width: 0;
}
.tabbar button .bi { font-size: 22px; }

/* user dropdown in header */
.user-menu { position: relative; }
.user-menu__avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; cursor: pointer; border: 2px solid var(--separator); }
.user-menu__avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-menu__panel {
    position: absolute; right: 0; top: 52px; width: 260px; background: var(--card-solid);
    border-radius: var(--r-md); box-shadow: var(--shadow-lg); border: 0.5px solid var(--separator);
    padding: 8px; display: none; z-index: 1200;
}
.user-menu__panel.is-open { display: block; }
.user-menu__panel a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--label); font-weight: 600; font-size: 14px; }
.user-menu__panel a:hover { background: var(--separator); opacity: 1; }
.user-menu__panel .bi { color: var(--label-2); font-size: 20px; }
.user-menu__hr { height: 0.5px; background: var(--separator); margin: 6px 8px; }

/* related carousel */
.related-track { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.related-track::-webkit-scrollbar { display: none; }
.related-track > * { flex: 0 0 150px; }
.episodes-list { -webkit-overflow-scrolling: touch; }

/* utility */
.d-none { display: none !important; }
.js-mobile-only { display: none; }
.flex-grow-1 { flex: 1; }
.text-fade { color: var(--label-2); }
.mt-auto { margin-top: auto; }

/* ===================== Responsive ===================== */
@media (max-width: 1024px) {
    .layout { grid-template-columns: 1fr; }
    .layout__side { position: static; order: 3; }
}
@media (max-width: 900px) {
    .layout { padding: 16px 14px 90px; gap: 18px; }
}

@media (max-width: 768px) {
    :root { --header-h: 56px; }
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    .container-ios { padding: 0 14px; }
    .ios-header__inner { gap: 10px; padding: 0 14px; }
    .ios-logo { font-size: 19px; margin-right: auto; } /* push action buttons to the right */
    .ios-nav.desktop-nav, .ios-search.desktop-only { display: none; }
    .js-mobile-only { display: inline-grid; }
    .ios-header .btn-pill { display: none; } /* guest "Войти" -> use tab bar */
    body.menu-open .tabbar { visibility: hidden; pointer-events: none; }

    /* Detail hero: poster + title side by side, meta below */
    .detail__inner { padding: 16px; gap: 16px; }
    .detail { margin-bottom: 16px; }
    .detail__head { gap: 14px; }
    .detail__poster { flex: 0 0 120px; max-width: 120px; margin: 0; }
    .detail__info { text-align: left; }
    .detail__info .detail__title { font-size: 19px; }
    .detail__chips { margin-bottom: 10px; }
    .detail__stats { gap: 14px 18px; margin-bottom: 0; }
    .detail__props { grid-template-columns: 1fr 1fr; gap: 12px 16px; }
    .detail__actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .detail__actions .btn-pill { width: 100%; justify-content: center; height: 48px; }

    .hero-card { flex-basis: 132px; }
    .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .section__title { font-size: 20px; }

    /* full-width surfaces feel more native on phones */
    .player-card, .surface.section, .comments-wrap, .seo-block, .countdown { border-radius: var(--r-md); }
    .segmented { width: 100%; }
    .segmented button { flex: 1; }
    .player-head { gap: 10px; }

    /* sheets become bottom sheets on mobile */
    .sheet {
        top: auto; bottom: 0; left: 0; transform: translateY(20px);
        width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0;
        padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
    }
    .sheet.is-open { transform: translateY(0); }
    .search-overlay__panel { margin-top: 12px; padding: 0 12px; }

    /* Profile page mobile adaptation */
    .profile-hero__cover { height: 110px; }
    .profile-hero__body { padding: 0 16px 18px; margin-top: -46px; }
    .profile-hero__avatar { width: 86px; height: 86px; }
    .profile-hero__name { font-size: 20px; }
    .info-list li { flex-direction: column; gap: 2px; }
    .info-list li > span:first-child { flex: none; }
    .ios-row { flex-direction: column; align-items: stretch; gap: 8px; }
    .ios-row > label, .ios-row > .form__label, .ios-row .form__caption { flex: none; }
    .ios-row input[type="text"], .ios-row input[type="password"], .ios-row input[type="email"],
    .ios-row select, .ios-row textarea, .ios-row .form__content { min-width: 0; }
    .profile-stat__num { font-size: 22px; }

    /* iOS bottom tab bar */
    .tabbar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
        background: var(--card); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
        border-top: 0.5px solid var(--separator); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
        justify-content: space-around;
    }
    .tabbar a, .tabbar button {
        display: flex; flex-direction: column; align-items: center; gap: 2px;
        font-size: 10px; font-weight: 600; color: var(--label-2); padding: 4px 8px; flex: 1;
        background: none; border: 0; cursor: pointer; font-family: inherit;
    }
    .tabbar a.is-active { color: var(--accent); }
    .tabbar a .bi, .tabbar button .bi { font-size: 22px; margin-right: 0; display: block; margin-bottom: 2px; }
    .tabbar a:active, .tabbar button:active { opacity: .6; }
}

@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes iosMenuIn {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 420px) {
    .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .anime-card__title { font-size: 14px; }
    .section__title { font-size: 18px; }
    .detail__poster { flex-basis: 104px; max-width: 104px; }
    .profile-stats { gap: 8px; }
}
