:root {
  --bg: #10151c;
  --surface: #1a212b;
  --surface-hover: #232b37;
  --surface-2: #141a22;
  --text-primary: #e8ecf1;
  --text-secondary: #8b95a5;
  --border: #2a323e;
  --brand: #d5001c;
  --primary: #0ea5e9;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;
  --status-available: #22c55e;
  --status-charging: #0ea5e9;
  --status-faulted: #ef4444;
  --status-offline: #64748b;
  --status-preparing: #f59e0b;
  --radius: 14px;
  --font-sans: "Prompt", "Segoe UI", "Tahoma", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Roboto Mono", "SFMono-Regular", monospace;

  /* ชื่อตัวแปรรุ่นเก่า คงไว้เป็น alias ระหว่างช่วงเปลี่ยนผ่าน กัน component เก่าที่ยังไม่ได้ migrate พัง */
  --panel: var(--surface);
  --panel-2: var(--surface-2);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --accent: var(--success);
  --accent-2: var(--primary);
  --sidebar-bg: #0d1117;
  --sidebar-bg-hover: var(--surface-hover);
  --sidebar-text: #c7ccd6;
  --sidebar-muted: #7d8494;
  --sidebar-border: var(--border);
  --sidebar-active-bg: var(--surface-hover);
  --sidebar-active-text: #ffffff;
  --active-bg: rgba(14, 165, 233, 0.14);
  --active-text: var(--primary);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
}

a { color: var(--primary); }

button, input, select, textarea { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================================
   Mobile header (index.html) — แถบบางด้านบน แทนที่ topbar เดิม
   ============================================================ */

.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 68px;
  padding: 10px 20px;
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.mobile-header .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
}

.mobile-header .brand-mark {
  flex: 0 0 auto;
  color: #f59e0b;
  font-size: 16px;
  line-height: 1;
}

.mobile-header .brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  line-height: 1.15;
}

.mobile-header .brand-name {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.mobile-header .brand-copy .brand-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
}

.mobile-header .brand .version-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 999px;
}

.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.mobile-header-actions #status-pill {
  white-space: nowrap;
  font-size: 11px;
}

.mobile-header-actions .header-refresh-btn {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0;
  color: var(--primary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.mobile-header-actions .header-refresh-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-header-actions .header-refresh-btn:hover:not(:disabled) {
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.12);
  border-color: var(--primary);
}

.mobile-header-actions .header-refresh-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.mobile-header-actions .header-refresh-btn:disabled {
  opacity: 0.72;
  cursor: default;
}

/* ============================================================
   Screens: home / detail / transactions / events / settings
   สลับด้วย JS (.screen.active) เหมือน pattern .tab-panel ของ admin
   ============================================================ */

.screen { display: none; }
.screen.active { display: block; }

main.app-content {
  padding: 14px 14px calc(84px + env(safe-area-inset-bottom, 0px));
  max-width: 720px;
  margin: 0 auto;
}

.screen-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.screen-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
}

.screen-guidance {
  margin: -7px 0 14px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 10px;
  font-size: 18px;
  flex-shrink: 0;
}

.overview-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 14px;
}

.overview-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.overview-chip .dot { width: 8px; height: 8px; }
.overview-chip strong { font-family: var(--font-mono); font-size: 14px; }

/* ============================================================
   Bottom navigation (index.html)
   ============================================================ */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 30;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px 10px;
  min-height: 56px;
  background: none;
  border: none;
  border-top: 2px solid transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
}

.bottom-nav-item .icon { font-size: 20px; line-height: 1; }

.bottom-nav-item.active {
  color: var(--primary);
  border-top-color: var(--brand);
}

.bottom-nav-item.scan-nav-item {
  color: var(--primary);
  font-weight: 700;
}

.bottom-nav-item.scan-nav-item .icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 24px;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
}

/* ============================================================
   Status badge / dot
   ============================================================ */

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.available { background: var(--status-available); }
.status-dot.charging { background: var(--status-charging); }
.status-dot.faulted { background: var(--status-faulted); }
.status-dot.offline { background: var(--status-offline); }
.status-dot.preparing { background: var(--status-preparing); }

.status-dot.pulse {
  box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.6);
  animation: status-pulse 1.6s ease-out infinite;
}

@keyframes status-pulse {
  0% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(14, 165, 233, 0); }
  100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}

/* ============================================================
   Device card (charge point)
   ============================================================ */

.device-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.device-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 10px;
}

.device-card-header .device-id {
  font-weight: 700;
  font-size: 15px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.device-card-meta b { color: var(--text-primary); font-weight: 500; }

.device-location {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.device-location-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.device-location-copy strong { color: var(--text-primary); font-weight: 600; }
.device-location-copy > span:last-child { color: var(--text-secondary); }
.device-location-label { color: var(--text-secondary); font-size: 11px; }

.device-map-link {
  flex: none;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 12px;
}

.device-map-link:hover { border-color: var(--accent); color: var(--accent); }

.device-live-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.device-live-strip .metric-label {
  display: block;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  font-size: 10px;
  margin-bottom: 2px;
}

.device-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================================
   Cards ทั่วไป (admin + legacy)
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}

.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
}

.stat-card.blue { background: rgba(14, 165, 233, 0.1); border-color: rgba(14, 165, 233, 0.3); }
.stat-card.green { background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.3); }

section { margin-bottom: 20px; }

h2 {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* ============================================================
   Chips (filter)
   ============================================================ */

.chip-group {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
}

.chip {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ============================================================
   Skeleton loading
   ============================================================ */

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: 8px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.skeleton-card {
  height: 130px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

/* ============================================================
   Empty / error state
   ============================================================ */

.state-block {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 13px;
}

.state-block .state-icon { font-size: 34px; margin-bottom: 10px; }
.state-block code {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  word-break: break-all;
  margin-top: 6px;
}

/* ============================================================
   Timeline (transactions) / event list
   ============================================================ */

.timeline-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.timeline-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

.timeline-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.timeline-item-meta .mono { font-family: var(--font-mono); color: var(--text-primary); }

details.payload-details {
  margin-top: 8px;
  font-size: 12px;
}

details.payload-details summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 12px;
}

details.payload-details pre {
  margin: 8px 0 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-all;
}

.event-log-item {
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.event-log-heading,
.event-log-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.event-log-heading {
  font-size: 13px;
}

.event-log-heading strong,
.event-log-source {
  min-width: 0;
  overflow-wrap: anywhere;
}

.event-log-category {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 10px;
}

.event-log-category.payment { color: var(--primary); }
.event-log-category.charging { color: var(--success); }
.event-log-category.system { color: var(--warning); }

.event-log-summary {
  margin: 6px 0;
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.event-log-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 11px;
}

.event-log-source { font-family: var(--font-mono); }

.event-filter-label {
  margin: 0 0 6px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

/* ============================================================
   Table (admin ยังใช้ตารางอยู่)
   ============================================================ */

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:last-child td { border-bottom: none; }

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.live-charging-row td {
  padding: 0;
  border-bottom: 1px solid var(--border);
}

.live-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  background: rgba(14, 165, 233, 0.08);
  border-left: 3px solid var(--primary);
  font-size: 13px;
  font-family: var(--font-mono);
}

/* ============================================================
   Badges
   ============================================================ */

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.online { background: rgba(34, 197, 94, 0.16); color: var(--success); }
.badge.offline { background: var(--surface-2); color: var(--text-secondary); }

.badge.status-Available { background: rgba(34, 197, 94, 0.16); color: var(--status-available); }
.badge.status-Charging { background: rgba(14, 165, 233, 0.16); color: var(--status-charging); }
.badge.status-Faulted { background: rgba(239, 68, 68, 0.16); color: var(--status-faulted); }
.badge.status-Preparing { background: rgba(245, 158, 11, 0.16); color: var(--status-preparing); }
.badge.status-Reserved { background: rgba(245, 158, 11, 0.16); color: var(--status-preparing); }

.badge.role-admin { background: rgba(213, 0, 28, 0.16); color: #ff6b6b; }
.badge.role-staff { background: rgba(14, 165, 233, 0.16); color: var(--primary); }
.badge.role-customer { background: var(--surface-2); color: var(--text-secondary); }

/* ============================================================
   Users tab: toolbar, avatar, row actions (admin)
   ============================================================ */

.count-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 2px 10px;
}

.table-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.table-toolbar .search-input {
  flex: 1;
  min-width: 160px;
}

.table-toolbar .search-input,
.table-toolbar select {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 14px;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.user-cell-name {
  font-weight: 600;
  font-size: 13px;
}

.user-cell-handle {
  font-size: 12px;
  color: var(--text-secondary);
}

.row-actions {
  display: flex;
  gap: 6px;
}

.icon-btn-sm {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  margin: 0;
}

.icon-btn-sm:hover { background: var(--surface-hover); }
.icon-btn-sm.danger:hover { background: rgba(239, 68, 68, 0.16); border-color: var(--danger); }

/* ============================================================
   Buttons — touch target ขั้นต่ำ 44px
   ============================================================ */

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 16px;
  min-height: 44px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  margin-right: 6px;
  font-family: inherit;
}

button.secondary { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-primary); }
button.danger { background: var(--danger); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button:hover:not(:disabled) { filter: brightness(1.1); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
}

.icon-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

/* ============================================================
   Dialog
   ============================================================ */

dialog {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  min-width: 320px;
  width: min(92vw, 420px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

html.payment-dialog-open {
  overflow: hidden;
  overscroll-behavior: none;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

dialog label {
  display: block;
  margin: 10px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

dialog input {
  width: 100%;
  margin-top: 4px;
  padding: 11px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 16px;
}

dialog menu {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding: 0;
}

#detail-dialog {
  width: 90vw;
  max-width: 720px;
}

.detail-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.detail-dialog-header h3 {
  margin: 0;
  font-size: 15px;
}

.detail-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.detail-section h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  font-size: 13px;
}

.info-grid .label {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 2px;
}

/* Customer charger detail: clear status, location, price, and charging actions. */
body.customer-charger-detail #screen-detail .charger-detail-header {
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(14, 165, 233, 0.1), var(--surface) 52%);
}

body.customer-charger-detail #screen-detail .charger-detail-header h2 {
  margin: 0 0 3px !important;
  font-size: clamp(20px, 4vw, 25px);
  line-height: 1.25;
}

body.customer-charger-detail #detail-cp-id {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

body.customer-charger-detail #detail-status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body.customer-charger-detail #detail-status-badges .badge {
  padding: 4px 9px;
}

.customer-detail-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 14px;
}

.customer-detail-overview {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.customer-detail-eyebrow,
.customer-detail-location-copy > span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-secondary);
  font-size: 12px;
}

.customer-detail-overview h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.35;
}

.customer-detail-overview p {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.customer-detail-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.customer-detail-status.ready { background: rgba(34, 197, 94, 0.14); color: var(--success); }
.customer-detail-status.working { background: rgba(14, 165, 233, 0.14); color: var(--primary); }
.customer-detail-status.offline { background: rgba(100, 116, 139, 0.17); color: var(--text-secondary); }

.customer-detail-location {
  display: grid;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
}

.customer-detail-location-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.customer-detail-location-copy { min-width: 0; }
.customer-detail-location-copy strong,
.customer-detail-location-copy small { display: block; overflow-wrap: anywhere; }
.customer-detail-location-copy strong { font-size: 14px; }
.customer-detail-location-copy small { margin-top: 3px; color: var(--text-secondary); font-size: 12px; }
.customer-detail-location-header .device-map-link { flex: 0 0 auto; white-space: nowrap; }

.customer-detail-map {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.customer-detail-map-preview {
  position: relative;
  z-index: 0;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  height: 230px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-primary);
  cursor: zoom-in;
  text-align: left;
}

.customer-detail-map-thumbnail {
  position: absolute;
  inset: 0;
  background: #e8e5df;
}

.customer-detail-map-thumbnail.leaflet-container { font: inherit; }
.customer-charger-map-pin { border: 0; background: transparent; }
.customer-charger-map-pin svg {
  display: block;
  width: 36px;
  height: 48px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35));
}
.customer-detail-map-thumbnail:not(.leaflet-container) {
  display: grid;
  place-items: center;
  padding: 18px;
  color: #566474;
  font-size: 12px;
  text-align: center;
}

.customer-detail-map-open-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(13, 20, 29, .9);
  color: #f7fbff;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}

.customer-map-user-status {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 500;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 20px);
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(13, 20, 29, .9);
  color: #dbeafe;
  font-size: 11px;
  line-height: 1.3;
  pointer-events: none;
}

.customer-map-user-status::before {
  content: "";
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
}

.customer-map-user-status[data-gps-state="ready"]::before { background: #3b82f6; }
.customer-map-user-status[data-gps-state="error"]::before { background: #ef4444; }

.customer-detail-map-preview:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.customer-map-attribution {
  justify-self: end;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
  text-align: right;
  text-decoration: none;
}

.customer-map-attribution:hover { color: var(--primary); }

.customer-map-dialog {
  width: min(960px, calc(100vw - 32px));
  height: min(820px, 92dvh);
  min-width: 0;
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
}

.customer-map-dialog[open] { display: flex; }
.customer-map-dialog::backdrop { background: rgba(3, 8, 15, .78); backdrop-filter: blur(5px); }

.customer-map-dialog-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 18px;
}

.customer-map-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.customer-map-dialog-footer { display: grid; gap: 8px; }
.customer-map-dialog-actions { display: flex; gap: 8px; min-width: 0; }

.customer-map-dialog-header > div { min-width: 0; }
.customer-map-dialog-header span { color: var(--text-secondary); font-size: 12px; }
.customer-map-dialog-header h2 { margin: 2px 0 0; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.customer-map-dialog-header button { display: grid; flex: 0 0 auto; place-items: center; width: 52px; min-width: 52px; height: 52px; min-height: 52px; margin: 0; padding: 0; }
.customer-map-dialog-header button svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 2.4; }

.customer-map-dialog-canvas {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #e8e5df;
}

.customer-map-dialog-canvas.leaflet-container { width: 100%; height: 100%; font: inherit; }
.customer-map-dialog-canvas .leaflet-control-zoom { margin: 12px !important; border: 0 !important; box-shadow: 0 2px 12px rgba(0, 0, 0, .2); }
.customer-map-dialog-canvas .leaflet-control-zoom a {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  line-height: 1;
  color: #17212b;
  font-size: 26px;
}
.customer-map-dialog-canvas .leaflet-control-attribution { display: none !important; }

.customer-map-dialog-footer .customer-map-directions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.customer-map-dialog-footer .customer-map-directions { flex: 0 1 260px; }
.customer-map-dialog-footer .customer-map-directions:hover { border-color: var(--primary); color: var(--primary); }
.customer-map-dialog-meta { display: grid; justify-items: end; gap: 4px; min-width: 0; text-align: right; }
.customer-map-dialog-meta #customer-map-gps-status { max-width: 100%; color: var(--text-secondary); font-size: 13px; line-height: 1.45; text-align: right; }
.customer-map-dialog-meta #customer-map-gps-status[data-gps-state="ready"] { color: #93c5fd; }
.customer-map-dialog-meta #customer-map-gps-status[data-gps-state="error"] { color: #fca5a5; }

.customer-map-dialog-hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.customer-map-unavailable {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 20px;
  color: var(--text-secondary);
  text-align: center;
}

.customer-map-unavailable a { margin-top: 10px; color: var(--primary); }

.customer-detail-map-empty {
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 9px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.customer-detail-connectors { display: grid; gap: 8px; }
.customer-detail-connectors > .muted-note { margin: 0; font-size: 12px; }

.customer-detail-connector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
}

.customer-detail-connector-main { display: grid; gap: 4px; min-width: 0; }
.customer-detail-connector-main strong { overflow-wrap: anywhere; font-size: 14px; }
.customer-detail-connector-main > span { color: var(--text-secondary); font-size: 12px; }
.customer-detail-connector-open { flex: 0 0 auto; min-height: 40px; margin: 0; padding: 8px 12px; white-space: nowrap; }

.customer-detail-no-qr {
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.customer-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.customer-detail-actions button { min-height: 44px; }
.customer-detail-actions button:disabled { cursor: not-allowed; opacity: 0.55; }
.customer-detail-footnote { margin: -8px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }

.flow-camera-panel[hidden] { display: none; }
.flow-camera-panel {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  box-sizing: border-box;
  margin: 0;
  padding: max(20px, env(safe-area-inset-top, 0px)) 18px max(20px, env(safe-area-inset-bottom, 0px));
  background: #05070b;
  isolation: isolate;
  color: var(--text-primary);
  text-align: center;
}
body.flow-camera-open .customer-detail-map-preview { visibility: hidden; }
.flow-camera-panel video {
  display: block;
  width: min(100%, 560px);
  height: min(68dvh, 560px);
  min-height: 220px;
  margin: 0 auto;
  border-radius: 16px;
  background: #000;
  object-fit: cover;
}
.flow-camera-panel p { max-width: 560px; margin: 0; color: var(--text-secondary); font-size: 13px; }
.flow-camera-panel button { min-width: min(100%, 260px); }
body.flow-camera-open { overflow: hidden; }

@media (max-width: 760px) {
  body.customer-charger-detail #screen-detail .charger-detail-header { gap: 10px; padding: 14px; }
  .customer-detail-card { gap: 13px; padding: 15px; }
  .customer-detail-overview h3 { font-size: 17px; }
  .customer-detail-location,
  .customer-detail-connector { align-items: flex-start; }
  .customer-detail-location-header { align-items: flex-start; }
  .customer-detail-map-preview { height: 200px; }
  .customer-map-dialog {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #10161e;
    border-radius: 0;
  }
  .customer-map-dialog[open] { display: block; }
  .customer-map-dialog-content {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
  }
  .customer-map-dialog-header {
    position: absolute;
    z-index: 1100;
    top: calc(10px + env(safe-area-inset-top, 0px));
    right: 12px;
    left: 12px;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
  }
  .customer-map-dialog-header > div {
    max-width: calc(100% - 76px);
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 12px;
    background: rgba(13, 20, 29, .92);
    box-shadow: 0 3px 14px rgba(0, 0, 0, .22);
    backdrop-filter: blur(10px);
  }
  .customer-map-dialog-header span { font-size: 11px; }
  .customer-map-dialog-header h2 { margin-top: 1px; font-size: 15px; }
  .customer-map-dialog-header button {
    width: 56px;
    min-width: 56px;
    height: 56px;
    min-height: 56px;
    padding: 0 8px;
    border-color: rgba(255, 255, 255, .22);
    border-radius: 50%;
    background: rgba(13, 20, 29, .94);
    box-shadow: 0 3px 14px rgba(0, 0, 0, .22);
    backdrop-filter: blur(10px);
  }
  .customer-map-dialog-canvas {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
  }
  .customer-map-dialog-canvas .leaflet-top.leaflet-left {
    top: calc(70px + env(safe-area-inset-top, 0px));
    right: 0;
    left: auto;
    z-index: 800;
  }
  .customer-map-dialog-canvas .leaflet-control-zoom { margin: 10px !important; }
  .customer-map-dialog-canvas .leaflet-control-zoom a { width: 50px; height: 50px; font-size: 28px; }
  .customer-map-dialog-footer {
    position: absolute;
    z-index: 1100;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    display: grid;
    grid-template-areas: "meta" "actions";
    gap: 8px;
    pointer-events: none;
  }
  .customer-map-dialog-actions {
    grid-area: actions;
    width: 100%;
    pointer-events: auto;
  }
  .customer-map-dialog-footer .customer-map-directions {
    flex: 1 1 auto;
    width: 100%;
    min-height: 52px;
    padding: 10px 14px;
    border-color: var(--primary);
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
    pointer-events: auto;
  }
  .customer-map-dialog-footer .customer-map-directions:hover { color: #fff; }
  .customer-map-dialog-meta {
    grid-area: meta;
    justify-self: end;
    width: fit-content;
    max-width: min(100%, 420px);
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 10px;
    background: rgba(13, 20, 29, .88);
    box-shadow: 0 3px 14px rgba(0, 0, 0, .2);
    backdrop-filter: blur(8px);
    pointer-events: auto;
  }
  .customer-map-dialog-meta #customer-map-gps-status { max-width: 100%; }
  .customer-map-dialog-meta .customer-map-attribution { max-width: 100%; }
  .customer-map-dialog-hint { display: none; }
  .customer-detail-connector { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .customer-detail-connector-main { grid-column: 1; }
  .customer-detail-connector > .customer-detail-status { grid-column: 2; }
  .customer-detail-connector-open { grid-column: 1 / -1; width: 100%; }
  .customer-detail-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .customer-detail-actions button { width: 100%; }
  .flow-camera-panel { padding-right: 12px; padding-left: 12px; }
  .flow-camera-panel video { width: min(100%, 480px); height: min(64dvh, 520px); min-height: 200px; border-radius: 12px; }
}

#config-table input[type="text"] {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-mono);
}

#config-table input[type="text"]:disabled {
  background: var(--surface);
  color: var(--text-secondary);
}

/* ============================================================
   Toast notifications
   ============================================================ */

.toast-container {
  position: fixed;
  right: 16px;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  left: 16px;
  align-items: flex-end;
}

.toast {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  background: var(--primary);
  max-width: 320px;
}

.toast-success { background: var(--success); }
.toast-warning { background: var(--warning); }
.toast-error { background: var(--danger); }

/* ============================================================
   Sidebar / admin app-shell (ใช้ในหน้า admin ต่อไป — ดู Phase 5)
   ============================================================ */

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  height: 100%;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 20px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand .brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
}

.sidebar-brand .version-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--sidebar-muted);
  background: var(--sidebar-bg-hover);
  border: 1px solid var(--sidebar-border);
  padding: 1px 7px;
  border-radius: 999px;
}

.sidebar-brand .brand-subtitle {
  font-size: 12px;
  color: var(--sidebar-muted);
  margin: 4px 0 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sidebar-muted);
  padding: 14px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 44px;
  border-left: 3px solid transparent;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 2px;
  cursor: pointer;
  border-top: none;
  border-right: none;
  border-bottom: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.nav-item:hover {
  background: var(--sidebar-bg-hover);
  text-decoration: none;
  color: #ffffff;
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  border-left-color: var(--brand);
  font-weight: 600;
}

.sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  padding: 12px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}

.sidebar-user .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-user .info {
  flex: 1;
  min-width: 0;
}

.sidebar-user .username {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .role {
  font-size: 11px;
  color: var(--sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 44px;
  color: var(--sidebar-muted);
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.sidebar-logout:hover {
  background: var(--sidebar-bg-hover);
  color: #ff6161;
}

.main-area {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.topbar h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 10px;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-overlay {
  display: none;
}

main.content {
  padding: 24px 32px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* ============================================================
   Auth pages (login/register) — centered card, ไม่มี sidebar
   ============================================================ */

.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.auth-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 32px;
  font-size: 16px;
  font-weight: 700;
  background: var(--sidebar-bg);
  color: #ffffff;
  border-bottom: 3px solid var(--brand);
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.auth-card h2 {
  margin-top: 0;
}

.auth-footer-link {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

/* ============================================================
   EV Portal login — standalone login experience
   ============================================================ */

.ev-portal-login {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 18% 43%, rgba(14, 165, 233, 0.10), transparent 34%),
    radial-gradient(ellipse at 80% 12%, rgba(34, 197, 94, 0.055), transparent 28%),
    #0d131a;
}

.ev-portal-login [hidden] { display: none !important; }

.ev-portal-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.ev-portal-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(20px, 5vw, 72px);
  background: rgba(16, 21, 28, 0.88);
  border-bottom: 1px solid rgba(122, 145, 168, 0.16);
}

.ev-portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f7faff;
  text-decoration: none;
}

.ev-portal-brand-mark { color: #f8a91b; font-size: 22px; line-height: 1; }
.ev-portal-brand-copy { display: grid; gap: 2px; line-height: 1.1; }
.ev-portal-brand-copy strong { font-size: 15px; letter-spacing: 0.01em; }
.ev-portal-brand-copy small { color: #8292a5; font-size: 9px; letter-spacing: 0.13em; }

.ev-portal-header-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #91a1b5;
  font-size: 10px;
  letter-spacing: 0.11em;
}

.ev-portal-header-status i,
.ev-portal-live i {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: #24ce83;
  box-shadow: 0 0 12px rgba(36, 206, 131, 0.55);
}

.ev-portal-main {
  width: min(1160px, calc(100% - 48px));
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(350px, 440px);
  align-items: center;
  gap: clamp(42px, 8vw, 110px);
  margin: 0 auto;
  padding: 56px 0;
}

.ev-portal-intro { min-width: 0; }
.ev-portal-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #35bdf2;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.ev-portal-kicker > span {
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: #19adea;
}

.ev-portal-intro h1 {
  margin: 18px 0 14px;
  color: #f3f7fc;
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.045em;
}

.ev-portal-intro h1 em { color: #23b6ef; font-style: normal; }
.ev-portal-description { max-width: 470px; margin: 0; color: #9ba8b8; font-size: 14px; line-height: 1.9; }

.ev-portal-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 560px;
  margin-top: 30px;
}

.ev-portal-features > div {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 10px;
  border: 1px solid rgba(118, 145, 170, 0.15);
  border-radius: 12px;
  background: rgba(24, 33, 43, 0.62);
}

.ev-portal-feature-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(14, 165, 233, 0.13);
  color: #39c4f8;
  font-size: 15px;
  font-weight: 600;
}

.ev-portal-features strong,
.ev-portal-features small { display: block; }
.ev-portal-features strong { color: #e8eff7; font-size: 11px; font-weight: 600; }
.ev-portal-features small { margin-top: 3px; color: #8291a3; font-size: 9px; line-height: 1.5; }

.ev-portal-visual {
  position: relative;
  width: min(470px, 100%);
  height: 190px;
  margin: 30px 0 0 10px;
}

.ev-portal-orbit { position: absolute; border: 1px solid rgba(31, 171, 228, 0.14); border-radius: 50%; }
.ev-portal-orbit-one { width: 195px; height: 195px; top: -3px; left: 110px; }
.ev-portal-orbit-two { width: 148px; height: 148px; top: 20px; left: 133px; border-style: dashed; border-color: rgba(31, 171, 228, 0.19); }

.ev-portal-charge-card {
  position: absolute;
  top: 14px;
  left: 0;
  width: 340px;
  height: 144px;
  overflow: hidden;
  border: 1px solid rgba(87, 126, 156, 0.32);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(27, 42, 54, 0.97), rgba(18, 28, 38, 0.94));
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.26), inset 0 1px rgba(255, 255, 255, 0.035);
}

.ev-portal-charge-top { position: absolute; top: 14px; right: 15px; left: 15px; display: flex; justify-content: space-between; color: #92a6b9; font-size: 8px; letter-spacing: 0.11em; }
.ev-portal-live { display: inline-flex; align-items: center; gap: 5px; color: #5be6a2; font-size: 8px; }
.ev-portal-live i { width: 5px; height: 5px; }
.ev-portal-charger { position: absolute; top: 39px; left: 36px; width: 76px; height: 81px; border: 1px solid #526b7e; border-radius: 12px 12px 10px 10px; background: linear-gradient(135deg, #e7f1f7, #a8bbc8); box-shadow: 7px 9px 22px rgba(0, 0, 0, 0.22); }
.ev-portal-charger-screen { position: absolute; top: 10px; left: 11px; width: 54px; height: 42px; display: grid; place-items: center; border-radius: 6px; background: linear-gradient(135deg, #102a3a, #164962); box-shadow: inset 0 0 12px rgba(31, 183, 239, 0.16); }
.ev-portal-charger-screen span { color: #2dd2ff; font-size: 23px; filter: drop-shadow(0 0 6px rgba(45, 210, 255, 0.45)); }
.ev-portal-charger-slot { position: absolute; bottom: 9px; left: 30px; width: 16px; height: 5px; border-radius: 5px; background: #5f7789; }
.ev-portal-charger-leg { position: absolute; bottom: -13px; left: 29px; width: 18px; height: 14px; background: #61798a; clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%); }
.ev-portal-charge-cable { position: absolute; top: 73px; left: 112px; width: 38px; height: 47px; border: 4px solid #2f4f62; border-top: 0; border-left: 0; border-radius: 0 0 24px 0; transform: skewX(-14deg); }
.ev-portal-charge-base { position: absolute; bottom: 23px; left: 22px; width: 108px; height: 5px; border-radius: 50%; background: rgba(1, 8, 14, 0.55); filter: blur(2px); }
.ev-portal-power-chip { position: absolute; right: 18px; bottom: 23px; width: 130px; padding: 10px 12px; border: 1px solid rgba(82, 121, 147, 0.35); border-radius: 11px; background: rgba(14, 22, 30, 0.83); }
.ev-portal-power-chip span,.ev-portal-power-chip strong { display: block; }
.ev-portal-power-chip span { color: #93a3b4; font-size: 9px; }
.ev-portal-power-chip strong { margin-top: 3px; color: #e8f0f6; font-size: 12px; }
.ev-portal-power-chip i { position: absolute; right: 12px; bottom: 14px; color: #31d18b; font-size: 8px; font-style: normal; }
.ev-portal-visual-caption { position: absolute; right: 28px; bottom: 2px; color: #718397; font-size: 9px; letter-spacing: 0.16em; }
.ev-portal-visual-caption span { margin-right: 7px; color: #22b8f0; }

.ev-portal-auth {
  width: 100%;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  padding: 30px;
  border: 1px solid rgba(120, 144, 168, 0.21);
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(28, 37, 48, 0.98), rgba(22, 30, 40, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.035);
}

.ev-portal-auth-heading { text-align: center; }
.ev-portal-auth-heading,
.ev-portal-auth-tabs { flex: 0 0 auto; }
.ev-portal-auth-icon { width: 40px; height: 40px; display: grid; place-items: center; margin: 0 auto 13px; border: 1px solid rgba(37, 183, 238, 0.28); border-radius: 13px; background: rgba(14, 165, 233, 0.12); color: #30c2f5; font-size: 19px; }
.ev-portal-auth-heading .ev-portal-kicker { justify-content: center; font-size: 9px; }
.ev-portal-auth-heading .ev-portal-kicker > span { display: none; }
.ev-portal-auth-heading h2 { margin: 7px 0 3px; color: #f2f6fa; font-size: 22px; }
.ev-portal-auth-heading > p:last-child { margin: 0; color: #8998a9; font-size: 12px; }

.ev-portal-auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 25px 0 22px; padding: 4px; border: 1px solid #2a3744; border-radius: 11px; background: #141b23; }
.ev-portal-auth-tabs button { min-height: 38px; padding: 8px 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #8796a7; font-size: 12px; font-weight: 600; cursor: pointer; }
.ev-portal-auth-tabs button:hover { color: #e9f0f6; }
.ev-portal-auth-tabs button.is-active { border-color: rgba(39, 184, 238, 0.24); background: #202d39; color: #4dc9f5; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14); }

.ev-portal-form { display: flex; flex-direction: column; gap: 9px; }
.ev-portal-form label { margin-top: 1px; color: #bac5d1; font-size: 12px; font-weight: 500; }
.ev-portal-form input { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #344251; border-radius: 10px; outline: 0; background: #121922; color: #f3f7fb; font-size: 15px; transition: border-color 140ms ease, box-shadow 140ms ease; }
.ev-portal-form input::placeholder { color: #627184; }
.ev-portal-form input:focus { border-color: #159ed7; box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12); }
.ev-portal-phone-field { display: flex; align-items: center; min-height: 48px; padding-left: 13px; border: 1px solid #344251; border-radius: 10px; background: #121922; }
.ev-portal-phone-field:focus-within { border-color: #159ed7; box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12); }
.ev-portal-phone-field > span { display: grid; place-items: center; width: 24px; color: #5bbfe8; font-size: 15px; }
.ev-portal-phone-field input { min-width: 0; border: 0; background: transparent; box-shadow: none !important; }
.ev-portal-field-note { margin: -3px 0 5px; color: #8190a2; font-size: 10px; line-height: 1.6; }
.ev-portal-primary-button { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 5px; padding: 11px 16px; border: 1px solid #13a8e4; border-radius: 10px; background: linear-gradient(110deg, #0ea5e9, #0c99d8); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 22px rgba(14, 165, 233, 0.17); transition: filter 140ms ease, transform 140ms ease, opacity 140ms ease; }
.ev-portal-primary-button:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.ev-portal-primary-button:disabled { cursor: wait; opacity: 0.68; }
.ev-portal-primary-button.is-loading::after { width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.45); border-top-color: white; border-radius: 50%; content: ""; animation: ev-portal-spin .7s linear infinite; }
@keyframes ev-portal-spin { to { transform: rotate(360deg); } }

.ev-portal-message { margin: 2px 0; padding: 9px 10px; border: 1px solid rgba(14, 165, 233, 0.22); border-radius: 8px; background: rgba(14, 165, 233, 0.08); color: #91d9f4; font-size: 11px; line-height: 1.55; }
.ev-portal-message.is-error { border-color: rgba(239, 68, 68, 0.29); background: rgba(239, 68, 68, 0.08); color: #ff9a9a; }
.ev-portal-message.is-success { border-color: rgba(34, 197, 94, 0.25); background: rgba(34, 197, 94, 0.075); color: #78dfa3; }
.ev-portal-login-panel:not([hidden]) { display: flex; flex: 1 0 auto; flex-direction: column; }
.ev-portal-privacy-note { display: flex; justify-content: center; align-items: center; gap: 7px; margin: auto 0 0; padding-top: 17px; color: #77879a; font-size: 10px; }
.ev-portal-privacy-note span { color: #38b9e9; }
.ev-portal-otp-summary { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; color: #8797a9; font-size: 11px; line-height: 1.6; }
.ev-portal-otp-summary strong { color: #dce6ef; font-size: 12px; }
.ev-portal-otp-symbol { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; background: rgba(14, 165, 233, 0.12); color: #42c4f0; font-size: 17px; }
.ev-portal-form .ev-portal-otp-input { min-height: 54px; text-align: center; font-size: 22px; font-weight: 700; letter-spacing: 0.34em; }
.ev-portal-text-button { align-self: center; padding: 5px 8px; border: 0; background: transparent; color: #49bce9; font-size: 11px; cursor: pointer; }
.ev-portal-text-button:hover { color: #a6e7ff; text-decoration: underline; }
.ev-portal-legacy-note { margin: auto 0 0; padding-top: 16px; color: #8594a5; font-size: 10px; line-height: 1.6; text-align: center; }
.ev-portal-auth-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(128, 148, 168, 0.14); color: #77879a; font-size: 9px; letter-spacing: 0.04em; }
.ev-portal-auth-footer a { color: #52bfe7; text-decoration: none; letter-spacing: 0; }
.ev-portal-auth-footer a:hover { text-decoration: underline; }
.ev-portal-footer { display: flex; justify-content: space-between; gap: 20px; padding: 16px clamp(20px, 5vw, 72px); color: #627286; font-size: 9px; letter-spacing: 0.08em; }

@media (max-width: 900px) {
  .ev-portal-main { grid-template-columns: minmax(0, 1fr) minmax(320px, 390px); gap: 32px; }
  .ev-portal-features { grid-template-columns: 1fr; gap: 8px; max-width: 390px; margin-top: 22px; }
  .ev-portal-features > div { align-items: center; padding: 8px 10px; }
  .ev-portal-features small { font-size: 9px; }
  .ev-portal-visual { margin-top: 20px; transform: scale(.86); transform-origin: left top; }
}

@media (max-width: 700px) {
  .ev-portal-header { min-height: 64px; padding-right: 18px; padding-left: 18px; }
  .ev-portal-header-status { font-size: 8px; letter-spacing: 0.06em; }
  .ev-portal-main { width: min(100% - 32px, 440px); grid-template-columns: 1fr; gap: 26px; padding: 34px 0 28px; }
  .ev-portal-intro { text-align: center; }
  .ev-portal-intro > .ev-portal-kicker { justify-content: center; }
  .ev-portal-intro h1 { margin: 13px 0 9px; font-size: clamp(34px, 10vw, 46px); }
  .ev-portal-description { max-width: 390px; margin: 0 auto; font-size: 12px; }
  .ev-portal-features { display: none; }
  .ev-portal-visual { display: none; }
  .ev-portal-auth { min-height: 600px; padding: 24px 20px 20px; border-radius: 17px; }
  .ev-portal-auth-tabs { margin: 21px 0 19px; }
  .ev-portal-footer { padding: 12px 18px max(12px, env(safe-area-inset-bottom, 0px)); font-size: 8px; }
}

@media (max-width: 380px) {
  .ev-portal-header-status { display: none; }
  .ev-portal-auth { padding-right: 16px; padding-left: 16px; }
  .ev-portal-main { width: calc(100% - 24px); }
}

/* ============================================================
   Forms ทั่วไป (admin/settings/users/cards)
   ============================================================ */

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.form-grid input[type="text"],
.form-grid input[type="password"],
.form-grid input[type="number"],
.form-grid input[type="email"],
.form-grid select {
  padding: 11px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 16px;
}

.form-grid .checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.form-grid.inline-form {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
}

.form-grid.inline-form input {
  flex: 1;
  min-width: 140px;
}

.form-grid.compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 16px;
  align-items: end;
}

.form-grid.compact-grid .form-msg,
.form-grid.compact-grid button[type="submit"] {
  grid-column: 1 / -1;
}

.form-grid.compact-grid button[type="submit"] {
  justify-self: start;
  min-width: 120px;
}

.muted-note {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.form-error {
  color: var(--danger);
  font-size: 13px;
  margin: 0;
}

.form-msg {
  color: var(--success);
  font-size: 13px;
  margin: 0;
}

.autocomplete-results {
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 180px;
  overflow-y: auto;
  margin-top: -6px;
  background: var(--surface);
}

.autocomplete-item {
  padding: 10px 10px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--active-bg); }
.autocomplete-item .muted { color: var(--text-secondary); font-size: 12px; }

footer.page-footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ============================================================
   Responsive: min-width ขยายจากมือถือไป tablet/desktop
   ============================================================ */

@media (min-width: 640px) {
  main.app-content {
    padding-left: 24px;
    padding-right: 24px;
  }

  .device-card-meta {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (min-width: 900px) {
  /* bottom nav ยังคงอยู่ทุกขนาดจอ — ธีมมือถือนี้แทนที่ layout เดิมทั้งหมด ไม่มี nav สำรองสำหรับจอกว้าง */
  .mobile-header {
    padding-left: 32px;
    padding-right: 32px;
  }
}

/* app-shell (admin) breakpoint เดิม: sidebar เป็น off-canvas บนจอแคบ */
@media (max-width: 900px) {
  .menu-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    width: min(80vw, 280px);
    transform: translateX(-100%);
    transition: transform 0.2s ease-in-out;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.4);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
  }

  .app-shell {
    display: block;
  }

  .topbar {
    padding: 14px 16px;
    padding-top: max(14px, env(safe-area-inset-top, 0px));
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .topbar h2 {
    font-size: 18px;
  }

  main.content {
    padding: 16px;
  }

  .card {
    padding: 14px;
    border-radius: 10px;
  }

  table {
    min-width: 640px;
  }

  .form-grid.compact-grid {
    grid-template-columns: 1fr;
  }

  .table-toolbar {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .icon-btn span.label {
    display: none;
  }
}

/* Wallet top-up mock flow. */
.wallet-home-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
  padding: 17px;
  border: 1px solid rgba(14, 165, 233, .45);
  border-radius: 12px;
  background: #172b39;
  cursor: pointer;
}

.wallet-home-summary-main { display: block; min-width: 0; }
.wallet-home-kicker { color: #9ddcf4; font-size: 12px; }
.wallet-home-label { margin-top: 7px; color: var(--text-secondary); font-size: 12px; }
.wallet-home-value { display: block; margin-top: 2px; color: #fff; font-family: var(--font-mono); font-size: 32px; font-weight: 700; line-height: 1.15; }

.wallet-home-action {
  min-height: 42px;
  margin: 0;
  padding: 9px 14px;
  border: 1px solid var(--primary);
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.wallet-home-meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 3px;
  padding-top: 11px;
  border-top: 1px solid rgba(157, 220, 244, .2);
  color: #b7c5d1;
  font-size: 11px;
}
.wallet-home-meta strong { color: #8de0a2; font-weight: 600; }

.customer-history { margin-bottom: 16px; }
.history-wallet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.history-wallet > div { display: grid; gap: 3px; min-width: 0; }
.history-eyebrow, .history-summary span { color: var(--text-secondary); font-size: 12px; }
.history-wallet strong { font-family: var(--font-mono); font-size: 21px; line-height: 1.2; }
.history-wallet button { flex: 0 0 auto; margin: 0; }
.history-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.history-summary > div { display: grid; gap: 3px; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.history-summary strong { font-family: var(--font-mono); font-size: 17px; }
.customer-transaction-list { display: grid; }
.customer-transaction-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 13px 2px; border-bottom: 1px solid var(--border); }
.history-type-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-2); font-size: 15px; }
.history-type-icon.charge { color: var(--primary); }
.history-type-icon.topup { color: var(--success); }
.customer-transaction-copy { flex: 1 1 auto; min-width: 0; }
.customer-transaction-title { overflow-wrap: anywhere; color: var(--text-primary); font-size: 13px; font-weight: 600; }
.customer-transaction-meta { margin-top: 3px; color: var(--text-secondary); font-size: 11px; line-height: 1.45; }
.customer-transaction-amount { flex: 0 0 auto; max-width: 42%; overflow-wrap: anywhere; text-align: right; font-family: var(--font-mono); font-size: 13px; }
.customer-transaction-amount.debit { color: var(--danger); }
.customer-transaction-amount.credit { color: var(--success); }
.customer-transaction-amount.pending { color: var(--text-secondary); }
.history-status { display: inline-block; margin-top: 4px; color: var(--text-secondary); font-size: 10px; }
.history-status.charging { color: var(--primary); }
.history-status.pending { color: var(--warning); }

.home-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.home-section-heading h3 { margin: 0; color: var(--text-primary); font-size: 15px; }
.home-section-heading span { color: var(--text-secondary); font-size: 11px; }

.mock-payment-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid rgba(14, 165, 233, .35);
  border-radius: 10px;
  background: rgba(14, 165, 233, .08);
}

.mock-payment-callout strong { color: var(--text-primary); }
.mock-payment-callout p { margin: 4px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.mock-payment-callout button { flex: 0 0 auto; margin: 0; }

.mock-payment-dialog {
  width: min(94vw, 430px);
  min-width: 0;
  max-width: calc(100vw - 20px);
  max-height: calc(100dvh - 24px);
  padding: 20px;
  overflow: auto;
}

.mock-payment-dialog-header,
.mock-payment-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mock-payment-dialog-header h3 { margin: 3px 0 0; font-size: 20px; }
.mock-payment-kicker { color: var(--primary); font-size: 10px; font-weight: 700; }
.mock-payment-dialog-header .icon-btn { margin: 0; padding: 8px 10px; min-height: 36px; }

.mock-payment-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 18px 0;
}

.mock-payment-steps span {
  padding: 7px 4px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text-secondary);
  text-align: center;
  font-size: 11px;
}

.mock-payment-steps span.active { background: var(--primary); color: #fff; }
.mock-payment-step { text-align: center; }
.mock-payment-note { margin: 0 0 16px; color: var(--text-secondary); font-size: 12px; line-height: 1.55; }
.mock-payment-label { display: block; margin-bottom: 7px; color: var(--text-secondary); text-align: left; font-size: 13px; }

.mock-payment-amount-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.mock-payment-amount-row span { color: var(--text-secondary); font-size: 18px; }
.mock-payment-amount-row input { flex: 1; width: 100%; min-width: 0; padding: 12px 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font-family: var(--font-mono); font-size: 24px; }
.mock-payment-quick-amounts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 12px 0 18px; }
.mock-payment-quick-amounts button { min-height: 36px; margin: 0; padding: 6px 4px; font-size: 12px; }
.mock-payment-primary { width: 100%; margin: 0; }
.mock-payment-cancel { width: 100%; margin: 12px 0 0; }

.mock-payment-status { display: inline-block; margin-bottom: 12px; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.mock-payment-status.pending { background: rgba(245, 158, 11, .12); color: #fbbf24; }
.mock-payment-status.success { background: rgba(34, 197, 94, .12); color: #4ade80; }
.mock-payment-amount-display { margin-bottom: 5px; color: var(--text-primary); font-family: var(--font-mono); font-size: 29px; font-weight: 700; }
.mock-payment-qr-caption { margin: 10px 0 16px; color: var(--text-secondary); font-size: 11px; }

.mock-qr {
  display: grid;
  grid-template-columns: repeat(29, minmax(0, 1fr));
  gap: 0;
  width: min(58vw, 240px);
  aspect-ratio: 1;
  margin: 12px auto 0;
  padding: 8px;
  border: 6px solid #fff;
  border-radius: 16px;
  background: #fff;
}

.mock-qr span { min-width: 0; background: #fff; }
.mock-qr span.on { background: #101820; }
.omise-payment-qr {
  width: min(76vw, 300px);
  max-width: 100%;
  height: auto;
  margin: 12px auto 0;
  padding: 8px;
  border: 5px solid #fff;
  border-radius: 16px;
  background: #fff;
  object-fit: contain;
}
.mock-payment-success-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 2px auto 14px; border-radius: 50%; background: #16a05d; color: #fff; font-size: 32px; font-weight: 700; }
.mock-payment-success-title { margin: 3px 0 20px; font-size: 19px; }
.mock-payment-result-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 2px auto 14px; border-radius: 50%; background: #b4233c; color: #fff; font-size: 32px; font-weight: 700; }
.mock-payment-result-icon.expired { background: #a76a12; }
.mock-payment-result-icon.cancelled { background: #526176; }
.mock-payment-result-title { margin: 3px 0 14px; color: #f3f6fc; font-size: 19px; }
.mock-payment-status.failed { background: rgba(244, 63, 94, .14); color: #fb7185; }
.mock-payment-status.expired { background: rgba(245, 158, 11, .14); color: #fbbf24; }
.mock-payment-status.cancelled { background: rgba(148, 163, 184, .14); color: #cbd5e1; }
.mock-payment-result-summary {
  width: 100%;
  margin-top: 4px;
  padding: 2px 14px;
  border: 1px solid #2d3b53;
  border-radius: 10px;
  background: #141e30;
}
.mock-payment-result-row { padding: 11px 0; border-bottom: 1px solid var(--border); color: var(--text-secondary); font-size: 13px; text-align: left; }
.mock-payment-result-row:last-child { border-bottom: 0; }
.mock-payment-result-row strong { color: var(--text-primary); font-family: var(--font-mono); }

#mock-payment-step-scan,
#mock-payment-step-success,
#mock-payment-step-failure {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f3f6fc;
}

#mock-payment-step-scan .mock-payment-note,
#mock-payment-step-success .mock-payment-note { color: #a6b4c9; }
#mock-payment-step-scan .mock-payment-amount-display { color: #f3f6fc; }
#mock-payment-step-scan .mock-payment-qr-caption { color: #a6b4c9; }
#mock-payment-step-success .mock-payment-success-title { color: #f3f6fc; }
#mock-payment-step-success .mock-payment-result-row { border-color: rgba(181, 199, 226, .14); color: #a6b4c9; }
#mock-payment-step-success .mock-payment-result-row strong { color: #f3f6fc; }
#mock-payment-step-success #mock-payment-success-note { margin: 12px 0 0; }
.mock-payment-failure-mode #mock-payment-step-failure { display: flex !important; flex-direction: column; align-items: stretch; }
.mock-payment-result-mode #mock-payment-step-failure .mock-payment-result-summary { margin-top: 0; }
.mock-payment-result-mode #mock-payment-step-failure .mock-payment-note { margin: 14px 0; color: #a6b4c9; text-align: left; }

.mock-payment-dialog.mock-payment-scan-mode {
  width: min(94vw, 430px);
  max-height: calc(100dvh - 24px);
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #314363;
  border-radius: 18px;
  background: #101a2d;
  color: #f3f6fc;
  box-shadow: 0 22px 64px rgba(0, 0, 0, .5);
}

.mock-payment-dialog.mock-payment-scan-mode::backdrop { background: rgba(2, 6, 16, .78); backdrop-filter: blur(6px); }
.mock-payment-scan-mode .mock-payment-dialog-header { justify-content: space-between; padding: 4px 0 14px; }
.mock-payment-scan-mode .mock-payment-dialog-header > div { display: block; }
.mock-payment-scan-mode .mock-payment-steps { display: grid; margin: 14px 0; }
.mock-payment-scan-mode #mock-payment-step-scan .mock-payment-status,
.mock-payment-scan-mode #mock-payment-step-scan .mock-payment-amount-label,
.mock-payment-scan-mode #mock-payment-step-scan .mock-payment-qr-caption { display: block; }
.mock-payment-scan-mode #mock-payment-step-scan .mock-payment-note { display: none; }
.mock-payment-scan-mode #mock-payment-step-scan { display: flex !important; flex-direction: column; align-items: stretch; padding: 0; border: 0; background: transparent; color: #f8fbff; }
.mock-payment-qr-brand { order: 1; margin: 0 0 8px; padding: 11px 10px; border-radius: 14px; background: #07508b; color: #fff; font-size: 16px; font-weight: 700; }
.mock-payment-qr-provider { order: 2; color: #9fcaff; font-size: 16px; font-style: italic; font-weight: 700; }
.mock-payment-qr-powered { order: 3; margin-top: 2px; color: #94a3b8; font-size: 12px; }
.mock-payment-amount-label { order: 5; margin-top: 14px; color: #aab8cc; font-size: 12px; text-align: center; }
.mock-payment-scan-mode .mock-payment-amount-display { order: 6; margin: 3px 0 0; color: #f8fbff; font-size: 28px; text-align: center; }
.mock-payment-scan-mode .mock-qr { order: 4; margin-top: 12px; }
.mock-payment-scan-mode .omise-payment-qr { order: 4; }
.mock-payment-qr-expiry { order: 5; margin-top: 10px; color: #cbd5e1; font-size: 14px; }
.mock-payment-qr-expiry strong { color: #ff4b5c; font-size: 16px; }
.mock-payment-qr-credit { order: 7; margin-top: 8px; color: #8795ff; font-size: 14px; }
.mock-payment-download { order: 8; width: 100%; margin: 12px 0 0; border: 1px solid #5541dc; border-radius: 12px; background: transparent; color: #b6baff; }
.mock-payment-waiting { order: 9; margin: 10px 0 0; color: #9aa6bc; font-size: 13px; }
.mock-payment-test-action { order: 10; width: auto; margin: 8px auto 0; padding: 5px 10px; border: 0; background: transparent; color: #aab6cc; font-size: 12px; }
.mock-payment-warning { order: 11; margin-top: 10px; padding: 8px 10px; border: 1px solid #714018; border-radius: 10px; background: rgba(91, 47, 24, .22); color: #f2b34b; font-size: 10px; line-height: 1.45; text-align: left; }

.mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-qr-brand,
.mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-qr-provider,
.mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-qr-powered { display: none; }
.mock-payment-dialog.mock-payment-scan-mode.omise-mode[open] { display: flex; flex-direction: column; }
.mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-dialog-header {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0 14px;
  border-bottom: 1px solid rgba(181, 199, 226, .14);
}
.mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-dialog-header > div { display: block; min-width: 0; text-align: left; }
.mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-dialog-header h3 { margin-top: 3px; color: #f8fbff; font-size: 19px; }
.mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-kicker { color: #9fcaff; letter-spacing: 0; }
.mock-payment-dialog.mock-payment-scan-mode.omise-mode #mock-payment-step-scan .mock-payment-status {
  order: 1;
  display: inline-block;
  align-self: center;
  margin: 4px 0 8px;
}
.mock-payment-dialog.mock-payment-scan-mode.omise-mode #mock-payment-step-scan .mock-payment-amount-label {
  order: 2;
  display: block;
  margin: 0;
}
.mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-amount-display {
  order: 3;
  margin: 2px 0 0;
  color: #f8fbff !important;
  font-size: 30px;
  line-height: 1.15;
}
.mock-payment-dialog.mock-payment-scan-mode.omise-mode .omise-payment-qr {
  order: 4;
  width: min(68vw, 250px);
  margin-top: 12px;
  padding: 6px;
  border-radius: 12px;
}
.mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-qr-expiry {
  order: 5;
  display: block;
  margin-top: 9px;
  text-align: center;
}
.mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-download {
  order: 6;
  display: block;
  width: 100%;
  margin: 10px 0 0;
  border: 1px solid rgba(159, 202, 255, .35);
  border-radius: 10px;
  background: rgba(159, 202, 255, .08);
  color: #dbeafe;
}
.mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-qr-caption {
  order: 7;
  display: block;
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(245, 158, 11, .35);
  border-radius: 10px;
  background: rgba(245, 158, 11, .1);
  color: #f4c66a;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}
.mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-waiting {
  order: 8;
  margin-top: 9px;
  text-align: center;
}
.mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-qr-credit {
  order: 9;
  margin-top: 4px;
  color: #9fcaff;
  font-size: 12px;
  text-align: center;
}
.mock-payment-dialog.mock-payment-scan-mode.omise-mode #mock-payment-step-scan .mock-payment-cancel-note {
  order: 10;
  display: block;
  margin: 12px 0 0;
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 8px;
  background: rgba(148, 163, 184, .07);
  color: #b7c2d3;
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
}
.mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-cancel {
  position: sticky;
  bottom: 0;
  z-index: 2;
  flex: 0 0 auto;
  margin-top: 12px;
  border: 1px solid rgba(159, 202, 255, .35);
  background: rgba(159, 202, 255, .08);
  color: #dbeafe;
}

@media (max-width: 480px) {
  .wallet-home-summary { align-items: stretch; }
  .wallet-home-action { width: 100%; }
  .wallet-home-value { font-size: 28px; }
  .mock-payment-callout { align-items: stretch; flex-direction: column; }
  .mock-payment-callout button { width: 100%; }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .omise-payment-qr { width: min(64vw, 224px); }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-cancel { margin-top: 8px; }
}

@media (max-width: 760px) and (max-height: 760px) {
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode {
    max-height: calc(100dvh - 16px);
    padding: 0 14px 12px;
  }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-dialog-header { padding: 8px 0 9px; }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode #mock-payment-step-scan .mock-payment-status { margin: 2px 0 4px; padding: 4px 8px; }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-amount-display { font-size: 26px; }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .omise-payment-qr { width: min(56vw, 196px); margin-top: 7px; padding: 4px; }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-qr-expiry { margin-top: 6px; }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-download { min-height: 38px; margin-top: 7px; }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-qr-caption { margin-top: 6px; padding: 6px 8px; font-size: 10px; }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-waiting { margin-top: 6px; font-size: 11px; }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-qr-credit { margin-top: 2px; font-size: 11px; }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode #mock-payment-step-scan .mock-payment-cancel-note { margin-top: 7px; padding: 6px 8px; font-size: 10px; }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-cancel { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
}

.account-settings-card {
  margin-bottom: 18px;
}

.account-profile-label {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.account-settings-card .sidebar-user {
  padding: 6px 4px 18px !important;
  border-bottom: 1px solid var(--border);
}

.account-settings-card .sidebar-user .avatar {
  width: 54px;
  height: 54px;
  font-size: 20px;
}

.account-settings-card .sidebar-user .username {
  color: var(--text-primary) !important;
  font-size: 17px;
}

.account-login-name {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 12px;
}

.account-settings-card .sidebar-user .role {
  margin-top: 3px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.account-menu {
  display: grid;
  margin: 4px 0 12px;
}

.account-menu-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 76px;
  padding: 12px 4px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  margin: 0;
}

.account-menu-row:hover:not(:disabled) {
  background: var(--surface-hover);
}

.account-menu-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 21px;
}

.account-menu-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.account-menu-copy strong {
  font-size: 15px;
  font-weight: 600;
}

.account-menu-copy small {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.account-menu-copy small b {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 600;
}

.account-menu-chevron {
  color: var(--text-secondary);
  font-size: 25px;
  line-height: 1;
}

.account-menu-row.is-disabled {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  color: var(--text-secondary);
  cursor: not-allowed;
}

.account-menu-row.is-disabled .account-menu-icon {
  opacity: .72;
}

.account-menu-badge {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
}

.account-settings-card #logout-btn {
  width: 100%;
  margin: 12px 0 0;
  min-height: 48px;
}

#screen-wallet #wallet-card {
  margin-bottom: 0;
}

#screen-wallet #wallet-card .stat-grid {
  grid-template-columns: minmax(0, 1fr);
}

#screen-wallet #wallet-card .stat-card {
  border-radius: 8px;
}

.wallet-budget-description {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.wallet-current-budget {
  margin: 0 0 14px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.wallet-budget-controls {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  align-items: end;
  gap: 12px;
}

.wallet-budget-label {
  display: grid;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
}

.wallet-budget-label input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 16px;
}

.wallet-budget-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.wallet-budget-actions button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 9px 12px;
}

@media (max-width: 520px) {
  main.app-content {
    padding: 12px 12px calc(76px + env(safe-area-inset-bottom, 0px));
  }

  .screen-header {
    gap: 8px;
    margin-bottom: 12px;
  }

  .screen-header h2 {
    font-size: 17px;
  }

  .bottom-nav-item {
    min-height: 60px;
    padding: 7px 3px 8px;
    font-size: 12px;
  }

  .account-settings-card .sidebar-user {
    padding-bottom: 15px !important;
  }

  .account-menu-row {
    grid-template-columns: 38px minmax(0, 1fr) auto 14px;
    gap: 8px;
    min-height: 72px;
    padding: 10px 0;
  }

  .account-menu-icon {
    width: 36px;
    height: 36px;
  }

  .account-menu-copy strong {
    font-size: 14px;
  }

  .account-menu-copy small {
    font-size: 11px;
  }

  .account-menu-row.is-disabled {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .account-menu-badge {
    grid-column: 2;
    justify-self: start;
  }

  #screen-wallet #wallet-card {
    padding: 14px;
    border-radius: 10px;
  }

  #screen-wallet #wallet-card .card-header {
    margin-bottom: 10px;
  }

  #screen-wallet #wallet-card .stat-grid {
    margin-bottom: 14px;
  }

  #screen-wallet #wallet-card .stat-card {
    padding: 13px;
  }

  .wallet-budget-controls,
  .wallet-budget-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .wallet-budget-actions button {
    min-height: 46px;
  }
}

/* Wallet top-up flow */
.mock-payment-dialog {
  border: 1px solid #314363;
  border-radius: 18px;
  background: #101a2d;
  color: #f3f6fc;
  box-shadow: 0 22px 64px rgba(0, 0, 0, .5);
}

.mock-payment-dialog-header {
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(181, 199, 226, .14);
}

.mock-payment-dialog-header h3 { color: #f3f6fc; }
.mock-payment-close-action {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  min-height: 48px;
  margin: 12px 0 0;
  border: 1px solid #3d5678;
  border-radius: 9px;
  background: #182943;
  color: #e0ebfb;
}
.mock-payment-close-action:hover { background: #263957; color: #fff; }
.mock-payment-steps { margin: 14px 0; }
.mock-payment-balance-context,
.mock-payment-method-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #2d3b53;
  border-radius: 10px;
  background: #141e30;
  text-align: left;
}
.mock-payment-balance-context { justify-content: space-between; margin-bottom: 10px; }
.mock-payment-balance-context span { color: #a6b4c9; font-size: 12px; }
.mock-payment-balance-context strong { color: #f3f6fc; font-family: var(--font-mono); font-size: 17px; }
.mock-payment-method-card { margin-bottom: 10px; }
.mock-payment-method-icon {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #123e61;
  color: #7dd3fc;
  font-size: 20px;
  font-weight: 700;
}
.mock-payment-method-copy { display: grid; flex: 1; min-width: 0; gap: 3px; }
.mock-payment-method-copy strong { color: #f3f6fc; font-size: 14px; }
.mock-payment-method-copy small { color: #9cabc1; font-size: 11px; }
.mock-payment-method-mark { color: #87b9f4; font-size: 10px; font-weight: 700; }
.mock-payment-mode-banner {
  margin: 0 0 14px;
  padding: 9px 11px;
  border: 1px solid rgba(56, 189, 248, .28);
  border-radius: 8px;
  background: rgba(14, 116, 144, .12);
  color: #b7e6f9;
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}
.mock-payment-mode-banner.is-test,
.mock-payment-mode-banner.is-mock {
  border-color: rgba(245, 158, 11, .35);
  background: rgba(120, 73, 12, .16);
  color: #f5ce80;
}
.mock-payment-note#mock-payment-mode-note { margin: 0 0 16px; text-align: left; }
.mock-payment-label { margin-bottom: 8px; color: #d7e1ef; font-weight: 600; }
.mock-payment-amount-row { min-height: 62px; border-color: #3a4e6e; background: #0c1422; }
.mock-payment-amount-row span { font-size: 22px; color: #afc0d7; }
.mock-payment-amount-row input { font-size: 26px; font-weight: 700; }
.mock-payment-amount-hint { margin: 6px 0 0; color: #91a1b8; font-size: 11px; text-align: left; }
.mock-payment-quick-amounts { gap: 8px; margin: 12px 0 18px; }
.mock-payment-quick-amounts button {
  min-height: 42px;
  border: 1px solid #33445e;
  border-radius: 8px;
  background: #182438;
  color: #cfdaea;
  font-size: 13px;
  font-weight: 600;
}
.mock-payment-quick-amounts button[aria-pressed="true"] {
  border-color: #149ed4;
  background: #0c789f;
  color: #fff;
}
.mock-payment-primary { min-height: 50px; border-radius: 9px; font-weight: 700; }
.mock-payment-scan-mode .mock-payment-dialog-header { justify-content: space-between; }
.mock-payment-scan-mode .mock-payment-dialog-header > div { display: block; }
.mock-payment-scan-mode .mock-payment-steps { display: grid; }
.mock-payment-scan-mode.omise-mode .mock-payment-dialog-header { justify-content: space-between; }

@media (max-width: 760px) {
  .mock-payment-dialog[open] {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: max(16px, env(safe-area-inset-top)) 18px max(16px, env(safe-area-inset-bottom));
    overflow: auto;
    border: 0;
    border-radius: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .mock-payment-dialog[open]::backdrop { background: #0b111b; backdrop-filter: none; }
  .mock-payment-dialog-header { position: sticky; top: 0; z-index: 3; flex: 0 0 auto; padding: 4px 0 14px; background: #101a2d; }
  .mock-payment-dialog-header h3 { font-size: 19px; }
  .mock-payment-close-action {
    position: sticky;
    bottom: 0;
    z-index: 4;
  }
  .mock-payment-steps { display: grid; flex: 0 0 auto; }
  .mock-payment-step { flex: 1 0 auto; width: 100%; }
  .mock-payment-failure-mode #mock-payment-step-failure { flex: 1 0 auto; padding: 14px 0 8px; }
  .mock-payment-dialog:not(.mock-payment-scan-mode):not(.mock-payment-success-mode):not(.mock-payment-failure-mode) #mock-payment-step-amount {
    display: flex !important;
    flex-direction: column;
    padding: 14px 0 8px;
    text-align: left;
  }
  .mock-payment-mode-banner { font-size: 12px; }
  .mock-payment-quick-amounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mock-payment-quick-amounts button { min-height: 48px; }
  .mock-payment-primary { min-height: 54px; }
  #mock-payment-step-amount .mock-payment-primary { position: static; margin-top: 16px; }
  .mock-payment-scan-mode #mock-payment-step-scan,
  .mock-payment-scan-mode.omise-mode #mock-payment-step-scan {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    flex: 1 0 auto;
    padding: 8px 0 18px;
    border: 0;
    background: transparent;
    color: #f3f6fc;
  }
  .mock-payment-scan-mode .mock-payment-dialog-header { padding-top: 4px; }
  .mock-payment-scan-mode .mock-payment-dialog-header h3 { font-size: 19px; }
  .mock-payment-scan-mode .mock-payment-amount-display { font-size: 28px; }
  .mock-payment-scan-mode .omise-payment-qr { width: min(68vw, 280px); max-height: 38dvh; margin: 12px auto 0; padding: 6px; border-radius: 12px; }
  .mock-payment-scan-mode .mock-payment-qr-expiry { margin-top: 9px; }
  .mock-payment-scan-mode .mock-payment-download { min-height: 48px; margin-top: 10px; border-color: #3d5678; border-radius: 9px; background: #182943; color: #e0ebfb; }
  .mock-payment-scan-mode .mock-payment-qr-caption { margin: 10px 0 0; padding: 9px 10px; border-radius: 8px; font-size: 11px; line-height: 1.45; }
  .mock-payment-scan-mode .mock-payment-waiting { margin-top: 10px; }
  .mock-payment-scan-mode.omise-mode .mock-payment-cancel-note { margin-top: 10px; }
}

@media (max-width: 760px) {
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode[open] {
    overflow: hidden;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-dialog-header,
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-steps,
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-close-action {
    flex: 0 0 auto;
  }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-steps {
    margin: 8px 0;
  }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode #mock-payment-step-scan {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 0 8px;
    overscroll-behavior: contain;
  }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .omise-payment-qr {
    width: min(58vw, 220px);
    max-height: 30dvh;
    margin-top: 8px;
  }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-qr-caption,
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode #mock-payment-step-scan .mock-payment-cancel-note {
    margin-top: 6px;
    padding: 6px 8px;
    font-size: 10px;
  }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode #mock-payment-scan-error {
    order: 8;
    margin: 6px 0 0;
  }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-close-action {
    margin-top: 8px;
  }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-qr-retry {
    order: 9;
    width: 100%;
    min-height: 42px;
    margin-top: 8px;
    border: 1px solid rgba(159, 202, 255, .35);
    border-radius: 9px;
    background: rgba(159, 202, 255, .08);
    color: #dbeafe;
  }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-waiting { order: 10; }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode .mock-payment-qr-credit { order: 11; }
  .mock-payment-dialog.mock-payment-scan-mode.omise-mode #mock-payment-step-scan .mock-payment-cancel-note { order: 12; }
}

.qr-flow-entry {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.qr-flow-entry p {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.connector-pricing-help { margin: -4px 0 12px; }
.connector-pricing-default {
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-size: 13px;
}
.connector-prices-list { display: grid; gap: 9px; }
.connector-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.connector-price-name { display: grid; gap: 3px; }
.connector-price-name small { color: var(--text-secondary); font-size: 12px; }
.connector-price-input-wrap { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); white-space: nowrap; }
.connector-price-input { width: 118px; min-height: 40px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-primary); font: inherit; }
.connector-pricing-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.connector-pricing-actions .form-msg,
.connector-pricing-actions .form-error { flex: 1; }

@media (max-width: 520px) {
  .connector-price-row { align-items: flex-start; flex-direction: column; }
  .connector-price-input-wrap { width: 100%; }
  .connector-price-input { flex: 1; width: 100%; }
  .connector-pricing-actions { align-items: stretch; flex-direction: column; }
}

.detail-cp-id {
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
}

.admin-detail-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 18px;
}
.admin-detail-layout > .card { min-width: 0; margin-bottom: 0; }
.admin-detail-overview-card,
.admin-detail-settings-card,
.admin-detail-layout > .admin-detail-controls-card,
.admin-detail-layout > .admin-detail-activity-card { grid-column: auto; }
.admin-detail-layout > .connector-pricing-card,
.admin-detail-layout > .admin-detail-advanced { grid-column: 1 / -1; }
.admin-detail-section { min-width: 0; }
.admin-detail-section .card-header h4 { margin: 0; }
.admin-detail-card-description {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}
.admin-detail-device-meta { min-width: 0; }
.admin-detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.admin-detail-meta-item {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.admin-detail-meta-label { color: var(--text-secondary); font-size: 12px; }
.admin-detail-meta-item strong { color: var(--text-primary); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.admin-detail-meta-item small { color: var(--text-secondary); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.admin-detail-meta-location { grid-column: 1 / -1; }
.admin-detail-map-link { justify-self: start; font-size: 12px; }
.admin-detail-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.admin-detail-field { display: grid; gap: 6px; min-width: 0; }
.admin-detail-field > span,
.admin-detail-target > span {
  color: var(--text-secondary);
  font-size: 13px;
}
.admin-detail-field input,
.admin-detail-field select,
.admin-detail-field textarea,
.admin-detail-target input,
.admin-detail-target select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
}
.admin-detail-field textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.admin-detail-help { margin: 11px 0 0; line-height: 1.5; }
.admin-detail-save-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.admin-detail-save-row .form-msg,
.admin-detail-save-row .form-error { margin: 0; }
.connector-price-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(220px, 260px) auto;
  align-items: center;
  gap: 12px;
}
.connector-price-name { min-width: 0; }
.connector-price-name > strong { font-size: 14px; }
.connector-price-name small { line-height: 1.4; }
.connector-price-status { display: inline-flex; width: fit-content; color: var(--text-secondary); font-size: 11px; }
.connector-price-status.error { color: var(--danger); }
.connector-price-input-wrap { width: 100%; min-width: 0; }
.connector-price-input { flex: 1; width: 0; min-width: 0; }
.connector-price-qr {
  justify-self: end;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.connector-price-qr:hover { background: var(--surface); }
.connector-qr-dialog {
  width: min(92vw, 460px);
  min-width: 0;
  padding: 0;
  border-radius: 16px;
}
.connector-qr-dialog-content { padding: 22px; }
.connector-qr-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.connector-qr-dialog-header p {
  margin: 0 0 4px;
  color: var(--text-secondary);
  font-size: 12px;
}
.connector-qr-dialog-header h3 { margin: 0; font-size: 18px; }
.connector-qr-preview {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.connector-qr-preview img {
  display: block;
  width: min(100%, 320px);
  max-height: min(66vh, 360px);
  object-fit: contain;
  image-rendering: pixelated;
}
.connector-qr-preview img[hidden] { display: none; }
.connector-qr-preview .muted-note { margin: 0; color: #475569; text-align: center; }
.admin-detail-controls-heading { align-items: flex-end; }
.admin-detail-controls-heading p { margin: 5px 0 0; color: var(--text-secondary); font-size: 13px; line-height: 1.45; }
.admin-detail-target { display: grid; gap: 6px; width: min(250px, 42%); }
.admin-detail-action-group { padding: 12px 0; border-top: 1px solid var(--border); }
.admin-detail-action-group:first-of-type { border-top: 0; padding-top: 0; }
.admin-detail-action-label { display: block; color: var(--text-secondary); font-size: 13px; margin-bottom: 9px; }
.admin-detail-action-group .muted-note { margin: 9px 0 0; line-height: 1.45; }
.admin-detail-controls-card .device-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-detail-controls-card .device-card-actions button { flex: 0 1 auto; min-height: 42px; margin: 0; }
.admin-detail-advanced { padding: 0; }
.admin-detail-advanced > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  cursor: pointer;
}
.admin-detail-advanced > summary span { color: var(--text-secondary); font-size: 12px; line-height: 1.45; }
.admin-detail-advanced-body { padding: 0 20px 18px; }
.admin-detail-auto-unlock,
.admin-detail-config-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.admin-detail-auto-unlock h4,
.admin-detail-config-heading h4 { margin: 0; font-size: 14px; }
.admin-detail-auto-unlock p { margin: 6px 0 0; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.admin-detail-config-heading { margin-top: 8px; }
.admin-charge-point-activity { display: grid; }
.admin-charge-point-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}
.admin-charge-point-event strong { font-size: 13px; font-weight: 600; }
.admin-charge-point-event span { color: var(--text-secondary); font-size: 13px; line-height: 1.45; }
.admin-charge-point-event time { color: var(--text-secondary); font-size: 11px; white-space: nowrap; }
.admin-charge-point-event small { grid-column: 1 / -1; color: var(--text-secondary); font-size: 11px; }

@media (max-width: 760px) {
  .admin-detail-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .admin-detail-overview-card,
  .admin-detail-settings-card,
  .admin-detail-layout > .connector-pricing-card,
  .admin-detail-layout > .admin-detail-controls-card,
  .admin-detail-layout > .admin-detail-advanced,
  .admin-detail-layout > .admin-detail-activity-card { grid-column: 1; }
  .connector-price-row { grid-template-columns: minmax(0, 1fr) auto; }
  .connector-price-name { grid-column: 1 / -1; }
  .connector-price-input-wrap { grid-column: 1; grid-row: 2; }
  .connector-price-qr { grid-column: 2; grid-row: 2; align-self: center; }
  .admin-detail-controls-heading { align-items: stretch; flex-direction: column; }
  .admin-detail-target { width: 100%; }
  .admin-detail-advanced > summary { align-items: flex-start; flex-direction: column; padding: 15px; }
  .admin-detail-advanced-body { padding: 0 15px 15px; }
  .admin-detail-auto-unlock,
  .admin-detail-config-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 420px) {
  .admin-detail-meta-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-detail-meta-location { grid-column: 1; }
  .connector-price-row { grid-template-columns: minmax(0, 1fr); }
  .connector-price-name,
  .connector-price-input-wrap,
  .connector-price-qr { grid-column: 1; grid-row: auto; justify-self: start; }
  .connector-price-input-wrap { max-width: none; }
  .admin-detail-save-row { flex-direction: column; }
  .admin-detail-controls-card .device-card-actions button { flex: 1 1 100%; }
  .admin-charge-point-event { grid-template-columns: minmax(0, 1fr); }
  .admin-charge-point-event time { white-space: normal; }
}

/* หน้ารายละเอียดสำหรับ Admin/Staff ใช้พื้นที่เต็มขึ้น โดยไม่เปลี่ยน layout ลูกค้า */
body.charger-management-view main.app-content {
  width: 100%;
  max-width: 1360px;
  padding: 24px 28px calc(100px + env(safe-area-inset-bottom, 0px));
}

body.charger-management-view #screen-detail .charger-detail-header {
  gap: 16px;
  align-items: center;
  padding: 22px 24px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(120deg, rgba(14, 165, 233, 0.12), rgba(26, 33, 43, 0.98) 48%);
}

body.charger-management-view .charger-detail-header .back-btn {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface);
}

body.charger-management-view .charger-detail-header h2 {
  margin: 0 0 3px !important;
  font-size: clamp(21px, 2vw, 27px);
  line-height: 1.25;
}

body.charger-management-view .charger-detail-header .detail-cp-id {
  margin: 0 0 8px;
  font-size: 13px;
}

body.charger-management-view #detail-status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body.charger-management-view #detail-status-badges .badge {
  padding: 4px 10px;
  font-size: 12px;
}

.detail-management-caption {
  margin: 9px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

body.charger-management-view #live-charging-section {
  padding: 22px;
  margin-bottom: 18px;
}

body.charger-management-view .admin-detail-layout { gap: 18px; }
body.charger-management-view .admin-detail-layout > .card { padding: 22px; border-radius: 14px; }
body.charger-management-view .admin-detail-layout > .admin-detail-advanced { padding: 0; }
body.charger-management-view .admin-detail-layout > .admin-detail-activity-card { align-self: stretch; }

body.charger-management-view .admin-detail-meta-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

body.charger-management-view .admin-detail-meta-item {
  min-height: 88px;
  padding: 12px 13px;
  border-radius: 11px;
}

body.charger-management-view .admin-detail-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body.charger-management-view .admin-detail-note-field { grid-column: 1 / -1; }
body.charger-management-view .admin-detail-save-row { align-items: center; }
body.charger-management-view .connector-price-row { grid-template-columns: minmax(220px, 1fr) minmax(240px, 300px) auto; }

body.charger-management-view .admin-detail-controls-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 12px;
}

body.charger-management-view .admin-detail-controls-card > .card-header,
body.charger-management-view .admin-detail-controls-card > #availability-status {
  grid-column: 1 / -1;
}

body.charger-management-view .admin-detail-controls-card .admin-detail-action-group {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

body.charger-management-view .admin-detail-controls-card .admin-detail-action-group:nth-of-type(4) {
  grid-column: 1;
}

body.charger-management-view .admin-detail-controls-card .device-card-actions button {
  min-height: 42px;
  padding: 9px 14px;
}

body.charger-management-view .admin-detail-controls-card .admin-detail-action-group .muted-note {
  font-size: 12px;
}

body.charger-management-view .admin-detail-session-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

body.charger-management-view .admin-detail-session-heading .admin-detail-action-label { margin: 0; }

body.charger-management-view .admin-detail-session-state {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

body.charger-management-view .admin-detail-session-state.is-ready,
body.charger-management-view .admin-detail-session-state.is-active {
  background: rgba(34, 197, 94, 0.14);
  color: var(--success);
}

body.charger-management-view .admin-detail-session-state.is-waiting {
  background: rgba(245, 158, 11, 0.14);
  color: var(--warning);
}

body.charger-management-view .admin-detail-session-state.is-offline {
  background: rgba(100, 116, 139, 0.18);
  color: var(--text-secondary);
}

body.charger-management-view .admin-detail-session-idle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
}

body.charger-management-view .admin-detail-session-idle p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

body.charger-management-view .admin-detail-session-active {
  gap: 11px;
}

body.charger-management-view .admin-detail-session-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

body.charger-management-view .admin-detail-session-metric {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

body.charger-management-view .admin-detail-session-metric span {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

body.charger-management-view .admin-detail-session-metric strong {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.35;
}

body.charger-management-view #admin-detail-session-waiting { margin: 0; }
body.charger-management-view #admin-detail-stop-btn { justify-self: start; }

body.charger-management-view .admin-charge-point-event { padding: 12px 0; }
body.charger-management-view .admin-detail-advanced > summary { padding: 19px 22px; }
body.charger-management-view .admin-detail-advanced-body { padding: 0 22px 20px; }
body.staff-charger-detail .admin-only-detail { display: none !important; }
body.staff-charger-detail .admin-detail-overview-card { grid-column: 1 / -1; }

@media (max-width: 980px) {
  body.charger-management-view main.app-content { padding-right: 20px; padding-left: 20px; }
  body.charger-management-view .admin-detail-overview-card,
  body.charger-management-view .admin-detail-settings-card,
  body.charger-management-view .admin-detail-layout > .admin-detail-controls-card,
  body.charger-management-view .admin-detail-layout > .admin-detail-activity-card { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body.charger-management-view main.app-content {
    padding: 14px 14px calc(88px + env(safe-area-inset-bottom, 0px));
  }
  body.charger-management-view .admin-detail-layout { gap: 14px; }
  body.charger-management-view #screen-detail .charger-detail-header { padding: 16px; }
  body.charger-management-view .admin-detail-layout > .card { padding: 16px; }
  body.charger-management-view .admin-detail-layout > .admin-detail-advanced { padding: 0; }
  body.charger-management-view .admin-detail-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.charger-management-view .admin-detail-fields { grid-template-columns: minmax(0, 1fr); }
  body.charger-management-view .admin-detail-note-field { grid-column: 1; }
  body.charger-management-view .connector-price-row { grid-template-columns: minmax(0, 1fr) auto; }
}

@media (max-width: 520px) {
  body.charger-management-view main.app-content {
    padding: 12px 12px calc(82px + env(safe-area-inset-bottom, 0px));
  }
  body.charger-management-view #screen-detail .charger-detail-header { gap: 10px; padding: 14px; }
  body.charger-management-view .admin-detail-meta-grid { grid-template-columns: minmax(0, 1fr); }
  body.charger-management-view .admin-detail-meta-location { grid-column: 1; }
  body.charger-management-view .admin-detail-controls-card { grid-template-columns: minmax(0, 1fr); }
  body.charger-management-view .admin-detail-controls-card > .card-header,
  body.charger-management-view .admin-detail-controls-card > #availability-status,
  body.charger-management-view .admin-detail-controls-card .admin-detail-action-group:nth-of-type(4) { grid-column: 1; }
  body.charger-management-view .admin-detail-session-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.charger-management-view .admin-detail-session-idle { align-items: stretch; flex-direction: column; }
}

/* Activity, event timeline and settings workspace. */
body.workspace-view main.app-content {
  width: 100%;
  max-width: 1320px;
  padding: 26px 32px calc(112px + env(safe-area-inset-bottom, 0px));
}

.workspace-screen { margin-bottom: 0; }

.workspace-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  padding: 27px 30px;
  border: 1px solid #254054;
  border-radius: 18px;
  background: linear-gradient(115deg, #1a2d3b 0%, #19212d 57%, #181f2a 100%);
}

.workspace-hero::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -150px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(91, 190, 236, .12);
  border-radius: 50%;
  box-shadow: 0 0 0 65px rgba(91, 190, 236, .025), 0 0 0 130px rgba(91, 190, 236, .018);
  pointer-events: none;
}

.workspace-eyebrow {
  display: block;
  margin-bottom: 9px;
  color: #70cdf4;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .11em;
}

.workspace-hero h2 {
  position: relative;
  margin: 0 0 6px;
  font-size: clamp(24px, 2.7vw, 32px);
  line-height: 1.25;
}

.workspace-hero p {
  position: relative;
  max-width: 720px;
  margin: 0;
  color: #b3c3d1;
  font-size: 13px;
  line-height: 1.65;
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(220px, 258px) minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

.workspace-filter-panel {
  position: sticky;
  top: 90px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}
.workspace-filter-summary { display: none; }

.workspace-panel-heading,
.workspace-list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.workspace-panel-heading { margin-bottom: 20px; }
.workspace-panel-heading h3,
.workspace-list-heading h3 { margin: 0; font-size: 16px; }
.workspace-panel-heading > span,
.workspace-list-heading > span { color: var(--text-secondary); font-size: 12px; white-space: nowrap; }
.workspace-list-heading { margin: 0 0 12px; }

.workspace-filter-label {
  display: block;
  margin: 0 0 8px;
  color: #b4c0cc;
  font-size: 12px;
  font-weight: 600;
}

.workspace-search {
  width: 100%;
  min-height: 44px;
  margin-bottom: 22px;
  padding: 10px 12px;
  border: 1px solid #344353;
  border-radius: 10px;
  outline: none;
  background: #111923;
  color: var(--text-primary);
  font-size: 13px;
}
.workspace-search::placeholder { color: #738397; }
.workspace-search:focus-visible { border-color: var(--primary); outline: 2px solid rgba(14, 165, 233, .22); }

.workspace-filter-field + .workspace-filter-field {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.workspace-filter-panel .chip-group {
  flex-wrap: wrap;
  overflow: visible;
  gap: 7px;
  margin: 0;
  padding: 0;
}
.workspace-filter-panel .chip {
  padding: 7px 11px;
  font-size: 12px;
}
.workspace-filter-panel .chip:not(.active):hover { border-color: #64839b; color: #fff; }

.workspace-results { min-width: 0; }
.workspace-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.workspace-metrics > div {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.workspace-metrics span,
.session-card-metrics span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-secondary);
  font-size: 11px;
}
.workspace-metrics strong { font-family: var(--font-mono); font-size: 21px; }
.workspace-metrics small { color: var(--text-secondary); font-family: var(--font-sans); font-size: 11px; font-weight: 500; }

#screen-transactions .customer-history {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
#screen-transactions .history-wallet {
  min-height: 100px;
  margin: 0;
  padding: 17px 19px;
  border-color: rgba(14, 165, 233, .38);
  border-radius: 12px;
  background: linear-gradient(125deg, #123247, #1a2532);
}
#screen-transactions .history-wallet strong { font-size: 26px; }
#screen-transactions .history-summary { gap: 10px; margin: 0; }
#screen-transactions .history-summary > div { padding: 17px; border-radius: 12px; background: var(--surface); }
#screen-transactions .history-summary strong { font-size: 20px; }

.session-list { display: grid; gap: 11px; }
.session-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.session-card-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.session-card-id { color: #82ccec; font-family: var(--font-mono); font-size: 11px; }
.session-card-heading h4 { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 16px; }
.session-card-heading .badge { flex: 0 0 auto; }
.session-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 17px 0;
}
.session-card-metrics > div { min-width: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.session-card-metrics strong { font-family: var(--font-mono); font-size: 17px; overflow-wrap: anywhere; }
.session-card-metrics small { color: var(--text-secondary); font-family: var(--font-sans); font-size: 11px; font-weight: 500; }
.session-card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: #c6d0d9;
  font-size: 12px;
}
.session-card-details > span { overflow-wrap: anywhere; }
.session-card-details b { margin-right: 6px; color: var(--text-secondary); font-weight: 500; }
.session-card-management { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.session-card-management summary { width: fit-content; color: var(--primary); font-size: 12px; cursor: pointer; }
.session-card .device-card-actions { justify-content: flex-start; margin-top: 12px; }
.session-card .device-card-actions button { min-height: 38px; }

#screen-transactions .customer-transaction-list { gap: 10px; }
#screen-transactions .customer-transaction-row {
  min-height: 76px;
  gap: 14px;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
#screen-transactions .history-type-icon { width: 42px; height: 42px; flex-basis: 42px; border-radius: 12px; }
#screen-transactions .customer-transaction-title { font-size: 14px; }
#screen-transactions .customer-transaction-meta { font-size: 12px; }
#screen-transactions .customer-transaction-amount { font-size: 15px; }

.workspace-context-note {
  margin-bottom: 23px;
  padding: 13px 16px;
  border: 1px solid rgba(14, 165, 233, .3);
  border-radius: 11px;
  background: rgba(14, 165, 233, .07);
  color: #b6c7d3;
  font-size: 12px;
  line-height: 1.55;
}
.workspace-context-note a { margin-left: 4px; font-weight: 600; }
.event-list { display: grid; gap: 9px; }
.event-list .event-log-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  min-width: 0;
  margin: 0;
  padding: 17px 18px;
  border-radius: 13px;
}
.event-log-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(14, 165, 233, .13);
  color: #65cdf8;
  font-size: 18px;
}
.event-log-item.charging .event-log-icon { background: rgba(34, 197, 94, .12); color: #69e28e; }
.event-log-item.payment .event-log-icon { background: rgba(14, 165, 233, .13); color: #65cdf8; }
.event-log-item.system .event-log-icon { background: rgba(245, 158, 11, .12); color: #fbc46c; }
.event-log-content { min-width: 0; }
.event-list .event-log-heading { justify-content: flex-start; flex-wrap: wrap; gap: 7px 10px; font-size: 14px; }
.event-list .event-log-category { border: 1px solid var(--border); }
.event-list .event-log-summary { margin: 6px 0; color: #d3dde5; font-size: 13px; }
.event-list .event-log-meta { margin-top: 5px; font-size: 11px; }
.event-list .payload-details { margin-top: 10px; }
.event-list .payload-details summary { font-size: 11px; }
.event-log-time { padding-top: 2px; color: var(--text-secondary); font-size: 11px; white-space: nowrap; }

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 20px;
}
.settings-column { display: grid; align-content: start; gap: 20px; min-width: 0; }
#screen-settings .settings-column > .card { margin: 0; padding: 24px; border-radius: 15px; }
#screen-settings .account-profile-label { color: #8dcfee; font-size: 11px; letter-spacing: .04em; }
#screen-settings .account-settings-card .sidebar-user { padding: 8px 0 20px !important; }
#screen-settings .account-settings-card .sidebar-user .avatar { width: 60px; height: 60px; border-radius: 15px; }
#screen-settings .account-settings-card .sidebar-user .username { font-size: 20px; }
#screen-settings .account-menu { margin-top: 5px; }
#screen-settings .account-menu-row { padding-left: 8px; padding-right: 8px; }
#screen-settings .account-settings-card #logout-btn { margin-top: 20px; }
.settings-card-heading { margin-bottom: 18px; }
.settings-card-heading > span { color: #70cdf4; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.settings-card-heading h3 { margin: 5px 0 3px; font-size: 18px; }
.settings-card-heading p { margin: 0; color: var(--text-secondary); font-size: 12px; }
.settings-link-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.settings-tool-link {
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr);
  align-items: center;
  gap: 2px 10px;
  min-width: 0;
  min-height: 69px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text-primary);
  text-decoration: none;
}
.settings-tool-link:hover { border-color: #45718d; background: #1b2b39; }
.settings-tool-link > span { display: grid; grid-row: span 2; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: rgba(14, 165, 233, .12); color: #72d1fa; font-size: 17px; }
.settings-tool-link strong { align-self: end; overflow-wrap: anywhere; font-size: 12px; }
.settings-tool-link small { align-self: start; color: var(--text-secondary); font-size: 10px; }
.settings-help-link { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-top: 1px solid var(--border); color: var(--text-primary); font-size: 13px; text-decoration: none; }
.settings-help-link:hover { color: #70cdf4; }
.settings-help-link span { color: var(--primary); }
#screen-settings .staff-payment-settings .form-grid.compact-grid { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
#screen-settings .staff-payment-settings .form-grid.compact-grid label { grid-column: 1; }
#screen-settings .staff-payment-settings .form-grid.compact-grid .muted-note,
#screen-settings .staff-payment-settings .form-grid.compact-grid .form-msg { grid-column: 1 / -1; }
#screen-settings .staff-payment-settings .form-grid.compact-grid button[type="submit"] { grid-column: 2; grid-row: 1; min-height: 43px; }

@media (min-width: 800px) {
  body.workspace-view .bottom-nav {
    right: auto;
    bottom: 16px;
    left: 50%;
    width: min(570px, calc(100vw - 48px));
    padding-bottom: 0;
    transform: translateX(-50%);
    border: 1px solid #3a4c5a;
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .4);
    overflow: hidden;
  }
}

@media (max-width: 980px) {
  body.workspace-view main.app-content { padding-right: 20px; padding-left: 20px; }
  .workspace-layout { grid-template-columns: minmax(190px, 225px) minmax(0, 1fr); gap: 15px; }
  .settings-layout { gap: 15px; }
  .settings-link-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  body.workspace-view main.app-content { padding: 14px 14px calc(88px + env(safe-area-inset-bottom, 0px)); }
  .workspace-hero { margin-bottom: 14px; padding: 21px; }
  .workspace-layout, .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .workspace-filter-panel { position: static; padding: 17px; }
  .workspace-filter-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
  }
  .workspace-filter-summary::-webkit-details-marker { display: none; }
  .workspace-filter-summary > span { color: var(--primary); font-size: 20px; line-height: 1; transition: transform 150ms ease; }
  .workspace-filter-panel[open] .workspace-filter-summary { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
  .workspace-filter-panel[open] .workspace-filter-summary > span { transform: rotate(180deg); }
  .workspace-filter-panel .workspace-panel-heading { display: none; }
  .workspace-search { margin-bottom: 15px; }
  .workspace-filter-field + .workspace-filter-field { margin-top: 12px; padding-top: 12px; }
  .settings-link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  body.workspace-view main.app-content { padding: 12px 12px calc(82px + env(safe-area-inset-bottom, 0px)); }
  .workspace-hero { padding: 18px; }
  .workspace-hero h2 { font-size: 23px; }
  .workspace-hero p { font-size: 12px; }
  .workspace-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-metrics > div:last-child { grid-column: 1 / -1; }
  #screen-transactions .customer-history { grid-template-columns: minmax(0, 1fr); }
  .session-card { padding: 15px; }
  .session-card-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .session-card-metrics > div:last-child { grid-column: 1 / -1; }
  .event-list .event-log-item { grid-template-columns: 36px minmax(0, 1fr); gap: 9px 11px; padding: 14px; }
  .event-log-icon { width: 36px; height: 36px; }
  .event-log-time { grid-column: 2; grid-row: 2; padding: 0; }
  .event-list .event-log-heading { font-size: 13px; }
  .event-list .event-log-summary { font-size: 12px; }
  #screen-settings .settings-column > .card { padding: 18px; }
  .settings-link-grid { grid-template-columns: minmax(0, 1fr); }
  #screen-settings .staff-payment-settings .form-grid.compact-grid { grid-template-columns: minmax(0, 1fr); }
  #screen-settings .staff-payment-settings .form-grid.compact-grid button[type="submit"] { grid-column: 1; grid-row: auto; }
}

/* Home dashboard shares the workspace width and visual language. */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 175px;
  align-items: center;
  gap: 24px;
}
.home-hero-summary {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 16px 18px;
  border: 1px solid rgba(112, 205, 244, .24);
  border-radius: 13px;
  background: rgba(9, 23, 34, .36);
}
.home-hero-summary > span { color: #aac2d2; font-size: 11px; }
.home-hero-summary strong { font-family: var(--font-mono); font-size: 31px; line-height: 1.15; }
.home-hero-summary small { color: #8bd5a5; font-size: 11px; }

.home-customer-tools {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 25px;
}
#screen-home .home-customer-tools > .card { margin: 0; min-width: 0; }
#screen-home .wallet-home-summary { min-height: 155px; }
#screen-home .qr-flow-entry {
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 13px;
  padding: 20px;
  border-color: rgba(14, 165, 233, .32);
  background: linear-gradient(125deg, #192a37, #1a212b);
}
#screen-home .qr-flow-entry strong { font-size: 16px; }
#screen-home .qr-flow-entry p { margin-top: 6px; line-height: 1.55; }
#screen-home .qr-flow-entry > a { align-self: flex-start; margin: 0; }

#screen-home .home-section-heading {
  align-items: end;
  margin: 0 0 12px;
}
#screen-home .home-section-heading h3 { font-size: 17px; }
#screen-home .home-section-heading span { font-size: 12px; }
#screen-home .overview-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
  margin-bottom: 30px;
  padding: 0;
}
#screen-home .overview-chip {
  display: grid;
  align-content: space-between;
  gap: 5px;
  min-width: 0;
  min-height: 112px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  font-size: 12px;
}
.overview-chip-label { display: flex; align-items: center; gap: 7px; min-width: 0; color: #c4cfda; }
#screen-home .overview-chip strong { font-size: 28px; line-height: 1; }
#screen-home .overview-chip small { color: var(--text-secondary); font-size: 11px; }
#screen-home .overview-chip:nth-child(1) strong { color: #6be29a; }
#screen-home .overview-chip:nth-child(2) strong { color: #74d4fa; }
#screen-home .overview-chip:nth-child(3) strong { color: #f5c669; }
#screen-home .overview-chip:nth-child(4) strong { color: #fb8585; }
#screen-home .overview-chip:nth-child(5) strong { color: #a9b6c5; }
#screen-home .home-device-heading { margin-bottom: 14px; }
#screen-home .home-device-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
}
#screen-home .device-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 20px;
  border-radius: 15px;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}
#screen-home .device-card:hover { border-color: #4a768e; transform: translateY(-2px); }
#screen-home .device-card-header { margin-bottom: 16px; }
#screen-home .device-card-header .device-id { font-size: 17px; }
#screen-home .device-card-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 18px;
  margin-bottom: 14px;
  line-height: 1.5;
}
#screen-home .device-card-meta > div { min-width: 0; overflow-wrap: anywhere; }
#screen-home .device-card-meta b { display: block; margin-top: 3px; }
#screen-home .device-location { margin-bottom: 13px; padding: 13px; border-radius: 10px; }
#screen-home .device-live-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#screen-home .device-card-actions { margin-bottom: 12px; }
#screen-home .home-card-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  margin: auto 0 0;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: #73d0f7;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
#screen-home .home-card-open:hover { color: #b1e9ff; }

@media (max-width: 980px) {
  #screen-home .overview-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #screen-home .overview-chip { min-height: 100px; }
}

@media (max-width: 760px) {
  .home-hero { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .home-hero-summary { grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
  .home-hero-summary strong { font-size: 23px; }
  .home-customer-tools { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 22px; }
  #screen-home .overview-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 25px; }
  #screen-home .overview-chip { min-height: 94px; }
  #screen-home .overview-chip:last-child { grid-column: 1 / -1; }
  #screen-home .home-device-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .home-hero-summary { padding: 12px; }
  .home-hero-summary small { text-align: right; }
  #screen-home .home-section-heading h3 { font-size: 15px; }
  #screen-home .overview-chip { padding: 12px; }
  #screen-home .overview-chip strong { font-size: 25px; }
  #screen-home .device-card { padding: 16px; }
  #screen-home .device-card-header .device-id { font-size: 15px; }
  #screen-home .device-card-meta { grid-template-columns: minmax(0, 1fr); }
  #screen-home .device-live-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Customer home: C layout follows the device color preference automatically. */
body.customer-app,
html.charging-flow-page {
  color-scheme: dark;
  --bg: #10151c;
  --surface: #1a212b;
  --surface-hover: #232b37;
  --surface-2: #141a22;
  --text-primary: #e8ecf1;
  --text-secondary: #9aa8b5;
  --border: #2a323e;
  --brand: #0e9ca4;
  --primary: #0e9ca4;
  --danger: #ef4850;
  --sidebar-bg: #0d1117;
  --sidebar-bg-hover: #202a35;
  --sidebar-text: #c7ccd6;
  --sidebar-muted: #7d8494;
  --sidebar-border: #2a323e;
  --sidebar-active-bg: #202a35;
  --sidebar-active-text: #ffffff;
  --active-bg: rgba(14, 156, 164, .15);
  --active-text: #61d5dc;
}

@media (prefers-color-scheme: light) {
  body.customer-app,
  html.charging-flow-page {
    color-scheme: light;
    --bg: #f3f7f7;
    --surface: #ffffff;
    --surface-hover: #edf4f4;
    --surface-2: #f4f8f7;
    --text-primary: #153640;
    --text-secondary: #61777e;
    --border: #d8e5e3;
    --brand: #087a80;
    --primary: #087a80;
    --danger: #d74751;
    --sidebar-bg: #fbfdfd;
    --sidebar-bg-hover: #eff5f5;
    --sidebar-text: #36575e;
    --sidebar-muted: #6a8389;
    --sidebar-border: #d8e5e3;
    --sidebar-active-bg: #e0f3f3;
    --sidebar-active-text: #153640;
    --active-bg: #e0f3f3;
    --active-text: #087a80;
  }
  body.customer-app .mobile-header .brand,
  body.customer-app .mobile-header .brand-name { color: var(--text-primary); }
}

body.customer-app #screen-home > #home-hero,
body.customer-app #screen-home > #home-status-heading,
body.customer-app #screen-home > #overview-strip,
body.customer-app #screen-home > #home-device-heading,
body.customer-app #screen-home > #cp-list { display: none !important; }
body.customer-app #screen-home .customer-home:not([hidden]) {
  display: block;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 8px 0 22px;
  color: var(--text-primary);
}
.customer-home-state[hidden] { display: none !important; }
.customer-home-intro { margin: 0 4px 17px; }
.customer-home-eyebrow { display: block; margin-bottom: 4px; color: var(--active-text); font-size: 11px; font-weight: 600; }
.customer-home-intro h2 { margin: 0 0 3px; color: var(--text-primary); font-size: 25px; line-height: 1.3; }
.customer-home-intro p { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
.customer-wallet-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 112px;
  margin: 0 0 15px;
  padding: 18px 19px 13px;
  border: 0;
  border-radius: 17px;
  background: linear-gradient(135deg, #075f66, #043d4b);
  color: #fff;
  text-align: left;
  box-shadow: 0 11px 25px rgba(5, 91, 100, .17);
}
.customer-wallet-balance { color: inherit; text-decoration: none; }
.customer-wallet-label { display: block; color: #a9d9dd; font-size: 11px; }
.customer-wallet-balance > strong { display: block; margin-top: 5px; font-size: 29px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.customer-wallet-topup { min-height: 38px; padding: 8px 11px; border: 1px solid #ffffff40; border-radius: 9px; background: #ffffff12; color: #eaffff; font-size: 11px; font-weight: 600; }
.customer-wallet-topup:hover { background: #ffffff25; }
.customer-wallet-foot { display: flex; grid-column: 1 / -1; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid #ffffff35; color: #c4e2e2; font-size: 10px; }
.customer-wallet-foot span:last-child { color: #a4f1d4; font-weight: 600; }
.customer-start-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
}
.customer-scan-art { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 12px; border-radius: 14px; background: var(--active-bg); color: var(--active-text); font-size: 29px; font-weight: 700; line-height: 1; }
.customer-start-card h3 { margin: 0 0 4px; color: var(--text-primary); font-size: 18px; }
.customer-start-card p { margin: 0 0 15px; color: var(--text-secondary); font-size: 11px; line-height: 1.55; }
.customer-primary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 50px;
  padding: 11px 15px;
  border: 0;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.customer-primary-action:hover { filter: brightness(1.08); }
.customer-primary-action > span { font-size: 19px; line-height: 1; }
.customer-home-process { margin-top: 20px; }
.customer-home-process h3, .customer-home-section-title h3 { margin: 0; color: var(--text-primary); font-size: 14px; }
.customer-home-process ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 0; margin: 10px 0 0; list-style: none; }
.customer-home-process li { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 9px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-primary); font-size: 10px; }
.customer-home-process li b { display: grid; place-items: center; width: 23px; height: 23px; flex: 0 0 23px; border-radius: 50%; background: var(--active-bg); color: var(--active-text); font-size: 10px; }
.customer-home-last-session { margin-top: 20px; }
.customer-home-section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.customer-home-section-title a, .customer-home-guide a { color: var(--primary); font-size: 11px; font-weight: 600; text-decoration: none; }
.customer-home-last-card { padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.customer-home-last-main { display: flex; align-items: center; gap: 10px; }
.customer-home-last-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; background: var(--active-bg); color: var(--active-text); }
.customer-home-last-main > div { display: grid; min-width: 0; gap: 3px; }
.customer-home-last-main > div strong { overflow: hidden; color: var(--text-primary); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.customer-home-last-main > div span { color: var(--text-secondary); font-size: 10px; }
.customer-home-last-main > b { margin-left: auto; color: var(--text-primary); font-size: 12px; white-space: nowrap; }
.customer-home-last-foot { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0 0 46px; margin-top: 10px; border-top: 1px solid var(--border); color: var(--text-secondary); font-size: 10px; }
.customer-home-guide { margin: 17px 0 0; text-align: center; }
.customer-home-state#customer-home-charging { padding: 2px 0 0; }
.customer-charging-heading { margin: 0 4px 12px; }
.customer-charging-heading > span { color: var(--primary); font-size: 11px; font-weight: 600; }
.customer-charging-heading h3 { margin: 2px 0 2px; color: var(--text-primary); font-size: 23px; }
.customer-charging-heading p { margin: 0; color: var(--text-secondary); font-size: 12px; }
.customer-live-power { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 9px; padding: 13px 14px; border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border)); border-radius: 13px; background: linear-gradient(110deg, color-mix(in srgb, var(--primary) 9%, var(--surface)), var(--surface-2)); }
.customer-live-power > div:first-child > span { display: block; color: var(--text-secondary); font-size: 10px; }
.customer-live-power > div:first-child > strong { display: block; margin-top: 2px; color: var(--active-text); font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.customer-live-power small { color: var(--text-secondary); font-size: 12px; font-weight: 500; }
.customer-live-state { display: grid; justify-items: end; gap: 5px; text-align: right; }
.customer-live-state > span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 99px; background: rgba(52, 211, 153, .12); color: #18875c; font-size: 10px; font-weight: 700; }
.customer-live-state > span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 rgba(52, 211, 153, .2); animation: customer-live-dot 1.8s ease-in-out infinite; }
.customer-live-state > small { max-width: 145px; color: var(--text-secondary); font-size: 9px; }
.customer-charge-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.customer-charge-stats > div { min-width: 0; padding: 10px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.customer-charge-stats > div > span { display: block; color: var(--text-secondary); font-size: 10px; }
.customer-charge-stats > div > strong { display: block; overflow-wrap: anywhere; margin-top: 3px; color: var(--text-primary); font-size: 14px; font-variant-numeric: tabular-nums; }
.customer-charge-meter { height: 6px; overflow: hidden; margin: 11px 0; border-radius: 99px; background: var(--surface-2); }
.customer-charge-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--primary); transition: width .3s ease; }
.customer-charging-visual { position: relative; width: 100%; overflow: hidden; margin: 0 0 12px; aspect-ratio: 1672 / 954; border: 1px solid rgba(52, 176, 220, .25); border-radius: 12px; background: #06101a; isolation: isolate; }
.customer-charging-visual img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; animation: customer-scene-pulse 4s ease-in-out infinite; }
.customer-charging-visual svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; mix-blend-mode: screen; }
.customer-charging-visual path { fill: none; stroke: #d8fcff; stroke-width: 12; stroke-linecap: round; stroke-dasharray: 110 890; opacity: .92; filter: drop-shadow(0 0 8px #24dfff) drop-shadow(0 0 16px rgba(41, 223, 255, .8)); animation: customer-cable-pulse 2.4s linear infinite; }
.customer-charging-manage { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; padding: 10px; border-radius: 11px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 700; text-align: center; text-decoration: none; }
.customer-charging-manage:hover { filter: brightness(1.06); }
.customer-charging-note { margin: 9px 2px 0; color: var(--text-secondary); font-size: 10px; line-height: 1.5; }
.customer-done-heading { margin: 8px 0 18px; text-align: center; }
.customer-done-heading > span { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 11px; border-radius: 50%; background: #d8f3e5; color: #0e9b64; font-size: 31px; font-weight: 700; }
.customer-done-heading h3 { margin: 0 0 3px; color: var(--text-primary); font-size: 22px; }
.customer-done-heading p { margin: 0; color: var(--text-secondary); font-size: 11px; }
.customer-done-wallet { padding: 17px 18px 12px; margin-bottom: 17px; border-radius: 16px; background: linear-gradient(135deg, #075f66, #043d4b); color: #fff; box-shadow: 0 11px 25px rgba(5, 91, 100, .14); }
.customer-done-wallet > span { color: #a9d9dd; font-size: 11px; }
.customer-done-wallet > strong { display: block; margin: 6px 0 14px; font-size: 29px; line-height: 1; }
.customer-done-wallet > div { display: flex; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid #ffffff35; color: #c4e2e2; font-size: 10px; }
.customer-done-wallet b { color: #a4f1d4; }
.customer-done-section-title { margin: 0 0 8px; color: var(--text-primary); font-size: 14px; }
.customer-done-stats { margin-bottom: 15px; }
.customer-done-stats > div > strong { font-size: 14px; }
.customer-done-return { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 46px; margin-top: 8px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--text-primary); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.customer-done-return:hover { border-color: var(--primary); background: var(--surface-hover); }
@keyframes customer-live-dot { 50% { box-shadow: 0 0 0 4px rgba(52, 211, 153, .15); } }
@keyframes customer-scene-pulse { 0%, 100% { filter: brightness(.96) saturate(.96); } 50% { filter: brightness(1.08) saturate(1.08); } }
@keyframes customer-cable-pulse { to { stroke-dashoffset: 1000; } }
@media (prefers-reduced-motion: reduce) {
  .customer-live-state > span::before, .customer-charging-visual img, .customer-charging-visual path { animation: none; }
}
@media (max-width: 520px) {
  body.customer-app #screen-home .customer-home:not([hidden]) { padding-top: 2px; }
  .customer-home-intro { margin-bottom: 14px; }
  .customer-home-intro h2 { font-size: 23px; }
  .customer-wallet-feature { min-height: 105px; padding: 15px 15px 11px; }
  .customer-home-process li { gap: 5px; padding: 8px 6px; font-size: 9px; }
  .customer-live-power { padding: 11px; }
  .customer-live-power > div:first-child > strong { font-size: 26px; }
  .customer-live-state > small { max-width: 112px; }
}
