/* =============================================================
   DARK MODE - "ESDM BANDS" (html.esdm-theme-4 body.dark ...)
   -------------------------------------------------------------
   The app adds/removes the class "dark" on <body id="body"> when the
   DARK_MODE deployment setting is on. In dark mode the page drops to
   near-black and the tiles to dark grey, and ONLY the highlighted
   bands go aurora: the tenant header, the tile footer bar and the list
   accent. The top nav bar deliberately STAYS brand blue with white
   icons/tabs (stock dark would render it near-black).
   ============================================================= */

/* =======================================================
   CUSTOM PROPERTIES
   =======================================================
   --esdm-zoom: scale factor for responsive UI elements (default: 1)
   */

/* the aurora now lives in the TEXT: a wide gradient swept across the
   glyphs by animating background-position. */
@keyframes esdm-aurora-text{
    0%  {background-position:0% 50%}
    100%{background-position:200% 50%}
}

/* nav bar is FLAT BLACK in dark (matches the bands); white glyphs/tabs */
html.esdm-theme-4 body.dark .navbar-container{
    background-color:#0a0a0b !important;
    color:#ffffff !important;
    border-bottom:1px solid rgba(255,255,255,.10) !important;
}
html.esdm-theme-4 body.dark .navbar-container *{
    color:#ffffff !important;
}
html.esdm-theme-4 body.dark .session-tab,
html.esdm-theme-4 body.dark .session-tab.active{
    color:#ffffff !important;
}
/* hide the brand words while a session tab exists (overlay clash) */
html.esdm-theme-4 body.dark .navbar-session-container:has(.session-tab)::before{
    display:none !important;
}

/* near-black page + dark grey surfaces */
html.esdm-theme-4 body.dark{
    background-color:#0a0a0b !important;
    /* backdrop applied below; keep image active */
}
html.esdm-theme-4 body.dark .tenants-container{
    background:#141416 !important;
    border-color:rgba(255,255,255,.06) !important;
    box-shadow:0 10px 30px rgba(0,0,0,.60) !important;
    backdrop-filter:none !important;
    -webkit-backdrop-filter:none !important;
}
html.esdm-theme-4 body.dark .tenant-resources .tile-view .tenant-resources-btn{
    background:#1e1e20 !important;
    /* NO resting ring - the card reads as a plain dark disc; the only
       edge cue is the moon glow that fades in on hover below. */
    border:1px solid transparent !important;
    box-shadow:
        0 1px 1px rgba(0,0,0,.5),
        0 4px 14px rgba(0,0,0,.55) !important;
}
/* tile HOVER: the same soft "moonlight" blue the HBSMR bar and the list
   rows already carry - very restrained, just enough to read as a lift. */
html.esdm-theme-4 body.dark .tenant-resources .tile-view:hover .tenant-resources-btn,
html.esdm-theme-4 body.dark .tenant-resources .tile-view .tenant-resources-btn:hover{
    border-color:rgba(120,170,255,.20) !important;
    box-shadow:
        0 1px 1px rgba(0,0,0,.5),
        0 6px 18px rgba(96,150,220,.20),
        0 0 0 1px rgba(120,170,255,.10) !important;
}
/* list HOVER: the SAME soft moonlight lift as the tiles/header; the
   remainder lightens a touch so the row reads as active.

   IDENTICAL geometry to the resting rule - solid black bar to 75%,
   then a fade. Only the fade's endpoint is lighter (#303036), so hover
   lifts the row without changing its shape. An earlier version used a
   different split POSITION here, which made the zone resize on hover
   and cut through the label; sharing one shape between the two rules
   makes that class of bug impossible. */
html.esdm-theme-4 body.dark .tenant-resources .list-view:hover{
    border-color:rgba(120,170,255,.20) !important;
    background-image:linear-gradient(90deg,
        #0a0a0b 0,
        #0a0a0b 75%,
        #303036 100%) !important;
    box-shadow:
        0 2px 4px rgba(0,0,0,.4),
        0 6px 18px rgba(96,150,220,.18),
        0 0 0 1px rgba(120,170,255,.10) !important;
}
html.esdm-theme-4 body.dark .tenant-resources .tile-view .tile-view-label{
    color:#e8e8ea !important;
    -webkit-text-fill-color:#e8e8ea !important;
    background-image:none !important;
    text-shadow:none !important;
}
/* list rows: a BLACK BAR that runs past the text, then RAMPS away.
   The explicit box-shadow here is essential: base.css paints a WHITE
   inset top line ("inset 0 1px 0 rgba(255,255,255,1)") that leaked
   through in dark and read as a 3D "white bar" above every row - this
   replaces it.

   WHY THIS SHAPE
   Two rounds of tuning the split position changed nothing on screen,
   and the reason was measured, not guessed: the row and the panel it
   sits on are only a few RGB units apart (#0a0a0b row vs #141416
   panel), so any boundary between two tones that close is invisible.
   Rendered side by side in Scripts/_listview_probe.html, a 56px split,
   a 120px split and a full-width ramp all looked identical.

   What DOES read is a long solid zone next to a fade, because the eye
   compares the bar against the PANEL rather than against a second
   in-row tone. So:

     bar  : 0..75% solid #0a0a0b. The resource name is measured at
            20-25% of the row, so 75% clears it with a wide margin -
            the text sits wholly on the solid black, never straddling
            a change of tone.
     fade : 75%..100%, #0a0a0b easing out to the row grey, so the
            trailing edge dissolves into the panel instead of ending
            on a hard seam.

   The icon cradle is inside the solid zone already - it needs no stop
   of its own, and the icon gets a stable dark backdrop for free.

   Hover keeps the identical geometry and only lifts the fade's
   endpoint, which structurally prevents the earlier bug where a
   mismatched hover split cut through the label. */
html.esdm-theme-4 body.dark .tenant-resources .list-view{
    background:linear-gradient(90deg,
        #0a0a0b 0,
        #0a0a0b 75%,
        #1e1e20 100%) !important;
    border:1px solid rgba(255,255,255,.10) !important;
    box-shadow:
        0 1px 1px rgba(0,0,0,.5),
        0 4px 14px rgba(0,0,0,.5) !important;
}
html.esdm-theme-4 body.dark .tenant-resources .list-view .list-view-label{
    color:#e8e8ea !important;
    -webkit-text-fill-color:#e8e8ea !important;
    background-image:none !important;
    box-sizing:border-box !important;
    padding-left:8px !important;
}

/* ---- bands stay BLACK - the AURORA lives in the TEXT only ---- */
/* tenant header band ("HBSMR Demo") = flat black, no hover colour change.
   NOTE: real DOM has NO .tenant-header-container wrapper - .tenant-header
   is a direct child of a plain div inside .tenants-container, so the
   selector must NOT require the container. */
html.esdm-theme-4 body.dark .tenant-header,
html.esdm-theme-4 body.dark .tenant-header:hover,
html.esdm-theme-4 body.dark .tenant-header:focus,
html.esdm-theme-4 body.dark .tenant-header:focus-within,
html.esdm-theme-4 body.dark .tenant-header:active,
html.esdm-theme-4 body.dark .tenant-header-container .tenant-header{
    background-image:none !important;
    background-color:#0a0a0b !important;
    border:1px solid rgba(120,170,255,.20) !important;
    /* the moonlight glow is ON BY DEFAULT here (not hover-only); hover
       below just deepens it slightly */
    box-shadow:
        0 1px 1px rgba(0,0,0,.5),
        0 4px 14px rgba(96,150,220,.16),
        0 0 0 1px rgba(120,170,255,.08) !important;
    animation:none !important;
}
/* HBSMR header HOVER: the SAME soft "moonlight" lift as the tiles and
   list rows so all three bands respond identically on hover. Out-specifies
   the base-layer flat shadow pin ("box-shadow:0 2px 6px rgba(0,0,0,.08)")
   and re-pins the border to the moonlight blue. */
html.esdm-theme-4 body.dark .tenant-header:hover,
html.esdm-theme-4 body.dark .tenant-header:focus,
html.esdm-theme-4 body.dark .tenant-header:focus-within,
html.esdm-theme-4 body.dark .tenant-header-container .tenant-header:hover,
html.esdm-theme-4 body.dark .tenant-header-container .tenant-header:focus,
html.esdm-theme-4 body.dark .tenant-header-container .tenant-header:focus-within{
    border-color:rgba(120,170,255,.20) !important;
    box-shadow:
        0 1px 1px rgba(0,0,0,.5),
        0 6px 18px rgba(96,150,220,.20),
        0 0 0 1px rgba(120,170,255,.10) !important;
}
/* tile footer band (e.g. "Calculator") = flat black */
html.esdm-theme-4 body.dark .tenant-resources .tile-view .tile-view-label-container{
    background-image:none !important;
    background-color:#0a0a0b !important;
    animation:none !important;
}
/* list rows: the two-tone split above owns their surface (black cradle +
   grey remainder) and their box-shadow (white-inset removed); nothing to
   re-pin here. */
/* ---- the AURORA TEXT (gradient clipped into the glyphs) ---- */
html.esdm-theme-4 body.dark .tenant-header .tenant-display-name,
html.esdm-theme-4 body.dark .tenant-header-container .tenant-header .tenant-display-name,
html.esdm-theme-4 body.dark .tenant-resources .tile-view .tile-view-label,
html.esdm-theme-4 body.dark .tenant-resources .list-view .list-view-label{
    background-image:linear-gradient(90deg,#00c2ff,#33ff8c,#ffc640,#e54cff,#00c2ff) !important;
    background-size:250% 100% !important;
    -webkit-background-clip:text !important;
    background-clip:text !important;
    color:transparent !important;
    -webkit-text-fill-color:transparent !important;
    text-shadow:none !important;
    animation:esdm-aurora-text 6s linear infinite !important;
    /* heavier weight + a little tracking make the swept aurora read more
       clearly through the glyphs (matches the bold highlight we had). */
    font-weight:700 !important;
    letter-spacing:.3px !important;
}

/* ---- AURORA on the view + theme CONTROLS (dark only) ----
   The BUTTON boxes stay neutral dark (they are not the "highlighted
   bands"); the AURORA lives in the GLYPH. The app ships an inline
   <svg> whose path fill is currentColor, so we paint the svg element
   with the aurora gradient and MASK it to the icon shape (the real
   collected path data). The dot on the theme toggle gets the same
   treatment. */
html.esdm-theme-4 body.dark .resources-controls-icon-btn,
html.esdm-theme-4 body.dark #esdm-brand-toggle{
    background-image:none !important;
    background-color:transparent !important;
    animation:none !important;
    border-radius:6px !important;
}
html.esdm-theme-4 body.dark .resources-controls-icon-btn:hover,
html.esdm-theme-4 body.dark #esdm-brand-toggle:hover{
    background-color:rgba(120,170,255,.10) !important;
}
/* aurora-painted, mask-clipped icon glyphs.
   The app swaps the grid glyph between "GridFilled" (tile view
   selected) and "GridRegular" (tile view unselected) and always uses
   "ListRegular" for the list switch - each is an <svg fill="currentColor">
   whose <i> carries a STABLE, locale-independent data-icon-name. Keying
   the mask to that attribute (not the button aria-label) guarantees the
   mask always matches the glyph that is actually rendered, so the icon
   is never clipped to a mismatched silhouette (the "corrupted/half
   missing" bug). The shape paths below are each icon's own real path
   data (16x16 viewBox). */
html.esdm-theme-4 body.dark .resources-controls-icon-btn .ms-Icon[data-icon-name] svg{
    background-image:linear-gradient(90deg,#00c2ff,#33ff8c,#ffc640,#e54cff,#00c2ff) !important;
    background-size:250% 100% !important;
    animation:esdm-aurora-text 6s linear infinite !important;
}
/* GridFilled - the 2x2 solid grid (tile view selected) */
html.esdm-theme-4 body.dark .resources-controls-icon-btn .ms-Icon[data-icon-name="GridFilled"] svg{
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M3.5 2C2.67 2 2 2.67 2 3.5v2C2 6.33 2.67 7 3.5 7h2C6.33 7 7 6.33 7 5.5v-2C7 2.67 6.33 2 5.5 2h-2Zm7 0C9.67 2 9 2.67 9 3.5v2c0 .83.67 1.5 1.5 1.5h2c.83 0 1.5-.67 1.5-1.5v-2c0-.83-.67-1.5-1.5-1.5h-2Zm-7 7C2.67 9 2 9.67 2 10.5v2c0 .83.67 1.5 1.5 1.5h2c.83 0 1.5-.67 1.5-1.5v-2C7 9.67 6.33 9 5.5 9h-2Zm7 0C9.67 9 9 9.67 9 10.5v2c0 .83.67 1.5 1.5 1.5h2c.83 0 1.5-.67 1.5-1.5v-2C7 9.67 6.33 9 5.5 9h-2Z'/%3E%3C/svg%3E") center/contain no-repeat !important;
            mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M3.5 2C2.67 2 2 2.67 2 3.5v2C2 6.33 2.67 7 3.5 7h2C6.33 7 7 6.33 7 5.5v-2C7 2.67 6.33 2 5.5 2h-2Zm7 0C9.67 2 9 2.67 9 3.5v2c0 .83.67 1.5 1.5 1.5h2c.83 0 1.5-.67 1.5-1.5v-2c0-.83-.67-1.5-1.5-1.5h-2Zm-7 7C2.67 9 2 9.67 2 10.5v2c0 .83.67 1.5 1.5 1.5h2c.83 0 1.5-.67 1.5-1.5v-2C7 9.67 6.33 9 5.5 9h-2Zm7 0C9.67 9 9 9.67 9 10.5v2c0 .83.67 1.5 1.5 1.5h2c.83 0 1.5-.67 1.5-1.5v-2C7 9.67 6.33 9 5.5 9h-2Z'/%3E%3C/svg%3E") center/contain no-repeat !important;
}
/* GridRegular - the 2x2 outline grid (tile view unselected) */
html.esdm-theme-4 body.dark .resources-controls-icon-btn .ms-Icon[data-icon-name="GridRegular"] svg{
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M3.5 2C2.67 2 2 2.67 2 3.5v2C2 6.33 2.67 7 3.5 7h2C6.33 7 7 6.33 7 5.5v-2C7 2.67 6.33 2 5.5 2h-2ZM3 3.5c0-.28.22-.5.5-.5h2c.28 0 .5.22.5.5v2a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-2ZM10.5 2C9.67 2 9 2.67 9 3.5v2c0 .83.67 1.5 1.5 1.5h2c.83 0 1.5-.67 1.5-1.5v-2c0-.83-.67-1.5-1.5-1.5h-2ZM10 3.5c0-.28.22-.5.5-.5h2c.28 0 .5.22.5.5v2a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-2Zm-8 7C2 9.67 2.67 9 3.5 9h2c.83 0 1.5.67 1.5 1.5v2c0 .83-.67 1.5-1.5 1.5h-2A1.5 1.5 0 0 1 2 12.5v-2Zm1.5-.5a.5.5 0 0 0-.5.5v2c0 .28.22.5.5.5h2a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 0-.5-.5h-2Zm7-1C9.67 9 9 9.67 9 10.5v2c0 .83.67 1.5 1.5 1.5h2c.83 0 1.5-.67 1.5-1.5v-2c0-.83-.67-1.5-1.5-1.5h-2Zm-.5 1.5c0-.28.22-.5.5-.5h2c.28 0 .5.22.5.5v2a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-2Z'/%3E%3C/svg%3E") center/contain no-repeat !important;
            mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M3.5 2C2.67 2 2 2.67 2 3.5v2C2 6.33 2.67 7 3.5 7h2C6.33 7 7 6.33 7 5.5v-2C7 2.67 6.33 2 5.5 2h-2ZM3 3.5c0-.28.22-.5.5-.5h2c.28 0 .5.22.5.5v2a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-2ZM10.5 2C9.67 2 9 2.67 9 3.5v2c0 .83.67 1.5 1.5 1.5h2c.83 0 1.5-.67 1.5-1.5v-2c0-.83-.67-1.5-1.5-1.5h-2ZM10 3.5c0-.28.22-.5.5-.5h2c.28 0 .5.22.5.5v2a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-2Zm-8 7C2 9.67 2.67 9 3.5 9h2c.83 0 1.5.67 1.5 1.5v2c0 .83-.67 1.5-1.5 1.5h-2A1.5 1.5 0 0 1 2 12.5v-2Zm1.5-.5a.5.5 0 0 0-.5.5v2c0 .28.22.5.5.5h2a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 0-.5-.5h-2Zm7-1C9.67 9 9 9.67 9 10.5v2c0 .83.67 1.5 1.5 1.5h2c.83 0 1.5-.67 1.5-1.5v-2c0-.83-.67-1.5-1.5-1.5h-2Zm-.5 1.5c0-.28.22-.5.5-.5h2c.28 0 .5.22.5.5v2a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-2Z'/%3E%3C/svg%3E") center/contain no-repeat !important;
}
/* ListRegular - the rows list glyph (list view) */
html.esdm-theme-4 body.dark .resources-controls-icon-btn .ms-Icon[data-icon-name="ListRegular"] svg{
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M2 3.5c0-.28.22-.5.5-.5h8a.5.5 0 0 1 0 1h-8a.5.5 0 0 1-.5-.5Zm0 8c0-.28.22-.5.5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5ZM2.5 7a.5.5 0 0 0 0 1h11a.5.5 0 0 0 0-1h-11Z'/%3E%3C/svg%3E") center/contain no-repeat !important;
            mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M2 3.5c0-.28.22-.5.5-.5h8a.5.5 0 0 1 0 1h-8a.5.5 0 0 1-.5-.5Zm0 8c0-.28.22-.5.5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5ZM2.5 7a.5.5 0 0 0 0 1h11a.5.5 0 0 0 0-1h-11Z'/%3E%3C/svg%3E") center/contain no-repeat !important;
}
/* hide the original currentColor path so only the masked aurora shows */
html.esdm-theme-4 body.dark .resources-controls-icon-btn .ms-Icon[data-icon-name] svg path{
    fill:transparent !important;
}

/* theme toggle dot = aurora */
html.esdm-theme-4 body.dark #esdm-brand-toggle .esdm-brand-dot{
    background-color:transparent !important;
    background-image:linear-gradient(90deg,#00c2ff,#33ff8c,#ffc640,#e54cff,#00c2ff) !important;
    background-size:250% 100% !important;
    animation:esdm-aurora-text 6s linear infinite !important;
}

/* ---- DARK AURORA BACKDROP (theme-4 dark only) ----
   The Sycamore Gap Aurora photo (1600x616) is applied as a fixed,
   cover-sized backdrop behind the near-black page. It stretches to
   fill the viewport (no tiling) and is masked by a subtle dark
   overlay so the content stays fully readable. */
html.esdm-theme-4 body.dark{
    background-image:url("../../../static/media/bg_aurora.jpg") !important;
    background-size:cover !important;
    background-position:center center !important;
    background-repeat:no-repeat !important;
    background-attachment:fixed !important;
}
/* subtle dark overlay so text remains legible over the bright aurora */
html.esdm-theme-4 body.dark::before{
    content:"" !important;
    position:fixed !important;
    inset:0 !important;
    background:rgba(10,10,11,.35) !important;
    pointer-events:none !important;
    z-index:0 !important;
}