/* DrBestand ERP 0.19.0 — mobile release-candidate consistency layer. */
:root{
  --app-mobile-safe-bottom:env(safe-area-inset-bottom,0px);
  --app-mobile-dock-bottom:calc(12px + var(--app-mobile-safe-bottom));
  --app-mobile-nav-size:46px;
  --app-mobile-dock-gap:8px;
}

.header-mobile-menu-toggle,.header-mobile-menu-layer{display:none}
.header-mobile-menu-layer[hidden]{display:none!important}

@media(max-width:850px){
  .hero-premium{
    grid-template-columns:minmax(0,1fr)!important;
    width:100%;
  }
  .hero-premium>*{min-width:0;max-width:100%}
  .hero-feature-card{width:100%;align-self:stretch}
}

@media(max-width:980px){
  /* The administration trigger participates in layout instead of covering cards. */
  body.admin-workspace-page main{padding-bottom:calc(28px + var(--app-mobile-safe-bottom))!important}
  body.admin-workspace-page .admin-layout{grid-template-columns:minmax(0,1fr)!important}
  body.admin-workspace-page .admin-nav-mobile-toggle{
    position:sticky!important;
    top:calc(68px + env(safe-area-inset-top,0px))!important;
    left:auto!important;
    right:auto!important;
    bottom:auto!important;
    z-index:76!important;
    display:inline-grid!important;
    justify-self:start;
    width:var(--app-mobile-nav-size)!important;
    min-width:var(--app-mobile-nav-size)!important;
    height:var(--app-mobile-nav-size)!important;
    margin:0 0 10px!important;
  }

  /* Section navigation and action navigation use separate dock slots. */
  /* ERP owns the section-navigation trigger geometry in erp.css. */
  .erp-right-command-rail{
    left:calc(12px + var(--app-mobile-nav-size) + var(--app-mobile-dock-gap))!important;
    right:12px!important;
    bottom:var(--app-mobile-dock-bottom)!important;
    z-index:77!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
  }
  .erp-right-command-icons{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    justify-content:flex-end!important;
  }
  body.erp-right-command-active .erp-ajax-content{
    padding-bottom:calc(82px + var(--app-mobile-safe-bottom))!important;
  }
  .erp-structure-menu{bottom:calc(78px + var(--app-mobile-safe-bottom))!important}
  .erp-category-picker-results{bottom:calc(84px + var(--app-mobile-safe-bottom))!important}
}

@media(max-width:900px){
  html,body{max-width:100%;overflow-x:clip}
  body{overflow-wrap:anywhere}
  main,.panel,.card,.grid,.grid>*,.panel-head,.panel-head>*,.admin-content,.erp-ajax-content{min-width:0;max-width:100%}
  img,video,canvas{max-width:100%;height:auto}
  svg.ui-icon{max-width:24px;max-height:24px}
  .table-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
  pre,code{max-width:100%;overflow-wrap:anywhere;word-break:break-word}

  header.site-header{padding:9px 0}
  header.site-header .head{
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:7px;
    min-height:50px;
  }
  header.site-header .brand{min-width:0}
  header.site-header .brand-image-mark{width:42px;height:42px;max-width:42px}
  header.site-header .header-actions{
    display:flex;
    min-width:0;
    max-width:100%;
    align-items:center;
    justify-content:flex-end;
    gap:4px;
    overflow:hidden!important;
  }
  header.site-header .header-actions>.header-icon-link:not(.header-nav-icon-link),
  header.site-header .header-actions>.header-actions-separator{display:none!important}
  header.site-header .header-nav-icon-link{
    flex:0 0 35px!important;
    width:35px!important;
    min-width:35px!important;
    height:35px!important;
    padding:0!important;
  }
  header.site-header .header-actions .ui-icon,
  .header-mobile-menu-toggle .ui-icon{width:19px!important;height:19px!important;max-width:19px!important;max-height:19px!important}
  .header-mobile-menu-toggle{
    display:inline-grid!important;
    place-items:center;
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    padding:0!important;
    border-radius:11px!important;
  }

  .header-mobile-menu-layer{
    position:fixed;
    inset:0;
    z-index:1400;
    display:grid;
    align-items:start;
    padding:calc(10px + env(safe-area-inset-top,0px)) 10px 10px;
  }
  .header-mobile-menu-backdrop{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    padding:0;
    border:0;
    border-radius:0;
    background:rgba(4,29,61,.52)!important;
    box-shadow:none!important;
    backdrop-filter:blur(4px);
  }
  .header-mobile-menu-panel{
    position:relative;
    width:100%;
    max-height:calc(100dvh - 20px - env(safe-area-inset-top,0px));
    overflow:auto;
    padding:14px;
    border:1px solid #c9d8e4;
    border-radius:18px;
    background:#fff;
    box-shadow:0 24px 70px rgba(5,35,72,.28);
  }
  .header-mobile-menu-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding-bottom:12px;border-bottom:1px solid #d8e3eb}
  .header-mobile-menu-head h2{margin:2px 0 0;color:var(--brand-primary,#06285b);font-size:21px}
  .header-mobile-menu-kicker{margin:0;color:var(--brand-accent-dark,#007f6c);font-size:10px;font-weight:950;letter-spacing:.12em;text-transform:uppercase}
  .header-mobile-menu-close{flex:0 0 40px;width:40px!important;min-width:40px!important;height:40px!important;padding:0!important}
  .header-mobile-menu-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}
  .header-mobile-menu-link{
    display:grid;
    grid-template-columns:34px minmax(0,1fr);
    align-items:center;
    gap:9px;
    min-width:0;
    min-height:52px;
    padding:8px 10px;
    border:1px solid #d4e0e9;
    border-radius:12px;
    background:#f8fbfd;
    color:var(--brand-primary,#06285b);
    font-size:13px;
    font-weight:850;
    text-decoration:none;
  }
  .header-mobile-menu-link:hover,.header-mobile-menu-link:focus-visible,.header-mobile-menu-link.is-active{
    border-color:var(--brand-accent,#08a88a);
    background:#eaf9f5;
    color:var(--brand-accent-dark,#007f6c);
    outline:none;
  }
  .header-mobile-menu-link-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:9px;background:#fff}
  .header-mobile-menu-link-icon .ui-icon{width:20px!important;height:20px!important}
  .header-mobile-menu-link-label{min-width:0;overflow-wrap:anywhere;line-height:1.25}
  body.header-mobile-menu-open{overflow:hidden}

  .hero-premium{padding:22px!important;overflow:hidden}
  .hero-title{max-width:100%;font-size:clamp(38px,12vw,58px)!important;overflow-wrap:normal;word-break:normal}
  .hero-lead{max-width:100%}
  .hero-actions,.hero-actions .button{width:100%}
  .platform-process-section,.drbestand-beta-offer,.custom-excel-offer{max-width:100%;overflow:hidden}
  .platform-process-intro,.offer-intro,.offer-process,.beta-offer-intro{grid-template-columns:minmax(0,1fr)!important}
  .platform-process-badge{max-width:100%;border-radius:16px}
  .platform-process-poster{max-width:100%;overflow:hidden}
  .platform-process-poster img{width:100%!important;max-width:100%!important;object-fit:contain}
  .platform-process-flow,.platform-capability-grid{min-width:0}
  .platform-step-icon,.platform-capability-icon,.beta-icon-tab-symbol,.beta-detail-icon{flex:0 0 auto;max-width:82px;max-height:82px}
  .platform-step-icon .ui-icon,.platform-capability-icon .ui-icon,.beta-icon-tab-symbol .ui-icon,.beta-detail-icon .ui-icon{max-width:40px!important;max-height:40px!important}

  body.profile-workspace-page main{padding-bottom:calc(88px + var(--app-mobile-safe-bottom))!important}
  .profile-workspace-nav{bottom:var(--app-mobile-dock-bottom)!important;max-width:calc(100vw - 24px)!important}

  .cookie-banner{bottom:var(--app-mobile-dock-bottom)!important;max-width:calc(100vw - 24px)}

  .ai-assistant-admin,.ai-assistant-panel,.ai-assistant-panel>.panel,.ai-assistant-update-form,.ai-update-report,.ai-assistant-details{min-width:0;max-width:100%;width:100%;box-sizing:border-box}
  .ai-assistant-dropzone{min-width:0;max-width:100%;width:100%;padding:18px 12px;overflow:hidden;box-sizing:border-box}
  .ai-assistant-dropzone strong,[data-ai-update-filename]{display:block;max-width:100%;overflow-wrap:anywhere;word-break:break-word;text-align:center}
  .ai-assistant-update-options{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .ai-assistant-update-form .panel-actions{display:grid;grid-template-columns:minmax(0,1fr);width:100%}
  .ai-assistant-update-form .panel-actions button{width:100%;min-width:0}
  .ai-update-report .panel-head{min-width:0}
  .ai-update-report .panel-head p,.ai-assistant-path,.ai-assistant-static-alert li{max-width:100%;overflow-wrap:anywhere;word-break:break-word}
  .ai-assistant-details .table-wrap{width:100%;max-width:100%;overflow-x:auto}
  .ai-assistant-details table{min-width:680px}
}

@media(max-width:360px){
  header.site-header .head{gap:4px}
  header.site-header .brand-image-mark{width:38px;height:38px;max-width:38px}
  header.site-header .header-actions{gap:2px}
  header.site-header .header-nav-icon-link{flex-basis:32px!important;width:32px!important;min-width:32px!important;height:34px!important}
  .header-mobile-menu-toggle{width:35px!important;min-width:35px!important;height:35px!important}
  .header-mobile-menu-list{grid-template-columns:minmax(0,1fr)}
  .erp-right-command-rail{left:calc(10px + 42px + 6px)!important;right:10px!important}
}

@media(prefers-reduced-motion:reduce){
  .header-mobile-menu-layer,.header-mobile-menu-panel{scroll-behavior:auto}
}
