/* LIME999 panel · mobile layout (drawer menu, card tables, touch sizing). Loaded last; desktop (>1200px) untouched. */
#pmBurger,#pmScrim,.pm-acct,.pm-foot,.pm-x{display:none}

@media(max-width:1200px){
  /* top bar: menu button · page title · balance */
  .topbar{gap:10px;padding:0 10px 0 6px}
  #pmBurger{display:flex;flex-direction:column;justify-content:center;gap:4px;width:42px;height:42px;padding:0 11px;border-radius:10px;background:transparent;flex:0 0 auto;cursor:pointer}
  #pmBurger span{display:block;height:2px;border-radius:2px;background:var(--text-primary,#fff)}
  #pmBurger:active{background:var(--bg-control)}
  #crumbTop{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .topbar .right{margin-left:0;flex:0 0 auto}
  #authArea .balpill{min-width:0;padding:0 10px}
  .pnav{display:none!important}

  /* the desktop sidebar becomes a slide-in drawer, so every menu item is always in it */
  .sidebar{display:flex!important;flex-direction:column;position:fixed;top:0;left:0;bottom:0;width:min(86vw,320px);height:100dvh;z-index:300;
    transform:translateX(-102%);transition:transform .22s cubic-bezier(.2,.8,.2,1);box-shadow:none;padding:0 0 calc(10px + env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain;border-right:1px solid var(--divider)}
  body.pm-open .sidebar{transform:none;box-shadow:0 0 40px #0009}
  #pmScrim{display:block;position:fixed;inset:0;z-index:290;background:#0008;opacity:0;pointer-events:none;transition:opacity .2s}
  body.pm-open #pmScrim{opacity:1;pointer-events:auto}
  body.pm-open{overflow:hidden}
  .sidebar .sb-logo{display:flex;align-items:center;justify-content:space-between;padding:calc(12px + env(safe-area-inset-top)) 12px 10px 16px;position:sticky;top:0;background:var(--bg-main);z-index:2}
  .pm-x{display:flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:10px;font-size:20px;color:var(--text-secondary);background:var(--bg-control)}

  .pm-acct{display:block;margin:0 12px 10px;padding:12px 14px;border-radius:12px;background:var(--bg-tertiary)}
  .pm-acct .who{font-weight:600;font-size:14px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .pm-acct .role{font-size:11px;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.06em;margin-top:2px}
  .pm-acct .nums{display:flex;gap:16px;margin-top:10px}
  .pm-acct .nums div{display:flex;flex-direction:column;gap:2px}
  .pm-acct .nums small{font-size:10px;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.06em}
  .pm-acct .nums b{font-size:15px;color:#fff;font-variant-numeric:tabular-nums}
  .pm-acct .nums .exp b{color:var(--live)}

  .sidebar .sb-group{padding:2px 8px}
  .sidebar .sb-group .lbl{padding:10px 10px 4px}
  .sidebar .sb-group a{display:flex;align-items:center;gap:12px;min-height:46px;padding:0 12px;border-radius:10px;font-size:15px}
  .sidebar .sb-group a .ic{width:22px;text-align:center;font-style:normal}
  .sidebar .sb-group a.active{background:var(--bg-control);color:#fff;font-weight:600}
  .sidebar .sb-group a .n:empty{display:none}
  .sidebar .sb-group a .n{margin-left:auto}

  .pm-foot{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:auto 12px 0;padding-top:14px;border-top:1px solid var(--divider)}
  .pm-foot button{height:46px;border-radius:10px;background:var(--bg-control);color:#fff;font-weight:600;font-size:14px;display:flex;align-items:center;justify-content:center;gap:8px}
  .pm-foot button.wide{grid-column:1/-1}
  .pm-foot button.out{background:var(--live-surface,#3a1414);color:#fff}
  .pm-foot .on{font-size:11px;font-weight:600;padding:2px 7px;border-radius:999px;background:var(--brand);color:#000}
  .pm-foot .off{font-size:11px;font-weight:600;padding:2px 7px;border-radius:999px;background:#ffffff1f;color:var(--text-secondary)}
}

/* phones: organise page content for narrow widths */
@media(max-width:700px){
  .wrap{padding:10px 10px calc(28px + env(safe-area-inset-bottom))}
  .section{padding:12px;border-radius:12px}
  .section-h{flex-wrap:wrap;gap:8px}
  .section-h h2{font-size:16px;line-height:20px}
  .section-h > div:last-child,.section-h .acts{display:flex;flex-wrap:wrap;gap:6px}
  .row2,.grid2{grid-template-columns:1fr!important}
  .kpis,.skpis,.skpis.four{grid-template-columns:1fr 1fr!important;gap:8px}
  .kpi{padding:12px;min-width:0}
  .kpi b{font-size:18px;word-break:break-word}
  .filters{gap:6px}
  .filters input:not([type=checkbox]):not([type=radio]),.filters select{flex:1 1 140px;min-width:0;height:40px;font-size:16px}
  .filters label{display:inline-flex;align-items:center;gap:6px;min-height:40px}
  .filters .btn,.filters button{height:40px}
  .section .btn,.section button.btn{min-height:38px}
  .wrap input:not([type=checkbox]):not([type=radio]),.wrap select,.wrap textarea,.modal input:not([type=checkbox]):not([type=radio]),.modal select,.modal textarea{font-size:16px}
  .tabs,.chips-row{scrollbar-width:none;-webkit-mask-image:linear-gradient(90deg,#000 88%,transparent);mask-image:linear-gradient(90deg,#000 88%,transparent)}
  .tabs::-webkit-scrollbar{display:none}
  .auditbadge ~ .auditbadge{display:none!important}

  /* wide tables become one card per row, each value labelled */
  table.pm-cards{display:block;width:100%;border:0;background:transparent}
  table.pm-cards thead{display:none}
  table.pm-cards tbody,table.pm-cards tfoot{display:flex;flex-direction:column;gap:8px}
  table.pm-cards tr{display:grid;grid-template-columns:1fr 1fr;gap:0 10px;padding:10px 12px;border-radius:12px;background:var(--bg-tertiary);border:1px solid #ffffff0f}
  table.pm-cards td{display:flex;flex-direction:column;gap:1px;padding:5px 0!important;border:0!important;min-width:0;text-align:left!important;white-space:normal!important;word-break:break-word;font-size:13px;background:transparent!important}
  table.pm-cards td > .tag,table.pm-cards td > .stag,table.pm-cards td > .pill{align-self:flex-start}
  table.pm-cards td::before{content:attr(data-label);font-size:10px;line-height:13px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--text-secondary)}
  table.pm-cards td[data-label=""]::before{display:none}
  table.pm-cards td.pm-title{grid-column:1/-1;flex-direction:row;align-items:baseline;gap:8px;font-size:15px;font-weight:600;padding:2px 0 8px!important;margin-bottom:4px;border-bottom:1px solid #ffffff14!important}
  table.pm-cards td.pm-title::before{display:none}
  table.pm-cards td.pm-wide{grid-column:1/-1}
  table.pm-cards td.pm-acts{grid-column:1/-1;flex-direction:row;flex-wrap:wrap;gap:6px;padding-top:10px!important;margin-top:4px;border-top:1px solid #ffffff14!important}
  table.pm-cards td.pm-acts::before{display:none}
  table.pm-cards td.pm-acts > *{flex-wrap:wrap;display:flex;gap:6px}
  table.pm-cards td.pm-acts button,table.pm-cards td.pm-acts .btn,table.pm-cards td.pm-acts a.btn{min-height:38px;min-width:44px;padding:0 12px;font-size:13px;margin:0}
  table.pm-cards td.pm-empty{grid-column:1/-1;text-align:center!important;color:var(--text-secondary);align-items:center}
  table.pm-cards td.pm-empty::before{display:none}
  table.pm-cards tr.pm-total{background:transparent;border:1px dashed #ffffff26}
  table.pm-cards td input,table.pm-cards td select{width:100%}
  table.pm-cards td.pm-blank{display:none}
  table.pm-cards td.pm-acts .actions-cell{display:grid!important;grid-template-columns:repeat(3,1fr);gap:6px;width:100%}
  table.pm-cards td.pm-acts .actions-cell button{margin:0;min-height:38px;padding:0 6px;font-size:0;border-radius:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  table.pm-cards td.pm-acts .actions-cell button[title]::after{content:attr(title);font-size:12px;font-weight:600}
  table.pm-cards td.pm-acts .actions-cell button:not([title]){font-size:13px}
  .pm-cardwrap{overflow:visible!important}
}
@media(max-width:520px){#mobLogo{display:none!important}}

/* status bar / notch (site opened from the home screen): the header grows by the status-bar height so the clock and
   battery never cover it. env()/constant() are 0 in a normal browser tab, so nothing moves there. */
:root{--sa-t:0px}
@supports (padding-top:constant(safe-area-inset-top)){:root{--sa-t:constant(safe-area-inset-top)}}
@supports (padding-top:env(safe-area-inset-top)){:root{--sa-t:env(safe-area-inset-top,0px)}}
.topbar{box-sizing:border-box;height:calc(var(--header-h) + var(--sa-t))!important;padding-top:var(--sa-t)!important}
@media(min-width:1201px){.sidebar{padding-top:calc(12px + var(--sa-t))}}
@media(max-width:1200px){.modal{padding-top:calc(10px + var(--sa-t))}}
