/**
 * RonexAdmin vertical shell tweaks (load once alongside vendor `app*.min.css` + `custom.min.css`).
 *
 * - Compact sidebar section titles (.menu-title): ellipsis-only in md/sm/sm-hover modes.
 * - Icon rail (`data-sidebar-size="sm"`): keep the menubar viewport-fixed and sized so SimpleBar
 *   can scroll; preserve Toner hover flyouts for nested `.menu-dropdown` (no clipping).
 *
 * SimpleBar host: #scrollbar only (NOT #navbar-nav).
 *   app.min.js I()/v()/W() previously initialised SimpleBar on both #scrollbar and #navbar-nav.
 *   Nesting two SimpleBar instances caused #navbar-nav to report offsetHeight=0 after its children
 *   were moved inside .simplebar-content, so SimpleBar set .simplebar-content-wrapper{height:0px}
 *   inline → items were in the DOM but invisible (not a display/visibility issue — container h=0).
 *   Fix: I()/v()/W() now only initialise SimpleBar on #scrollbar (which always has a definite
 *   flex-allocated height from the chain below). #navbar-nav is a plain <ul> inside the scroll area.
 */

/* -------------------------------------------------------------------------- */
/* Alpine `x-cloak`: hide until Alpine boots                                  */
/* -------------------------------------------------------------------------- */

/* Alpine is loaded with `defer` (utils/js.html), so `x-show` is only applied
   after the document has already painted. Without this rule `x-cloak` is inert
   and elements that start hidden — the dashboard "Customize" hide/reset
   controls, the hidden-items drawer, the search clear button — flash on screen
   during first paint and then vanish. Must live in a head stylesheet
   (utils/css.html) so it applies before the body renders. `!important` beats
   the component `display` declarations (e.g. .dashboard-hidden-items__body)
   that would otherwise win on load order. */
[x-cloak] {
    display: none !important;
}

/* -------------------------------------------------------------------------- */
/* Section titles (.menu-title): compact modes show ellipsis icon only        */
/* -------------------------------------------------------------------------- */

/* Compact “md”: hide labels, show ellipsis icon (theme base hides .menu-title i). */
[data-layout="vertical"][data-sidebar-size="md"] .navbar-menu .navbar-nav .menu-title span {
    display: none !important;
}

[data-layout="vertical"][data-sidebar-size="md"] .navbar-menu .navbar-nav .menu-title i {
    display: block !important;
    line-height: 36px;
    font-size: 1rem;
}

/* Reinforce sm when another bundle raises label visibility */
[data-layout="vertical"][data-sidebar-size="sm"] .navbar-menu .navbar-nav .menu-title span {
    display: none !important;
}

[data-layout="vertical"][data-sidebar-size="sm"] .navbar-menu .navbar-nav .menu-title i {
    display: block !important;
    line-height: 36px;
    font-size: 1rem;
}

/* sm-hover: collapsed strip shows icon only; expanded hover shows labels (Toner default). */
[data-layout="vertical"][data-sidebar-size="sm-hover"] .navbar-menu:not(:hover) .navbar-nav .menu-title span {
    display: none !important;
}

[data-layout="vertical"][data-sidebar-size="sm-hover"] .navbar-menu:not(:hover) .navbar-nav .menu-title i {
    display: block !important;
    line-height: 36px;
    font-size: 1rem;
}

/* -------------------------------------------------------------------------- */
/* Sidebar scroll: full-height flex chain for all vertical modes             */
/*                                                                           */
/* The vendor CSS positions .app-menu as a fixed column, but the inner      */
/* height chain (.app-menu → #scrollbar → SimpleBar wrappers) must be       */
/* complete so SimpleBar (or native scroll fallback) knows the scroll        */
/* window height. Without this, SimpleBar computes height = 0 and wheel     */
/* events fall through to the page.                                          */
/*                                                                           */
/* Breakpoints:                                                              */
/*   ≥ 768px  → sidebar is a persistent fixed column (lg / md / sm-hover)   */
/*   < 768px  → sidebar is a full-height drawer overlay                      */
/* -------------------------------------------------------------------------- */

/* ── Desktop / tablet: normal sidebar sizes (lg, md, sm-hover) ───────────── */
@media (min-width: 768px) {
    /* Flex column so #scrollbar can flex-grow to fill all height below the logo */
    [data-layout="vertical"]:not([data-sidebar-size="sm"]) .app-menu.navbar-menu {
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    /* #scrollbar fills remaining height after the logo strip */
    [data-layout="vertical"]:not([data-sidebar-size="sm"]) .app-menu.navbar-menu > #scrollbar {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        /*
         * Native scroll fallback. SimpleBar sets overflow:hidden via inline style
         * when it initialises on this element, so it takes priority (no !important
         * here on purpose). If SimpleBar doesn't initialise, native scroll is used.
         */
        overflow-y: auto;
        overflow-x: hidden;
    }

    /*
     * Propagate height through .container-fluid so that SimpleBar initialised on
     * #navbar-nav (the element app.js uses) can compute a meaningful scroll window.
     * Without this the flex chain stops at #scrollbar and SimpleBar sees height = 0.
     */
    [data-layout="vertical"]:not([data-sidebar-size="sm"]) .app-menu.navbar-menu > #scrollbar > .container-fluid {
        height: 100%;
    }

    /* SimpleBar internals must fill the scroll host (works for both #scrollbar and
       #navbar-nav as SimpleBar hosts because the selector matches both trees). */
    [data-layout="vertical"]:not([data-sidebar-size="sm"]) .app-menu.navbar-menu > #scrollbar .simplebar-wrapper,
    [data-layout="vertical"]:not([data-sidebar-size="sm"]) .app-menu.navbar-menu > #scrollbar .simplebar-content-wrapper {
        height: 100%;
    }
}

/* ── Mobile: sidebar rendered as a full-height drawer overlay ────────────── */
@media (max-width: 767.98px) {
    .app-menu.navbar-menu {
        overflow: hidden;
    }

    .app-menu.navbar-menu > #scrollbar {
        /*
         * On mobile SimpleBar is typically not active; use native scroll.
         * dvh (dynamic viewport height) avoids the iOS browser-chrome jump;
         * the vh fallback is for older browsers.
         */
        overflow-y: auto;
        overflow-x: hidden;
        max-height: calc(100vh  - 30px);
        max-height: calc(100dvh - 30px);
    }
}

/* ── SimpleBar integrity guard (non-sm modes) ────────────────────────────── */
/*
 * SimpleBar REQUIRES overflow:hidden on .simplebar-wrapper and .simplebar-mask
 * to capture wheel events. If JS sets these to overflow:visible, wheel events
 * escape to the page and the sidebar becomes un-scrollable.
 *
 * sm mode is excluded deliberately: its hover flyouts need overflow:visible on
 * the ancestor chain to escape the icon rail.
 */
[data-layout="vertical"]:not([data-sidebar-size="sm"]) .app-menu .simplebar-wrapper,
[data-layout="vertical"]:not([data-sidebar-size="sm"]) .app-menu .simplebar-mask {
    overflow: hidden !important;
}

/* ── Icon rail (sm mode): fixed menubar + scroll region; keep flyouts ─────── */
@media (min-width: 768px) {
    [data-layout="vertical"][data-sidebar-size="sm"] .app-menu.navbar-menu {
        position: fixed !important;
        top: 35px;
        bottom: 0;
        display: flex;
        flex-direction: column;
        /* overflow:visible lets the flyout .menu-dropdown panels escape the rail */
        overflow: visible;
    }

    /* Scroll area below the logo strip (brand box is `position: fixed` in sm mode). */
    [data-layout="vertical"][data-sidebar-size="sm"] .app-menu.navbar-menu > #scrollbar {
        flex: 1 1 auto;
        min-height: 0;
        overflow: visible;
    }

    /* SimpleBar wrappers need a definite height to show an inner scrollbar */
    [data-layout="vertical"][data-sidebar-size="sm"] .app-menu.navbar-menu > #scrollbar .simplebar-wrapper {
        height: 100%;
    }

    [data-layout="vertical"][data-sidebar-size="sm"] .app-menu.navbar-menu > #scrollbar .simplebar-content-wrapper {
        height: 100%;
    }
}

/* -------------------------------------------------------------------------- */
/* sm flyouts (.menu-dropdown): sub-links match full sidebar, not rail row    */
/* -------------------------------------------------------------------------- */
/*
 * Stock Toner hides every `.nav-link span` in sm mode and paints `.nav-item:hover > a.menu-link`
 * with the wide rail + `--tb-vertical-menu-item-hover-bg`. That selector also matches leaf
 * rows inside flyouts (`a.menu-link`), so nested items showed icon-only until hover and a dark
 * bar on hover. Scope submenus to normal nav-sm styling (label + icon, text-color hover).
 */
[data-layout="vertical"][data-sidebar-size="sm"] .navbar-menu .navbar-nav .menu-dropdown .nav-link span {
    display: inline-block !important;
}

[data-layout="vertical"][data-sidebar-size="sm"] .navbar-menu .navbar-nav .menu-dropdown .nav-item > a.menu-link {
    width: auto !important;
    max-width: none;
    color: var(--tb-vertical-menu-sub-item-color);
    background: transparent !important;
    transition: color 0.15s ease-in-out;
}

[data-layout="vertical"][data-sidebar-size="sm"] .navbar-menu .navbar-nav .menu-dropdown .nav-item:hover > a.menu-link {
    width: auto !important;
    color: var(--tb-vertical-menu-sub-item-hover-color) !important;
    background: transparent !important;
}

[data-layout="vertical"][data-sidebar-size="sm"] .navbar-menu .navbar-nav .menu-dropdown .nav-item > a.menu-link.active,
[data-layout="vertical"][data-sidebar-size="sm"] .navbar-menu .navbar-nav .menu-dropdown .nav-item:hover > a.menu-link.active {
    color: var(--tb-vertical-menu-item-active-color) !important;
}

/* Undo rail-only chevron / forced :after from sm parent-row rules on leaf links */
[data-layout="vertical"][data-sidebar-size="sm"]
    .navbar-menu
    .navbar-nav
    .menu-dropdown
    .nav-link.menu-link:not([data-bs-toggle="collapse"]):after {
    display: none !important;
    content: none !important;
}

/* -------------------------------------------------------------------------- */
/* HTMX top progress bar                                                      */
/* -------------------------------------------------------------------------- */

#htmx-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #4f86f7 0%, var(--tb-primary) 40%, #a78bfa 100%);
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.15s ease, width 0.1s ease;
    pointer-events: none;
    box-shadow: 0 0 12px 2px rgba(79, 134, 247, 0.7);
}

#htmx-progress-bar.htmx-loading {
    opacity: 1;
}

/* -------------------------------------------------------------------------- */
/* Top tagbar: single row on narrow viewports (avoids 35px strip + wrapped cols) */
/* -------------------------------------------------------------------------- */

/*
 * Theme sets .top-tagbar to z-index 1001 and #page-topbar up to 1003.
 * Menus opened from the tagbar extend over the main topbar — raise the tagbar
 * stacking context so dropdowns are not painted underneath #page-topbar.
 */
.top-tagbar {
    z-index: 1004 !important;
    isolation: isolate;
}

.top-tagbar .topbar-tag-dropdown .dropdown-menu,
.top-tagbar .weather-panel.dropdown-menu {
    z-index: 1050 !important;
}

.top-tagbar .topbar-head-dropdown.topbar-tag-dropdown {
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    align-self: stretch;
    min-height: 0;
    height: 100%;
    justify-content: flex-end;
}

.top-tagbar .top-tagbar-inner {
    min-width: 0;
}

.top-tagbar__start {
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(42%, 12rem);
}

.top-tagbar__end-inner {
    min-width: 0;
}

.top-tagbar .top-tagbar__icon-btn.btn-topbar {
    width: 1.75rem;
    height: 1.75rem;
    min-width: 1.75rem;
    min-height: 1.75rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-tagbar__lang-btn.btn-topbar {
    align-items: center;
    justify-content: center;
    align-self: stretch;
    width: auto;
    min-width: 2.75rem;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    padding: 0.15rem 0.65rem 0.15rem 0.5rem;
    white-space: nowrap;
    cursor: pointer;
    border-radius: 0.3rem;
    -webkit-tap-highlight-color: transparent;
}

/* Flag/label: clicks/taps go to the button, not the children */
.top-tagbar__lang-btn .top-tagbar__lang-flag,
.top-tagbar__lang-btn .top-tagbar__lang-label {
    pointer-events: none;
    user-select: none;
}

.top-tagbar__time-block {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.125rem;
    min-width: 0;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-tagbar__time-block .top-tagbar__weather-wrap {
    overflow: visible;
    flex-shrink: 0;
}

.top-tagbar__center {
    padding-inline: 0.15rem;
    position: relative; /* anchor for absolute clock + message children */
}

.top-tagbar__clock {
    font-size: 0.8125rem;
}

.top-tagbar__weather {
    font-size: 0.75rem;
    display: inline;
}

@media (min-width: 576px) {
    .top-tagbar__clock {
        font-size: 1rem;
    }

    .top-tagbar__weather {
        font-size: 0.875rem;
    }
}

/* -------------------------------------------------------------------------- */
/* Tagbar ticker: clock ↔ message animations                                  */
/* -------------------------------------------------------------------------- */
/*
 * --tagbar-flip-ms / --tagbar-*-hold-ms: unitless integers; tagbar.js reads
 *   them with getComputedStyle (defaults in JS if missing).
 * --tagbar-flip-duration: time value for keyframe animations (kept in sync
 *   with --tagbar-flip-ms).
 */
:root {
    --tagbar-flip-ms: 300;
    --tagbar-clock-hold-ms: 8000;
    --tagbar-message-hold-ms: 6000;
    --tagbar-flip-duration: calc(1ms * var(--tagbar-flip-ms));
}

/*
 * Slide-up OUT: current element climbs up and fades out.
 * Slide-up IN:  next element enters from below and fades in.
 */
@keyframes tagbar-slide-up-out {
    from { transform: translateY(0);    opacity: 1; }
    to   { transform: translateY(-120%); opacity: 0; }
}

@keyframes tagbar-slide-up-in {
    from { transform: translateY(120%); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}

/* Applied by JS during transitions */
.tagbar-slide-out {
    animation: tagbar-slide-up-out var(--tagbar-flip-duration, 0.3s) ease-in both;
    pointer-events: none;
}

.tagbar-slide-in {
    animation: tagbar-slide-up-in var(--tagbar-flip-duration, 0.3s) ease-out both;
}

/* -------------------------------------------------------------------------- */
/* Shared: stack clock + message in the same space via absolute positioning   */
/* -------------------------------------------------------------------------- */

/*
 * Both children are stretched to fill the center column absolutely so neither
 * pushes the other and they share the same centring rules:
 *   mobile  → start-aligned (time left, matches text-start)
 *   md+     → centered (matches justify-content:center on the clock)
 */
#tagbar-clock-wrap .top-tagbar__time-block,
#tagbar-message-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
}

#tagbar-clock-wrap .top-tagbar__time-block {
    justify-content: center;
    padding-inline: 0.1rem;
}

/* -------------------------------------------------------------------------- */
/* Message wrapper                                                             */
/* -------------------------------------------------------------------------- */

#tagbar-message-wrap {
    display: flex;
    align-items: center;
    justify-content: start;
    overflow: hidden;
    min-width: 0;
    gap: 0.35rem;
    padding-inline: 0.1rem;
}

@media (min-width: 768px) {
    #tagbar-message-wrap {
        justify-content: center;
    }
}

/* -------------------------------------------------------------------------- */
/* Pill badge — wraps icon + text, provides level colour + contrast bg        */
/* -------------------------------------------------------------------------- */

.tagbar-msg-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.15rem 0.7rem 0.15rem 0.5rem;
    border-radius: 100vw;
    max-width: 100%;
    overflow: hidden;        /* clips marquee text inside the pill */
    flex-shrink: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.25;
    white-space: nowrap;
    /* transition so colour change on level swap is smooth */
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

@media (min-width: 576px) {
    .tagbar-msg-badge { font-size: 0.85rem; }
}

/* Level: vivid colours readable on dark tagbar background */
#tagbar-message-wrap[data-level="info"] .tagbar-msg-badge {
    background: rgba(13, 202, 240, 0.18);
    color: #9eeeff;
    border: 1px solid rgba(13, 202, 240, 0.45);
}
#tagbar-message-wrap[data-level="warning"] .tagbar-msg-badge {
    background: rgba(255, 193, 7, 0.18);
    color: #ffe57a;
    border: 1px solid rgba(255, 193, 7, 0.5);
}
#tagbar-message-wrap[data-level="danger"] .tagbar-msg-badge {
    background: rgba(220, 53, 69, 0.2);
    color: #ff9aaa;
    border: 1px solid rgba(220, 53, 69, 0.5);
}
#tagbar-message-wrap[data-level="success"] .tagbar-msg-badge {
    background: rgba(40, 199, 111, 0.18);
    color: #7fffbf;
    border: 1px solid rgba(40, 199, 111, 0.45);
}

.tagbar-msg-icon {
    flex-shrink: 0;
    font-size: 0.85rem;
    line-height: 1;
}

#tagbar-message-text {
    white-space: nowrap;
    min-width: 0;
    will-change: transform;
    display: inline-block;
}

/* -------------------------------------------------------------------------- */
/* Marquee / news-ticker for long messages                                     */
/* -------------------------------------------------------------------------- */

@keyframes tagbar-marquee-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(var(--tagbar-marquee-shift, -100%)); }
}

#tagbar-message-text.tagbar-marquee {
    animation: tagbar-marquee-scroll linear infinite;
    /* animation-duration is set by tagbar.js as a valid time string */
}

/* -------------------------------------------------------------------------- */
/* Weather dropdown trigger                                                    */
/* -------------------------------------------------------------------------- */

.weather-dropdown {
    display: inline-flex;
    align-items: center;
    /* `position: relative` is needed by Bootstrap for the Popper anchor;
       overflow must stay visible so the panel is not clipped by this wrapper
       (the panel escapes via Popper's fixed strategy anyway). */
    position: relative;
    overflow: visible;
}

.weather-trigger {
    color: inherit;
    font-size: inherit;
    font-weight: 500;
    border-radius: 0.35rem;
    padding: 0.1rem 0.35rem !important;
    gap: 0.3rem;
    transition: background-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.1;
}

.weather-trigger:hover,
.weather-trigger:focus-visible,
.weather-dropdown.show .weather-trigger {
    background-color: rgba(var(--bs-body-color-rgb, 255 255 255) / 0.08);
    color: inherit;
    outline: none;
}

/*
 * Temperatures, wind speeds, and percentages stay left-to-right inside RTL
 * shells so digits and unit suffixes do not reorder (Unicode bidi).
 */
.ronex-weather-value {
    direction: ltr;
    unicode-bidi: isolate;
}

/* -------------------------------------------------------------------------- */
/* Weather panel (dropdown menu)                                               */
/* -------------------------------------------------------------------------- */

/*
 * The dropdown menu is positioned by Popper (inline transform). Do not set
 * `transform` or `margin` on this element or Popper will lose placement.
 * Animate the inner box instead.
 */
.weather-panel {
    min-width: 15rem;
    max-width: 18rem;
    border-radius: 0.75rem !important;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.35),
        0 10px 25px -5px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: var(--tb-dropdown-bg, #1e1b2e);
    /* Popper sets position (usually fixed); do not override here */
    overflow: visible;
    /* Tagbar shell is 1004; keep panel above topbar chrome */
    z-index: 1050 !important;
    /* Bridge the Popper gap (offset) so hover is continuous between trigger + menu */
}

@media (max-width: 575.98px) {
    .weather-panel {
        min-width: min(15rem, calc(100vw - 1rem));
        max-width: calc(100vw - 1rem);
    }
}

/* Invisible row above the panel — covers the offset gap so :hover is not “lost” */
.weather-panel::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
    z-index: 1;
    pointer-events: auto;
    background: transparent;
}

/* Inner fade-in only (avoids clobbering Popper’s transform on the menu) */
.weather-panel.show .weather-panel__inner {
    animation: weather-panel-in 0.2s ease both;
}

@keyframes weather-panel-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.weather-panel__inner {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    border-radius: inherit;
    overflow: hidden;
    text-align: start;
}

/* -- Header: big icon + temp + desc -- */

.weather-panel__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.weather-panel__hero-icon {
    font-size: 2.4rem;
    line-height: 1;
    flex-shrink: 0;
    /* Subtle gradient colouring via text gradient trick */
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.weather-panel__headline {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.weather-panel__big-temp {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    color: var(--tb-heading-color, #f1f5f9);
    letter-spacing: -0.02em;
}

.weather-panel__desc {
    font-size: 0.75rem;
    color: var(--tb-secondary-color, #94a3b8);
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -- Location row -- */

.weather-panel__location {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: var(--tb-secondary-color, #94a3b8);
    padding: 0.35rem 0.5rem;
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.weather-panel__location .bi {
    color: #f87171;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* -- 2×2 stats grid -- */

.weather-panel__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

.weather-panel__stat {
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 0.15rem;
    padding: 0.5rem 0.6rem;
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}

.weather-panel__stat:hover {
    background: rgba(255, 255, 255, 0.08);
}

.weather-panel__stat-icon {
    font-size: 0.95rem;
    color: #60a5fa;
}

.weather-panel__stat-label {
    font-size: 0.6875rem;
    color: var(--tb-secondary-color, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.weather-panel__stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--tb-heading-color, #f1f5f9);
    white-space: nowrap;
    text-align: start;
}

/* -- Footer -- */

.weather-panel__footer {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 0.5rem;
    text-align: center;
}

.weather-panel__refresh {
    font-size: 0.75rem;
    color: var(--tb-secondary-color, #94a3b8);
    padding: 0.2rem 0.65rem;
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    transition: all 0.15s ease;
}

.weather-panel__refresh:hover {
    color: var(--tb-heading-color, #f1f5f9);
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Spinning icon while refreshing */
.weather-panel__refresh.is-loading .bi-arrow-clockwise {
    animation: weather-refresh-spin 0.8s linear infinite;
}

@keyframes weather-refresh-spin {
    to { transform: rotate(360deg); }
}

/* -- Keyboard shortcuts help (?) modal ------------------------------------------------- */
/* Toner / RonexAdmin use --tb-* theme tokens (not --bs-*) for surfaces and text. */

.ronex-kbd-shortcuts-modal .modal-content {
    border-radius: 0.75rem;
    /* Opaque surface: do not use --bs-body-bg here; it is often unset or translucent in Toner. */
    background-color: var(--tb-secondary-bg, #212529);
    color: var(--tb-body-color, #e2e8f0);
    border: 1px solid var(--tb-border-color-translucent, rgba(255, 255, 255, 0.1)) !important;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.35) !important;
}

.ronex-kbd-shortcuts-modal .modal-header,
.ronex-kbd-shortcuts-modal .modal-body {
    background-color: transparent;
    color: inherit;
}

.ronex-kbd-shortcuts-modal [class*="border-"] {
    border-color: var(--tb-border-color-translucent, rgba(255, 255, 255, 0.1)) !important;
}

.ronex-kbd-shortcuts-modal .text-muted {
    color: var(--tb-secondary-color, #94a3b8) !important;
}

.ronex-kbd-shortcuts-modal .text-body {
    color: var(--tb-body-color, #e2e8f0) !important;
}

.ronex-kbd-shortcuts-modal .text-primary,
.ronex-kbd-shortcuts-modal .ri-keyboard-line.text-primary {
    color: var(--tb-primary, #6ea8fe) !important;
}

.ronex-kbd-shortcuts-modal .ronex-kbd-shortcuts-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tb-secondary-color, #94a3b8);
    margin-bottom: 0.75rem;
}

.ronex-kbd-shortcuts-modal .ronex-kbd-shortcuts-keys {
    flex-shrink: 0;
    align-self: flex-start;
}

@media (min-width: 576px) {
    .ronex-kbd-shortcuts-modal .ronex-kbd-shortcuts-keys {
        min-width: 11.5rem;
    }
}

.ronex-kbd-shortcuts-modal kbd {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    font-family: var(--bs-font-monospace, ui-monospace, monospace);
    color: var(--tb-body-color, #e2e8f0);
    /* Contrast with modal panel: use dropdown / topbar token or solid fallback */
    background-color: var(--tb-dropdown-bg, var(--tb-topbar-user-bg, #1e1b2e));
    border: 1px solid var(--tb-border-color-translucent, rgba(255, 255, 255, 0.12)) !important;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2) !important;
    border-radius: 0.3rem;
}

.ronex-kbd-shortcuts-modal p.small {
    line-height: 1.55;
    max-width: 34rem;
    color: var(--tb-body-color, #e2e8f0) !important;
}
