/* MyGirls.me redesign layer for DLE. Loaded after style.css/engine.css. */
:root {
    --mg-bg: #08090d;
    --mg-bg-soft: #11131a;
    --mg-surface: rgba(22, 24, 34, .92);
    --mg-surface-2: rgba(32, 35, 48, .96);
    --mg-border: rgba(255,255,255,.10);
    --mg-text: #f7f7fb;
    --mg-muted: #a7acbb;
    --mg-soft: #d7d9e3;
    --mg-accent: #ff4f89;
    --mg-accent-2: #7c5cff;
    --mg-accent-3: #00d4ff;
    --mg-good: #39e58c;
    --mg-danger: #ff5b5b;
    --mg-shadow: 0 24px 70px rgba(0,0,0,.45);
    --mg-radius-xl: 30px;
    --mg-radius-lg: 22px;
    --mg-radius-md: 16px;
    --mg-radius-sm: 12px;
    --mg-container: 1240px;
    --mg-header-h: 76px;
}

html[data-theme="light"] {
    --mg-bg: #f5f6fb;
    --mg-bg-soft: #ffffff;
    --mg-surface: rgba(255,255,255,.95);
    --mg-surface-2: rgba(249,250,255,.98);
    --mg-border: rgba(16,20,30,.10);
    --mg-text: #151722;
    --mg-muted: #626a7d;
    --mg-soft: #303544;
    --mg-shadow: 0 18px 55px rgba(23,33,64,.13);
}

html { background: var(--mg-bg); scroll-behavior: smooth; }
body.mg-shell {
    padding-top: var(--mg-header-h) !important;
    background:
        radial-gradient(circle at 15% -10%, rgba(255,79,137,.22), transparent 32rem),
        radial-gradient(circle at 85% 0%, rgba(124,92,255,.20), transparent 30rem),
        linear-gradient(180deg, var(--mg-bg), var(--mg-bg-soft) 48%, var(--mg-bg));
    color: var(--mg-text);
    font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

body.mg-shell a { color: inherit; text-decoration: none; }
body.mg-shell a:hover { text-decoration: none; }
body.mg-shell img { max-width: 100%; height: auto; }
body.mg-shell .container { width: min(100% - 28px, var(--mg-container)); max-width: var(--mg-container); }
body.mg-shell .row:before,
body.mg-shell .row:after { display: none; }

/* Header */
.mg-navbar.navbar {
    min-height: var(--mg-header-h);
    border: 0 !important;
    background: rgba(8,9,13,.76) !important;
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    box-shadow: 0 1px 0 var(--mg-border), 0 16px 50px rgba(0,0,0,.16);
}
html[data-theme="light"] .mg-navbar.navbar { background: rgba(255,255,255,.78) !important; }
.mg-nav-container { display: flex; align-items: center; min-height: var(--mg-header-h); }
.mg-navbar-header { display: flex; align-items: center; min-height: var(--mg-header-h); }
.mg-brand.navbar-brand {
    height: var(--mg-header-h);
    padding: 0 20px 0 0 !important;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--mg-text) !important;
    letter-spacing: -.02em;
}
.mg-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--mg-accent), var(--mg-accent-2));
    box-shadow: 0 10px 28px rgba(255,79,137,.28);
}
.mg-brand-name { font-size: 23px; font-weight: 900; line-height: 1; }
.mg-brand-name span { color: var(--mg-accent); }
.mg-collapse { flex: 1; }
.mg-nav-links > li > a,
.mg-nav-actions > li > a {
    color: var(--mg-soft) !important;
    font-weight: 760;
    font-size: 14px;
    padding: 10px 12px !important;
    margin: 17px 2px;
    border-radius: 999px;
}
.mg-nav-links > li > a:hover,
.mg-nav-actions > li > a:hover,
.mg-nav-links > li > a:focus,
.mg-nav-actions > li > a:focus {
    color: var(--mg-text) !important;
    background: rgba(255,255,255,.08) !important;
}
html[data-theme="light"] .mg-nav-links > li > a:hover,
html[data-theme="light"] .mg-nav-actions > li > a:hover { background: linear-gradient(135deg, rgba(255,79,137,.95), rgba(124,92,255,.95)) !important; color: #fff !important;}
.mg-nav-cta {
    color: #fff !important;
    background: linear-gradient(135deg, rgba(255,79,137,.95), rgba(124,92,255,.95)) !important;
    box-shadow: 0 12px 30px rgba(255,79,137,.22);
}
.mg-action-link { display: flex !important; align-items: center; gap: 8px; }
.mg-action-link .fa { font-size: 15px; }
.mg-theme-toggle {
    border: 1px solid var(--mg-border);
    background: var(--mg-surface-2);
    color: var(--mg-text);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
    margin: 19px 0 0 6px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 13px;
    box-shadow: none;
}
.mg-theme-toggle:hover { border-color: rgba(255,79,137,.45); }
.mg-theme-icon { width: 18px; display: inline-block; text-align: center; }
.mg-menu-toggle.navbar-toggle,
.mg-mobile-search.navbar-toggle,
.mg-mobile-user.navbar-toggle {
    background: var(--mg-surface-2) !important;
    border: 1px solid var(--mg-border) !important;
    color: var(--mg-text) !important;
    border-radius: 13px;
    margin-top: 17px;
    margin-right: 8px;
    width: 44px;
    height: 44px;
    padding: 0 !important;
    display: none;
    align-items: center;
    justify-content: center;
}
.mg-menu-lines { display: grid; gap: 4px; }
.mg-menu-lines span { display: block; width: 18px; height: 2px; border-radius: 5px; background: var(--mg-text); }

/* Hero */
.mg-main { position: relative; z-index: 1; }
.mg-hero { padding: 32px 0 18px; }
.mg-hero-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    padding: 34px;
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-xl);
    background:
        linear-gradient(135deg, rgba(255,79,137,.16), rgba(124,92,255,.12) 38%, transparent 66%),
        var(--mg-surface);
    box-shadow: var(--mg-shadow);
}
.mg-hero-card:before {
    content: "";
    position: absolute;
    inset: auto -80px -130px auto;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,212,255,.24), transparent 68%);
    pointer-events: none;
}
.mg-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--mg-accent);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 11px;
}
.mg-kicker:before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mg-accent);
    box-shadow: 0 0 0 6px rgba(255,79,137,.13);
}
.mg-hero-title {
    margin: 12px 0 10px;
    color: var(--mg-text);
    font-size: clamp(32px, 5vw, 62px);
    line-height: .98;
    letter-spacing: -.055em;
    font-weight: 950;
    max-width: 760px;
}
.mg-hero-text {
    color: var(--mg-muted);
    font-size: 16px;
    line-height: 1.7;
    max-width: 760px;
    margin: 0 0 22px;
}
.mg-hero-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    width: min(100%, 760px);
    border-radius: 999px;
    background: var(--mg-bg-soft);
    border: 1px solid var(--mg-border);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.mg-hero-search input {
    flex: 1;
    min-width: 0;
    height: 50px;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--mg-text);
    padding: 0 16px;
    font-size: 16px;
}
.mg-hero-search input::placeholder { color: var(--mg-muted); }
.mg-hero-search button,
.mg-primary-btn,
.mg-secondary-btn,
.mg-section-link {
    border: 0;
    border-radius: 999px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 20px;
    color: #fff !important;
    font-weight: 900;
    background: linear-gradient(135deg, var(--mg-accent), var(--mg-accent-2));
    box-shadow: 0 14px 34px rgba(255,79,137,.24);
}
.mg-hero-search button:hover,
.mg-primary-btn:hover,
.mg-section-link:hover { color: #fff !important; }
.mg-secondary-btn {
    color: var(--mg-text) !important;
    background: var(--mg-surface-2);
    border: 1px solid var(--mg-border);
    box-shadow: none;
}
.mg-hero-panel {
    position: relative;
    display: grid;
    gap: 14px;
    align-content: center;
}
.mg-stat-pill {
    border: 1px solid var(--mg-border);
    border-radius: 20px;
    padding: 18px;
    background: rgba(255,255,255,.06);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}
html[data-theme="light"] .mg-stat-pill { background: rgba(255,255,255,.56); }
.mg-stat-pill strong { display: block; color: var(--mg-text); font-size: 28px; line-height: 1; }
.mg-stat-pill span { display: block; color: var(--mg-muted); margin-top: 6px; font-weight: 750; }
.mg-quick-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px 2px 0;
}
.mg-quick-links a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--mg-border);
    border-radius: 999px;
    background: var(--mg-surface);
    color: var(--mg-soft);
    font-weight: 800;
}
.mg-quick-links a:hover { border-color: rgba(255,79,137,.45); background: var(--mg-surface-2); }

/* Content grid */
.mg-content { padding: 22px 0 56px; }
.mg-top-content { padding-top: 34px; }
.mg-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 10px 0 18px;
}
.mg-section-head h1,
.mg-section-head h2,
.page-header span {
    margin: 4px 0 0;
    color: var(--mg-text) !important;
    font-size: clamp(26px, 3vw, 38px) !important;
    line-height: 1.05;
    letter-spacing: -.035em;
    font-weight: 950 !important;
    border: 0 !important;
    padding: 0 !important;
}
.page-header {
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 14px 0 18px !important;
}
.mg-section-link { min-height: 40px; padding: 0 16px; font-size: 13px; }
.mg-card-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));
    gap: 18px;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
.mg-card-grid > .thumb,
.mg-card-grid > [class*="col-"] {
    float: none !important;
    width: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
}
.thumb.mg-card-cell { min-width: 0; }
.item.mg-card {
    height: 100%;
    overflow: hidden;
    border-radius: var(--mg-radius-lg) !important;
    background: var(--mg-surface) !important;
    border: 1px solid var(--mg-border);
    padding: 0 !important;
}
.item.mg-card:hover {
    border-color: rgba(255,79,137,.45);
}
.mg-card-link { display: flex; flex-direction: column; height: 100%; color: var(--mg-text) !important; }
.image.mg-card-media,
.short-img.mg-card-media,
.top-img.mg-card-media,
.short-actress.mg-card-media {
    position: relative;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #111;
    border-radius: calc(var(--mg-radius-lg) - 1px) calc(var(--mg-radius-lg) - 1px) 0 0;
}
.mg-person-card .mg-card-media { aspect-ratio: 4 / 5; }
.mg-card-media img,
.short-img img,
.top-img img,
.short-actress img,
.star_block img {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    object-fit: cover;
    display: block;
    transform: scale(1.01);
}
.item.mg-card:hover .mg-card-media img { transform: scale(1.07); filter: saturate(1.08) contrast(1.04); }
.mg-card-media:after {
    content: "";
    position: absolute;
    inset: 45% 0 0;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,.62));
    pointer-events: none;
}
.length.mg-card-badge,
.most.mg-card-badge,
.views.mg-card-views {
    position: absolute !important;
    z-index: 2;
    top: 12px !important;
    left: 12px !important;
    right: auto !important;
    bottom: auto !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: calc(100% - 24px);
    min-height: 30px;
    padding: 0 10px !important;
    border-radius: 999px !important;
    color: #fff !important;
    background: rgba(0,0,0,.62) !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    text-shadow: none !important;
    font-size: 12px !important;
    font-weight: 850;
    line-height: 1;
}
.views.mg-card-views {
    left: auto !important;
    right: 12px !important;
    background: rgba(255,79,137,.82) !important;
}
.mg-card-badge-hot { background: rgba(255,79,137,.88) !important; }
.mg-card-badge-best { background: rgba(124,92,255,.88) !important; }
.about.mg-card-about {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    z-index: 3;
    color: #fff;
    background: rgba(0,0,0,.66) !important;
    border-radius: 14px;
    opacity: 1 !important;
    font-size: 12px;
    line-height: 1.45;
    padding: 10px !important;
}
.name.mg-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 75px;
    padding: 14px 14px 13px;
    text-align: left;
}
.name > h2.mg-card-title,
.mg-card-title {
    color: var(--mg-text) !important;
    height: auto !important;
    min-height: 42px;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 15px !important;
    line-height: 1.38 !important;
    font-weight: 880;
}
.mg-card-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--mg-muted);
    font-size: 12px;
    font-weight: 850;
}
.mg-card-meta .fa { color: var(--mg-accent); font-size: 16px; }
.star_block.mg-person-media {
    position: relative;
    overflow: hidden;
    border-radius: var(--mg-radius-lg) !important;
    background: var(--mg-surface-2) !important;
    box-shadow: none !important;
}
.star_name.mg-person-name {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto !important;
    padding: 10px 12px !important;
    border-radius: 16px !important;
    background: rgba(0,0,0,.62) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    font-size: 15px !important;
    font-weight: 900;
}

/* Watch page */
.mg-watch-header {
    padding: 34px 0 18px;
    background: linear-gradient(180deg, rgba(255,79,137,.08), transparent);
}
.video_header.mg-watch-title {
    margin: 10px 0 !important;
    padding: 0 !important;
    color: var(--mg-text) !important;
    font-size: clamp(28px, 4.8vw, 56px) !important;
    line-height: 1.02;
    letter-spacing: -.045em;
    font-weight: 950;
    text-align: left;
}
.mg-watch-meta-top,
.mg-tagline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--mg-muted);
    font-weight: 800;
}
.mg-watch-meta-top span,
.mg-tagline span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--mg-border);
    border-radius: 999px;
    background: var(--mg-surface);
}
.mg-watch-meta-top .fa,
.mg-tagline .fa { color: var(--mg-accent); }
.video_play.mg-watch-stage {
    background: transparent !important;
    box-shadow: none !important;
    padding: 10px 0 24px !important;
    text-align: left !important;
}
.mg-watch-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}
.mg-player-card,
.mg-side-card,
.mg-video-description,
.mg-comments,
.form-wrap,
.search-page,
.us-prof {
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    background: var(--mg-surface);
    box-shadow: 0 16px 44px rgba(0,0,0,.22);
}
.mg-player-card { overflow: hidden; }
.video-box.mg-embed-target {
    position: relative;
    display: block;
    width: 100%;
    background: #050507;
    border-radius: var(--mg-radius-lg);
    overflow: hidden;
}
.mg-gallery-fallback { position: relative; display: grid; gap: 10px; padding: 10px; }
.mg-main-poster {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: calc(var(--mg-radius-lg) - 6px);
    aspect-ratio: 16 / 9;
    background: #000;
}
.mg-main-poster img,
.mg-thumb-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mg-thumb-poster {
    display: inline-block;
    width: 120px;
    height: 80px;
    overflow: hidden;
    border-radius: 14px;
}
.mg-poster-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 34px;
    background: radial-gradient(circle, rgba(255,79,137,.45), rgba(0,0,0,.08) 35%, rgba(0,0,0,.28));
}
.mg-poster-play .fa {
    width: 74px;
    height: 74px;
    display: grid;
    place-items: center;
    padding-left: 5px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mg-accent), var(--mg-accent-2));
    box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.mg-embed-frame,
.video-box.mg-embed-target iframe {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    min-height: 320px;
    display: block;
    border: 0;
    border-radius: var(--mg-radius-lg);
    background: #000;
}
.video-box.mg-embed-loaded .mg-gallery-fallback { display: none; }
.video-box.mg-embed-loaded { aspect-ratio: 16 / 9; }
.mg-hidden-source { display: none !important; }
.mg-watch-side { display: grid; gap: 14px; }
.mg-side-card { padding: 18px; box-shadow: 0 12px 34px rgba(0,0,0,.16); }
.mg-side-card h2 { margin: 0 0 8px; color: var(--mg-text); font-weight: 950; font-size: 18px; }
.mg-side-card p { color: var(--mg-muted); line-height: 1.55; margin-bottom: 14px; }
.mg-info-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.mg-info-card li { display: grid; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--mg-border); }
.mg-info-card li:last-child { border-bottom: 0; padding-bottom: 0; }
.mg-info-card span { color: var(--mg-muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.mg-info-card strong { color: var(--mg-text); font-weight: 850; overflow-wrap: anywhere; }
.mg-chat-frame { display: none; margin-top: 14px; border-radius: 16px; border: 1px solid var(--mg-border) !important; background: var(--mg-bg-soft); }
.mg-chat-card.is-loaded .mg-chat-frame { display: block; }
.mg-chat-card.is-loaded .mg-chat-load { display: none; }
.mg-watch-actions { padding: 18px 0 0 !important; }
.mg-action-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.mg-action-row .bt_l { float: none !important; margin: 0 !important; }
.btn.btn-danger,
.button,
.add-comm-btn.button {
    border-radius: 999px !important;
    border: 1px solid var(--mg-border) !important;
    background: var(--mg-surface-2) !important;
    color: var(--mg-text) !important;
    box-shadow: none !important;
    font-weight: 900;
}
.btn.btn-danger:hover,
.button:hover,
.add-comm-btn.button:hover { border-color: rgba(255,79,137,.45) !important; color: var(--mg-accent) !important; }
.favor { height: auto !important; line-height: 1.2 !important; margin-right: 0 !important; }
.btn-danger .badge,
.badge.like-badge { background: var(--mg-accent) !important; color: #fff !important; }
.mg-watch-content { padding: 18px 0 56px; }
.video_description.mg-video-description {
    color: var(--mg-soft) !important;
    padding: 22px !important;
    font-size: 15px;
    line-height: 1.75;
    margin-bottom: 18px;
}
.mg-video-description img { padding: 6px !important; border-radius: 18px; }
.mg-tagline { margin: 0 0 22px; }
.mg-related-head { margin-top: 28px; }
.mg-comments { padding: 18px; margin-top: 24px; }
.mg-comments-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--mg-text); font-weight: 950; font-size: 18px; }
.mg-partner-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.mg-partner-links a { color: var(--mg-muted); font-weight: 750; }

/* Search overlay */
#search.mg-search-overlay {
    background: rgba(8,9,13,.88) !important;
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    height: 100vh;
}
html[data-theme="light"] #search.mg-search-overlay { background: rgba(245,246,251,.90) !important; }
#search.mg-search-overlay input[type="search"] {
    height: 64px;
    max-width: 880px !important;
    border-radius: 999px !important;
    background: var(--mg-surface) !important;
    color: var(--mg-text) !important;
    border: 1px solid var(--mg-border) !important;
    box-shadow: var(--mg-shadow);
    padding-left: 24px !important;
}
#search.mg-search-overlay .btn,
#search.mg-search-overlay .close {
    background: linear-gradient(135deg, var(--mg-accent), var(--mg-accent-2)) !important;
    border: 0 !important;
    color: #fff !important;
    box-shadow: 0 12px 30px rgba(255,79,137,.24);
}
#search .search_input_frame { top: 50%; left: 50%; right: auto; width: min(90vw, 900px); transform: translate(-50%, -50%); }
#search .btn { top: 50% !important; right: calc(50% - min(45vw, 450px) + 10px) !important; transform: translateY(-50%); }
#search .close { top: 24px !important; left: 24px !important; }

/* Footer, pagination, forms */
.foot.mg-footer {
    margin-top: 0;
    border-top: 1px solid var(--mg-border) !important;
    background: var(--mg-surface);
    box-shadow: none !important;
    color: var(--mg-muted);
    padding: 28px 0;
}
.mg-footer-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.mg-footer-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--mg-text) !important; font-weight: 950; font-size: 20px; }
.mg-footer-brand span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--mg-accent), var(--mg-accent-2)); font-size: 12px; }
.mg-footer-links { display: flex; flex-wrap: wrap; gap: 12px; }
.mg-footer-links a { color: var(--mg-muted); font-weight: 800; }
.foot_text.mg-footer-text {
    margin: 18px 0 0 !important;
    padding: 0 !important;
    background: none !important;
    text-align: left !important;
    color: var(--mg-muted) !important;
    line-height: 1.7;
}
.mg-top-link.affix,
#top-link-block.affix,
#top-link-block.affix-top {
    left: auto !important;
    right: 20px !important;
    bottom: 20px !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.mg-top-link a,
#top-link-block a {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #fff !important;
    background: linear-gradient(135deg, var(--mg-accent), var(--mg-accent-2));
    box-shadow: 0 14px 34px rgba(255,79,137,.24);
    font-size: 24px;
    font-weight: 900;
}
.mg-pagination { margin: 28px 0 0 !important; text-align: center; }
.mg-pagination .navigation { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.mg-pagination a,
.mg-pagination span:not(.navigation),
.navigation a,
.navigation span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--mg-border);
    background: var(--mg-surface);
    color: var(--mg-text);
    font-weight: 850;
}
.navigation span { background: linear-gradient(135deg, var(--mg-accent), var(--mg-accent-2)); color: #fff; }
.form-wrap,
.search-page,
.us-prof { padding: 22px; color: var(--mg-text); }
input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select,
.form-control {
    border: 1px solid var(--mg-border) !important;
    border-radius: 14px !important;
    background: var(--mg-bg-soft) !important;
    color: var(--mg-text) !important;
    box-shadow: none !important;
}
.login-box {
    background: var(--mg-surface) !important;
    color: var(--mg-text) !important;
    border-radius: var(--mg-radius-lg) !important;
}

@media (max-width: 1199px) {
    .mg-nav-links > li > a, .mg-nav-actions > li > a { padding-left: 9px !important; padding-right: 9px !important; }
    .mg-action-link span { display: none; }
    .mg-hero-card { grid-template-columns: 1fr; }
    .mg-hero-panel { grid-template-columns: repeat(3, 1fr); }
    .mg-watch-layout { grid-template-columns: 1fr; }
    .mg-watch-side { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1200px) {
    :root { --mg-header-h: 70px; }
    .mg-nav-container { display: block; width: min(100% - 22px, var(--mg-container)); }
    .mg-navbar-header { justify-content: space-between; }
    .mg-brand.navbar-brand { padding-right: 0 !important; }
    .mg-brand-name { font-size: 20px; }
    .mg-menu-toggle.navbar-toggle,
    .mg-mobile-search.navbar-toggle,
    .mg-mobile-user.navbar-toggle { display: inline-flex; float: none; }
    .mg-menu-toggle { order: 2; }
    .mg-mobile-search { order: 3; }
    .mg-mobile-user { order: 4; }
    .mg-collapse.navbar-collapse {
        border-top: 1px solid var(--mg-border) !important;
        box-shadow: none !important;
        padding: 0px 0 15px;
        max-height: calc(119vh - var(--mg-header-h));
    }
    .mg-nav-links,
    .mg-nav-actions { float: none !important; margin: 0 !important; }
    .mg-nav-links > li,
    .mg-nav-actions > li { float: none !important; }
    .mg-nav-links > li > a,
    .mg-nav-actions > li > a {
        margin: 5px 0 !important;
        padding: 12px 14px !important;
        border: 1px solid var(--mg-border);
        background: var(--mg-surface-2);
    }
    .mg-nav-actions > li { display: inline-block; margin-right: 8px; }
    .mg-theme-toggle { margin: 5px 0 !important; }
    .mg-hero { padding-top: 20px; }
    .mg-hero-card { padding: 24px; border-radius: 24px; }
    .mg-card-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
    .mg-watch-side { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    body.mg-shell .container { width: min(100% - 18px, var(--mg-container)); }
    .mg-brand-mark { width: 38px; height: 38px; border-radius: 12px; }
    .mg-brand-name { font-size: 18px; }
    .mg-mobile-user { display: none !important; }
    .mg-hero-card { padding: 20px; }
    .mg-hero-title { font-size: 34px; }
    .mg-hero-search { flex-direction: column; align-items: stretch; border-radius: 22px; }
    .mg-hero-search input { height: 46px; }
    .mg-hero-search button { width: 100%; }
    .mg-hero-panel { grid-template-columns: 1fr; }
    .mg-section-head { align-items: flex-start; flex-direction: column; }
    .mg-card-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .name.mg-card-body { min-height: 75px; padding: 12px; }
    .mg-card-title { font-size: 13px !important; min-height: 38px; }
    .length.mg-card-badge,
    .most.mg-card-badge,
    .views.mg-card-views { font-size: 11px !important; min-height: 27px; padding: 0 8px !important; top: 8px !important; left: 8px !important; }
    .views.mg-card-views { right: 8px !important; left: auto !important; }
    .mg-watch-header { padding-top: 22px; }
    .mg-embed-frame, .video-box.mg-embed-target iframe { min-height: 220px; }
    .mg-tagline span, .mg-watch-meta-top span { width: 100%; justify-content: flex-start; }
    .mg-footer-top { align-items: flex-start; flex-direction: column; }
    #search .search_input_frame { width: 86vw; }
    #search .btn { right: 9vw !important; }
}

@media (max-width: 420px) {
    .mg-card-grid { grid-template-columns: 1fr; }
    .image.mg-card-media, .short-img.mg-card-media, .top-img.mg-card-media { aspect-ratio: 16 / 11; }
    .mg-quick-links a { width: calc(50% - 5px); justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *:before, *:after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Profile photo blocks */
.mg-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.mg-photo-grid img {
    width: 100%;
    height: auto;
    border-radius: 18px;
    border: 1px solid var(--mg-border);
    background: var(--mg-surface);
}

/* =========================================================
   V2 hard fixes: DLE #dle-content wrapper, header safe area,
   mobile controls, tags page. Keep this block at file bottom.
   ========================================================= */

/* Kill old Bootstrap negative logo offset and float behavior. */
body.mg-shell .navbar > .container .mg-brand.navbar-brand,
body.mg-shell .navbar > .container-fluid .mg-brand.navbar-brand,
body.mg-shell .mg-brand.navbar-brand {
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 20px !important;
    overflow: visible !important;
    white-space: nowrap;
}
body.mg-shell .mg-navbar-header,
body.mg-shell .mg-nav-container {
    overflow: visible !important;
}

/* DLE places news inside #dle-content. The old version made that wrapper
   become one grid item, so every .col-md-3 card became 25% of one small track. */
body.mg-shell .mg-list-grid,
body.mg-shell .row.mg-card-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 18px !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
body.mg-shell .mg-list-grid > #dle-content,
body.mg-shell .row.mg-card-grid > #dle-content,
body.mg-shell .mg-list-grid > .dle-content,
body.mg-shell .row.mg-card-grid > .dle-content {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 18px !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}
body.mg-shell .mg-list-grid > #dle-content:before,
body.mg-shell .mg-list-grid > #dle-content:after,
body.mg-shell .row.mg-card-grid > #dle-content:before,
body.mg-shell .row.mg-card-grid > #dle-content:after,
body.mg-shell .mg-list-grid:before,
body.mg-shell .mg-list-grid:after,
body.mg-shell .row.mg-card-grid:before,
body.mg-shell .row.mg-card-grid:after {
    content: none !important;
    display: none !important;
}
body.mg-shell .mg-list-grid > .thumb,
body.mg-shell .row.mg-card-grid > .thumb,
body.mg-shell .mg-list-grid > [class*="col-"],
body.mg-shell .row.mg-card-grid > [class*="col-"],
body.mg-shell .mg-list-grid > #dle-content > .thumb,
body.mg-shell .row.mg-card-grid > #dle-content > .thumb,
body.mg-shell .mg-list-grid > #dle-content > [class*="col-"],
body.mg-shell .row.mg-card-grid > #dle-content > [class*="col-"],
body.mg-shell .mg-list-grid > .dle-content > .thumb,
body.mg-shell .row.mg-card-grid > .dle-content > .thumb,
body.mg-shell .mg-list-grid > .dle-content > [class*="col-"],
body.mg-shell .row.mg-card-grid > .dle-content > [class*="col-"] {
    float: none !important;
    display: block !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
}
body.mg-shell .mg-list-grid .mg-card-cell,
body.mg-shell .row.mg-card-grid .mg-card-cell,
body.mg-shell .mg-list-grid .mg-card,
body.mg-shell .row.mg-card-grid .mg-card,
body.mg-shell .mg-list-grid .mg-card-link,
body.mg-shell .row.mg-card-grid .mg-card-link {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}
body.mg-shell .mg-list-grid .mg-pagination,
body.mg-shell .row.mg-card-grid .mg-pagination,
body.mg-shell .mg-list-grid .bottom-nav,
body.mg-shell .row.mg-card-grid .bottom-nav,
body.mg-shell .mg-list-grid > #dle-content > .clr,
body.mg-shell .row.mg-card-grid > #dle-content > .clr {
    grid-column: 1 / -1 !important;
    width: 100% !important;
}

/* Card proportions and text cleanup after the grid fix. */
body.mg-shell .mg-list-grid .image.mg-card-media,
body.mg-shell .mg-list-grid .short-img.mg-card-media,
body.mg-shell .mg-list-grid .top-img.mg-card-media,
body.mg-shell .row.mg-card-grid .image.mg-card-media,
body.mg-shell .row.mg-card-grid .short-img.mg-card-media,
body.mg-shell .row.mg-card-grid .top-img.mg-card-media {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 10 !important;
}
body.mg-shell .mg-list-grid .mg-card-media img,
body.mg-shell .row.mg-card-grid .mg-card-media img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
body.mg-shell .mg-list-grid .name.mg-card-body,
body.mg-shell .row.mg-card-grid .name.mg-card-body {
    min-height: 108px !important;
}

/* Modern tag cloud page; supports both the new tagscloud.tpl and the old .alft/.flex1 markup. */
body.mg-shell .mg-tags-page {
    padding: 28px 0 56px;
}
body.mg-shell .mg-tags-head {
    margin-top: 0;
}
body.mg-shell .mg-alpha-nav,
body.mg-shell .alft {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
    margin: 0 0 22px !important;
    padding: 0 !important;
}
body.mg-shell .alft div { margin: 0 !important; padding: 0 !important; }
body.mg-shell .mg-alpha-nav a,
body.mg-shell .alft a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--mg-border);
    background: var(--mg-surface);
    color: var(--mg-text) !important;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(0,0,0,.08);
}
body.mg-shell .mg-alpha-nav a:hover,
body.mg-shell .alft a:hover {
    color: #fff !important;
    background: linear-gradient(135deg, var(--mg-accent), var(--mg-accent-2));
    border-color: transparent;
}
body.mg-shell .mg-tags-cloud,
body.mg-shell .flex1 {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px 12px;
    width: 100%;
    min-width: 0;
}
body.mg-shell .mg-tags-cloud h3,
body.mg-shell .flex1 h3 {
    grid-column: 1 / -1;
    margin: 18px 0 2px !important;
    color: var(--mg-text) !important;
    font-size: 22px !important;
    font-weight: 950 !important;
    letter-spacing: -.025em;
}
body.mg-shell .mg-tags-cloud a,
body.mg-shell .flex1 a {
    display: inline-flex !important;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--mg-border);
    background: var(--mg-surface);
    color: var(--mg-soft) !important;
    font-weight: 800;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 10px 24px rgba(0,0,0,.08);
}
body.mg-shell .mg-tags-cloud a:hover,
body.mg-shell .flex1 a:hover {
    color: #fff !important;
    border-color: transparent;
    background: linear-gradient(135deg, var(--mg-accent), var(--mg-accent-2));
}

@media (max-width: 1200px) {
    body.mg-shell .mg-nav-container {
        display: block !important;
        width: min(100% - 22px, var(--mg-container)) !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    body.mg-shell .mg-navbar-header {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 10px !important;
        width: 100% !important;
        min-height: var(--mg-header-h) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    body.mg-shell .mg-brand.navbar-brand {
        order: 1 !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        height: var(--mg-header-h) !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 10px !important;
    }
    body.mg-shell .mg-brand-name {
        min-width: 0;
    }
    body.mg-shell .mg-mobile-search.navbar-toggle {
        order: 2 !important;
        display: inline-flex !important;
    }
    body.mg-shell .mg-menu-toggle.navbar-toggle {
        order: 3 !important;
        display: inline-flex !important;
    }
    body.mg-shell .mg-mobile-user.navbar-toggle {
        display: none !important;
    }
    body.mg-shell .mg-menu-toggle.navbar-toggle,
    body.mg-shell .mg-mobile-search.navbar-toggle,
    body.mg-shell .mg-mobile-user.navbar-toggle {
        flex: 0 0 44px !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        margin: 0 !important;
        float: none !important;
    }
    body.mg-shell .mg-collapse.navbar-collapse {
        width: 100% !important;
        margin: 0 !important;
    }
    body.mg-shell .mg-list-grid,
    body.mg-shell .row.mg-card-grid,
    body.mg-shell .mg-list-grid > #dle-content,
    body.mg-shell .row.mg-card-grid > #dle-content,
    body.mg-shell .mg-list-grid > .dle-content,
    body.mg-shell .row.mg-card-grid > .dle-content {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
        gap: 14px !important;
    }
}

@media (max-width: 640px) {
    body.mg-shell .mg-list-grid,
    body.mg-shell .row.mg-card-grid,
    body.mg-shell .mg-list-grid > #dle-content,
    body.mg-shell .row.mg-card-grid > #dle-content,
    body.mg-shell .mg-list-grid > .dle-content,
    body.mg-shell .row.mg-card-grid > .dle-content {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
    body.mg-shell .mg-section-head {
        gap: 12px !important;
    }
    body.mg-shell .mg-section-link {
        align-self: flex-start;
    }
    body.mg-shell .mg-tags-cloud,
    body.mg-shell .flex1 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 380px) {
    body.mg-shell .mg-brand-name { font-size: 16px !important; }
    body.mg-shell .mg-brand-mark { width: 36px; height: 36px; border-radius: 12px; }
    body.mg-shell .mg-menu-toggle.navbar-toggle,
    body.mg-shell .mg-mobile-search.navbar-toggle {
        flex-basis: 42px !important;
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
    }
    body.mg-shell .mg-list-grid,
    body.mg-shell .row.mg-card-grid,
    body.mg-shell .mg-list-grid > #dle-content,
    body.mg-shell .row.mg-card-grid > #dle-content,
    body.mg-shell .mg-list-grid > .dle-content,
    body.mg-shell .row.mg-card-grid > .dle-content {
        grid-template-columns: 1fr !important;
    }
    body.mg-shell .mg-tags-cloud,
    body.mg-shell .flex1 {
        grid-template-columns: 1fr;
    }
}


/* V2 generic page content container for non-card pages rendered through main.tpl. */
body.mg-shell .mg-page-content {
    width: 100%;
    min-width: 0;
    color: var(--mg-text);
}
body.mg-shell .mg-page-content > #dle-content,
body.mg-shell .mg-page-content > .dle-content {
    width: 100%;
    min-width: 0;
}

/* =========================================================
   V3 final: siterip embed + global bottom chat.
   ========================================================= */
body.mg-shell .mg-siterip-stage { padding-top: 12px !important; }
body.mg-shell .mg-siterip-layout { grid-template-columns: minmax(0, 1fr) 330px; }
body.mg-shell .mg-siterip-player-card { min-width: 0; }
body.mg-shell .video-box.mg-siterip-embed {
    border-radius: var(--mg-radius-lg);
    min-height: 540px;
}
body.mg-shell .video-box.mg-siterip-embed .mg-gallery-fallback {
    min-height: 540px;
    display: grid;
    place-items: center;
    padding: 28px;
    color: #fff;
    background:
        radial-gradient(circle at 50% 28%, rgba(255,79,137,.28), transparent 34%),
        linear-gradient(135deg, rgba(124,92,255,.18), rgba(0,0,0,.16)),
        #050507;
}
body.mg-shell .video-box.mg-siterip-embed .mg-embed-frame {
    aspect-ratio: auto;
    min-height: 720px;
    height: min(1304px, 92vh) !important;
    border-radius: var(--mg-radius-lg);
}
body.mg-shell .video-box.mg-siterip-embed.mg-embed-loaded {
    aspect-ratio: auto;
}
body.mg-shell .video-box.mg-siterip-embed.mg-embed-loaded .mg-embed-frame {
    display: block;
}
body.mg-shell .mg-siterip-fallback-inner {
    display: grid;
    place-items: center;
    gap: 12px;
    max-width: 560px;
    text-align: center;
}
body.mg-shell .mg-siterip-icon {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    padding-left: 4px;
    border-radius: 50%;
    color: #fff;
    font-size: 32px;
    background: linear-gradient(135deg, var(--mg-accent), var(--mg-accent-2));
    box-shadow: 0 24px 60px rgba(255,79,137,.30);
}
body.mg-shell .mg-siterip-fallback h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(24px, 3vw, 38px);
    line-height: 1.05;
    letter-spacing: -.04em;
    font-weight: 950;
}
body.mg-shell .mg-siterip-fallback p {
    margin: 0 0 6px;
    color: rgba(255,255,255,.74);
    line-height: 1.65;
    font-weight: 750;
}
body.mg-shell .video-box.mg-no-embed .mg-siterip-fallback {
    outline: 1px dashed rgba(255,255,255,.18);
    outline-offset: -14px;
}
body.mg-shell .mg-side-chat-jump {
    margin-top: 10px;
    width: 100%;
}
body.mg-shell .mg-download-card .mg-primary-btn {
    width: 100%;
}
body.mg-shell .mg-site-chat {
    position: relative;
    z-index: 1;
    padding: 8px 0 34px;
}
body.mg-shell .mg-site-chat-card {
    overflow: hidden;
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-xl);
    background:
        linear-gradient(135deg, rgba(255,79,137,.10), rgba(124,92,255,.08) 42%, transparent 70%),
        var(--mg-surface);
    box-shadow: var(--mg-shadow);
}
body.mg-shell .mg-site-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 22px 16px;
    border-bottom: 1px solid var(--mg-border);
}
body.mg-shell .mg-site-chat-head h2 {
    margin: 4px 0 6px;
    color: var(--mg-text);
    font-size: clamp(22px, 2.4vw, 32px);
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -.035em;
}
body.mg-shell .mg-site-chat-head p {
    margin: 0;
    color: var(--mg-muted);
    line-height: 1.55;
}
body.mg-shell .mg-site-chat-frame {
    display: block;
    width: 100% !important;
    min-height: 460px;
    border: 0 !important;
    background: var(--mg-bg-soft);
}
@media (max-width: 1199px) {
    body.mg-shell .mg-siterip-layout { grid-template-columns: 1fr; }
    body.mg-shell .video-box.mg-siterip-embed .mg-embed-frame { min-height: 680px; height: 82vh !important; }
}
@media (max-width: 640px) {
    body.mg-shell .video-box.mg-siterip-embed,
    body.mg-shell .video-box.mg-siterip-embed .mg-gallery-fallback { min-height: 360px; }
    body.mg-shell .video-box.mg-siterip-embed .mg-embed-frame { min-height: 560px; height: 78vh !important; }
    body.mg-shell .mg-siterip-icon { width: 66px; height: 66px; font-size: 26px; }
    body.mg-shell .mg-site-chat { padding: 4px 0 24px; }
    body.mg-shell .mg-site-chat-head { align-items: flex-start; flex-direction: column; padding: 18px; }
    body.mg-shell .mg-site-chat-head .mg-secondary-btn { width: 100%; }
    body.mg-shell .mg-site-chat-frame { min-height: 420px; }
}


/* v4: automatic embed insertion for /siterips/ pages that are rendered by an older DLE full template. */
body.mg-shell .mg-siterip-auto-wrap {
    margin: 0 0 22px;
}
body.mg-shell .mg-siterip-auto-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 14px;
}
body.mg-shell .mg-siterip-auto-head h2 {
    margin: 4px 0 6px;
    color: var(--mg-text);
    font-size: clamp(24px, 3vw, 38px);
    line-height: 1.05;
    letter-spacing: -.035em;
    font-weight: 950;
}
body.mg-shell .mg-siterip-auto-head p {
    margin: 0;
    color: var(--mg-muted);
    line-height: 1.55;
    font-weight: 750;
}
body.mg-shell .mg-siterip-auto-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}
body.mg-shell .mg-siterip-auto-wrap .mg-player-card {
    overflow: hidden;
    border-radius: var(--mg-radius-lg);
}
@media (max-width: 640px) {
    body.mg-shell .mg-siterip-auto-head {
        align-items: flex-start;
        flex-direction: column;
    }
    body.mg-shell .mg-siterip-auto-links,
    body.mg-shell .mg-siterip-auto-links .mg-secondary-btn {
        width: 100%;
    }
}



/* =========================================================
   V6: home-only big hero + compact inner-page header.
   Big hero stays on the homepage. Category/tag/search pages use a small header.
   ========================================================= */
body.mg-shell:not(.mg-home) .mg-hero {
    display: none !important;
}
body.mg-shell .mg-page-hero {
    position: relative;
    z-index: 1;
    padding: 24px 0 4px;
}
body.mg-shell .mg-page-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    border: 1px solid var(--mg-border);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(255,79,137,.08), rgba(124,92,255,.06) 42%, transparent 70%),
        var(--mg-surface);
    box-shadow: 0 14px 38px rgba(0,0,0,.12);
}
html[data-theme="light"] body.mg-shell .mg-page-hero-inner {
    box-shadow: 0 14px 38px rgba(23,33,64,.10);
}
body.mg-shell .mg-page-copy {
    min-width: 0;
}
body.mg-shell .mg-page-title {
    margin: 5px 0 0;
    color: var(--mg-text) !important;
    font-size: clamp(27px, 3.2vw, 42px);
    line-height: 1.03;
    letter-spacing: -.04em;
    font-weight: 950;
}
body.mg-shell .mg-page-text {
    margin: 8px 0 0;
    color: var(--mg-muted);
    font-size: 14px;
    line-height: 1.55;
    font-weight: 650;
}
body.mg-shell .mg-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    flex: 0 0 auto;
}
body.mg-shell:not(.mg-home) .mg-content {
    padding-top: 16px;
}
body.mg-shell:not(.mg-home) .mg-section-head {
    margin-top: 0;
}
body.mg-shell .mg-global-chat {
    position: relative;
    z-index: 1;
    padding: 8px 0 34px;
}
body.mg-shell .mg-global-chat-card {
    overflow: hidden;
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-xl);
    background:
        linear-gradient(135deg, rgba(255,79,137,.10), rgba(124,92,255,.08) 42%, transparent 70%),
        var(--mg-surface);
    box-shadow: var(--mg-shadow);
}
body.mg-shell .mg-global-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 22px 16px;
    border-bottom: 1px solid var(--mg-border);
}
body.mg-shell .mg-global-chat-head h2 {
    margin: 4px 0 0;
    color: var(--mg-text);
    font-size: clamp(22px, 2.4vw, 32px);
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -.035em;
}
body.mg-shell .mg-global-chat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 13px;
    border-radius: 999px;
    color: var(--mg-text);
    border: 1px solid var(--mg-border);
    background: var(--mg-surface-2);
    font-weight: 900;
}
body.mg-shell .mg-global-chat iframe {
    display: block;
    width: 100% !important;
    min-height: 430px;
    border: 0 !important;
    background: var(--mg-bg-soft);
}
@media (max-width: 1200px) {
    body.mg-shell .mg-page-hero { padding-top: 16px; }
    body.mg-shell .mg-page-hero-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
        border-radius: 20px;
    }
    body.mg-shell .mg-page-actions {
        width: 100%;
        justify-content: flex-start;
    }
}
@media (max-width: 640px) {
    body.mg-shell .mg-page-title { font-size: 28px; }
    body.mg-shell .mg-page-actions .mg-secondary-btn,
    body.mg-shell .mg-page-actions .mg-section-link {
        width: 100%;
    }
    body.mg-shell .mg-global-chat { padding: 4px 0 24px; }
    body.mg-shell .mg-global-chat-head {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }
    body.mg-shell .mg-global-chat-pill { width: 100%; justify-content: center; }
    body.mg-shell .mg-global-chat iframe { min-height: 420px; }
}


/* =========================================================
   V7: clean categories/tags layout.
   Makes DLE tag text/count split into neat chip cells after JS wraps them.
   ========================================================= */
body.mg-shell .mg-page-content .mg-tags-page {
    padding: 6px 0 56px !important;
}
body.mg-shell .mg-tags-page .page-header {
    display: none !important;
}
body.mg-shell .mg-tags-alphabet,
body.mg-shell .mg-tags-page .alft {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
    margin: 0 0 18px !important;
    padding: 0 !important;
}
body.mg-shell .mg-tags-alphabet div,
body.mg-shell .mg-tags-page .alft div {
    margin: 0 !important;
    padding: 0 !important;
}
body.mg-shell .mg-tags-alphabet a,
body.mg-shell .mg-tags-page .alft a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    border: 1px solid var(--mg-border) !important;
    background: var(--mg-surface) !important;
    color: var(--mg-text) !important;
    font-size: 13px !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    box-shadow: 0 10px 24px rgba(0,0,0,.07) !important;
}
body.mg-shell .mg-tags-alphabet a:hover,
body.mg-shell .mg-tags-page .alft a:hover {
    color: #fff !important;
    border-color: transparent !important;
    background: linear-gradient(135deg, var(--mg-accent), var(--mg-accent-2)) !important;
}
body.mg-shell .mg-tags-cloud,
body.mg-shell .mg-tags-page .flex1 {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)) !important;
    gap: 12px 16px !important;
    align-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}
body.mg-shell .mg-tags-cloud ul,
body.mg-shell .mg-tags-page .flex1 ul,
body.mg-shell .mg-tags-cloud li,
body.mg-shell .mg-tags-page .flex1 li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: contents !important;
}
body.mg-shell .mg-tags-cloud h3,
body.mg-shell .mg-tags-page .flex1 h3,
body.mg-shell .mg-tags-cloud .tag-letter,
body.mg-shell .mg-tags-page .flex1 .tag-letter {
    grid-column: 1 / -1 !important;
    margin: 20px 0 0 !important;
    color: var(--mg-text) !important;
    font-size: 22px !important;
    font-weight: 950 !important;
    line-height: 1.1 !important;
    letter-spacing: -.025em !important;
}
body.mg-shell .mg-tags-cloud a,
body.mg-shell .mg-tags-page .flex1 a {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 0 12px 0 14px !important;
    border-radius: 14px !important;
    border: 1px solid var(--mg-border) !important;
    background: var(--mg-surface-2) !important;
    color: var(--mg-text) !important;
    box-shadow: 0 10px 24px rgba(0,0,0,.08) !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-decoration: none !important;
}
body.mg-shell .mg-tags-cloud a:hover,
body.mg-shell .mg-tags-page .flex1 a:hover {
    color: #fff !important;
    border-color: transparent !important;
    background: linear-gradient(135deg, var(--mg-accent), var(--mg-accent-2)) !important;
}
body.mg-shell .mg-tags-cloud a .mg-tag-name,
body.mg-shell .mg-tags-page .flex1 a .mg-tag-name {
    display: block !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
body.mg-shell .mg-tags-cloud a .mg-tag-count,
body.mg-shell .mg-tags-page .flex1 a .mg-tag-count {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    min-width: 40px !important;
    height: 24px !important;
    padding: 0 8px !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,.09) !important;
    color: var(--mg-muted) !important;
    font-size: 11px !important;
    font-weight: 950 !important;
    letter-spacing: -.01em !important;
    line-height: 1 !important;
}
html[data-theme="light"] body.mg-shell .mg-tags-cloud a .mg-tag-count,
html[data-theme="light"] body.mg-shell .mg-tags-page .flex1 a .mg-tag-count {
    background: rgba(16,20,30,.07) !important;
    color: #667086 !important;
}
body.mg-shell .mg-tags-cloud a:hover .mg-tag-count,
body.mg-shell .mg-tags-page .flex1 a:hover .mg-tag-count {
    background: rgba(255,255,255,.22) !important;
    color: #fff !important;
}
@media (max-width: 760px) {
    body.mg-shell .mg-tags-cloud,
    body.mg-shell .mg-tags-page .flex1 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
    body.mg-shell .mg-tags-cloud a,
    body.mg-shell .mg-tags-page .flex1 a {
        min-height: 42px !important;
        padding-left: 12px !important;
        padding-right: 10px !important;
        font-size: 13px !important;
    }
    body.mg-shell .mg-tags-cloud a .mg-tag-count,
    body.mg-shell .mg-tags-page .flex1 a .mg-tag-count {
        min-width: 34px !important;
        height: 22px !important;
        padding: 0 6px !important;
        font-size: 10px !important;
    }
}
@media (max-width: 390px) {
    body.mg-shell .mg-tags-cloud,
    body.mg-shell .mg-tags-page .flex1 {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================================
   V8 TAGS HOTFIX: restores readable tag names and aligned counts.
   This block must stay after the old V7 tag rules.
   ========================================================= */
body.mg-shell.mg-tags-body .mg-tags-page {
    padding: 8px 0 56px !important;
}
body.mg-shell.mg-tags-body .mg-tags-page > .page-header {
    display: none !important;
}
body.mg-shell.mg-tags-body .mg-tags-cloud,
body.mg-shell.mg-tags-body .mg-tags-page .flex1,
body.mg-shell.mg-tags-body .flex1 {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important;
    gap: 12px 16px !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}
body.mg-shell.mg-tags-body .mg-tags-cloud ul,
body.mg-shell.mg-tags-body .mg-tags-page .flex1 ul,
body.mg-shell.mg-tags-body .flex1 ul,
body.mg-shell.mg-tags-body .mg-tags-cloud li,
body.mg-shell.mg-tags-body .mg-tags-page .flex1 li,
body.mg-shell.mg-tags-body .flex1 li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: contents !important;
}
body.mg-shell.mg-tags-body .mg-tags-cloud > *,
body.mg-shell.mg-tags-body .mg-tags-page .flex1 > *,
body.mg-shell.mg-tags-body .flex1 > * {
    min-width: 0 !important;
}
body.mg-shell.mg-tags-body .mg-tags-cloud h3,
body.mg-shell.mg-tags-body .mg-tags-page .flex1 h3,
body.mg-shell.mg-tags-body .flex1 h3,
body.mg-shell.mg-tags-body .mg-tag-letter,
body.mg-shell.mg-tags-body .tag-letter {
    grid-column: 1 / -1 !important;
    display: block !important;
    margin: 24px 0 4px !important;
    padding: 0 0 0 10px !important;
    color: var(--mg-text) !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    font-size: 24px !important;
    line-height: 1 !important;
    font-weight: 950 !important;
    letter-spacing: -.03em !important;
}
body.mg-shell.mg-tags-body .mg-tag-row {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}
body.mg-shell.mg-tags-body .mg-tag-row > :not(.mg-tag-chip) {
    display: none !important;
}
body.mg-shell.mg-tags-body .mg-tags-cloud a,
body.mg-shell.mg-tags-body .mg-tags-page .flex1 a,
body.mg-shell.mg-tags-body .flex1 a {
    position: relative !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 46px !important;
    height: auto !important;
    padding: 0 10px 0 14px !important;
    box-sizing: border-box !important;
    border-radius: 15px !important;
    border: 1px solid var(--mg-border) !important;
    background: var(--mg-surface-2) !important;
    color: var(--mg-text) !important;
    opacity: 1 !important;
    visibility: visible !important;
    text-indent: 0 !important;
    text-decoration: none !important;
    text-align: left !important;
    text-shadow: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 14px !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
    letter-spacing: -.01em !important;
    box-shadow: 0 10px 26px rgba(0,0,0,.08) !important;
    transform: translateZ(0) !important;
}
html[data-theme="light"] body.mg-shell.mg-tags-body .mg-tags-cloud a,
html[data-theme="light"] body.mg-shell.mg-tags-body .mg-tags-page .flex1 a,
html[data-theme="light"] body.mg-shell.mg-tags-body .flex1 a {
    background: linear-gradient(180deg, #ffffff, #f6f7fb) !important;
    color: #151722 !important;
    border-color: rgba(16,20,30,.10) !important;
    box-shadow: 0 10px 26px rgba(23,33,64,.09) !important;
}
body.mg-shell.mg-tags-body .mg-tags-cloud a:before,
body.mg-shell.mg-tags-body .mg-tags-cloud a:after,
body.mg-shell.mg-tags-body .mg-tags-page .flex1 a:before,
body.mg-shell.mg-tags-body .mg-tags-page .flex1 a:after,
body.mg-shell.mg-tags-body .flex1 a:before,
body.mg-shell.mg-tags-body .flex1 a:after {
    content: none !important;
    display: none !important;
}
body.mg-shell.mg-tags-body .mg-tags-cloud a .mg-tag-name,
body.mg-shell.mg-tags-body .mg-tags-page .flex1 a .mg-tag-name,
body.mg-shell.mg-tags-body .flex1 a .mg-tag-name {
    position: static !important;
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    color: inherit !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 14px !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
    text-indent: 0 !important;
}
body.mg-shell.mg-tags-body .mg-tags-cloud a .mg-tag-count,
body.mg-shell.mg-tags-body .mg-tags-page .flex1 a .mg-tag-count,
body.mg-shell.mg-tags-body .flex1 a .mg-tag-count {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    min-width: 42px !important;
    max-width: 86px !important;
    height: 24px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    box-sizing: border-box !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,.09) !important;
    color: var(--mg-muted) !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    line-height: 1 !important;
    font-weight: 950 !important;
    font-variant-numeric: tabular-nums !important;
    letter-spacing: -.01em !important;
}
html[data-theme="light"] body.mg-shell.mg-tags-body .mg-tags-cloud a .mg-tag-count,
html[data-theme="light"] body.mg-shell.mg-tags-body .mg-tags-page .flex1 a .mg-tag-count,
html[data-theme="light"] body.mg-shell.mg-tags-body .flex1 a .mg-tag-count {
    background: rgba(16,20,30,.07) !important;
    color: #667086 !important;
}
body.mg-shell.mg-tags-body .mg-tags-cloud a:hover,
body.mg-shell.mg-tags-body .mg-tags-page .flex1 a:hover,
body.mg-shell.mg-tags-body .flex1 a:hover {
    color: #fff !important;
    border-color: transparent !important;
    background: linear-gradient(135deg, var(--mg-accent), var(--mg-accent-2)) !important;
    box-shadow: 0 16px 34px rgba(255,79,137,.22) !important;
    transform: translateY(-1px) !important;
}
body.mg-shell.mg-tags-body .mg-tags-cloud a:hover .mg-tag-name,
body.mg-shell.mg-tags-body .mg-tags-page .flex1 a:hover .mg-tag-name,
body.mg-shell.mg-tags-body .flex1 a:hover .mg-tag-name,
body.mg-shell.mg-tags-body .mg-tags-cloud a:hover .mg-tag-count,
body.mg-shell.mg-tags-body .mg-tags-page .flex1 a:hover .mg-tag-count,
body.mg-shell.mg-tags-body .flex1 a:hover .mg-tag-count {
    color: #fff !important;
}
body.mg-shell.mg-tags-body .mg-tags-cloud a:hover .mg-tag-count,
body.mg-shell.mg-tags-body .mg-tags-page .flex1 a:hover .mg-tag-count,
body.mg-shell.mg-tags-body .flex1 a:hover .mg-tag-count {
    background: rgba(255,255,255,.22) !important;
}
body.mg-shell.mg-tags-body .mg-alpha-nav,
body.mg-shell.mg-tags-body .alft,
body.mg-shell.mg-tags-body .mg-tags-alphabet {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 7px !important;
    align-items: center !important;
    margin: 0 0 20px !important;
    padding: 0 !important;
}
body.mg-shell.mg-tags-body .mg-alpha-nav a,
body.mg-shell.mg-tags-body .alft a,
body.mg-shell.mg-tags-body .mg-tags-alphabet a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 12px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    font-weight: 950 !important;
}
@media (max-width: 820px) {
    body.mg-shell.mg-tags-body .mg-tags-cloud,
    body.mg-shell.mg-tags-body .mg-tags-page .flex1,
    body.mg-shell.mg-tags-body .flex1 {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
        gap: 10px !important;
    }
}
@media (max-width: 520px) {
    body.mg-shell.mg-tags-body .mg-tags-cloud,
    body.mg-shell.mg-tags-body .mg-tags-page .flex1,
    body.mg-shell.mg-tags-body .flex1 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    body.mg-shell.mg-tags-body .mg-tags-cloud a,
    body.mg-shell.mg-tags-body .mg-tags-page .flex1 a,
    body.mg-shell.mg-tags-body .flex1 a {
        min-height: 42px !important;
        padding-left: 12px !important;
        gap: 8px !important;
        font-size: 12px !important;
    }
    body.mg-shell.mg-tags-body .mg-tags-cloud a .mg-tag-name,
    body.mg-shell.mg-tags-body .mg-tags-page .flex1 a .mg-tag-name,
    body.mg-shell.mg-tags-body .flex1 a .mg-tag-name {
        font-size: 12px !important;
    }
    body.mg-shell.mg-tags-body .mg-tags-cloud a .mg-tag-count,
    body.mg-shell.mg-tags-body .mg-tags-page .flex1 a .mg-tag-count,
    body.mg-shell.mg-tags-body .flex1 a .mg-tag-count {
        min-width: 34px !important;
        height: 22px !important;
        padding: 0 6px !important;
        font-size: 10px !important;
    }
}
@media (max-width: 340px) {
    body.mg-shell.mg-tags-body .mg-tags-cloud,
    body.mg-shell.mg-tags-body .mg-tags-page .flex1,
    body.mg-shell.mg-tags-body .flex1 {
        grid-template-columns: 1fr !important;
    }
}


/* =========================================================
   V10 FINAL OVERRIDES: tags rebuilt safely + hide homepage hero on /page/N/.
   Keep this block at the very bottom of the file.
   ========================================================= */
html.mg-paged body.mg-shell .mg-hero,
html.mg-paged body.mg-shell .mg-page-hero {
    display: none !important;
}
html.mg-paged body.mg-shell .mg-content { padding-top: 28px !important; }
html.mg-paged body.mg-shell .mg-section-head { margin-top: 0 !important; }

body.mg-shell .mg-tags-page { 
padding: 20px 0 20px !important;
  max-width: 1200px !important;
  min-width: 100px;
  margin: 0 auto;
  display: block;
}
body.mg-shell .mg-tags-page .page-header { display: none !important; }
body.mg-shell .mg-tags-page .mg-tags-alphabet,
body.mg-shell .mg-tags-page .mg-alpha-nav,
body.mg-shell .mg-tags-page .alft {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    align-items: center !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
}
body.mg-shell .mg-tags-page .mg-tags-alphabet div,
body.mg-shell .mg-tags-page .alft div { margin: 0 !important; padding: 0 !important; }
body.mg-shell .mg-tags-page .mg-tags-alphabet a,
body.mg-shell .mg-tags-page .mg-alpha-nav a,
body.mg-shell .mg-tags-page .alft a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 38px !important;
    height: 38px !important;
    padding: 0 12px !important;
    border-radius: 13px !important;
    border: 1px solid var(--mg-border) !important;
    background: var(--mg-surface) !important;
    color: var(--mg-text) !important;
    font-size: 13px !important;
    line-height: 1 !important;
    font-weight: 950 !important;
    text-indent: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: 0 10px 24px rgba(0,0,0,.07) !important;
}
body.mg-shell .mg-tags-page .mg-tags-cloud,
body.mg-shell .mg-tags-page .flex1,
body.mg-shell.mg-tags-body .mg-tags-cloud,
body.mg-shell.mg-tags-body .flex1 {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)) !important;
    gap: 12px 16px !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}
body.mg-shell .mg-tags-page .mg-tags-cloud ul,
body.mg-shell .mg-tags-page .flex1 ul,
body.mg-shell .mg-tags-page .mg-tags-cloud li,
body.mg-shell .mg-tags-page .flex1 li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: contents !important;
}
body.mg-shell .mg-tags-page .mg-tag-letter,
body.mg-shell .mg-tags-page .mg-tags-cloud h3,
body.mg-shell .mg-tags-page .flex1 h3 {
    grid-column: 1 / -1 !important;
    display: block !important;
    margin: 24px 0 4px !important;
    padding: 0 0 0 10px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--mg-text) !important;
    font-size: 24px !important;
    line-height: 1 !important;
    font-weight: 950 !important;
    letter-spacing: -.03em !important;
}
body.mg-shell .mg-tags-page .mg-tags-cloud:not(.mg-tags-rebuilt) a,
body.mg-shell .mg-tags-page .flex1:not(.mg-tags-rebuilt) a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    padding: 0 16px !important;
    border-radius: 15px !important;
    border: 1px solid var(--mg-border) !important;
    background: var(--mg-surface-2) !important;
    color: var(--mg-text) !important;
    opacity: 1 !important;
    visibility: visible !important;
    text-indent: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 14px !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
    text-decoration: none !important;
    box-shadow: 0 10px 26px rgba(0,0,0,.08) !important;
}
body.mg-shell .mg-tags-page .mg-tags-rebuilt .mg-tag-chip,
body.mg-shell.mg-tags-body .mg-tags-rebuilt .mg-tag-chip {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 46px !important;
    height: auto !important;
    padding: 0 10px 0 14px !important;
    box-sizing: border-box !important;
    border-radius: 15px !important;
    border: 1px solid var(--mg-border) !important;
    background: var(--mg-surface-2) !important;
    color: var(--mg-text) !important;
    opacity: 1 !important;
    visibility: visible !important;
    text-indent: 0 !important;
    text-decoration: none !important;
    text-align: left !important;
    text-shadow: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 14px !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
    letter-spacing: -.01em !important;
    box-shadow: 0 10px 26px rgba(0,0,0,.08) !important;
    transform: translateZ(0) !important;
}
html[data-theme="light"] body.mg-shell .mg-tags-page .mg-tags-rebuilt .mg-tag-chip {
    background: linear-gradient(180deg, #ffffff, #f6f7fb) !important;
    color: #151722 !important;
    border-color: rgba(16,20,30,.10) !important;
    box-shadow: 0 10px 26px rgba(23,33,64,.09) !important;
}
body.mg-shell .mg-tags-page .mg-tags-rebuilt .mg-tag-chip:before,
body.mg-shell .mg-tags-page .mg-tags-rebuilt .mg-tag-chip:after { content: none !important; display: none !important; }
body.mg-shell .mg-tags-page .mg-tags-rebuilt .mg-tag-name {
    position: static !important;
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    color: inherit !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 14px !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
    text-indent: 0 !important;
}
body.mg-shell .mg-tags-page .mg-tags-rebuilt .mg-tag-count {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    min-width: 42px !important;
    max-width: 86px !important;
    height: 24px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    box-sizing: border-box !important;
    border-radius: 999px !important;
    background: rgba(16,20,30,.07) !important;
    color: #667086 !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    line-height: 1 !important;
    font-weight: 950 !important;
    font-variant-numeric: tabular-nums !important;
    letter-spacing: -.01em !important;
}
html[data-theme="dark"] body.mg-shell .mg-tags-page .mg-tags-rebuilt .mg-tag-count { background: rgba(255,255,255,.10) !important; color: var(--mg-muted) !important; }
body.mg-shell .mg-tags-page .mg-tags-rebuilt .mg-tag-chip:hover {
    color: #fff !important;
    border-color: transparent !important;
    background: linear-gradient(135deg, var(--mg-accent), var(--mg-accent-2)) !important;
    box-shadow: 0 16px 34px rgba(255,79,137,.22) !important;
    transform: translateY(-1px) !important;
}
body.mg-shell .mg-tags-page .mg-tags-rebuilt .mg-tag-chip:hover .mg-tag-count { color: #fff !important; background: rgba(255,255,255,.22) !important; }
@media (max-width: 820px) {
    body.mg-shell .mg-tags-page .mg-tags-cloud,
    body.mg-shell .mg-tags-page .flex1 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important; gap: 10px !important; }
}
@media (max-width: 520px) {
    body.mg-shell .mg-tags-page .mg-tags-cloud,
    body.mg-shell .mg-tags-page .flex1 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    body.mg-shell .mg-tags-page .mg-tags-rebuilt .mg-tag-chip { min-height: 42px !important; padding-left: 12px !important; gap: 8px !important; font-size: 12px !important; }
    body.mg-shell .mg-tags-page .mg-tags-rebuilt .mg-tag-name { font-size: 12px !important; }
    body.mg-shell .mg-tags-page .mg-tags-rebuilt .mg-tag-count { min-width: 34px !important; height: 22px !important; padding: 0 6px !important; font-size: 10px !important; }
}
@media (max-width: 340px) {
    body.mg-shell .mg-tags-page .mg-tags-cloud,
    body.mg-shell .mg-tags-page .flex1 { grid-template-columns: 1fr !important; }
}


/* =========================================================
   V10 TAGS WIDTH + NO TAGS HERO
   Keeps /tags/ content inside the same centered site width as the header.
   ========================================================= */
body.mg-shell.mg-tags-body .mg-page-hero {
    display: none !important;
}
body.mg-shell.mg-tags-body .mg-content {
    padding-top: 18px !important;
}
body.mg-shell.mg-tags-body .mg-page-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
body.mg-shell.mg-tags-body .mg-tags-page {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 8px 0 58px !important;
    box-sizing: border-box !important;
}
body.mg-shell.mg-tags-body .mg-tags-page > .mg-tags-container {
    width: min(100% - 28px, var(--mg-container)) !important;
    max-width: var(--mg-container) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    float: none !important;
    box-sizing: border-box !important;
}
body.mg-shell.mg-tags-body .mg-page-content .mg-tags-page > .mg-tags-container {
    width: 100% !important;
    max-width: 100% !important;
}
body.mg-shell.mg-tags-body .mg-tags-alphabet,
body.mg-shell.mg-tags-body .mg-alpha-nav,
body.mg-shell.mg-tags-body .alft {
    max-width: 100% !important;
    margin: 0 0 24px !important;
    padding: 0 !important;
    justify-content: flex-start !important;
}
body.mg-shell.mg-tags-body .mg-tags-cloud,
body.mg-shell.mg-tags-body #mg-tags-cloud,
body.mg-shell.mg-tags-body .mg-tags-page .flex1,
body.mg-shell.mg-tags-body .flex1 {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)) !important;
    gap: 12px 16px !important;
}
body.mg-shell.mg-tags-body .mg-tags-page .mg-tag-letter,
body.mg-shell.mg-tags-body .mg-tags-page .mg-tags-cloud h3,
body.mg-shell.mg-tags-body .mg-tags-page .flex1 h3 {
    padding-left: 10px !important;
}
@media (max-width: 760px) {
    body.mg-shell.mg-tags-body .mg-tags-page > .mg-tags-container {
        width: min(100% - 18px, var(--mg-container)) !important;
    }
    body.mg-shell.mg-tags-body .mg-page-content .mg-tags-page > .mg-tags-container {
        width: 100% !important;
    }
    body.mg-shell.mg-tags-body .mg-tags-cloud,
    body.mg-shell.mg-tags-body #mg-tags-cloud,
    body.mg-shell.mg-tags-body .mg-tags-page .flex1,
    body.mg-shell.mg-tags-body .flex1 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
}
@media (max-width: 340px) {
    body.mg-shell.mg-tags-body .mg-tags-cloud,
    body.mg-shell.mg-tags-body #mg-tags-cloud,
    body.mg-shell.mg-tags-body .mg-tags-page .flex1,
    body.mg-shell.mg-tags-body .flex1 {
        grid-template-columns: 1fr !important;
    }
}

/* v11: hard fallback for day/night switch and legacy style.css conflicts. */
html.mg-theme-light,
html[data-theme="light"] {
    --mg-bg: #f5f6fb;
    --mg-bg-soft: #ffffff;
    --mg-surface: rgba(255,255,255,.95);
    --mg-surface-2: rgba(249,250,255,.98);
    --mg-border: rgba(16,20,30,.10);
    --mg-text: #151722;
    --mg-muted: #626a7d;
    --mg-soft: #303544;
    --mg-shadow: 0 18px 55px rgba(23,33,64,.13);
}

html.mg-theme-dark,
html[data-theme="dark"] {
    --mg-bg: #08090d;
    --mg-bg-soft: #11131a;
    --mg-surface: rgba(22, 24, 34, .92);
    --mg-surface-2: rgba(32, 35, 48, .96);
    --mg-border: rgba(255,255,255,.10);
    --mg-text: #f7f7fb;
    --mg-muted: #a7acbb;
    --mg-soft: #d7d9e3;
    --mg-shadow: 0 24px 70px rgba(0,0,0,.45);
}

html.mg-theme-light body.mg-shell,
html[data-theme="light"] body.mg-shell {
    background:
        radial-gradient(circle at 15% -10%, rgba(255,79,137,.16), transparent 32rem),
        radial-gradient(circle at 85% 0%, rgba(0,212,255,.14), transparent 30rem),
        linear-gradient(180deg, var(--mg-bg), var(--mg-bg-soft) 48%, var(--mg-bg)) !important;
    color: var(--mg-text) !important;
}

html.mg-theme-dark body.mg-shell,
html[data-theme="dark"] body.mg-shell {
    background:
        radial-gradient(circle at 15% -10%, rgba(255,79,137,.22), transparent 32rem),
        radial-gradient(circle at 85% 0%, rgba(124,92,255,.20), transparent 30rem),
        linear-gradient(180deg, var(--mg-bg), var(--mg-bg-soft) 48%, var(--mg-bg)) !important;
    color: var(--mg-text) !important;
}

html.mg-theme-light .mg-navbar.navbar,
html[data-theme="light"] .mg-navbar.navbar { background: rgba(255,255,255,.82) !important; }
html.mg-theme-dark .mg-navbar.navbar,
html[data-theme="dark"] .mg-navbar.navbar { background: rgba(8,9,13,.80) !important; }

/* keep tag layout safe from old style.css .flex1/.item1 rules */
body.mg-shell .mg-tags-frame .flex1,
body.mg-shell .mg-tags-frame .item1,
body.mg-shell .mg-tags-frame .flex1:after,
body.mg-shell .mg-tags-page .flex1,
body.mg-shell .mg-tags-page .item1,
body.mg-shell .mg-tags-page .flex1:after {
    width: auto !important;
    max-width: none !important;
}

/* If old DLE video styles win, keep our auto embed visible. */
body.mg-shell .mg-embed-target,
body.mg-shell .mg-siterip-auto-wrap,
body.mg-shell .mg-siterip-embed,
body.mg-shell .mg-embed-frame {
    display: block !important;
    visibility: visible !important;
}
/* =========================================================
   V16: Siterip player clean mobile fix.
   Fixes the tall black iframe/player "tongue" on /siterips/ pages.
   Paste at the VERY END of css/mygirls-redesign.css
   ========================================================= */

body.mg-shell .mg-siterip .mg-watch-header {
    padding: 18px 0 10px !important;
}

body.mg-shell .mg-siterip .video_header.mg-watch-title {
    margin: 6px 0 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    color: var(--mg-text) !important;
    font-size: clamp(24px, 7vw, 36px) !important;
    line-height: 1.06 !important;
    letter-spacing: -0.045em !important;
    text-align: left !important;
}

body.mg-shell .mg-siterip .video_play.mg-watch-stage,
body.mg-shell .mg-siterip-stage {
    padding: 10px 0 16px !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.mg-shell .mg-siterip .mg-player-card,
body.mg-shell .mg-siterip-player-card,
body.mg-shell .mg-siterip-auto-wrap .mg-player-card {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

body.mg-shell .mg-siterip .video-box.mg-embed-target,
body.mg-shell .mg-siterip .mg-siterip-embed,
body.mg-shell .mg-siterip .mg-siterip-embed-target,
body.mg-shell .mg-siterip-auto-wrap .video-box.mg-embed-target {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 16 / 9 !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    background: #000 !important;
    box-shadow: 0 18px 50px rgba(0,0,0,.18) !important;
}

body.mg-shell .mg-siterip .video-box.mg-embed-target iframe,
body.mg-shell .mg-siterip .video-box.mg-embed-target embed,
body.mg-shell .mg-siterip .video-box.mg-embed-target object,
body.mg-shell .mg-siterip .video-box.mg-embed-target video,
body.mg-shell .mg-siterip .video-box.mg-embed-target frame,
body.mg-shell .mg-siterip .mg-embed-frame,
body.mg-shell .mg-siterip .mg-siterip-embed iframe,
body.mg-shell .mg-siterip .mg-siterip-embed-target iframe,
body.mg-shell .mg-siterip-auto-wrap .video-box.mg-embed-target iframe {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    border: 0 !important;
    border-radius: 24px !important;
    background: #000 !important;
}

body.mg-shell .mg-siterip .video-box.mg-embed-target iframe ~ .mg-gallery-fallback,
body.mg-shell .mg-siterip .video-box.mg-embed-target iframe ~ .mg-siterip-fallback,
body.mg-shell .mg-siterip .video-box.mg-embed-target .mg-embed-frame ~ .mg-gallery-fallback,
body.mg-shell .mg-siterip .video-box.mg-embed-target .mg-embed-frame ~ .mg-siterip-fallback,
body.mg-shell .mg-siterip .video-box.mg-embed-loaded .mg-gallery-fallback,
body.mg-shell .mg-siterip .video-box.mg-embed-loaded .mg-siterip-fallback,
body.mg-shell .mg-siterip-auto-wrap .video-box.mg-embed-target iframe ~ .mg-gallery-fallback,
body.mg-shell .mg-siterip-auto-wrap .video-box.mg-embed-target iframe ~ .mg-siterip-fallback,
body.mg-shell .mg-siterip-auto-wrap .video-box.mg-embed-loaded .mg-gallery-fallback,
body.mg-shell .mg-siterip-auto-wrap .video-box.mg-embed-loaded .mg-siterip-fallback {
    display: none !important;
}

@media (max-width: 640px) {
    body.mg-shell .mg-siterip .container {
        width: min(100% - 22px, var(--mg-container)) !important;
    }

    body.mg-shell .mg-siterip .mg-watch-header {
        padding-top: 14px !important;
        padding-bottom: 8px !important;
    }

    body.mg-shell .mg-siterip .video_header.mg-watch-title {
        font-size: clamp(22px, 7vw, 30px) !important;
    }

    body.mg-shell .mg-siterip .video-box.mg-embed-target,
    body.mg-shell .mg-siterip .mg-siterip-embed,
    body.mg-shell .mg-siterip .mg-siterip-embed-target,
    body.mg-shell .mg-siterip-auto-wrap .video-box.mg-embed-target,
    body.mg-shell .mg-siterip .video-box.mg-embed-target iframe,
    body.mg-shell .mg-siterip .mg-siterip-embed iframe,
    body.mg-shell .mg-siterip .mg-siterip-embed-target iframe,
    body.mg-shell .mg-siterip-auto-wrap .video-box.mg-embed-target iframe {
        border-radius: 22px !important;
    }
}

/* =========================================================
   V18: Search results comfort + card background tongue fix.
   Paste at the VERY END of css/mygirls-redesign.css.
   Based on the current user-edited CSS.
   ========================================================= */

/* 1) Stop grid rows from stretching all news cards to the height of the search form. */
body.mg-shell .mg-list-grid,
body.mg-shell .row.mg-card-grid,
body.mg-shell .mg-list-grid > #dle-content,
body.mg-shell .row.mg-card-grid > #dle-content,
body.mg-shell .mg-list-grid > .dle-content,
body.mg-shell .row.mg-card-grid > .dle-content {
    align-items: start !important;
}

body.mg-shell .mg-list-grid > .thumb,
body.mg-shell .row.mg-card-grid > .thumb,
body.mg-shell .mg-list-grid > [class*="col-"],
body.mg-shell .row.mg-card-grid > [class*="col-"],
body.mg-shell .mg-list-grid > #dle-content > .thumb,
body.mg-shell .row.mg-card-grid > #dle-content > .thumb,
body.mg-shell .mg-list-grid > #dle-content > [class*="col-"],
body.mg-shell .row.mg-card-grid > #dle-content > [class*="col-"],
body.mg-shell .mg-list-grid > .dle-content > .thumb,
body.mg-shell .row.mg-card-grid > .dle-content > .thumb,
body.mg-shell .mg-list-grid > .dle-content > [class*="col-"],
body.mg-shell .row.mg-card-grid > .dle-content > [class*="col-"] {
    align-self: start !important;
}

body.mg-shell .mg-list-grid .item.mg-card,
body.mg-shell .row.mg-card-grid .item.mg-card,
body.mg-shell .mg-list-grid .mg-card-link,
body.mg-shell .row.mg-card-grid .mg-card-link {
    height: auto !important;
    min-height: 0 !important;
}

body.mg-shell .mg-list-grid .name.mg-card-body,
body.mg-shell .row.mg-card-grid .name.mg-card-body {
    flex: 0 0 auto !important;
    min-height: 75px !important;
    padding: 12px 14px 13px !important;
}

body.mg-shell .mg-list-grid .mg-card-title,
body.mg-shell .row.mg-card-grid .mg-card-title {
    min-height: 40px !important;
}

/* 2) Search form must be a full-width panel, not the first tall card in the results grid. */
body.mg-shell .mg-list-grid > #dle-content > .search-page,
body.mg-shell .row.mg-card-grid > #dle-content > .search-page,
body.mg-shell .mg-list-grid > .dle-content > .search-page,
body.mg-shell .row.mg-card-grid > .dle-content > .search-page,
body.mg-shell .mg-list-grid .search-page,
body.mg-shell .row.mg-card-grid .search-page,
body.mg-shell .mg-list-grid .searchtable,
body.mg-shell .row.mg-card-grid .searchtable,
body.mg-shell .mg-list-grid form[name="fullsearch"],
body.mg-shell .row.mg-card-grid form[name="fullsearch"],
body.mg-shell .mg-list-grid form#fullsearch,
body.mg-shell .row.mg-card-grid form#fullsearch {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    align-self: start !important;
    box-sizing: border-box !important;
}

/* Parent fallback for DLE/Bootstrap wrappers around the search block. */
body.mg-shell .mg-list-grid > #dle-content > .thumb:has(.search-page),
body.mg-shell .row.mg-card-grid > #dle-content > .thumb:has(.search-page),
body.mg-shell .mg-list-grid > #dle-content > [class*="col-"]:has(.search-page),
body.mg-shell .row.mg-card-grid > #dle-content > [class*="col-"]:has(.search-page),
body.mg-shell .mg-list-grid > #dle-content > .thumb:has(.searchtable),
body.mg-shell .row.mg-card-grid > #dle-content > .thumb:has(.searchtable),
body.mg-shell .mg-list-grid > #dle-content > [class*="col-"]:has(.searchtable),
body.mg-shell .row.mg-card-grid > #dle-content > [class*="col-"]:has(.searchtable) {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
}

body.mg-shell .search-page,
body.mg-shell .searchtable,
body.mg-shell form[name="fullsearch"],
body.mg-shell form#fullsearch {
    overflow: hidden !important;
    margin: 0 0 16px !important;
    padding: 22px !important;
    border-radius: 24px !important;
    border: 1px solid var(--mg-border) !important;
    background:
        linear-gradient(135deg, rgba(255,79,137,.08), rgba(124,92,255,.06) 45%, transparent 72%),
        var(--mg-surface) !important;
    color: var(--mg-text) !important;
    box-shadow: 0 14px 38px rgba(0,0,0,.12) !important;
}

html[data-theme="light"] body.mg-shell .search-page,
html[data-theme="light"] body.mg-shell .searchtable,
html[data-theme="light"] body.mg-shell form[name="fullsearch"],
html[data-theme="light"] body.mg-shell form#fullsearch,
html.mg-theme-light body.mg-shell .search-page,
html.mg-theme-light body.mg-shell .searchtable,
html.mg-theme-light body.mg-shell form[name="fullsearch"],
html.mg-theme-light body.mg-shell form#fullsearch {
    background:
        linear-gradient(135deg, rgba(255,79,137,.08), rgba(124,92,255,.05) 45%, rgba(0,212,255,.05) 72%),
        #fff !important;
    color: #151722 !important;
    box-shadow: 0 16px 45px rgba(23,33,64,.10) !important;
}

body.mg-shell .search-page h1,
body.mg-shell .search-page h2,
body.mg-shell .searchtable h1,
body.mg-shell .searchtable h2,
body.mg-shell form[name="fullsearch"] h1,
body.mg-shell form[name="fullsearch"] h2,
body.mg-shell form#fullsearch h1,
body.mg-shell form#fullsearch h2 {
    margin: 0 0 16px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--mg-text) !important;
    font-size: clamp(26px, 3vw, 38px) !important;
    line-height: 1.05 !important;
    letter-spacing: -.04em !important;
    font-weight: 950 !important;
}

/* Normalize old DLE table-based search markup. */
body.mg-shell .search-page table,
body.mg-shell .search-page tbody,
body.mg-shell .search-page tr,
body.mg-shell .search-page td,
body.mg-shell .searchtable table,
body.mg-shell .searchtable tbody,
body.mg-shell .searchtable tr,
body.mg-shell .searchtable td,
body.mg-shell form[name="fullsearch"] table,
body.mg-shell form[name="fullsearch"] tbody,
body.mg-shell form[name="fullsearch"] tr,
body.mg-shell form[name="fullsearch"] td,
body.mg-shell form#fullsearch table,
body.mg-shell form#fullsearch tbody,
body.mg-shell form#fullsearch tr,
body.mg-shell form#fullsearch td {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

body.mg-shell .search-page form,
body.mg-shell .searchtable form,
body.mg-shell form[name="fullsearch"],
body.mg-shell form#fullsearch {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px !important;
}

body.mg-shell .search-page input[type="text"],
body.mg-shell .search-page input[type="search"],
body.mg-shell .searchtable input[type="text"],
body.mg-shell .searchtable input[type="search"],
body.mg-shell form[name="fullsearch"] input[type="text"],
body.mg-shell form[name="fullsearch"] input[type="search"],
body.mg-shell form#fullsearch input[type="text"],
body.mg-shell form#fullsearch input[type="search"] {
    flex: 1 1 320px !important;
    width: auto !important;
    max-width: none !important;
    height: 46px !important;
    margin: 0 !important;
    padding: 0 16px !important;
    border-radius: 999px !important;
    border: 1px solid var(--mg-border) !important;
    background: var(--mg-bg-soft) !important;
    color: var(--mg-text) !important;
    box-shadow: none !important;
    outline: none !important;
}

body.mg-shell .search-page input[type="submit"],
body.mg-shell .search-page input[type="button"],
body.mg-shell .search-page button,
body.mg-shell .search-page .btn,
body.mg-shell .search-page .bbcodes,
body.mg-shell .searchtable input[type="submit"],
body.mg-shell .searchtable input[type="button"],
body.mg-shell .searchtable button,
body.mg-shell .searchtable .btn,
body.mg-shell .searchtable .bbcodes,
body.mg-shell form[name="fullsearch"] input[type="submit"],
body.mg-shell form[name="fullsearch"] input[type="button"],
body.mg-shell form[name="fullsearch"] button,
body.mg-shell form[name="fullsearch"] .btn,
body.mg-shell form[name="fullsearch"] .bbcodes,
body.mg-shell form#fullsearch input[type="submit"],
body.mg-shell form#fullsearch input[type="button"],
body.mg-shell form#fullsearch button,
body.mg-shell form#fullsearch .btn,
body.mg-shell form#fullsearch .bbcodes {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 0 !important;
    height: 46px !important;
    margin: 0 !important;
    padding: 0 18px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, var(--mg-accent), var(--mg-accent-2)) !important;
    color: #fff !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    box-shadow: 0 12px 30px rgba(255,79,137,.20) !important;
}

/* Old DLE info boxes inside search should not look like an orange warning block. */
body.mg-shell .search-page .berrors,
body.mg-shell .search-page .alert,
body.mg-shell .search-page .info,
body.mg-shell .searchtable .berrors,
body.mg-shell .searchtable .alert,
body.mg-shell .searchtable .info,
body.mg-shell form[name="fullsearch"] .berrors,
body.mg-shell form[name="fullsearch"] .alert,
body.mg-shell form[name="fullsearch"] .info,
body.mg-shell form#fullsearch .berrors,
body.mg-shell form#fullsearch .alert,
body.mg-shell form#fullsearch .info {
    flex: 1 1 100% !important;
    width: 100% !important;
    margin: 10px 0 0 !important;
    padding: 11px 14px !important;
    border-radius: 16px !important;
    border: 1px solid var(--mg-border) !important;
    background: var(--mg-surface-2) !important;
    color: var(--mg-muted) !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
}

/* 3) Light theme cards should not look like a black slab unless the user selected Night. */
html[data-theme="light"] body.mg-shell .item.mg-card,
html[data-theme="light"] body.mg-shell .name.mg-card-body,
html.mg-theme-light body.mg-shell .item.mg-card,
html.mg-theme-light body.mg-shell .name.mg-card-body {
    background: #fff !important;
    color: #151722 !important;
}

html[data-theme="light"] body.mg-shell .mg-card-title,
html.mg-theme-light body.mg-shell .mg-card-title {
    color: #151722 !important;
}

html[data-theme="light"] body.mg-shell .mg-card-meta,
html.mg-theme-light body.mg-shell .mg-card-meta {
    color: #626a7d !important;
}

@media (max-width: 760px) {
    body.mg-shell .search-page,
    body.mg-shell .searchtable,
    body.mg-shell form[name="fullsearch"],
    body.mg-shell form#fullsearch {
        padding: 18px !important;
        border-radius: 22px !important;
    }

    body.mg-shell .search-page input[type="text"],
    body.mg-shell .search-page input[type="search"],
    body.mg-shell .searchtable input[type="text"],
    body.mg-shell .searchtable input[type="search"],
    body.mg-shell form[name="fullsearch"] input[type="text"],
    body.mg-shell form[name="fullsearch"] input[type="search"],
    body.mg-shell form#fullsearch input[type="text"],
    body.mg-shell form#fullsearch input[type="search"],
    body.mg-shell .search-page input[type="submit"],
    body.mg-shell .search-page input[type="button"],
    body.mg-shell .search-page button,
    body.mg-shell .search-page .btn,
    body.mg-shell .search-page .bbcodes,
    body.mg-shell .searchtable input[type="submit"],
    body.mg-shell .searchtable input[type="button"],
    body.mg-shell .searchtable button,
    body.mg-shell .searchtable .btn,
    body.mg-shell .searchtable .bbcodes,
    body.mg-shell form[name="fullsearch"] input[type="submit"],
    body.mg-shell form[name="fullsearch"] input[type="button"],
    body.mg-shell form[name="fullsearch"] button,
    body.mg-shell form[name="fullsearch"] .btn,
    body.mg-shell form[name="fullsearch"] .bbcodes,
    body.mg-shell form#fullsearch input[type="submit"],
    body.mg-shell form#fullsearch input[type="button"],
    body.mg-shell form#fullsearch button,
    body.mg-shell form#fullsearch .btn,
    body.mg-shell form#fullsearch .bbcodes {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    body.mg-shell .mg-list-grid .name.mg-card-body,
    body.mg-shell .row.mg-card-grid .name.mg-card-body {
        min-height: 65px !important;
        padding: 10px 12px 12px !important;
    }
}

/* =========================================================
   V19: Search results left empty slot/gap fix.
   Paste at the VERY END of css/mygirls-redesign.css.
   This removes the old hidden DLE search block/grid item so
   result cards start from the first column and form two clean rows.
   ========================================================= */

/* Hide the old DLE search form/panel inside the card grid. The modern
   Search MyGirls header already provides search access above the results. */
body.mg-shell .mg-list-grid .search-page,
body.mg-shell .row.mg-card-grid .search-page,
body.mg-shell .mg-list-grid .searchtable,
body.mg-shell .row.mg-card-grid .searchtable,
body.mg-shell .mg-list-grid form[name="fullsearch"],
body.mg-shell .row.mg-card-grid form[name="fullsearch"],
body.mg-shell .mg-list-grid form#fullsearch,
body.mg-shell .row.mg-card-grid form#fullsearch {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    max-width: 0 !important;
    min-width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

/* If DLE wrapped that old search block in a Bootstrap .thumb/.col-* cell,
   remove the wrapper too. Otherwise the wrapper remains as an empty card slot. */
body.mg-shell .mg-list-grid > #dle-content > .thumb:has(.search-page),
body.mg-shell .row.mg-card-grid > #dle-content > .thumb:has(.search-page),
body.mg-shell .mg-list-grid > #dle-content > [class*="col-"]:has(.search-page),
body.mg-shell .row.mg-card-grid > #dle-content > [class*="col-"]:has(.search-page),
body.mg-shell .mg-list-grid > #dle-content > .thumb:has(.searchtable),
body.mg-shell .row.mg-card-grid > #dle-content > .thumb:has(.searchtable),
body.mg-shell .mg-list-grid > #dle-content > [class*="col-"]:has(.searchtable),
body.mg-shell .row.mg-card-grid > #dle-content > [class*="col-"]:has(.searchtable),
body.mg-shell .mg-list-grid > #dle-content > .thumb:has(form[name="fullsearch"]),
body.mg-shell .row.mg-card-grid > #dle-content > .thumb:has(form[name="fullsearch"]),
body.mg-shell .mg-list-grid > #dle-content > [class*="col-"]:has(form[name="fullsearch"]),
body.mg-shell .row.mg-card-grid > #dle-content > [class*="col-"]:has(form[name="fullsearch"]),
body.mg-shell .mg-list-grid > #dle-content > .thumb:has(form#fullsearch),
body.mg-shell .row.mg-card-grid > #dle-content > .thumb:has(form#fullsearch),
body.mg-shell .mg-list-grid > #dle-content > [class*="col-"]:has(form#fullsearch),
body.mg-shell .row.mg-card-grid > #dle-content > [class*="col-"]:has(form#fullsearch),
body.mg-shell .mg-list-grid > .thumb:has(.search-page),
body.mg-shell .row.mg-card-grid > .thumb:has(.search-page),
body.mg-shell .mg-list-grid > [class*="col-"]:has(.search-page),
body.mg-shell .row.mg-card-grid > [class*="col-"]:has(.search-page),
body.mg-shell .mg-list-grid > .thumb:has(.searchtable),
body.mg-shell .row.mg-card-grid > .thumb:has(.searchtable),
body.mg-shell .mg-list-grid > [class*="col-"]:has(.searchtable),
body.mg-shell .row.mg-card-grid > [class*="col-"]:has(.searchtable),
body.mg-shell .mg-list-grid > .thumb:has(form[name="fullsearch"]),
body.mg-shell .row.mg-card-grid > .thumb:has(form[name="fullsearch"]),
body.mg-shell .mg-list-grid > [class*="col-"]:has(form[name="fullsearch"]),
body.mg-shell .row.mg-card-grid > [class*="col-"]:has(form[name="fullsearch"]),
body.mg-shell .mg-list-grid > .thumb:has(form#fullsearch),
body.mg-shell .row.mg-card-grid > .thumb:has(form#fullsearch),
body.mg-shell .mg-list-grid > [class*="col-"]:has(form#fullsearch),
body.mg-shell .row.mg-card-grid > [class*="col-"]:has(form#fullsearch) {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    max-width: 0 !important;
    min-width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    grid-column: auto !important;
    overflow: hidden !important;
}

/* Safety net: in card grids, direct Bootstrap cells that do not contain a
   real MyGirls card should not reserve an empty grid slot. Pagination and
   navigation are excluded and remain full-width. */
body.mg-shell .mg-list-grid > #dle-content > .thumb:not(:has(.mg-card)):not(:has(.item)):not(:has(.navigation)):not(:has(.mg-pagination)):not(:has(.bottom-nav)):not(:has(.pages)),
body.mg-shell .row.mg-card-grid > #dle-content > .thumb:not(:has(.mg-card)):not(:has(.item)):not(:has(.navigation)):not(:has(.mg-pagination)):not(:has(.bottom-nav)):not(:has(.pages)),
body.mg-shell .mg-list-grid > #dle-content > [class*="col-"]:not(:has(.mg-card)):not(:has(.item)):not(:has(.navigation)):not(:has(.mg-pagination)):not(:has(.bottom-nav)):not(:has(.pages)),
body.mg-shell .row.mg-card-grid > #dle-content > [class*="col-"]:not(:has(.mg-card)):not(:has(.item)):not(:has(.navigation)):not(:has(.mg-pagination)):not(:has(.bottom-nav)):not(:has(.pages)) {
    display: none !important;
}

/* Keep the actual result cards compact and left-aligned after the gap is removed. */
body.mg-shell .mg-list-grid > #dle-content,
body.mg-shell .row.mg-card-grid > #dle-content {
    justify-items: stretch !important;
    align-items: start !important;
}
