/* ShahrVam v570 — baseline mobile layout system.
   v579 supersedes final cascade authority with tiam-mobile-root-v579.css. */
:root{
  --sv-mobile-shell-breakpoint:900px;
  --sv-mobile-inline:12px;
  --sv-mobile-gap:8px;
  --sv-mobile-radius:14px;
  --sv-mobile-dock-h:52px;
  --sv-mobile-touch:44px;
  --sv-mobile-header-h:58px;
  --sv-z-sticky:30;
  --sv-z-header:60;
  --sv-z-dock:80;
  --sv-z-sheet-backdrop:120;
  --sv-z-sheet:130;
  --sv-z-modal:160;
  --sv-z-toast:190;
}

/* Runtime-only controls are invisible outside the mobile shell. */
.sv-mobile-filter-trigger,.sv-mobile-header-more{display:none}

@media (max-width:900px){
  html{width:100%;max-width:100%;height:100%;overflow:hidden;overscroll-behavior:none;text-size-adjust:100%;-webkit-text-size-adjust:100%;color-scheme:light}
  body{width:100%;max-width:100%;height:100%;min-height:100dvh;margin:0!important;overflow:hidden!important;overscroll-behavior:none;padding:0!important}
  body:not(.auth-active) #app-shell{display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:100%!important;max-width:100%!important;height:100dvh!important;min-height:100dvh!important;overflow:hidden!important}
  body:not(.auth-active) #app-shell>.sidebar{display:none!important}
  body:not(.auth-active) #app-shell>.workspace{min-width:0!important;width:100%!important;max-width:100%!important;height:100dvh!important;min-height:0!important;overflow:hidden!important}
  body:not(.auth-active) #page-content{
    box-sizing:border-box!important;width:100%!important;max-width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;
    overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior-y:contain!important;-webkit-overflow-scrolling:touch!important;
    padding-inline:var(--sv-mobile-inline)!important;
    padding-top:max(10px,env(safe-area-inset-top))!important;
    padding-bottom:calc(var(--sv-mobile-dock-h) + 18px + env(safe-area-inset-bottom))!important;
    scroll-padding-top:10px!important;scroll-padding-bottom:calc(var(--sv-mobile-dock-h) + 24px + env(safe-area-inset-bottom))!important;
  }
  body:not(.auth-active) #page-content>*{min-width:0;max-width:100%;box-sizing:border-box}
  body.sv-keyboard-open:not(.auth-active) #page-content{padding-bottom:18px!important;scroll-padding-bottom:24px!important}

  /* Persian text must wrap on semantic boundaries, never letter-by-letter. */
  #page-content :where(h1,h2,h3,h4,h5,p,span,b,strong,small,em,label,td,th,button,a,li,dd,dt){word-break:normal!important;overflow-wrap:normal!important}
  #page-content :where(code,pre,.sv-break-anywhere,[data-break-anywhere="1"],.technical-id,.url-text){overflow-wrap:anywhere!important;word-break:break-word!important}
  #page-content :where(.money,[data-money],.phone,[data-phone],.personnel-code,.national-code,.tracking-code){white-space:nowrap!important;word-break:keep-all!important}

  /* One compact app bar. */
  body:not(.auth-active) #page-content>.tiam-page-hero,
  body:not(.auth-active) #page-content>.rec-workspace-hero.tiam-page-hero{
    position:relative!important;isolation:isolate!important;display:grid!important;
    grid-template-columns:38px minmax(0,1fr) auto!important;grid-template-rows:1fr!important;
    align-items:center!important;gap:8px!important;width:100%!important;min-width:0!important;min-height:var(--sv-mobile-header-h)!important;
    margin:0 0 8px!important;padding:7px 8px!important;overflow:visible!important;border-radius:14px!important;
  }
  #page-content>.tiam-page-hero .tiam-page-hero__visual{grid-column:1!important;grid-row:1!important;width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;border-radius:10px!important}
  #page-content>.tiam-page-hero .tiam-page-hero__visual svg{width:19px!important;height:19px!important}
  #page-content>.tiam-page-hero .tiam-page-hero__copy{grid-column:2!important;grid-row:1!important;min-width:0!important;align-self:center!important}
  #page-content>.tiam-page-hero .tiam-page-hero__copy :where(h1,h2){margin:0!important;font-size:17px!important;line-height:1.45!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  #page-content>.tiam-page-hero .tiam-page-hero__copy p{display:none!important}
  #page-content>.tiam-page-hero .tiam-page-hero__actions{grid-column:3!important;grid-row:1!important;width:auto!important;min-width:0!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:5px!important;flex-wrap:nowrap!important;overflow:visible!important;padding:0!important;margin:0!important}
  #page-content>.tiam-page-hero .tiam-page-hero__actions>:where(button,a,summary,.tiam-header-action--icon,.tiam-head-icon-action){box-sizing:border-box!important;width:var(--sv-mobile-touch)!important;min-width:var(--sv-mobile-touch)!important;height:var(--sv-mobile-touch)!important;min-height:var(--sv-mobile-touch)!important;padding:0!important;border-radius:11px!important;display:grid!important;place-items:center!important;flex:0 0 var(--sv-mobile-touch)!important}
  #page-content>.tiam-page-hero .tiam-page-hero__actions>:where(button,a,summary) svg{width:19px!important;height:19px!important}
  #page-content>.tiam-page-hero .tiam-page-hero__actions .sv-mobile-overflow-action{display:none!important}
  .sv-mobile-header-more{width:var(--sv-mobile-touch)!important;height:var(--sv-mobile-touch)!important;min-width:var(--sv-mobile-touch)!important;border:1px solid rgba(255,255,255,.22)!important;border-radius:11px!important;background:rgba(255,255,255,.09)!important;color:inherit!important;padding:0!important;display:grid!important;place-items:center!important}
  .sv-mobile-header-more svg{width:20px!important;height:20px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important}

  /* Compact bottom dock: 3 destinations + More. */
  .tiam-mobile-bottom-v358{box-sizing:border-box!important;right:8px!important;left:8px!important;bottom:max(5px,env(safe-area-inset-bottom))!important;z-index:var(--sv-z-dock)!important;min-height:var(--sv-mobile-dock-h)!important;height:var(--sv-mobile-dock-h)!important;padding:4px!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:3px!important;border-radius:15px!important;box-shadow:0 6px 18px rgba(16,42,67,.14)!important;transition:transform .18s ease,opacity .18s ease!important}
  .tiam-mobile-bottom-v358 button{box-sizing:border-box!important;min-width:0!important;min-height:44px!important;height:44px!important;padding:0 5px!important;border-radius:10px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;font-size:10.5px!important;line-height:1.2!important}
  .tiam-mobile-bottom-v358 button svg{width:19px!important;height:19px!important;flex:0 0 19px!important}
  .tiam-mobile-bottom-v358 button span{display:none!important;max-width:72px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .tiam-mobile-bottom-v358 button.is-active span,.tiam-mobile-bottom-v358 button[data-more] span{display:inline!important}
  body.sv-keyboard-open .tiam-mobile-bottom-v358,body.sv-overlay-open .tiam-mobile-bottom-v358,body.tiam-mobile-more-open .tiam-mobile-bottom-v358{transform:translateY(calc(100% + 20px))!important;opacity:0!important;pointer-events:none!important}
  .tiam-mobile-more-v358{z-index:var(--sv-z-sheet)!important;direction:rtl!important}
  .tiam-mobile-more-v358 .tiam-mobile-more-backdrop{background:rgba(5,20,33,.42)!important;backdrop-filter:none!important}
  .tiam-mobile-more-v358>section{box-sizing:border-box!important;max-height:min(78dvh,680px)!important;padding:7px 12px calc(12px + env(safe-area-inset-bottom))!important;border-radius:20px 20px 0 0!important;box-shadow:0 -14px 34px rgba(7,31,50,.18)!important}
  .tiam-mobile-more-v358>section::before{content:"";display:block;width:38px;height:4px;margin:0 auto 6px;border-radius:99px;background:#d7e0e6}
  .tiam-mobile-more-v358 header{min-height:48px!important;margin:0!important;border-bottom:1px solid #e5ebef!important}
  .tiam-mobile-more-v358 header b{font-size:14px!important;color:#173b57!important}
  .tiam-mobile-more-v358 section>div{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;padding-top:10px!important}
  .tiam-mobile-more-v358 section>div>button{box-sizing:border-box!important;min-width:0!important;min-height:50px!important;padding:8px 9px!important;border-radius:12px!important;font-size:11px!important}

  /* Bottom sheets replace desktop popovers/dropdowns on phones. */
  .sv-mobile-sheet{position:fixed!important;inset:0!important;z-index:var(--sv-z-sheet)!important;display:block!important;direction:rtl!important}
  .sv-mobile-sheet__backdrop{position:absolute!important;inset:0!important;background:rgba(5,20,33,.42)!important;backdrop-filter:none!important}
  .sv-mobile-sheet__panel{position:absolute!important;inset-inline:0!important;bottom:0!important;max-height:min(78dvh,680px)!important;display:flex!important;flex-direction:column!important;background:#fff!important;border-radius:20px 20px 0 0!important;box-shadow:0 -14px 34px rgba(7,31,50,.18)!important;padding:0 12px calc(12px + env(safe-area-inset-bottom))!important;overflow:hidden!important}
  .sv-mobile-sheet__handle{width:38px!important;height:4px!important;margin:7px auto 5px!important;border-radius:99px!important;background:#d7e0e6!important;flex:0 0 auto!important}
  .sv-mobile-sheet__head{min-height:48px!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;border-bottom:1px solid #e5ebef!important;flex:0 0 auto!important}
  .sv-mobile-sheet__head b{font-size:14px!important;color:#173b57!important}
  .sv-mobile-sheet__close{width:44px!important;height:44px!important;min-width:44px!important;border:0!important;border-radius:11px!important;background:#f1f5f7!important;color:#294d66!important;display:grid!important;place-items:center!important;font-size:20px!important}
  .sv-mobile-sheet__body{min-height:0!important;overflow:auto!important;padding:10px 0 2px!important;-webkit-overflow-scrolling:touch!important}
  .sv-mobile-sheet__items{display:grid!important;grid-template-columns:1fr!important;gap:7px!important}
  .sv-mobile-sheet__items>*{box-sizing:border-box!important;position:relative!important;inset:auto!important;transform:none!important;width:100%!important;max-width:100%!important;min-width:0!important;min-height:48px!important;height:auto!important;margin:0!important;padding:9px 11px!important;border:1px solid #dce5eb!important;border-radius:12px!important;background:#fff!important;color:#173b57!important;box-shadow:none!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:9px!important;text-align:right!important;font-family:inherit!important;font-size:12px!important;font-weight:800!important;white-space:normal!important}
  .sv-mobile-sheet__items>* :where(svg){width:20px!important;height:20px!important;flex:0 0 20px!important}
  .sv-mobile-sheet__items>*[data-sv-sheet-label]::after{content:attr(data-sv-sheet-label);display:inline!important;min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:normal!important;color:inherit!important;font:inherit!important}
  .sv-mobile-sheet__items>*[data-sv-has-visible-text="1"]::after{display:none!important}
  .sv-mobile-sheet__items details{display:block!important}
  .sv-mobile-sheet__items details>summary{min-height:44px!important;display:flex!important;align-items:center!important;gap:8px!important;list-style:none!important}
  .sv-mobile-sheet__items details>summary::-webkit-details-marker{display:none!important}
  .sv-mobile-sheet__items details>:not(summary){position:static!important;width:100%!important;max-width:none!important;box-shadow:none!important;margin-top:6px!important}

  /* Filters: search stays visible; secondary controls are sheet-ready. */
  .sv-mobile-filter-host{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:7px!important;align-items:center!important;width:100%!important;min-width:0!important}
  .sv-mobile-filter-host>.sv-mobile-filter-search{grid-column:1!important;min-width:0!important;width:100%!important;margin:0!important}
  .sv-mobile-filter-host>.sv-mobile-filter-trigger{grid-column:2!important;width:auto!important;min-width:44px!important;height:44px!important;padding:0 10px!important;border:1px solid #d7e2e9!important;border-radius:11px!important;background:#fff!important;color:#244b66!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;font-family:inherit!important;font-size:11px!important;font-weight:800!important;white-space:nowrap!important}
  .sv-mobile-filter-host>.sv-mobile-filter-trigger svg{width:18px!important;height:18px!important}
  .sv-mobile-filter-host>.sv-mobile-filter-secondary{display:none!important}

  /* Summary cards: no fixed desktop min-widths. */
  :where(.hr388-summary-strip,.hr431-employee-summary,.v286-kpi-grid,.credit-v118-summary-grid,.brokerage-v285-summary,.finance-mini-kpis,.analysis-kpis,.sales-report-summary,.sales-average-detail-kpis,.attendance-v111-summary-grid,.attendance-v110-summary-grid){min-width:0!important;max-width:100%!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;overflow:visible!important}
  :where(.hr388-summary-strip,.hr431-employee-summary,.v286-kpi-grid,.credit-v118-summary-grid,.brokerage-v285-summary,.finance-mini-kpis,.analysis-kpis,.sales-report-summary,.sales-average-detail-kpis,.attendance-v111-summary-grid,.attendance-v110-summary-grid)>*{box-sizing:border-box!important;min-width:0!important;max-width:100%!important;min-height:60px!important;margin:0!important;padding:8px 9px!important;border-radius:13px!important;overflow:hidden!important}
  body[data-page="experts"] .hr431-employee-summary{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  body[data-page="experts"] .hr431-employee-summary>article{min-height:58px!important;padding:7px 6px!important;display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:center!important}
  body[data-page="experts"] .hr431-employee-summary small{font-size:10px!important;line-height:1.35!important;white-space:normal!important}
  body[data-page="experts"] .hr431-employee-summary b{font-size:18px!important;line-height:1.2!important;margin-top:2px!important}

  /* Experts page: compact filters + actual mobile cards instead of crushed desktop cells. */
  body[data-page="experts"] .hr388-page{gap:8px!important}
  body[data-page="experts"] .hr388-panel{min-width:0!important;overflow:visible!important}
  body[data-page="experts"] .hr388-panel-head{display:grid!important;grid-template-columns:1fr!important;gap:7px!important;padding:9px!important}
  body[data-page="experts"] .hr388-panel-head>h2{margin:0!important;font-size:15px!important}
  body[data-page="experts"] .hr431-employee-tools{width:100%!important;min-width:0!important;margin:0!important}
  body[data-page="experts"] .hr431-employee-tools .hr388-search{width:100%!important;min-width:0!important}
  body[data-page="experts"] .hr431-employee-tools input{width:100%!important;min-width:0!important;height:44px!important;font-size:16px!important}
  body[data-page="experts"] #v286-employee-table.sv-mobile-card-table,body[data-page="experts"] #v286-employee-table.sv-mobile-card-table tbody{display:block!important;width:100%!important;min-width:0!important;border:0!important}
  body[data-page="experts"] #v286-employee-table.sv-mobile-card-table thead{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important}
  body[data-page="experts"] #v286-employee-table.sv-mobile-card-table tbody{display:grid!important;gap:8px!important}
  body[data-page="experts"] #v286-employee-table.sv-mobile-card-table tbody tr[data-employee-row]{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:0!important;width:100%!important;min-width:0!important;padding:0!important;margin:0!important;border:1px solid #dbe5ec!important;border-radius:13px!important;background:#fff!important;box-shadow:0 2px 8px rgba(18,49,75,.04)!important;overflow:hidden!important}
  body[data-page="experts"] #v286-employee-table.sv-mobile-card-table tbody tr[data-branch-group]{display:block!important;width:100%!important;margin-top:4px!important}
  body[data-page="experts"] #v286-employee-table.sv-mobile-card-table tbody tr[data-branch-group] td{display:flex!important;width:100%!important;min-height:38px!important;padding:7px 10px!important;border:0!important;background:#eef4f8!important}
  body[data-page="experts"] #v286-employee-table.sv-mobile-card-table tbody td{box-sizing:border-box!important;display:grid!important;align-content:center!important;gap:2px!important;width:auto!important;min-width:0!important;min-height:54px!important;height:auto!important;padding:7px 9px!important;border:0!important;border-top:1px solid #edf1f4!important;border-inline-start:1px solid #edf1f4!important;white-space:normal!important;text-align:right!important;font-size:12px!important;line-height:1.55!important;overflow:visible!important;text-overflow:clip!important}
  body[data-page="experts"] #v286-employee-table.sv-mobile-card-table tbody td::before{content:attr(data-sv-label);display:block!important;margin-bottom:1px!important;font-size:9.5px!important;line-height:1.3!important;font-weight:700!important;color:#7a8c9a!important}
  body[data-page="experts"] #v286-employee-table.sv-mobile-card-table tbody td:first-child{grid-column:1/-1!important;min-height:48px!important;border-top:0!important;border-inline-start:0!important;background:#f6f9fb!important}
  body[data-page="experts"] #v286-employee-table.sv-mobile-card-table tbody td:first-child::before{display:none!important}
  body[data-page="experts"] #v286-employee-table.sv-mobile-card-table tbody td:last-child{grid-column:1/-1!important;border-inline-start:0!important;padding:7px!important}
  body[data-page="experts"] #v286-employee-table.sv-mobile-card-table tbody td:last-child::before{content:"عملیات"!important}
  body[data-page="experts"] #v286-employee-table.sv-mobile-card-table .hr388-person b{font-size:13.5px!important;white-space:normal!important;line-height:1.45!important}
  body[data-page="experts"] #v286-employee-table.sv-mobile-card-table .actions-cell{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important;width:100%!important}
  body[data-page="experts"] #v286-employee-table.sv-mobile-card-table .actions-cell .btn{min-width:0!important;width:100%!important;min-height:40px!important;padding:6px!important;font-size:10.5px!important;white-space:nowrap!important}

  /* Explicit list tables become readable record cards instead of narrow desktop grids. */
  #page-content table.sv-mobile-generic-card-table,#page-content table.sv-mobile-generic-card-table tbody{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;border:0!important}
  #page-content table.sv-mobile-generic-card-table thead{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important}
  #page-content table.sv-mobile-generic-card-table tbody{display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
  #page-content table.sv-mobile-generic-card-table tbody tr{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important;min-width:0!important;height:auto!important;min-height:0!important;padding:0!important;margin:0!important;border:1px solid #dbe5ec!important;border-radius:13px!important;background:#fff!important;overflow:hidden!important;box-shadow:0 2px 8px rgba(18,49,75,.04)!important}
  #page-content table.sv-mobile-generic-card-table tbody td{box-sizing:border-box!important;display:grid!important;align-content:center!important;gap:2px!important;min-width:0!important;min-height:48px!important;height:auto!important;padding:7px 9px!important;border:0!important;border-top:1px solid #edf1f4!important;border-inline-start:1px solid #edf1f4!important;white-space:normal!important;word-break:normal!important;overflow-wrap:normal!important;text-align:right!important;line-height:1.55!important}
  #page-content table.sv-mobile-generic-card-table tbody td::before{content:attr(data-label);display:block!important;font-size:9.5px!important;line-height:1.3!important;font-weight:700!important;color:#718596!important}
  #page-content table.sv-mobile-generic-card-table tbody td:first-child{grid-column:1/-1!important;min-height:42px!important;border-top:0!important;border-inline-start:0!important;background:#f4f8fa!important;font-weight:850!important}
  #page-content table.sv-mobile-generic-card-table tbody td:first-child::before{display:none!important}
  #page-content table.sv-mobile-generic-card-table tbody tr>td:nth-child(2n+1):not(:first-child){border-inline-start:0!important}
  #page-content .table-wrap.sv-mobile-card-wrap{overflow:visible!important;max-height:none!important}

  /* Brokerage and credit mobile density: preserve operational information without desktop-sized blocks. */
  body[data-page="brokerage"] .brokerage-employee-status-card{padding:9px!important;border-radius:14px!important}
  body[data-page="brokerage"] .brokerage-employee-status-wrap{overflow:visible!important;max-height:none!important;border:0!important}
  body[data-page="brokerage"] .bc391-table-scroll{max-width:100%!important;overflow-x:auto!important;overflow-y:hidden!important;overscroll-behavior-inline:contain!important;-webkit-overflow-scrolling:touch!important;touch-action:pan-x pan-y!important}
  body[data-page="brokerage"] .brokerage-row-list{max-width:none!important;overflow:visible!important}
  body[data-page="brokerage"] .brokerage-v436-scroll-hint{white-space:normal!important;font-size:9.5px!important;line-height:1.4!important}
  body[data-page="credit-assessment"] .credit-v380-metrics{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;border:0!important;background:transparent!important;overflow:visible!important}
  body[data-page="credit-assessment"] .credit-v380-metrics>div{min-width:0!important;min-height:54px!important;padding:7px 8px!important;border:1px solid #dce5eb!important;border-radius:10px!important}
  body[data-page="credit-assessment"] .credit-v368-fund-actions{display:flex!important;gap:6px!important;flex-wrap:wrap!important;width:100%!important}
  body[data-page="credit-assessment"] .credit-v368-fund-actions .btn{flex:1 1 120px!important;min-height:42px!important;height:auto!important}

  /* Tables: the page never scrolls horizontally; the table wrapper always can. */
  #page-content .table-wrap{box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;overflow-x:auto!important;overflow-y:visible!important;overscroll-behavior-inline:contain!important;-webkit-overflow-scrolling:touch!important;scrollbar-gutter:stable!important;touch-action:pan-x pan-y!important}
  #page-content .table-wrap.sv-mobile-card-wrap{overflow:visible!important}
  #page-content table.sv-mobile-wide-table{width:max-content!important;max-width:none!important;min-width:var(--sv-table-min,680px)!important;table-layout:auto!important;border-collapse:separate!important;border-spacing:0!important}
  #page-content table.sv-mobile-wide-table :where(th,td){box-sizing:border-box!important;min-width:92px!important;max-width:260px!important;white-space:nowrap!important;word-break:normal!important;overflow-wrap:normal!important}
  #page-content table.sv-mobile-wide-table :where(th,td).sv-wrap-cell{white-space:normal!important;min-width:150px!important}
  #page-content table.sv-mobile-wide-table thead th{position:sticky!important;top:0!important;z-index:var(--sv-z-sticky)!important}
  #page-content table.sv-mobile-wide-table.sv-sticky-edges :where(th:first-child,td:first-child){position:sticky!important;inset-inline-start:0!important;z-index:calc(var(--sv-z-sticky) + 1)!important;background:inherit!important;box-shadow:-1px 0 0 #e2e9ee!important}
  #page-content table.sv-mobile-wide-table.sv-sticky-edges :where(th:last-child,td:last-child){position:sticky!important;inset-inline-end:0!important;z-index:calc(var(--sv-z-sticky) + 1)!important;background:inherit!important;box-shadow:1px 0 0 #e2e9ee!important}
  #page-content .table-wrap.sv-scrollable-x{position:relative!important}
  #page-content .table-wrap.sv-scrollable-x::after{content:"";position:sticky;inset-inline-start:8px;bottom:6px;display:inline-flex;align-items:center;min-height:25px;padding:3px 8px;border-radius:999px;background:rgba(17,55,82,.9);color:#fff;font-size:9.5px;font-weight:750;line-height:1.4;pointer-events:none;opacity:.9;z-index:5}
  #page-content .table-wrap.sv-scrolled-x::after{opacity:0}
  #page-content .table-wrap::-webkit-scrollbar{height:7px!important}
  #page-content .table-wrap::-webkit-scrollbar-thumb{background:#b9c9d4!important;border-radius:99px!important}

  /* Touch targets and badges stay usable without visually inflating dense layouts. */
  #page-content :where(button,.btn,a[role="button"],summary){touch-action:manipulation;-webkit-tap-highlight-color:transparent}
  #page-content :where(.notification-badge,.badge-count,[data-bcfu-badge],[data-badge-count]){box-sizing:border-box!important;min-width:18px!important;max-width:42px!important;height:18px!important;padding-inline:5px!important;border-radius:999px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;line-height:18px!important;text-align:center!important}

  /* Forms are one-column, finger sized, and iOS-safe. */
  #page-content :where(.form-grid,.form-grid.cols-3,.employee-form-grid,.sales-entry-grid,.adjustments-filter,.inline-holiday-form){grid-template-columns:minmax(0,1fr)!important;gap:10px!important}
  #page-content .field{min-width:0!important;width:100%!important}
  #page-content :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){box-sizing:border-box!important;max-width:100%!important;min-height:44px!important}
  #page-content textarea{min-height:88px!important;resize:vertical!important}
  #page-content .form-footer{position:relative!important;display:flex!important;gap:7px!important;flex-wrap:wrap!important;margin-top:10px!important;padding-top:10px!important}
  #page-content .form-footer>.btn{flex:1 1 120px!important;min-height:44px!important}

  /* Modal / drawer contract. JS marks full vs sheet based on content. */
  body:not(.auth-active) .modal-backdrop{box-sizing:border-box!important;z-index:var(--sv-z-modal)!important;padding:0!important;align-items:flex-end!important;overflow:hidden!important}
  body:not(.auth-active) .modal.sv-mobile-modal--full,body:not(.auth-active) .modal-wide.sv-mobile-modal--full{box-sizing:border-box!important;width:100%!important;max-width:none!important;height:100dvh!important;max-height:100dvh!important;margin:0!important;border-radius:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important}
  body:not(.auth-active) .modal.sv-mobile-modal--sheet,body:not(.auth-active) .modal-wide.sv-mobile-modal--sheet{box-sizing:border-box!important;width:100%!important;max-width:none!important;max-height:82dvh!important;margin:0!important;border-radius:20px 20px 0 0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important}
  body:not(.auth-active) :where(.modal,.modal-wide) .modal-head{position:sticky!important;top:0!important;z-index:2!important;min-height:54px!important;padding:9px 12px!important;flex:0 0 auto!important}
  body:not(.auth-active) :where(.modal,.modal-wide) .modal-body{min-height:0!important;overflow:auto!important;padding:12px!important;-webkit-overflow-scrolling:touch!important}
  body:not(.auth-active) :where(.modal,.modal-wide) .modal-actions{position:sticky!important;bottom:0!important;z-index:2!important;display:flex!important;gap:7px!important;flex-wrap:wrap!important;padding:8px 12px calc(8px + env(safe-area-inset-bottom))!important;flex:0 0 auto!important}
  body:not(.auth-active) :where(.modal,.modal-wide) .modal-actions>.btn{flex:1 1 120px!important;min-height:44px!important}
  body:not(.auth-active) :where(.sales-entry-drawer,.so-drawer,.attendance-v110-drawer,.rec-drawer,.rec-upload-drawer,.rec-technical-drawer,.v367-action-drawer,.bcv391-drawer){box-sizing:border-box!important;position:fixed!important;inset:0!important;width:100%!important;max-width:none!important;height:100dvh!important;max-height:100dvh!important;margin:0!important;border-radius:0!important;transform:none!important;overflow:hidden!important}
  body:not(.auth-active) :where(.sales-entry-drawer,.so-drawer,.attendance-v110-drawer,.rec-drawer,.rec-upload-drawer,.rec-technical-drawer,.v367-action-drawer,.bcv391-drawer)>header{position:sticky!important;top:0!important;z-index:2!important;min-height:54px!important}
  body:not(.auth-active) :where(.attendance-v110-drawer-body,.rec-drawer-body,.so-drawer-body,.sales-entry-form){min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch!important}

  /* Pagination never becomes a desktop number wall. */
  #page-content .pagination{display:flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;flex-wrap:wrap!important;width:100%!important;padding:8px 0!important}
  #page-content .pagination button{min-width:40px!important;min-height:40px!important;padding:0 8px!important}
  #page-content .pagination button:not(.active):not(:first-child):not(:last-of-type){display:none!important}
  #page-content .pagination small{flex-basis:100%!important;text-align:center!important;font-size:10px!important}

  /* Toasts and notifications must stay above dock/keyboard. */
  .toast-stack{z-index:var(--sv-z-toast)!important;left:10px!important;right:10px!important;bottom:calc(var(--sv-mobile-dock-h) + 14px + env(safe-area-inset-bottom))!important;width:auto!important;max-width:none!important;align-items:stretch!important}
  .toast{box-sizing:border-box!important;width:100%!important;min-width:0!important;max-width:100%!important}
  body.sv-keyboard-open .toast-stack,body.sv-overlay-open .toast-stack{bottom:12px!important}

  /* Media and long record sections. */
  #page-content img,#page-content video,#page-content canvas,#page-content svg{max-width:100%}
  #page-content :where(.case-detail,.case-workspace,.brokerage-case,.support-case){min-width:0!important;max-width:100%!important}
  #page-content :where(.card,.panel,.form-card,.feature-card){max-width:100%;min-width:0}

  /* Reduced motion and mobile performance. */
  @media (prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}
}

@media (max-width:430px){
  :root{--sv-mobile-inline:9px;--sv-mobile-gap:7px;--sv-mobile-dock-h:50px}
  body:not(.auth-active) #page-content{padding-inline:9px!important}
  #page-content>.tiam-page-hero{grid-template-columns:36px minmax(0,1fr) auto!important;padding:6px 7px!important;gap:6px!important;border-radius:12px!important}
  #page-content>.tiam-page-hero .tiam-page-hero__visual{width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important}
  #page-content>.tiam-page-hero .tiam-page-hero__copy :where(h1,h2){font-size:16px!important}
  #page-content>.tiam-page-hero .tiam-page-hero__actions>:where(button,a,summary,.tiam-header-action--icon,.tiam-head-icon-action),.sv-mobile-header-more{width:42px!important;min-width:42px!important;height:42px!important;min-height:42px!important;flex-basis:42px!important}
  .tiam-mobile-bottom-v358{right:5px!important;left:5px!important;bottom:max(3px,env(safe-area-inset-bottom))!important;height:50px!important;min-height:50px!important;border-radius:14px!important}
  .tiam-mobile-bottom-v358 button{height:42px!important;min-height:42px!important;padding:0 4px!important}
  #page-content :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){font-size:16px!important}
  .sv-mobile-sheet__panel{max-height:84dvh!important;border-radius:18px 18px 0 0!important}
  body[data-page="experts"] #v286-employee-table.sv-mobile-card-table tbody td{font-size:11.5px!important;padding:7px 8px!important}
}

@media (max-width:340px){
  :root{--sv-mobile-inline:7px}
  body[data-page="experts"] .hr431-employee-summary{grid-template-columns:1fr 1fr!important}
  body[data-page="experts"] .hr431-employee-summary>article:last-child{grid-column:1/-1!important}
  .tiam-mobile-bottom-v358 button[data-more] span{display:none!important}
}

@media (max-width:900px) and (orientation:landscape) and (max-height:520px){
  :root{--sv-mobile-dock-h:48px}
  body:not(.auth-active) #page-content{padding-top:6px!important;padding-bottom:calc(54px + env(safe-area-inset-bottom))!important}
  #page-content>.tiam-page-hero{min-height:48px!important;padding-block:4px!important;margin-bottom:6px!important}
  .tiam-mobile-bottom-v358{height:48px!important;min-height:48px!important}
  .tiam-mobile-bottom-v358 button{height:40px!important;min-height:40px!important}
  .sv-mobile-sheet__panel{max-height:92dvh!important}
}

@media print{
  .tiam-mobile-bottom-v358,.tiam-mobile-more-v358,.sv-mobile-sheet,.sv-mobile-header-more,.sv-mobile-filter-trigger{display:none!important}
  #page-content{overflow:visible!important;padding:0!important;height:auto!important}
}

/* v570.1 specificity guards against older desktop-first !important rules. */
@media (max-width:900px){
  body:not(.auth-active) #page-content>.tiam-page-hero .tiam-page-hero__actions>.sv-mobile-overflow-action{display:none!important;width:0!important;min-width:0!important;height:0!important;min-height:0!important;padding:0!important;margin:0!important;border:0!important;overflow:hidden!important;pointer-events:none!important;flex:0 0 0!important}
  body:not(.auth-active) #page-content .sv-mobile-filter-host>.sv-mobile-filter-secondary{display:none!important;width:0!important;min-width:0!important;height:0!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;overflow:hidden!important;pointer-events:none!important}
  body[data-page="experts"] #page-content #v286-employee-table.sv-mobile-card-table tbody tr[data-employee-row]{height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body[data-page="experts"] #page-content #v286-employee-table.sv-mobile-card-table tbody tr[data-employee-row]>td{box-sizing:border-box!important;width:auto!important;max-width:none!important;min-width:0!important;height:auto!important;max-height:none!important;overflow:visible!important;white-space:normal!important}
  body[data-page="experts"] #page-content #v286-employee-table.sv-mobile-card-table tbody tr[data-employee-row]>td:first-child,
  body[data-page="experts"] #page-content #v286-employee-table.sv-mobile-card-table tbody tr[data-employee-row]>td:last-child{width:100%!important;max-width:100%!important}
}
