html.charging-flow-page,
html.charging-flow-page body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html.charging-flow-page::-webkit-scrollbar,
html.charging-flow-page body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

main.app-content.charging-flow-shell {
  width: min(100%, 1040px);
  max-width: 1040px;
  margin: 0 auto;
  padding-top: 30px;
  padding-bottom: max(40px, env(safe-area-inset-bottom, 0px));
}

.flow-header .brand { color: var(--text-primary); text-decoration: none; }
.flow-header-link { text-decoration: none; font-size: 12px; padding: 7px 10px; }
.flow-page-heading { align-items: center; gap: 24px; }
.flow-page-heading h1 { margin: 2px 0 4px; font-size: clamp(24px, 5vw, 34px); }
.flow-page-heading p, .flow-card-heading p { margin: 0; color: var(--text-secondary); font-size: 13px; }
.flow-guide-link { display: inline-flex; margin-top: 8px; color: var(--primary); font-size: 12px; font-weight: 600; text-decoration: none; }
.flow-guide-link:hover { text-decoration: underline; }
.flow-kicker { color: var(--primary); font-size: 12px; font-weight: 600; }
.flow-wallet-chip { min-width: 190px; padding: 14px 16px; border: 1px solid #ffffff25; border-radius: 12px; background: linear-gradient(135deg, #075f66, #043d4b); color: #fff; display: grid; gap: 2px; text-decoration: none; transition: border-color .15s ease, filter .15s ease; }
.flow-wallet-chip:hover { border-color: #ffffff65; filter: brightness(1.08); }
.flow-wallet-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.flow-wallet-chip[hidden] { display: none; }
.flow-wallet-chip span { color: #a9d9dd; font-size: 11px; }
.flow-wallet-chip strong { font-size: 18px; }
.flow-wallet-chip .flow-wallet-topup { justify-self: start; margin-top: 4px; color: #a4f1d4; font-size: 12px; font-weight: 700; text-decoration: none; }
.flow-wallet-topup:hover { text-decoration: underline; }

.flow-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 18px 0; padding: 0; }
.flow-steps li { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 12px; color: var(--text-secondary); background: var(--surface-2); font-size: 12px; }
.flow-steps li span { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border-radius: 50%; background: var(--surface-hover); font-weight: 700; }
.flow-steps li.is-current { color: var(--text-primary); border-color: var(--primary); }
.flow-steps li.is-current span, .flow-steps li.is-done span { color: #fff; background: var(--primary); }
.flow-steps li.is-done { color: var(--text-primary); }

.flow-banner, .flow-message { padding: 10px 12px; margin: 12px 0 0; border-radius: 10px; background: var(--surface-2); color: var(--text-secondary); font-size: 13px; }
.flow-banner.is-error, .flow-message.is-error { color: #fecaca; border: 1px solid rgba(239,68,68,.4); }
.flow-banner.is-success, .flow-message.is-success { color: #bbf7d0; border: 1px solid rgba(34,197,94,.35); }
.flow-first-use-dialog { width: min(calc(100% - 32px), 500px); max-height: min(88vh, 720px); padding: 0; overflow: auto; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text-primary); box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.flow-first-use-dialog::backdrop { background: rgba(5, 9, 15, .78); backdrop-filter: blur(4px); }
.flow-first-use-content { position: relative; padding: 28px; }
.flow-first-use-close { position: absolute; top: 13px; right: 13px; display: grid; width: 36px; height: 36px; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-2); color: var(--text-secondary); font-size: 22px; line-height: 1; }
.flow-first-use-icon { display: grid; width: 44px; height: 44px; place-items: center; margin-bottom: 15px; border-radius: 13px; background: var(--active-bg); color: var(--active-text); font-size: 23px; }
.flow-first-use-content > .flow-kicker { margin: 0 0 4px; }
.flow-first-use-content h2 { margin: 0; font-size: 22px; }
.flow-first-use-lead { margin: 5px 0 18px; color: var(--text-secondary); font-size: 13px; line-height: 1.65; }
.flow-first-use-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.flow-first-use-steps li { display: flex; align-items: flex-start; gap: 11px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.flow-first-use-steps li > span { display: grid; width: 27px; height: 27px; flex: 0 0 27px; place-items: center; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; }
.flow-first-use-steps strong { display: block; margin: 2px 0 3px; font-size: 13px; }
.flow-first-use-steps p { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.55; }
.flow-first-use-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; margin-top: 20px; }
.flow-first-use-actions a { display: inline-flex; min-height: 42px; align-items: center; padding: 9px 13px; border-radius: 9px; color: var(--text-secondary); font-size: 12px; text-decoration: none; }
.flow-first-use-actions a:hover { color: var(--text-primary); }
.flow-card { margin-bottom: 14px; padding: clamp(16px, 4vw, 24px); }
.flow-card h2 { margin: 0 0 3px; font-size: 18px; }
.flow-card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.flow-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px; color: var(--active-text); background: var(--active-bg); font-size: 22px; font-weight: 700; }
.flow-form { display: grid; gap: 8px; margin-top: 16px; max-width: none; }
.flow-form label { color: var(--text-secondary); font-size: 13px; }
.flow-inline-control { display: flex; gap: 8px; }
.flow-inline-control input { flex: 1; min-width: 0; }
.flow-form input,
.flow-card-fields input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-primary);
  color-scheme: inherit;
  font: inherit;
  font-size: 16px;
}
.flow-form input::placeholder,
.flow-card-fields input::placeholder { color: var(--text-secondary); opacity: 1; }
.flow-form input:focus,
.flow-card-fields input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--active-bg);
  outline: none;
}
.flow-inline-control button { white-space: nowrap; }
.flow-legacy-note { margin: 18px 0 0; color: var(--text-secondary); font-size: 12px; text-align: center; }
.flow-user-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.flow-user-row strong { font-size: 17px; }
.flow-topup-link { text-decoration: none; white-space: nowrap; }
.flow-selected-connector { padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.flow-selected-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.flow-selected-title strong { font-size: 17px; }
.flow-selected-meta { margin-top: 8px; color: var(--text-secondary); font-size: 12px; line-height: 1.65; }
.flow-selected-details { margin-top: 7px; color: var(--text-secondary); font-size: 11px; line-height: 1.55; }
.flow-selected-details summary { width: fit-content; color: var(--primary); cursor: pointer; font-weight: 600; }
.flow-selected-details > div { padding-top: 5px; }
.flow-state-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--border); border-radius: 999px; font-size: 11px; }
.flow-state-badge.is-ready { color: #bbf7d0; border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.1); }
.flow-state-badge.is-busy { color: #fde68a; border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.1); }
.flow-state-badge.is-unready { color: #fecaca; border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.08); }
.flow-location-result { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.flow-location-result.is-success { border-color: rgba(34,197,94,.35); color: #6be5a7; }
.flow-location-result.is-warning { border-color: rgba(239,68,68,.4); color: #ff9297; }
.flow-geofence-visual { display: grid; gap: 8px; margin-top: 12px; }
.flow-geofence-visual[hidden] { display: none; }
.flow-map-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; }
.flow-map-heading button { flex: 0 0 auto; min-height: 36px; margin: 0; padding: 7px 10px; font-size: 11px; }
.flow-geofence-map { position: relative; z-index: 0; isolation: isolate; height: 220px; overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: #e8e5df; cursor: zoom-in; }
.flow-geofence-map:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.flow-geofence-map.leaflet-container { width: 100%; font: inherit; }
.flow-geofence-map .leaflet-control-zoom { margin: 8px !important; border: 0 !important; box-shadow: 0 2px 10px rgba(0,0,0,.22); }
.flow-geofence-map .leaflet-control-zoom a { display: grid; width: 38px; height: 38px; place-items: center; color: #17212b; font-size: 22px; }
.flow-geofence-map .leaflet-control-attribution { padding: 2px 5px; border-radius: 5px 0 0; background: rgba(255,255,255,.88); font-size: 10px; }
.flow-geofence-map-meta { display: grid; gap: 5px; }
.flow-geofence-legend { display: grid; width: min(100%, 360px); grid-template-columns: repeat(2, minmax(0, 1fr)); justify-items: center; gap: 6px 12px; margin-inline: auto; color: var(--text-secondary); font-size: 11px; }
.flow-geofence-legend > span { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; text-align: center; line-height: 1.35; }
.flow-geofence-legend i { display: inline-block; width: 12px; height: 12px; flex: 0 0 12px; border-radius: 50%; }
.flow-geofence-legend-charger { background: var(--primary); box-shadow: inset 0 0 0 2px #fff; }
.flow-geofence-legend-user { background: #2563eb; box-shadow: inset 0 0 0 2px #fff; }
.flow-geofence-legend-limit { border: 2px solid #22c55e; background: rgba(34,197,94,.12); }
.flow-geofence-legend-accuracy { border: 2px dashed #3b82f6; background: rgba(59,130,246,.12); }
.flow-map-attribution { justify-self: end; color: var(--text-secondary); font-size: 10px; text-decoration: none; }
.flow-map-dialog { position: fixed; inset: 0; width: 100vw; height: 100dvh; min-width: 0; max-width: none; max-height: none; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 0; background: #10161e; color: var(--text-primary); }
.flow-map-dialog[open] { display: block; }
.flow-map-dialog::backdrop { background: #10161e; }
.flow-map-dialog-content { position: relative; display: block; width: 100%; height: 100%; min-height: 0; padding: 0; }
.flow-map-dialog-header { position: absolute; z-index: 1100; top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px; left: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: auto; touch-action: none; user-select: none; }
.flow-map-dialog-header > div { min-width: 0; 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); }
.flow-map-dialog-header span { color: var(--text-secondary); font-size: 11px; }
.flow-map-dialog-header h2 { margin: 1px 0 0; overflow-wrap: anywhere; font-size: 15px; line-height: 1.35; }
.flow-map-dialog-header button { display: grid; flex: 0 0 auto; width: 56px; min-width: 56px; height: 56px; min-height: 56px; place-items: center; margin: 0; padding: 0; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; background: rgba(13,20,29,.96); box-shadow: 0 3px 14px rgba(0,0,0,.28); color: var(--text-primary); backdrop-filter: blur(10px); }
.flow-map-dialog-header button svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 2.4; }
.flow-geofence-full-map { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: hidden; border: 0; border-radius: 0; background: #e8e5df; }
.flow-geofence-full-map.leaflet-container { width: 100%; height: 100%; font: inherit; }
.flow-geofence-full-map .leaflet-top.leaflet-left { top: calc(70px + env(safe-area-inset-top, 0px)); right: 0; left: auto; z-index: 800; }
.flow-geofence-full-map .leaflet-control-zoom { margin: 10px !important; border: 0 !important; box-shadow: 0 2px 12px rgba(0,0,0,.2); }
.flow-geofence-full-map .leaflet-control-zoom a { display: grid; width: 50px; height: 50px; place-items: center; color: #17212b; font-size: 28px; }
.flow-geofence-full-map .leaflet-control-attribution { display: none !important; }
.flow-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"; grid-template-columns: minmax(0, 1fr); gap: 8px; pointer-events: none; }
.flow-map-dialog-actions { grid-area: actions; display: flex; width: 100%; min-width: 0; pointer-events: auto; }
.flow-map-directions { display: inline-flex; flex: 1 1 auto; align-items: center; justify-content: center; width: 100%; min-width: 0; min-height: 52px; padding: 10px 14px; border: 1px solid var(--primary); border-radius: 12px; background: var(--primary); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.flow-map-directions:hover { color: #fff; }
.flow-map-dialog-meta { grid-area: meta; display: grid; justify-items: end; gap: 5px; justify-self: end; width: fit-content; max-width: min(100%, 420px); min-width: 0; padding: 9px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; background: rgba(13,20,29,.9); color: var(--text-secondary); box-shadow: 0 3px 14px rgba(0,0,0,.22); backdrop-filter: blur(10px); pointer-events: auto; }
.flow-map-dialog-summary { display: grid; gap: 3px; color: var(--text-primary); font-size: 13px; line-height: 1.4; text-align: right; }
.flow-map-dialog-summary span { display: block; }
.flow-map-dialog-legend { display: none; }
.flow-map-dialog-footer .flow-map-attribution { color: var(--text-secondary); }
.flow-reasons { display: grid; gap: 5px; margin: 12px 0 0; padding: 0 0 0 18px; color: #fecaca; font-size: 12px; }
.flow-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.flow-picker-heading { align-items: center; justify-content: space-between; }
.flow-picker-heading h2 { margin-bottom: 3px; }
.flow-page-heading > div:first-child { flex: 1 1 auto; min-width: 0; }
.flow-wallet-chip { margin-left: auto; }
.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;
  text-align: center;
}
.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; }
.flow-session-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.flow-stat { padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.flow-stat span { display: block; color: var(--text-secondary); font-size: 11px; }
.flow-stat strong { display: block; margin-top: 3px; font-size: 17px; }
.flow-session-meter { overflow: hidden; height: 7px; margin-top: 13px; border-radius: 10px; background: var(--surface-2); }
.flow-session-meter > div { width: 0; height: 100%; border-radius: inherit; background: var(--primary); transition: width .25s ease; }
.flow-session-section:not([hidden]) { animation: flow-session-enter .32s ease-out both; }
.flow-session-section.is-waiting .flow-icon { animation: flow-session-wait-pulse 1.25s ease-in-out infinite; }
.flow-session-section.is-active .flow-icon { animation: flow-session-active-pulse 2.2s ease-in-out infinite; }
.flow-session-section.is-waiting #flow-session-subtitle::after {
  content: " ···";
  display: inline-block;
  letter-spacing: .12em;
  animation: flow-session-wait-dots 1.2s ease-in-out infinite;
}
.flow-session-meter.is-indeterminate > div {
  width: 36% !important;
  transform: translateX(-110%);
  background: linear-gradient(90deg, transparent, var(--primary), #71d9ff, var(--primary), transparent);
  animation: flow-session-progress-sweep 1.45s ease-in-out infinite;
}
@keyframes flow-session-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes flow-session-wait-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(15, 168, 232, .08); transform: scale(1); }
  50% { box-shadow: 0 0 0 8px rgba(15, 168, 232, .14); transform: scale(1.06); }
}
@keyframes flow-session-active-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(15, 168, 232, .08); }
  50% { box-shadow: 0 0 0 5px rgba(15, 168, 232, .12); }
}
@keyframes flow-session-wait-dots {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}
@keyframes flow-session-progress-sweep {
  from { transform: translateX(-110%); }
  to { transform: translateX(290%); }
}
@media (prefers-reduced-motion: reduce) {
  .flow-session-section:not([hidden]),
  .flow-session-section.is-waiting .flow-icon,
  .flow-session-section.is-active .flow-icon,
  .flow-session-section.is-waiting #flow-session-subtitle::after,
  .flow-session-meter.is-indeterminate > div {
    animation: none;
  }
}
.flow-payment-panel { margin-top: 16px; padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.flow-payment-panel h3 { margin: 0 0 6px; font-size: 16px; }
.flow-payment-amount { margin: 0 0 11px; color: var(--text-secondary); font-size: 13px; }
.flow-payment-amount strong { margin-left: 5px; color: var(--text-primary); font-size: 20px; }
.flow-payment-options { display: grid; gap: 8px; }
.flow-payment-options label { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); cursor: pointer; }
.flow-payment-options label:has(input:checked) { border-color: var(--primary); }
.flow-payment-options input { flex: 0 0 auto; width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.flow-payment-options input:disabled + span { color: var(--text-secondary); }
.flow-payment-config-note { margin: 9px 0 0; color: var(--text-secondary); font-size: 12px; }
.flow-card-fields { display: grid; gap: 7px; margin-top: 12px; }
.flow-card-fields label { color: var(--text-secondary); font-size: 12px; }
.flow-card-expiry-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.flow-card-expiry-row > div { display: grid; gap: 7px; min-width: 0; }
.flow-card-fields small { color: var(--text-secondary); font-size: 11px; }
.flow-promptpay-panel { margin-top: 12px; text-align: center; }
.flow-promptpay-panel img { display: block; width: min(68vw, 240px); max-height: 270px; object-fit: contain; margin: 0 auto; padding: 8px; border-radius: 10px; background: #fff; }
.flow-promptpay-panel p { color: var(--text-secondary); font-size: 12px; }
.flow-promptpay-download { display: inline-block; margin-top: 8px; color: var(--primary); font-size: 12px; }
.flow-payment-topup { display: inline-flex; align-items: center; text-decoration: none; }
.flow-payment-panel[hidden], .flow-card-fields[hidden], .flow-promptpay-panel[hidden] { display: none; }
.flow-scan-dock { display: none; }
.flow-footer { padding: 10px 0 20px; text-align: center; font-size: 12px; }
.qr-flow-entry { display: flex; 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; }

.flow-qr-section:not([hidden]) .flow-card-heading { animation: flow-qr-enter .3s ease-out both; }
.flow-qr-section:not([hidden]) .flow-selected-connector { animation: flow-qr-enter .34s .06s ease-out both; }
.flow-qr-section:not([hidden]) .flow-actions { animation: flow-qr-enter .34s .12s ease-out both; }
.flow-qr-section:not([hidden]) .flow-location-result:not([hidden]),
.flow-qr-section:not([hidden]) .flow-geofence-visual:not([hidden]),
.flow-banner:not([hidden]) { animation: flow-qr-enter .28s ease-out both; }
.flow-qr-section.is-loading .flow-selected-connector { animation: flow-qr-check-pulse 1.25s ease-in-out infinite; }
#flow-check-location.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  opacity: .95;
}
#flow-check-location.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: flow-qr-spinner .75s linear infinite;
}
@keyframes flow-qr-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes flow-qr-check-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(15, 168, 232, 0); }
  50% { border-color: var(--primary); box-shadow: 0 0 15px rgba(15, 168, 232, .15); }
}
@keyframes flow-qr-spinner { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .flow-qr-section:not([hidden]) .flow-card-heading,
  .flow-qr-section:not([hidden]) .flow-selected-connector,
  .flow-qr-section:not([hidden]) .flow-actions,
  .flow-qr-section:not([hidden]) .flow-location-result:not([hidden]),
  .flow-qr-section:not([hidden]) .flow-geofence-visual:not([hidden]),
  .flow-banner:not([hidden]),
  #flow-check-location.is-loading::before {
    animation: none;
  }
}

@media (max-width: 560px) {
  .flow-first-use-content { padding: 24px 17px 18px; }
  .flow-first-use-content h2 { font-size: 19px; }
  .flow-first-use-actions { align-items: stretch; flex-direction: column-reverse; }
  .flow-first-use-actions > * { width: 100%; justify-content: center; }
  .charging-flow-shell { padding: 18px 12px max(112px, calc(96px + env(safe-area-inset-bottom, 0px))); }
  .flow-page-heading { align-items: start; flex-direction: column; }
  .flow-wallet-chip { width: 100%; }
  .flow-steps { gap: 5px; }
  .flow-steps li { flex-direction: column; justify-content: center; gap: 4px; padding: 7px 2px; font-size: 10px; }
  .flow-inline-control { flex-direction: column; }
  .flow-inline-control button { width: 100%; }
  .flow-session-stats { gap: 7px; }
  .flow-payment-panel { padding: 12px; }
  .flow-stat { padding: 10px; }
  .flow-stat strong { font-size: 15px; }
  .flow-header .version-badge { display: none; }
  .flow-header-link { padding: 6px 8px; }
  .flow-picker-heading #flow-open-camera { display: none; }
  .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; }
  .flow-map-dialog { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; overflow: hidden; border-radius: 0; background: #10161e; }
  .flow-map-dialog[open] { display: block; }
  .flow-map-dialog-content { position: relative; display: block; width: 100%; height: 100%; min-height: 0; padding: 0; }
  .flow-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; }
  .flow-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); }
  .flow-map-dialog-header span { font-size: 11px; }
  .flow-map-dialog-header h2 { margin-top: 1px; font-size: 15px; }
  .flow-map-dialog-header button { width: 56px; min-width: 56px; height: 56px; min-height: 56px; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; background: rgba(13,20,29,.96); box-shadow: 0 3px 14px rgba(0,0,0,.28); }
  .flow-geofence-full-map { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; }
  .flow-geofence-full-map .leaflet-top.leaflet-left { top: calc(70px + env(safe-area-inset-top, 0px)); right: 0; left: auto; z-index: 800; }
  .flow-geofence-full-map .leaflet-control-zoom { margin: 10px !important; }
  .flow-geofence-full-map .leaflet-control-zoom a { width: 50px; height: 50px; font-size: 28px; }
  .flow-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"; grid-template-columns: 1fr; gap: 8px; pointer-events: none; }
  .flow-map-dialog-meta { grid-area: meta; justify-self: end; width: fit-content; max-width: min(100%, 360px); padding: 8px 10px; 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,.22); backdrop-filter: blur(10px); }
  .flow-map-dialog-summary { text-align: right; }
  .flow-map-dialog-legend { grid-template-columns: repeat(2, auto); justify-content: end; gap: 5px 12px; }
  .flow-map-dialog-legend > span { min-width: 0; }
  .flow-map-dialog-actions { grid-area: actions; width: 100%; pointer-events: auto; }
  .flow-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); }
  .flow-map-directions:hover { color: #fff; }
  .flow-map-dialog-footer .flow-map-attribution { pointer-events: auto; }
  .flow-scan-dock:not([hidden]) { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: flex; justify-content: center; padding: 10px 16px max(10px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: rgba(16, 21, 28, .96); backdrop-filter: blur(12px); }
  .flow-scan-dock button { width: min(100%, 480px); min-height: 48px; }
}

/* Keep customer charging text readable on phone screens. */
main.app-content.charging-flow-shell { font-size: 15px; }
.flow-header-link { font-size: 13px; }
.flow-page-heading p, .flow-card-heading p { font-size: 14px; line-height: 1.55; }
.flow-guide-link, .flow-kicker { font-size: 13px; }
.flow-wallet-chip span { font-size: 12px; }
.flow-wallet-chip .flow-wallet-topup { font-size: 13px; }
.flow-steps li { font-size: 13px; }
.flow-banner, .flow-message { font-size: 14px; line-height: 1.5; }
.flow-first-use-lead, .flow-first-use-steps p { font-size: 14px; }
.flow-first-use-steps strong, .flow-first-use-actions a { font-size: 14px; }
.flow-form label, .flow-legacy-note { font-size: 14px; }
.flow-selected-meta { font-size: 14px; line-height: 1.55; }
.flow-selected-details { font-size: 13px; }
.flow-state-badge { font-size: 12px; }
.flow-location-result { font-size: 14px; line-height: 1.55; }
.flow-map-heading { font-size: 15px; }
.flow-map-heading button { font-size: 13px; }
.flow-geofence-legend, .flow-map-dialog-legend { font-size: 13px; }
.flow-map-attribution { font-size: 12px; line-height: 1.4; }
.flow-map-dialog-header span { font-size: 11px; }
.flow-map-dialog-header h2 { font-size: 15px; }
.flow-map-dialog-summary { font-size: 13px; line-height: 1.4; }
.flow-reasons { font-size: 14px; line-height: 1.5; }
.flow-stat span { font-size: 12px; }
.flow-payment-amount { font-size: 14px; }
.flow-payment-config-note, .flow-card-fields label, .flow-promptpay-panel p, .flow-promptpay-download { font-size: 13px; }
.flow-card-fields small { font-size: 12px; }
.flow-footer, .qr-flow-entry p { font-size: 13px; }
.flow-geofence-map .leaflet-control-attribution,
.flow-geofence-full-map .leaflet-control-attribution { font-size: 11px; }

@media (max-width: 560px) {
  .flow-steps li { font-size: 13px; }
  .flow-selected-meta, .flow-location-result { font-size: 14px; }
  .flow-geofence-legend, .flow-map-dialog-legend { font-size: 12px; }
}
/* Make the QR flow actions easy to tap on phones. */
.flow-charge-actions > button {
  min-height: 46px;
  padding: 10px 16px;
  font-size: 14px;
}

.flow-charge-actions > #flow-start-charge:not([hidden]) {
  flex: 1 1 220px;
  order: -1;
}

.flow-charge-actions > #flow-check-location,
.flow-charge-actions > #flow-back-to-list {
  min-width: 150px;
}

@media (max-width: 820px) {
  .flow-charge-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .flow-charge-actions > #flow-start-charge {
    order: -1;
  }

  .flow-charge-actions > :is(button, a) {
    width: 100%;
    min-height: 48px;
    margin: 0;
  }
}

.flow-session-actions > #flow-session-restart:not([hidden]) {
  order: -1;
  flex: 1 1 100%;
  min-height: 54px;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 700;
}
.flow-session-actions > #flow-session-back:not([hidden]) {
  flex: 1 1 100%;
  min-height: 50px;
  padding: 12px 18px;
  font-size: 14px;
}
@media (max-width: 820px) {
  .flow-session-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .flow-session-actions > button { width: 100%; min-height: 48px; margin: 0; }
  .flow-session-actions > #flow-session-restart:not([hidden]) {
    min-height: 58px;
    font-size: 16px;
  }
}

.flow-charging-visual {
  display: none;
  position: relative;
  width: 100%;
  margin: 16px auto;
  overflow: hidden;
  aspect-ratio: 1672 / 954;
  border: 1px solid rgba(52, 176, 220, .2);
  border-radius: 12px;
  background: #06101a;
  isolation: isolate;
}
.flow-session-section.is-waiting .flow-charging-visual,
.flow-session-section.is-active .flow-charging-visual,
.flow-session-section.is-paused .flow-charging-visual,
.flow-session-section.is-offline .flow-charging-visual,
.flow-session-section.is-stale .flow-charging-visual,
.flow-session-section.is-reconnecting .flow-charging-visual,
.flow-session-section.is-faulted .flow-charging-visual,
.flow-session-section.is-stopping .flow-charging-visual {
  display: block;
  animation: flow-charging-scene-enter .45s ease-out both;
}
.flow-charging-scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter .6s ease;
}
.flow-charging-energy-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  mix-blend-mode: screen;
}
.flow-charging-energy-overlay path {
  fill: none;
  stroke: #d8fcff;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 110 890;
  opacity: 0;
  filter: drop-shadow(0 0 8px #24dfff) drop-shadow(0 0 16px rgba(41, 223, 255, .8));
  transition: opacity .6s ease;
}
.flow-session-section.is-active .flow-charging-scene { animation: flow-charging-scene-pulse 4s ease-in-out infinite; }
.flow-session-section.is-active .flow-charging-energy-overlay path { opacity: .92; animation: flow-charging-cable-pulse 2.4s linear infinite; }
.flow-session-section.is-stopping .flow-charging-energy-overlay path { opacity: .25; animation: flow-charging-cable-pulse 5s linear infinite; }
.flow-session-section.is-stopping:not(.is-energy-flowing) .flow-charging-energy-overlay path { opacity: 0; animation: none; }
.flow-session-section.is-waiting .flow-charging-scene { filter: brightness(.7); }
.flow-session-section.is-waiting .flow-charging-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 8% 24% at 79% 30%, rgba(255, 167, 46, .45), transparent);
  animation: flow-charger-ready-glow 1.4s ease-in-out infinite;
}
.flow-session-section:is(.is-paused, .is-offline, .is-stale, .is-reconnecting, .is-faulted) .flow-charging-scene { filter: brightness(.52) saturate(.7); }
.flow-session-section.is-stopping .flow-charging-scene { filter: brightness(.65); }
@keyframes flow-charger-ready-glow { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes flow-charging-scene-enter {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes flow-charging-scene-pulse {
  0%, 100% { filter: brightness(.96) saturate(.96); }
  50% { filter: brightness(1.08) saturate(1.08); }
}
@keyframes flow-charging-cable-pulse { to { stroke-dashoffset: 1000; } }
@media (prefers-reduced-motion: reduce) {
  .flow-session-section.is-waiting .flow-charging-visual,
  .flow-session-section.is-active .flow-charging-visual,
  .flow-charging-scene,
  .flow-charging-energy-overlay path { animation: none; }
}

.flow-live-power { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 16px; border: 1px solid rgba(14, 156, 164, .35); border-radius: 12px; background: linear-gradient(110deg, var(--active-bg), var(--surface-2)); }
.flow-live-power-reading > span { color: var(--text-secondary); font-size: 13px; }
.flow-live-power-reading > strong { display: block; margin-top: 3px; color: var(--active-text); font-size: clamp(28px, 5vw, 36px); font-variant-numeric: tabular-nums; line-height: 1.2; }
.flow-live-power-reading small { color: var(--text-secondary); font-size: 15px; font-weight: 500; }
.flow-live-power-status { display: grid; gap: 8px; justify-items: end; text-align: right; }
.flow-live-power-status > small { color: var(--text-secondary); font-size: 12px; }
.flow-session-status { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 30px; background: rgba(52, 211, 153, .1); color: #7de8b9; font-size: 12px; }
.flow-session-status i { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: currentColor; }
.is-active .flow-session-status i { animation: flow-status-dot-pulse 1.8s ease-in-out infinite; }
.flow-session-section:is(.is-waiting, .is-paused, .is-stopping, .is-offline, .is-stale, .is-reconnecting) .flow-session-status { background: rgba(251, 191, 36, .1); color: #fcd887; }
.is-faulted .flow-session-status { background: rgba(239, 68, 68, .1); color: #fca5a5; }
.is-stopping .flow-icon { color: #fcd887; background: rgba(251, 191, 36, .1); }
.is-complete .flow-icon { color: #7de8b9; background: rgba(52, 211, 153, .1); }
@keyframes flow-status-dot-pulse { 50% { box-shadow: 0 0 0 4px rgba(52, 211, 153, .12); } }

@media (prefers-color-scheme: light) {
  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;
  }
  html.charging-flow-page body { background: var(--bg); color: var(--text-primary); }
  .charging-flow-page .mobile-header { background: var(--surface); border-bottom-color: var(--border); }
  .charging-flow-page .mobile-header .brand,
  .charging-flow-page .mobile-header .brand-name { color: var(--text-primary); }
  .charging-flow-page .flow-first-use-dialog::backdrop { background: rgba(17, 39, 46, .42); }
  .charging-flow-page .flow-banner.is-error,
  .charging-flow-page .flow-message.is-error { color: #a92732; background: #fff5f5; border-color: #efb5b8; }
  .charging-flow-page .flow-banner.is-success,
  .charging-flow-page .flow-message.is-success { color: #176b48; background: #f0fbf5; border-color: #b6e6ca; }
  .charging-flow-page .flow-state-badge.is-ready { color: #176b48; border-color: #a9dfc0; background: #eefaf3; }
  .charging-flow-page .flow-state-badge.is-busy { color: #845800; border-color: #ead39b; background: #fff9e9; }
  .charging-flow-page .flow-state-badge.is-unready { color: #a92732; border-color: #efb5b8; background: #fff5f5; }
  .charging-flow-page .flow-location-result.is-success { color: #176b48; }
  .charging-flow-page .flow-location-result.is-warning,
  .charging-flow-page .flow-reasons { color: #a92732; }
  .charging-flow-page .flow-live-power { border-color: #b9dfe1; background: linear-gradient(110deg, #e8f7f7, var(--surface-2)); }
  .charging-flow-page .flow-live-power-reading > strong { color: #087a80; }
  .charging-flow-page .flow-live-power-status .flow-session-status { background: #e7f8ef; color: #176b48; }
  .charging-flow-page .flow-session-section:is(.is-waiting, .is-paused, .is-stopping, .is-offline, .is-stale, .is-reconnecting) .flow-session-status { background: #fff7e4; color: #845800; }
  .charging-flow-page .is-faulted .flow-session-status { background: #fff0f0; color: #a92732; }
  .charging-flow-page .is-stopping .flow-icon { color: #845800; background: #fff7e4; }
  .charging-flow-page .is-complete .flow-icon { color: #176b48; background: #e7f8ef; }
  .charging-flow-page .flow-stop-progress .is-current { color: #087a80; border-color: #a6d8da; }
  .charging-flow-page .flow-stop-progress .is-done { color: #176b48; border-color: #b6e6ca; }
  .charging-flow-page .flow-stop-progress .is-error { color: #a92732; border-color: #efb5b8; }
  .charging-flow-page .flow-scan-dock:not([hidden]) { background: rgba(255, 255, 255, .96); border-top-color: var(--border); box-shadow: 0 -8px 25px rgba(18, 55, 63, .08); }
  .charging-flow-page .flow-map-dialog { color: #e8ecf1; }
  .charging-flow-page .flow-map-dialog::backdrop { background: #10161e; }
}

.flow-stop-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 16px 0; list-style: none; }
.flow-stop-progress li { display: grid; justify-items: center; align-content: start; gap: 5px; padding: 12px 6px; border: 1px solid var(--border); border-radius: 10px; text-align: center; background: var(--surface-2); color: var(--text-secondary); }
.flow-stop-step-icon { position: relative; display: grid; width: 30px; height: 30px; place-items: center; margin-bottom: 3px; border-radius: 50%; background: var(--surface-hover); font-weight: 700; }
.flow-stop-progress strong { font-size: 13px; font-weight: 600; }
.flow-stop-progress small { font-size: 11px; line-height: 1.5; }
.flow-stop-progress .is-current { color: var(--active-text); border-color: var(--primary); }
.flow-stop-progress .is-current .flow-stop-step-icon::after { content: ""; position: absolute; inset: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: flow-qr-spinner 1.2s linear infinite; }
.flow-stop-progress .is-done { color: #7de8b9; border-color: rgba(52, 211, 153, .25); }
.flow-stop-progress .is-done .flow-stop-step-icon { background: rgba(52, 211, 153, .12); }
.flow-stop-progress .is-error { color: #fca5a5; border-color: rgba(239, 68, 68, .4); }
.flow-session-actions > #flow-stop-charge:not([hidden]) { width: 100%; flex: 1 1 100%; min-height: 52px; font-size: 15px; font-weight: 600; }
.flow-release-transition { display: grid; justify-items: center; gap: 10px; padding: 34px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); text-align: center; }
.flow-release-transition[hidden] { display: none; }
.flow-release-transition strong { font-size: 17px; }
.flow-release-transition small { max-width: 280px; color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
.flow-release-spinner { width: 42px; height: 42px; margin-bottom: 4px; border: 3px solid var(--active-bg); border-top-color: var(--primary); border-radius: 50%; animation: flow-qr-spinner .85s linear infinite; }
.flow-session-section.is-releasing > :not(.flow-card-heading):not(.flow-release-transition) { display: none !important; }
.flow-live-power[hidden], .flow-stop-progress[hidden] { display: none; }
@media (max-width: 560px) {
  .flow-live-power { padding: 13px; gap: 8px; }
  .flow-session-status { font-size: 11px; padding: 6px 8px; }
  .flow-live-power-status > small { font-size: 11px; }
  .flow-stop-progress { gap: 6px; }
  .flow-stop-progress strong { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .flow-session-section .flow-charging-visual,
  .flow-session-section .flow-charging-scene,
  .flow-session-section .flow-charging-energy-overlay path,
  .flow-session-section .flow-charging-visual::after,
  .flow-session-status i,
  .flow-stop-progress .is-current .flow-stop-step-icon::after,
  .flow-release-spinner { animation: none; }
  .flow-session-section .flow-charging-energy-overlay path { opacity: 0; }
}
