/* Preserve the original artwork without shrinking it into its transparent
   padding at compact desktop widths. */
@media (min-width:801px){
  body.terminal-mode>header .brand{overflow:hidden!important}
  body.terminal-mode>header .app-logo{object-fit:cover!important;object-position:center 46%!important}
}
@media (min-width:1000px){
  body.terminal-mode>header{display:grid!important;grid-template-columns:280px minmax(0,1fr) 390px!important;grid-template-rows:112px!important;gap:12px!important;height:112px!important;min-height:112px!important;padding:0 18px!important;align-items:center!important}
  body.terminal-mode>header .brand{position:static!important;grid-column:2!important;grid-row:1!important;justify-self:center!important;transform:none!important;width:100%!important;max-width:360px!important;height:90px!important;margin:0!important}
  body.terminal-mode>header .nav-toggle{position:static!important;grid-column:1!important;grid-row:1!important;justify-self:start!important;margin:0!important}
  body.terminal-mode>header .header-right{position:static!important;grid-column:1!important;grid-row:1!important;justify-self:start!important;left:auto!important;right:auto!important;bottom:auto!important;margin:0 0 0 57px!important}
  body.terminal-mode>header .terminal-status{position:static!important;grid-column:3!important;grid-row:1!important;justify-self:end!important;left:auto!important;right:auto!important;bottom:auto!important;margin:0!important}
}
/* One phone layout, after the legacy desktop styles. Keep account actions
   below the original artwork, with real 44px touch targets. */
@media (max-width:800px){
  body:is(.admin-mode,.terminal-mode)>header{
    display:grid!important;grid-template-columns:44px repeat(3,minmax(0,1fr)) 44px 44px!important;
    grid-template-rows:48px 44px 44px!important;gap:6px!important;
    height:auto!important;min-height:0!important;padding:8px 12px 12px!important;
    align-items:center!important;border-bottom:1px solid #ffffff25!important;
  }
  body:is(.admin-mode,.terminal-mode)>header .brand{
    position:static!important;grid-column:1/-1!important;grid-row:1!important;
    justify-self:center!important;transform:none!important;margin:0!important;
    width:220px!important;max-width:100%!important;height:48px!important;
    overflow:hidden!important;
  }
  body:is(.admin-mode,.terminal-mode)>header .app-logo{
    width:100%!important;max-width:none!important;height:100%!important;
    max-height:none!important;object-fit:cover!important;object-position:center 46%!important;
  }
  body:is(.admin-mode,.terminal-mode)>header :is(.header-right,.admin-header-navigation,.admin-account-stack){display:contents!important}
  body:is(.admin-mode,.terminal-mode)>header button{
    position:static!important;transform:none!important;margin:0!important;
    min-width:0!important;width:100%!important;max-width:none!important;
    min-height:44px!important;height:44px!important;padding:8px 6px!important;
    border-radius:10px!important;font-size:13px!important;line-height:1.15!important;
    letter-spacing:0!important;white-space:normal!important;box-sizing:border-box;
  }
  body:is(.admin-mode,.terminal-mode)>header button:focus-visible{outline:3px solid #ffe09a!important;outline-offset:2px}
  body.admin-mode>header .nav-toggle{grid-column:1!important;grid-row:2!important}
  body.admin-mode>header .admin-live-button{grid-column:2/5!important;grid-row:2!important;font-size:13px!important}
  body.admin-mode>header .admin-customer-qr{grid-column:5!important;grid-row:2!important;background:#ffffffed!important}
  body.admin-mode>header #approval-bell{grid-column:6!important;grid-row:2!important;display:grid!important;place-items:center!important;background:#ffffff18!important}
  body.admin-mode>header #approval-bell img{width:30px!important;min-width:0!important;height:30px!important;min-height:0!important}
  body.admin-mode>header .approval-bell-count{position:absolute;top:2px;right:2px}
  body.admin-mode>header #approval-bell{position:relative!important;top:auto!important;right:auto!important}
  body:is(.admin-mode,.terminal-mode)>header #language-toggle{
    grid-column:1/3!important;grid-row:3!important;display:block!important;
    width:100%!important;min-width:0!important;height:44px!important;padding:0!important;
    border:0!important;background:transparent!important;
  }
  body:is(.admin-mode,.terminal-mode)>header .language-face{font-size:13px!important;gap:5px!important}
  body:is(.admin-mode,.terminal-mode)>header .language-face img{width:22px!important;height:16px!important}
  body:is(.admin-mode,.terminal-mode)>header #language-switch{position:relative!important;width:100%!important;height:44px!important;min-height:44px!important}
  body.admin-mode>header :is(.nav-toggle,.admin-customer-qr,#approval-bell){width:100%!important;min-width:44px!important;height:44px!important;min-height:44px!important;padding:8px!important}
  body.admin-mode>header .admin-customer-qr img{width:26px!important;height:26px!important}
  body.admin-mode>header #language-toggle{grid-column:1/5!important;max-width:150px!important;justify-self:start!important}
  body.admin-mode>header #change-password{grid-column:5!important;grid-row:3!important}
  body.admin-mode>header #logout{grid-column:6!important;grid-row:3!important}
  body.admin-mode>header :is(#change-password,#logout){background:#ffffff12!important;border:1px solid #ffffff55!important;color:white!important}
  /* The phone post already has its own navigation and no sales controls. */
  body.terminal-mode>header{grid-template-rows:48px 44px 44px!important}
  body.terminal-mode>header #mobile-live-link:not([hidden]){display:flex;grid-column:1/-1;grid-row:2;align-items:center;justify-content:center;gap:8px;min-height:44px;border:1px solid #ff8179;border-radius:10px;background:#c92932;color:#fff;text-decoration:none;font-size:15px;font-weight:700;line-height:1.2}
  body.terminal-mode>header #mobile-live-link::before{content:"";width:0;height:0;border-top:6px solid transparent;border-bottom:6px solid transparent;border-left:9px solid currentColor}
  body.terminal-mode>header #mobile-live-link:hover{background:#ac2029}
  body.terminal-mode>header #mobile-live-link:focus-visible{outline:3px solid #ffe09a;outline-offset:2px}
  body.terminal-mode>header #language-toggle{grid-column:1/4!important;grid-row:3!important}
  body.terminal-mode>header #change-password{grid-column:5!important;grid-row:3!important;background:#ffffff12!important;border:1px solid #ffffff55!important;color:white!important}
  body.terminal-mode>header #logout{grid-column:6!important;grid-row:3!important;background:#ffffff12!important;border:1px solid #ffffff55!important;color:white!important}
  body:is(.admin-mode,.terminal-mode)>header :is(#change-password,#logout){
    display:grid!important;place-items:center!important;font-size:0!important;
    overflow:hidden!important;
  }
  body:is(.admin-mode,.terminal-mode)>header :is(#change-password,#logout)::before{
    content:"";display:block;width:22px;height:22px;background:currentColor;
    mask:var(--account-icon) center/contain no-repeat;
  }
  body:is(.admin-mode,.terminal-mode)>header #change-password{--account-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='15' r='4'/%3E%3Cpath d='m11 12 9-9m-4 4 3 3m-6 0 3 3'/%3E%3C/svg%3E")}
  body:is(.admin-mode,.terminal-mode)>header #logout{--account-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 4H4v16h6M14 8l4 4-4 4M9 12h12'/%3E%3C/svg%3E")}
  body:is(.admin-mode,.terminal-mode)>header :is(#change-password,#logout)[hidden]{display:none!important}
  body.terminal-mode .mobile-pos-summary{margin:12px auto!important;width:calc(100% - 24px)!important;max-width:520px!important;padding:16px!important;border-radius:14px!important}
}

/* Keep the private rules label readable in either language; public Live is unchanged. */
@media(max-width:800px){body:is(.admin-mode,.terminal-mode)>header #simulation-usage-trigger{grid-column:1/-1!important;grid-row:4!important;width:100%!important;height:auto!important;min-height:44px!important;white-space:normal!important}}
