/* Device modes change presentation without re-rendering in-progress forms. */
[hidden] { display: none !important; }
.brand-mark, .side-head .brand-mark, .login-visual .brand-mark {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid #b5d2a7;
  border-radius: 8px;
  background: #edf5e9;
  color: #32771e;
  font-style: normal;
}
.brand-mark svg { width: 32px; height: 32px; stroke-width: 1.6; }
.brand-mark:not(:has(svg))::before { content: "+ | | −"; font-size: 15px; font-style: normal; color: #32771e; }
.login-shell {
  position: relative;
  background: linear-gradient(90deg, rgba(12, 28, 20, .78), rgba(12, 28, 20, .08)), url("assets/battery-room-login.png") center / cover;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
}
.login-visual { background: transparent; padding: 48px; min-width: 0; }
.login-visual::after { display: none; }
.login-visual h1 { font-size: 40px; max-width: 640px; margin-top: 40px; text-wrap: balance; }
.login-visual p { max-width: 520px; color: #f1f5f2; }
.login-visual .brand-mark { background: #f4f8f1; border-color: #f4f8f1; }
.login-panel { position: relative; background: transparent; padding: 40px; }
.auth-card { width: min(100%, 440px); padding: 32px; border-radius: 8px; background: rgba(255, 255, 255, .98); box-shadow: 0 12px 48px #0b1d2233; }
.auth-card h2 { color: #23382b; }
.auth-card .field label { font-size: 13px; }
.auth-card input { min-height: 48px; }
.login-metrics { max-width: 580px; gap: 12px; }
.login-metrics div { background: #13241ce8; border-color: #ffffff45; backdrop-filter: blur(5px); }
.mobile-bottom-nav, .registration-section { display: none; }
.battery-capture-field { position: relative; padding: 16px; border: 1px solid #c9d8cf; border-left: 4px solid #2588b8; border-radius: 8px; background: #fff; }
.battery-capture-field[data-direction="in"] { border-left-color: #4a9f23; }
.battery-capture-field.scan-confirmed { box-shadow: 0 0 0 2px #5aa73930; }
.battery-capture-field.scan-confirmed .battery-match { font-weight: 750; }
.scan-confirmed .capture-mode:last-child { color: #32771e; }
#scanConfirmation { display: grid; justify-items: center; padding: 40px 18px; gap: 14px; background: #edf7e9; border-radius: 8px; margin-top: 20px; color: #276419; }
#scanConfirmation > svg { width: 54px; height: 54px; stroke-width: 1.5; }
#scanConfirmation > strong { font-size: 32px; overflow-wrap: anywhere; max-width: 100%; }
#scanConfirmation > span { font-size: 14px; font-weight: 650; }
#scanConfirmation > small { color: #5f7467; }
.scan-dialog .modal-head .eyebrow { max-width: 280px; line-height: 1.6; }
.scan-actions { gap: 10px; }

html[data-device="mobile"] { scroll-padding-top: 86px; }
html[data-device="mobile"] body { overflow-x: clip; }
html[data-device="mobile"] .shell { display: block; }
html[data-device="mobile"] .sidebar { position: sticky; top: 0; width: 100%; height: auto; padding: max(8px, env(safe-area-inset-top)) 16px 8px; z-index: 20; background: #fffffff5; backdrop-filter: blur(14px); border: 0; border-bottom: 1px solid var(--line); }
html[data-device="mobile"] .side-head, html[data-device="mobile"] .user-box { display: none; }
html[data-device="mobile"] .mobile-top { display: flex; border: 0; padding: 0; min-height: 50px; gap: 16px; }
html[data-device="mobile"] .mobile-top > strong { display: flex; align-items: center; gap: 10px; font-size: 14px; }
html[data-device="mobile"] .mobile-top small { display: block; font-size: 11px; font-weight: 500; color: #718076; margin-top: 4px; }
.mobile-battery-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 7px; background: #edf5e9; color: #32771e; }
.mobile-battery-mark svg { width: 26px; height: 26px; }
html[data-device="mobile"] .mobile-top .btn { min-height: 44px; }
html[data-device="mobile"] .sidebar > .nav { display: none; }
html[data-device="mobile"] .mobile-menu-open > .nav { display: grid; position: fixed; inset: 70px 12px auto; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 55px #122b2a40; max-height: calc(100dvh - 165px); overflow-y: auto; margin: 0; }
html[data-device="mobile"] .nav button { min-height: 48px; font-size: 14px; }
html[data-device="mobile"] .mobile-bottom-nav { position: fixed; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); z-index: 22; inset: auto 0 0; padding: 7px max(6px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); min-height: 72px; border-top: 1px solid #d6e2da; background: #fffffff5; backdrop-filter: blur(14px); box-shadow: 0 -4px 20px #132c2106; }
.mobile-bottom-nav button { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; min-height: 52px; border-radius: 7px; color: #768378; background: transparent; font-size: 10px; font-weight: 650; }
.mobile-bottom-nav svg { width: 21px; height: 21px; }
.mobile-bottom-nav button[aria-current="page"], .mobile-bottom-nav button[aria-expanded="true"] { color: #32771e; background: #edf5e9; }
html[data-device="mobile"] .main { padding: 0 16px calc(104px + env(safe-area-inset-bottom)); width: 100%; min-width: 0; }
html[data-device="mobile"] .workspace-strip { display: none; }
html[data-device="mobile"] .topbar { padding-top: 22px; flex-direction: column; gap: 16px; }
html[data-device="mobile"] .topbar h1 { font-size: 26px; }
html[data-device="mobile"] .topbar p { font-size: 13px; line-height: 1.55; }
html[data-device="mobile"] .topbar .filters, html[data-device="mobile"] .topbar .field, html[data-device="mobile"] .topbar select { width: 100%; min-width: 0; }
html[data-device="mobile"] .grid-2, html[data-device="mobile"] .grid-3, html[data-device="mobile"] .form-grid, html[data-device="mobile"] .asset-grid, html[data-device="mobile"] .maintenance-grid, html[data-device="mobile"] .analytics-band { grid-template-columns: minmax(0, 1fr); }
html[data-device="mobile"] .content { gap: 20px; }
html[data-device="mobile"] .panel { padding: 18px 0; }
html[data-device="mobile"] .panel h2 { font-size: 17px; }
html[data-device="mobile"] .stats-grid, html[data-device="mobile"] .grid-2 .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html[data-device="mobile"] .stat-card { min-height: 150px; padding: 15px; }
html[data-device="mobile"] .stat-card strong { font-size: 25px; }
html[data-device="mobile"] .stat-card small { font-size: 11px; line-height: 1.4; }
html[data-device="mobile"] .stat-card > span:not(.stat-symbol) { display: block; font-size: 11px; line-height: 1.4; }
html[data-device="mobile"] .quick-actions { align-items: stretch; flex-direction: column; }
html[data-device="mobile"] .quick-actions > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
html[data-device="mobile"] .quick-actions .btn { min-height: 48px; font-size: 12px; }
html[data-device="mobile"] .registration-section { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; }
.registration-section span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #e3eedf; color: #32771e; font-size: 11px; font-weight: 750; }
.registration-section h3 { margin: 0; font-size: 13px; color: #506957; }
html[data-device="mobile"] .field { margin-top: 10px; gap: 9px; min-width: 0; }
html[data-device="mobile"] .field label { font-size: 14px; }
html[data-device="mobile"] input, html[data-device="mobile"] select, html[data-device="mobile"] textarea { font-size: 16px; min-height: 50px; max-width: 100%; }
html[data-device="mobile"] textarea { min-height: 100px; }
html[data-device="mobile"] .btn, html[data-device="mobile"] .capture-mode { min-height: 48px; font-size: 13px; }
html[data-device="mobile"] .battery-capture-field { margin-top: 10px; padding: 16px; }
html[data-device="mobile"] .battery-capture-field > label { font-size: 16px; font-weight: 750; }
html[data-device="mobile"] .capture-mode:last-child { color: #32771e; font-weight: 750; }
html[data-device="mobile"] .battery-match { font-size: 12px; min-height: 18px; }
html[data-device="mobile"] .check-item { font-size: 14px; min-height: 48px; align-items: center; line-height: 1.5; padding: 12px; }
html[data-device="mobile"] .check-item input { flex: 0 0 24px; width: 24px; height: 24px; min-height: 24px; }
html[data-device="mobile"] form > .split-actions { position: sticky; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 5; display: flex; margin: 12px 0 0; padding: 12px 0; background: #f2f5f4f5; backdrop-filter: blur(10px); }
html[data-device="mobile"] form > .split-actions > .btn { flex: 1; min-height: 52px; }
html[data-device="mobile"] .success { position: relative; padding: 16px; border: 1px solid #acd196; font-size: 14px; line-height: 1.5; background: #e7f6e1; color: #276419; }
html[data-device="mobile"] .table-wrap { border: 0; background: transparent; overflow: visible; }
html[data-device="mobile"] table, html[data-device="mobile"] tbody { display: block; min-width: 0; width: 100%; }
html[data-device="mobile"] thead { display: none; }
html[data-device="mobile"] tbody tr { display: block; padding: 8px 14px; margin-bottom: 14px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
html[data-device="mobile"] td { display: grid; grid-template-columns: minmax(88px, .8fr) minmax(0, 1.2fr); gap: 12px; padding: 9px 0; font-size: 13px; overflow-wrap: anywhere; align-items: center; }
html[data-device="mobile"] td::before { content: attr(data-label); color: #77867b; font-size: 11px; }
html[data-device="mobile"] td:last-child { border-bottom: 0; }
html[data-device="mobile"] td .card-actions { margin-top: 0; }
html[data-device="mobile"] td .badge { width: fit-content; }
html[data-device="mobile"] .modal { padding: 0; align-items: stretch; }
html[data-device="mobile"] .modal-card { width: 100%; max-height: 100dvh; border-radius: 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
html[data-device="mobile"] .modal-card > .split-actions { bottom: 0; background: #fff; }
html[data-device="mobile"] .modal-head { position: relative; align-items: center; gap: 12px; }
html[data-device="mobile"] .modal-head h2 { font-size: 21px; }
html[data-device="mobile"] .scan-dialog { inset: 0; margin: 0; width: 100%; height: 100dvh; max-height: 100dvh; max-width: 100%; border: 0; border-radius: 0; padding: calc(20px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom)); background: #f8fbf9; }
html[data-device="mobile"] #scanReader { margin-top: 26px; min-height: 300px; }
html[data-device="mobile"] #scanStatus { font-size: 15px; line-height: 1.6; }
html[data-device="mobile"] .scan-actions { display: flex; flex-direction: column; margin-top: 24px; }
html[data-device="mobile"] .scan-actions .btn { width: 100%; min-height: 54px; }
html[data-device="mobile"] .scan-dialog .modal-head h2 { font-size: 26px; }
html[data-device="mobile"] #scanConfirmation { min-height: 300px; }
html[data-device="mobile"] .login-shell { display: flex; flex-direction: column; min-height: 100dvh; background-position: 58% center; background-attachment: scroll; }
html[data-device="mobile"] .login-visual { min-height: auto; padding: calc(26px + env(safe-area-inset-top)) 24px 0; }
html[data-device="mobile"] .login-visual .brand-mark { width: 44px; height: 44px; }
html[data-device="mobile"] .login-visual h1 { font-size: 27px; max-width: 520px; margin: 22px 0 12px; }
html[data-device="mobile"] .login-visual p { display: none; }
html[data-device="mobile"] .login-metrics { display: none; }
html[data-device="mobile"] .login-panel { min-height: 0; display: block; padding: 24px 20px calc(30px + env(safe-area-inset-bottom)); }
html[data-device="mobile"] .auth-card { width: min(100%, 480px); padding: 24px; }
html[data-device="mobile"] .auth-card h2 { font-size: 23px; }
html[data-device="mobile"] .auth-card p { font-size: 13px; }
html[data-device="mobile"] .auth-card .field { margin-top: 18px; }
html[data-device="mobile"] .auth-card .auth-actions { margin-top: 24px; }
html[data-device="mobile"] .auth-card .hint { font-size: 11px; line-height: 1.5; }
@media (max-width: 360px) {
  html[data-device="mobile"] .main { padding-left: 12px; padding-right: 12px; }
  html[data-device="mobile"] .stats-grid { grid-template-columns: minmax(0, 1fr); }
  html[data-device="mobile"] .donut-layout { flex-direction: column; }
  html[data-device="mobile"] .quick-actions > div { grid-template-columns: minmax(0, 1fr); }
}
