/* /Components/Layout/MainLayout.razor.rz.scp.css */
.page[b-eatya7x94y] {
    position: relative;
    display: flex;
    flex-direction: row;
}

main[b-eatya7x94y] {
    flex: 1;
    min-width: 0;
    /* iPad Safari rubber-bands the page even when the dashboard /
       wind / sailsteer page content fits in one viewport. Containing
       the scroll on <main> stops the bounce; pages that DO need to
       scroll (Settings, Resources at >20 rows) still scroll within
       <main>, just without the rubber-band visual. --app-height is
       the dynamic viewport minus the safe-area insets <html> pads
       itself by (app.css :root), so main fills the padded html box
       exactly in a standalone PWA and the OS chrome (URL bar
       showing/hiding) doesn't trigger rubber-band. */
    height: var(--app-height);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sidebar[b-eatya7x94y] {
    background: var(--sk-sidebar-bg);
    border-right: 1px solid var(--sk-sidebar-border);
    /* Always-dark navigation rail (Pattern 1: VSCode / Linear / Slack).
       The rail is "frame", not content - keeping it constant gives the
       eye a stable anchor regardless of theme. Drop-shadow below floats
       it above the chart in light theme so the dark rail reads as a
       deliberate frame instead of an unflipped island. */
    box-shadow: var(--sidebar-shadow, none);
    /* Default expanded width (icons + labels). iPad touch target
       floor is 44 px; 10 rem leaves comfortable room for every
       label without wrapping. Collapses to the 4 rem icon rail via
       .page.sidebar-collapsed below. */
    width: 10rem;
    /* Same --app-height as <main>: the html content box, which is the
       dynamic viewport shrunk by the safe-area padding. */
    height: var(--app-height);
    position: sticky;
    top: 0;
    flex-shrink: 0;
    /* No width transition: animating width reflows <main> and resizes
       the chart on every frame. The rail snaps to its new width in a
       single layout pass (MainLayout then nudges Leaflet to re-measure
       once) and only the rail's contents animate, below. */
    /* Clips the sliding contents during the toggle animation and keeps
       Safari from drawing a stray scrollbar track on the narrow rail. */
    overflow: hidden;
}

/* Icon rail. Single trigger: `.page.sidebar-collapsed`, mirrored off
   Settings.SidebarCollapsed in MainLayout, which also flips that
   setting on fullscreen enter / exit so the chevron toggle in the
   rail stays authoritative. 4 rem fits the 1.15 rem rail icons
   without clipping. */
.page.sidebar-collapsed .sidebar[b-eatya7x94y] {
    width: 4rem;
}

/* Toggle animation: compositor-only (transform + opacity) on the rail's
   contents, so the chart behind never re-lays out mid-animation. Two
   identical keyframes with different names restart the animation on
   every toggle, because a changed animation-name re-runs it. */
@media (prefers-reduced-motion: no-preference) {
    .sidebar[b-eatya7x94y]  .nav-scrollable {
        animation: sidebar-contents-expand-b-eatya7x94y 0.18s ease-out;
    }
    .page.sidebar-collapsed .sidebar[b-eatya7x94y]  .nav-scrollable {
        animation-name: sidebar-contents-collapse-b-eatya7x94y;
    }
}

@keyframes sidebar-contents-expand-b-eatya7x94y {
    from { opacity: 0; transform: translateX(-0.75rem); }
    to   { opacity: 1; transform: none; }
}

@keyframes sidebar-contents-collapse-b-eatya7x94y {
    from { opacity: 0; transform: translateX(-0.75rem); }
    to   { opacity: 1; transform: none; }
}

.top-row[b-eatya7x94y] {
    background-color: var(--sk-top-row-bg);
    border-bottom: 1px solid var(--sk-top-row-border);
    justify-content: flex-end;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    /* --z-topbar sits above the map, HUD, controls and Leaflet's own
       control corners so descendants that overflow into the chart
       area (the SearchBox typeahead dropdown) paint on top; sticky +
       z-index makes this a stacking context, so the topbar's tier is
       the ceiling for everything inside. Alarm banner, toasts and
       modals sit above it (see the z-index scale in app.css :root). */
    z-index: var(--z-topbar);
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Phone (portrait, or a phone turned landscape; same breakpoint as the
   phone block in app.css, which sizes the topbar controls).
   - Expanded sidebar narrows to 7 rem so the chart and the topbar keep
     their width; the collapsed rail stays at 4 rem (44 px+ targets).
   - Topbar row: tight padding + gap, and an inline-size container so
     app.css can drop the zoom pair when the row runs short.
     flex-start makes any residual overflow spill off the right end,
     away from the connection dot and the Notifications button. */
@media (max-width: 600px), (max-height: 500px) and (max-width: 900px) {
    .sidebar[b-eatya7x94y] {
        width: 7rem;
    }
    .page.sidebar-collapsed .sidebar[b-eatya7x94y] {
        width: 4rem;
    }
    .top-row[b-eatya7x94y] {
        justify-content: flex-start;
        padding-left: 4px !important;
        padding-right: 4px !important;
        gap: 4px;
        flex-wrap: nowrap;
        container: topbar / inline-size;
    }
}

.connection-status[b-eatya7x94y] {
    font-size: 0.8rem;
    color: var(--sk-top-row-text);
}

article[b-eatya7x94y] {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Shared shape for topbar glyph buttons (Night / Fullscreen / zoom).
   Fixed 2 rem square so they line up with the search input next to
   them (.topbar-search-input is 31 px tall) and the row of identical
   glyphs reads as a unit. Touch pointers and phone widths raise them
   to 44 px via app.css. */
.topbar-icon-btn[b-eatya7x94y] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    line-height: 1;
}

.topbar-icon-btn svg[b-eatya7x94y] {
    display: block;
}
/* /Components/Layout/NavMenu.razor.rz.scp.css */
/* Sidebar: icon-left, label-right. Expanded by default with visible
   labels; narrows to icon-only when the page is in fullscreen /
   iOS-fullbleed so the chart gets the maximum viewport.
   See MainLayout.razor.css for the .sidebar width rules that match. */

.nav-icon[b-yba9ql18na] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-icon svg[b-yba9ql18na] {
    /* 1.4rem visible icon size keeps glyphs readable at iPad touch
       distance / cabin sunlight. stroke="currentColor" on the SVG
       lets the icon pick up sidebar text + active-state colours. */
    width: 1.4rem;
    height: 1.4rem;
}

/* Inline SVG icons (Chart / Resources) track currentColor for stroke
   and pick up the .nav-icon font-size via 1.1em so they read at the
   same apparent weight as the unicode glyphs on the other links. */
.nav-icon svg[b-yba9ql18na] {
    display: block;
}

/* Labels visible by default; collapsed to icon-only in fullscreen
   (either the real Fullscreen API state handled from .page, or the
   iOS CSS fallback on <html>). */
.nav-label[b-yba9ql18na] {
    display: inline;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[b-yba9ql18na] .nav-item {
    padding-bottom: 0.3rem;
}

[b-yba9ql18na] .nav-item:first-of-type {
    padding-top: 1rem;
}

[b-yba9ql18na] .nav-link {
    color: var(--sk-sidebar-text);
    border-radius: 6px;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    /* Bigger tap target for iPad touch. */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

[b-yba9ql18na] .nav-link:hover {
    background-color: var(--sk-sidebar-hover-bg);
    color: var(--sk-sidebar-text-active);
}

[b-yba9ql18na] .nav-link.active {
    background-color: var(--sk-sidebar-active-bg);
    color: var(--sk-sidebar-text-active);
}

[b-yba9ql18na] .nav-link.active .nav-icon {
    opacity: 1;
}

/* Scrollable nav column. Hide the scrollbar completely - the nav
   almost never overflows (<10 items), and on the rare narrow-
   viewport case where it does, the hover / swipe-scroll still works
   without the visual clutter of a scrollbar track running down the
   side of the chrome.
   Flex column so the collapse button at the bottom can be pushed
   to the rail's foot via margin-top:auto without forcing a fixed
   height on the nav above it. --app-height is the html content box
   (dynamic viewport minus the safe-area padding, app.css :root) -
   100vh / 100dvh would overflow on iPad PWA standalone. */
.nav-scrollable[b-yba9ql18na] {
    display: flex;
    flex-direction: column;
    height: var(--app-height);
    overflow-y: auto;
    scrollbar-width: none;                  /* Firefox */
    /* iOS Safari rubber-bands an overflow:auto container even when the
       inner content fits - the helm could swipe the nav up/down on
       any page where the page itself fit without scrolling. Containing
       the overscroll stops the bounce; horizontally, we don't scroll
       at all so contain on x is also safe. */
    overscroll-behavior: contain;
    touch-action: pan-y;
}
.nav-scrollable[b-yba9ql18na]::-webkit-scrollbar {
    display: none;                          /* Chrome / Safari / Edge */
}

/* Suppress the WebKit / iOS link-drag preview ("drag-and-drop" of
   the icon glyph) on nav links. Without this the helm could grab
   any nav icon on iPad and drag it sideways, leaving a ghost glyph
   floating across the rail until they let go. */
[b-yba9ql18na] .nav-link {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}
[b-yba9ql18na] .nav-link img,
[b-yba9ql18na] .nav-link svg {
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Collapse labels + shrink nav-link padding when the sidebar is in
   icon-rail mode. The .sidebar width itself is in
   MainLayout.razor.css. Triggered solely by .page.sidebar-collapsed
   (mirrored off Settings.SidebarCollapsed). MainLayout auto-flips
   that setting on fullscreen enter/exit so fullscreen narrows the
   rail, while the
   chevron-toggle in the rail keeps working as an override. */
.page.sidebar-collapsed .nav-label[b-yba9ql18na] {
    display: none;
}
.page.sidebar-collapsed[b-yba9ql18na]  .nav-link {
    justify-content: center;
    gap: 0;
    padding: 0.5rem;
}
/* The collapsed-rail icon-centring overrides for .nav-item / .nav-link
   are in app.css (global). Blazor CSS isolation scopes those scoped
   rules to the NavMenu host attribute, which the .page selector
   doesn't carry, so they wouldn't apply here. */

/* Icon-rail mode: shrink the 1.4rem day-size icons so they fit
   comfortably inside the 4rem sidebar without touching the rail
   borders. 1.15rem keeps them legible at arm's length on an iPad
   while leaving ~0.5rem padding on each side. */
.page.sidebar-collapsed .nav-icon[b-yba9ql18na] {
    font-size: 1.15rem;
    width: auto;
}

/* Collapse / expand button at the foot of the rail. margin-top:auto
   pushes it past the spaced nav items so it sits at the bottom
   regardless of how many items the rail holds. The button reuses
   .nav-link styling for hover + sidebar-collapsed icon-rail rules,
   so the chevron shrinks alongside the page icons. A subtle top
   border separates it from the navigation cluster, matching the
   collapse-button placement convention in VSCode / Linear / Slack. */
.nav-collapse-row[b-yba9ql18na] {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 0.4rem 0.75rem 0.6rem;
}
.nav-collapse-btn[b-yba9ql18na] {
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}
.nav-collapse-btn:focus-visible[b-yba9ql18na] {
    outline: 2px solid var(--sk-accent-dim, rgba(255,255,255,0.3));
    outline-offset: -2px;
}

/* Phone-width responsive trim. The first-run default for phone
   viewports already auto-collapses the rail (see
   IAppSettings.ApplyMobileFirstRunDefaultsAsync), so this mostly
   shapes the LOOK after a manual expand: a touch tighter than
   desktop but still tappable above the iPad-class 44 px floor.
   Breakpoint matches the (max-width: 600px) used elsewhere in
   app.css for layout shifts. */
@media (max-width: 600px) {
    .nav-icon[b-yba9ql18na] {
        width: 1.5rem;
        height: 1.5rem;
    }
    .nav-icon svg[b-yba9ql18na] {
        width: 1.2rem;
        height: 1.2rem;
    }
    .nav-label[b-yba9ql18na] {
        font-size: 0.85rem;
    }
    [b-yba9ql18na] .nav-link {
        /* 2.75 rem ~= 44 px on default 16 px root, the iOS Human
           Interface tap-target floor. Don't go lower without
           reducing root font-size. */
        min-height: 2.75rem;
        gap: 0.5rem;
        padding: 0.4rem 0.55rem;
    }
    .page.sidebar-collapsed .nav-icon[b-yba9ql18na] {
        /* Slightly smaller than the desktop 1.15 rem so the icon-
           rail's 4 rem width has more breathing room. */
        font-size: 1rem;
    }
}
