/* ========================================================================== 
   Hooger HR 3.6.1 — explicit responsive layout system
   Breakpoints:
   Mobile:  0–640px
   Tablet:  641–1024px
   Desktop: 1025px+
   This layer is intentionally last in the cascade.
   ========================================================================== */

:root{
  /* Canonical semantic palette */
  --color-primary:#2563d9;
  --color-primary-hover:#1f52ad;
  --color-primary-soft:#eaf2ff;
  --color-secondary:#0f2a5f;
  --color-secondary-soft:#e9eef8;
  --color-background:#f3f6fb;
  --color-surface:#ffffff;
  --color-surface-subtle:#f7f9fc;
  --color-text:#14213d;
  --color-text-secondary:#47566f;
  --color-text-muted:#718096;
  --color-border:#dbe4f0;
  --color-border-strong:#c7d4e5;
  --color-error:#d7273f;
  --color-error-soft:#ffe9ed;
  --color-success:#07966f;
  --color-success-soft:#e7f8f1;
  --color-warning:#c47a0a;
  --color-warning-soft:#fff3dd;

  /* Typography scale */
  --font-h1:28px;
  --font-h2:22px;
  --font-h3:18px;
  --font-h4:16px;
  --font-h5:15px;
  --font-h6:14px;
  --font-body-lg:16px;
  --font-body:14px;
  --font-body-sm:13px;
  --font-caption:12px;
  --line-heading:1.5;
  --line-body:1.85;

  /* 4/8 spacing scale */
  --space-0:0;
  --space-1:4px;
  --space-2:8px;
  --space-3:12px;
  --space-4:16px;
  --space-5:20px;
  --space-6:24px;
  --space-8:32px;
  --space-10:40px;
  --space-12:48px;

  /* Component geometry */
  --radius-control:12px;
  --radius-card:16px;
  --radius-dialog:20px;
  --radius-pill:999px;
  --shadow-card:0 8px 24px rgba(18,38,72,.06);
  --shadow-floating:0 18px 48px rgba(18,38,72,.16);
  --shadow-focus:0 0 0 3px rgba(37,99,217,.14);
  --control-height:46px;
  --control-height-sm:38px;

  /* Grid system */
  --grid-columns-desktop:12;
  --grid-columns-tablet:8;
  --grid-columns-mobile:4;
  --grid-gap-desktop:24px;
  --grid-gap-tablet:16px;
  --grid-gap-mobile:12px;
  --content-max:1480px;
  --sidebar-width:260px;
  --sidebar-collapsed-width:76px;

  /* Layer system */
  --z-sticky:100;
  --z-sidebar:400;
  --z-bottom-nav:500;
  --z-dropdown:700;
  --z-overlay:800;
  --z-modal:900;
  --z-toast:1000;
}

/* --------------------------------------------------------------------------
   Token bridge: all active components consume the canonical aliases.
   -------------------------------------------------------------------------- */
:root{
  --ds-color-primary-600:var(--color-primary);
  --ds-color-primary-700:var(--color-primary-hover);
  --ds-color-primary-100:var(--color-primary-soft);
  --ds-color-primary-900:var(--color-secondary);
  --ds-color-text:var(--color-text);
  --ds-color-text-soft:var(--color-text-secondary);
  --ds-color-muted:var(--color-text-muted);
  --ds-color-border:var(--color-border);
  --ds-color-border-strong:var(--color-border-strong);
  --ds-color-danger-600:var(--color-error);
  --ds-color-danger-100:var(--color-error-soft);
  --ds-color-success-600:var(--color-success);
  --ds-color-success-100:var(--color-success-soft);
  --ds-color-warning-700:var(--color-warning);
  --ds-color-warning-100:var(--color-warning-soft);
  --ds-color-surface:var(--color-surface);
  --ds-color-surface-soft:var(--color-surface-subtle);
  --ds-color-page:var(--color-background);
  --ds-radius-sm:var(--radius-control);
  --ds-radius-md:var(--radius-card);
  --ds-radius-lg:var(--radius-dialog);
  --ds-radius-pill:var(--radius-pill);
  --ds-shadow-sm:var(--shadow-card);
  --ds-shadow-md:var(--shadow-floating);
  --ds-ring:var(--shadow-focus);
  --ds-control-height:var(--control-height);
  --ds-control-height-sm:var(--control-height-sm);
  --ds-content-max:var(--content-max);
  --ds-space-1:var(--space-1);
  --ds-space-2:var(--space-2);
  --ds-space-3:var(--space-3);
  --ds-space-4:var(--space-4);
  --ds-space-5:var(--space-5);
  --ds-space-6:var(--space-6);
  --ds-space-8:var(--space-8);
  --ds-space-10:var(--space-10);
}

html body{
  background:var(--color-background)!important;
  color:var(--color-text)!important;
  font-size:var(--font-body)!important;
  line-height:var(--line-body)!important;
}
html body h1{font-size:var(--font-h1)!important;line-height:var(--line-heading)!important}
html body h2{font-size:var(--font-h2)!important;line-height:var(--line-heading)!important}
html body h3{font-size:var(--font-h3)!important;line-height:var(--line-heading)!important}
html body h4{font-size:var(--font-h4)!important;line-height:var(--line-heading)!important}
html body h5{font-size:var(--font-h5)!important;line-height:var(--line-heading)!important}
html body h6{font-size:var(--font-h6)!important;line-height:var(--line-heading)!important}
html body small,.caption{font-size:var(--font-caption)!important;line-height:1.7!important}

html body .card{
  border-color:var(--color-border)!important;
  border-radius:var(--radius-card)!important;
  background:var(--color-surface)!important;
  box-shadow:var(--shadow-card)!important;
  padding:var(--space-5)!important;
}
html body .btn,
html body input,
html body select,
html body textarea,
html body .icon-button,
html body .message-shortcut,
html body .menu-toggle{
  border-radius:var(--radius-control)!important;
}
html body .btn{min-block-size:var(--control-height)!important;padding:9px var(--space-4)!important}
html body .btn.small{min-block-size:var(--control-height-sm)!important;padding:7px var(--space-3)!important}
html body .badge{border-radius:var(--radius-pill)!important}
html body :focus-visible{box-shadow:var(--shadow-focus)!important}

/* Containment contract */
html body :where(.card,.filters,.form-grid,.table-wrap,.row-actions,.actions,.page-actions,.form-actions,.stats,.grid){min-inline-size:0!important;max-inline-size:100%!important}
html body :where(.card,.filters,.form-grid,.table-wrap,.stats,.grid)>*{min-inline-size:0!important;max-inline-size:100%!important}
html body :where(.input-with-icon,.filter-search-control,.date-field,.password-wrap,.money-field){inline-size:100%!important;max-inline-size:100%!important;overflow:hidden!important}
html body :where(.input-with-icon,.filter-search-control,.date-field,.password-wrap)>svg,
html body :where(.input-with-icon,.filter-search-control,.date-field,.password-wrap)>.filter-search-icon{
  position:static!important;
  inset:auto!important;
  transform:none!important;
  flex:0 0 auto!important;
  margin:0!important;
}
html body :where(.input-with-icon,.filter-search-control,.date-field,.password-wrap)>input{min-inline-size:0!important;flex:1 1 auto!important}
html body :where(.ds-profile-menu,.dropdown-menu,.jalali-picker,dialog,.modal,.drawer){max-inline-size:calc(100vw - 24px)!important;max-block-size:calc(100dvh - 24px)!important}
html body .ds-profile-menu,html body .dropdown-menu,html body .jalali-picker{z-index:var(--z-dropdown)!important}
html body .mobile-overlay{z-index:var(--z-overlay)!important}
html body dialog,html body .modal,html body .drawer{z-index:var(--z-modal)!important}
html body .flash-stack,html body .toast-stack{z-index:var(--z-toast)!important}

/* Shared semantic grids */
html body .layout-grid{display:grid!important;grid-template-columns:repeat(var(--grid-columns-desktop),minmax(0,1fr))!important;gap:var(--grid-gap-desktop)!important}
html body .grid.two-col,html body .two-col{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--grid-gap-desktop)!important}
html body .grid.three-col,html body .three-col{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:var(--grid-gap-desktop)!important}

/* ==========================================================================
   DESKTOP — 1025px+
   ========================================================================== */
@media screen and (min-width:1025px){
  html body .ds-sidebar{inline-size:var(--sidebar-width)!important;max-inline-size:var(--sidebar-width)!important}
  html body .ds-main{margin-inline-start:var(--sidebar-width)!important;margin-inline-end:0!important}
  html[dir="rtl"] body .ds-main{margin-inline-start:var(--sidebar-width)!important;margin-inline-end:0!important}
  html body.sidebar-collapsed .ds-main,
  html.sidebar-collapsed-preload body .ds-main{margin-inline-start:var(--sidebar-collapsed-width)!important}
  html body .mobile-only-menu-toggle,html body .mobile-bottom-nav{display:none!important}
  html body .ds-collapse{display:flex!important}
  html body .ds-container{padding:var(--space-6) var(--space-6) 56px!important}

  html body .page-head,html body .v355-page-head{display:flex!important;flex-direction:row!important;align-items:flex-start!important;justify-content:space-between!important;gap:var(--space-5)!important}
  html body .page-head>.actions,html body .page-head>.page-actions,html body .v355-page-head>.actions{display:flex!important;flex-wrap:wrap!important;justify-content:flex-start!important;align-items:center!important;inline-size:auto!important}

  /* Dashboard */
  html body.page-dashboard .v333-kpi-strip{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:var(--space-3)!important;overflow:visible!important}
  html body.page-dashboard .v280-quick-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:var(--space-3)!important}
  html body.page-dashboard .v280-dashboard-grid{display:grid!important;grid-template-columns:minmax(0,1.55fr) minmax(320px,.85fr)!important;gap:var(--space-5)!important}
  html body.page-dashboard .v280-bottom-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--space-5)!important}

  /* Employee portal/account */
  html body.page-employee-dashboard .v355-summary-strip{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  html body.page-employee-dashboard .v355-employee-shortcuts{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  html body.page-employee-dashboard .v355-employee-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-account .v355-profile-summary{grid-template-columns:minmax(280px,.9fr) minmax(0,1.5fr)!important}
  html body.page-account .v355-profile-facts{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  html body.page-account .v355-account-grid{grid-template-columns:minmax(0,1.05fr) minmax(360px,.95fr)!important}

  /* Lists and forms */
  html body.page-employees .filters,
  html body.page-activity .filters,
  html body.page-notifications .filters{grid-template-columns:minmax(280px,1fr) auto!important}
  html body.page-employee-form .form-grid,
  html body.page-work .form-grid,
  html body.page-settings .form-grid,
  html body.page-message-form .form-grid,
  html body.page-letter-form .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-employee-form .v351-basis-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html body.page-employee-view .employee-profile-layout,
  html body.page-employee-view .grid.two-col{grid-template-columns:minmax(300px,.8fr) minmax(0,1.6fr)!important}

  /* Work/payroll/reporting */
  html body.page-work .v280-work-kpis{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  html body.page-work .v280-alert-strip{grid-template-columns:minmax(190px,1fr) repeat(4,minmax(150px,1fr))!important}
  html body.page-work .v280-toolbar{grid-template-columns:repeat(4,minmax(140px,1fr)) minmax(260px,1.4fr)!important}
  html body.page-payroll .stats,html body.page-payroll-batch .stats{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  html body.page-accounting-reports .accounting-stats{grid-template-columns:repeat(6,minmax(0,1fr))!important}
  html body.page-accounting-reports .accounting-report-filters{grid-template-columns:170px 190px minmax(300px,1fr) auto!important}

  /* Rations */
  html body.page-rations .ration-item-row{grid-template-columns:minmax(180px,1.4fr) 110px 130px minmax(180px,1fr) 42px!important}
  html body.page-rations .ration-employee-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html body.page-rations .ration-batch-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-ration-view .grid.two-col{grid-template-columns:minmax(0,1fr) minmax(380px,.9fr)!important}

  /* Messaging */
  html body.page-messages .v355-message-toolbar{grid-template-columns:minmax(260px,1fr) auto!important}
  html body.page-messages .v355-message-filters{grid-template-columns:repeat(3,minmax(150px,1fr)) auto!important}
  html body.page-message-view .v293-message-layout{display:grid!important;grid-template-columns:280px minmax(420px,1fr) 320px!important;min-block-size:680px!important}
  html body.page-message-view .v293-message-list-panel,
  html body.page-message-view .v293-thread-panel,
  html body.page-message-view .v293-info-panel{position:relative!important;inset:auto!important;transform:none!important;display:flex!important}

  /* Letters */
  html body.page-letters .v280-letter-kpis{grid-template-columns:repeat(5,minmax(0,1fr))!important}
  html body.page-letters .v280-letter-archive{grid-template-columns:minmax(0,1fr) minmax(280px,.42fr)!important}
  html body.page-letter-form .letter-base-fields,
  html body.page-letter-form .letter-template-fields{grid-template-columns:repeat(2,minmax(0,1fr))!important}

  /* Admin pages */
  html body.page-users .users-layout{grid-template-columns:minmax(0,1.5fr) minmax(300px,.7fr)!important}
  html body.page-settings .settings-grid,
  html body.page-backup .backup-grid,
  html body.page-updates .updates-grid,
  html body.page-system-health .health-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-system-health .health-check-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* ==========================================================================
   TABLET — 641px–1024px
   Sidebar becomes a drawer; no desktop collapse and no bottom navigation.
   ========================================================================== */
@media screen and (min-width:641px) and (max-width:1024px){
  html body .ds-main,html body.sidebar-collapsed .ds-main,html.sidebar-collapsed-preload body .ds-main{margin-inline:0!important}
  html body .ds-sidebar{
    position:fixed!important;
    inset-block:0!important;
    inset-inline-start:auto!important;
    inset-inline-end:0!important;
    inline-size:min(340px,82vw)!important;
    max-inline-size:min(340px,82vw)!important;
    transform:translateX(110%)!important;
    visibility:hidden!important;
    transition:transform .2s ease,visibility .2s ease!important;
    z-index:var(--z-sidebar)!important;
  }
  html body .ds-sidebar.open{transform:translateX(0)!important;visibility:visible!important}
  html body .mobile-overlay:not([hidden]){display:block!important;position:fixed!important;inset:0!important;background:rgba(13,30,60,.42)!important;border:0!important}
  html body .ds-collapse{display:none!important}
  html body .mobile-only-menu-toggle{display:grid!important}
  html body .mobile-bottom-nav{display:none!important}
  html body .ds-container{padding:var(--space-5) var(--space-5) 48px!important}
  html body .ds-topbar{display:grid!important;grid-template-columns:44px minmax(0,1fr) auto!important;align-items:center!important;gap:var(--space-3)!important;padding-inline:var(--space-5)!important}
  html body .ds-top-actions .date-chip{display:none!important}
  html body .ds-profile{max-inline-size:190px!important}

  html body .page-head,html body .v355-page-head{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:start!important;gap:var(--space-4)!important}
  html body .page-head>.actions,html body .page-head>.page-actions,html body .v355-page-head>.actions{display:grid!important;grid-template-columns:repeat(2,minmax(130px,1fr))!important;align-self:start!important}

  html body .layout-grid{grid-template-columns:repeat(var(--grid-columns-tablet),minmax(0,1fr))!important;gap:var(--grid-gap-tablet)!important}
  html body .grid.two-col,html body .two-col{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--grid-gap-tablet)!important}

  /* Dashboard */
  html body.page-dashboard .v333-kpi-strip{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:var(--space-3)!important}
  html body.page-dashboard .v280-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-dashboard .v280-dashboard-grid,
  html body.page-dashboard .v280-bottom-grid{grid-template-columns:1fr!important}

  /* Employee/account */
  html body.page-employee-dashboard .v355-summary-strip{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-employee-dashboard .v355-employee-shortcuts{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-employee-dashboard .v355-employee-grid{grid-template-columns:1fr!important}
  html body.page-account .v355-profile-summary{grid-template-columns:1fr!important}
  html body.page-account .v355-profile-facts{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  html body.page-account .v355-account-grid{grid-template-columns:1fr!important}
  html body.page-account .v355-security-list{grid-template-columns:repeat(3,minmax(0,1fr))!important}

  /* Forms/filter bars */
  html body .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--space-3)!important}
  html body .filters{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--space-3)!important}
  html body .filters>.grow{grid-column:1/-1!important}
  html body .filters>.btn,html body .filters>.form-actions{grid-column:auto!important}
  html body.page-employee-form .v351-basis-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html body.page-employee-view .grid.two-col{grid-template-columns:1fr!important}

  /* Work/payroll/reporting */
  html body.page-work .v280-work-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-work .v280-alert-strip{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-work .v280-alert-title{grid-column:1/-1!important}
  html body.page-work .v280-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-work .v280-toolbar .grow{grid-column:1/-1!important}
  html body.page-payroll .stats,html body.page-payroll-batch .stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-accounting-reports .accounting-stats{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html body.page-accounting-reports .accounting-report-filters{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-accounting-reports .filter-search,
  html body.page-accounting-reports .report-filter-actions{grid-column:1/-1!important}

  /* Rations */
  html body.page-rations .ration-item-row{grid-template-columns:repeat(2,minmax(0,1fr)) 42px!important}
  html body.page-rations .ration-item-row>label:first-child{grid-column:1/-1!important}
  html body.page-rations .ration-item-row>button{grid-column:3!important;grid-row:2!important}
  html body.page-rations .ration-employee-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-rations .ration-batch-grid{grid-template-columns:1fr!important}
  html body.page-ration-view .grid.two-col{grid-template-columns:1fr!important}

  /* Messages */
  html body.page-messages .v355-message-toolbar{grid-template-columns:1fr!important}
  html body.page-messages .v355-message-filters{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-messages .v355-filter-submit{grid-column:1/-1!important}
  html body.page-message-view .v293-message-layout{display:grid!important;grid-template-columns:300px minmax(0,1fr)!important}
  html body.page-message-view .v293-info-panel{position:fixed!important;inset-block:0!important;inset-inline-start:0!important;inline-size:min(360px,80vw)!important;transform:translateX(-110%)!important;z-index:var(--z-modal)!important}
  html body.page-message-view .v293-info-panel.open{transform:translateX(0)!important}

  /* Letters/admin */
  html body.page-letters .v280-letter-kpis{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html body.page-letters .v280-letter-archive{grid-template-columns:1fr!important}
  html body.page-letter-form .letter-base-fields,
  html body.page-letter-form .letter-template-fields{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-users .permission-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-system-health .health-check-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* ==========================================================================
   MOBILE — 0–640px
   Drawer + bottom navigation, section-level stacks/carousels/accordions.
   ========================================================================== */
@media screen and (max-width:640px){
  :root{
    --font-h1:23px;
    --font-h2:19px;
    --font-h3:17px;
    --font-body:14px;
    --grid-gap-mobile:12px;
  }
  html body{padding-block-end:calc(76px + env(safe-area-inset-bottom))!important}
  html body .ds-main,html body.sidebar-collapsed .ds-main,html.sidebar-collapsed-preload body .ds-main{margin-inline:0!important}
  html body .ds-sidebar{
    position:fixed!important;
    inset-block:0!important;
    inset-inline-start:auto!important;
    inset-inline-end:0!important;
    inline-size:min(330px,88vw)!important;
    max-inline-size:min(330px,88vw)!important;
    transform:translateX(110%)!important;
    visibility:hidden!important;
    transition:transform .2s ease,visibility .2s ease!important;
    z-index:var(--z-sidebar)!important;
  }
  html body .ds-sidebar.open{transform:translateX(0)!important;visibility:visible!important}
  html body .mobile-overlay:not([hidden]){display:block!important;position:fixed!important;inset:0!important;background:rgba(13,30,60,.42)!important;border:0!important}
  html body .ds-collapse{display:none!important}
  html body .mobile-only-menu-toggle{display:grid!important}
  html body .mobile-bottom-nav{
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    position:fixed!important;
    inset-inline:0!important;
    inset-block-end:0!important;
    z-index:var(--z-bottom-nav)!important;
    min-block-size:70px!important;
    padding:6px 6px calc(6px + env(safe-area-inset-bottom))!important;
    border-block-start:1px solid var(--color-border)!important;
    background:rgba(255,255,255,.98)!important;
    box-shadow:0 -10px 28px rgba(18,38,72,.10)!important;
    backdrop-filter:blur(14px)!important;
  }
  html body .mobile-bottom-nav a{min-inline-size:0!important;min-block-size:56px!important;padding:5px 2px!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:3px!important;border-radius:10px!important;font-size:11px!important;line-height:1.25!important;white-space:nowrap!important;overflow:hidden!important}
  html body .mobile-bottom-nav a span{max-inline-size:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}

  html body .ds-container{padding:var(--space-4) var(--space-3) 32px!important}
  html body .footer-note{display:none!important}
  html body .ds-topbar{display:grid!important;grid-template-columns:42px minmax(0,1fr) auto!important;align-items:center!important;gap:var(--space-2)!important;min-block-size:64px!important;padding:8px var(--space-3)!important}
  html body .ds-page-title strong{font-size:14px!important}
  html body .ds-top-actions{display:flex!important;gap:6px!important}
  html body .ds-top-actions .date-chip,html body .ds-profile{display:none!important}
  html body .message-shortcut{inline-size:40px!important;min-inline-size:40px!important;block-size:40px!important;min-block-size:40px!important}

  html body .layout-grid{grid-template-columns:repeat(var(--grid-columns-mobile),minmax(0,1fr))!important;gap:var(--grid-gap-mobile)!important}
  html body .grid.two-col,html body .two-col,html body .grid.three-col,html body .three-col{grid-template-columns:1fr!important;gap:var(--grid-gap-mobile)!important}

  /* Page header becomes a content stack; action controls use an explicit grid. */
  html body .page-head,html body .v355-page-head{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:var(--space-3)!important;margin-block-end:var(--space-4)!important}
  html body .page-head>div:first-child,html body .v355-page-head>div:first-child{max-inline-size:none!important}
  html body .page-head>.actions,html body .page-head>.page-actions,html body .v355-page-head>.actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    inline-size:100%!important;
    gap:var(--space-2)!important;
  }
  html body .page-head>.actions:has(> :only-child),html body .page-head>.page-actions:has(> :only-child){grid-template-columns:1fr!important}
  html body .page-head>.actions .btn,html body .page-head>.page-actions .btn,html body .page-head>.actions form,html body .page-head>.page-actions form{inline-size:100%!important}
  html body .page-head>.actions form .btn,html body .page-head>.page-actions form .btn{inline-size:100%!important}

  html body .card{padding:var(--space-4)!important;border-radius:14px!important}
  html body .card-head,html body .section-title-row{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:var(--space-2)!important}
  html body .card-head>.btn,html body .section-title-row>.btn{inline-size:100%!important}
  html body .form-grid{grid-template-columns:1fr!important;gap:var(--space-3)!important}
  html body .form-grid>.full{grid-column:auto!important}
  html body .filters{display:grid!important;grid-template-columns:1fr!important;gap:var(--space-3)!important;padding:var(--space-4)!important}
  html body .filters>*{grid-column:auto!important}
  html body .filters>.btn,html body .filters>.form-actions{inline-size:100%!important}
  html body .filters>.btn{justify-content:center!important}
  html body .form-actions,html body .row-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;inline-size:100%!important;gap:var(--space-2)!important}
  html body .form-actions .btn,html body .row-actions .btn,html body .row-actions form,html body .row-actions form .btn{inline-size:100%!important;justify-content:center!important}
  html body .form-actions:has(> :only-child),html body .row-actions:has(> :only-child){grid-template-columns:1fr!important}

  /* Dashboard: KPI carousel + 2x2 shortcuts + vertically stacked content sections. */
  html body.page-dashboard .v333-kpi-strip,
  html body.page-dashboard .v280-kpis,
  html body.page-work .v280-work-kpis,
  html body.page-payroll-batch .stats{
    display:grid!important;
    grid-auto-flow:column!important;
    grid-auto-columns:minmax(250px,84vw)!important;
    grid-template-columns:none!important;
    gap:var(--space-3)!important;
    overflow-x:auto!important;
    scroll-snap-type:x mandatory!important;
    overscroll-behavior-inline:contain!important;
    padding-block-end:4px!important;
  }
  html body.page-dashboard .v333-kpi-strip>* ,
  html body.page-dashboard .v280-kpis>* ,
  html body.page-work .v280-work-kpis>* ,
  html body.page-payroll-batch .stats>*{scroll-snap-align:start!important}
  html body.page-dashboard .v280-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--space-2)!important}
  html body.page-dashboard .v280-dashboard-grid,html body.page-dashboard .v280-bottom-grid{grid-template-columns:1fr!important;gap:var(--space-3)!important}
  html body.page-dashboard .v351-flow-steps{display:grid!important;grid-template-columns:1fr!important}

  /* Employee portal/profile */
  html body.page-employee-dashboard .v355-summary-strip{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-employee-dashboard .v355-employee-shortcuts{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-employee-dashboard .v355-employee-grid{grid-template-columns:1fr!important}
  html body.page-account .v355-profile-summary{grid-template-columns:1fr!important;padding:var(--space-4)!important}
  html body.page-account .v355-profile-facts{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-account .v355-account-grid,html body.page-account .v355-security-list{grid-template-columns:1fr!important}
  html body.page-account .v355-password-fields{grid-template-columns:1fr!important}
  html body.page-account .v355-pwa-actions{grid-template-columns:1fr!important}

  /* Employees and forms */
  html body.page-employees .responsive-table,
  html body.page-users .responsive-table,
  html body.page-activity .responsive-table,
  html body.page-notifications .responsive-table,
  html body.page-backup .responsive-table,
  html body.page-payroll .responsive-table,
  html body.page-accounting-reports .responsive-table,
  html body.page-work .responsive-table{min-inline-size:0!important}
  html body.page-employee-form .v351-form-progress{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-employee-form .v351-basis-grid{grid-template-columns:1fr!important}
  html body.page-employee-view .employee-tabs,html body.page-employee-view .tabs{display:flex!important;overflow-x:auto!important;flex-wrap:nowrap!important;scroll-snap-type:x proximity!important}
  html body.page-employee-view .employee-tabs>a,html body.page-employee-view .tabs>a{flex:0 0 auto!important;scroll-snap-align:start!important}
  html body.page-employee-view .grid.two-col{grid-template-columns:1fr!important}

  /* Work: KPI carousel, alert accordion-like stack, form details retained. */
  html body.page-work .v280-alert-strip{display:grid!important;grid-template-columns:1fr!important;gap:var(--space-2)!important}
  html body.page-work .v280-toolbar{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--space-2)!important}
  html body.page-work .v280-toolbar .grow,html body.page-work .v280-toolbar-actions{grid-column:1/-1!important}
  html body.page-work .v280-toolbar-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-work .v351-work-path-steps{grid-template-columns:1fr!important}
  html body.page-work .advanced-fields>summary{min-block-size:48px!important}

  /* Payroll/reporting */
  html body.page-payroll .stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-payroll .simple-flow{display:grid!important;grid-template-columns:1fr!important}
  html body.page-payroll-batch .reconciliation-grid{grid-template-columns:1fr!important}
  html body.page-accounting-reports .accounting-stats{display:grid!important;grid-template-columns:1fr!important;gap:var(--space-2)!important;overflow:visible!important}
  html body.page-accounting-reports .accounting-stats .stat-card{display:grid!important;grid-template-columns:44px minmax(0,1fr)!important;min-block-size:72px!important;padding:10px 12px!important}
  html body.page-accounting-reports .accounting-stats .stat-card>div{display:grid!important;grid-template-columns:minmax(100px,1fr) auto!important;align-items:center!important;gap:6px!important}
  html body.page-accounting-reports .accounting-stats .stat-card>div>span{grid-column:1!important;grid-row:1!important;white-space:nowrap!important}
  html body.page-accounting-reports .accounting-stats .stat-card>div>strong{grid-column:2!important;grid-row:1!important;white-space:nowrap!important}
  html body.page-accounting-reports .accounting-stats .stat-card>div>small{grid-column:1/-1!important;grid-row:2!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  html body.page-accounting-reports .accounting-report-filters{grid-template-columns:1fr!important}
  html body.page-accounting-reports .report-filter-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}

  /* Rations: form sections are vertical, recipients are one-column, records are cards. */
  html body.page-rations .ration-section-head{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:var(--space-2)!important}
  html body.page-rations .ration-selection-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-rations .ration-item-row{display:grid!important;grid-template-columns:1fr 1fr!important;gap:var(--space-2)!important}
  html body.page-rations .ration-item-row>label:first-child,html body.page-rations .ration-item-row>label:last-of-type{grid-column:1/-1!important}
  html body.page-rations .ration-item-row>[data-remove-ration-item]{grid-column:1/-1!important;inline-size:100%!important}
  html body.page-rations .ration-employee-grid,html body.page-rations .ration-batch-grid{grid-template-columns:1fr!important}
  html body.page-ration-view .grid.two-col{grid-template-columns:1fr!important}
  html body.page-ration-view .ration-recipient-row{grid-template-columns:42px minmax(0,1fr) auto!important}
  html body.page-ration-view .ration-recipient-row>form{grid-column:1/-1!important}
  html body.page-ration-view .ration-recipient-row>form .btn{inline-size:100%!important}

  /* Messages: single-pane mobile app pattern. */
  html body.page-messages .v355-messages-card{padding:0!important;overflow:hidden!important}
  html body.page-messages .v355-message-toolbar{grid-template-columns:1fr!important;padding:var(--space-3)!important}
  html body.page-messages .v355-message-filters{grid-template-columns:1fr!important}
  html body.page-messages .v355-message-tabs{display:flex!important;grid-template-columns:none!important;overflow-x:auto!important;flex-wrap:nowrap!important;scroll-snap-type:x proximity!important}
  html body.page-messages .v355-message-tabs>a{flex:0 0 auto!important;min-inline-size:112px!important;scroll-snap-align:start!important}
  html body.page-message-view .v293-message-layout{display:block!important;min-block-size:auto!important}
  html body.page-message-view .v293-message-list-panel,
  html body.page-message-view .v293-info-panel{position:fixed!important;inset-block:0!important;inset-inline-end:0!important;inline-size:min(340px,88vw)!important;transform:translateX(110%)!important;z-index:var(--z-modal)!important;background:var(--color-surface)!important}
  html body.page-message-view .v293-message-list-panel.open,
  html body.page-message-view .v293-info-panel.open{transform:translateX(0)!important}
  html body.page-message-view .v293-thread-panel{display:flex!important;inline-size:100%!important}
  html body.page-message-view .v293-thread-toolbar{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--space-2)!important}
  html body.page-message-view .v293-thread-toolbar>*{min-inline-size:0!important}
  html body.page-message-view .v293-message-bubble{max-inline-size:92%!important}

  /* Letters: KPI carousel, archive cards, form sections stack. */
  html body.page-letters .v280-letter-kpis{display:grid!important;grid-auto-flow:column!important;grid-auto-columns:minmax(240px,82vw)!important;grid-template-columns:none!important;overflow-x:auto!important;scroll-snap-type:x mandatory!important}
  html body.page-letters .v280-letter-kpis>*{scroll-snap-align:start!important}
  html body.page-letters .v280-letter-archive{grid-template-columns:1fr!important}
  html body.page-letter-form .letter-base-fields,html body.page-letter-form .letter-template-fields{grid-template-columns:1fr!important}
  html body.page-letter-form .letter-template-selector{overflow-x:auto!important}

  /* Administrative pages */
  html body.page-users .permission-grid,html body.page-users .permission-switches{grid-template-columns:1fr!important}
  html body.page-settings .settings-grid,
  html body.page-backup .backup-grid,
  html body.page-updates .updates-grid,
  html body.page-system-health .health-grid,
  html body.page-system-health .health-check-grid{grid-template-columns:1fr!important}
  html body.page-updates .update-summary-strip{grid-template-columns:1fr!important}
  html body.page-updates .update-process{display:grid!important;grid-template-columns:1fr!important}
  html body.page-system-health .health-check-item{grid-template-columns:38px minmax(0,1fr)!important}
  html body.page-system-health .health-check-item>.badge{grid-column:2!important;justify-self:start!important}

  /* Dialog becomes bottom sheet on mobile. */
  html body dialog{
    inline-size:100%!important;
    max-inline-size:100%!important;
    max-block-size:min(88dvh,760px)!important;
    margin:auto 0 0!important;
    border-radius:20px 20px 0 0!important;
  }
}

@media screen and (max-width:420px){
  html body .page-head>.actions,html body .page-head>.page-actions,html body .v355-page-head>.actions,
  html body .form-actions,html body .row-actions,
  html body.page-work .v280-toolbar,
  html body.page-work .v280-toolbar-actions,
  html body.page-accounting-reports .report-filter-actions{grid-template-columns:1fr!important}
  html body.page-dashboard .v280-quick-grid,
  html body.page-employee-dashboard .v355-summary-strip,
  html body.page-employee-dashboard .v355-employee-shortcuts,
  html body.page-account .v355-profile-facts,
  html body.page-payroll .stats{grid-template-columns:1fr!important}
}

@media print{
  html body .ds-sidebar,html body .ds-topbar,html body .mobile-bottom-nav,html body .mobile-overlay{display:none!important}
  html body .ds-main{margin:0!important}
  html body{padding:0!important;background:#fff!important}
}

/* ========================================================================== 
   Reviewer corrections after browser render pass
   ========================================================================== */

/* Responsive table cards release legacy table geometry completely. */
@media screen and (max-width:1024px){
  html body .responsive-table,
  html body .responsive-table tbody,
  html body .responsive-table tr,
  html body .responsive-table td{inline-size:100%!important;max-inline-size:100%!important;min-inline-size:0!important}
  html body .responsive-table td.actions-cell{display:block!important;overflow:visible!important;padding-block-start:var(--space-3)!important}
  html body .responsive-table td.actions-cell .row-actions{inline-size:100%!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .responsive-table td.actions-cell .row-actions>*{inline-size:100%!important;min-inline-size:0!important}
  html body .responsive-table td.actions-cell .row-actions .btn{inline-size:100%!important}
}

/* Financial values need legible tracks, not six compressed cards. */
@media screen and (min-width:1025px){
  html body.page-accounting-reports .accounting-stats{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html body.page-accounting-reports .accounting-stats .stat-card{min-block-size:112px!important}
  html body.page-accounting-reports .accounting-stats .money-display{white-space:nowrap!important}
}
@media screen and (min-width:641px) and (max-width:1024px){
  html body.page-accounting-reports .accounting-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-accounting-reports .accounting-stats .money-display{white-space:nowrap!important}
}

/* Conversation centre must remain a vertical application panel. */
@media screen and (min-width:1025px){
  html body.page-message-view .v293-thread-panel{
    display:grid!important;
    grid-template-rows:auto auto minmax(0,1fr) auto!important;
    min-inline-size:0!important;
    inline-size:100%!important;
    overflow:hidden!important;
  }
  html body.page-message-view .v293-thread-toolbar,
  html body.page-message-view .v293-thread-subject,
  html body.page-message-view .v293-thread-scroll,
  html body.page-message-view .v293-composer{inline-size:100%!important;min-inline-size:0!important;max-inline-size:100%!important}
  html body.page-message-view .v293-thread-scroll{overflow-y:auto!important;overflow-x:hidden!important}
  html body.page-message-view .v293-message-bubble{inline-size:100%!important;max-inline-size:100%!important}
  html body.page-message-view .v293-bubble-card{inline-size:auto!important;max-inline-size:min(78%,720px)!important;min-inline-size:220px!important}
}
@media screen and (min-width:641px) and (max-width:1024px){
  html body.page-message-view .v293-thread-panel{
    display:grid!important;
    grid-template-rows:auto auto minmax(0,1fr) auto!important;
    min-inline-size:0!important;
    overflow:hidden!important;
  }
  html body.page-message-view .v293-thread-scroll{overflow-y:auto!important;overflow-x:hidden!important}
}
@media screen and (max-width:640px){
  html body.page-message-view .v293-thread-panel{
    display:grid!important;
    grid-template-rows:auto auto minmax(0,1fr) auto!important;
    min-inline-size:0!important;
    overflow:hidden!important;
  }
  html body.page-message-view .v293-thread-scroll{overflow-y:auto!important;overflow-x:hidden!important}
  html body.page-message-view .v293-message-bubble{inline-size:100%!important;max-inline-size:100%!important}
  html body.page-message-view .v293-bubble-card{inline-size:auto!important;max-inline-size:calc(100% - 42px)!important;min-inline-size:0!important}
}

/* Payroll cards and actions stay inside each mobile record. */
@media screen and (max-width:640px){
  html body.page-payroll .table-wrap{overflow:visible!important}
  html body.page-payroll .responsive-table,
  html body.page-payroll .responsive-table tbody,
  html body.page-payroll .responsive-table tr,
  html body.page-payroll .responsive-table td{display:block!important;inline-size:100%!important;max-inline-size:100%!important;min-inline-size:0!important}
  html body.page-payroll .responsive-table tr{margin-block-end:var(--space-3)!important;padding:var(--space-3)!important;border:1px solid var(--color-border)!important;border-radius:var(--radius-card)!important;background:var(--color-surface)!important;overflow:hidden!important}
  html body.page-payroll .responsive-table td{display:grid!important;grid-template-columns:minmax(90px,.75fr) minmax(0,1.25fr)!important;gap:var(--space-2)!important;padding:8px 0!important;border-block-end:1px dashed var(--color-border)!important;overflow:hidden!important}
  html body.page-payroll .responsive-table td::before{min-inline-size:0!important;white-space:nowrap!important}
  html body.page-payroll .responsive-table td.actions-cell{display:block!important;border-block-end:0!important;padding-block-start:var(--space-3)!important}
  html body.page-payroll .responsive-table td.actions-cell .row-actions{display:grid!important;grid-template-columns:1fr!important;gap:var(--space-2)!important}
}

@media screen and (max-width:640px){
  html body.page-message-view .v293-thread-toolbar{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:var(--space-2)!important;
    padding:var(--space-2)!important;
  }
  html body.page-message-view .v293-toolbar-start,
  html body.page-message-view .v293-toolbar-end{display:contents!important}
  html body.page-message-view .v293-thread-toolbar :where(.btn,.v293-mobile-pane-button,form){
    inline-size:100%!important;
    min-inline-size:0!important;
    max-inline-size:100%!important;
    min-block-size:44px!important;
    block-size:44px!important;
    margin:0!important;
  }
  html body.page-message-view .v293-thread-toolbar form .btn{inline-size:100%!important;block-size:44px!important}
  html body.page-message-view .v293-thread-toolbar :where(.btn,.v293-mobile-pane-button){
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:center!important;
    gap:5px!important;
    padding-inline:7px!important;
    font-size:12px!important;
    line-height:1.2!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  html body.page-message-view .v293-thread-toolbar :where(.btn,.v293-mobile-pane-button)>span{min-inline-size:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
}

/* ========================================================================== 
   v3.6.1 reviewer closure — section-specific responsive corrections
   ========================================================================== */

/* Dashboard: one dominant operational panel plus two compact information cards. */
@media screen and (min-width:1025px){
  html body.page-dashboard .v280-bottom-grid{
    display:grid!important;
    grid-template-columns:minmax(0,2fr) minmax(220px,1fr) minmax(220px,1fr)!important;
    align-items:stretch!important;
    gap:var(--space-4)!important;
  }
  html body.page-dashboard .v280-bottom-grid>*{min-inline-size:0!important}
  html body.page-dashboard .v280-bottom-grid .card-head{
    min-inline-size:0!important;
    align-items:flex-start!important;
  }
  html body.page-dashboard .v280-bottom-grid .card-head :where(h2,p){
    max-inline-size:100%!important;
    overflow-wrap:anywhere!important;
  }
}

/* Responsive table actions: legacy absolute/offset rules must never escape cards. */
@media screen and (max-width:640px){
  html body .responsive-table td.actions-cell{
    position:static!important;
    inset:auto!important;
    inset-inline:auto!important;
    inset-block:auto!important;
    transform:none!important;
    float:none!important;
    display:block!important;
    inline-size:100%!important;
    max-inline-size:100%!important;
    min-inline-size:0!important;
    overflow:visible!important;
    margin:0!important;
  }
  html body .responsive-table td.actions-cell .row-actions{
    position:static!important;
    inset:auto!important;
    transform:none!important;
    float:none!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    inline-size:100%!important;
    max-inline-size:100%!important;
    min-inline-size:0!important;
    margin:0!important;
    gap:var(--space-2)!important;
  }
  html body .responsive-table td.actions-cell .row-actions>*{
    position:static!important;
    inset:auto!important;
    transform:none!important;
    float:none!important;
    inline-size:100%!important;
    max-inline-size:100%!important;
    min-inline-size:0!important;
    margin:0!important;
  }
  html body .responsive-table td.actions-cell .row-actions :where(.btn,button,a){
    position:static!important;
    inset:auto!important;
    transform:none!important;
    inline-size:100%!important;
    max-inline-size:100%!important;
    min-inline-size:0!important;
    justify-content:center!important;
  }
  html body .responsive-table td.actions-cell .row-actions:has(>:only-child){
    grid-template-columns:1fr!important;
  }
}

/* Payroll batch: mobile is a sequence of readable task cards, not a scaled desktop sheet. */
@media screen and (max-width:640px){
  html body.page-payroll-batch :where(.card,.issue-box,.payment-readiness,.payment-ready-card,.reconciliation-card){
    min-inline-size:0!important;
    max-inline-size:100%!important;
    overflow:hidden!important;
  }
  html body.page-payroll-batch :where(.issue-box,.payment-readiness,.payment-ready-card) {
    display:block!important;
    inline-size:100%!important;
    padding:var(--space-3)!important;
  }
  html body.page-payroll-batch :where(.issue-box,.payment-readiness,.payment-ready-card)>*{
    min-inline-size:0!important;
    max-inline-size:100%!important;
  }
  html body.page-payroll-batch :where(.issue-box,.payment-readiness,.payment-ready-card) :where(h2,h3,strong,p,span){
    max-inline-size:100%!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
  }
  html body.page-payroll-batch .form-grid,
  html body.page-payroll-batch .grid.two-col,
  html body.page-payroll-batch .reconciliation-grid{
    grid-template-columns:1fr!important;
  }
  html body.page-payroll-batch .form-actions,
  html body.page-payroll-batch .page-actions{
    grid-template-columns:1fr!important;
  }
}

/* Final specificity overrides for legacy high-specificity rules. */
@media screen and (min-width:1025px){
  html body.page-dashboard .v280-bottom-grid{
    grid-template-columns:minmax(0,1.45fr) minmax(250px,.9fr) minmax(320px,1.15fr)!important;
  }
  html body.page-dashboard .v280-bottom-grid>article:nth-child(1){grid-column:1!important}
  html body.page-dashboard .v280-bottom-grid>article:nth-child(2){grid-column:2!important}
  html body.page-dashboard .v280-bottom-grid>article:nth-child(3){grid-column:3!important}
  html body.page-dashboard .v280-bottom-grid>article:nth-child(3) .v280-quick-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:var(--space-2)!important;
  }
  html body.page-dashboard .v280-bottom-grid>article:nth-child(3) .v280-quick{
    min-inline-size:0!important;
    inline-size:100%!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
}

@media screen and (max-width:640px){
  html body:is(.page-work,.page-letters) .responsive-table td:last-child{
    position:static!important;
    inset:auto!important;
    transform:none!important;
    display:block!important;
    grid-column:1/-1!important;
    inline-size:100%!important;
    max-inline-size:100%!important;
    min-inline-size:0!important;
    overflow:visible!important;
    padding-block-start:var(--space-3)!important;
  }
  html body:is(.page-work,.page-letters) .responsive-table td:last-child .row-actions{
    position:static!important;
    inset:auto!important;
    transform:none!important;
    float:none!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    inline-size:100%!important;
    max-inline-size:100%!important;
    min-inline-size:0!important;
    overflow:visible!important;
    direction:rtl!important;
    gap:var(--space-2)!important;
  }
  html body:is(.page-work,.page-letters) .responsive-table td:last-child .row-actions>form{
    display:block!important;
    position:static!important;
    inset:auto!important;
    transform:none!important;
    float:none!important;
    inline-size:100%!important;
    max-inline-size:100%!important;
    min-inline-size:0!important;
    margin:0!important;
  }
  html body:is(.page-work,.page-letters) .responsive-table td:last-child .row-actions>:where(a,button),
  html body:is(.page-work,.page-letters) .responsive-table td:last-child .row-actions>form>.btn{
    display:flex!important;
    position:static!important;
    inset:auto!important;
    transform:none!important;
    inline-size:100%!important;
    max-inline-size:100%!important;
    min-inline-size:0!important;
    margin:0!important;
    justify-content:center!important;
  }
  html body.page-payroll-batch .payment-panel-head{
    display:grid!important;
    grid-template-columns:1fr!important;
    inline-size:100%!important;
    max-inline-size:100%!important;
    gap:var(--space-2)!important;
  }
  html body.page-payroll-batch .payment-panel-head>span{display:none!important}
  html body.page-payroll-batch .payment-panel-head>div,
  html body.page-payroll-batch .payment-panel-head>strong{
    grid-column:1!important;
    inline-size:100%!important;
    max-inline-size:100%!important;
    min-inline-size:0!important;
    justify-self:stretch!important;
  }
  html body.page-payroll-batch .payment-panel-head>div :where(h2,p){
    inline-size:100%!important;
    max-inline-size:100%!important;
    min-inline-size:0!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
}
