/* The existing sidebar and account controls retain their desktop behavior. */
[data-wallet-toggle], #desk-sidebar .client-phone-contact {display:none}
@media (max-width:760px) {
  html body[data-portal-design="client"], html[data-desk-folded] body[data-portal-design="client"] {
    --rail:0px; --gutter:clamp(14px,4vw,22px); padding-inline-start:0;
  }
  html:not([data-desk-open]) body[data-portal-design="client"] #desk-sidebar {
    visibility:hidden;transform:translateX(-100%);pointer-events:none;
  }
  html body[data-portal-design="client"] > .portal-header,
  html body[data-portal-design="client"].ll-phone-navigation > .portal-header:has(.client-wallet) {
    display:grid; grid-template-columns:44px minmax(0,1fr) auto auto;
    align-items:center;gap:0 6px;position:relative;inset:auto;
    height:auto;min-height:58px;width:100%;margin:0;
    padding:max(7px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 7px max(12px,env(safe-area-inset-left));
    background:#fcfbf8;border-bottom:1px solid #d8ded9;color:#193137;
  }
  html body[data-portal-design="client"] .portal-header > #desk-toggle {grid-area:1/1;margin:0;position:static}
  html body[data-portal-design="client"] .portal-header > .desk-trail {grid-area:1/2;display:flex;flex-flow:column;align-items:flex-start;gap:0;min-width:0;white-space:normal}
  html body[data-portal-design="client"] .desk-trail .desk-portal-name {font:600 15px/1.2 Arial,sans-serif;color:#193137;text-decoration:none}
  html body[data-portal-design="client"] .desk-trail #desk-page-name {display:block;font:400 12px/1.2 Arial,sans-serif;color:#4c6059;overflow-wrap:anywhere;white-space:normal}
  html body[data-portal-design="client"] .portal-header > a {display:none}
  #desk-sidebar .client-phone-contact {display:flex;align-items:center;min-height:44px}
  html body[data-portal-design="client"] .portal-header > [data-wallet-toggle]:not([hidden]) {
    display:inline-flex;grid-area:1/3;align-items:center;justify-content:center;gap:7px;
    height:44px;min-width:44px;padding:0 10px;margin:0;border:1px solid #c6d1c9;border-radius:6px;
    color:#254a3f;background:#eef3ed;font:600 14px/1.2 Arial,sans-serif;cursor:pointer;
  }
  [data-wallet-toggle]::after {content:'';width:6px;height:6px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:translateY(-1px) rotate(45deg)}
  [data-wallet-toggle][aria-expanded="true"]::after {transform:translateY(1px) rotate(225deg)}
  html body[data-portal-design="client"] .portal-header > #desk-client-account {grid-area:1/4;position:static;margin:0}
  html body[data-portal-design="client"] #desk-client-account > summary {
    display:grid;place-items:center;min-height:44px;min-width:44px;width:44px;padding:0;border:1px solid #d5dcd5;border-radius:6px;list-style:none;
  }
  #desk-client-account > summary::after,#desk-client-account > summary::-webkit-details-marker{display:none}
  #desk-client-name{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap}
  html body[data-portal-design="client"] #desk-client-tools {position:absolute;inset:54px 12px auto auto;width:min(300px,calc(100vw - 24px));max-height:70dvh;overflow:auto;z-index:45}
  html body[data-portal-design="client"] #desk-client-tools :is(a,button){min-height:44px}
  html body[data-portal-design="client"] .portal-header:not([data-wallet-open]) > .client-wallet {display:none}
  html body[data-portal-design="client"] .portal-header[data-wallet-open] > .client-wallet {display:block;grid-area:2/1/auto/-1;width:100%;margin:8px 0 2px;min-width:0}
  html body[data-portal-design="client"] .client-wallet .client-wallet-wheel {display:none}
  html body[data-portal-design="client"] .client-wallet .client-wallet-group {
    width:100%;max-width:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;
    padding:6px;border:1px solid #d5dfd8;border-radius:8px;background:#f2f5f0;
  }
  html body[data-portal-design="client"] .client-wallet .client-wallet-field {display:flex;align-items:center;min-width:0;min-height:44px;padding:5px 8px}
  html body[data-portal-design="client"] .client-wallet-field::before {display:none}
  html body[data-portal-design="client"] .client-wallet :is(.client-wallet-field>span,.client-wallet-value,.client-wallet-label,.client-wallet-value strong) {min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
  .client-wallet .client-wallet-value small:empty {display:none}
  html body[data-portal-design="client"] .client-wallet .client-funding-trigger {position:static;inset:auto;grid-column:auto;width:100%;min-width:0;min-height:44px;margin:0}
  html body[data-portal-design="client"] :is(.portal-shell,.phone-guide) {width:100%;min-width:0;margin:0 auto;padding:18px max(var(--gutter),env(safe-area-inset-right)) max(32px,env(safe-area-inset-bottom)) max(var(--gutter),env(safe-area-inset-left))}
  html body[data-portal-design="client"] :is(.portal-card,.campaign-card,.workflow-row,.lead-row,.detail-grid>div,.section-heading>*,.lead-filters>*,.desk-identity>div,#account-gate>section) {min-width:0;overflow-wrap:anywhere}
  #account-gate:has(>[data-panel="overview"][hidden]) > .account-top {display:none}
  html body[data-portal-design="client"] .account-top {padding:16px;border-radius:8px}
  html body[data-portal-design="client"] .account-top .desk-hero-top {display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
  html body[data-portal-design="client"] .account-top .desk-identity {min-width:0;gap:8px}
  html body[data-portal-design="client"] .account-top .desk-identity h1 {font-size:clamp(28px,7vw,34px);margin:4px 0}
  html body[data-portal-design="client"] .account-top .desk-emblem{display:none}
  html body[data-portal-design="client"] .desk-hero-actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  html body[data-portal-design="client"] .desk-hero-actions a {min-height:44px;white-space:normal}
  html body[data-portal-design="client"] .desk-quick {display:flex;flex-wrap:wrap;gap:0 14px;padding-top:4px;margin-top:10px}
  html body[data-portal-design="client"] .desk-quick button {min-height:44px}
  html body[data-portal-design="client"] .stat-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:16px 0 22px}
  html body[data-portal-design="client"] .stat-grid article {padding:12px;min-width:0}
  html body[data-portal-design="client"] .stat-grid strong {font-size:30px;margin-top:4px}
  html body[data-portal-design="client"] .section-heading {gap:8px 12px;flex-wrap:wrap;align-items:center;margin:18px 0 12px}
  html body[data-portal-design="client"] :is(.lead-filters,.detail-grid) {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  html body[data-portal-design="client"] .lead-filters>:first-child,html body[data-portal-design="client"] .lead-filters>button {grid-column:1/-1}
  html body[data-portal-design="client"] .lead-filters :is(input,select){width:100%;min-height:44px;font-size:16px}
  html body[data-portal-design="client"] .lead-row {display:grid;grid-template-columns:minmax(0,1fr);gap:6px;padding:12px 0}
  html body[data-portal-design="client"] .lead-row>div:last-child {text-align:start}
  html body[data-portal-design="client"] :is(.pagination,.detail-head,.workflow-row summary){flex-wrap:wrap;gap:8px}
  html body[data-portal-design="client"] .pagination button {min-height:44px}
  html body[data-portal-design="client"] dialog {box-sizing:border-box;max-width:calc(100% - 20px);max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain}
  html body[data-portal-design="client"] .lead-dialog audio{width:100%;min-width:0}
  html body[data-portal-design="client"] .lead-dialog :is(input,textarea,select) {width:100%;max-width:100%;min-width:0}
  html body[data-portal-design="client"] .portal-foot {padding-inline:var(--gutter);flex-wrap:wrap}
}
@media(max-width:359px){
  html body[data-portal-design="client"] :is(.lead-filters,.detail-grid){grid-template-columns:minmax(0,1fr)}
}
@media(max-width:760px){
  html body[data-portal-design="client"].ll-phone-navigation #desk-sidebar {transition-property:transform}
  html body[data-portal-design="client"] #account-gate .account-top {background:#20373a;color:#fff}
  html body[data-portal-design="client"] #account-gate .account-top::after,
  html body[data-portal-design="client"] #account-gate .account-top .desk-eyebrow::before {content:none}
  html body[data-portal-design="client"] #account-gate .desk-quick {background:transparent}
  html body[data-portal-design="client"] #account-gate .desk-quick button{background:transparent}
}
@media(max-width:760px){
  html body[data-portal-design="client"]:has(#account-gate > a[href*="login.html"]) .portal-header > :is([data-wallet-toggle],.client-wallet){display:none}
}
@media(min-width:761px){
  #desk-sidebar .desk-bottom a.client-phone-contact,.portal-header button[data-wallet-toggle]{display:none!important}
}
@media(max-width:760px){
  html body[data-portal-design="client"] #lead-filters {grid-template-areas:none}
  html body[data-portal-design="client"] #lead-filters > * {grid-area:auto}
  html body[data-portal-design="client"] #lead-filters > :is(div:first-child,button){grid-column:1/-1}
}
