/* Customer panel: the phone drawer's account menu (customer-panel-drawer-account.js).
   IT4Y_CUSTOMER_DRAWER_ACCOUNT_START
   One compact row at the drawer's foot (avatar, name and e-mail on one line each with an ellipsis, a chevron) and a panel that
   opens in flow directly below it. Nothing is positioned over the navigation: the navigation scrolls in its own region above
   the foot, the foot grows when the panel opens, and the navigation keeps at least 96px (customer-panel-mobile-sidebar.css).
   The foot is a flex column that may shrink: when the drawer is short (a landscape phone, a wrapped name, a home-indicator
   inset) the panel scrolls by itself and sign out stays reachable; no height is hard-coded.
   Logical properties only, so RTL mirrors by itself. Desktop hides the foot (the header carries the session, theme and
   sign-out controls there). */
:root{
  --i-user:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' \
stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E");
}
.icon--user{--icon:var(--i-user)}
#app-sidebar .drawer-account{display:none}

@media(max-width:900px){
  #app-sidebar .drawer-account{display:flex;flex-direction:column;flex:0 1 auto;min-height:0;
    padding:6px 8px max(6px,env(safe-area-inset-bottom,0px));border-top:1px solid var(--border-soft);background:var(--bg-2)}

  /* The row: 52px tall, every line one line with an ellipsis; expanded, the full name and e-mail show, wrapping. */
  #app-sidebar .drawer-account-toggle{display:flex;flex:0 0 auto;align-items:center;gap:10px;box-sizing:border-box;width:100%;
    min-height:52px;margin:0;
    padding:6px 8px;border:0;border-radius:10px;background:transparent;color:var(--text);font:inherit;text-align:start;cursor:pointer;
    touch-action:manipulation}
  #app-sidebar .drawer-account-toggle[aria-expanded="true"]{background:color-mix(in srgb,var(--text) 6%,transparent)}
  #app-sidebar .drawer-account-avatar{display:inline-flex;flex:0 0 32px;align-items:center;justify-content:center;width:32px;height:32px;
    border-radius:50%;background:var(--accent-fill);color:#fff;font-size:13px;font-weight:700;line-height:1}
  #app-sidebar .drawer-account-text{display:grid;flex:1 1 auto;gap:1px;min-width:0}
  #app-sidebar .drawer-account-name,#app-sidebar .drawer-account-mail{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  #app-sidebar .drawer-account-name{font-size:14px;font-weight:600;line-height:1.3}
  #app-sidebar .drawer-account-mail{color:var(--text-dim);font-size:12px;line-height:1.3}
  #app-sidebar .drawer-account-chevron{flex:0 0 16px;width:16px;height:16px;fill:none;stroke:var(--muted);stroke-width:2;stroke-linecap:round;
    stroke-linejoin:round;transition:transform .15s ease}
  #app-sidebar .drawer-account-toggle[aria-expanded="true"] .drawer-account-chevron{transform:rotate(180deg)}
  /* Collapsed: the greeting name. Expanded: the full account name and e-mail, wrapping, never cut. */
  #app-sidebar .drawer-account-toggle[aria-expanded="false"] .drawer-account-name-full,
  #app-sidebar .drawer-account-toggle[aria-expanded="true"] .drawer-account-name-short{display:none}
  #app-sidebar .drawer-account-toggle[aria-expanded="true"] .drawer-account-name,
  #app-sidebar .drawer-account-toggle[aria-expanded="true"] .drawer-account-mail{overflow:visible;white-space:normal;overflow-wrap:anywhere}

  /* The panel: in flow below the row, never over the menu. It takes what the drawer has left after the row and the menu's
     96px floor and scrolls by itself beyond that (the foot is a shrinkable flex column). */
  #app-sidebar .drawer-account-sheet{position:static;flex:0 1 auto;box-sizing:border-box;min-block-size:0;margin-block-start:4px;
    padding-block-start:4px;overflow-y:auto;overscroll-behavior:contain;border-top:1px solid var(--border-soft)}
  /* Names and e-mails carry their own direction (dir=auto, dir=ltr), so start would follow the text, not the drawer: they align
     with the drawer's side explicitly (text-align:match-parent is not supported in Chromium). */
  #app-sidebar .drawer-account-text>*{text-align:left}
  html[dir="rtl"] #app-sidebar .drawer-account-text>*{text-align:right}
  #app-sidebar .drawer-account-name{unicode-bidi:isolate}
  #app-sidebar .drawer-account-id{display:flex;align-items:center;gap:6px;min-width:0;padding-inline-start:10px;color:var(--muted);font-size:12px;
    line-height:1.35}
  #app-sidebar .drawer-account-id-text{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
  #app-sidebar .drawer-account-id code{color:var(--text-dim)}
  #app-sidebar .drawer-copy{display:inline-flex;flex:0 0 44px;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;
    min-height:44px;margin:0;padding:0;border:0;border-radius:10px;background:transparent;color:var(--text-dim);cursor:pointer;
    touch-action:manipulation}
  #app-sidebar .drawer-copy .icon{--hdr-ico:16px}

  /* Actions: account settings, the dark-theme switch and sign out, one 44px row each. */
  #app-sidebar .drawer-account-actions{display:grid;gap:2px;margin-block-start:4px;padding-block-start:4px;border-top:1px solid var(--border-soft)}
  #app-sidebar .drawer-account--plain .drawer-account-actions,#app-sidebar .drawer-account-sheet>.drawer-account-actions:first-child{margin:0;
    padding:0;border:0}
  #app-sidebar .drawer-account-item,#app-sidebar .drawer-theme,#app-sidebar .it4y-drawer-signout{display:flex;align-items:center;gap:9px;
    box-sizing:border-box;width:100%;min-height:44px;margin:0;padding:9px 11px;border:0;border-radius:9px;background:transparent;font:inherit;
    font-size:13px;font-weight:600;line-height:1.3;text-align:start;text-decoration:none;cursor:pointer;touch-action:manipulation}
  #app-sidebar .drawer-account-item,#app-sidebar .drawer-theme{color:var(--text)}
  #app-sidebar .drawer-account-item .icon,#app-sidebar .drawer-theme .icon{--hdr-ico:18px}
  #app-sidebar .drawer-account-toggle:focus-visible,#app-sidebar .drawer-copy:focus-visible,#app-sidebar .drawer-account-item:focus-visible,
  #app-sidebar .drawer-theme:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}

  /* The dark-theme switch: a track that follows aria-checked. Both track colours keep 3:1 against the sheet and against the
     white knob in both themes (WCAG 1.4.11). */
  #app-sidebar{--switch-off:var(--muted);--switch-on:var(--accent-fill)}
  html[data-theme="dark"] #app-sidebar{--switch-off:#64748b}
  #app-sidebar .drawer-theme-label{flex:1 1 auto;min-width:0}
  #app-sidebar .drawer-theme-track{position:relative;flex:0 0 36px;width:36px;height:20px;border-radius:999px;background:var(--switch-off);
    transition:background-color .15s ease}
  #app-sidebar .drawer-theme-track::after{content:"";position:absolute;inset-block-start:2px;inset-inline-start:2px;width:16px;height:16px;
    border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(2,6,23,.3);transition:transform .15s ease}
  #app-sidebar .drawer-theme[aria-checked="true"] .drawer-theme-track{background:var(--switch-on)}
  #app-sidebar .drawer-theme[aria-checked="true"] .drawer-theme-track::after{transform:translateX(16px)}
  html[dir="rtl"] #app-sidebar .drawer-theme[aria-checked="true"] .drawer-theme-track::after{transform:translateX(-16px)}

  /* Sign out: the danger token (foundation defines it for light and dark). */
  #app-sidebar .it4y-drawer-signout{color:var(--danger);font-weight:700}
  #app-sidebar .it4y-drawer-signout:focus-visible{outline:2px solid var(--danger);outline-offset:-2px}
  #app-sidebar .it4y-drawer-signout[aria-busy="true"]{cursor:progress;opacity:.6}
  #app-sidebar .it4y-drawer-signout svg{width:18px;height:18px;flex:0 0 18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;
    stroke-linejoin:round}

  /* Hover tints only where a pointer can hover: on a touch screen a tap leaves :hover on the control, so the collapsed row
     looked expanded until the next tap elsewhere. */
  @media(hover:hover){
    #app-sidebar .drawer-account-toggle:hover{background:color-mix(in srgb,var(--text) 6%,transparent)}
    #app-sidebar .drawer-copy:hover{background:color-mix(in srgb,var(--text) 7%,transparent);color:var(--text)}
    #app-sidebar .drawer-account-item:hover,#app-sidebar .drawer-theme:hover{background:color-mix(in srgb,var(--text) 6%,transparent)}
    #app-sidebar .it4y-drawer-signout:hover{background:color-mix(in srgb,currentColor 9%,transparent)}
  }
}

@media(prefers-reduced-motion:reduce){
  #app-sidebar .drawer-theme-track,#app-sidebar .drawer-theme-track::after,#app-sidebar .drawer-account-chevron{transition:none!important}
}
/* IT4Y_CUSTOMER_DRAWER_ACCOUNT_END */
