/* CDC 0.9: layout only. Desktop/tablet retain their existing structure. */
@media (max-width:560px) and (orientation:portrait) {
    .page-shell { width:calc(100% - 20px); padding-top:max(10px,env(safe-area-inset-top)); padding-bottom:calc(20px + env(safe-area-inset-bottom)); }
    .topbar { gap:8px; min-height:0; padding-bottom:10px; }
    .topbar h1 { font-size:1.3rem; }
    .hero,.section-action,.detail-heading,.today-heading { flex-direction:column; align-items:stretch; gap:12px; }
    .action-grid,.cards,.today-grid,.catalog-grid,.keg-grid,.client-detail-grid,.order-layout,.checkout-layout { grid-template-columns:minmax(0,1fr); }
    .action-dialog { width:100%; max-width:none; height:100dvh; max-height:100dvh; margin:0; border-radius:0; padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
    .dialog-heading { position:static; }
    .table-wrap { overflow:visible; }
    .table-wrap table,.table-wrap tbody,.table-wrap tr,.table-wrap td { display:block; width:100%; min-width:0; }
    .table-wrap thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
    .table-wrap tr { margin-bottom:14px; padding:8px; border:1px solid var(--sirius-border); border-radius:var(--sirius-radius-sm); }
    .table-wrap td { box-sizing:border-box; white-space:normal; overflow-wrap:anywhere; }
    .table-wrap td::before { content:attr(data-label); display:block; font-weight:bold; margin-bottom:4px; }
    input,select,textarea { font-size:16px; max-width:100%; min-width:0; box-sizing:border-box; }
    button,summary { min-width:44px; min-height:44px; white-space:normal; }
    .action-buttons,.catalog-actions,.variant-row,.cart-line,.detail-heading { flex-wrap:wrap; }
    .action-grid > *, .variant-row > *, .catalog-card-body, .checkout-cart { min-width:0; max-width:100%; }
    .wide { grid-column:1/-1; }
    img,canvas { max-width:100%; height:auto; }
    pre { white-space:pre-wrap; overflow-wrap:anywhere; }
    h1,h2,h3,h4,p,span,strong,a { overflow-wrap:anywhere; }
    #client-detail,#order-detail,input,select,textarea { scroll-margin-block:20px 100px; }
}

/* v1 consultation shell: retain the metal identity without oversized brand buttons. */
#brand-home { background:none; border:0; box-shadow:none; padding:0; cursor:pointer; }
#brand-home:focus-visible { outline:2px solid currentColor; outline-offset:4px; }
@media (min-width:821px) {
    .topbar { min-height:90px; padding-block:8px; }
    .topbar #brand-home img { max-height:90px; width:auto; object-fit:contain; }
}
@media (max-width:560px) and (orientation:portrait) {
    *,*::before,*::after { box-sizing:border-box; }
    .page-shell,.panel,.content,.hero,.topbar,.user-block { min-width:0; max-width:100%; }
    .topbar #brand-home { min-width:0; max-width:100%; gap:8px; }
    .topbar #brand-home img { max-height:65px; max-width:65%; object-fit:contain; }
    .topbar #brand-home img:first-child { max-width:28%; }
    .hero { margin-block:14px; padding-block:0; }
    .dialog-heading { align-items:flex-start; gap:8px; }
    .dialog-heading h2 { font-size:1.25rem; }
    .action-dialog { max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px); }
}

/* Shell: the existing 560px portrait breakpoint is retained. Landscape uses PC navigation. */
#mobile-menu-toggle, .mobile-shortcuts, .mobile-menu-panel { display:none; }
.module-nav { display:flex; flex-wrap:wrap; align-items:flex-start; gap:6px; position:relative; z-index:20; }
.nav-primary, .nav-groups { display:flex; flex-wrap:wrap; gap:6px; }
.module-nav button, .nav-group summary { display:inline-flex; align-items:center; justify-content:flex-start; gap:0; width:auto; min-height:44px; padding:9px 8px; font-size:13px; white-space:nowrap; }
.nav-group summary { list-style:none; }
.nav-group summary::-webkit-details-marker { display:none; }
.nav-group summary > .ui-icon:last-child { margin:0 0 0 4px; width:14px; flex-basis:14px; }
.nav-group > div { position:absolute; right:0; top:calc(100% + 6px); min-width:260px; width:max-content; max-width:calc(100vw - 40px); max-height:65vh; overflow:auto; display:grid; gap:6px; grid-template-columns:1fr; z-index:30; }
.nav-group:not([open]) > div { display:none; }
.nav-group > div button { width:100%; white-space:normal; }
.user-menu { z-index:40; }
.user-menu-actions { min-width:0; width:270px; max-width:calc(100vw - 24px); gap:6px; }
.user-menu-actions p { margin:0 0 4px; line-height:1.8; }
.user-menu-actions hr { margin:2px 0; border:0; border-top:1px solid var(--line); }
.user-menu-actions button { display:flex; align-items:center; padding:8px 10px; font-size:13px; text-align:left; }
.user-menu-actions .profile-badge { margin-top:4px; }
@media (min-width:1200px) {
    .module-nav, .nav-primary, .nav-groups { flex-wrap:nowrap; }
    .module-nav { gap:5px; }
    .module-nav button, .nav-group summary { padding-inline:7px; }
    .module-nav .ui-icon { width:18px; height:18px; flex-basis:18px; margin-right:5px; }
}
@media (max-width:560px) and (orientation:portrait) {
    .topbar { display:flex; align-items:center; min-height:64px; height:auto; max-height:80px; padding:4px 0 8px; gap:6px; }
    .topbar #brand-home { flex:1; justify-content:flex-start; min-width:0; gap:5px; }
    .topbar #brand-home img:first-child { width:32px; height:40px; flex:0 0 32px; }
    .topbar #brand-home img:nth-child(2) { width:110px; max-width:calc(100% - 37px); height:auto; max-height:42px; }
    .topbar .user-block { display:block; flex:none; }
    .account-avatar { width:44px; height:44px; padding:6px; }
    #mobile-menu-toggle { display:inline-flex; align-items:center; flex:none; min-height:44px; padding:8px; font-size:13px; }
    #mobile-menu-toggle .ui-icon { margin-right:4px; }
    .module-nav { margin:0; padding:0; border:0; background:none; box-shadow:none; display:block; position:relative; }
    .module-nav > .nav-primary, .module-nav > .nav-groups { display:none; }
    .mobile-shortcuts { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.4fr); gap:8px; }
    .mobile-shortcuts button { min-height:48px; width:100%; white-space:normal; font-size:14px; justify-content:center; }
    .mobile-shortcuts [data-section="new-order"], .mobile-shortcuts [data-section="event-till"] { background:var(--metal-bronze); color:var(--sirius-on-primary); border-color:var(--sirius-border-bronze); }
    .mobile-shortcuts [data-section="my-hours"] { grid-column:1/-1; justify-self:start; width:auto; min-height:44px; }
    .mobile-menu-panel:not([hidden]) { display:block; position:absolute; inset:0 0 auto; z-index:35; max-height:calc(100dvh - 110px); overflow:auto; overscroll-behavior:contain; }
    .mobile-menu-heading { display:flex; justify-content:space-between; align-items:center; }
    .mobile-menu-heading button { width:44px; justify-content:center; padding:8px; }
    .mobile-menu-heading .ui-icon { margin:0; }
    .mobile-menu-panel section { border-top:1px solid var(--line); margin-top:12px; padding-top:8px; }
    .mobile-menu-panel h3 { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.06em; margin:4px 0 8px; }
    .mobile-menu-panel section > div { display:grid; gap:6px; }
    .mobile-menu-panel button[data-section] { width:100%; white-space:normal; text-align:left; }
}
