/* ============================================================
   GUIDES PAGE (redesigned)
   Markup: modules/guides.php + buildGuidesNav() in
   templates/momo2/inc/template.functions.php
   Uses the momo2 theme tokens defined on :root in style.css.
   ============================================================ */

.gd-section {
    background: var(--m2-bg);
    padding: 0 0 60px;
}

/* Two-column shell */
.gd-app {
    max-width: 1240px;
    margin: 0 auto;
    padding: 26px 20px 0;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

/* ---------------------------------------------------------- SIDEBAR */
.gd-sidebar {
    position: sticky;
    top: calc(var(--m2-header-h) + 16px);
    z-index: 30;
}
.gd-sidebar-inner {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--m2-header-h) - 40px);
    background: var(--m2-bg-card);
    border: 1px solid var(--m2-border);
    border-radius: var(--m2-r-lg);
    overflow: hidden;
}
.gd-sidebar-title {
    margin: 0;
    padding: 16px 18px 12px;
    font-family: "Cinzel", "Roboto", serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .4px;
    color: var(--m2-gold);
    border-bottom: 1px solid var(--m2-border);
}

/* Search */
.gd-search {
    position: relative;
    padding: 12px;
    border-bottom: 1px solid var(--m2-border);
    flex: 0 0 auto;
}
.gd-search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--m2-text-muted);
    pointer-events: none;
}
.gd-search-input {
    width: 100%;
    height: 40px;
    padding: 0 36px 0 34px;
    background: var(--m2-bg-input);
    border: 1px solid var(--m2-border);
    border-radius: var(--m2-r-sm);
    color: var(--m2-text);
    font-size: 13.5px;
    outline: none;
    transition: border-color var(--m2-trans), box-shadow var(--m2-trans);
}
.gd-search-input::placeholder { color: var(--m2-text-muted); }
.gd-search-input:focus {
    border-color: var(--m2-gold-border);
    box-shadow: 0 0 0 3px var(--m2-gold-glow);
}
.gd-search-clear {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--m2-bg-elevated);
    color: var(--m2-text-sub);
    font-size: 11px;
    cursor: pointer;
    transition: color var(--m2-trans), background var(--m2-trans);
}
.gd-search-clear:hover { color: #fff; background: var(--m2-border-strong); }

/* Category accordion (scrolls inside the sticky panel) */
.gd-cats,
.gd-results {
    list-style: none;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    scrollbar-width: thin;
    scrollbar-color: var(--m2-border-strong) transparent;
}
.gd-cats::-webkit-scrollbar,
.gd-results::-webkit-scrollbar { width: 8px; }
.gd-cats::-webkit-scrollbar-thumb,
.gd-results::-webkit-scrollbar-thumb { background: var(--m2-border-strong); border-radius: 8px; }

.gd-cat { border-radius: var(--m2-r-sm); }
.gd-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 11px 12px;
    background: none;
    border: 0;
    border-radius: var(--m2-r-sm);
    color: var(--m2-text);
    font-size: 13.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background var(--m2-trans), color var(--m2-trans);
}
.gd-cat-head:hover { background: var(--m2-bg-elevated); color: var(--m2-gold); }
.gd-cat-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gd-cat-arrow {
    flex: 0 0 auto;
    font-size: 11px;
    color: var(--m2-text-muted);
    transition: transform .22s ease, color var(--m2-trans);
}
.gd-cat.is-open > .gd-cat-head { color: var(--m2-gold); }
.gd-cat.is-open > .gd-cat-head .gd-cat-arrow { transform: rotate(180deg); color: var(--m2-gold); }

/* Empty categories: shown but non-interactive */
.gd-cat-head-empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--m2-text-muted);
    opacity: .6;
    cursor: default;
}
.gd-cat-soon {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 2px 7px;
    border: 1px solid var(--m2-border);
    border-radius: 20px;
}

/* Submenu */
.gd-cat-list {
    list-style: none;
    margin: 0 0 4px;
    padding: 2px 0 6px;
    /* collapsed by default; JS sets .is-open on the parent */
    display: none;
}
.gd-cat.is-open > .gd-cat-list { display: block; }
.gd-cat-list a,
.gd-results a {
    display: block;
    padding: 8px 12px 8px 22px;
    font-size: 13px;
    line-height: 1.35;
    color: var(--m2-text-sub);
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 var(--m2-r-sm) var(--m2-r-sm) 0;
    transition: color var(--m2-trans), background var(--m2-trans), border-color var(--m2-trans);
}
.gd-cat-list a:hover,
.gd-results a:hover {
    color: var(--m2-gold);
    background: var(--m2-bg-elevated);
}
.gd-cat-list a.is-active {
    color: var(--m2-gold);
    background: var(--m2-gold-glow);
    border-left-color: var(--m2-gold);
    font-weight: 600;
}

/* Search results (flat list) */
.gd-results a { padding-left: 12px; }
.gd-results .gd-result-cat {
    display: block;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--m2-text-muted);
    margin-top: 1px;
}
.gd-results mark {
    background: var(--m2-gold-glow);
    color: var(--m2-gold);
    padding: 0 1px;
    border-radius: 2px;
}
.gd-noresults,
.gd-nav-msg {
    padding: 18px 14px;
    font-size: 13px;
    color: var(--m2-text-muted);
    text-align: center;
}

/* ---------------------------------------------------------- MAIN */
.gd-main {
    min-width: 0;
    background: var(--m2-bg-card);
    border: 1px solid var(--m2-border);
    border-radius: var(--m2-r-lg);
    padding: 26px 30px 30px;
}

.gd-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--m2-text-muted);
    margin-bottom: 16px;
}
.gd-breadcrumb a { color: var(--m2-text-sub); text-decoration: none; }
.gd-breadcrumb a:hover { color: var(--m2-gold); }
.gd-bc-sep { opacity: .5; }
.gd-bc-cat { color: var(--m2-text-sub); }

.gd-article-head { position: relative; margin-bottom: 20px; }
.gd-title {
    font-family: "Cinzel", "Roboto", serif;
    font-size: clamp(1.6rem, 3.5vw, 2.1rem);
    line-height: 1.2;
    color: #fff;
    margin: 0 0 14px;
    padding-right: 48px; /* room for edit button */
}
.gd-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--m2-border);
}
.gd-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--m2-text-muted);
}
.gd-meta-item i { color: var(--m2-gold-dim); }
.gd-edit {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--m2-r-sm);
    background: var(--m2-bg-elevated);
    border: 1px solid var(--m2-border);
    text-decoration: none;
    font-size: 16px;
    transition: border-color var(--m2-trans);
}
.gd-edit:hover { border-color: var(--m2-gold); }

.gd-content { margin-top: 20px; }

/* ============================================================
   SHARED RICH-CONTENT STYLING (.ck-content)
   These rules apply to ALL CKEditor content — the guides page
   (.gd-content) AND the news details page (.dark-news-body inside
   .ck-content) — so both render identically. guides.css loads on
   every page, so scoping to .ck-content is safe and DRY. Only the
   sidebar search <mark> (.gd-results) is outside .ck-content and
   therefore untouched. Existing markup/DB content is not changed. */

/* Keep rich content inside its column (esp. on phones) */
.ck-content {
    display: flow-root;          /* contain floated images (no bleed into footer/pager) */
    overflow-wrap: break-word;   /* break long words / URLs instead of overflowing */
    word-break: break-word;
}
.ck-content img { height: auto; }   /* preserve aspect ratio when width/height attrs exist */

/* --- Mirror the CKEditor editor's image alignment / sizing in the view ---
   The base .ck-content rules in style.css center every image as a block, so
   left/right-aligned (text-wrap) and resized images looked different from the
   editor. These rules restore CKEditor's own behaviour. */
.ck-content figure.image {
    display: table;
    margin: 0.9em auto;
    max-width: 100%;
    text-align: center;
}
.ck-content figure.image img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    min-width: 100%;             /* fill the figure box */
    height: auto;
}
.ck-content figure.image > figcaption {
    display: table-caption;
    caption-side: bottom;
    padding: 6px 6px 0;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--m2-text-muted);
    text-align: center;
    word-break: break-word;
}
/* Resized images carry their width as an inline style on the <figure>.
   The figure switches to block, so its caption must be block too (a
   table-caption outside a table box renders one letter per line). */
.ck-content figure.image.image_resized { display: block; box-sizing: border-box; }
.ck-content figure.image.image_resized img { width: 100%; }
.ck-content figure.image.image_resized > figcaption { display: block; }
/* Block alignment (no text wrap) */
.ck-content figure.image.image-style-align-center { margin-left: auto; margin-right: auto; }
.ck-content figure.image.image-style-block-align-left  { margin-left: 0; margin-right: auto; }
.ck-content figure.image.image-style-block-align-right { margin-right: 0; margin-left: auto; }
/* Side/inline alignment (text wraps around the image).
   This editor emits image-align-left / image-align-right (custom classNames
   set in admincp/modules/ckeditor5.php); the image-style-* selectors are a
   fallback for content authored with CKEditor's defaults. */
.ck-content figure.image.image-align-left,
.ck-content figure.image.image-style-align-left {
    float: left;  max-width: 50%; margin: 0.4em 1.5em 1em 0;
}
.ck-content figure.image.image-align-right,
.ck-content figure.image.image-style-align-right,
.ck-content figure.image.image-style-side {
    float: right; max-width: 50%; margin: 0.4em 0 1em 1.5em;
}
/* A wrapped image sitting right after a paragraph shouldn't add a top gap */
.ck-content p + figure.image.image-align-left,
.ck-content p + figure.image.image-align-right,
.ck-content p + figure.image.image-style-align-left,
.ck-content p + figure.image.image-style-align-right,
.ck-content p + figure.image.image-style-side { margin-top: 0; }

/* On narrow phones, floated images that shrink below ~180px hurt readability,
   so drop the wrap and show them full-width and centered instead. */
@media (max-width: 560px) {
    .ck-content figure.image.image-align-left,
    .ck-content figure.image.image-align-right,
    .ck-content figure.image.image-style-align-left,
    .ck-content figure.image.image-style-align-right,
    .ck-content figure.image.image-style-side {
        float: none;
        max-width: 100%;
        margin: 0.9em auto;
    }
}

/* Tables fill the column on desktop (width:100% from the base .ck-content
   rule) and only scroll horizontally when the screen is too narrow.
   CKEditor 5 wraps tables in <figure class="table">. */
.ck-content figure.table {
    clear: both;         /* start below floated images instead of squashing beside them */
    max-width: 100%;
    margin: 1.2em 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.gd-content > table {                /* bare (unwrapped) tables (guides content is a direct child) */
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
/* On phones keep a readable minimum width, so wide tables scroll instead
   of squashing their columns. Desktop is untouched (100% < 560px is false). */
@media (max-width: 700px) {
    .ck-content figure.table > table,
    .gd-content > table { min-width: 560px; }
}

/* Media embeds, iframes and code blocks stay within the column */
.ck-content figure.media,
.ck-content .raw-html-embed { max-width: 100%; }
.ck-content iframe { max-width: 100%; }
.ck-content pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre;
    -webkit-overflow-scrolling: touch;
}

/* ---------------------------------------------------------- HIGHLIGHTS / MARKERS
   Modernise the old flat highlight blocks in CMS content — both CKEditor's
   <mark class="marker-*"> highlights and the inline background-colour "callout"
   spans (the green success / red fail boxes). Every highlight gets a soft,
   rounded, padded "chip" shape that wraps cleanly across lines, and the classic
   full-saturation colours are softened into translucent tints that stay readable
   on the dark theme. Applies to guides + news; the sidebar search <mark>
   (.gd-results) is outside .ck-content and unaffected. Styling only. */

/* Chip shape for any highlighted inline text (marks + inline-bg spans) */
.ck-content mark,
.ck-content span[style*="background-color"] {
    padding: .06em .42em;
    border-radius: 6px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* CKEditor highlight markers → soft tints (keep the hue, keep text readable) */
.ck-content mark.marker-yellow { background: rgba(255, 205, 0, .22);  color: inherit; }
.ck-content mark.marker-green  { background: rgba(77, 230, 77, .18);  color: inherit; }
.ck-content mark.marker-pink   { background: rgba(252, 121, 153, .20); color: inherit; }
.ck-content mark.marker-blue   { background: rgba(114, 205, 253, .20); color: inherit; }
.ck-content mark.pen-red   { background: transparent; color: #ff6b6b; padding: 0; }
.ck-content mark.pen-green { background: transparent; color: #59d98a; padding: 0; }

/* Classic solid "callout" backgrounds → modern translucent badges. Inline
   background-colour has inline specificity, so !important is required to override
   it. A thin inset ring stands in for a border (no reflow). Only the specific
   green "success" and red/crimson "fail" colours actually used (plus this
   editor's palette green/red) are matched — never grayscale, so other highlights
   keep their own colour. Spaced + unspaced syntaxes both covered. */
.ck-content span[style*="background-color:rgb(77,230,77)"],
.ck-content span[style*="background-color:rgb(77, 230, 77)"],
.ck-content span[style*="background-color:hsl(120,75%,60%)"],
.ck-content span[style*="background-color:hsl(90,75%,60%)"] {
    padding: .16em .6em;
    border-radius: 8px;
    background-color: rgba(77, 230, 77, .13) !important;
    box-shadow: inset 0 0 0 1px rgba(77, 230, 77, .3);
}
.ck-content span[style*="background-color:rgb(230,77,77)"],
.ck-content span[style*="background-color:rgb(230, 77, 77)"],
.ck-content span[style*="background-color:hsl(348,83%,47%)"],
.ck-content span[style*="background-color:hsl(0,75%,60%)"] {
    padding: .16em .6em;
    border-radius: 8px;
    background-color: rgba(230, 77, 77, .15) !important;
    box-shadow: inset 0 0 0 1px rgba(230, 77, 77, .34);
}

/* Collapse a highlight nested inside another (e.g. <mark> inside a coloured
   span, as in "In case of success:") into ONE clean chip — otherwise it renders
   as a chip-inside-a-chip (double tint, double ring). The inner one becomes
   plain text so only the outer badge shows. */
.ck-content span[style*="background-color"] mark,
.ck-content mark span[style*="background-color"] {
    padding: 0;
    border-radius: 0;
    background: none !important;
    box-shadow: none;
}

/* Prev / next pager */
.gd-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 28px;
}
.gd-pager-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--m2-bg-elevated);
    border: 1px solid var(--m2-border);
    border-radius: var(--m2-r-md);
    text-decoration: none;
    transition: border-color var(--m2-trans), transform var(--m2-trans), background var(--m2-trans);
}
.gd-pager-link:hover {
    border-color: var(--m2-gold-border);
    background: var(--m2-bg-overlay);
    transform: translateY(-2px);
}
.gd-pager-next { text-align: right; align-items: flex-end; }
.gd-pager-dir {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--m2-text-muted);
}
.gd-pager-title { font-size: 13.5px; font-weight: 600; color: var(--m2-gold); }
.gd-pager-spacer { display: block; }

/* Footer / licence */
.gd-footer {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--m2-border);
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--m2-text-muted);
}
.gd-footer a { color: var(--m2-text-sub); }
.gd-footer a:hover { color: var(--m2-gold); }

/* ---------------------------------------------------------- MOBILE BAR + DRAWER */
.gd-mobilebar { display: none; }
.gd-backdrop { display: none; }

@media (max-width: 991px) {
    .gd-app {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 14px 14px 0;
    }

    /* Sticky toolbar under the header */
    .gd-mobilebar {
        display: flex;
        align-items: center;
        gap: 12px;
        position: sticky;
        top: var(--m2-header-h);
        z-index: 35;
        margin: 0 -14px 14px;
        padding: 10px 14px;
        background: var(--m2-bg-card);
        border-bottom: 1px solid var(--m2-border);
    }
    .gd-menu-toggle {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        height: 40px;
        padding: 0 16px;
        background: var(--m2-gold);
        color: var(--m2-text-inv);
        border: 0;
        border-radius: 22px;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        white-space: nowrap;
    }
    .gd-mobilebar-current {
        min-width: 0;
        flex: 1 1 auto;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 13px;
        color: var(--m2-text-sub);
    }

    /* Sidebar becomes a slide-in drawer */
    .gd-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(320px, 86vw);
        z-index: 1200;
        padding: 0;
        transform: translateX(-100%);
        transition: transform .28s cubic-bezier(.4, 0, .2, 1);
    }
    .gd-sidebar.is-open { transform: translateX(0); }
    .gd-sidebar-inner {
        max-height: 100%;
        height: 100%;
        border: 0;
        border-right: 1px solid var(--m2-border);
        border-radius: 0;
        box-shadow: var(--m2-shadow-drop);
    }
    .gd-sidebar-title { display: flex; align-items: center; justify-content: space-between; }
    .gd-drawer-close {
        display: inline-grid;
        place-items: center;
        width: 30px;
        height: 30px;
        margin: -4px -6px -4px 0;
        border: 0;
        border-radius: 50%;
        background: var(--m2-bg-elevated);
        color: var(--m2-text-sub);
        font-size: 14px;
        cursor: pointer;
    }
    .gd-drawer-close:hover { color: #fff; }

    .gd-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1100;
        background: rgba(0, 0, 0, .55);
        backdrop-filter: blur(2px);
        opacity: 0;
        transition: opacity .28s ease;
    }
    .gd-backdrop.is-open { display: block; opacity: 1; }

    body.gd-drawer-lock { overflow: hidden; }

    .gd-main { padding: 20px 16px 22px; }
}

/* The desktop-only drawer close button never shows on desktop */
.gd-drawer-close { display: none; }
@media (max-width: 991px) { .gd-drawer-close { display: inline-grid; } }

@media (max-width: 560px) {
    .gd-pager { grid-template-columns: 1fr; }
    .gd-pager-next { text-align: left; align-items: flex-start; }
    .gd-title { padding-right: 44px; }

    /* Reclaim side space so guide content fits narrow phones (e.g. S23) */
    .gd-app { padding: 12px 10px 0; }
    .gd-mobilebar { margin: 0 -10px 12px; padding: 10px; }
    .gd-main { padding: 18px 12px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .gd-sidebar, .gd-backdrop, .gd-cat-arrow, .gd-pager-link { transition: none; }
}

/* ============================================================
   NEWS DETAILS (modules/details.php)
   Reuses the guides gd-* shell (.gd-app / .gd-sidebar / .gd-main /
   mobile drawer / breadcrumb / pager). Only the sidebar post list
   and the feed view need their own styling.
   ============================================================ */

/* Sidebar: scrollable "latest news" list (fills the sticky panel) */
.nd-posts {
    list-style: none;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    scrollbar-width: thin;
    scrollbar-color: var(--m2-border-strong) transparent;
}
.nd-posts::-webkit-scrollbar { width: 8px; }
.nd-posts::-webkit-scrollbar-thumb { background: var(--m2-border-strong); border-radius: 8px; }

.nd-post {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border-left: 2px solid transparent;
    border-radius: 0 var(--m2-r-sm) var(--m2-r-sm) 0;
    color: var(--m2-text-sub);
    text-decoration: none;
    transition: color var(--m2-trans), background var(--m2-trans), border-color var(--m2-trans);
}
.nd-post:hover { color: var(--m2-gold); background: var(--m2-bg-elevated); }
.nd-post.is-active {
    color: var(--m2-gold);
    background: var(--m2-gold-glow);
    border-left-color: var(--m2-gold);
}
.nd-post-title { font-size: 13px; font-weight: 600; line-height: 1.35; }
.nd-post-date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--m2-text-muted);
}
.nd-post.is-active .nd-post-date { color: var(--m2-gold-dim); }

/* Feed view (Home / News with no specific article) */
.nd-feed-item {
    padding-bottom: 26px;
    margin-bottom: 26px;
    border-bottom: 1px solid var(--m2-border);
}
.nd-feed-item:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.nd-feed-title {
    font-family: "Cinzel", "Roboto", serif;
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
    line-height: 1.25;
    margin: 0 0 12px;
}
.nd-feed-title a { color: #fff; text-decoration: none; }
.nd-feed-title a:hover { color: var(--m2-gold); }
.nd-feed-item .gd-content { margin-top: 14px; }

/* "Read more" button (feed view) */
.gd-readmore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 9px 18px;
    background: var(--m2-gold);
    color: var(--m2-text-inv);
    border-radius: 22px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: filter var(--m2-trans), transform var(--m2-trans);
}
.gd-readmore:hover { filter: brightness(1.1); transform: translateY(-2px); color: var(--m2-text-inv); }

/* ============================================================
   DROP LOCATOR (modules/droplocator.php)
   Search an item, see where it drops. Uses the momo2 theme tokens.
   ============================================================ */

.dl-app {
    max-width: 1080px;
    margin: 0 auto;
    padding: 26px 20px 0;
}

/* Search + filter bar */
.dl-toolbar {
    position: sticky;
    top: var(--m2-header-h);
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    background: var(--m2-bg);
}
.dl-search { position: relative; flex: 1 1 320px; min-width: 0; }
.dl-search-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 14px; color: var(--m2-text-muted); pointer-events: none;
}
.dl-search-input {
    width: 100%;
    height: 48px;
    padding: 0 40px 0 38px;
    background: var(--m2-bg-input);
    border: 1px solid var(--m2-border);
    border-radius: var(--m2-r-md);
    color: var(--m2-text);
    font-size: 15px;
    outline: none;
    transition: border-color var(--m2-trans), box-shadow var(--m2-trans);
}
.dl-search-input::placeholder { color: var(--m2-text-muted); }
.dl-search-input:focus { border-color: var(--m2-gold-border); box-shadow: 0 0 0 3px var(--m2-gold-glow); }
.dl-search-clear {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    width: 24px; height: 24px; display: grid; place-items: center;
    padding: 0; border: 0; border-radius: 50%;
    background: var(--m2-bg-elevated); color: var(--m2-text-sub);
    font-size: 14px; cursor: pointer;
}
.dl-search-clear:hover { color: #fff; background: var(--m2-border-strong); }

.dl-map-select {
    height: 48px;
    padding: 0 14px;
    background: var(--m2-bg-input);
    border: 1px solid var(--m2-border);
    border-radius: var(--m2-r-md);
    color: var(--m2-text);
    font-size: 14px;
    cursor: pointer;
    outline: none;
    max-width: 100%;
}
.dl-map-select:focus { border-color: var(--m2-gold-border); }
.dl-count { font-size: 13px; color: var(--m2-text-muted); white-space: nowrap; }

.dl-hint {
    margin: 0 0 18px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--m2-text-muted);
}
.dl-hint strong { color: var(--m2-gold-dim); }

/* Item card */
.dl-card {
    background: var(--m2-bg-card);
    border: 1px solid var(--m2-border);
    border-radius: var(--m2-r-lg);
    margin-bottom: 14px;
    overflow: hidden;
}
.dl-card-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--m2-border);
}
.dl-item-name {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-family: "Cinzel", "Roboto", serif;
    font-size: 1.15rem;
    color: #fff;
}
.dl-item-name mark { background: var(--m2-gold-glow); color: var(--m2-gold); padding: 0 2px; border-radius: 3px; }

/* Drop rules table */
.dl-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dl-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dl-table th {
    text-align: left;
    padding: 9px 18px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--m2-text-muted);
    background: var(--m2-bg-elevated);
    white-space: nowrap;
}
.dl-table td {
    padding: 10px 18px;
    border-top: 1px solid var(--m2-border);
    color: var(--m2-text-sub);
    vertical-align: middle;
}
.dl-table tr:hover td { background: rgba(255, 255, 255, .02); }
.dl-map-name { color: var(--m2-gold); font-weight: 600; white-space: nowrap; }
.dl-map-any { color: var(--m2-text-sub); white-space: nowrap; }
.dl-map-name i, .dl-map-any i { margin-right: 6px; opacity: .7; }
/* Location chips under the card header */
.dl-locs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--m2-border);
}
.dl-loc {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--m2-gold);
    background: var(--m2-gold-glow);
    border: 1px solid var(--m2-gold-border);
    border-radius: 20px;
    padding: 3px 11px;
    white-space: nowrap;
}
.dl-loc.is-any {
    color: var(--m2-text-sub);
    background: var(--m2-bg-elevated);
    border-color: var(--m2-border);
}
.dl-loc i { margin-right: 5px; opacity: .8; }

/* Monster name chips inside a rule row */
.dl-monsters { width: 100%; }
.dl-mons { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
/* display:contents lets the extra chips flow in the same wrap row, but it also
   beats the UA [hidden] rule, so the hidden state has to be restated. */
.dl-mons-rest { display: contents; }
.dl-mons-rest[hidden] { display: none; }
.dl-mon {
    display: inline-block;
    padding: 2px 9px;
    font-size: 11.5px;
    color: var(--m2-text);
    background: var(--m2-bg-elevated);
    border: 1px solid var(--m2-border);
    border-radius: 20px;
    white-space: nowrap;
}
.dl-mon-none { color: var(--m2-text-muted); font-style: italic; }
.dl-mon-more {
    background: none;
    border: 1px dashed var(--m2-border-strong);
    border-radius: 20px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 700;
    color: var(--m2-gold);
    cursor: pointer;
    white-space: nowrap;
}
.dl-mon-more:hover { background: var(--m2-gold-glow); }

.dl-itemlvl { color: var(--m2-text-muted); white-space: nowrap; }

/* States */
.dl-empty, .dl-alert {
    text-align: center;
    padding: 40px 20px;
    border: 1px dashed var(--m2-border);
    border-radius: var(--m2-r-lg);
    color: var(--m2-text-muted);
}
.dl-empty strong { display: block; color: var(--m2-text); margin-bottom: 6px; font-size: 15px; }
.dl-alert { border-color: rgba(230, 77, 77, .4); color: #f2a6a6; }
.dl-more, .dl-foot {
    text-align: center;
    font-size: 12.5px;
    color: var(--m2-text-muted);
    padding: 10px 0 0;
}
.dl-foot { padding-bottom: 40px; }

@media (max-width: 700px) {
    .dl-app { padding: 14px 12px 0; }
    .dl-toolbar { padding: 10px 0; gap: 9px; }
    .dl-search-input { height: 44px; font-size: 14px; }
    .dl-map-select { height: 44px; width: 100%; }
    .dl-card-head { padding: 12px 14px; }
    .dl-locs { padding: 9px 14px; }
    .dl-item-name { font-size: 1.02rem; }
    .dl-table th, .dl-table td { padding: 9px 14px; }
    .dl-table { min-width: 520px; }
}

/* ============================================================
   RICH-CONTENT IMAGE LIGHTBOX (global - .ck-content images)
   Built by templates/momo2/js/main.js
   ============================================================ */
.lb {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 6, 8, .92);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.lb.is-open { opacity: 1; visibility: visible; }

.lb__stage {
    position: relative;
    max-width: 92vw;
    max-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}
.lb__img {
    max-width: 92vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 10px;
    background: #0e0e10;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
    transform: scale(1) translate(0, 0);
    transform-origin: center;
    transition: transform .25s ease, opacity .2s ease;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
}
.lb.is-zoomed .lb__img { cursor: grab; transition: none; }
.lb.is-panning .lb__img { cursor: grabbing; transition: none; }
.lb.is-loading .lb__img { opacity: 0; }

.lb__spinner {
    position: absolute;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .15);
    border-top-color: var(--m2-gold);
    animation: lb-spin .8s linear infinite;
    display: none;
}
.lb.is-loading .lb__spinner { display: block; }
@keyframes lb-spin { to { transform: rotate(360deg); } }

/* controls */
.lb__close,
.lb__nav {
    position: fixed;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #fff;
    background: rgba(20, 20, 24, .7);
    border: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(4px);
    transition: background .2s, border-color .2s, transform .2s;
}
.lb__close {
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
}
.lb__nav {
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 30px;
}
.lb__prev { left: 18px; }
.lb__next { right: 18px; }
.lb__close:hover,
.lb__nav:hover {
    background: var(--m2-gold);
    color: var(--m2-text-inv);
    border-color: var(--m2-gold);
}
.lb__nav:hover { transform: translateY(-50%) scale(1.06); }
.lb__nav[hidden] { display: none; }

/* caption + counter */
.lb__bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, rgba(0, 0, 0, .72), transparent);
    pointer-events: none;
}
.lb__caption {
    color: var(--m2-text);
    font-size: 13.5px;
    line-height: 1.4;
    text-align: center;
    max-width: 70vw;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .85);
}
.lb__caption:empty { display: none; }
.lb__counter {
    flex: 0 0 auto;
    color: var(--m2-text-sub);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    background: rgba(0, 0, 0, .45);
    padding: 3px 10px;
    border-radius: 20px;
}
.lb__counter:empty { display: none; }

/* subtle brand watermark on the image */
.lb__stage::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 44px;
    height: 44px;
    background: url('https://mudestinyzone.com/img/logo.png') center/contain no-repeat;
    opacity: .4;
    pointer-events: none;
}

body.lb-lock { overflow: hidden; }

@media (max-width: 700px) {
    .lb__stage, .lb__img { max-width: 96vw; max-height: 76vh; }
    .lb__close { top: 10px; right: 10px; width: 40px; height: 40px; font-size: 22px; }
    .lb__nav { width: 42px; height: 42px; font-size: 26px; }
    .lb__prev { left: 8px; }
    .lb__next { right: 8px; }
    .lb__caption { max-width: 86vw; font-size: 12.5px; }
    .lb__stage::after { width: 36px; height: 36px; right: 8px; bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .lb, .lb__img, .lb__close, .lb__nav { transition: none; }
    .lb__spinner { animation: none; }
}
