/* VAHB v177 — phone and tablet layout. Loaded after each page's own styles. */
@media (max-width: 900px) {
  .site-header .nav-inner,
  body.v174-shared-shell .site-header .nav-inner {
    display:block!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    padding-inline:0!important;
    min-width:0!important;
  }
  .site-header .main-nav,
  body.v150-home .site-header .main-nav,
  body.v150-shared-header .site-header .main-nav {
    display:flex!important;
    width:max-content!important;
    min-width:max-content!important;
    padding-inline:12px!important;
  }
  .site-header .main-nav a {scroll-snap-align:start;flex:none!important}
  .site-header .nav-inner {scroll-snap-type:x proximity}
  .expense-main-grid,.finance-expense-layout,.expense-settings-grid {grid-template-columns:minmax(0,1fr)!important}
  .finance-expense-list-card {position:static!important;max-height:none!important}
  .v130m-tabs {overflow-x:auto!important;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  .v130m-tab {flex:none!important}
  .toolbar,.v132m-toolbar {min-width:0}
}

@media (max-width: 640px) {
  html {text-size-adjust:100%;-webkit-text-size-adjust:100%}
  body {min-width:0}
  img,video,iframe {max-width:100%;height:auto}
  .site-header .header-top,
  body.v150-home .site-header .header-top,
  body.v150-shared-header .site-header .header-top,
  body.v174-shared-shell .site-header .header-top {
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-rows:auto auto auto!important;
    align-items:center!important;
    column-gap:8px!important;
    row-gap:9px!important;
    width:calc(100% - 24px)!important;
    height:auto!important;
    min-height:0!important;
    padding:9px 0 11px!important;
  }
  .site-header .official-logo,
  body.v150-home .site-header .official-logo {grid-column:1!important;grid-row:1!important;min-width:0!important;width:auto!important;max-width:180px!important;height:auto!important}
  .site-header .official-logo img {width:min(170px,100%)!important;max-width:100%!important;height:auto!important}
  .site-header .header-account-area,
  body.v150-shared-header .site-header .header-account-area {grid-column:2!important;grid-row:1!important;margin:0!important;justify-self:end!important;min-width:0!important}
  .site-header .header-admin {display:none!important}
  .site-header .account-chip {height:42px!important;min-width:42px!important;padding:6px!important}
  .site-header .account-copy,.site-header .account-chevron {display:none!important}
  .site-header .header-meta,
  body.v150-shared-header .site-header .header-meta {grid-column:1/-1!important;grid-row:2!important;display:flex!important;justify-content:flex-start!important;min-width:0!important;margin:0!important}
  .site-header .header-meta .phone {display:none!important}
  .site-header .header-search,
  body.v150-shared-header .site-header .header-search {grid-column:1/-1!important;grid-row:3!important;width:100%!important;max-width:none!important;min-width:0!important;height:44px!important;margin:0!important;background:#fff!important}
  .site-header .header-search input {min-width:0!important;font-size:16px!important}
  .site-header .v142-language-slot {min-width:0;max-width:100%}
  .site-header .vahb-lang-control {display:flex!important;gap:4px!important;max-width:100%}
  .site-header .vahb-lang-btn {min-height:36px!important;padding:5px 7px!important}
  .site-header .nav-row,
  body.v150-home .site-header .nav-row,
  body.v150-shared-header .site-header .nav-row {height:49px!important}
  .site-header .nav-inner,
  body.v174-shared-shell .site-header .nav-inner {width:100%!important;max-width:100%!important;height:49px!important;min-height:49px!important}
  .site-header .main-nav,
  body.v150-home .site-header .main-nav,
  body.v150-shared-header .site-header .main-nav {height:49px!important;gap:3px!important}
  .site-header .main-nav a,
  body.v150-home .site-header .main-nav a,
  body.v150-shared-header .site-header .main-nav a {height:42px!important;min-height:42px!important;padding:0 11px!important;font-size:13px!important}
  .site-header .account-menu-panel,.site-header .notification-panel {right:0!important;left:auto!important;max-width:calc(100vw - 24px)!important}

  body.v150-home .compact-home-main {padding:12px!important}
  body.v150-home .v141-hero-layout {padding:18px!important;gap:15px!important}
  body.v150-home .v34-hero-copy h1 {font-size:clamp(26px,8vw,34px)!important;line-height:1.08!important}
  body.v150-home .v141-hero-shortcuts {width:100%!important;min-width:0!important;padding:12px!important}
  body.v150-home .v141-shortcut-grid {grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.v150-home .v34-metric-grid,
  body.v150-home .v141-workspace {grid-template-columns:minmax(0,1fr)!important}
  body.v150-home .v34-metric-card {min-width:0!important}
  body.v150-home .v141-workspace>.v141-column {min-width:0!important}
  body.v150-home .v34-panel {min-width:0!important}

  body.v174-shared-shell :is(#topicContext.v174-page-banner,.vahb-v65-hero.v174-page-banner,.expense-page-head.v174-page-banner,.v27-team-head.v174-page-banner,.v22-page-head.v174-page-banner) {
    width:calc(100% - 24px)!important;min-height:132px!important;
    margin:16px auto 14px!important;border-radius:13px!important;
  }
  body.v174-shared-shell :is(#topicContext.v174-page-banner,.expense-page-head.v174-page-banner,.v27-team-head.v174-page-banner,.v22-page-head.v174-page-banner) {padding:20px!important}
  body.v174-shared-shell .vahb-v65-hero.v174-page-banner .vahb-v65-hero-inner {min-height:132px!important;padding:20px!important}
  body.v174-shared-shell :is(#topicContext.v174-page-banner,.vahb-v65-hero.v174-page-banner,.expense-page-head.v174-page-banner,.v27-team-head.v174-page-banner,.v22-page-head.v174-page-banner) :is(h1,.vahb-v65-title,#topicContextLabel) {font-size:clamp(26px,8vw,34px)!important;overflow-wrap:anywhere}
  body.topic-page .content-shell.shell-wide,
  body.v150-shared-header:not(.v150-home)>main.shell-wide,
  body.vahb-photo-page .vahb-v65-hero {width:calc(100% - 24px)!important}

  .expense-stat-grid {grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .expense-stat-grid>article {min-width:0;padding:12px!important}
  .expense-stat-grid strong {font-size:21px!important;overflow-wrap:anywhere}
  .expense-main-grid,.finance-expense-layout {display:grid!important;gap:14px!important}
  .expense-form-card,.expense-list-card,.finance-expense-list-card,.finance-expense-detail-card {min-width:0!important;padding:15px!important}
  .expense-card-head,.finance-detail-head {flex-wrap:wrap!important;gap:10px!important}
  .expense-list-tools {display:flex;flex-wrap:wrap;gap:8px;width:100%}
  .expense-list-tools select {max-width:100%}
  .expense-item summary {align-items:flex-start!important;gap:9px!important}
  .expense-summary-right {max-width:46%!important;min-width:0;overflow-wrap:anywhere}
  .expense-detail-grid,.finance-workflow-summary {grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .form-two,.expense-settings-grid {grid-template-columns:minmax(0,1fr)!important}
  .expense-form-card input,.expense-form-card select,.expense-form-card textarea,
  .finance-expense-main input,.finance-expense-main select,.finance-expense-main textarea {box-sizing:border-box;max-width:100%;min-width:0;font-size:16px!important}
  .expense-item-actions textarea {flex-basis:100%!important}
  .expense-item-actions .btn {min-height:44px}

  .v130m-top {height:auto!important;min-height:68px!important}
  .v130m-topin {width:calc(100% - 24px)!important;flex-wrap:wrap!important;padding:9px 0!important;gap:8px!important}
  .v130m-logo {max-width:160px!important;height:auto!important}
  .v130m-top-actions {flex-wrap:wrap!important;justify-content:flex-end!important;min-width:0!important}
  .v130m-back {white-space:normal!important;text-align:center;min-height:40px}
  .v130m-shell,.v130m-heroin {width:calc(100% - 24px)!important}
  .v130m-hero h1 {font-size:29px!important}
  .v130m-tabs {margin-top:12px!important}
  .v130m-panelbox,.v130m-block {padding:14px!important}
  .v130m-panelhead,.v130m-blockhead,.v130m-reqhead {flex-wrap:wrap!important}
  .v130m-kpis,.v130m-kpis.v132m-kpis {grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .v130m-grid,.v130m-dashgrid,.v130m-form {grid-template-columns:minmax(0,1fr)!important}
  .v130m-kpi,.v130m-card,.v130m-person {min-width:0!important}
  .v130m-actions {flex-wrap:wrap!important}
  .v130m-teamtable {min-width:440px}
  #teamOverview,#teamPlanner {max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .v130m-form input,.v130m-form textarea,.v130m-adjust input {font-size:16px!important}

  body:has(.top .topin) .topin {width:calc(100% - 24px)!important}
  body:has(.top .topin) .top .actions {width:100%;display:flex;flex-wrap:wrap;gap:8px!important}
  body:has(.top .topin) .top .back {min-height:42px;flex:1 1 110px;white-space:normal;text-align:center}
  body:has(.top .topin) :is(.shell,.heroin) {width:calc(100% - 24px)!important}
  body:has(.top .topin) .toolbar {grid-template-columns:minmax(0,1fr)!important}
  body:has(.top .topin) .toolbar :is(input,select,button) {min-width:0;width:100%;font-size:16px!important}
  body:has(.top .topin) :is(.layout,.balancegrid,.balanceform,.formgrid) {grid-template-columns:minmax(0,1fr)!important}
  body:has(.top .topin) .metrics {grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body:has(.top .topin) :is(#requests,#previewBox) {max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  body:has(.top .topin) :is(#requests,#previewBox) .table {min-width:620px}
  body:has(.top .topin) .modal {padding:8px!important}
  body:has(.top .topin) .modalcard {max-height:calc(100dvh - 16px)!important;width:100%!important}
  body:has(.top .topin) .modalbody {padding:14px!important}
  body:has(.top .topin) .formgrid :is(input,select,textarea) {min-width:0;font-size:16px!important}

  body.v172-admin-page .topbar-inner {width:calc(100% - 24px)!important;flex-wrap:wrap!important}
  body.v172-admin-page .topbar-inner .vahb-admin-top-actions {width:100%!important;justify-content:space-between!important;flex-wrap:wrap!important}
  body.v172-admin-page .admin-wrap {max-width:100%;min-width:0;padding-inline:12px!important}
  body.v172-admin-page .admin-wrap .tabs {overflow-x:auto!important;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  body.v172-admin-page .admin-wrap :is(input,select,textarea) {max-width:100%;min-width:0;font-size:16px!important}

  :is(a,button,input,select,textarea):focus-visible {outline:3px solid #ff9800!important;outline-offset:2px!important}
}

@media (max-width: 400px) {
  .site-header .vahb-lang-name {display:none!important}
  .site-header .vahb-lang-btn {min-width:39px!important;justify-content:center!important}
  .expense-stat-grid {grid-template-columns:minmax(0,1fr)!important}
  .v130m-kpis,.v130m-kpis.v132m-kpis {grid-template-columns:minmax(0,1fr)!important}
}
