/* GZ-EMPLOYEE-IPHONE-EDGE-20261115: full-width phone canvas. */
@media (max-width:767px){
  .emp-dashboard-inner{width:100%;max-width:none;margin:0;padding:env(safe-area-inset-top,0px) 0 env(safe-area-inset-bottom,0px);gap:0}
  .emp-topbar{display:grid;grid-template-columns:minmax(0,1fr) auto;height:auto;min-height:64px;padding:4px max(12px,env(safe-area-inset-right,0px)) 4px max(12px,env(safe-area-inset-left,0px));gap:0 6px;border:0;border-radius:0;box-shadow:none}
  .emp-topbar .emp-brand{grid-column:1;grid-row:1}
  .emp-brand .emp-logo{width:104px;height:36px}
  .emp-topbar .emp-tools{grid-column:2;grid-row:1;gap:2px}
  .emp-tools .emp-icon{width:40px;height:44px;border:0;background:transparent;box-shadow:none}
  .emp-topbar time{grid-column:1 / -1;grid-row:2;justify-content:center;font-size:10px;line-height:16px;padding:0;gap:6px}
  .emp-overview{width:100%;border-radius:0;scroll-padding-block:0;scrollbar-width:none}
  .emp-overview::-webkit-scrollbar{display:none}
  .emp-dashboard-cards{gap:8px}
  .emp-card{border:0;border-radius:0;box-shadow:none}
  .emp-identity-copy{padding:12px max(14px,env(safe-area-inset-right,0px)) 12px 30%}
  .emp-identity h1{font-size:18px;line-height:1.4}
  .emp-portrait,.emp-portrait.male{max-width:29%}
  .emp-facts{gap:6px 8px}
  .emp-leave,.emp-advances{padding:12px max(14px,env(safe-area-inset-right,0px)) 12px max(14px,env(safe-area-inset-left,0px))}
  .emp-main-number strong{font-size:34px}
  .emp-advances .employee-auth-text-button{font-size:12px;font-weight:400;margin-top:8px}
  .emp-monthly{padding-inline:8px}
  .emp-nav{width:100%;max-width:none;align-items:center;padding:6px max(8px,env(safe-area-inset-right,0px)) 6px max(8px,env(safe-area-inset-left,0px));background:var(--emp-bg)}
  .emp-nav button,.emp-nav button.emp-nav-raised{width:44px;margin:0;border:0;box-shadow:none}
  .emp-nav button.emp-add{width:48px;margin:0;box-shadow:none}
  .emp-nav svg{width:21px;height:21px}
}


/* Employee templates are also reached from the Home button, outside React. */
@media (max-width:767px){
 body:has(>.app){padding:0;margin:0}
 body>.app{width:100%;max-width:none;margin:0;padding:0 0 calc(70px + env(safe-area-inset-bottom,0px));gap:8px}
 body>.app>.card,body>.app>.stats{border:0;border-radius:0;box-shadow:none}
 body>.app>.hdr.hdr{position:sticky!important;top:0!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:4px 12px!important;min-height:64px;gap:2px 6px!important;background:var(--card)!important;z-index:19!important}
 body>.app>.hdr .guh-brand img{width:104px!important;max-height:36px}
 body>.app>.hdr .guh-clock{order:5;flex-basis:100%;font-size:10px!important;line-height:16px!important}
 body>.app>.hdr :is(.sq,.guh-actions>button){width:36px!important;min-width:36px!important;height:40px!important;min-height:40px!important;border:0!important;background:transparent!important}
 body>.app .emp h1{font-size:18px;line-height:1.4}
 body>.app .role{flex-wrap:wrap;font-size:12px}
 body>.app .card-head h2{font-size:14px}
 body>.app .facts{width:74%;gap:6px 8px}
 body>.app .facts dt{font-size:10px}
 body>.app .facts dd{font-size:12px}
 body>.app .blob{width:120px;height:120px;left:-30px}
 body>.app>.nav[data-gazali-bottom]{width:100%!important;max-width:none;left:0!important;right:0!important;bottom:0!important;transform:none!important;margin:0!important;border:0;border-radius:0;box-shadow:none;padding:6px 8px calc(6px + env(safe-area-inset-bottom,0px));grid-template-columns:repeat(5,minmax(0,1fr));min-height:60px}
 body>.app>.nav button{min-height:44px;margin:0;font-size:10px}
 body>.app>.nav .plus{width:46px;height:46px;min-height:46px;margin:0;justify-self:center;box-shadow:none}
 body>.app>.nav button svg{width:21px;height:21px}
 body>.app .adv .follow{font-size:13px}
 body .emp-dashboard .emp-topbar .emp-icon{border:0!important}
 .emp-dashboard-cards>.emp-salary-card{border:0;border-radius:0;box-shadow:none}
}

/* Employee identity strip, shared by the live card and dashboard panels. */
body>.app>.employee-strip, .emp-dashboard .employee-strip {
  --strip-line:#dce0e3; --strip-fill:#fafbfc; --strip-ink:#2e3b40;
  position:sticky; top:0; z-index:19; display:grid; grid-template-columns:auto minmax(0,1fr) auto;
  box-sizing:border-box; width:100%; height:auto; min-height:48px; flex:none;
  align-items:center; gap:clamp(2px,.8vw,10px); margin:0; padding:4px clamp(4px,1.3vw,14px);
  border:1px solid var(--strip-line); border-radius:20px; background:var(--strip-fill); color:var(--strip-ink); box-shadow:none;
}
html[data-theme=dark] .employee-strip,.emp-dashboard[data-theme=dark] .employee-strip{--strip-line:#4b5358;--strip-fill:#272c30;--strip-ink:#eee}
@media(prefers-color-scheme:dark){html:not([data-theme=light]) body>.app>.employee-strip{--strip-line:#4b5358;--strip-fill:#272c30;--strip-ink:#eee}}
.employee-strip .strip-brand{grid-column:1;grid-row:1;display:flex;flex-direction:row;align-items:center;gap:clamp(2px,1vw,10px)}
.employee-strip .strip-mark{display:block;flex:none;width:26px;height:28px;border-radius:5px;background:#fff url('/employee-portal/header-brand-reference.jpg') -10px -35px / 390px 90px no-repeat}
.employee-strip .strip-brand img{display:block;width:clamp(43px,12vw,88px);height:auto;object-fit:contain}
.employee-strip .strip-clock{grid-column:2;grid-row:1;display:grid;justify-content:center;align-content:center;gap:0;min-width:0;padding:0;margin:0;white-space:nowrap;text-align:center;direction:ltr;font:500 clamp(9px,2.4vw,13px)/1.3 'IBM Plex Sans Arabic',sans-serif;font-variant-numeric:tabular-nums}
.employee-strip .strip-actions{grid-column:3;grid-row:1;display:flex;align-items:center;gap:clamp(1px,.7vw,6px)}
body .employee-strip .strip-actions :is(.sq,.emp-icon,.gazali-page-back){--gazali-back-size:clamp(29px,8.5vw,44px);box-sizing:border-box;display:grid;place-items:center;width:var(--gazali-back-size)!important;min-width:var(--gazali-back-size)!important;height:var(--gazali-back-size)!important;min-height:var(--gazali-back-size)!important;padding:3px!important;border-radius:9px!important;border:1px solid var(--strip-line)!important;background:var(--strip-fill)!important;color:var(--strip-ink)!important;box-shadow:none!important}
.employee-strip .strip-actions svg{width:17px;height:17px}
.employee-strip .gazali-page-back svg{background:linear-gradient(currentColor,currentColor) 45% 50% / 11px 1.5px no-repeat}
.employee-strip .gazali-back-slot{display:flex;align-items:center}
.emp-dashboard.emp-dashboard[data-theme]{background-image:none}
.employee-type{display:flex;gap:.55rem;align-items:center;flex-wrap:wrap;margin-block:8px;color:var(--ink);font-size:13px}
.employee-type label{color:var(--muted)}
.employee-type select{font:inherit;color:inherit;background:var(--card);border:1px solid var(--line);border-radius:8px;padding:4px 8px}
.employee-card-portrait{position:absolute;left:0;bottom:0;width:25%;max-width:205px;height:86%;object-fit:contain;object-position:center bottom;pointer-events:none}
.app>.emp>.wm{z-index:0}.app>.emp>.employee-card-portrait{z-index:1}
.app>.emp .facts dd{color:var(--ink)}

/* The caption and illustration share a column so the badge follows the head
   of either portrait, including when a short viewport scales the image down. */
.emp-dashboard-cards>.employee-services,.employee-home .app>.employee-services{display:contents}
.employee-service-figure{position:absolute;left:0;top:6px;bottom:0;width:29%;margin:0;padding:0 3px;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:3px;pointer-events:none;z-index:1}
.employee-service-figure figcaption{display:grid;gap:2px;justify-items:center;flex:none;box-sizing:border-box;max-width:100%;padding:4px 6px;border-radius:10px;background:var(--emp-soft,var(--card,#f1f2f3));color:inherit;text-align:center;font-size:12px;line-height:1.4}
.employee-service-figure figcaption>span{font-size:10px;color:var(--emp-muted,var(--muted,#60686d))}
.employee-service-figure gazali-service-duration{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.employee-service-figure:has(img[hidden]),.employee-service-figure:not(:has(img)){justify-content:center}
.employee-service-figure img:is(.emp-portrait,.employee-card-portrait){position:static;display:block;flex:0 1 auto;min-height:0;width:auto;max-width:100%;height:auto;max-height:76%;object-fit:contain;object-position:center bottom;z-index:auto}
.employee-service-figure img[hidden]{display:none!important}
.employee-home .employee-static-copy{position:relative;z-index:2;margin-left:30%}
.employee-home .app .employee-static-copy :is(.facts,hr){width:100%}
.emp-dashboard .emp-identity-copy{padding-left:31%}

/* Keep the document, portrait and navigation anchored. Services that need more
   space on a short screen scroll in their own region, as do open forms. */
@media screen{
  html:has(.emp-dashboard),body:has(.emp-dashboard),html:has(body.employee-home),body.employee-home{overflow:hidden;overscroll-behavior:none}
  .emp-dashboard,.employee-home>.app{height:100vh;height:100dvh;max-height:100dvh;min-height:0;box-sizing:border-box;overscroll-behavior:none}
  html body.employee-home>.app:has(>.employee-services){padding-bottom:0!important}
  .emp-dashboard{position:fixed;inset:0}
  .emp-dashboard .emp-overview{min-height:0;overflow:clip}
}
@media screen and (max-width:1023px),screen and (max-height:720px){
  .emp-dashboard .emp-overview{display:flex;flex-direction:column;justify-content:flex-start}
  .emp-dashboard .emp-dashboard-cards{display:grid;grid-template: auto minmax(0,1fr) / minmax(0,1fr);gap:0;flex:1;min-height:0;align-content:stretch}
  .emp-dashboard .emp-identity{grid-area:auto;min-height:0;max-height:45dvh}
  .emp-dashboard .emp-identity-copy{max-height:45dvh;overflow-y:auto;overscroll-behavior:contain}
  .emp-dashboard-cards>.employee-services,.employee-home .app>.employee-services{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;min-height:0;overflow-y:auto;overscroll-behavior:contain;gap:1px}
  .employee-services>:is(.emp-card,.emp-salary-card,.card,.stats){grid-area:auto;min-height:0;border-radius:0;border:0;box-shadow:none}
  .employee-services>:is(.emp-leave,.emp-advances,.leave,.adv){padding:9px 10px}
  .employee-services :is(.emp-card-heading,.card-head){flex-wrap:wrap;gap:4px}
  .employee-services :is(.emp-card-heading h2,.card-head h2){font-size:14px}
  .employee-services .emp-main-number{flex-wrap:wrap;gap:4px;margin:6px 0}
  .employee-services .emp-main-number strong{font-size:23px;line-height:1}
  .employee-services :is(.emp-progress,.emp-recent,.emp-loan-facts,.wm,.tri,.meter,.bar){display:none}
  .employee-services .emp-incomplete{font-size:10px;line-height:1.4}
  .employee-services>.emp-salary-card,.employee-services>.emp-monthly,.employee-services>.stats{grid-column:1/-1}
  .employee-services>.emp-salary-card{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px}
  .employee-services>.emp-salary-card>header{margin:0}
  .employee-services>.emp-salary-card>:not(header):not(button){display:none}
  .employee-services .emp-salary-details{width:auto;max-width:55%;min-height:40px;padding:0;text-align:start}
  .employee-services .emp-monthly{min-height:44px}
  .employee-services .emp-monthly button{min-height:44px}
  body.employee-home>.app{display:flex;flex-direction:column;gap:0;padding:env(safe-area-inset-top,0px) 0 0;overflow:hidden}
  .employee-home .app>.emp{flex:none;min-height:0;max-height:45dvh;box-sizing:border-box;padding:8px 12px}
  .employee-home .employee-static-copy{max-height:calc(45dvh - 16px);overflow:auto;overscroll-behavior:contain}
  .employee-home .app>.employee-services{flex:1}
  .employee-home .app>.nav[data-gazali-bottom]{position:static!important;align-self:center;transform:none!important;margin:0!important;flex:none;min-height:48px;padding-bottom:max(4px,env(safe-area-inset-bottom,0px))}
  .employee-home .employee-services .lv-row{flex-wrap:wrap}
  .employee-home .employee-services .lv-note{margin:5px 0}
  .employee-home .employee-services .cta-leave{padding:7px;gap:4px}
  .employee-home .employee-services .cta-leave b{font-size:13px}
  .employee-home .employee-services .cta-leave :is(.ic,small){display:none}
  .employee-home .employee-services .stats{margin:0}
}
@media screen and (min-width:1024px) and (min-height:721px){
  .emp-dashboard .emp-dashboard-cards,.employee-home>.app{max-height:100%;min-height:0}
  .emp-dashboard .emp-dashboard-cards>.employee-services,.employee-home .app>.employee-services{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;min-height:0;overflow:auto;overscroll-behavior:contain;align-content:start}
  .emp-dashboard .emp-dashboard-cards{grid-template-columns:minmax(0,1fr) minmax(0,1.7fr);grid-template-rows:minmax(0,1fr)}
  .emp-dashboard .emp-identity,.employee-services>:is(.emp-card,.card,.emp-salary-card){grid-area:auto}
  .emp-dashboard .emp-identity-copy{max-height:100%;overflow:auto}
  .employee-home>.app{display:grid;grid-template-columns:1fr 1.6fr;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden}
  .employee-home .app>.emp{grid-area:2/1}
  .employee-home .app>.employee-strip,.employee-home .app>.nav{grid-column:1/-1}
  .employee-home .app>.employee-services{grid-area:2/2}
  .employee-home .app>.nav[data-gazali-bottom]{position:static!important;transform:none!important}
  .employee-home .app .stats,.employee-services>.emp-monthly{grid-column:1/-1}
}
