.branch-workspace {
    --bg: #f7f5f4;
    --panel: #fff;
    --border: #e5dcde;
    --text: #251d21;
    --muted: #62595e;
    --accent: #981b31;
    --accent-dark: #7b1628;
    background: var(--bg);
    font: 16px/1.45 "Segoe UI", sans-serif;
}

.branch-app-settings {
    display: grid;
    gap: 10px;
    border: 1px solid #e5dcde;
    border-radius: 11px;
    background: #fff;
    padding: 14px;
    margin: 0 0 16px;
    scroll-margin-top: 96px;
}

.branch-app-settings[hidden],
.branch-app-settings [hidden] {
    display: none;
}

.auth-page .branch-app-settings {
    margin: 18px 0 0;
    background: #fcf7f8;
}

.branch-app-actions,
.branch-app-dialog-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.branch-app-dialog {
    width: min(440px, calc(100% - 28px));
    max-height: calc(100% - 28px);
    border: 1px solid #e5dcde;
    border-radius: 12px;
    background: #fff;
    color: #342129;
    padding: 17px;
    box-shadow: 0 14px 40px #22151c44;
}

.branch-app-dialog::backdrop {
    background: #22151c85;
}

.branch-app-dialog-heading {
    justify-content: space-between;
}

.branch-app-dialog-heading h2 {
    font-size: 1.22rem;
    margin: 0;
}

.branch-app-dialog [data-pwa-view] {
    margin-top: 12px;
}

.branch-app-dialog [data-pwa-view] > p {
    flex-basis: 100%;
}

@media (max-width: 620px) {
    .branch-app-dialog {
        position: fixed;
        inset: auto 0 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        border-radius: 16px 16px 0 0;
    }
}

.branch-install,
.branch-alerts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.branch-install > div,
.branch-alerts > div {
    flex: 1 1 210px;
}

.branch-install:not([hidden]) + .branch-alerts {
    border-top: 1px solid #e5dcde;
    padding-top: 10px;
}

.branch-install p,
.branch-alerts p {
    color: #62595e;
    margin: 3px 0 0;
    font-size: 0.89rem;
}

.branch-install .pwa-message {
    flex-basis: 100%;
}

.branch-app-settings .button,
.branch-topbar-alerts {
    background: #fff;
    color: #7b1628;
    border: 1px solid #e5dcde;
    min-height: 44px;
    padding: 8px 12px;
}

.branch-topbar-title {
    display: grid;
    min-width: 0;
    margin-right: auto;
    line-height: 1.2;
}

.branch-topbar-title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.branch-topbar-title span {
    color: var(--muted);
    font-size: 0.83rem;
}

.branch-topbar-alerts {
    display: grid;
    place-items: center;
    min-width: 44px;
    border-radius: 9px;
}

.branch-workspace .content-topbar {
    gap: 10px;
}

.branch-workspace .sidebar {
    background: #342129;
}

.branch-workspace .panel,
.branch-workspace .metric-card,
.branch-workspace .catalog-card {
    background: var(--panel);
    box-shadow: 0 1px 2px #26151b12;
}

.branch-workspace .button:not(.button-secondary):not(.button-danger) {
    background: #89172a;
}

.branch-workspace .page-head h2 {
    font-size: clamp(1.38rem, 4vw, 2rem);
    letter-spacing: -0.04em;
}

.branch-workspace #branch-cart {
    scroll-margin-top: calc(84px + env(safe-area-inset-top, 0px));
}

.branch-mobile-nav {
    display: none;
}

@media (max-width: 980px) {
    .branch-workspace .content {
        padding: 0 14px calc(80px + env(safe-area-inset-bottom, 0px));
    }

    .branch-workspace .content-topbar {
        top: 0;
        min-height: 62px;
        margin: 0 -14px 15px;
        padding: calc(7px + env(safe-area-inset-top, 0px)) 14px 7px;
        background: #fff;
        border-bottom: 1px solid var(--border);
    }

    .branch-workspace .sidebar-content-toggle {
        width: 44px;
        height: 44px;
        border-radius: 9px;
        background: #342129;
        box-shadow: none;
    }

    .branch-mobile-nav {
        position: fixed;
        z-index: 22;
        inset: auto 0 0;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        border-top: 1px solid #e5dcde;
        padding: 4px max(7px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(7px, env(safe-area-inset-left, 0px));
        background: #fff;
    }

    .branch-mobile-nav a {
        display: grid;
        place-items: center;
        align-content: center;
        gap: 4px;
        min-height: 52px;
        padding: 4px;
        border-radius: 8px;
        color: #62595e;
        font-size: 0.76rem;
        font-weight: 650;
    }

    .branch-mobile-nav a[aria-current],
    .branch-mobile-nav a:hover {
        color: #7b1628;
        background: #faedf0;
    }

    .branch-mobile-nav i {
        font-size: 1.08rem;
    }

    .branch-cart-icon {
        position: relative;
    }

    .branch-cart-badge {
        position: absolute;
        inset: -7px auto auto 88%;
        min-width: 16px;
        padding-inline: 3px;
        border-radius: 10px;
        background: #89172a;
        color: #fff;
        text-align: center;
        font-size: 0.68rem;
    }

    .branch-workspace .button,
    .branch-workspace .quantity-stepper-button,
    .branch-workspace input:not([type="hidden"]):not([type="checkbox"]),
    .branch-workspace select {
        min-height: 44px;
    }

    .branch-workspace input:not([type="hidden"]),
    .branch-workspace select,
    .branch-workspace textarea {
        font-size: 16px;
        min-width: 0;
    }

    .branch-workspace .page-head,
    .branch-workspace .panel-head {
        gap: 9px;
        margin-bottom: 12px;
    }

    .branch-workspace .panel,
    .branch-workspace .catalog-card,
    .branch-workspace .metric-card {
        padding: 13px;
    }

    .branch-workspace .panel {
        margin-block: 0 12px;
    }

    .branch-workspace .panel-grid,
    .branch-workspace .catalog-layout,
    .branch-workspace .filter-row,
    .branch-workspace .form-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .branch-workspace .metric-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr));
        gap: 8px;
        margin-bottom: 12px;
    }

    .branch-workspace .metric-card {
        gap: 3px;
    }

    .branch-workspace .metric-card strong {
        font-size: 1.5rem;
    }

    .branch-workspace .catalog-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr));
        gap: 10px;
    }

    .branch-workspace .catalog-card {
        text-align: left;
        gap: 9px;
    }

    .branch-workspace .catalog-card h4 {
        margin: 0;
        text-align: left;
    }

    .branch-workspace .catalog-card img {
        height: 110px;
        width: 100%;
        object-fit: contain;
        background: #f8f5f5;
    }

    .branch-workspace .cart-item-info,
    .branch-workspace .cart-actions {
        width: 100%;
        min-width: 0;
    }

    .branch-workspace #orders-list-table .order-requester {
        display: none;
    }

    .branch-workspace .pwa-update-notice {
        bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    }
}
