/* Hooger HR 3.6.0 — unified responsive design system and containment layer */

:root{
  --ds-color-primary-900:#0f2a5f;
  --ds-color-primary-800:#173a7a;
  --ds-color-primary-700:#1f52ad;
  --ds-color-primary-600:#2563d9;
  --ds-color-primary-500:#3478ed;
  --ds-color-primary-100:#eaf2ff;
  --ds-color-primary-050:#f5f8ff;
  --ds-color-danger-700:#bc1e35;
  --ds-color-danger-600:#d7273f;
  --ds-color-danger-100:#ffe9ed;
  --ds-color-success-700:#08795d;
  --ds-color-success-600:#07966f;
  --ds-color-success-100:#e7f8f1;
  --ds-color-warning-700:#9b5c08;
  --ds-color-warning-100:#fff3dd;
  --ds-color-text:#14213d;
  --ds-color-text-soft:#47566f;
  --ds-color-muted:#718096;
  --ds-color-border:#dbe4f0;
  --ds-color-border-strong:#c7d4e5;
  --ds-color-surface:#ffffff;
  --ds-color-surface-soft:#f7f9fc;
  --ds-color-page:#f3f6fb;

  --ds-space-1:4px;
  --ds-space-2:8px;
  --ds-space-3:12px;
  --ds-space-4:16px;
  --ds-space-5:20px;
  --ds-space-6:24px;
  --ds-space-8:32px;
  --ds-space-10:40px;

  --ds-radius-xs:8px;
  --ds-radius-sm:12px;
  --ds-radius-md:16px;
  --ds-radius-lg:20px;
  --ds-radius-pill:999px;

  --ds-shadow-xs:0 2px 8px rgba(18,38,72,.045);
  --ds-shadow-sm:0 8px 24px rgba(18,38,72,.06);
  --ds-shadow-md:0 14px 38px rgba(18,38,72,.085);
  --ds-ring:0 0 0 3px rgba(37,99,217,.14);

  --ds-control-height:46px;
  --ds-control-height-sm:38px;
  --ds-content-max:1480px;

  --ds-z-base:0;
  --ds-z-sticky:100;
  --ds-z-sidebar:300;
  --ds-z-bottom-nav:400;
  --ds-z-dropdown:600;
  --ds-z-overlay:800;
  --ds-z-modal:900;
  --ds-z-toast:1000;
}

/* Foundation */
html{
  color-scheme:light;
  background:var(--ds-color-page)!important;
  overflow-x:clip!important;
  scroll-behavior:smooth;
}
html body{
  margin:0!important;
  min-inline-size:320px!important;
  background:var(--ds-color-page)!important;
  color:var(--ds-color-text)!important;
  font-size:14px!important;
  line-height:1.75!important;
  overflow-x:clip!important;
}
html body *,html body *::before,html body *::after{box-sizing:border-box}
html body img,html body svg,html body video,html body canvas{max-inline-size:100%}
html body img,html body video,html body canvas{block-size:auto}
html body svg{flex:0 0 auto}
html body main,html body section,html body article,html body aside,html body nav,html body header,html body footer,html body form,html body fieldset,html body label,html body div{min-inline-size:0}
html body h1,html body h2,html body h3,html body h4,html body p,html body small,html body span,html body strong,html body td,html body th,html body dd{overflow-wrap:anywhere}
html body .ltr{overflow-wrap:anywhere}
html body [hidden]{display:none!important}
html body :focus-visible{outline:0!important;box-shadow:var(--ds-ring)!important}
html body a,html body button,html body input,html body select,html body textarea{transition:border-color .16s ease,background-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease,opacity .16s ease}
html body button:active,html body .btn:active{transform:translateY(1px)}
html body button:disabled,html body .btn:disabled,html body input:disabled,html body select:disabled,html body textarea:disabled{cursor:not-allowed!important;opacity:.56!important;transform:none!important}
html body .sr-only{position:absolute!important;inline-size:1px!important;block-size:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}

/* Application shell and layers */
html body .ds-shell{min-block-size:100dvh!important}
html body .ds-sidebar{z-index:var(--ds-z-sidebar)!important;box-shadow:-12px 0 34px rgba(14,38,79,.07)!important}
html body .ds-topbar{z-index:var(--ds-z-sticky)!important}
html body .mobile-bottom-nav{z-index:var(--ds-z-bottom-nav)!important}
html body .ds-profile-menu,html body .jalali-picker,html body [role="menu"],html body .dropdown-menu{z-index:var(--ds-z-dropdown)!important}
html body .mobile-overlay{z-index:var(--ds-z-overlay)!important}
html body dialog,html body .notification-dialog,html body .modal,html body .drawer{z-index:var(--ds-z-modal)!important}
html body .flash-stack,html body .toast-stack{z-index:var(--ds-z-toast)!important}

html body .ds-main{min-inline-size:0!important}
html body .ds-container{
  inline-size:100%!important;
  max-inline-size:var(--ds-content-max)!important;
  margin-inline:auto!important;
  padding:var(--ds-space-6) var(--ds-space-6) 56px!important;
}
html body .footer-note{max-inline-size:var(--ds-content-max)!important;margin-inline:auto!important;padding-inline:var(--ds-space-6)!important}

/* Typography hierarchy */
html body .page-head,html body .v355-page-head{margin-block-end:var(--ds-space-5)!important}
html body .page-head h1,html body .v355-page-head h1{
  margin:0!important;
  color:var(--ds-color-text)!important;
  font-size:clamp(22px,1.6vw,28px)!important;
  line-height:1.45!important;
  letter-spacing:-.35px!important;
}
html body .page-head p,html body .v355-page-head p{margin:4px 0 0!important;color:var(--ds-color-muted)!important;font-size:13px!important;line-height:1.9!important}
html body .eyebrow,html body .page-eyebrow{display:inline-flex!important;align-items:center!important;gap:6px!important;color:var(--ds-color-primary-600)!important;font-size:11.5px!important;font-weight:850!important;line-height:1.5!important;margin-block-end:5px!important}
html body .card h2,html body .section-title-row h2,html body .card-head h2{color:var(--ds-color-text)!important;line-height:1.55!important}
html body .card-subtitle,html body .muted{color:var(--ds-color-muted)!important}

/* Page headers: desktop row, tablet wrapping, mobile stack */
html body .page-head,html body .v355-page-head{
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:var(--ds-space-4)!important;
  min-inline-size:0!important;
}
html body .page-head>div:first-child,html body .v355-page-head>div:first-child{min-inline-size:0!important;max-inline-size:820px!important}
html body .page-head>.actions,html body .page-head>.page-actions,html body .v355-page-head>.actions{flex:0 0 auto!important;align-self:center!important}

/* Shared surfaces */
html body .card{
  background:var(--ds-color-surface)!important;
  border:1px solid var(--ds-color-border)!important;
  border-radius:var(--ds-radius-md)!important;
  box-shadow:var(--ds-shadow-sm)!important;
  padding:var(--ds-space-5)!important;
  overflow:visible!important;
}
html body .card.compact{padding:var(--ds-space-4)!important}
html body .card:hover{border-color:var(--ds-color-border-strong)!important}
html body .section-gap{margin-block-start:var(--ds-space-5)!important}
html body .card-head,html body .section-title-row{
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:var(--ds-space-3)!important;
  margin-block-end:var(--ds-space-4)!important;
}
html body .card-head>div,html body .section-title-row>div{min-inline-size:0!important}

/* Buttons */
html body .btn,html body .icon-button,html body .menu-toggle,html body .message-shortcut{
  min-block-size:var(--ds-control-height)!important;
  border-radius:var(--ds-radius-sm)!important;
  font-weight:800!important;
}
html body .btn{
  min-inline-size:0!important;
  max-inline-size:100%!important;
  padding:9px 16px!important;
  gap:8px!important;
  border:1px solid var(--ds-color-border-strong)!important;
  background:#fff!important;
  color:var(--ds-color-text-soft)!important;
  line-height:1.35!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
html body .btn:hover{background:var(--ds-color-surface-soft)!important;border-color:#aebdd1!important;color:var(--ds-color-text)!important}
html body .btn.primary{background:var(--ds-color-primary-600)!important;border-color:var(--ds-color-primary-600)!important;color:#fff!important;box-shadow:0 7px 16px rgba(37,99,217,.17)!important}
html body .btn.primary:hover{background:var(--ds-color-primary-700)!important;border-color:var(--ds-color-primary-700)!important}
html body .btn.success{background:var(--ds-color-success-600)!important;border-color:var(--ds-color-success-600)!important;color:#fff!important}
html body .btn.danger{background:#fff!important;border-color:#ffb8c4!important;color:var(--ds-color-danger-600)!important}
html body .btn.danger:hover{background:var(--ds-color-danger-100)!important}
html body .btn.small{min-block-size:var(--ds-control-height-sm)!important;padding:7px 12px!important;font-size:11.5px!important}
html body .actions,html body .page-actions,html body .row-actions,html body .form-actions{gap:var(--ds-space-2)!important}
html body .actions form,html body .page-actions form,html body .row-actions form,html body .form-actions form{margin:0!important;min-inline-size:0!important}
html body .actions .btn,html body .page-actions .btn,html body .row-actions .btn,html body .form-actions .btn{max-inline-size:100%!important}

/* Badges: contained, never outside buttons/cards */
html body .badge{
  min-block-size:26px!important;
  max-inline-size:100%!important;
  padding:4px 10px!important;
  border-radius:var(--ds-radius-pill)!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  font-size:10.5px!important;
  line-height:1.2!important;
}
html body .badge.success{background:var(--ds-color-success-100)!important;color:var(--ds-color-success-700)!important}
html body .badge.danger{background:var(--ds-color-danger-100)!important;color:var(--ds-color-danger-700)!important}
html body .badge.warning{background:var(--ds-color-warning-100)!important;color:var(--ds-color-warning-700)!important}
html body .badge.info{background:var(--ds-color-primary-100)!important;color:var(--ds-color-primary-700)!important}

/* Forms and icon containment */
html body input,html body select,html body textarea{
  inline-size:100%!important;
  max-inline-size:100%!important;
  border:1px solid var(--ds-color-border-strong)!important;
  border-radius:var(--ds-radius-sm)!important;
  background:#fff!important;
  color:var(--ds-color-text)!important;
  outline:0!important;
}
html body input,html body select{min-block-size:var(--ds-control-height)!important;block-size:var(--ds-control-height)!important;padding-inline:13px!important}
html body textarea{min-block-size:112px!important;padding:12px 13px!important;resize:vertical!important}
html body input:hover,html body select:hover,html body textarea:hover{border-color:#aebdd1!important}
html body input:focus,html body select:focus,html body textarea:focus{border-color:var(--ds-color-primary-500)!important;box-shadow:var(--ds-ring)!important}
html body input::placeholder,html body textarea::placeholder{color:#9aa7b9!important;opacity:1!important}
html body .form-grid,html body .filters,html body .v355-password-fields{min-inline-size:0!important}
html body .form-grid label,html body .filters label,html body .v355-field{min-inline-size:0!important;gap:6px!important;color:var(--ds-color-text-soft)!important;font-size:11.5px!important;font-weight:800!important}
html body .form-grid label>span:first-child,html body .filters label>span:first-child{min-inline-size:0!important}

html body .input-with-icon,html body .v293-search-control,html body .filter-search-control,html body .payroll-period-search,html body .v355-search-control{
  position:relative!important;
  display:grid!important;
  grid-template-columns:44px minmax(0,1fr)!important;
  align-items:center!important;
  min-inline-size:0!important;
  min-block-size:var(--ds-control-height)!important;
  border:1px solid var(--ds-color-border-strong)!important;
  border-radius:var(--ds-radius-sm)!important;
  background:#fff!important;
  overflow:hidden!important;
}
html body .input-with-icon:focus-within,html body .v293-search-control:focus-within,html body .filter-search-control:focus-within,html body .payroll-period-search:focus-within,html body .v355-search-control:focus-within{border-color:var(--ds-color-primary-500)!important;box-shadow:var(--ds-ring)!important}
html body .input-with-icon>svg,html body .v293-search-control>svg,html body .filter-search-icon,html body .v355-search-control>svg{
  position:static!important;
  inset:auto!important;
  transform:none!important;
  grid-column:1!important;
  grid-row:1!important;
  justify-self:center!important;
  color:#718198!important;
  pointer-events:none!important;
}
html body .input-with-icon>input,html body .v293-search-control>input,html body .filter-search-control>input,html body .payroll-period-search>input,html body .v355-search-control>input{
  grid-column:2!important;
  grid-row:1!important;
  min-inline-size:0!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  padding-inline:8px 13px!important;
  background:transparent!important;
}

html body .password-wrap{
  position:relative!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 44px!important;
  align-items:center!important;
  min-inline-size:0!important;
  border:1px solid var(--ds-color-border-strong)!important;
  border-radius:var(--ds-radius-sm)!important;
  background:#fff!important;
  overflow:hidden!important;
}
html body .password-wrap:focus-within{border-color:var(--ds-color-primary-500)!important;box-shadow:var(--ds-ring)!important}
html body .password-wrap>input{grid-column:1!important;grid-row:1!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding-inline:13px 8px!important;background:transparent!important}
html body .password-wrap>.password-toggle{
  position:static!important;
  inset:auto!important;
  transform:none!important;
  grid-column:2!important;
  grid-row:1!important;
  inline-size:44px!important;
  min-inline-size:44px!important;
  block-size:44px!important;
  min-block-size:44px!important;
  padding:0!important;
  border:0!important;
  border-inline-start:1px solid var(--ds-color-border)!important;
  border-radius:0!important;
  background:transparent!important;
  color:#718198!important;
  display:grid!important;
  place-items:center!important;
}

/* Jalali date: icon is a real contained grid cell, never absolute outside */
html body .jalali-input-wrap{
  position:relative!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 44px!important;
  align-items:center!important;
  min-inline-size:0!important;
  inline-size:100%!important;
  min-block-size:var(--ds-control-height)!important;
  border:1px solid var(--ds-color-border-strong)!important;
  border-radius:var(--ds-radius-sm)!important;
  background:#fff!important;
  overflow:visible!important;
}
html body .jalali-input-wrap:focus-within{border-color:var(--ds-color-primary-500)!important;box-shadow:var(--ds-ring)!important}
html body .jalali-input-wrap>input{
  grid-column:1!important;
  grid-row:1!important;
  min-inline-size:0!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  padding-inline:13px 8px!important;
  background:transparent!important;
}
html body .jalali-input-wrap>.jalali-trigger{
  position:static!important;
  inset:auto!important;
  transform:none!important;
  grid-column:2!important;
  grid-row:1!important;
  inline-size:44px!important;
  min-inline-size:44px!important;
  block-size:44px!important;
  min-block-size:44px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-inline-start:1px solid var(--ds-color-border)!important;
  border-radius:0!important;
  background:transparent!important;
  color:#61718a!important;
  display:grid!important;
  place-items:center!important;
  overflow:hidden!important;
}
html body .jalali-input-wrap>.jalali-picker{
  position:absolute!important;
  inset-block-start:calc(100% + 8px)!important;
  inset-inline-start:0!important;
  inset-inline-end:auto!important;
  inline-size:min(320px,calc(100vw - 24px))!important;
  max-inline-size:calc(100vw - 24px)!important;
  border:1px solid var(--ds-color-border)!important;
  border-radius:var(--ds-radius-md)!important;
  background:#fff!important;
  box-shadow:var(--ds-shadow-md)!important;
  overflow:hidden!important;
}

/* Layout primitives */
html body .grid{gap:var(--ds-space-4)!important}
html body .two-col{grid-template-columns:repeat(2,minmax(0,1fr))!important}
html body .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--ds-space-4)!important}
html body .stats{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:var(--ds-space-3)!important}
html body .quick-actions{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:var(--ds-space-3)!important}
html body .permission-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--ds-space-2)!important}
html body .permission-switches{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:var(--ds-space-2)!important}
html body .filters{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(150px,1fr)) auto!important;
  align-items:end!important;
  gap:var(--ds-space-3)!important;
}
html body .filters>.grow{min-inline-size:0!important}
html body .filters>.btn,html body .filters>.form-actions{align-self:end!important}

/* Tables: desktop table, controlled scroll on tablet, card rows on mobile when responsive-table exists */
html body .table-wrap{
  inline-size:100%!important;
  max-inline-size:100%!important;
  overflow-x:auto!important;
  overscroll-behavior-inline:contain!important;
  -webkit-overflow-scrolling:touch!important;
  border-radius:var(--ds-radius-sm)!important;
}
html body table{inline-size:100%!important;max-inline-size:100%!important;border-collapse:collapse!important}
html body .table{min-inline-size:760px!important}
html body .table th,html body .table td{vertical-align:middle!important;padding:12px!important}
html body .table th{white-space:nowrap!important;color:var(--ds-color-muted)!important;font-size:10.5px!important}
html body .table td{color:var(--ds-color-text-soft)!important}
html body .table td>*{max-inline-size:100%!important}
html body .actions-cell{min-inline-size:0!important}
html body .actions-cell .row-actions{display:flex!important;align-items:center!important;justify-content:flex-start!important;flex-wrap:wrap!important;min-inline-size:0!important}

/* Top bar */
html body .ds-topbar{
  min-block-size:72px!important;
  block-size:auto!important;
  padding:10px var(--ds-space-6)!important;
  border-block-end:1px solid var(--ds-color-border)!important;
  background:rgba(255,255,255,.97)!important;
  box-shadow:var(--ds-shadow-xs)!important;
  backdrop-filter:blur(16px)!important;
}
html body .ds-page-title{min-inline-size:0!important;flex:1 1 auto!important}
html body .ds-page-title strong{display:block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;color:var(--ds-color-text)!important}
html body .ds-top-actions{min-inline-size:0!important;flex:0 1 auto!important}
html body .date-chip{min-block-size:42px!important;max-inline-size:220px!important;border-color:var(--ds-color-border)!important;border-radius:var(--ds-radius-sm)!important;overflow:hidden!important}
html body .date-chip time{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
html body .message-shortcut{
  position:relative!important;
  inline-size:42px!important;
  min-inline-size:42px!important;
  block-size:42px!important;
  min-block-size:42px!important;
  border:1px solid var(--ds-color-border)!important;
  background:#fff!important;
  color:#5e6e86!important;
  overflow:hidden!important;
}
html body .message-shortcut b{
  position:absolute!important;
  inset-block-start:3px!important;
  inset-inline-start:3px!important;
  inset-inline-end:auto!important;
  min-inline-size:16px!important;
  block-size:16px!important;
  padding-inline:3px!important;
  border:0!important;
  border-radius:var(--ds-radius-pill)!important;
  background:var(--ds-color-danger-600)!important;
  color:#fff!important;
  font-size:8px!important;
  line-height:16px!important;
  box-shadow:none!important;
  overflow:hidden!important;
}
html body .ds-profile-wrap{min-inline-size:0!important}
html body .ds-profile{max-inline-size:260px!important;min-inline-size:0!important;border-radius:var(--ds-radius-sm)!important;overflow:hidden!important}
html body .ds-profile>span:nth-child(2){min-inline-size:0!important}
html body .ds-profile strong,html body .ds-profile small{display:block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
html body .ds-profile-menu{inline-size:min(300px,calc(100vw - 24px))!important;max-inline-size:calc(100vw - 24px)!important;border-radius:var(--ds-radius-md)!important;border:1px solid var(--ds-color-border)!important;box-shadow:var(--ds-shadow-md)!important;overflow:hidden!important}

/* Sidebar consistency */
html body .ds-sidebar{background:#0d2a5e!important;border-inline-start:0!important}
html body .ds-brand{block-size:88px!important;border-block-end:1px solid rgba(255,255,255,.12)!important;background:#0b2554!important}
html body .ds-brand-logo{inline-size:48px!important;block-size:48px!important;border-radius:var(--ds-radius-sm)!important;border:1px solid rgba(255,255,255,.12)!important}
html body .ds-sidebar-scroll{padding:var(--ds-space-3)!important}
html body .ds-sidebar .nav-section-title{color:#90a8cf!important;padding:14px 12px 7px!important}
html body .ds-sidebar .nav a{min-block-size:44px!important;border-radius:var(--ds-radius-sm)!important;color:#d9e5f8!important;gap:10px!important;padding:9px 12px!important}
html body .ds-sidebar .nav a:hover{background:rgba(255,255,255,.08)!important;color:#fff!important}
html body .ds-sidebar .nav a.active{background:#fff!important;color:var(--ds-color-primary-800)!important;box-shadow:0 8px 18px rgba(0,0,0,.13)!important}
html body .ds-sidebar .nav a span:last-of-type{min-inline-size:0!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
html body .ds-sidebar-footer{border-block-start:1px solid rgba(255,255,255,.12)!important;background:#0b2554!important}
html body .ds-sidebar-footer a,html body .ds-sidebar-footer button{color:#e3edfb!important}
html body .ds-sidebar-footer a:hover,html body .ds-sidebar-footer button:hover{background:rgba(255,255,255,.08)!important}

/* Empty, error and loading states */
html body .empty,html body .compact-empty{
  min-block-size:160px!important;
  display:grid!important;
  place-items:center!important;
  align-content:center!important;
  gap:var(--ds-space-2)!important;
  padding:var(--ds-space-6)!important;
  color:var(--ds-color-muted)!important;
  text-align:center!important;
  border:1px dashed var(--ds-color-border-strong)!important;
  border-radius:var(--ds-radius-md)!important;
  background:var(--ds-color-surface-soft)!important;
}
html body .compact-empty{min-block-size:96px!important;padding:var(--ds-space-4)!important}
html body .empty-icon{inline-size:48px!important;block-size:48px!important;border-radius:var(--ds-radius-md)!important;background:var(--ds-color-primary-100)!important;color:var(--ds-color-primary-600)!important;display:grid!important;place-items:center!important}
html body .error-state,html body .flash.error{border-color:#ffc4ce!important;background:#fff4f6!important;color:var(--ds-color-danger-700)!important}
html body .success-state,html body .flash.success{border-color:#bdebdc!important;background:#effbf6!important;color:var(--ds-color-success-700)!important}
html body .skeleton{position:relative!important;overflow:hidden!important;background:#e8edf4!important;color:transparent!important;border-radius:var(--ds-radius-xs)!important}
html body .skeleton::after{content:"";position:absolute;inset:0;transform:translateX(100%);background:linear-gradient(90deg,transparent,rgba(255,255,255,.72),transparent);animation:ds-skeleton 1.25s infinite}
@keyframes ds-skeleton{to{transform:translateX(-100%)}}
@media (prefers-reduced-motion:reduce){html body *,html body *::before,html body *::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

/* Dialogs, drawers, popovers */
html body dialog{max-inline-size:min(680px,calc(100vw - 24px))!important;max-block-size:calc(100dvh - 24px)!important;border:0!important;border-radius:var(--ds-radius-lg)!important;padding:0!important;box-shadow:0 26px 70px rgba(12,31,64,.24)!important;overflow:hidden!important}
html body dialog::backdrop{background:rgba(13,30,60,.48)!important;backdrop-filter:blur(3px)!important}
html body .notification-dialog{inline-size:min(560px,calc(100vw - 24px))!important}
html body .notification-modal-list{max-block-size:min(520px,55dvh)!important;overflow:auto!important}
html body .notification-modal-item{min-inline-size:0!important}
html body .notification-modal-item>span:last-child{min-inline-size:0!important}
html body .notification-modal-item strong,html body .notification-modal-item small{display:block!important;white-space:normal!important;overflow-wrap:anywhere!important}

/* Employee portal */
html body .v355-profile-summary{grid-template-columns:minmax(280px,.9fr) minmax(0,1.5fr)!important;gap:var(--ds-space-5)!important;padding:var(--ds-space-5)!important}
html body .v355-profile-facts{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:var(--ds-space-2)!important}
html body .v355-profile-facts>div{padding:10px 12px!important;border-radius:var(--ds-radius-sm)!important;background:var(--ds-color-surface-soft)!important;border:1px solid var(--ds-color-border)!important}
html body .v355-account-grid{grid-template-columns:minmax(0,1.05fr) minmax(360px,.95fr)!important;gap:var(--ds-space-4)!important}
html body .v355-account-card,html body .v355-security-card{padding:var(--ds-space-5)!important;gap:var(--ds-space-4)!important}
html body .v355-card-heading{grid-template-columns:44px minmax(0,1fr) auto!important;gap:var(--ds-space-3)!important;align-items:start!important}
html body .v355-card-icon{inline-size:44px!important;block-size:44px!important;border-radius:var(--ds-radius-sm)!important}
html body .v355-password-fields{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--ds-space-3)!important}
html body .v355-pwa-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--ds-space-2)!important}
html body .v355-test-push .btn{inline-size:100%!important}
html body .v355-security-list{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:var(--ds-space-2)!important}
html body .v355-security-list>div{min-inline-size:0!important;border:1px solid var(--ds-color-border)!important;border-radius:var(--ds-radius-sm)!important;background:var(--ds-color-surface-soft)!important;padding:var(--ds-space-3)!important}
html body .v355-security-list p{min-inline-size:0!important}

html body .v355-employee-shortcuts{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:var(--ds-space-3)!important}
html body .v355-summary-strip{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:var(--ds-space-3)!important}
html body .v355-employee-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:var(--ds-space-4)!important}
html body .v355-dashboard-card{min-inline-size:0!important}

html body .v355-message-toolbar{grid-template-columns:minmax(260px,1.4fr) minmax(320px,1fr) auto!important;gap:var(--ds-space-3)!important;padding:var(--ds-space-4)!important}
html body .v355-message-filters{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--ds-space-2)!important}
html body .v355-message-tabs{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:4px!important;padding:4px!important}
html body .v355-message-tabs>a{min-inline-size:0!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
html body .v355-message-row{grid-template-columns:44px minmax(0,1fr) minmax(160px,auto)!important;gap:var(--ds-space-3)!important;min-inline-size:0!important}
html body .v355-message-meta{min-inline-size:0!important;grid-template-columns:auto auto 16px!important}

html body .v355-payslip-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:var(--ds-space-3)!important}
html body .v355-payslip-card,html body .v355-ration-card{min-inline-size:0!important;overflow:hidden!important}
html body .v355-pay-breakdown,html body .v355-ration-items{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--ds-space-2)!important}
html body .v355-rations-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--ds-space-3)!important}

/* Admin and operational pages */
html body .v351-main-flow,html body .v351-ration-path,html body .simple-flow,html body .payroll-stepper{overflow:hidden!important}
html body .v351-flow-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:1px!important}
html body .v333-kpi-strip,html body .v280-kpis,html body .v280-work-kpis,html body .v280-letter-kpis{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:var(--ds-space-3)!important}
html body .v280-bottom-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:var(--ds-space-4)!important}
html body .v280-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--ds-space-2)!important}
html body .v280-kpi,html body .v333-kpi-card,html body .v280-work-kpi{min-inline-size:0!important;overflow:hidden!important}
html body .v280-kpi strong,html body .v333-kpi-card strong,html body .v280-work-kpi strong{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}

html body .simple-work-layout{grid-template-columns:minmax(0,1.55fr) minmax(300px,.45fr)!important;gap:var(--ds-space-4)!important}
html body .batch-control-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--ds-space-4)!important}
html body .accounting-stats{grid-template-columns:repeat(4,minmax(0,1fr))!important}
html body .accounting-report-filters{grid-template-columns:minmax(110px,.45fr) minmax(150px,.7fr) minmax(260px,1.35fr) auto!important}
html body .report-filter-actions{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:var(--ds-space-2)!important}
html body .user-management-grid{grid-template-columns:minmax(340px,.72fr) minmax(0,1.28fr)!important;gap:var(--ds-space-4)!important}
html body .employee-documents-layout{grid-template-columns:minmax(340px,.72fr) minmax(0,1.28fr)!important;gap:var(--ds-space-4)!important}
html body .settings-layout{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--ds-space-4)!important;align-items:start!important}
html body .health-dashboard{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--ds-space-4)!important}
html body .health-card-wide{grid-column:1/-1!important}
html body .update-clean-grid{grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr)!important;gap:var(--ds-space-4)!important}
html body .update-process{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:var(--ds-space-2)!important}
html body .update-process-item{min-inline-size:0!important;align-items:flex-start!important}
html body .letter-compose-v354,html body .letter-compose-card,html body .v280-letter-main{min-inline-size:0!important}
html body .letter-base-fields{grid-template-columns:repeat(2,minmax(0,1fr))!important}
html body .letter-template-fields{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:var(--ds-space-3)!important}
html body .letter-editor-v354{max-inline-size:100%!important;overflow:hidden!important}
html body .letter-sheet,html body .payslip-sheet{max-inline-size:100%!important;overflow:hidden!important}

/* Responsive: medium desktop/tablet */
@media (max-width:1280px){
  html body .ds-container{padding-inline:var(--ds-space-5)!important}
  html body .stats,html body .accounting-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .v333-kpi-strip,html body .v280-kpis,html body .v280-work-kpis,html body .v280-letter-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .v280-bottom-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .v280-bottom-grid>article:last-child{grid-column:1/-1!important}
  html body .v355-profile-summary{grid-template-columns:1fr!important}
  html body .v355-profile-facts{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  html body .v355-payslip-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .v355-message-toolbar{grid-template-columns:minmax(240px,1fr) minmax(300px,1fr)!important}
  html body .v355-filter-submit{grid-column:1/-1!important;justify-self:end!important}
  html body .v355-employee-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .filters{grid-template-columns:repeat(3,minmax(150px,1fr))!important}
  html body .filters>.btn,html body .filters>.form-actions{justify-self:start!important}
}

/* Tablet */
@media (max-width:1024px){
  html body .ds-container{padding:var(--ds-space-5) var(--ds-space-4) 64px!important}
  html body .page-head,html body .v355-page-head{flex-wrap:wrap!important}
  html body .page-head>.actions,html body .page-head>.page-actions,html body .v355-page-head>.actions{align-self:flex-start!important}
  html body .two-col,html body .simple-work-layout,html body .batch-control-grid,html body .user-management-grid,html body .employee-documents-layout,html body .update-clean-grid{grid-template-columns:1fr!important}
  html body .settings-layout,html body .health-dashboard{grid-template-columns:1fr!important}
  html body .health-card-wide{grid-column:auto!important}
  html body .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .permission-switches{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .quick-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .v355-account-grid{grid-template-columns:1fr!important}
  html body .v355-security-list{grid-template-columns:1fr!important}
  html body .v355-employee-shortcuts{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html body .v355-summary-strip{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .v355-rations-grid{grid-template-columns:1fr!important}
  html body .v355-message-row{grid-template-columns:44px minmax(0,1fr) auto!important}
  html body .v355-message-meta{grid-template-columns:auto 16px!important;min-inline-size:110px!important}
  html body .v355-message-meta>.badge{display:none!important}
  html body .letter-template-fields{grid-template-columns:1fr!important}
  html body .update-process{grid-template-columns:1fr!important}
  html body .accounting-report-filters{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .report-filter-actions{grid-column:1/-1!important}
}

/* Mobile navigation and page layout */
@media (max-width:900px){
  html body{padding-block-end:calc(76px + env(safe-area-inset-bottom))!important}
  html body .ds-main{margin-inline:0!important;padding-block-end:0!important}
  html body .ds-container{padding:18px 12px 24px!important}
  html body .footer-note{display:none!important}

  html body .ds-topbar{
    position:sticky!important;
    inset-block-start:0!important;
    display:grid!important;
    grid-template-columns:92px minmax(0,1fr) 44px!important;
    grid-template-areas:"actions title menu"!important;
    align-items:center!important;
    column-gap:8px!important;
    min-block-size:60px!important;
    padding:8px max(10px,env(safe-area-inset-right))!important;
  }
  html body .mobile-only-menu-toggle{grid-area:menu!important;display:grid!important;inline-size:42px!important;min-inline-size:42px!important;block-size:42px!important;min-block-size:42px!important;justify-self:end!important;border:1px solid var(--ds-color-border)!important;border-radius:var(--ds-radius-sm)!important;background:#fff!important;overflow:hidden!important}
  html body .ds-page-title{grid-area:title!important;text-align:center!important;justify-self:stretch!important;min-inline-size:0!important}
  html body .ds-page-title strong{font-size:14px!important;text-align:center!important}
  html body .ds-top-actions{grid-area:actions!important;display:flex!important;justify-content:flex-start!important;gap:6px!important;min-inline-size:92px!important;margin:0!important}
  html body .ds-top-actions .date-chip,html body .ds-top-actions .ds-profile-wrap{display:none!important}
  html body .message-shortcut{inline-size:42px!important;min-inline-size:42px!important;block-size:42px!important;min-block-size:42px!important}

  html body .ds-sidebar{inline-size:min(320px,86vw)!important;max-inline-size:86vw!important;box-shadow:-24px 0 58px rgba(9,27,60,.25)!important}
  html body .ds-collapse{display:none!important}
  html body .mobile-overlay{position:fixed!important;inset:0!important;background:rgba(10,25,52,.48)!important;backdrop-filter:none!important}

  html body .mobile-bottom-nav{
    position:fixed!important;
    inset-inline:0!important;
    inset-block-end:0!important;
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    block-size:calc(72px + env(safe-area-inset-bottom))!important;
    padding:6px 6px calc(6px + env(safe-area-inset-bottom))!important;
    gap:3px!important;
    border-block-start:1px solid var(--ds-color-border)!important;
    background:rgba(255,255,255,.985)!important;
    box-shadow:0 -10px 30px rgba(16,38,74,.10)!important;
    backdrop-filter:blur(18px)!important;
    overflow:visible!important;
  }
  html body .mobile-bottom-nav a{
    position:relative!important;
    min-inline-size:0!important;
    min-block-size:58px!important;
    padding:5px 2px!important;
    border-radius:var(--ds-radius-sm)!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:4px!important;
    color:#66758d!important;
    font-size:10px!important;
    font-weight:780!important;
    white-space:nowrap!important;
    overflow:hidden!important;
  }
  html body .mobile-bottom-nav a.active{background:var(--ds-color-primary-100)!important;color:var(--ds-color-primary-600)!important}
  html body .mobile-bottom-nav a span{max-inline-size:100%!important;overflow:hidden!important;text-overflow:ellipsis!important}
  html body .mobile-bottom-nav b{
    position:absolute!important;
    inset-block-start:4px!important;
    inset-inline-start:calc(50% + 8px)!important;
    min-inline-size:16px!important;
    block-size:16px!important;
    padding-inline:3px!important;
    border:0!important;
    border-radius:var(--ds-radius-pill)!important;
    background:var(--ds-color-danger-600)!important;
    color:#fff!important;
    font-size:8px!important;
    display:grid!important;
    place-items:center!important;
  }

  html body .page-head,html body .v355-page-head{display:grid!important;grid-template-columns:1fr!important;gap:10px!important;margin-block-end:14px!important}
  html body .page-head h1,html body .v355-page-head h1{font-size:21px!important;line-height:1.5!important}
  html body .page-head p,html body .v355-page-head p{font-size:12.5px!important;line-height:1.8!important}
  html body .page-head>.actions,html body .page-head>.page-actions,html body .v355-page-head>.actions{inline-size:100%!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  html body .page-head>.actions .btn,html body .page-head>.page-actions .btn,html body .v355-page-head>.actions .btn{inline-size:100%!important}
  html body .page-head>.actions>*:only-child,html body .page-head>.page-actions>*:only-child,html body .v355-page-head>.actions>*:only-child{grid-column:1/-1!important}

  html body .card{padding:16px!important;border-radius:var(--ds-radius-md)!important;box-shadow:0 7px 22px rgba(18,38,72,.055)!important}
  html body .card-head,html body .section-title-row{gap:10px!important}
  html body .card-head .btn,html body .section-title-row .btn{flex:0 0 auto!important}

  html body .form-grid,html body .v355-password-fields{grid-template-columns:1fr!important;gap:14px!important}
  html body .form-grid .full,html body .v355-password-fields .full{grid-column:auto!important}
  html body .form-section{grid-column:auto!important}
  html body .filters{grid-template-columns:1fr 1fr!important;align-items:end!important;gap:10px!important;padding:14px!important}
  html body .filters>.grow,html body .filters>.filter-search,html body .filters>.input-with-icon{grid-column:1/-1!important}
  html body .filters>.btn,html body .filters>.form-actions{grid-column:1/-1!important;inline-size:100%!important;justify-self:stretch!important}
  html body .filters>.btn,html body .filters>.form-actions .btn{inline-size:100%!important}
  html body .form-actions{display:grid!important;grid-template-columns:1fr!important;inline-size:100%!important}
  html body .form-actions .btn,html body .form-actions form,html body .form-actions form .btn{inline-size:100%!important}

  html body .stats,html body .accounting-stats,html body .quick-actions,html body .permission-grid,html body .permission-switches{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  html body .two-col,html body .settings-layout,html body .health-dashboard{grid-template-columns:1fr!important}

  html body .table-wrap{margin-inline:0!important;border:1px solid var(--ds-color-border)!important;border-radius:var(--ds-radius-sm)!important;background:#fff!important}
  html body .table{min-inline-size:680px!important}

  html body .v351-flow-grid,html body .simple-flow{grid-template-columns:1fr!important}
  html body .v333-kpi-strip,html body .v280-kpis,html body .v280-work-kpis,html body .v280-letter-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  html body .v280-bottom-grid{grid-template-columns:1fr!important}
  html body .v280-bottom-grid>article:last-child{grid-column:auto!important}
  html body .v280-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}

  html body .v355-profile-summary{grid-template-columns:1fr!important;gap:14px!important;padding:16px!important}
  html body .v355-profile-identity{grid-template-columns:58px minmax(0,1fr)!important;gap:12px!important}
  html body .v355-profile-avatar{inline-size:58px!important;block-size:58px!important;border-radius:16px!important}
  html body .v355-profile-name h2{font-size:17px!important}
  html body .v355-profile-facts{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  html body .v355-profile-facts>div{padding:9px 10px!important}
  html body .v355-account-grid{grid-template-columns:1fr!important}
  html body .v355-card-heading{grid-template-columns:42px minmax(0,1fr) auto!important;gap:10px!important}
  html body .v355-card-icon{inline-size:42px!important;block-size:42px!important}
  html body .v355-card-heading h2{font-size:16px!important}
  html body .v355-pwa-actions{grid-template-columns:1fr!important}
  html body .v355-security-list{grid-template-columns:1fr!important}

  html body .v355-employee-shortcuts{grid-template-columns:1fr!important}
  html body .v355-summary-strip{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .v355-employee-grid{grid-template-columns:1fr!important}

  html body .v355-messages-card{overflow:hidden!important;padding:0!important}
  html body .v355-message-toolbar{grid-template-columns:1fr!important;gap:10px!important;padding:14px!important}
  html body .v355-message-filters{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .v355-filter-submit{grid-column:1/-1!important;inline-size:100%!important;justify-self:stretch!important}
  html body .v355-message-tabs{grid-template-columns:repeat(4,minmax(0,1fr))!important;border-radius:0!important;border-inline:0!important}
  html body .v355-message-tabs>a{padding-inline:4px!important;font-size:10px!important}
  html body .v355-message-row{grid-template-columns:42px minmax(0,1fr)!important;gap:10px!important;min-block-size:92px!important;padding:12px 14px!important}
  html body .v355-message-avatar{inline-size:42px!important;block-size:42px!important}
  html body .v355-message-meta{grid-column:2!important;grid-template-columns:auto auto 14px!important;justify-content:start!important;justify-items:start!important;min-inline-size:0!important;gap:7px!important}
  html body .v355-message-meta>.badge{display:inline-flex!important}
  html body .v355-message-copy strong,html body .v355-message-copy p{white-space:normal!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;overflow:hidden!important}
  html body .v355-message-copy strong{-webkit-line-clamp:1!important}
  html body .v355-message-copy p{-webkit-line-clamp:2!important}

  html body .v355-payslip-grid,html body .v355-rations-grid{grid-template-columns:1fr!important}
  html body .v355-pay-breakdown,html body .v355-ration-items{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .v355-payslip-foot{display:grid!important;grid-template-columns:1fr!important}
  html body .v355-payslip-foot .btn{inline-size:100%!important}

  html body .accounting-report-filters{grid-template-columns:1fr 1fr!important}
  html body .accounting-report-filters .filter-search{grid-column:1/-1!important}
  html body .report-filter-actions{grid-column:1/-1!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .report-filter-actions .btn{inline-size:100%!important}
  html body .letter-base-fields,html body .letter-template-fields{grid-template-columns:1fr!important}
  html body .update-summary-strip{grid-template-columns:1fr!important}
  html body .rollback-clean-card{grid-template-columns:1fr!important}

  html body dialog{border-radius:16px!important;max-block-size:calc(100dvh - 16px)!important}
}

/* Small mobile */
@media (max-width:560px){
  html body .ds-container{padding-inline:10px!important}
  html body .page-head>.actions,html body .page-head>.page-actions,html body .v355-page-head>.actions{grid-template-columns:1fr!important}
  html body .stats,html body .accounting-stats,html body .quick-actions,html body .permission-grid,html body .permission-switches{grid-template-columns:1fr!important}
  html body .v333-kpi-strip,html body .v280-kpis,html body .v280-work-kpis,html body .v280-letter-kpis{grid-template-columns:1fr!important}
  html body .v280-quick-grid{grid-template-columns:1fr!important}
  html body .filters{grid-template-columns:1fr!important}
  html body .filters>*{grid-column:auto!important}
  html body .v355-profile-facts{grid-template-columns:1fr!important}
  html body .v355-summary-strip{grid-template-columns:1fr!important}
  html body .v355-message-filters{grid-template-columns:1fr!important}
  html body .v355-message-tabs{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .v355-message-meta{grid-template-columns:auto auto!important}
  html body .v355-message-meta>svg{display:none!important}
  html body .v355-pay-breakdown,html body .v355-ration-items{grid-template-columns:1fr!important}
  html body .accounting-report-filters{grid-template-columns:1fr!important}
  html body .report-filter-actions{grid-template-columns:1fr!important}
  html body .card-head,html body .section-title-row{flex-direction:column!important;align-items:stretch!important}
  html body .card-head .btn,html body .section-title-row .btn{inline-size:100%!important}
}

/* Print remains clean and unaffected by app chrome */
@media print{
  html body{background:#fff!important;padding:0!important}
  html body .ds-sidebar,html body .ds-topbar,html body .mobile-bottom-nav,html body .footer-note,html body .no-print{display:none!important}
  html body .ds-main{margin:0!important}
  html body .ds-container{max-inline-size:none!important;padding:0!important}
  html body .card,html body .letter-sheet,html body .payslip-sheet{box-shadow:none!important}
}

/* ========================================================================== */
/* Final reviewer pass — deterministic containment and true responsive layout */
/* ========================================================================== */

/* Shared components must not shrink into clipped labels. */
html body .card-head,
html body .section-title-row{
  flex-wrap:wrap!important;
}
html body .badge{
  flex:0 0 auto!important;
  min-inline-size:max-content!important;
  overflow:visible!important;
  text-overflow:clip!important;
}
html body .row-actions{
  inline-size:100%!important;
  max-inline-size:100%!important;
  min-inline-size:0!important;
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:var(--ds-space-2)!important;
  overflow:visible!important;
}
html body .row-actions>*,
html body .row-actions>form{
  min-inline-size:0!important;
  max-inline-size:100%!important;
  margin:0!important;
}

/* Operational toolbar: real grid tracks, never a row of 100%-wide flex items. */
html body .v280-toolbar-actions{
  grid-column:1/-1!important;
  inline-size:100%!important;
  min-inline-size:0!important;
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr))!important;
  align-items:stretch!important;
  gap:var(--ds-space-2)!important;
  padding:0!important;
  overflow:visible!important;
}
html body .v280-toolbar-actions>.btn,
html body .v280-toolbar-actions>form,
html body .v280-toolbar-actions>form>.btn{
  inline-size:100%!important;
  min-inline-size:0!important;
  max-inline-size:100%!important;
  margin:0!important;
  justify-content:center!important;
}

/* Form progress is a responsive grid, not a clipped horizontal strip. */
html body .v351-form-progress{
  inline-size:100%!important;
  min-inline-size:0!important;
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:var(--ds-space-2)!important;
  padding:var(--ds-space-2)!important;
  margin:0!important;
  direction:rtl!important;
  overflow:visible!important;
}
html body .v351-form-progress>span{
  inline-size:auto!important;
  min-inline-size:0!important;
  max-inline-size:100%!important;
  min-block-size:44px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  padding:7px 8px!important;
  border:1px solid var(--ds-color-border)!important;
  border-radius:var(--ds-radius-sm)!important;
  background:var(--ds-color-surface-soft)!important;
  white-space:normal!important;
  text-align:center!important;
  overflow:hidden!important;
}
html body .v351-form-progress>span>b{flex:0 0 24px!important}

/* Card-style responsive tables must release the legacy 760px minimum width. */
@media screen and (max-width:1365px){
  html body .responsive-table{
    min-inline-size:0!important;
    max-inline-size:100%!important;
  }
  html body .table-wrap:has(.responsive-table){
    inline-size:100%!important;
    max-inline-size:100%!important;
  }
}

/* Tablet keeps semantic card rows without forcing the page wider than content. */
@media screen and (min-width:768px) and (max-width:1024px){
  html body .responsive-table,
  html body .responsive-table tbody,
  html body .responsive-table tr,
  html body .responsive-table td{
    max-inline-size:100%!important;
  }
  html body .responsive-table tbody{
    grid-template-columns:1fr!important;
  }
  html body .responsive-table tr{
    inline-size:100%!important;
  }
  html body .v293-thread-toolbar{
    padding-inline:10px!important;
  }
  html body .v293-mobile-pane-button{
    margin-inline:0!important;
  }
}

@media screen and (max-width:900px){
  /* Dashboard sections stack vertically; no desktop carousel is inherited. */
  html body .v280-dashboard-grid,
  html body .v280-bottom-grid{
    inline-size:100%!important;
    max-inline-size:100%!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:var(--ds-space-3)!important;
    margin-inline:0!important;
    padding:0!important;
    direction:rtl!important;
    overflow:visible!important;
    scroll-snap-type:none!important;
  }
  html body .v280-dashboard-grid>.card,
  html body .v280-bottom-grid>.card{
    grid-column:auto!important;
    inline-size:100%!important;
    min-inline-size:0!important;
    max-inline-size:100%!important;
    flex:0 1 auto!important;
    margin:0!important;
    scroll-snap-align:none!important;
  }

  html body .v351-form-progress{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  /* Every direct page-header action gets a full contained row on mobile. */
  html body .page-head>form,
  html body .v355-page-head>form{
    inline-size:100%!important;
    min-inline-size:0!important;
    margin:0!important;
  }
  html body .page-head>form>.btn,
  html body .v355-page-head>form>.btn{
    inline-size:100%!important;
  }

  /* Notification actions are a local grid, never pushed beyond the card. */
  html body .notification-item{
    grid-template-columns:42px minmax(0,1fr)!important;
    align-items:start!important;
  }
  html body .notification-item>.notification-icon{grid-column:1!important}
  html body .notification-item>div:nth-of-type(1){grid-column:2!important;min-inline-size:0!important}
  html body .notification-item>.row-actions{
    grid-column:1/-1!important;
    display:grid!important;
    grid-template-columns:repeat(auto-fit,minmax(110px,1fr))!important;
    gap:var(--ds-space-2)!important;
    inline-size:100%!important;
  }
  html body .notification-item>.row-actions>*,
  html body .notification-item>.row-actions>form,
  html body .notification-item>.row-actions .btn{
    inline-size:100%!important;
    max-inline-size:100%!important;
  }

  /* Conversation controls become two deliberate rows instead of an off-screen strip. */
  html body .v293-thread-toolbar{
    display:grid!important;
    grid-template-columns:1fr!important;
    align-items:stretch!important;
    gap:var(--ds-space-2)!important;
    min-block-size:0!important;
    block-size:auto!important;
    padding:var(--ds-space-2)!important;
    overflow:visible!important;
  }
  html body .v293-toolbar-start,
  html body .v293-toolbar-end{
    inline-size:100%!important;
    min-inline-size:0!important;
    display:grid!important;
    align-items:stretch!important;
    gap:var(--ds-space-2)!important;
    padding:0!important;
    overflow:visible!important;
  }
  html body .v293-toolbar-start{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .v293-toolbar-end{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html body .v293-toolbar-start>*,
  html body .v293-toolbar-end>*,
  html body .v293-toolbar-end>form,
  html body .v293-toolbar-end>form>.btn,
  html body .v293-thread-toolbar .btn,
  html body .v293-thread-toolbar .v293-mobile-pane-button{
    inline-size:100%!important;
    min-inline-size:0!important;
    max-inline-size:100%!important;
    margin:0!important;
    justify-content:center!important;
  }

  /* Closed drawers are truly hidden and non-interactive, not merely translated. */
  html body .v293-message-list-panel,
  html body .v293-info-panel{
    visibility:hidden!important;
    opacity:0!important;
    pointer-events:none!important;
  }
  html body.message-list-open .v293-message-list-panel,
  html body.message-info-open .v293-info-panel{
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
  }

  /* Mobile action groups are predictable local grids. */
  html body .row-actions{
    display:grid!important;
    grid-template-columns:repeat(auto-fit,minmax(100px,1fr))!important;
    align-items:stretch!important;
  }
  html body .row-actions>*,
  html body .row-actions>form,
  html body .row-actions .btn,
  html body .row-actions>form>.btn{
    inline-size:100%!important;
    max-inline-size:100%!important;
  }

  html body .mobile-bottom-nav{
    isolation:isolate!important;
  }
  html body .ds-container{
    scroll-margin-block-end:calc(84px + env(safe-area-inset-bottom))!important;
  }
}

@media screen and (max-width:560px){
  html body .v293-toolbar-end{
    grid-template-columns:1fr 1fr!important;
  }
  html body .v293-toolbar-end>*:last-child{
    grid-column:1/-1!important;
  }
  html body .v351-form-progress>span{
    min-block-size:48px!important;
    font-size:11.5px!important;
  }
}

/* Final zero-overflow corrections found by the three-viewport reviewer. */
@media screen and (max-width:900px){
  html body .v280-dashboard-grid,
  html body .v280-bottom-grid{
    grid-template-areas:none!important;
    grid-auto-flow:row!important;
    grid-auto-columns:minmax(0,1fr)!important;
    grid-auto-rows:auto!important;
  }
  html body .v280-dashboard-grid>* ,
  html body .v280-bottom-grid>*{
    grid-area:auto!important;
  }
}

@media screen and (min-width:901px) and (max-width:1200px){
  html body .v293-toolbar-start,
  html body .v293-toolbar-end{
    display:grid!important;
    align-items:stretch!important;
    gap:6px!important;
    overflow:visible!important;
  }
  html body .v293-toolbar-start{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .v293-toolbar-end{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html body .v293-toolbar-start>*,
  html body .v293-toolbar-end>*,
  html body .v293-toolbar-end>form,
  html body .v293-toolbar-end>form>.btn,
  html body .v293-toolbar-start .btn,
  html body .v293-toolbar-end .btn,
  html body .v293-toolbar-start .v293-mobile-pane-button,
  html body .v293-toolbar-end .v293-mobile-pane-button{
    inline-size:100%!important;
    min-inline-size:0!important;
    max-inline-size:100%!important;
    margin:0!important;
    justify-content:center!important;
  }
}

@media screen and (max-width:1024px){
  html body .v280-letter-filter{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
  html body .v280-letter-filter>.grow{
    grid-column:1/-1!important;
  }
  html body .v280-letter-filter>.btn{
    grid-column:1/-1!important;
    inline-size:100%!important;
    min-inline-size:0!important;
    justify-content:center!important;
  }
}
@media screen and (max-width:560px){
  html body .v280-letter-filter{grid-template-columns:1fr!important}
  html body .v280-letter-filter>*{grid-column:auto!important}
}

/* 3.6.0 final reviewer corrections */
html body .badge{
  inline-size:max-content!important;
  flex:0 0 auto!important;
}
html body .filters>.btn{min-inline-size:96px!important}

@media screen and (max-width:1180px){
  html body.page-message-view .v293-thread-toolbar{
    display:grid!important;
    grid-template-columns:1fr!important;
    align-items:stretch!important;
    gap:var(--ds-space-2)!important;
    block-size:auto!important;
    min-block-size:0!important;
    padding:var(--ds-space-2)!important;
    overflow:visible!important;
  }
  html body.page-message-view .v293-toolbar-start,
  html body.page-message-view .v293-toolbar-end{
    inline-size:100%!important;
    min-inline-size:0!important;
    display:grid!important;
    gap:var(--ds-space-2)!important;
    padding:0!important;
    overflow:visible!important;
  }
  html body.page-message-view .v293-toolbar-start{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body.page-message-view .v293-toolbar-end{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html body.page-message-view .v293-toolbar-start>*,
  html body.page-message-view .v293-toolbar-end>*,
  html body.page-message-view .v293-toolbar-end>form,
  html body.page-message-view .v293-toolbar-end>form>.btn,
  html body.page-message-view .v293-mobile-pane-button{
    inline-size:100%!important;
    min-inline-size:0!important;
    max-inline-size:100%!important;
    margin:0!important;
    justify-content:center!important;
  }
}

@media screen and (max-width:900px){
  html body .v280-dashboard-grid,
  html body .v280-bottom-grid{
    grid-template-areas:none!important;
    grid-auto-flow:row!important;
    grid-auto-columns:minmax(0,1fr)!important;
    grid-auto-rows:auto!important;
  }
  html body .v280-dashboard-grid>*,
  html body .v280-bottom-grid>*{
    grid-area:auto!important;
    grid-column:auto!important;
    grid-row:auto!important;
  }
  html body .filters>.btn{min-inline-size:0!important}
}
@media screen and (max-width:900px){
  html body .v280-bottom-grid>article:nth-child(1),
  html body .v280-bottom-grid>article:nth-child(2),
  html body .v280-bottom-grid>article:nth-child(3){
    grid-area:auto!important;
    grid-column:auto!important;
    grid-row:auto!important;
  }
}
