/* MVCA STAMPS v2.1.0 responsive experience layer */
:root{
  --mvca-navy-950:#071a31;
  --mvca-navy-900:#0b2545;
  --mvca-navy-800:#123d63;
  --mvca-blue-700:#176b87;
  --mvca-blue-600:#1f7f9f;
  --mvca-blue-500:#2b91ad;
  --mvca-gold-500:#d7a33d;
  --mvca-canvas:#f3f6fa;
  --mvca-surface:#ffffff;
  --mvca-surface-muted:#f8fafc;
  --mvca-ink:#172033;
  --mvca-muted:#667085;
  --mvca-line:#dbe3ec;
  --mvca-focus:rgba(31,127,159,.24);
  --mvca-shadow-sm:0 3px 12px rgba(7,26,49,.055);
  --mvca-shadow:0 12px 34px rgba(7,26,49,.08);
  --mvca-shadow-lg:0 26px 70px rgba(7,26,49,.16);
  --stamps-topbar-height:70px;
  --stamps-bottom-nav-height:74px;
  --stamps-safe-bottom:env(safe-area-inset-bottom,0px);
}

html{scroll-padding-top:calc(var(--stamps-topbar-height) + 18px)}
body{
  background:
    radial-gradient(circle at 96% -8%,rgba(43,145,173,.09),transparent 28rem),
    linear-gradient(180deg,#f8fafc 0,var(--mvca-canvas) 50%,#eef3f8 100%);
  color:var(--mvca-ink);
  min-height:100dvh;
}
body.viewport-mobile{--stamps-topbar-height:58px}
body.viewport-tablet{--stamps-topbar-height:64px}
body.modal-open,body.nav-open,body.action-sheet-open{overflow:hidden}

/* Accessible interaction baseline */
:where(a,button,input,select,textarea,[tabindex]):focus-visible{
  outline:3px solid var(--mvca-focus)!important;
  outline-offset:2px;
}
button,.btn,.form-control,.form-select,.nav-link,.stamps-nav-link{-webkit-tap-highlight-color:transparent}
.btn,.form-control,.form-select,.input-group-text{border-radius:11px}
.btn{min-height:43px;display:inline-flex;align-items:center;justify-content:center;gap:.42rem}
.btn-sm{min-height:36px}
.icon-button{min-width:42px;min-height:42px}
.form-control,.form-select{min-height:44px}
textarea.form-control{min-height:112px}
.form-check-input{width:1.16rem;height:1.16rem;margin-top:.12rem}
.form-check-label{line-height:1.45}
.form-text{line-height:1.45}
.required:after{content:" *";color:#b42318}

/* Refined global shell */
.stamps-topbar{
  min-height:var(--stamps-topbar-height);
  background:rgba(255,255,255,.93);
  border-bottom:1px solid rgba(219,227,236,.9);
  backdrop-filter:saturate(1.35) blur(16px);
  -webkit-backdrop-filter:saturate(1.35) blur(16px);
}
.stamps-topbar-inner{min-height:var(--stamps-topbar-height);padding-inline:clamp(12px,2vw,26px)}
.brand-link{min-width:0}
.brand-logo{width:42px;height:42px;border-radius:12px;object-fit:cover}
.brand-copy strong{color:var(--mvca-navy-900);letter-spacing:-.02em}
.brand-copy small{color:var(--mvca-muted)}
.mobile-page-context{display:none;min-width:0;line-height:1.12}
.mobile-page-context strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.91rem;color:var(--mvca-navy-900)}
.mobile-page-context small{display:block;color:var(--mvca-muted);font-size:.67rem;margin-top:3px}
.command-trigger{border-color:var(--mvca-line);background:#f8fafc}
.command-trigger:hover{border-color:#b7c8d8;background:#fff}
.connection-pill{border-color:var(--mvca-line)}
.connection-pill.offline{background:#fff4e6;color:#9a5b00;border-color:#f0c98c}
.user-avatar{background:linear-gradient(135deg,var(--mvca-navy-800),var(--mvca-blue-600))}

.stamps-sidebar{
  background:linear-gradient(180deg,var(--mvca-navy-950) 0%,var(--mvca-navy-900) 44%,#123b5e 100%);
  box-shadow:12px 0 40px rgba(7,26,49,.08);
}
.sidebar-search-wrap{padding:8px 12px 12px;position:sticky;top:0;z-index:2;background:linear-gradient(180deg,rgba(7,26,49,.98),rgba(7,26,49,.93) 80%,transparent)}
.sidebar-search{
  display:flex;align-items:center;gap:9px;border:1px solid rgba(255,255,255,.13);background:rgba(255,255,255,.08);
  border-radius:12px;padding:0 11px;color:rgba(255,255,255,.7)
}
.sidebar-search:focus-within{border-color:rgba(111,205,229,.75);box-shadow:0 0 0 3px rgba(86,190,219,.14);background:rgba(255,255,255,.11)}
.sidebar-search input{width:100%;height:40px;border:0;outline:0;background:transparent;color:#fff;font-size:.84rem}
.sidebar-search input::placeholder{color:rgba(255,255,255,.55)}
.sidebar-search button{border:0;background:transparent;color:rgba(255,255,255,.68);padding:5px;display:none}
.sidebar-search.has-value button{display:inline-grid;place-items:center}
.sidebar-no-results{display:none;margin:10px 12px;padding:18px 13px;text-align:center;border:1px dashed rgba(255,255,255,.18);border-radius:12px;color:rgba(255,255,255,.7);font-size:.8rem}
.sidebar-no-results.visible{display:block}

body.sidebar-collapsed .sidebar-search-wrap{padding-inline:4px}
body.sidebar-collapsed .sidebar-search{justify-content:center;padding:0;width:44px;height:44px;margin:auto}
body.sidebar-collapsed .sidebar-search input,body.sidebar-collapsed .sidebar-search button{display:none!important}
body.sidebar-collapsed .sidebar-no-results{display:none!important}
.stamps-nav-link{min-height:43px;border-radius:11px;margin-inline:7px}
.stamps-nav-link.active{background:linear-gradient(90deg,rgba(74,170,202,.24),rgba(255,255,255,.09));border:1px solid rgba(113,208,231,.19)}
.stamps-nav-link.active:before{background:#7bd5e6}
.stamps-nav-link[aria-current="page"] span{font-weight:780}

.stamps-main{min-width:0}
.stamps-content{padding:clamp(18px,2.2vw,34px);padding-bottom:40px}
.stamps-breadcrumb{margin-bottom:13px}
.page-head,.page-heading{
  align-items:flex-end;gap:20px;margin-bottom:22px;
}
.page-head>div:first-child,.page-heading>div:first-child{min-width:0}
.page-head h1,.page-heading h1{font-size:clamp(1.55rem,2.25vw,2.3rem);color:var(--mvca-navy-900);margin-bottom:.42rem}
.page-head p,.page-heading p{color:var(--mvca-muted);margin-bottom:0}
.page-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:9px}
.page-actions .btn{white-space:nowrap}

/* Cards, KPI blocks, and dashboard structure */
.card,.stamps-card{
  border-color:rgba(208,219,230,.88);
  border-radius:17px;
}
.stamps-card{box-shadow:var(--mvca-shadow-sm);overflow:hidden}
.stamps-card>.card-header{background:linear-gradient(180deg,#fff,#fbfcfe);border-bottom-color:var(--mvca-line)}
.stamps-card>.card-footer{background:#fbfcfe;border-top-color:var(--mvca-line)}
.card-header.d-flex{gap:12px;align-items:center}
.card-header small{line-height:1.35}
.kpi-grid,.summary-grid,.stats-grid{gap:16px}
.stat-card,.kpi-card,.operation-stat{border:1px solid var(--mvca-line);background:#fff;border-radius:17px;box-shadow:var(--mvca-shadow-sm)}

/* Tables: desktop clarity and mobile cards */
.table-responsive{
  position:relative;
  border-radius:0 0 17px 17px;
  scrollbar-width:thin;
  scrollbar-color:#b7c4d1 transparent;
}
.table-responsive:focus-within{box-shadow:inset 0 0 0 2px var(--mvca-focus)}
.table{--bs-table-bg:transparent;margin-bottom:0}
.table>:not(caption)>*>*{padding:.86rem .92rem;border-bottom-color:#e7edf3;vertical-align:middle}
.table thead th{
  color:#4a5a70;font-size:.72rem;text-transform:uppercase;letter-spacing:.045em;font-weight:800;
  background:#f7f9fc;white-space:nowrap;border-bottom:1px solid #dbe3ec;
}
.table tbody tr{transition:background .14s ease}
.table tbody tr:hover{background:#f8fbfd}
.table td:last-child .btn,.table td:last-child button{margin-block:2px}
.table-scroll-shadow-left:before,.table-scroll-shadow-right:after{content:"";position:absolute;top:0;bottom:0;width:24px;z-index:3;pointer-events:none}
.table-scroll-shadow-left:before{left:0;background:linear-gradient(90deg,rgba(7,26,49,.12),transparent)}
.table-scroll-shadow-right:after{right:0;background:linear-gradient(-90deg,rgba(7,26,49,.12),transparent)}
.empty-state{padding:34px 18px!important;color:var(--mvca-muted);text-align:center}
.empty-state i{font-size:1.6rem;color:#9aabbb}

/* Filters become a clear mobile disclosure while staying efficient on desktop */
.filter-card,.responsive-filter-card{overflow:visible}
.filter-toggle-bar{display:none}
.filter-bar{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:12px;align-items:end;
}
.filter-bar>button,.filter-bar>.btn{align-self:end}
.filter-bar .form-label{margin-bottom:.32rem;font-size:.76rem}
.filter-active-count{display:inline-grid;place-items:center;min-width:20px;height:20px;padding-inline:5px;border-radius:999px;background:var(--mvca-blue-700);color:#fff;font-size:.65rem;font-weight:800}

/* Search inputs receive a consistent clear affordance */
.responsive-search-wrap{position:relative}
.responsive-search-wrap>.form-control{padding-right:42px}
.responsive-search-clear{position:absolute;right:5px;top:50%;translate:0 -50%;width:34px;height:34px;border:0;border-radius:9px;background:transparent;color:#738195;display:none;place-items:center}
.responsive-search-wrap.has-value .responsive-search-clear{display:grid}
.responsive-search-clear:hover{background:#edf2f7;color:var(--mvca-navy-900)}

/* Modal and form flow */
.modal-content{border:0;border-radius:19px;box-shadow:var(--mvca-shadow-lg);overflow:hidden}
.modal-header{padding:17px 20px;background:linear-gradient(180deg,#fff,#fafcfe);border-bottom-color:var(--mvca-line)}
.modal-title{color:var(--mvca-navy-900);font-weight:800;letter-spacing:-.02em}
.modal-body{padding:20px}
.modal-footer{padding:14px 20px;background:#fbfcfe;border-top-color:var(--mvca-line)}
.form-section-title{display:flex;align-items:center;gap:8px;margin:4px 0 2px;color:var(--mvca-navy-900);font-size:.84rem;font-weight:800}
.form-section-title:after{content:"";height:1px;background:var(--mvca-line);flex:1}
.validation-summary{display:none;border:1px solid #f0b7be;background:#fff1f3;color:#8c2632;border-radius:12px;padding:12px 14px;margin-bottom:14px}
.validation-summary.visible{display:block}
.validation-summary strong{display:block;margin-bottom:4px}
.validation-summary ul{margin:0;padding-left:18px;font-size:.82rem}
.is-invalid{scroll-margin-top:90px}

/* Persistent network/status feedback */
.stamps-network-banner{
  display:none;position:fixed;z-index:1085;left:50%;translate:-50% 0;top:calc(var(--stamps-topbar-height) + 10px);
  max-width:min(680px,calc(100vw - 24px));padding:10px 14px;border-radius:12px;background:#fff4e6;color:#8c5300;
  border:1px solid #e8c280;box-shadow:var(--mvca-shadow);font-size:.82rem;font-weight:680;align-items:center;gap:9px
}
.stamps-network-banner.visible{display:flex}
.stamps-live-region{position:fixed;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Mobile actions sheet generated from each page's existing action buttons */
.mobile-action-trigger{display:none}
.stamps-action-sheet-overlay{position:fixed;inset:0;background:rgba(5,20,38,.48);backdrop-filter:blur(3px);z-index:1095;opacity:0;visibility:hidden;transition:.2s}
.stamps-action-sheet{
  position:fixed;left:0;right:0;bottom:0;z-index:1100;background:#fff;border-radius:22px 22px 0 0;
  box-shadow:0 -20px 60px rgba(7,26,49,.24);translate:0 110%;transition:translate .24s ease;
  padding:8px 16px calc(16px + var(--stamps-safe-bottom));max-height:min(76dvh,620px);overflow:auto
}
.stamps-action-sheet-overlay.open{opacity:1;visibility:visible}
.stamps-action-sheet.open{translate:0 0}
.action-sheet-handle{width:42px;height:4px;border-radius:999px;background:#cbd5df;margin:4px auto 13px}
.action-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.action-sheet-head strong{font-size:1.02rem;color:var(--mvca-navy-900)}
.action-sheet-head small{display:block;color:var(--mvca-muted);margin-top:2px}
.action-sheet-items{display:grid;gap:8px}
.action-sheet-item{
  width:100%;min-height:54px;border:1px solid var(--mvca-line);background:#fff;border-radius:13px;padding:10px 13px;
  display:grid;grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:11px;color:var(--mvca-ink);text-align:left;text-decoration:none
}
.action-sheet-item:hover,.action-sheet-item:focus{background:#f5fafc;border-color:#a9c6d5;color:var(--mvca-navy-900)}
.action-sheet-item .action-icon{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;background:#eaf5f8;color:var(--mvca-blue-700)}
.action-sheet-item.primary .action-icon{background:linear-gradient(135deg,var(--mvca-navy-800),var(--mvca-blue-600));color:#fff}
.action-sheet-item span:nth-child(2){min-width:0;font-weight:760}
.action-sheet-item small{display:block;color:var(--mvca-muted);font-weight:500;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.action-sheet-close{border:0;background:#eef2f6;width:38px;height:38px;border-radius:10px;color:var(--mvca-navy-900)}

/* Loading skeleton utility applied to existing loading placeholders */
.stamps-skeleton{position:relative;overflow:hidden;color:transparent!important;background:#edf2f7!important;border-radius:9px}
.stamps-skeleton:after{content:"";position:absolute;inset:0;translate:-100% 0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.72),transparent);animation:stamps-shimmer 1.3s infinite}
@keyframes stamps-shimmer{to{translate:100% 0}}

/* Compact desktop enhances information density without shrinking controls too far */
@media (min-width:1200px){
  body[data-density="compact"] .table>:not(caption)>*>*{padding:.64rem .75rem}
  body[data-density="compact"] .filter-bar{gap:9px}
  body[data-density="compact"] .stamps-content{padding-top:22px}
  .page-head.has-many-actions .page-actions{max-width:52%}
}

/* Tablet */
@media (max-width:1199.98px){
  .stamps-content{padding:22px}
  .page-head,.page-heading{align-items:flex-start}
  .page-actions{max-width:52%}
  .quick-actions-panel{width:min(340px,calc(100vw - 24px))}
}

/* Phone and small tablet */
@media (max-width:767.98px){
  html{font-size:16px;scroll-padding-top:72px}
  body{background:#f3f6fa;padding-bottom:calc(var(--stamps-bottom-nav-height) + var(--stamps-safe-bottom))}
  .stamps-topbar{height:58px;min-height:58px}
  .stamps-topbar-inner{height:58px;min-height:58px;padding-inline:8px;gap:5px}
  .brand-link{flex:1;max-width:none;padding:4px 5px;gap:8px}
  .brand-logo{width:36px;height:36px;border-radius:10px}
  .brand-copy{display:none}
  .mobile-page-context{display:block;flex:1}
  .topbar-spacer{display:none}
  .command-trigger{width:40px;height:40px;min-width:40px;padding:0;border-radius:11px}
  .command-trigger span,.command-trigger kbd{display:none}
  .quick-actions-trigger,.topbar-help,.sound-toggle{width:40px;height:40px;min-width:40px}
  .connection-pill{position:absolute;left:50%;translate:-50% 0;top:54px;z-index:5;height:24px;padding:2px 8px;font-size:.66rem;box-shadow:var(--mvca-shadow-sm)}
  .connection-pill:not(.offline){display:none}
  .user-menu-button{width:40px;height:40px;min-width:40px;padding:2px;border-radius:11px}
  .user-avatar{width:34px;height:34px}
  .user-copy,.user-chevron{display:none}
  .stamps-sidebar{width:min(88vw,360px);border-radius:0 22px 22px 0;padding-bottom:var(--stamps-safe-bottom)}
  .sidebar-mobile-head{padding-top:calc(13px + env(safe-area-inset-top,0px))}
  .sidebar-search-wrap{padding-top:4px}
  .stamps-nav-link{min-height:48px;margin-inline:8px}
  .stamps-nav-link i{font-size:1.08rem}
  .stamps-content{padding:15px 12px 24px}
  .stamps-breadcrumb{display:none}
  .page-head,.page-heading{display:block;margin-bottom:15px}
  .page-head h1,.page-heading h1{font-size:1.48rem;margin-bottom:.35rem}
  .page-head p,.page-heading p{font-size:.87rem;line-height:1.52}
  .page-head>.page-actions,.page-heading>.page-actions{margin-top:12px;width:100%;max-width:none;display:flex;overflow-x:auto;flex-wrap:nowrap;justify-content:flex-start;padding-bottom:3px;scrollbar-width:none}
  .page-head>.page-actions::-webkit-scrollbar,.page-heading>.page-actions::-webkit-scrollbar{display:none}
  .page-actions .btn{flex:0 0 auto;min-height:42px}
  body.has-mobile-action-sheet .page-head>.page-actions,body.has-mobile-action-sheet .page-heading>.page-actions{display:none}
  .mobile-action-trigger{
    display:flex;position:fixed;right:14px;bottom:calc(var(--stamps-bottom-nav-height) + var(--stamps-safe-bottom) + 12px);z-index:1040;
    min-height:48px;border:0;border-radius:999px;padding:0 17px;background:linear-gradient(135deg,var(--mvca-navy-800),var(--mvca-blue-600));
    color:#fff;box-shadow:0 12px 28px rgba(11,37,69,.28);align-items:center;gap:8px;font-weight:780
  }
  .mobile-action-trigger:active{transform:translateY(1px)}
  .mobile-bottom-nav{height:calc(var(--stamps-bottom-nav-height) + var(--stamps-safe-bottom));padding-bottom:var(--stamps-safe-bottom);background:rgba(255,255,255,.97);border-top:1px solid #dbe3ec;box-shadow:0 -8px 28px rgba(7,26,49,.09)}
  .mobile-bottom-nav a{min-width:0;color:#65748a}
  .mobile-bottom-nav a.active{color:var(--mvca-blue-700)}
  .mobile-bottom-nav a.active:after{content:"";position:absolute;top:4px;width:20px;height:3px;border-radius:999px;background:var(--mvca-blue-600)}
  .mobile-bottom-nav .mobile-primary-action .mobile-action-icon{background:linear-gradient(135deg,var(--mvca-navy-800),var(--mvca-blue-600));box-shadow:0 8px 20px rgba(11,37,69,.25)}
  .mobile-bottom-nav span{font-size:.65rem}
  .card,.stamps-card{border-radius:15px}
  .stamps-card>.card-body{padding:15px}
  .stamps-card>.card-header{padding:13px 15px;align-items:flex-start!important;flex-wrap:wrap}
  .stamps-card>.card-footer{padding:12px 15px}
  .row.g-4{--bs-gutter-y:1rem;--bs-gutter-x:1rem}
  .row.g-3{--bs-gutter-y:.8rem;--bs-gutter-x:.8rem}
  .filter-toggle-bar{
    width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;border:0;background:transparent;padding:0;
    color:var(--mvca-navy-900);font-weight:800;text-align:left
  }
  .filter-toggle-copy{display:flex;align-items:center;gap:9px}
  .filter-toggle-copy small{display:block;color:var(--mvca-muted);font-weight:500;font-size:.7rem;margin-top:2px}
  .responsive-filter-card>.card-body{padding:13px 15px}
  .responsive-filter-card .filter-bar{display:none;grid-template-columns:1fr;margin-top:14px;padding-top:14px;border-top:1px solid var(--mvca-line)}
  .responsive-filter-card.filters-open .filter-bar{display:grid}
  .responsive-filter-card.filters-open .filter-toggle-bar .bi-chevron-down{rotate:180deg}
  .filter-bar>button,.filter-bar>.btn{width:100%}
  .table-responsive{border-radius:0 0 15px 15px;overflow:visible}
  table.mobile-card-table{display:block;padding:10px;background:#f5f8fb}
  table.mobile-card-table thead{display:none}
  table.mobile-card-table tbody{display:grid;gap:10px}
  table.mobile-card-table tr{display:block;background:#fff;border:1px solid #dbe3ec;border-radius:13px;box-shadow:0 3px 10px rgba(7,26,49,.045);padding:8px 12px}
  table.mobile-card-table tr:hover{background:#fff}
  table.mobile-card-table td{display:grid!important;grid-template-columns:minmax(92px,38%) minmax(0,1fr);gap:10px;padding:8px 0!important;border:0!important;text-align:left!important;min-height:34px;align-items:start;word-break:break-word}
  table.mobile-card-table td+td{border-top:1px solid #edf1f5!important}
  table.mobile-card-table td:before{content:attr(data-label);color:#68778b;font-size:.68rem;font-weight:800;text-transform:uppercase;letter-spacing:.035em;line-height:1.35}
  table.mobile-card-table td[colspan]{display:block!important;text-align:center!important;padding:25px 12px!important}
  table.mobile-card-table td[colspan]:before{display:none}
  table.mobile-card-table td:last-child:not([colspan]){display:flex!important;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap;padding-top:10px!important}
  table.mobile-card-table td:last-child:not([colspan]):before{margin-right:auto}
  table.mobile-card-table td:last-child .btn{flex:0 0 auto}
  table.mobile-card-table .btn-sm{min-height:38px;min-width:38px}
  table.mobile-card-table .dropdown-menu{position:fixed!important;inset:auto 12px calc(var(--stamps-bottom-nav-height) + var(--stamps-safe-bottom) + 12px)!important;transform:none!important;width:auto}
  .modal-dialog{margin:0;min-height:100%;max-width:none}
  .modal-dialog-centered{min-height:100%}
  .modal-content{min-height:100dvh;border-radius:0}
  .modal-header{position:sticky;top:0;z-index:4;padding:13px 15px}
  .modal-body{padding:15px;overscroll-behavior:contain}
  .modal-footer{position:sticky;bottom:0;z-index:4;padding:11px 15px calc(11px + var(--stamps-safe-bottom));gap:8px;flex-wrap:nowrap}
  .modal-footer .btn{flex:1;min-width:0}
  .modal-footer .btn-outline-secondary{max-width:42%}
  .modal-dialog-scrollable{height:100dvh}
  .modal-dialog-scrollable .modal-content{max-height:100dvh}
  .modal-dialog-scrollable .modal-body{max-height:none}
  .command-palette .modal-dialog{min-height:auto;margin:auto 10px}
  .command-palette .modal-content{min-height:0;border-radius:17px;max-height:82dvh}
  .command-footer{display:none}
  .quick-actions-panel{position:fixed!important;left:10px!important;right:10px!important;top:64px!important;width:auto!important;transform:none!important;max-height:calc(100dvh - 90px);overflow:auto}
  .quick-actions-grid a{min-height:80px}
  .stamps-help-drawer{width:100%;border-radius:22px 22px 0 0;top:auto;bottom:0;height:min(88dvh,760px);translate:0 105%}
  .stamps-help-drawer.open{translate:0 0}
  .help-drawer-head{padding-top:16px}
  .stamps-network-banner{top:68px;width:calc(100vw - 20px)}
  .back-to-top{bottom:calc(var(--stamps-bottom-nav-height) + var(--stamps-safe-bottom) + 12px);left:12px;right:auto}
  body.has-mobile-action-sheet .back-to-top{display:none}
  .alert{font-size:.84rem;border-radius:12px}
  input,select,textarea{font-size:16px!important}
}

/* Very narrow phones */
@media (max-width:389.98px){
  .stamps-topbar-inner{gap:2px}
  .brand-logo{width:34px;height:34px}
  .mobile-page-context strong{font-size:.82rem}
  .mobile-page-context small{display:none}
  .quick-actions-trigger,.topbar-help,.command-trigger,.user-menu-button{width:38px;height:38px;min-width:38px}
  .sound-toggle{display:none}
  .stamps-content{padding-inline:9px}
  .page-head h1,.page-heading h1{font-size:1.34rem}
  table.mobile-card-table{padding:8px}
  table.mobile-card-table td{grid-template-columns:82px minmax(0,1fr)}
  .mobile-action-trigger{right:10px;padding-inline:14px}
}

/* Landscape phones: keep actions and content usable */
@media (max-height:520px) and (orientation:landscape){
  .stamps-topbar{position:sticky}
  .mobile-bottom-nav{height:58px;--stamps-bottom-nav-height:58px}
  .mobile-bottom-nav a{flex-direction:row;gap:5px}
  .mobile-bottom-nav .mobile-action-icon{width:34px;height:34px;margin:0}
  .modal-body{padding-block:10px}
  .stamps-action-sheet{max-height:86dvh}
}

/* Respect system accessibility preferences */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}
@media (prefers-contrast:more){
  :root{--mvca-line:#aebac7;--mvca-muted:#455468;--mvca-focus:rgba(0,91,122,.42)}
  .card,.stamps-card,.form-control,.form-select,.btn{border-width:2px}
}
@media print{
  .mobile-action-trigger,.stamps-action-sheet,.stamps-action-sheet-overlay,.stamps-network-banner,.sidebar-search-wrap{display:none!important}
}

/* Dedicated offline screens share the same visual language */
.offline-workspace-body,.offline-attendance-body{background:linear-gradient(180deg,#f8fafc,var(--mvca-canvas));color:var(--mvca-ink)}
.offline-workspace-body .offline-topbar{background:rgba(255,255,255,.94);border-bottom-color:var(--mvca-line)}
.offline-workspace-body .offline-sidebar{border-right-color:var(--mvca-line)}
.offline-workspace-body .offline-card,.offline-workspace-body .offline-gate-card{border-color:var(--mvca-line);box-shadow:var(--mvca-shadow)}
.offline-workspace-body .offline-nav-link.active{background:#eaf5f8;color:var(--mvca-navy-900)}
.offline-workspace-body .offline-statusbar{background:linear-gradient(90deg,var(--mvca-navy-900),var(--mvca-navy-800))}
.offline-attendance-body .attendance-control-card{position:sticky;top:12px;z-index:8}
.offline-attendance-body .sync-counter{border:1px solid var(--mvca-line);background:#fff;border-radius:999px;padding:9px 12px}
@media(max-width:767.98px){
  .offline-workspace-body .offline-topbar{height:58px;padding-inline:9px}
  .offline-workspace-body .offline-brand img{width:38px;height:38px}
  .offline-workspace-body .offline-main{padding-top:58px}
  .offline-workspace-body .offline-sidebar{top:58px;width:min(88vw,350px);border-radius:0 20px 20px 0}
  .offline-workspace-body .offline-overlay{inset:58px 0 0}
  .offline-workspace-body .offline-statusbar{top:58px}
  .offline-workspace-body .offline-view{padding:14px 10px calc(104px + var(--stamps-safe-bottom))}
  .offline-workspace-body .offline-page-head h1{font-size:1.45rem}
  .offline-workspace-body .offline-actions{overflow-x:auto;flex-wrap:nowrap;padding-bottom:3px}
  .offline-workspace-body .offline-actions .btn{flex:0 0 auto}
  .offline-workspace-body .offline-bottom-nav{padding-bottom:calc(6px + var(--stamps-safe-bottom));background:rgba(255,255,255,.97)}
  .offline-attendance-body main.container{padding:12px 9px 34px!important}
  .offline-attendance-body header{position:sticky;top:0;z-index:12;background:rgba(243,246,250,.94);backdrop-filter:blur(12px);margin-inline:-9px;padding:8px 10px;border-bottom:1px solid var(--mvca-line)}
  .offline-attendance-body header img{width:44px;height:44px}
  .offline-attendance-body header .eyebrow{font-size:.62rem}
  .offline-attendance-body header h1{font-size:1.15rem!important}
  .offline-attendance-body .attendance-control-card{position:static}
  .offline-attendance-body .input-group{display:grid;grid-template-columns:auto minmax(0,1fr)}
  .offline-attendance-body .input-group .btn{grid-column:1/-1;margin-top:8px;border-radius:11px!important}
  .offline-attendance-body .attendance-grid{grid-template-columns:1fr}
}
