.sn-panel { display: none; }
/* Desktop layout for the member portal. The phone layouts remain in the page templates. */
.sn-chat-navigation { display: none; }
body:has(.sn-chat-navigation) { padding-bottom: 0 !important; }
@media (min-width: 1024px) {
    /* Phone installation controls do not belong to the desktop portal. */
    #pwaInstall, #bvInstalar { display: none !important; }
    .sn-chat-navigation { display: contents; }
    body:has(.sn-panel) :is(.bottom-nav, .pn-bar, .pn-drawer, .pn-scrim, #drawer, #drawerScrim, #openDrawerBtn, .menu-toggle, .navbar #menu) { display: none !important; }
    body:has(.sn-panel) .sn-panel { position: fixed; display: flex; flex-direction: column; overflow-y: auto; z-index: 110; font-family: 'Inter', sans-serif; }
    .sn-panel .sn-link { display: flex; align-items: center; text-decoration: none; color: #111827; border-radius: 10px; }
    .sn-panel .sn-ico { display: flex; align-items: center; justify-content: center; flex: none; }
    .sn-panel .sn-ico svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
    .sn-panel .sn-link.danger { color: #b91c1c; }
    .sn-panel .sn-count { margin-left: auto; font-size: 11px; padding: 1px 6px; border-radius: 8px; background: #eaf5e6; }
    body:has(.sn-panel) {
        --member-sidebar: 256px;
        --member-space: clamp(28px, 3.2vw, 56px);
        padding-left: var(--member-sidebar) !important;
        padding-bottom: 0 !important;
        background: #f5f7f5;
    }
    body:has(.sn-panel) .sn-bar,
    body:has(.sn-panel) .sn-scrim,
    body:has(.sn-panel) .sn-head { display: none; }
    body:has(.sn-panel) .sn-panel {
        left: 0; right: auto; top: 0; bottom: 0; width: var(--member-sidebar); max-width: none;
        transform: none; transition: none; padding: 26px 14px 20px;
        border-right: 1px solid #e1e8e0; background: #fff;
        overscroll-behavior: contain; scrollbar-width: thin;
    }
    body .sn-desktop-only { display: block; }
    body .sn-desktop-brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 24px; color: #174b24; text-decoration: none; }
    body .sn-desktop-brand img { width: 48px; height: 48px; object-fit: contain; }
    body .sn-desktop-brand > span { font: 700 24px 'Playfair Display', Georgia, serif; }
    body .sn-desktop-brand small { display: block; margin-top: 3px; font: 500 11px 'Inter', sans-serif; letter-spacing: .04em; color: #6a776b; }
    body .sn-panel .sn-who { margin: 0 0 12px; padding: 14px 12px; border-radius: 12px; background: #f4f7f2; }
    body .sn-panel .sn-who b { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
    body .sn-panel .sn-who span { display: block; margin-top: 4px; font-size: 12px; }
    body .sn-section-label { margin: 15px 12px 8px; font-size: 10px; letter-spacing: .11em; text-transform: uppercase; font-weight: 700; color: #748176; }
    body .sn-panel .sn-link { min-height: 44px; padding: 7px 11px; margin: 2px 0; gap: 10px; font-size: 12px; font-weight: 500; border: 1px solid transparent; }
    body .sn-panel .sn-link:hover { background: #f5f8f3; }
    body .sn-panel .sn-link.on { color: #145625; background: #eaf5e6; border-color: #d8ebd1; font-weight: 700; }
    body .sn-panel .sn-ico { width: 28px; height: 28px; background: transparent; border-radius: 8px; }
    body .sn-panel .sn-ico svg { width: 18px; height: 18px; stroke-width: 1.8; }
    body .sn-panel .sn-link.danger { margin-top: 10px; }
    body:has(.sn-panel) :is(a, button, input, select, textarea):focus-visible { outline: 3px solid #2f853d; outline-offset: 3px; }

    /* Toolbar and page widths include the standalone mobile-first templates. */
    body:has(.sn-panel) > :is(.app-header, .navbar) {
        min-height: 80px; height: auto; padding: 20px var(--member-space); background: #fff;
        color: #274b30; border-bottom: 1px solid #e1e8e0; box-shadow: none;
    }
    body:has(.sn-panel) > .app-header :is(.head-wave, .head-landscape, .brand-logo),
    body:has(.sn-panel) > .navbar .brand img { display: none; }
    body:has(.sn-panel) > .app-header .head-row { min-height: 39px; }
    body:has(.sn-panel) > :is(.app-header, .navbar) :is(.brand-name, .brand span) { color: #536b57; font: 500 14px 'Inter', sans-serif; }
    body:has(.sn-panel) > :is(.app-header, .navbar) :is(.icon-btn, .nav-bell, .back) { color: #2d6a38; background: #f1f7ed; border-color: #e0ecd9; }
    body:has(.sn-panel) > .app-header :is(.head-title, .head-sub) { color: #224b2c; }
    body:has(.sn-panel) > :is(main, .container, .page-head, .greeting, .strip-wrap) {
        width: 100%; max-width: 1320px; margin-left: auto; margin-right: auto;
        padding-left: var(--member-space); padding-right: var(--member-space); box-sizing: border-box;
    }
    body:has(.sn-panel) > .container { margin-top: 32px; margin-bottom: 40px; }
    body:has(.sn-panel) > :is(.page-head, .greeting) { padding-top: 32px; padding-bottom: 24px; }
    body:has(.sn-panel) > main { padding-top: 0; padding-bottom: 40px; }
    body:has(.sn-panel) :is(.page-title, .greeting-name, .container > h1) { font-size: clamp(28px, 2.4vw, 38px); letter-spacing: -.025em; }
    body:has(.sn-panel) .greeting-hi { font-size: 14px; }
    body:has(.sn-panel) :is(.page-sub, .subtitle, .greeting-accion) { font-size: 14px; line-height: 1.6; }
    body:has(.sn-panel) :is(.card, .section-card, .rsv-card, .pay-card, .opt-card, .form-card) { border: 1px solid #e2e9df; box-shadow: 0 3px 12px -8px #17452a24; }

    /* Home: useful columns instead of a phone-sized feed. */
    body:has(.greeting) > main { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
    body:has(.greeting) > main > :is(.stats-row, .banner-familiar, .banner-clave) { grid-column: 1 / -1; margin: 0; }
    body:has(.greeting) .stats-row { order: 1; }
    body:has(.greeting) .stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
    body:has(.greeting) .stat-card { padding: 22px; min-width: 0; }
    body:has(.greeting) .stat-num { font-size: 36px; }
    body:has(.greeting) .section-card { margin: 0; min-width: 0; }
    body:has(.greeting) .section-card:has(.actions-grid) { order: 2; }
    body:has(.greeting) .section-card:has(.rsv-list) { order: 3; }
    body:has(.greeting) > main:not(:has(.rsv-list)) > .section-card { grid-column: 1 / -1; }
    body:has(.greeting) .actions-grid { grid-template-columns: 1fr; }
    body:has(.greeting) .actions-grid > .action { grid-column: auto; }
    body:has(.greeting) .ardi-card { order: 4; grid-column: 1 / -1; max-width: none; }
    body:has(.greeting) .rsv-item { padding: 17px 20px; }

    /* Keep readable line lengths and QR sizes while widening lists and forms. */
    body:has(.sn-panel) .rsv-list:has(> .rsv-card.upcoming),
    body:has(.sn-panel) .pay-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
    body:has(.sn-panel) :is(.rsv-list:has(> .rsv-card.upcoming) .rsv-card, .pay-list .pay-card) { margin: 0; min-width: 0; }
    body:has(.sn-panel) :is(.pay-ref, .rsv-nombre, .fact-value) { overflow-wrap: anywhere; }
    body:has(.sn-panel) .new-row { justify-content: flex-start; }
    body:has(.sn-panel) :is(.btn-new, .btn-gold) { width: auto; min-width: 200px; }
    body:has(.sn-panel) .form-card { max-width: 960px; margin-left: 0; padding: 28px; }
    body:has(.sn-panel) .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
    body:has(.sn-panel) :is(.field-full, .form-grid > .notice) { grid-column: 1 / -1; }
    body:has(.sn-panel) .slots-grid { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
    body:has(.sn-panel) .days { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    body:has(.sn-panel) .days .day { margin: 0; }
    body:has(.sn-panel) .courts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
    body:has(.sn-panel) .iv-meters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    body:has(.sn-panel) .iv-list { max-width: 100%; }
    body:has(.sn-panel) :is(.iv-grid, .field-grid) { gap: 20px; }
    body:has(.sn-panel) .container:has(.chat-wrap) { max-width: 1200px; margin: 24px auto; padding: 0 var(--member-space); }
    body:has(.sn-panel) .chat-wrap { height: calc(100dvh - 48px); min-height: 440px; border-radius: 18px; overflow: hidden; border: 1px solid #dce5da; }
    body:has(.sn-panel) .sheet {
        left: calc(var(--member-sidebar) + (100vw - var(--member-sidebar)) / 2); right: auto;
        top: 50%; bottom: auto; width: calc(100vw - var(--member-sidebar) - 64px); max-width: 560px;
        max-height: 85dvh; overflow-y: auto; border-radius: 20px; margin: 0; z-index: 251;
        transform: translate(-50%, calc(-50% + 12px)); opacity: 0; visibility: hidden; pointer-events: none;
        box-shadow: 0 24px 80px -16px #12351d66; transition: opacity .15s, transform .15s;
    }
    body:has(.sn-panel) :is(.sheet.open, .sheet.on) { transform: translate(-50%, -50%); opacity: 1; visibility: visible; pointer-events: auto; }
    body:has(.sn-panel) :is(.grip, .sheet-grip) { display: none; }
    body:has(.sn-panel) :is(.sheet-scrim, .scrim, .confirm-sheet) { z-index: 250; }
    body:has(.sn-panel) .confirm-sheet { left: var(--member-sidebar); }
    body:has(.sn-panel) .pd-cart { left: var(--member-sidebar); right: 0; }

    /* Same login flow, with a welcoming desktop panel. */
    body.socio-auth { padding: 48px; background: #f1f5ef; }
    body.socio-auth > .card { display: grid; grid-template-columns: minmax(320px, .95fr) minmax(400px, 1fr); max-width: 1040px; min-height: 620px; border-radius: 24px; overflow: hidden; box-shadow: 0 20px 70px -30px #173a244d; }
    body.socio-auth > .card > .head { padding: 48px 38px; background: #164b27; display: flex; flex-direction: column; justify-content: space-between; }
    body.socio-auth .head-art { opacity: .18; height: 100%; }
    body.socio-auth .head-inner { display: flex; flex-direction: column; height: 100%; }
    body.socio-auth .head .brand { margin-bottom: 50px; }
    body.socio-auth .head .brand img { height: 76px; padding: 10px; background: white; border-radius: 16px; }
    body.socio-auth .head :is(h1, .subtitle, .top-back) { color: #fff; }
    body.socio-auth .head h1 { font-size: 38px; max-width: 290px; line-height: 1.14; }
    body.socio-auth .head .subtitle { color: #d6e7d6; font-size: 16px; line-height: 1.7; margin-top: 16px; }
    body.socio-auth .accent-line { margin-top: 10px; background: #d5c97a; }
    body.socio-auth .auth-desktop-note { display: block; margin-top: auto; padding-top: 64px; color: #cfdfcc; font-size: 13px; line-height: 1.7; }
    body.socio-auth > .card > .body { padding: 40px; align-self: center; min-width: 0; }
    body.socio-auth .body .btn { min-height: 48px; }
}
@media (min-width: 1440px) {
    body:has(.sn-panel) { --member-sidebar: 272px; }
    body:has(.greeting) .actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
    .sn-panel, .sn-bar, .sn-scrim { display: none !important; }
    body:has(.sn-panel) { padding-left: 0 !important; padding-bottom: 0 !important; }
}
