/* ============================================================
   MARSX Charger — Public mobile flow
   Mirrors Operator design tokens but trimmed for one-page use.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700&display=swap');

:root {
    --color-primary: #FD853A;
    --color-primary-dark: #C45B1C;
    --color-secondary: #3D66A9;
    --color-success: #2B8A3E;
    --color-warning: #E67700;
    --color-warning-bg: #FFF3BF;
    --color-error: #C92A2A;
    --color-error-bg: #FFE3E3;
    --color-bg: #F8F9FA;
    --color-card: #FFFFFF;
    --color-border: #DEE2E6;
    --color-text: #212529;
    --color-text-muted: #6C757D;
    --radius: 14px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.10);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Noto Sans Thai', system-ui, -apple-system, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ─── Layout shell ─────────────────────────────────────────── */
.public-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    background: var(--color-bg);
}
.public-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-card);
}
.public-brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-primary);
}
.public-brand-name {
    font-weight: 700;
    color: var(--color-text);
}
.public-main {
    flex: 1;
    padding: 1rem;
}
.public-foot {
    padding: 0.75rem 1rem 1.5rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

/* ─── Card ─────────────────────────────────────────────────── */
.charge-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.charge-card h1 {
    margin: 0 0 0.5rem;
    font-size: 1.375rem;
    font-weight: 700;
}
.charge-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}
.charge-muted {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1rem;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: var(--color-card);
    color: var(--color-text);
    cursor: pointer;
    transition: transform 80ms ease, box-shadow 80ms ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--color-primary);
    color: white;
}
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-secondary {
    background: var(--color-card);
    color: var(--color-secondary);
    border: 1px solid var(--color-secondary);
}
.btn-danger {
    background: var(--color-error);
    color: white;
}
.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    width: auto;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-row {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-top: 0.75rem;
}

/* ─── Inputs ───────────────────────────────────────────────── */
.charge-field {
    display: block;
    margin-bottom: 1rem;
}
.charge-field label {
    display: block;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-bottom: 0.375rem;
    font-weight: 500;
}
.charge-input {
    width: 100%;
    padding: 0.75rem 0.875rem;
    font: inherit;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: white;
}
.charge-input:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: -1px;
    border-color: var(--color-primary);
}

/* ─── Amount chips ─────────────────────────────────────────── */
.amount-chips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.amount-chip {
    padding: 0.875rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: white;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 100ms ease;
}
.amount-chip.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ─── Banners ──────────────────────────────────────────────── */
.banner {
    padding: 0.75rem 0.875rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}
.banner i { flex-shrink: 0; margin-top: 2px; }
.banner-warn { background: var(--color-warning-bg); color: #5C3A00; }
.banner-error { background: var(--color-error-bg); color: var(--color-error); }
.banner-info { background: #E7F5FF; color: var(--color-info, #1971C2); }
.banner-success { background: #E6F9EF; color: #166534; border: 1px solid #A7F3D0; }

/* ─── Station-card header (logout corner) ──────────────────── */
.station-card-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 0.5rem;
}
.station-card-head h1 { margin: 0; }
.charge-logout {
    flex-shrink: 0;
    width: 2rem; height: 2rem;
    border-radius: 50%; border: 1px solid var(--color-border, #DEE2E6);
    background: var(--color-surface, #fff); color: var(--color-muted, #868E96);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.15s ease;
}
.charge-logout:hover {
    background: var(--color-error-bg, #FFE3E3); color: var(--color-error, #C92A2A);
    border-color: var(--color-error, #C92A2A);
}

/* ─── PWA install tip card ─────────────────────────────────── */
.pwa-tip {
    display: flex; gap: 0.75rem;
    padding: 0.85rem 1rem;
    margin: 0.75rem 0;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0F2FE 100%);
    border: 1px solid #BFDBFE;
    align-items: flex-start;
    position: relative;
}
.pwa-tip-charging {
    background: linear-gradient(135deg, #FEF3C7 0%, #FEF9C3 100%);
    border-color: #FDE68A;
}
.pwa-tip-done {
    background: linear-gradient(135deg, #DCFCE7 0%, #D1FAE5 100%);
    border-color: #86EFAC;
}
.pwa-tip-icon {
    flex-shrink: 0;
    width: 2.5rem; height: 2.5rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.7);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: #0F172A;
}
.pwa-tip-body { flex: 1; min-width: 0; }
.pwa-tip-title { font-weight: 600; color: #0F172A; font-size: 0.95rem; }
.pwa-tip-desc {
    font-size: 0.85rem; color: #334155;
    margin-top: 0.2rem; line-height: 1.4;
}
.pwa-tip-desc-faint {
    font-size: 0.8rem; color: #64748B;
    margin-top: 0.5rem;
}
.pwa-tip-cta {
    margin-top: 0.6rem;
    width: auto !important; padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
}
.pwa-tip-ios {
    margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.35rem;
    align-items: center; font-size: 0.85rem; color: #0F172A;
    background: rgba(255,255,255,0.6); padding: 0.4rem 0.65rem;
    border-radius: 0.4rem;
}
.pwa-tip-ios i { font-size: 1rem; }
.pwa-tip-dismiss {
    position: absolute; top: 0.4rem; right: 0.4rem;
    background: none; border: none; cursor: pointer;
    color: #94A3B8; padding: 0.25rem;
    border-radius: 0.25rem;
}
.pwa-tip-dismiss:hover { color: #334155; background: rgba(0,0,0,0.05); }

/* ─── Self-reported SoC inputs (option-c preview) ──────────────── */
.soc-self {
    margin-top: 0.5rem;
}
.soc-self-toggle {
    background: none; border: none; padding: 0.4rem 0;
    color: var(--color-primary, #1E40AF); cursor: pointer;
    font-size: 0.85rem; display: inline-flex; align-items: center; gap: 0.4rem;
}
.soc-self-toggle:hover { text-decoration: underline; }
.soc-self-fields {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem;
    padding: 0.6rem; background: rgba(59,130,246,0.06);
    border-radius: 0.5rem; margin-top: 0.4rem;
}
.soc-self-fields label {
    display: flex; flex-direction: column; gap: 0.25rem;
    font-size: 0.78rem; color: #475569;
}
.soc-self-hint {
    font-size: 0.75rem; color: #64748B;
    margin: 0.4rem 0 0; padding: 0;
}

/* ─── Charging metric panel ────────────────────────────────── */
.metric-big {
    text-align: center;
    padding: 1.25rem 0;
}
.metric-big-num {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}
.metric-big-label {
    color: var(--color-text-muted);
    margin-top: 0.5rem;
    font-size: 0.875rem;
}
.metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 1rem 0;
}
.metric-cell {
    background: var(--color-bg);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
}
.metric-cell-num {
    font-size: 1.25rem;
    font-weight: 700;
}
.metric-cell-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ─── PromptPay QR display ─────────────────────────────────── */
.qr-host {
    display: flex;
    justify-content: center;
    background: white;
    padding: 0.75rem;
    border-radius: 10px;
    margin: 0.75rem 0;
}
.qr-host canvas { max-width: 100%; height: auto; }

/* ─── Receipt ──────────────────────────────────────────────── */
.receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--color-border);
}
.receipt-row:last-child { border-bottom: none; }
.receipt-row.total {
    font-size: 1.125rem;
    font-weight: 700;
    border-top: 2px solid var(--color-text);
    margin-top: 0.5rem;
    padding-top: 0.625rem;
}

/* ─── Print ────────────────────────────────────────────────── */
@media print {
    .public-brand, .public-foot, .no-print { display: none !important; }
    .public-shell { max-width: 100%; }
    .charge-card { box-shadow: none; border: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   Modern Charging Dashboard (RenderCharging)
   Replaces the boring metric-grid with a gradient hero + cost ring +
   live stat strip + ETA. Mobile-first; tested at 360px / 414px / 480px.
   ═══════════════════════════════════════════════════════════════════ */

.cs-hero {
    position: relative;
    background: linear-gradient(160deg, #0F172A 0%, #1E3A8A 60%, #0F172A 100%);
    color: #F8FAFC;
    border-radius: 24px;
    padding: 1.25rem 1.25rem 1.5rem;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.25);
}
.cs-hero::before {
    /* Subtle radial highlight that gently pulses behind the ring. */
    content: "";
    position: absolute; inset: -40% 30% auto -20%;
    height: 80%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.25) 0%, transparent 60%);
    filter: blur(20px);
    animation: csGlow 4s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes csGlow {
    from { opacity: 0.55; transform: translate(-2%, -2%); }
    to   { opacity: 1.0;  transform: translate(2%, 3%); }
}

.cs-hero-head {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 0.5rem;
    flex-wrap: wrap;
}
.cs-live-pill {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: rgba(34, 197, 94, 0.15);
    color: #86EFAC;
    border: 1px solid rgba(34, 197, 94, 0.35);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
}
.cs-live-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #22C55E;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.30);
    animation: csLivePulse 1.6s ease-in-out infinite;
}
@keyframes csLivePulse {
    50% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
}
.cs-evse-badge {
    margin-left: auto;
    background: rgba(255,255,255,0.10);
    color: #BFDBFE;
    border: 1px solid rgba(191, 219, 254, 0.20);
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.7rem; font-weight: 600;
    white-space: nowrap;
}

/* ─── Cost ring (primary KPI) ──────────────────────────────────── */
.cs-ring-wrap {
    position: relative; z-index: 1;
    margin: 1.25rem auto 1rem;
    width: min(260px, 80%);
    aspect-ratio: 1;
    display: grid; place-items: center;
}
.cs-ring {
    width: 100%; height: 100%;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.20));
}
.cs-ring-inner {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    pointer-events: none;
}
.cs-cost {
    font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em;
    color: #FFF;
    line-height: 1;
    /* Subtle pulse when value updates so it feels live */
    animation: csCountPulse 0.4s ease-out;
}
.cs-cost-of {
    font-size: 0.75rem; color: #94A3B8;
    margin-top: 0.25rem; letter-spacing: 0.02em;
}
.cs-pct {
    margin-top: 0.5rem;
    font-size: 0.875rem; font-weight: 600;
    color: #FBBF24;
    background: rgba(251, 191, 36, 0.10);
    padding: 0.15rem 0.625rem;
    border-radius: 999px;
}
@keyframes csCountPulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.04); }
    100% { transform: scale(1); }
}

/* ─── Stat strip (3 columns) ───────────────────────────────────── */
/* Battery SoC dial — circular % gauge, same style as the car cockpit. */
.cs-soc {
    position: relative; z-index: 1;
    display: flex; justify-content: center;
    margin: 0.25rem 0 0.5rem;
}
.cs-soc-dial { width: 168px; height: 168px; }

/* Charger doesn't report battery % — replace the (misleading) 0% ring with a
   compact, muted note. Keeps the hero's vertical rhythm without a big dial. */
.cs-soc-unreported {
    align-items: center;
    gap: 0.4rem;
    min-height: 56px;
    padding: 0.5rem 0.9rem;
    color: #9CA3AF;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}
.cs-soc-unreported i { font-size: 1.15rem; line-height: 1; opacity: 0.85; }

.cs-stats {
    position: relative; z-index: 1;
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 0.625rem;
    margin: 0.75rem 0 1rem;
}
.cs-stat {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    backdrop-filter: blur(8px);
}
.cs-stat-icon { font-size: 1.1rem; line-height: 1; }
.cs-stat-num {
    font-size: 1.15rem; font-weight: 700;
    color: #FFF;
    margin-top: 0.25rem; line-height: 1;
}
.cs-stat-label {
    font-size: 0.68rem; color: #94A3B8;
    margin-top: 0.25rem; letter-spacing: 0.02em;
}

/* ─── Budget rows ──────────────────────────────────────────────── */
.cs-budget {
    position: relative; z-index: 1;
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    padding: 0.625rem 0.875rem;
    margin-bottom: 0.75rem;
}
.cs-budget-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 0.25rem 0;
    font-size: 0.85rem;
}
.cs-budget-row span    { color: #94A3B8; }
.cs-budget-row strong  { color: #F8FAFC; font-weight: 700; }
.cs-budget-row + .cs-budget-row { border-top: 1px solid rgba(255,255,255,0.06); }

/* ─── Auto-stop hint ───────────────────────────────────────────── */
.cs-auto-stop-hint {
    position: relative; z-index: 1;
    display: flex; align-items: flex-start; gap: 0.5rem;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.20);
    color: #FDE68A;
    border-radius: 12px;
    padding: 0.625rem 0.875rem;
    font-size: 0.8rem;
    line-height: 1.45;
}

/* ─── Big stop button (full-width below the hero) ──────────────── */
.cs-stop-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 1.1rem 1rem;
    background: linear-gradient(135deg, #DC2626 0%, #991B1B 100%);
    color: #FFF;
    border: none;
    border-radius: 18px;
    font-size: 1.05rem; font-weight: 800; letter-spacing: 0.02em;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.30);
    transition: transform 0.06s, box-shadow 0.15s;
}
.cs-stop-btn:hover:not(:disabled) {
    box-shadow: 0 10px 28px rgba(220, 38, 38, 0.40);
}
.cs-stop-btn:active:not(:disabled) { transform: scale(0.98); }
.cs-stop-btn:disabled { opacity: 0.6; cursor: wait; }
.cs-stop-btn .ti-loader-2 { animation: csSpin 1s linear infinite; }
@keyframes csSpin {
    to { transform: rotate(360deg); }
}

/* ─── Paused state ─────────────────────────────────────────────── */
.cs-hero.cs-paused {
    /* Slightly dimmed gradient — clear visual distinction from active. */
    background: linear-gradient(160deg, #0F172A 0%, #475569 60%, #0F172A 100%);
}
.cs-hero.cs-paused::before { animation: none; opacity: 0.3; }
.cs-hero.cs-paused .cs-ring { opacity: 0.55; }
.cs-hero.cs-paused .cs-ring-inner .cs-cost { color: #CBD5E1; }
.cs-paused-pill {
    background: rgba(251, 191, 36, 0.15) !important;
    color: #FCD34D !important;
    border-color: rgba(251, 191, 36, 0.35) !important;
}
.cs-paused-pill .cs-live-dot {
    background: #F59E0B;
    animation: none;
    box-shadow: none;
}

/* ─── Action button group (pause/resume + stop) ────────────────── */
.cs-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}
.cs-pause-btn,
.cs-stop-btn {
    width: 100%;
    padding: 1.1rem 0.75rem;
    border: none;
    border-radius: 18px;
    font-size: 1rem; font-weight: 800; letter-spacing: 0.02em;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    transition: transform 0.06s, box-shadow 0.15s, opacity 0.15s;
}
.cs-pause-btn {
    background: linear-gradient(135deg, #1F2937 0%, #0F172A 100%);
    color: #F8FAFC;
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
}
.cs-pause-btn:hover:not(:disabled) {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
}
.cs-pause-btn.cs-resume {
    background: linear-gradient(135deg, #16A34A 0%, #15803D 100%);
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.30);
}
.cs-pause-btn.cs-resume:hover:not(:disabled) {
    box-shadow: 0 10px 28px rgba(22, 163, 74, 0.40);
}
.cs-pause-btn:active:not(:disabled),
.cs-stop-btn:active:not(:disabled) { transform: scale(0.98); }
.cs-pause-btn:disabled,
.cs-stop-btn:disabled { opacity: 0.6; cursor: wait; }
.cs-pause-btn .ti-loader-2,
.cs-stop-btn  .ti-loader-2 { animation: csSpin 1s linear infinite; }

/* When stop button is in the action grid, drop its top-margin so the grid
   gap controls spacing (the standalone version on its own keeps margin). */
.cs-actions > .cs-stop-btn { margin-top: 0; }

/* ─── Plug-detection gate (before charge) ──────────────────────── */
.plug-gate {
    display: flex; align-items: flex-start; gap: 0.875rem;
    background: linear-gradient(135deg, #FEF3C7 0%, #FFFBEB 100%);
    border: 2px dashed #F59E0B;
    border-radius: 16px;
    padding: 1rem 1.125rem;
    margin-bottom: 1rem;
    animation: plugGateAppear 0.3s ease-out;
}
@keyframes plugGateAppear {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.plug-gate-icon {
    font-size: 2rem; line-height: 1;
    animation: plugGateBob 1.6s ease-in-out infinite;
}
@keyframes plugGateBob {
    0%, 100% { transform: translateY(0) rotate(-8deg); }
    50%      { transform: translateY(-3px) rotate(8deg); }
}
.plug-gate-body { flex: 1; color: #92400E; }
.plug-gate-body strong { display: block; font-size: 1rem; font-weight: 700; }
.plug-gate-body p {
    margin: 0.25rem 0 0.5rem;
    font-size: 0.85rem; color: #78350F;
}
.plug-gate-spinner {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(245, 158, 11, 0.15);
    color: #92400E;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem; font-weight: 600;
}
.plug-gate-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #D97706;
    animation: plugDotBounce 1.4s ease-in-out infinite;
}
.plug-gate-dot:nth-child(2) { animation-delay: 0.16s; }
.plug-gate-dot:nth-child(3) { animation-delay: 0.32s; }
@keyframes plugDotBounce {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50%      { opacity: 1.0; transform: translateY(-3px); }
}

/* Warning variant of the EVSE pill — shown when picked EVSE not plugged. */
.evse-pill-warn {
    background: #FEE2E2 !important;
    color: #991B1B !important;
}

/* ─── SoC chip (secondary KPI under cost ring) ─────────────────── */
.cs-soc-chip {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 0.5rem;
    margin: 0 auto 0.875rem;
    padding: 0.5rem 1rem;
    background: rgba(34, 197, 94, 0.10);
    border: 1px solid rgba(34, 197, 94, 0.30);
    border-radius: 999px;
    color: #BBF7D0;
    font-size: 0.875rem;
    width: fit-content;
    /* Slight pulse when delta updates so the customer sees the battery
       gaining ground in real time. Drives "feels alive" feeling. */
    animation: socAppear 0.4s ease-out;
}
@keyframes socAppear {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cs-soc-icon { font-size: 1.1rem; line-height: 1; }
.cs-soc-text {
    display: inline-flex; align-items: center; gap: 0.4rem;
    color: #DCFCE7;
}
.cs-soc-text strong { color: #FFFFFF; font-weight: 700; }
.cs-soc-arrow { color: #86EFAC; font-weight: 700; opacity: 0.8; }
.cs-soc-delta {
    margin-left: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.78rem; font-weight: 700;
}
.cs-soc-delta.up {
    background: #22C55E;
    color: #052E16;
}

/* ═══════════════════════════════════════════════════════════════════
   Wallet Dashboard / Topup / History pages
   Shares PublicLayout's .public-shell wrapper. Mobile-first 480px max.
   ═══════════════════════════════════════════════════════════════════ */

.wallet-hero {
    background: linear-gradient(135deg, #FD853A 0%, #C45B1C 100%);
    color: #FFF;
    border-radius: 22px;
    padding: 1.25rem 1.5rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 12px 28px rgba(196, 91, 28, 0.30);
    position: relative;
    overflow: hidden;
}
.wallet-hero::before {
    /* subtle decorative orb */
    content: ""; position: absolute; right: -30%; top: -50%;
    width: 70%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 65%);
    pointer-events: none;
}
.wallet-hero-head {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: space-between;
}
.wallet-hero-label {
    font-size: 0.85rem; letter-spacing: 0.04em; opacity: 0.9;
    font-weight: 600;
}
.wallet-logout {
    background: rgba(255,255,255,0.15);
    color: #FFF;
    border: none;
    border-radius: 50%;
    width: 36px; height: 36px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.wallet-logout:hover { background: rgba(255,255,255,0.25); }
.wallet-balance {
    font-size: 2.6rem; font-weight: 800; letter-spacing: -0.02em;
    margin: 0.5rem 0 0.25rem;
    position: relative; z-index: 1;
    line-height: 1;
}
.wallet-balance-breakdown {
    position: relative; z-index: 1;
    display: flex; gap: 0.875rem; flex-wrap: wrap;
    font-size: 0.85rem; opacity: 0.95;
    margin-top: 0.625rem;
}
.wallet-balance-breakdown span { display: inline-flex; align-items: center; gap: 0.3rem; }
.wallet-held { opacity: 0.85; }

.wallet-cta {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    width: 100%; padding: 1rem;
    background: var(--color-card);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    border-radius: 14px;
    font-size: 1rem; font-weight: 700;
    text-decoration: none;
    transition: background 0.15s, transform 0.05s;
    margin-bottom: 1rem;
}
.wallet-cta:hover { background: rgba(253, 133, 58, 0.08); }
.wallet-cta:active { transform: scale(0.98); }
.wallet-cta.primary {
    background: var(--color-primary);
    color: #FFF;
    box-shadow: 0 6px 16px rgba(253, 133, 58, 0.30);
}
.wallet-cta.primary:hover { background: var(--color-primary-dark); }

.wallet-active {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 1rem 1.125rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.wallet-active-head {
    display: flex; align-items: center; gap: 0.625rem;
    margin-bottom: 0.75rem;
}
.wallet-active-pill {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: rgba(34, 197, 94, 0.10);
    color: #15803D;
    border: 1px solid rgba(34, 197, 94, 0.25);
    padding: 0.2rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem; font-weight: 700;
}
.wallet-active-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #22C55E;
    animation: walletDot 1.6s ease-in-out infinite;
}
@keyframes walletDot {
    50% { transform: scale(1.4); opacity: 0.7; }
}
.wallet-active-station {
    color: var(--color-text-muted); font-size: 0.85rem;
    flex: 1; text-align: right;
}
.wallet-active-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem;
    text-align: center;
}
.wallet-active-stats .num {
    font-size: 1.15rem; font-weight: 700; color: var(--color-text);
}
.wallet-active-stats .lbl {
    font-size: 0.7rem; color: var(--color-text-muted);
    margin-top: 0.125rem;
}

.wallet-section {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 1rem 1.125rem 0.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.wallet-section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.5rem;
}
.wallet-section-head h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.wallet-link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.85rem; font-weight: 600;
}

.wallet-tx-list { display: flex; flex-direction: column; }
.wallet-tx {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--color-border);
}
.wallet-tx:last-child { border-bottom: none; }
.wallet-tx-icon {
    font-size: 1.25rem; line-height: 1;
    flex-shrink: 0; width: 36px; text-align: center;
}
.wallet-tx-body { flex: 1; min-width: 0; }
.wallet-tx-title { font-weight: 600; font-size: 0.92rem; color: var(--color-text); }
.wallet-tx-time  { font-size: 0.75rem; color: var(--color-text-muted); }
.wallet-tx-desc  {
    font-size: 0.78rem; color: var(--color-text-muted);
    margin-top: 0.125rem; word-break: break-word;
}
.wallet-tx-amt {
    font-weight: 700; font-size: 0.95rem;
    flex-shrink: 0; text-align: right;
}
.wallet-tx.tx-topup .wallet-tx-amt  { color: #16A34A; }
.wallet-tx.tx-deduct .wallet-tx-amt { color: #DC2626; }
.wallet-tx.tx-refund .wallet-tx-amt { color: #2563EB; }
.wallet-tx.tx-info .wallet-tx-amt   { color: var(--color-text-muted); }

.wallet-empty {
    padding: 1rem; text-align: center;
    color: var(--color-text-muted); font-size: 0.875rem;
}

.wallet-foot-nav {
    display: flex; gap: 0.5rem;
    padding: 0.5rem;
    margin-top: 1rem;
}
.wallet-foot-nav a {
    flex: 1; padding: 0.75rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    text-align: center; text-decoration: none;
    color: var(--color-text); font-weight: 600; font-size: 0.875rem;
}
.wallet-foot-nav a:hover { background: var(--color-bg); }

.wallet-back {
    display: inline-block; margin-bottom: 0.5rem;
    color: var(--color-primary);
    text-decoration: none; font-size: 0.875rem; font-weight: 600;
}

/* ─── SoC ring inner (primary KPI now) ──────────────────────────── */
.cs-soc-num {
    font-size: 3.4rem; font-weight: 800; letter-spacing: -0.02em;
    color: #FFF; line-height: 1;
}
.cs-soc-pct { font-size: 1.4rem; font-weight: 600; opacity: 0.85; }
.cs-soc-sub {
    font-size: 0.85rem; color: #94A3B8;
    margin-top: 0.25rem; letter-spacing: 0.05em;
}
.cs-soc-delta-pill {
    display: inline-flex; align-items: center; gap: 0.3rem;
    margin-top: 0.5rem;
    background: rgba(34, 197, 94, 0.12);
    color: #DCFCE7;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
}
.cs-soc-delta-pill strong { color: #FFF; font-weight: 700; }
.cs-soc-delta-pill .cs-soc-arrow { color: #86EFAC; opacity: 0.8; }
.cs-soc-delta-pill .cs-soc-up {
    margin-left: 0.25rem;
    background: #22C55E;
    color: #052E16;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.72rem;
}

/* ─── Cost progress bar (secondary KPI now) ─────────────────────── */
.cs-cost-bar-wrap {
    position: relative; z-index: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 0.625rem 0.875rem;
    margin: 0 0 0.75rem;
}
.cs-cost-bar-row {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 0.85rem;
}
.cs-cost-bar-label { color: #94A3B8; }
.cs-cost-bar-value { color: #F8FAFC; font-weight: 700; }
.cs-cost-bar-of    { color: #94A3B8; font-weight: 500; font-size: 0.78rem; }
.cs-cost-bar-track {
    margin-top: 0.4rem;
    height: 8px; border-radius: 999px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}
.cs-cost-bar-fill {
    height: 100%;
    transition: width 0.6s ease, background 0.3s;
    border-radius: 999px;
}

/* ─── Active session card as link (clickable resume) ──────────── */
.wallet-active-link {
    display: block; text-decoration: none; color: inherit;
    transition: transform 0.05s, box-shadow 0.15s;
    cursor: pointer;
}
.wallet-active-link:hover { box-shadow: 0 8px 22px rgba(15,23,42,0.10); }
.wallet-active-link:active { transform: scale(0.99); }
.wallet-active-resume {
    margin-left: auto;
    color: var(--color-primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ─── PIN upsell card (Done screen — claim guest wallet) ────── */
.pin-upsell {
    display: flex; gap: 0.875rem;
    background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
    border: 2px dashed var(--color-primary);
    margin-top: 1rem;
    animation: pinUpsellAppear 0.4s ease-out;
}
@keyframes pinUpsellAppear {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.pin-upsell-icon {
    font-size: 2.4rem; line-height: 1;
    flex-shrink: 0;
    animation: pinUpsellPulse 2s ease-in-out infinite;
}
@keyframes pinUpsellPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.06); }
}
.pin-upsell-body { flex: 1; }
.pin-upsell-body strong { display: block; font-size: 1rem; color: var(--color-primary-dark); }
.pin-upsell-body p {
    margin: 0.4rem 0 0.75rem;
    font-size: 0.875rem; color: #78350F;
}
.pin-upsell-body p code {
    background: rgba(196, 91, 28, 0.10);
    padding: 0.05rem 0.35rem; border-radius: 4px;
    color: var(--color-primary-dark);
    font-weight: 600;
}
.pin-upsell-body .btn { width: 100%; }
