/* Shared responsive shell, independent of business and control state. */
html { scroll-padding-bottom: calc(86px + env(safe-area-inset-bottom,0px)); }
.kkm-alert { max-width: calc(100vw - 20px); }
.kkm-alert :is(h1,h2,h3,p,label,small,code) { overflow-wrap: anywhere; }
.kkm-alert :is(input,select,textarea) { min-width: 0; max-width: 100%; }
.kkm-panel { max-height: calc(100dvh - 24px); }
.kkm-panel > .swal2-html-container {
  min-height: 0;
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.kkm-panel .modal-template { min-width: 0; }
.kkm-panel .modal-template > h2:first-of-type { padding-right: 30px; }
.kkm-alert .swal2-close { min-width: 44px; min-height: 44px; z-index: 2; color: var(--muted); }
.customer-statement > .customer-statement-header {
  height: auto; min-height: 0; display: block; padding: 0 32px 0 0;
  border: 0; background: transparent;
}
.payment-provider-heading { height: auto; min-height: 0; padding: 0; border: 0; background: transparent; }
.settings-card .tariff-scopes input[type=radio] { width: 23px; height: 23px; padding: 0; margin: 2px 0 0; flex: 0 0 23px; }
.table-scroll-hint { display: block; color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.table-scroll-hint[hidden] { display: none; }
.table-wrap:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
#app-view .device-qr-menu { min-width: 0; }
#app-view .device-qr-menu > summary { width: 100%; min-height: 44px; cursor: pointer; list-style: none; }
#app-view .device-qr-menu > summary::-webkit-details-marker { display: none; }
#app-view .device-qr-menu > summary::after { content: '⌄'; }
#app-view .device-qr-menu[open] { flex-basis: 100%; grid-column: 1 / -1; }
#app-view .device-menu-items { display: grid; grid-template-columns: repeat(auto-fit,minmax(110px,1fr)); gap: 8px; padding-top: 8px; }
#app-view .fleet-device > .device-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 8px; align-items: start; }
#app-view .fleet-device .device-action-menu { min-width: 0; }
#app-view .fleet-device .device-action-menu[open] { grid-column: 1 / -1; }
#app-view .fleet-device .device-action-menu > .button { margin-top: 8px; width: 100%; }
#app-view .fleet-device .device-action-menu > summary { min-height: 44px; }
@media (min-width:701px) {
  .sidebar { overflow-y: auto; overscroll-behavior-y: contain; max-height: 100dvh; }
  .sidebar > * { flex-shrink: 0; }
}
@media (max-width:700px) {
  #app-view .payment-provider-heading { display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: start; gap: 12px 14px; }
  #app-view .payment-provider-heading > .pill { grid-column: 2; justify-self: start; margin-left: 0; }
  #app-view .payment-provider-heading > div { min-width: 0; }
  #app-view .device-row:has(> .device-identity) { grid-template-columns: repeat(3,minmax(0,1fr)); }
  #app-view .device-row > .device-identity,
  #app-view .device-row > .device-state { grid-column: 2 / -1; }
  #app-view .device-row > .device-details { grid-column: 1; border-top: 0; align-self: start; }
  #app-view .device-row > .device-details > summary { min-height: 44px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 9px; gap: 3px; justify-content: center; text-align: center; line-height: 1.4; }
  #app-view .device-row > .device-actions { grid-column: 2 / -1; }
  #app-view .device-row > .device-details[open],
  #app-view .device-row > .device-details[open] + .device-actions { grid-column: 1 / -1; }
  body:has(#app-view:not([hidden])) { padding-bottom: calc(78px + env(safe-area-inset-bottom,0px)); }
  #app-view .sidebar { padding-top: env(safe-area-inset-top,0px); height: calc(61px + env(safe-area-inset-top,0px)); }
  #customer-view > header { padding-top: calc(10px + env(safe-area-inset-top,0px)); height: calc(56px + env(safe-area-inset-top,0px)); }
  #app-view .fleet-device.device-compact .charger-visual figcaption { display: none; }
  .kkm-panel { padding: 14px 10px; }
  .kkm-panel > .swal2-html-container { margin-inline: 0; }
  .auth-card input { font-size: 16px; }
}
@media (max-width:600px) {
  .auth-story { min-height: 0; padding: 24px; }
  .auth-story .brand { margin-bottom: 18px; }
  .auth-story h1 { font-size: 28px; line-height: 1.4; }
  .auth-story p { margin-top: 10px; }
  .auth-story .auth-steps { margin-top: 20px; }
}
@media (max-width:700px) and (max-height:700px) {
  #customer-view #customer-notice { padding-block: 0; }
  #customer-view .prepaid-shell[data-view=funding-panel] .member-welcome { display: none; }
  #customer-view .prepaid-shell[data-view=funding-panel] { padding-bottom: 8px; }
  #customer-view .prepaid-shell[data-view=funding-panel] #funding-panel { padding-bottom: 4px; }
}

@media (max-width:700px) and (max-height:700px) {
  #customer-view .prepaid-shell[data-view="topup-panel"] { padding-bottom:8px; }
  .prepaid-shell[data-view="topup-panel"] #customer-notice:not([open]) { display:none; }
}

#service-job-detail-dialog .button.full { margin-left:0; margin-right:0; max-width:100%; box-sizing:border-box; }

/* Account number and a single 48px copy target share the same card. */
.account-with-copy { position:relative; min-width:0; }
.account-with-copy #payment-current,
#customer-view .account-with-copy #topup-bank { padding-right:70px; min-height:88px; }
.account-with-copy .account-copy-action,
#customer-view .prepaid-shell .account-with-copy #copy-account {
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  display:grid; place-items:center; width:48px; height:48px; min-height:48px;
  padding:0; margin:0; border-radius:12px; color:var(--brand); background:var(--brand-soft);
}
.account-with-copy .account-copy-action[hidden] { display:none; }
.account-copy-action .ui-icon { width:22px; height:22px; }
.account-copy-action .account-copy-check { display:none; }
.account-copy-action[data-copied="true"] .account-copy-glyph { display:none; }
.account-copy-action[data-copied="true"] .account-copy-check { display:block; }
#customer-view #copy-account-status:empty { margin:0; }

#customer-view .funding-selection { display:flex; align-items:center; justify-content:space-between; gap:8px; }
#customer-view #funding-selected { font-size:18px; font-weight:700; color:var(--brand); font-variant-numeric:tabular-nums; }
#customer-view #topup-budget-note { margin:2px 0 4px; font-size:12px; line-height:1.6; color:var(--muted); }
