/* Mobile refinement: Classic Hybrid + Classic Portal.
   Deliberately scoped: Minimal and desktop remain unchanged. The stylesheet is
   loaded after mobile-nav.css so legacy breakpoint rules cannot override it. */
@media (max-width: 900px) {
  html[data-l2-layout="classic-hybrid"] {
    --mobile-panel: var(--ch-panel);
    --mobile-line: var(--ch-line-soft);
    --mobile-text: var(--ch-text);
    --mobile-muted: var(--ch-muted);
  }
  html[data-l2-layout="classic-portal"] {
    --mobile-panel: var(--cp-surface);
    --mobile-line: var(--cp-line-soft);
    --mobile-text: var(--cp-text);
    --mobile-muted: var(--cp-muted);
  }
  /* Keep layout width and children contained without hiding dropdowns/modals. */
  html:is([data-l2-layout="classic-hybrid"],[data-l2-layout="classic-portal"]) body.l2-home-v3 :is(.ch-home,.cp-home) {
    min-width: 0;
  }
  html:is([data-l2-layout="classic-hybrid"],[data-l2-layout="classic-portal"]) body.l2-home-v3 :is(.ch-home,.cp-home) :is(section,article,aside,.ch-module,.ch-box,.cp-side-stack,.cp-gallery-frame,.cp-stats-frame,.cp-live-frame,.l2-home-module,.l2-home-rankings,.l2-home-rank-card) {
    min-width: 0;
  }
  /* Same one-column reading order as Minimal on tablets and phones. */
  html[data-l2-layout="classic-portal"] body.l2-home-v3 :is(.cp-showcase-grid,.cp-side-stack,.cp-lower-grid,.cp-hero-content) {
    grid-template-columns: minmax(0,1fr) !important;
  }
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 :is(.ch-hero-inner,.ch-information-grid) {
    grid-template-columns: minmax(0,1fr) !important;
  }
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-server-card,
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-realm-card {
    width: 100%; max-width: none;
  }
  /* Rank cards: a comfortable full-width column, not two squeezed panels. */
  html:is([data-l2-layout="classic-hybrid"],[data-l2-layout="classic-portal"]) body.l2-home-v3 .l2-home-rankings-grid {
    grid-template-columns: minmax(0,1fr) !important;
    gap: 12px !important;
  }
  /* Gallery: one main image and a thumb rail inside the viewport. */
  html:is([data-l2-layout="classic-hybrid"],[data-l2-layout="classic-portal"]) body.l2-home-v3 .l2-gallery-v5-stage {
    grid-template-columns: minmax(0,1fr) !important;
  }
  html:is([data-l2-layout="classic-hybrid"],[data-l2-layout="classic-portal"]) body.l2-home-v3 .l2-gallery-v5-mosaic {
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
    grid-template-rows: 76px !important;
    min-height: 76px !important;
    overflow: hidden;
  }
  html:is([data-l2-layout="classic-hybrid"],[data-l2-layout="classic-portal"]) body.l2-home-v3 .l2-gallery-v5-tile {
    min-width: 0; height: 76px !important;
  }
  /* Shared module headings are allowed to wrap instead of shrinking labels. */
  html:is([data-l2-layout="classic-hybrid"],[data-l2-layout="classic-portal"]) body.l2-home-v3 :is(.l2-module-head,.l2-home-rankings-head,.l2-gallery-v5-head,.ch-box-head,.cp-section-head) {
    min-width: 0; gap: 12px;
  }
  html:is([data-l2-layout="classic-hybrid"],[data-l2-layout="classic-portal"]) body.l2-home-v3 :is(.l2-module-head,.l2-home-rankings-head,.l2-gallery-v5-head,.ch-box-head,.cp-section-head) > :first-child {
    min-width: 0;
  }
  html:is([data-l2-layout="classic-hybrid"],[data-l2-layout="classic-portal"]) body.l2-home-v3 :is(.l2-module-head,.l2-home-rankings-head,.l2-gallery-v5-head,.ch-box-head,.cp-section-head) h2 {
    overflow-wrap: break-word; line-height: 1.2 !important;
  }
  /* Internal page headers and wrappers should match Minimal's mobile gutter. */
  html:is([data-l2-layout="classic-hybrid"],[data-l2-layout="classic-portal"]) .l2-pagebar-inner {
    width: auto !important; max-width: calc(100% - 24px) !important;
  }
  html:is([data-l2-layout="classic-hybrid"],[data-l2-layout="classic-portal"]) body:not(.l2-home-v3) :is(.rank-shell,.support-shell,.don-shell,.player-shell,.dl4-shell,.l2r-shell,.gallery-shell,.auth-shell,main>.max-w-7xl,main>.max-w-6xl) {
    width: auto !important;
    max-width: calc(100% - 24px) !important;
    margin-left: auto !important; margin-right: auto !important;
    min-width: 0;
  }
  html:is([data-l2-layout="classic-hybrid"],[data-l2-layout="classic-portal"]) body:not(.l2-home-v3) main {
    min-width: 0;
  }
  /* Header/menu: keep navigation accessible and scroll within short screens. */
  html[data-l2-layout="classic-portal"] .cp-header-inner,
  html[data-l2-layout="classic-hybrid"] .cr-nav-shell {
    min-width: 0; grid-template-columns: minmax(0,1fr) auto !important;
  }
  html[data-l2-layout="classic-portal"] .cp-header-actions,
  html[data-l2-layout="classic-hybrid"] .cr-account { flex: 0 0 auto; gap: 5px; }
  html[data-l2-layout="classic-portal"] .cp-brand,
  html[data-l2-layout="classic-hybrid"] .cr-brand { min-width: 0; width: auto; }
  html[data-l2-layout="classic-portal"] .cp-brand-copy,
  html[data-l2-layout="classic-hybrid"] .cr-brand>span:last-child { min-width: 0; }
  html[data-l2-layout="classic-portal"] .cp-brand-copy strong,
  html[data-l2-layout="classic-hybrid"] .cr-brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html[data-l2-layout="classic-portal"] .cp-mobile-menu,
  html[data-l2-layout="classic-hybrid"] .cr-mobile-menu {
    max-height: min(75dvh, 680px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  html[data-l2-layout="classic-portal"] .cp-mobile-menu.open,
  html[data-l2-layout="classic-hybrid"] .cr-mobile-menu.open {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 7px !important;
    padding: 12px !important;
  }
  html[data-l2-layout="classic-portal"] .cp-mobile-head,
  html[data-l2-layout="classic-portal"] .cp-mobile-tools,
  html[data-l2-layout="classic-hybrid"] .cr-mobile-brand,
  html[data-l2-layout="classic-hybrid"] .cr-mobile-tools,
  html[data-l2-layout="classic-hybrid"] .cr-mobile-account,
  html[data-l2-layout="classic-portal"] .cp-mobile-rank,
  html[data-l2-layout="classic-hybrid"] .cr-mobile-rank {
    grid-column: 1 / -1 !important;
    min-width: 0;
  }
  html[data-l2-layout="classic-portal"] .cp-mobile-menu>a,
  html[data-l2-layout="classic-portal"] .cp-mobile-rank>button,
  html[data-l2-layout="classic-hybrid"] .cr-mobile-menu>a,
  html[data-l2-layout="classic-hybrid"] .cr-mobile-rank>button {
    min-height: 46px !important;
    width: 100%;
    font-size: 13px !important;
    line-height: 1.35 !important;
  }
  html[data-l2-layout="classic-portal"] .cp-mobile-tools,
  html[data-l2-layout="classic-hybrid"] .cr-mobile-tools {
    flex-wrap: wrap; row-gap: 12px; justify-content: space-between;
  }
  html[data-l2-layout="classic-portal"] .cp-mobile-menu .l2-rank-submenu>a,
  html[data-l2-layout="classic-hybrid"] .cr-mobile-menu .l2-rank-submenu>a {
    font-size: 13px !important; min-height: 42px !important;
  }
}

@media (max-width: 700px) {
  /* Consistent 12px gutters and calm vertical spacing, without touching desktop. */
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-home {
    width: auto !important; max-width: calc(100% - 24px) !important;
    margin: 14px auto 36px !important;
  }
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-wrap {
    width: auto !important; max-width: calc(100% - 24px) !important;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 :is(.cp-showcase-grid,.cp-lower-grid) {
    gap: 14px !important; margin-top: 14px !important;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 :is(.cp-rank-frame,.cp-achievements-frame,.cp-opening,.cp-bottom-actions) {
    margin-top: 14px !important;
  }
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 :is(.ch-overview,.ch-achievements-section,.ch-rankings-section,.ch-media-section,.ch-information-grid,.ch-live-module) {
    margin-top: 16px !important;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-hero-shell::after { display: none; }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-hero-content {
    padding: 26px 18px 20px !important; gap: 22px !important;
  }
  /* A legacy global mobile rule was adding padding inside the already padded hero. */
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-hero-copy {
    padding: 0 !important; min-width: 0;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-hero-copy h1,
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-hero-copy h1 {
    font-size: clamp(29px,8.5vw,38px) !important; line-height: 1.12 !important;
    overflow-wrap: break-word;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-hero-desc,
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-hero-copy>p {
    font-size: 14px !important; line-height: 1.55 !important;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-hero-actions,
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-actions {
    display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 9px !important;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-action,
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-button {
    min-width: 0 !important; width: 100% !important;
    min-height: 45px; padding: 10px 8px !important;
    font-size: 13px !important; line-height: 1.25 !important;
    text-align: center; overflow-wrap: normal;
  }
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-hero-inner {
    padding-top: 28px !important; padding-bottom: 24px !important; gap: 20px !important;
  }
  /* Stats: two readable columns down to 320px, never one giant card per row. */
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .l2-stats-grid,
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-stats-module .l2-stats-grid {
    display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 9px !important;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .l2-stat-card,
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-stats-module .l2-stat-card {
    min-width: 0 !important; min-height: 100px !important;
    padding: 11px 8px !important; gap: 7px !important;
    flex-direction: column !important; justify-content: center !important;
    align-items: center !important;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .l2-stat-card>div,
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .l2-stat-card>div {
    min-width: 0; width: 100%; align-items: center; overflow-wrap: normal;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .l2-stat-card strong,
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .l2-stat-card strong {
    font-size: 24px !important; line-height: 1.1 !important;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .l2-stat-card span:not(.l2-stat-icon),
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .l2-stat-card span:not(.l2-stat-icon) {
    font-size: 12px !important; line-height: 1.3 !important;
    overflow-wrap: normal; word-break: normal;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .l2-stats-module,
  html[data-l2-layout="classic-portal"] body.l2-home-v3 :is(.l2-home-rankings,.l2-home-achievements),
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .l2-gallery-v5,
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 :is(.ch-module,.ch-box) {
    padding: 15px !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-gallery-v5-main {
    min-height: 220px !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-gallery-v5-mosaic {
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
    grid-template-rows: 67px !important;
    min-height: 67px !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-gallery-v5-tile {
    height: 67px !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-gallery-v5-head,
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-rankings-head {
    flex-wrap: wrap; align-items: center; row-gap: 8px !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 :is(.l2-home-rankings-head>a,.l2-gallery-v5-all) {
    min-height: 36px; font-size: 12px !important;
    line-height: 1.3 !important;
    white-space: normal;
  }
  /* Rankings: score stays on the right on medium phones; no 8px labels. */
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-rank-list {
    padding: 4px 8px 6px !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-rank-row:not(.l2-home-achievement-row) {
    grid-template-columns: 26px 38px minmax(0,1fr) auto !important;
    gap: 8px !important; min-height: 62px !important; padding: 9px 4px !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-rank-row:not(.l2-home-achievement-row) .l2-home-rank-score {
    grid-column: auto !important; display: flex !important; flex-direction: column !important;
    align-items: flex-end !important; text-align: right !important; margin: 0 !important;
    gap: 3px !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-rank-row:not(.l2-home-achievement-row) .l2-home-rank-score strong {
    font-size: 14px !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-rank-row:not(.l2-home-achievement-row) .l2-home-rank-score small {
    font-size: 10px !important; line-height: 1.2 !important;
  }
  /* Achievements: player and achievement on two lines instead of four tiny columns. */
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-achievement-row {
    grid-template-columns: 23px 38px minmax(0,1fr) !important;
    grid-template-areas: "ach-type ach-avatar ach-player" "ach-type ach-avatar ach-score" !important;
    gap: 4px 9px !important; min-height: 76px !important;
    padding: 10px 6px !important;
    background: transparent !important;
    border-bottom: 1px solid var(--mobile-line) !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-achievement-row .l2-home-rank-player b,
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-achievement-summary {
    flex-wrap: wrap !important; white-space: normal !important;
    overflow: visible !important; align-items: baseline !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-achievement-summary>strong {
    flex: 1 1 120px !important; white-space: normal !important;
    overflow: visible !important; text-overflow: clip !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-achievement-summary strong {
    font-size: 13px !important; line-height: 1.25 !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-achievement-summary>span {
    font-size: 11px !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-achievement-score {
    grid-area: ach-score !important; width: auto !important; min-width: 0 !important;
    display: flex !important; flex-direction: row !important; align-items: center !important;
    justify-content: flex-start !important; gap: 6px !important;
    margin: 0 !important; text-align: left !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-achievement-score>strong {
    font-size: 11px !important; white-space: normal !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-achievement-score>small {
    font-size: 10px !important; white-space: normal !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-achievement-score>small::before { content: "·" !important; }
  /* News & boss entries: preserve images/dates, give text room to wrap. */
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-section-head,
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-box-head {
    padding: 13px !important; min-height: 0 !important;
    flex-wrap: wrap; row-gap: 10px !important;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-section-head h2,
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-box-head h2 { font-size: 21px !important; }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-section-head>a,
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-box-head>a {
    min-height: 34px; display: inline-flex; align-items: center;
    font-size: 12px !important; line-height: 1.25;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-journal-list { padding: 8px 12px !important; }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-journal-entry {
    grid-template-columns: 50px minmax(0,1fr) !important; gap: 12px !important;
    padding: 13px 4px 42px !important;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-journal-date { width: 50px !important; height: 52px !important; }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-journal-copy>strong,
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-journal-entry.is-featured .cp-journal-copy>strong {
    font-size: 16px !important; line-height: 1.3 !important;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-journal-copy>span,
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-news-copy small {
    font-size: 13px !important; line-height: 1.5 !important;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-journal-copy :is(small,em) { font-size: 11px !important; }
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-news-item,
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-news-item:first-child {
    grid-template-columns: 54px minmax(0,1fr) !important;
    gap: 12px !important; padding: 12px 7px 40px !important;
  }
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-news-item>time { width: 54px !important; }
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-news-copy strong { font-size: 16px !important; }
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-news-item>i { display: none !important; }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-boss-card {
    grid-template-columns: 58px minmax(0,1fr) !important;
    gap: 10px !important; padding: 12px 8px !important;
    min-height: 82px !important;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-boss-card>i { display: none !important; }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-boss-image { width: 58px !important; height: 58px !important; }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-boss-copy>strong,
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-boss-copy>strong { font-size: 15px !important; white-space: normal !important; }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-boss-copy>small,
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-boss-copy>small { font-size: 11px !important; line-height: 1.25 !important; }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-boss-copy .l2-boss-time :is(b,em) { font-size: 11px !important; }
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-boss-row {
    grid-template-columns: 52px minmax(0,1fr) !important; gap: 12px !important;
    min-height: 83px !important; padding: 12px 4px !important;
  }
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-boss-time {
    grid-column: 2 !important; display: flex; flex-wrap: wrap;
    justify-content: flex-start; gap: 4px 12px; text-align: left;
  }
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-boss-time em { margin: 0 !important; }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-bottom-actions {
    grid-template-columns: 1fr !important;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-bottom-actions>a {
    min-height: 60px !important; padding: 10px 16px !important;
    justify-content: flex-start !important; border-right: 0 !important;
    border-bottom: 1px solid var(--mobile-line) !important;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-bottom-actions small { font-size: 11px !important; }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-bottom-actions b { font-size: 15px !important; }
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 .ch-bottom-actions a { min-height: 46px; }
  /* Phone navigation: full-width options and single-column ranking submenu. */
  html[data-l2-layout="classic-portal"] .cp-mobile-menu.open,
  html[data-l2-layout="classic-hybrid"] .cr-mobile-menu.open { grid-template-columns: minmax(0,1fr) !important; }
  html[data-l2-layout="classic-portal"] .cp-mobile-menu .l2-rank-submenu,
  html[data-l2-layout="classic-hybrid"] .cr-mobile-menu .l2-rank-submenu {
    grid-template-columns: minmax(0,1fr) !important;
  }
}

@media (max-width: 410px) {
  html[data-l2-layout="classic-hybrid"] body.l2-home-v3 :is(.ch-module,.ch-box),
  html[data-l2-layout="classic-portal"] body.l2-home-v3 :is(.l2-gallery-v5,.l2-stats-module,.l2-home-rankings,.l2-home-achievements) {
    padding: 12px !important;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-hero-content { padding: 21px 13px 16px !important; }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-realm-metrics>div {
    grid-template-columns: minmax(0,1fr) auto !important; gap: 8px !important;
  }
  html[data-l2-layout="classic-portal"] body.l2-home-v3 .cp-realm-metrics strong {
    max-width: 130px !important; text-align: right !important; overflow: hidden;
    white-space: normal !important; overflow-wrap: break-word;
  }
  html[data-l2-layout="classic-portal"] .cp-brand-copy strong { font-size: 16px !important; }
  html[data-l2-layout="classic-portal"] .cp-brand-copy small { display: none !important; }
  html[data-l2-layout="classic-portal"] .cp-brand-mark { width: 38px !important; height: 38px !important; flex: 0 0 38px !important; }
  html[data-l2-layout="classic-portal"] .cp-header-actions { gap: 3px !important; }
  html[data-l2-layout="classic-portal"] :is(.cp-account,.cp-register,.cp-icon-action,.cp-menu-button) {
    width: 34px !important; height: 38px !important; padding: 0 !important;
  }
  html[data-l2-layout="classic-hybrid"] .cr-brand-symbol,
  html[data-l2-layout="classic-hybrid"] .cr-brand-symbol img {
    width: 35px !important; height: 35px !important; flex-basis: 35px !important;
  }
  html[data-l2-layout="classic-hybrid"] .cr-brand>span:last-child { display: flex !important; }
  html[data-l2-layout="classic-hybrid"] .cr-brand strong { font-size: 16px !important; max-width: 105px; }
  html[data-l2-layout="classic-hybrid"] .cr-brand small { display: none; }
  html[data-l2-layout="classic-hybrid"] .cr-account { gap: 3px !important; }
  html[data-l2-layout="classic-hybrid"] :is(.cr-account-icon,.cr-menu-button) { width: 36px !important; min-height: 38px !important; }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-rank-row:not(.l2-home-achievement-row) {
    grid-template-columns: 22px 32px minmax(0,1fr) !important;
    gap: 6px !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-rank-row:not(.l2-home-achievement-row) .l2-home-rank-score {
    grid-column: 3 !important; align-items: flex-start !important; text-align: left !important;
    flex-direction: row !important; gap: 6px !important; flex-wrap: wrap;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-achievement-row {
    grid-template-columns: 20px 32px minmax(0,1fr) !important;
    gap: 4px 6px !important;
  }
  html:is([data-l2-layout="classic-portal"],[data-l2-layout="classic-hybrid"]) body.l2-home-v3 .l2-home-achievement-row .l2-home-rank-avatar {
    width: 32px !important; height: 32px !important;
  }
}
