/* ==============================
   LAYOUT
================================ */

.wl-main-header {
    position: sticky;
    top: 0;
    z-index: 1100;
    /* Above sidebar and overlay */
    background: var(--color-bg-800);
    border-bottom: 4px solid var(--color-accent-600);
    padding: var(--space-3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Header layout: toggle + brand left, help button right */
.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.header-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Menu toggle: compact 44x44 touch target (WCAG 2.1 SC 2.5.8), reset global button overrides */
#menu-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-text-200);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}

#menu-toggle:hover {
    color: var(--color-accent-500);
    background: var(--color-hover-accent);
}

/* Page title: compact inline label next to hamburger (WEAP-41) */
#page-title {
    font-size: 1.25rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    line-height: 1.2;
}

/* Sidebar: closed by default (left: -320px). Open state = class "open" on #sidebar (E2E contract: tests/e2e/helpers/SidebarHelper.js). */
.wl-sidebar {
    position: fixed;
    top: 68px;
    left: -320px;
    width: 300px;
    height: calc(100vh - 68px);
    height: calc(100dvh - 68px);
    background: var(--color-bg-900);
    border-right: 4px solid var(--color-accent-600);
    transition: left 0.3s ease;
    z-index: 1000;
}

.wl-sidebar.open {
    left: 0;
}

#menu-overlay {
    position: fixed;
    top: 68px;
    /* Below header */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    z-index: 900;
}

#menu-overlay.show {
    display: block;
}

main {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-5) var(--space-3);
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    align-items: flex-end;
    /* Align inputs with labels */
}

/* Ensure children take available space but wrap if needed */
.row>* {
    flex: 1;
    min-width: 140px;
    /* Min width for mobile inputs */
}

/* Mobile: prevent overflow on narrow viewports (Firefox) */
@media (max-width: 480px) {
    .row>* {
        min-width: 0;
        flex-basis: 100%;
    }

    #page-title {
        font-size: 1rem;
    }
}