#store-accounts-dialog,#store-account-photo-dialog{position:fixed;inset:0;margin:auto;width:min(760px,calc(100% - 24px));max-width:100%;max-height:calc(100dvh - var(--app-safe-top,0px) - var(--app-safe-bottom,0px) - 20px);padding:0;border:1px solid #cbd5e1;border-radius:16px;background:#f5f7fb;color:#142641;overflow:hidden}
#store-accounts-dialog[open]{display:flex;flex-direction:column;max-width:600px}
#store-accounts-dialog [hidden],#store-account-photo-dialog [hidden]{display:none!important}
#store-accounts-dialog::backdrop,#store-account-photo-dialog::backdrop{background:#13233985}
.sa-heading,.sa-photo-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;background:white;padding:14px 18px;border-bottom:1px solid #d4dce7}
.sa-heading h2,.sa-photo-heading h2{font-size:1.125rem;line-height:1.4;margin:0;overflow-wrap:anywhere;color:#172b48}
.sa-heading button,.sa-photo-heading button{min-height:40px;padding:6px 10px;white-space:nowrap}
.sa-body{padding:16px;overflow-y:auto;overscroll-behavior:contain}
.sa-toolbar,.sa-machine-head,.sa-add-actions,.sa-slot-foot{display:flex;align-items:center;justify-content:space-between;gap:8px}
.sa-toolbar{margin-bottom:10px}
.sa-toolbar h3,.sa-machine-head h3{margin:0;line-height:1.4;font-size:1rem;color:#172b48;overflow-wrap:anywhere}
.sa-body form,.sa-body fieldset{margin:0;padding:0;min-width:0;border:0}
.sa-add-form,.sa-machine{border:1px solid #ccd5e1;border-radius:10px;background:white}
.sa-body .sa-add-form{padding:12px;margin-bottom:12px}
.sa-add-form label{display:block;margin:0 0 8px;font-size:.875rem;color:#354960}
.sa-add-form input,.sa-add-form select{display:block;box-sizing:border-box;width:100%;margin-top:3px;min-height:42px}
.sa-add-actions{justify-content:flex-end}
.sa-machines{display:grid;gap:7px}
.sa-machine-head{padding:0 8px;background:#eaf1fa;border-radius:9px;gap:4px}
.sa-machine-head h3{flex:1;min-width:0}
.sa-machine-toggle{width:100%;display:flex;align-items:center;gap:8px;text-align:left;min-height:44px;padding:5px 4px}
.sa-machine-name{min-width:0;overflow-wrap:anywhere}
.sa-slot-count{margin-left:auto;white-space:nowrap;font-size:.75rem;font-weight:500;color:#4a6078}
.sa-machine-toggle::after{content:"";width:8px;height:8px;flex:none;margin:0 5px 4px 3px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg)}
.sa-machine-toggle[aria-expanded=true]::after{transform:rotate(225deg);margin-top:7px}
.sa-machine-head .sa-add-position{flex:none;min-height:36px;padding:4px 8px;font-size:.8rem}
.sa-add-toggle{min-height:40px}
.sa-body .sa-position{padding:9px 12px}
.sa-position+.sa-position{border-top:1px solid #dce3eb}
.sa-position-title{font-size:.875rem;font-weight:700;color:#213f5d}
.sa-position-layout{--photo-size:108px;display:grid;grid-template-columns:var(--photo-size) minmax(0,1fr);column-gap:14px;row-gap:3px;align-items:center}
.sa-photo,.sa-readings{min-width:0}
.sa-photo{grid-row:span 2;display:grid;align-content:center;gap:3px}
.sa-photo-preview,.sa-no-photo{padding:0;background:#eef2f7;border:1px solid #cad5e2;border-radius:6px;height:var(--photo-size);width:100%;overflow:hidden}
.sa-photo-preview{display:block;cursor:zoom-in}
.sa-no-photo{display:grid;place-items:center;color:#52667b;font-size:.75rem}
.sa-photo-preview img{display:block;width:100%;height:100%;object-fit:cover}
.sa-photo-actions button{width:100%;min-height:34px;padding:3px;white-space:nowrap;font-size:.8rem}
.sa-counter-line{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1fr) minmax(0,1fr);gap:6px;align-items:center;padding:2px 0}
.sa-counter-head{font-size:.76rem;color:#465b72;font-weight:550;border-bottom:1px solid #dce3eb;margin-bottom:2px}
.sa-counter-label{font-size:.82rem;font-weight:650;color:#1d334e;word-break:keep-all}
.sa-previous{font-size:.875rem;font-variant-numeric:tabular-nums;color:#172b48;overflow-wrap:anywhere;line-height:1.25}
.sa-previous.sa-unrecorded{font-size:.76rem;color:#52667b}
.sa-counter-input{box-sizing:border-box;width:100%;min-width:0;height:34px;padding:3px 6px;font:inherit;font-size:16px;font-variant-numeric:tabular-nums;border:1px solid #a3b4c8;border-radius:6px;background:white;color:#172b48}
.sa-counter-input::placeholder{color:#65768a}
.sa-slot-foot{display:flex;justify-content:flex-start;gap:6px;min-width:0}
.sa-slot-foot .sa-delete-position{flex:none;width:36px;min-height:36px;padding:2px;font-size:16px;line-height:1}
.sa-updated{margin-left:auto;min-width:0;text-align:right;font-size:.75rem;line-height:1.3;color:#4a6078;font-variant-numeric:tabular-nums}
.sa-slot-foot .sa-save{min-height:36px;min-width:44px;padding:4px 9px;flex:none}
.sa-save:disabled{opacity:.55}
.sa-status,.sa-inline-status{margin:6px 0 0;color:#35516f;font-size:.875rem;line-height:1.45;overflow-wrap:anywhere}
.sa-status:not(:empty){margin:10px 0}
.sa-status:empty,.sa-inline-status:empty{display:none}
.sa-machine>.sa-inline-status:not(:empty){padding:0 12px 10px}
.sa-status.sa-error,.sa-inline-status.sa-error{color:#a12927}
#store-account-photo-dialog{background:#fff}
#store-account-photo-dialog img{display:block;width:100%;height:auto;max-height:calc(78dvh - 54px);object-fit:contain}
@media(max-width:600px){
  #store-accounts-dialog,#store-account-photo-dialog{width:calc(100% - 12px);border-radius:12px}
  .sa-heading,.sa-photo-heading{padding:8px 12px}
  .sa-body{padding:10px}
  .sa-body .sa-position{padding:7px 8px}
  .sa-position-layout{--photo-size:clamp(72px,22vw,104px);column-gap:8px}
  .sa-counter-line{grid-template-columns:minmax(3.6rem,.8fr) minmax(0,1fr) minmax(0,1fr);gap:4px}
  .sa-heading button,.sa-photo-heading button,.sa-add-toggle,.sa-add-actions button{min-height:44px}
  .sa-slot-foot{gap:3px}
  .sa-updated{word-break:keep-all}
}
