/* ================================================================
   MID Sign Control — Fuel Pro
   Palette: Deep Navy + Amber  |  Mobile App Shell
   Skill: ui-ux-pro-max  |  Font: Plus Jakarta Sans
   ================================================================ */

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

@font-face {
    font-family: 'Digital7';
    src: url('/font/digital-7.ttf') format('truetype');
    font-weight: normal; font-style: normal;
}

/* ===== DESIGN TOKENS ===== */
:root {
    --bg:           #0c0e1a;
    --text:         #f1f5f9;
    --text-2:       #94a3b8;
    --muted:        #64748b;

    /* Surfaces (dark → mid) */
    --s1:  rgba(18,  23,  40, .92);  /* cards */
    --s2:  rgba(26,  33,  55, .80);  /* inner sections */
    --s3:  rgba(255,255,255,.05);    /* hover */

    /* Borders */
    --b1:  rgba(255,255,255,.07);
    --b2:  rgba(255,255,255,.13);
    --b3:  rgba(255,255,255,.22);

    /* Blue — primary accent */
    --amber:      #3b82f6;
    --amber-hi:   #60a5fa;
    --amber-soft: rgba(59,130,246,.12);
    --amber-glow: rgba(59,130,246,.35);
    --amber-btn:  linear-gradient(135deg, #1e40af 0%, #2563eb 40%, #3b82f6 100%);

    /* Blue alias (kept for backwards compat) */
    --blue:       #3b82f6;
    --blue-soft:  rgba(59,130,246,.12);

    /* Status */
    --ok:         #10b981;
    --ok-soft:    rgba(16,185,129,.10);
    --danger:     #ef4444;
    --danger-soft:rgba(239,68,68,.10);
    --warn:       #f59e0b;
    --warn-soft:  rgba(245,158,11,.10);
}

/* ================================================================
   BASE
   ================================================================ */
body.page-login,
body.page-dash,
body.page-edit {
    background:
        radial-gradient(ellipse 75% 55% at -8% -8%,  rgba(59,130,246,.22) 0%, transparent 58%),
        radial-gradient(ellipse 60% 48% at 108% 108%, rgba(37,99,235,.22)  0%, transparent 54%),
        var(--bg);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    min-height: 100dvh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body.page-login *,
body.page-dash  *,
body.page-edit  * { box-sizing: border-box; }

/* thin, unobtrusive scrollbar */
body.page-edit ::-webkit-scrollbar { width: 4px; }
body.page-edit ::-webkit-scrollbar-track { background: transparent; }
body.page-edit ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

body.page-login { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
body.page-dash  { display: flex; flex-direction: column; align-items: center; padding: 20px 14px; }
body.page-edit  { display: flex; flex-direction: column; align-items: center; }

/* ===== KEYFRAMES ===== */
@keyframes fadeUp  { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:none; } }
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes spin    { to { transform:rotate(360deg); } }
@keyframes shake   { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-7px)} 40%,80%{transform:translateX(7px)} }
@keyframes slideUp { from { opacity:0; transform:translateY(22px); } to { opacity:1; transform:none; } }
@keyframes flashBorder {
    0%,100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); }
    40%,60% { box-shadow: 0 0 0 3px rgba(59,130,246,.45); }
}

.shake     { animation: shake .38s ease; }
.highlight { animation: flashBorder .5s ease; }

/* ================================================================
   LOGIN PAGE
   ================================================================ */

.login-wrap { width:100%; max-width:400px; animation: fadeUp .4s ease; }

/* Brand */
.login-brand { text-align:center; margin-bottom:28px; }
.brand-logo {
    width:56px; height:56px; border-radius:18px;
    background: linear-gradient(145deg, #1e40af, #2563eb, #3b82f6);
    border:1px solid rgba(255,255,255,.25);
    display:flex; align-items:center; justify-content:center;
    margin:0 auto 16px;
    box-shadow: 0 8px 32px rgba(59,130,246,.45), 0 2px 0 rgba(255,255,255,.2) inset;
}
.brand-logo svg { width:26px; height:26px; color:#fff; stroke-width:2; }
.brand-title { font-size:22px; font-weight:800; letter-spacing:-.5px; color:var(--text); }
.brand-sub   { font-size:12.5px; color:var(--muted); margin-top:4px; }

/* Card */
.login-card {
    background: rgba(16,20,38,.92);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid var(--b2);
    border-top-color: var(--b3);
    border-radius: 24px;
    padding: 30px 28px;
    box-shadow: 0 2px 0 rgba(255,255,255,.07) inset, 0 32px 80px rgba(0,0,0,.6);
}

/* Alert */
.alert-box {
    display:flex; align-items:flex-start; gap:10px;
    padding:12px 14px; border-radius:12px; font-size:13.5px; margin-bottom:20px;
    background: rgba(239,68,68,.10); border:1px solid rgba(239,68,68,.24); color:#fca5a5;
    animation: fadeUp .25s ease;
}
.alert-box svg { flex-shrink:0; margin-top:1px; width:16px; height:16px; }

/* Fields */
.field-group  { margin-bottom:18px; }
.field-label  { display:block; font-size:11px; font-weight:700; color:var(--text-2); margin-bottom:8px; text-transform:uppercase; letter-spacing:.8px; }
.field-wrap   { position:relative; display:flex; align-items:center; }
.field-icon   { position:absolute; left:14px; width:16px; height:16px; color:var(--muted); pointer-events:none; }

.field-wrap input {
    width:100%;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--b2);
    border-radius:13px; color:var(--text); font-size:15px; font-family:inherit;
    padding:14px 46px 14px 44px; outline:none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.field-wrap input::placeholder { color:rgba(100,116,139,.6); }
.field-wrap input:hover  { border-color:var(--b3); }
.field-wrap input:focus  {
    border-color:var(--amber);
    background: rgba(255,255,255,.07);
    box-shadow: 0 0 0 3px rgba(59,130,246,.15), 0 0 18px rgba(59,130,246,.08);
}
.field-wrap input.error  { border-color:var(--danger); box-shadow:0 0 0 3px rgba(239,68,68,.15); }

.field-toggle { position:absolute; right:10px; background:none; border:none; padding:8px; cursor:pointer; color:var(--muted); display:flex; align-items:center; transition:color .15s; }
.field-toggle:hover { color:var(--text-2); }
.field-hint { font-size:12px; color:var(--danger); margin-top:5px; display:none; }
.field-hint.visible { display:block; animation:fadeUp .2s ease; }

/* Remember me */
.remember-row {
    display:flex; align-items:center; gap:9px;
    font-size:13px; color:var(--text-2); cursor:pointer;
    margin-bottom:4px; user-select:none;
}
.remember-row input[type="checkbox"] {
    width:16px; height:16px; accent-color:var(--amber);
    cursor:pointer; flex-shrink:0;
}

/* Sign-in button */
.btn-signin {
    width:100%;
    background: var(--amber-btn);
    color:#fff; border:1px solid rgba(255,255,255,.18); border-radius:14px;
    font-size:15px; font-weight:700; font-family:inherit;
    padding:14px; cursor:pointer; min-height:52px; margin-top:12px;
    display:flex; align-items:center; justify-content:center; gap:8px;
    transition: opacity .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 2px 0 rgba(255,255,255,.2) inset, 0 6px 28px rgba(59,130,246,.45);
    letter-spacing:.2px;
}
.btn-signin:hover    { opacity:.92; box-shadow:0 2px 0 rgba(255,255,255,.2) inset, 0 8px 36px rgba(59,130,246,.6); }
.btn-signin:active   { transform:scale(.98); }
.btn-signin:disabled { opacity:.4; cursor:not-allowed; transform:none; }

.spinner { width:16px; height:16px; border:2.5px solid rgba(255,255,255,.3); border-top-color:#fff; border-radius:50%; animation:spin .7s linear infinite; display:none; }

.login-footer { text-align:center; font-size:11.5px; color:rgba(100,116,139,.5); margin-top:22px; }

/* ================================================================
   DASHBOARD  (body.page-dash)
   ================================================================ */

.dash-wrap { width:min(100%, 460px); }

/* Snapshot button */
.btn-snap {
    display:flex; align-items:center; gap:6px;
    padding:8px 14px; border-radius:10px;
    border:1px solid var(--b2); background:rgba(255,255,255,.06);
    color:var(--text-2); font-size:12px; font-weight:500; font-family:inherit;
    cursor:pointer; white-space:nowrap; flex-shrink:0; min-height:44px;
    transition: background .2s, border-color .2s, color .2s;
}
.btn-snap:hover:not(:disabled) { background:var(--amber-soft); border-color:rgba(59,130,246,.4); color:var(--amber-hi); }
.btn-snap:disabled { opacity:.3; cursor:not-allowed; }
.btn-snap svg { width:13px; height:13px; }

/* Main card */
.dash-card {
    background: rgba(14,18,34,.94);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border:1px solid var(--b2); border-top-color:var(--b3);
    border-radius:24px; overflow:hidden;
    box-shadow: 0 2px 0 rgba(255,255,255,.06) inset, 0 28px 70px rgba(0,0,0,.55);
}

/* Station hero */
.station-hero {
    padding:20px 22px 16px;
    border-bottom:1px solid var(--b1);
    background: linear-gradient(160deg, rgba(59,130,246,.08) 0%, transparent 55%);
    position:relative;
}
.station-hero::after {
    content:''; position:absolute; top:0; left:15%; right:15%; height:1px;
    background: linear-gradient(90deg, transparent, rgba(59,130,246,.5), transparent);
}
.sh-brand         { text-align:center; margin-bottom:14px; display:flex; align-items:center; justify-content:center; gap:8px; }
.sh-brand-label   { font-size:22px; font-weight:800; letter-spacing:-.4px; color:var(--text); }
.sh-help-btn      { display:flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%; background:rgba(255,255,255,.07); border:1px solid var(--b2); color:var(--muted); text-decoration:none; transition:background .15s,color .15s,border-color .15s; flex-shrink:0; }
.sh-help-btn:hover { background:rgba(59,130,246,.15); border-color:rgba(59,130,246,.35); color:var(--amber); }
.station-name-row { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.station-name     { font-size:18px; font-weight:700; color:var(--text); line-height:1.2; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.station-location { display:flex; align-items:center; gap:5px; font-size:12px; color:var(--muted); margin-top:4px; overflow:hidden; }
.station-location svg  { width:12px; height:12px; flex-shrink:0; color:var(--amber); opacity:.7; }
.station-location span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }

/* LED fuel prices */
.fuel-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:1px; background:var(--b1); border-bottom:1px solid var(--b1); }
.fuel-cell { background:#000; padding:18px 10px; text-align:center; }
.fuel-label { font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.9px; color:rgba(120,135,165,.75); margin-bottom:8px; }
.fuel-price {
    font-family:'Digital7','Courier New',monospace;
    font-size:46px; font-weight:normal; letter-spacing:3px; line-height:1;
    color:#ff2828;
    text-shadow: 0 0 4px #ff8080, 0 0 10px #ff2828, 0 0 22px rgba(255,40,40,.75), 0 0 50px rgba(255,20,20,.45), 0 0 80px rgba(200,0,0,.25);
}
.fuel-cents {
    font-family:'Digital7','Courier New',monospace;
    font-size:12px; vertical-align:top; line-height:1; letter-spacing:2px; opacity:.8;
    color:#ff2828; text-shadow:0 0 8px rgba(255,50,50,.7);
}

/* Settings list */
.dash-settings { padding:0; list-style:none; margin:0; border-bottom:1px solid var(--b1); }
.dash-settings li { display:flex; align-items:center; justify-content:space-between; padding:12px 22px; border-bottom:1px solid var(--b1); font-size:13.5px; gap:12px; min-height:50px; transition:background .15s; }
.dash-settings li:last-child { border-bottom:none; }
.dash-settings li:hover { background:var(--s3); }
.setting-label { display:flex; align-items:center; gap:9px; color:var(--text-2); flex-shrink:0; }
.setting-label svg { width:14px; height:14px; }
.setting-value { color:var(--text); font-weight:500; text-align:right; }

/* Chips */
.chip { display:inline-flex; align-items:center; gap:5px; padding:4px 11px; border-radius:999px; font-size:12px; font-weight:500; border:1px solid; }
.chip.day    { color:#fde68a; background:rgba(251,191, 36,.09); border-color:rgba(251,191, 36,.25); }
.chip.night  { color:#a5b4fc; background:rgba(165,180,252,.08); border-color:rgba(165,180,252,.22); }
.chip.auto   { color:#6ee7b7; background:rgba( 16,185,129,.08); border-color:rgba( 16,185,129,.22); }
.chip.manual { color:var(--text-2); background:rgba(255,255,255,.05); border-color:var(--b2); }
.chip.tpl    { color:#93c5fd;  background:rgba(147,197,253,.08); border-color:rgba(147,197,253,.22); }

/* Actions */
.dash-actions { padding:16px 22px; display:flex; flex-direction:column; gap:10px; }

.btn-primary-action {
    width:100%; padding:14px;
    background: var(--amber-btn);
    color:#fff; border:1px solid rgba(255,255,255,.18); border-radius:14px;
    font-size:15px; font-weight:700; font-family:inherit; cursor:pointer;
    text-decoration:none; min-height:52px; letter-spacing:.2px;
    display:flex; align-items:center; justify-content:center; gap:8px;
    transition: opacity .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 2px 0 rgba(255,255,255,.18) inset, 0 6px 28px rgba(59,130,246,.4);
}
.btn-primary-action:hover  { opacity:.9; box-shadow:0 2px 0 rgba(255,255,255,.18) inset, 0 8px 36px rgba(59,130,246,.55); color:#fff; text-decoration:none; }
.btn-primary-action:active { transform:scale(.98); }
.btn-primary-action svg    { width:16px; height:16px; }

.btn-liveview-action {
    width:100%; padding:13px;
    background: rgba(255,255,255,.06); color:var(--text-2);
    border:1px solid var(--b2); border-radius:14px;
    font-size:14px; font-weight:600; font-family:inherit; cursor:pointer;
    min-height:48px;
    display:flex; align-items:center; justify-content:center; gap:8px;
    transition: background .2s, border-color .2s, color .2s;
}
.btn-liveview-action:hover:not(:disabled) { background:var(--amber-soft); border-color:rgba(59,130,246,.4); color:var(--amber-hi); }
.btn-liveview-action:disabled { opacity:.3; cursor:not-allowed; }
.btn-liveview-action svg { width:15px; height:15px; }

.btn-secondary-action {
    width:100%; padding:12px;
    background: rgba(239,68,68,.05); color:#fca5a5;
    border:1px solid rgba(239,68,68,.18); border-radius:14px;
    font-size:14px; font-weight:500; font-family:inherit; cursor:pointer;
    text-decoration:none; min-height:46px;
    display:flex; align-items:center; justify-content:center; gap:8px;
    transition: background .2s, border-color .2s, color .2s;
}
.btn-secondary-action:hover { background:rgba(239,68,68,.12); border-color:rgba(239,68,68,.40); color:#fecaca; text-decoration:none; }
.btn-secondary-action svg   { width:15px; height:15px; }

.dash-footer { text-align:center; font-size:11.5px; color:rgba(100,116,139,.45); margin-top:18px; }

/* Snapshot modal */
.snap-modal { position:fixed; inset:0; z-index:9999; background:rgba(0,0,0,.72); display:flex; align-items:center; justify-content:center; padding:16px; backdrop-filter:blur(10px); animation:fadeIn .2s ease; }
.snap-modal.hidden { display:none; }
.snap-modal-card {
    background:rgba(10,13,26,.92); backdrop-filter:blur(28px); -webkit-backdrop-filter:blur(28px);
    border:1px solid var(--b2); border-top-color:var(--b3); border-radius:22px;
    box-shadow:0 32px 80px rgba(0,0,0,.75);
    width:min(900px,96vw); max-height:90vh; display:flex; flex-direction:column;
    animation:slideUp .25s ease;
}
.snap-modal-head { display:flex; align-items:center; justify-content:space-between; padding:14px 18px; border-bottom:1px solid var(--b1); flex-shrink:0; }
.snap-modal-title { font-size:14px; font-weight:600; color:var(--text); display:flex; align-items:center; gap:8px; }
.snap-modal-title svg { width:15px; height:15px; color:var(--muted); }
.snap-modal-body { overflow:auto; padding:16px; min-height:220px; flex:1; }
.snap-close { background:rgba(255,255,255,.05); border:1px solid var(--b2); color:var(--text-2); border-radius:9px; padding:8px 14px; cursor:pointer; font-size:13px; font-family:inherit; min-height:36px; transition:background .15s,color .15s,border-color .15s; }
.snap-close:hover { background:rgba(239,68,68,.1); border-color:rgba(239,68,68,.3); color:#fca5a5; }
.snap-loading { display:flex; align-items:center; gap:14px; padding:28px 12px; font-size:14px; color:var(--text-2); }
.snap-loading .spinner { width:26px; height:26px; border:2.5px solid rgba(255,255,255,.15); border-top-color:var(--amber-hi); border-radius:50%; animation:spin .8s linear infinite; flex-shrink:0; display:block; }
.snap-content img { max-width:100%; height:auto; display:block; margin:auto; border-radius:12px; border:1px solid var(--b2); }

@media (max-width:600px) {
    body.page-dash  { padding:10px; }
    .dash-wrap      { width:100%; }
    .dash-card      { border-radius:20px; }
    .station-hero   { padding:14px 16px; }
    .sh-brand       { margin-bottom:10px; }
    .station-name   { font-size:16px; }
    .fuel-cell      { padding:12px 4px; }
    .fuel-price     { font-size:clamp(26px,9vw,40px); letter-spacing:1px; }
    .fuel-label     { font-size:9px; }
    .dash-settings li { padding:10px 16px; }
    .dash-actions   { padding:14px 16px; }
    .btn-primary-action, .btn-secondary-action { min-height:50px; font-size:15px; }
}

/* ================================================================
   EDIT PRICES  (body.page-edit) — Mobile App Shell
   ================================================================ */

body.page-edit { padding:0; }

/* ── Sticky App Header ── */
.ep-app-header {
    position:sticky; top:0; z-index:100; width:100%;
    background: rgba(10,13,24,.90);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    border-bottom:1px solid var(--b2);
    height:56px; padding:0 14px;
    display:flex; align-items:center; gap:8px;
}
.app-back {
    flex:1; display:flex; align-items:center; justify-content:center; gap:5px;
    padding:7px 10px; color:var(--text-2); font-size:14px; font-weight:600;
    text-decoration:none; min-height:36px; border-radius:10px;
    background: rgba(255,255,255,.06); border:1px solid var(--b2);
    transition: background .15s, border-color .15s, color .15s;
}
.app-back:hover { background:rgba(255,255,255,.11); border-color:var(--b3); color:var(--text); text-decoration:none; }
.app-back svg   { width:16px; height:16px; flex-shrink:0; }
.app-live-btn {
    flex:1; display:flex; align-items:center; justify-content:center; gap:6px;
    padding:7px 10px; min-height:36px; border-radius:10px;
    background: rgba(255,255,255,.06); border:1px solid var(--b2);
    color:var(--text-2); font-size:14px; font-weight:600; font-family:inherit; cursor:pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.app-live-btn:hover:not(:disabled) { background:var(--amber-soft); border-color:rgba(59,130,246,.4); color:var(--amber-hi); }
.app-live-btn:disabled { opacity:.3; cursor:not-allowed; }
.app-live-btn svg { width:15px; height:15px; flex-shrink:0; }
.app-title {
    flex:1; text-align:center; font-size:15px; font-weight:600; color:var(--text);
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:0 4px;
}
.app-save-btn {
    flex:1; display:flex; align-items:center; justify-content:center; gap:6px;
    padding:7px 10px; border-radius:10px; min-height:36px;
    background: var(--amber-btn); color:#fff;
    border:1px solid rgba(255,255,255,.18);
    font-size:14px; font-weight:700; font-family:inherit; cursor:pointer;
    flex-shrink:0; white-space:nowrap;
    box-shadow: 0 2px 0 rgba(255,255,255,.14) inset, 0 2px 10px rgba(59,130,246,.3);
    transition: opacity .2s, transform .15s;
}
.app-save-btn:hover    { opacity:.88; }
.app-save-btn:active   { transform:scale(.97); }
.app-save-btn:disabled { opacity:.4; cursor:not-allowed; transform:none; }
.app-save-btn svg      { width:15px; height:15px; flex-shrink:0; }

/* ── Content area ── */
.ep-page { width:100%; max-width:580px; padding:8px 14px 24px; margin:0 auto; }

/* Station info strip */
.ep-station-hero {
    background: rgba(14,18,34,.90);
    backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px);
    border:1px solid var(--b2); border-radius:18px;
    padding:14px 18px; margin-bottom:10px; position:relative; overflow:hidden;
    box-shadow: 0 2px 0 rgba(255,255,255,.04) inset, 0 4px 18px rgba(0,0,0,.22);
    display:flex; align-items:center; gap:14px;
}
.ep-station-hero::before {
    content:''; position:absolute; top:0; left:0; right:0; height:1px;
    background: linear-gradient(90deg, transparent, rgba(59,130,246,.5), transparent);
}
.ep-sh-icon {
    flex-shrink:0; width:36px; height:36px;
    color:var(--amber); opacity:.85;
}
.ep-sh-text  { display:flex; flex-direction:column; gap:3px; min-width:0; flex:1; }
.ep-sh-name  { font-size:15px; font-weight:700; color:var(--text); }
.ep-sh-loc   { font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ── Section blocks (collapsible) ── */
.section-block {
    background: rgba(14,18,34,.90);
    border:1px solid var(--b2); border-radius:18px; margin-bottom:10px; overflow:hidden;
    box-shadow: 0 2px 0 rgba(255,255,255,.04) inset, 0 4px 18px rgba(0,0,0,.22);
    transition: box-shadow .2s;
}
.section-block[data-open="true"] {
    box-shadow: 0 2px 0 rgba(255,255,255,.04) inset, 0 4px 24px rgba(0,0,0,.28), 0 0 0 1px rgba(59,130,246,.12);
}

.section-head {
    display:flex; align-items:center; gap:9px;
    padding:14px 18px;
    font-size:15px; font-weight:700; color:var(--text);
    cursor:pointer; user-select:none; position:relative;
    transition: background .15s;
    border-bottom:1px solid var(--b1);
}
.section-block[data-open="false"] .section-head { border-bottom-color:transparent; }
.section-head:active { background:var(--s3); }

/* Left accent bar */
.section-head::before {
    content:''; position:absolute; left:0; top:22%; bottom:22%;
    width:3px; border-radius:0 3px 3px 0;
    background: linear-gradient(to bottom, var(--amber-hi), var(--amber));
    opacity:0; transition:opacity .25s;
}
.section-block[data-open="true"] .section-head::before { opacity:1; }

.section-icon    { width:15px; height:15px; color:var(--amber); flex-shrink:0; }
.section-title   { flex:1; }
.section-chevron {
    width:16px; height:16px; color:var(--text-2); flex-shrink:0;
    transition: transform .3s cubic-bezier(.4,0,.2,1), color .2s;
}
.section-block[data-open="false"] .section-chevron { transform:rotate(-90deg); color:var(--muted); }

.section-body {
    overflow:hidden;
    transition: height .32s cubic-bezier(.4,0,.2,1);
}
.section-body-inner { padding:16px 18px; }

.lock-badge {
    display:inline-flex; align-items:center; gap:4px; flex-shrink:0;
    font-size:11px; font-weight:500; color:var(--muted);
    background:rgba(255,255,255,.04); border:1px solid var(--b1);
    border-radius:999px; padding:2px 9px;
}
.lock-badge svg { width:10px; height:10px; }

/* ── Locked section (read-only users) ── */
.section-locked { border-color: var(--b1); }
.section-locked[data-open="true"] { box-shadow: 0 2px 0 rgba(255,255,255,.03) inset, 0 4px 14px rgba(0,0,0,.16); }
.section-locked .section-icon  { color: var(--muted); }
.section-locked .section-head  { color: var(--text-2); }
.section-locked .section-head::before { display: none; }
.section-locked .lock-badge { opacity: .7; }

/* ── Secondary section (Display Settings — lower visual weight) ── */
.section-secondary {
    border-color: var(--b1);
    background: rgba(14,18,34,.70);
    box-shadow: none;
}
.section-secondary[data-open="true"] {
    box-shadow: 0 2px 14px rgba(0,0,0,.16);
}
.section-secondary .section-head {
    padding: 12px 18px;
}
.section-secondary .section-icon { color: var(--amber); }
.section-secondary .section-head::before { background: linear-gradient(to bottom, var(--amber-hi), var(--amber)); }
.section-secondary[data-open="true"] .section-head::before { opacity: .7; }

/* ── PRICE INPUTS ── */
.price-rows { display:flex; flex-direction:column; }
.price-row {
    display:flex; align-items:center; justify-content:space-between;
    padding:16px 0;
    border-bottom:1px solid var(--b1); gap:12px;
}
.price-row:last-child { border-bottom:none; }

/* Fuel type label — italic bold pill */
.price-row-label {
    display:flex; align-items:center; gap:8px;
    padding:7px 11px; border-radius:10px; flex-shrink:0;
}
.pr-dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.pr-fuel-name { font-size:13px; font-weight:800; font-style:italic; letter-spacing:-.2px; white-space:nowrap; }
.price-row-label.regular { color:#34d399; background:rgba(52,211,153,.08); }
.price-row-label.plus    { color:#eab308; background:rgba(234,179,8,.08); }
.price-row-label.premium { color:#93c5fd; background:rgba(147,197,253,.08); }
.price-row-label.regular .pr-dot { background:#34d399; box-shadow:0 0 7px rgba(52,211,153,.65); }
.price-row-label.plus    .pr-dot { background:#eab308; box-shadow:0 0 7px rgba(234,179,8,.65); }
.price-row-label.premium .pr-dot { background:#93c5fd; box-shadow:0 0 7px rgba(147,197,253,.65); }

/* Right side: inputs + preview column */
.price-right { display:flex; align-items:center; gap:14px; }
.price-inputs { display:flex; align-items:center; gap:4px; }
.price-inputs .sep { font-size:22px; font-weight:700; color:var(--muted); line-height:1; padding:0 2px; opacity:.65; }

/* Preview column: label + LED value + delta badge */
.price-preview-wrap {
    display:none; flex-direction:column; align-items:flex-end; gap:3px; min-width:72px;
}
@media(min-width:460px) { .price-preview-wrap { display:flex; } }
.price-current-label {
    font-size:9px; font-weight:700; text-transform:uppercase;
    letter-spacing:.7px; color:var(--muted); opacity:.65;
}
.price-preview {
    font-family:'Digital7','Courier New',monospace;
    font-size:20px; letter-spacing:2px; line-height:1;
    color:#ff3030; opacity:.6;
    text-shadow: 0 0 6px rgba(255,48,48,.4);
    text-align:right; pointer-events:none;
}
.price-delta {
    font-size:11px; font-weight:700; border-radius:6px;
    padding:2px 7px; white-space:nowrap;
    opacity:0; transition:opacity .2s, transform .2s;
    transform:translateY(-2px);
}
.price-delta.up   { color:#ef4444; background:rgba(239,68,68,.14); opacity:1; transform:none; }
.price-delta.down { color:#10b981; background:rgba(16,185,129,.14); opacity:1; transform:none; }
.price-field {
    width:52px; height:52px; background:rgba(0,0,0,.65);
    border:1px solid var(--b2); border-radius:10px;
    color:#ff3030; font-size:29px; font-weight:700;
    text-align:center; outline:none; font-family:inherit;
    transition: border-color .2s, box-shadow .2s;
    -moz-appearance:textfield; cursor:text;
    text-shadow:0 0 8px rgba(255,50,50,.55);
}
.price-field::-webkit-inner-spin-button,
.price-field::-webkit-outer-spin-button { -webkit-appearance:none; }
.price-field:hover { border-color:var(--b3); }
.price-field:focus { border-color:var(--amber); box-shadow:0 0 0 3px rgba(59,130,246,.15), 0 0 14px rgba(255,50,50,.12); }
.price-field.cents  { width:44px; font-size:24px; }
.price-field.invalid { border-color:var(--danger) !important; box-shadow:0 0 0 2px rgba(239,68,68,.2); animation:shake .35s ease; }

/* ── SETTINGS ── */
.settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width:420px) { .settings-grid { grid-template-columns:1fr; } }

.setting-item label { display:block; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.7px; color:var(--text-2); margin-bottom:8px; }

.ep-select {
    width:100%; background:rgba(255,255,255,.05); border:1px solid var(--b2);
    border-radius:11px; color:var(--text); font-size:14px; font-family:inherit;
    padding:11px 14px; outline:none; min-height:46px;
    transition: border-color .2s, box-shadow .2s;
    appearance:auto;
}
.ep-select:focus { border-color:var(--amber); box-shadow:0 0 0 3px rgba(59,130,246,.12); }
.ep-select option { background:#1a2035; }

.auto-badge { display:inline-flex; align-items:center; gap:6px; padding:10px 14px; border-radius:11px; background:rgba(16,185,129,.08); border:1px solid rgba(16,185,129,.22); color:#6ee7b7; font-size:13.5px; font-weight:600; min-height:46px; }
.auto-badge svg { width:14px; height:14px; }

.brightness-wrap { display:flex; flex-direction:column; gap:20px; }
.brightness-label-row { display:flex; align-items:center; justify-content:space-between; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.7px; color:var(--text-2); }
.brightness-val { color:var(--amber); font-weight:700; }

.ep-range { width:100%; -webkit-appearance:none; appearance:none; height:4px; border-radius:4px; background:var(--b2); outline:none; cursor:pointer; accent-color:var(--amber); }
.ep-range::-webkit-slider-thumb { -webkit-appearance:none; width:20px; height:20px; border-radius:50%; background:var(--amber); border:2px solid rgba(255,255,255,.3); box-shadow:0 0 8px rgba(59,130,246,.5); cursor:pointer; transition:transform .15s,box-shadow .15s; }
.ep-range::-webkit-slider-thumb:hover { transform:scale(1.15); box-shadow:0 0 14px rgba(59,130,246,.7); }

/* ── TEMPLATE LIST ── */
.template-list { display:flex; flex-direction:column; gap:8px; }
.template-option {
    display:flex; align-items:center; gap:12px; padding:13px 16px;
    border-radius:12px; border:1.5px solid var(--b2); background:rgba(255,255,255,.04);
    cursor:pointer; transition:border-color .2s,background .2s; min-height:50px;
}
.template-option:hover   { background:rgba(59,130,246,.06); border-color:rgba(59,130,246,.3); }
.template-option.selected { border-color:var(--amber); background:rgba(59,130,246,.08); box-shadow:0 0 0 1px rgba(59,130,246,.15) inset; }
.template-option input[type="radio"] { accent-color:var(--amber); width:16px; height:16px; cursor:pointer; flex-shrink:0; }
.tpl-name { font-size:14px; font-weight:500; color:var(--text); }
.template-option.selected .tpl-name { color:var(--amber-hi); }

/* ── AD CONTROLS ── */
.ep-ad-controls { display:flex; flex-direction:column; gap:14px; }
.ep-switch-wrap { display:flex; align-items:center; gap:10px; font-size:14px; font-weight:500; color:var(--text); min-height:46px; }

.ep-switch { position:relative; display:inline-block; width:44px; height:26px; flex-shrink:0; }
.ep-switch input { opacity:0; width:0; height:0; }
.ep-switch-slider { position:absolute; inset:0; background:rgba(255,255,255,.12); border-radius:26px; border:1px solid var(--b2); cursor:pointer; transition:background .2s,border-color .2s; }
.ep-switch-slider::before { content:''; position:absolute; left:3px; top:50%; transform:translateY(-50%); width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:0 1px 4px rgba(0,0,0,.4); transition:transform .22s cubic-bezier(.4,0,.2,1); }
.ep-switch input:checked + .ep-switch-slider { background:var(--amber); border-color:rgba(59,130,246,.6); }
.ep-switch input:checked + .ep-switch-slider::before { transform:translateY(-50%) translateX(18px); }

.ep-dur-header {
    display:flex; align-items:center; justify-content:space-between;
    margin-bottom:10px;
    font-size:11px; font-weight:700; text-transform:uppercase;
    letter-spacing:.7px; color:var(--text-2);
}
.ep-dur-unit {
    font-size:11px; font-weight:600; color:var(--muted);
    background:rgba(255,255,255,.05); border:1px solid var(--b1);
    border-radius:5px; padding:2px 8px; letter-spacing:.4px; text-transform:none;
}
.ep-duration-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; }
.ep-number-input { display:flex; flex-direction:column; gap:7px; }
.ep-number-input label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.7px; color:var(--text-2); }
.ep-number-input input[type="number"] { width:100%; padding:11px 14px; background:rgba(255,255,255,.05); border:1px solid var(--b2); border-radius:11px; color:var(--text); font-size:14px; font-family:inherit; outline:none; min-height:46px; transition:border-color .2s,box-shadow .2s; -moz-appearance:textfield; }
.ep-number-input input:focus { border-color:var(--amber); box-shadow:0 0 0 3px rgba(59,130,246,.12); }

/* ── MEDIA GRID ── */
.media-grid         { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.media-grid.one-col { grid-template-columns:1fr; }
.media-grid.two-col { grid-template-columns:1fr 1fr; }
.media-card { display:flex; flex-direction:column; gap:8px; }

.mz { position:relative; overflow:hidden; border-radius:12px; aspect-ratio:16/9; background:rgba(255,255,255,.04); border:1.5px dashed var(--b2); cursor:pointer; transition:border-color .2s,background .2s; }
.mz:hover      { border-color:var(--amber); background:rgba(59,130,246,.04); }
.mz.has-media  { border-style:solid; border-color:var(--b2); }
.mz.drag-over  { border-color:var(--amber); background:rgba(59,130,246,.08); }
.mz-file-input { display:none; }

.mz-media       { width:100%; height:100%; object-fit:cover; display:block; }
.mz-media.tall  { aspect-ratio:9/16; }

.mz-overlay { position:absolute; inset:0; background:rgba(0,0,0,.55); display:flex; align-items:center; justify-content:center; gap:8px; opacity:0; transition:opacity .2s; }
.mz:hover .mz-overlay { opacity:1; }
.mz-ov-btn { display:flex; align-items:center; gap:5px; padding:7px 12px; border-radius:8px; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.18); color:#fff; font-size:12px; font-weight:500; font-family:inherit; cursor:pointer; min-height:36px; transition:background .15s; }
.mz-ov-btn:hover { background:rgba(255,255,255,.22); }
.mz-ov-btn svg { width:12px; height:12px; }

.mz-placeholder { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; padding:12px; pointer-events:none; }
.mz-placeholder svg { width:24px; height:24px; color:var(--muted); opacity:.6; }
.mz-placeholder.tall svg { width:30px; height:30px; }
.mz-ph-title { font-size:11px; font-weight:600; color:var(--text-2); text-align:center; }
.mz-ph-hint  { font-size:10px; color:var(--muted); text-align:center; }

.mz-foot { display:flex; flex-direction:column; gap:5px; }
.mz-row  { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.mz-label { font-size:12px; font-weight:500; color:var(--text-2); }
.mz-del { display:flex; align-items:center; gap:5px; font-size:12px; color:var(--danger); cursor:pointer; padding:3px 0; min-height:30px; transition:opacity .15s; }
.mz-del:hover { opacity:.75; }
.mz-del input[type="checkbox"] { accent-color:var(--danger); width:14px; height:14px; }
.mz-del svg { width:12px; height:12px; }

@media (max-width:480px) {
    .media-grid:not(.one-col):not(.two-col) { grid-template-columns:1fr 1fr; }
}

/* ── Sticky Save Bar ── */
/* ep-sticky-bar removed — buttons moved to ep-station-hero */

/* ep-actions — fallback for result page */
.ep-actions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }

.btn-save {
    flex:1; min-height:50px;
    background: var(--amber-btn);
    color:#fff; border:1px solid rgba(255,255,255,.18); border-radius:14px;
    font-size:15px; font-weight:700; font-family:inherit; cursor:pointer;
    text-decoration:none; letter-spacing:.2px;
    display:flex; align-items:center; justify-content:center; gap:8px;
    transition: opacity .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 2px 0 rgba(255,255,255,.18) inset, 0 4px 20px rgba(59,130,246,.4);
}
.btn-save:hover  { opacity:.9; box-shadow:0 2px 0 rgba(255,255,255,.18) inset, 0 6px 28px rgba(59,130,246,.55); color:#fff; text-decoration:none; }
.btn-save:active { transform:scale(.98); }
.btn-save:disabled { opacity:.4; cursor:not-allowed; transform:none; }
.btn-save svg    { width:16px; height:16px; }

.btn-cancel {
    min-height:50px; padding:0 18px;
    background:rgba(255,255,255,.06); border:1px solid var(--b2);
    border-radius:14px; font-size:14px; font-weight:500; font-family:inherit;
    cursor:pointer; text-decoration:none; color:var(--text-2);
    display:flex; align-items:center; justify-content:center; gap:7px;
    transition: background .2s, border-color .2s, color .2s;
}
.btn-cancel:hover { background:rgba(239,68,68,.06); border-color:rgba(239,68,68,.25); color:#fca5a5; text-decoration:none; }
.btn-cancel svg   { width:13px; height:13px; }


.ep-spinner { width:18px; height:18px; border:2.5px solid rgba(255,255,255,.3); border-top-color:#fff; border-radius:50%; animation:spin .7s linear infinite; display:none; flex-shrink:0; }

/* ── Toast ── */
.ep-toast {
    position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(20px);
    z-index:200; background:rgba(18,24,42,.95);
    border:1px solid var(--b2); border-radius:12px;
    padding:11px 18px; font-size:13.5px; font-weight:500; color:var(--text);
    display:flex; align-items:center; gap:8px;
    box-shadow:0 8px 28px rgba(0,0,0,.5);
    opacity:0; pointer-events:none;
    transition: opacity .25s, transform .25s;
    white-space:nowrap;
}
.ep-toast.show { opacity:1; transform:translateX(-50%) translateY(0); }
.ep-toast.success { border-color:rgba(16,185,129,.35); color:#6ee7b7; }
.ep-toast.danger  { border-color:rgba(239,68,68,.35);  color:#fca5a5; }
.ep-toast svg     { width:15px; height:15px; flex-shrink:0; }

/* ── Result Page ── */
.result-page { display:flex; align-items:center; justify-content:center; min-height:calc(100dvh - 56px); padding:16px; }
.result-card {
    background: rgba(14,18,34,.94); border:1px solid var(--b2); border-radius:22px;
    padding:32px 26px; max-width:440px; width:100%; text-align:center;
    box-shadow:0 2px 0 rgba(255,255,255,.04) inset, 0 24px 60px rgba(0,0,0,.5);
    animation:slideUp .3s ease;
}
.result-icon { width:56px; height:56px; border-radius:16px; display:flex; align-items:center; justify-content:center; margin:0 auto 18px; }
.result-icon.success { background:rgba(16,185,129,.10); border:1px solid rgba(16,185,129,.25); }
.result-icon.danger  { background:rgba(239,68,68,.10);  border:1px solid rgba(239,68,68,.25); }
.result-icon.warn    { background:rgba(245,158,11,.10); border:1px solid rgba(245,158,11,.25); }
.result-title { font-size:20px; font-weight:700; margin-bottom:10px; }
.result-msg   { font-size:14px; color:var(--text-2); line-height:1.6; margin-bottom:16px; }
.result-alert { padding:10px 14px; border-radius:10px; text-align:left; font-size:13px; margin-bottom:8px; line-height:1.5; }
.result-alert.danger { background:rgba(239,68,68,.08);  border:1px solid rgba(239,68,68,.22);  color:#fca5a5; }
.result-alert.warn   { background:rgba(245,158,11,.08); border:1px solid rgba(245,158,11,.22); color:#fde68a; }

.section-locked-wrap { border:none; padding:0; margin:0; }
.ad-locked { opacity:.35; pointer-events:none; user-select:none; transition:opacity .2s; }

/* ── Lightbox ── */
.lb { display:none; position:fixed; inset:0; z-index:9999; background:rgba(0,0,0,.88); align-items:center; justify-content:center; backdrop-filter:blur(12px); }
.lb.open { display:flex; animation:fadeIn .2s ease; }
.lb-inner { position:relative; max-width:min(90vw,860px); max-height:90dvh; }
.lb-inner img, .lb-inner video { display:block; max-width:100%; max-height:85dvh; border-radius:14px; border:1px solid var(--b2); }
.lb-close { position:absolute; top:-14px; right:-14px; width:34px; height:34px; background:rgba(18,22,38,.92); border:1px solid var(--b2); border-radius:50%; display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--text-2); padding:0; transition:background .15s,color .15s; }
.lb-close:hover { background:rgba(239,68,68,.15); color:#fca5a5; }
.lb-close svg { width:14px; height:14px; }

@media (max-width:560px) {
    .ep-page            { padding:6px 10px 24px; }
    .section-body-inner { padding:14px; }
    .section-head       { padding:12px 14px; }
    .price-row-label    { min-width:72px; font-size:15px; }
    .price-field        { width:46px; height:46px; font-size:20px; }
    .price-field.cents  { width:40px; font-size:18px; }
    .settings-grid      { grid-template-columns:1fr; }
    .result-card        { padding:24px 18px; }
}

/* ================================================================
   DESKTOP  (>= 768px) — override mobile app shell to proper web UI
   ================================================================ */
@media (min-width: 768px) {

    /* Dashboard — slightly wider */
    .dash-wrap          { max-width:520px; }
    .fuel-cell          { padding:22px 14px; }
    .fuel-price         { font-size:52px; }
    .dash-settings li   { padding:13px 26px; }
    .dash-actions       { padding:18px 26px; }
    .station-hero       { padding:22px 26px 18px; }

    /* Login — wider card */
    .login-wrap         { max-width:420px; }

    /* Edit page — convert sticky bars to floating cards */
    body.page-edit { padding: 16px 24px 48px; }

    /* App header: floating card that sticks at 16px from top */
    .ep-app-header {
        position: sticky;
        top: 16px;
        max-width: 580px;
        width: 100%;
        margin: 0 auto 16px;
        border-radius: 16px;
        border: 1px solid var(--b2);
        height: auto;
        min-height: 52px;
        padding: 8px 14px;
        box-shadow: 0 4px 24px rgba(0,0,0,.35), 0 1px 0 rgba(255,255,255,.06) inset;
    }

    /* Spacious sections */
    .section-head       { padding: 15px 24px; font-size: 15px; }
    .section-secondary .section-head { padding: 12px 24px; }
    .section-body-inner { padding: 20px 24px; }
    .section-block      { border-radius: 20px; margin-bottom: 12px; }

    /* Larger price inputs on desktop */
    .price-row          { padding: 18px 0; }
    .pr-fuel-name       { font-size: 14px; }
    .price-field        { width: 56px; height: 56px; font-size: 25px; }
    .price-field.cents  { width: 48px; font-size: 21px; }
    .price-preview      { font-size: 22px; }

    /* Settings always 2-col on desktop */
    .settings-grid      { grid-template-columns: 1fr 1fr; }

    /* Media grid 3-col on desktop */
    .media-grid:not(.one-col):not(.two-col) { grid-template-columns: repeat(3, 1fr); }

    .ep-toast { bottom: 24px; }

    /* Result page uses full height */
    .result-page { min-height: calc(100dvh - 120px); }
}

/* ================================================================
   THEME TOGGLE BUTTON
   ================================================================ */
.theme-toggle-btn {
    display:flex; align-items:center; justify-content:center;
    width:22px; height:22px; border-radius:50%;
    background:rgba(255,255,255,.07); border:1px solid var(--b2);
    color:var(--muted); cursor:pointer; flex-shrink:0;
    transition: background .15s, color .15s, border-color .15s;
    padding:0;
}
.theme-toggle-btn:hover { background:rgba(59,130,246,.15); border-color:rgba(59,130,246,.35); color:var(--amber); }
.theme-toggle-btn svg { width:12px; height:12px; pointer-events:none; }
.theme-toggle-btn .icon-moon { display:none; }
body.theme-light .theme-toggle-btn .icon-moon { display:block; }
body.theme-light .theme-toggle-btn .icon-sun  { display:none; }

/* ================================================================
   LIGHT THEME
   ================================================================ */
body.theme-light {
    --bg:           #f1f5f9;
    --text:         #0f172a;
    --text-2:       #475569;
    --muted:        #94a3b8;
    --s1:  rgba(255,255,255,.98);
    --s2:  rgba(248,250,252,.95);
    --s3:  rgba(0,0,0,.04);
    --b1:  rgba(0,0,0,.07);
    --b2:  rgba(0,0,0,.13);
    --b3:  rgba(0,0,0,.22);
    --amber:      #2563eb;
    --amber-hi:   #1d4ed8;
    --amber-soft: rgba(37,99,235,.12);
    --amber-glow: rgba(37,99,235,.25);
    --amber-btn:  linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 40%, #2563eb 100%);
    --blue:       #2563eb;
    --blue-soft:  rgba(37,99,235,.12);
    --ok:         #059669;
    --ok-soft:    rgba(5,150,105,.10);
    --danger:     #dc2626;
    --danger-soft:rgba(220,38,38,.10);
    --warn:       #d97706;
    --warn-soft:  rgba(217,119,6,.10);
}

body.theme-light.page-login,
body.theme-light.page-dash,
body.theme-light.page-edit,
body.theme-light.page-help {
    background:
        radial-gradient(ellipse 75% 55% at -8% -8%,  rgba(59,130,246,.08) 0%, transparent 58%),
        radial-gradient(ellipse 60% 48% at 108% 108%, rgba(37,99,235,.08)  0%, transparent 54%),
        var(--bg);
}

/* Cards & surfaces */
body.theme-light .login-card {
    background: rgba(255,255,255,.97);
    box-shadow: 0 2px 0 rgba(255,255,255,.8) inset, 0 16px 50px rgba(0,0,0,.10);
}
body.theme-light .dash-card {
    background: rgba(255,255,255,.97);
    box-shadow: 0 2px 0 rgba(255,255,255,.8) inset, 0 16px 50px rgba(0,0,0,.10);
}
body.theme-light .snap-modal-card {
    background: rgba(255,255,255,.97);
    box-shadow: 0 32px 80px rgba(0,0,0,.18);
}
body.theme-light .ep-app-header   { background: rgba(255,255,255,.92); }
body.theme-light .section-block,
body.theme-light .ep-station-hero,
body.theme-light .section-secondary { background: rgba(255,255,255,.97); box-shadow: 0 2px 0 rgba(255,255,255,.6) inset, 0 4px 18px rgba(0,0,0,.07); }
body.theme-light .section-block[data-open="true"] { box-shadow: 0 2px 0 rgba(255,255,255,.6) inset, 0 4px 24px rgba(0,0,0,.09), 0 0 0 1px rgba(37,99,235,.12); }
body.theme-light .result-card { background: rgba(255,255,255,.97); box-shadow: 0 2px 0 rgba(255,255,255,.6) inset, 0 24px 60px rgba(0,0,0,.10); }
body.theme-light .ep-toast { background: rgba(255,255,255,.97); box-shadow: 0 8px 28px rgba(0,0,0,.15); }

/* Inputs */
body.theme-light .field-wrap input { background: rgba(0,0,0,.04); color: var(--text); }
body.theme-light .field-wrap input:focus { background: rgba(0,0,0,.06); }
body.theme-light .ep-number-input input { background: rgba(0,0,0,.05); color: var(--text); }
body.theme-light .price-field { background: rgba(0,0,0,.05); }
body.theme-light .ep-select { background: rgba(0,0,0,.04); color: var(--text); }
body.theme-light .ep-select option { background: #f8fafc; color: #0f172a; }

/* Controls */
body.theme-light .ep-switch-slider { background: rgba(0,0,0,.18); }
body.theme-light .ep-switch-slider::before { background: #fff; }
body.theme-light .mz { background: rgba(0,0,0,.04); }
body.theme-light .app-back,
body.theme-light .app-live-btn { background: rgba(0,0,0,.06); }
body.theme-light .snap-close { background: rgba(0,0,0,.05); }

/* Help page overrides */
body.theme-light .help-header      { background: rgba(255,255,255,.92); }
body.theme-light .help-header-back { background: rgba(0,0,0,.05); }
body.theme-light .help-toc a       { background: rgba(0,0,0,.04); }
body.theme-light .rotation-slide   { background: rgba(0,0,0,.03); }
body.theme-light .help-card        { background: rgba(0,0,0,.03); }
body.theme-light .help-table .tag  { background: rgba(0,0,0,.06); }

/* Price row labels in light mode */
body.theme-light .price-row-label.regular { color:#059669; background:rgba(5,150,105,.09); }
body.theme-light .price-row-label.plus    { color:#ca8a04; background:rgba(202,138,4,.09); }
body.theme-light .price-row-label.premium { color:#2563eb; background:rgba(37,99,235,.09); }
body.theme-light .price-row-label.regular .pr-dot { background:#059669; box-shadow:0 0 6px rgba(5,150,105,.4); }
body.theme-light .price-row-label.plus    .pr-dot { background:#ca8a04; box-shadow:0 0 6px rgba(202,138,4,.4); }
body.theme-light .price-row-label.premium .pr-dot { background:#2563eb; box-shadow:0 0 6px rgba(37,99,235,.4); }
body.theme-light .price-preview { opacity:.4; }
body.theme-light .price-delta.up   { background:rgba(220,38,38,.12); }
body.theme-light .price-delta.down { background:rgba(5,150,105,.12); }

/* Fuel price grid */
body.theme-light .fuel-grid { background: var(--b1); }
body.theme-light .fuel-cell { background: #e8ecf2; }
body.theme-light .fuel-label { color: rgba(71,85,105,.75); }
body.theme-light .fuel-price {
    text-shadow: 0 0 4px rgba(220,38,38,.35), 0 0 12px rgba(220,38,38,.2);
}
body.theme-light .fuel-cents { text-shadow: none; }

/* Chips — restore contrast on light bg */
body.theme-light .chip.day    { color:#92400e; background:rgba(217,119,6,.12); border-color:rgba(217,119,6,.30); }
body.theme-light .chip.night  { color:#4338ca; background:rgba(99,102,241,.10); border-color:rgba(99,102,241,.28); }
body.theme-light .chip.auto   { color:#065f46; background:rgba(16,185,129,.12); border-color:rgba(16,185,129,.30); }
body.theme-light .chip.manual { color:var(--text-2); background:rgba(0,0,0,.05); border-color:var(--b2); }
body.theme-light .chip.tpl    { color:#1d4ed8; background:rgba(59,130,246,.10); border-color:rgba(59,130,246,.28); }

/* Dashboard action buttons */
body.theme-light .btn-liveview-action { background:rgba(0,0,0,.05); }
body.theme-light .btn-secondary-action { color:#dc2626; background:rgba(220,38,38,.06); border-color:rgba(220,38,38,.20); }
body.theme-light .btn-secondary-action:hover { color:#b91c1c; background:rgba(220,38,38,.12); border-color:rgba(220,38,38,.35); text-decoration:none; }
body.theme-light .dash-footer { color:rgba(71,85,105,.6); }

/* ======================================================
   Quick action icon buttons (index.php dashboard)
   ====================================================== */
.sh-quick-btns {
    display: flex;
    gap: 16px;
    margin-top: 14px;
    justify-content: center;
}
.sh-quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.sh-quick-btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    border: 1px solid var(--b2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.sh-quick-btn:hover .sh-quick-btn-icon,
.sh-quick-btn:focus-visible .sh-quick-btn-icon {
    background: rgba(255,255,255,.13);
    color: var(--text);
    border-color: var(--b3);
}
.sh-quick-btn:active .sh-quick-btn-icon {
    transform: scale(.92);
    transition-duration: .08s;
}
.sh-quick-btn-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--muted);
    text-transform: uppercase;
    line-height: 1;
}

/* ======================================================
   Info modals — price history & activity log
   ====================================================== */
.info-modal {
    position: fixed;
    inset: 0;
    z-index: 600;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
@media (min-width: 480px) {
    .info-modal { align-items: center; padding: 20px; }
}
.info-modal.hidden { display: none; }

.info-modal-card {
    background: var(--s1);
    border: 1px solid var(--b1);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    max-height: 88vh;
    overflow: hidden;
    box-shadow: 0 -4px 40px rgba(0,0,0,.4);
}
@media (min-width: 480px) {
    .info-modal-card { border-radius: 20px; max-height: 80vh; box-shadow: 0 8px 48px rgba(0,0,0,.5); }
}
.info-modal-head {
    display: flex;
    align-items: center;
    padding: 16px 16px 14px;
    border-bottom: 1px solid var(--b1);
    flex-shrink: 0;
}
.info-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
}
.info-modal-title svg { color: var(--amber-hi); flex-shrink: 0; }
.info-modal-close {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--b1);
    color: var(--muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.info-modal-close:hover { background: rgba(255,255,255,.13); color: var(--text); }
.info-modal-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.info-modal-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 0;
    color: var(--muted);
    font-size: 13px;
}
.im-spinner {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.12);
    border-top-color: var(--amber);
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}

/* Price history chart */
.ph-chart-wrap {
    background: var(--s2);
    border: 1px solid var(--b1);
    border-radius: 14px;
    padding: 12px 10px 8px;
    overflow: hidden;
}
.ph-chart-wrap svg { display: block; width: 100%; height: auto; }
.ph-legend {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    justify-content: center;
}
.ph-leg-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-2);
}
.ph-leg-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Price history table */
.ph-table {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--b1);
}
.ph-table-head {
    display: grid;
    grid-template-columns: 1fr 58px 58px 58px;
    background: var(--s3);
    padding: 7px 12px;
    gap: 4px;
}
.ph-table-head span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    text-align: right;
}
.ph-table-head span:first-child { text-align: left; }
.ph-row {
    display: grid;
    grid-template-columns: 1fr 58px 58px 58px;
    padding: 9px 12px;
    gap: 4px;
    border-top: 1px solid var(--b1);
    transition: background .12s;
    align-items: center;
}
.ph-row:hover { background: rgba(255,255,255,.03); }
.ph-row-time { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ph-row-price {
    font-size: 12px;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.ph-row-price.reg  { color: #34d399; }
.ph-row-price.plus { color: #fbbf24; }
.ph-row-price.prem { color: #93c5fd; }
.ph-empty {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    padding: 36px 0;
    opacity: .7;
}

/* Activity log */
.al-list { display: flex; flex-direction: column; gap: 1px; }
.al-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    transition: background .12s;
}
.al-item:hover { background: rgba(255,255,255,.04); }
.al-icon {
    width: 30px; height: 30px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 1px;
}
.al-icon.price { background: rgba(59,130,246,.12); color: #60a5fa; }
.al-icon.visit { background: rgba(148,163,184,.08); color: var(--muted); }
.al-icon.other { background: rgba(147,197,253,.10); color: #93c5fd; }
.al-info { flex: 1; min-width: 0; }
.al-text { font-size: 12px; color: var(--text); line-height: 1.5; word-break: break-word; }
.al-text.dim { color: var(--text-2); font-size: 11px; }
.al-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.al-time { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.al-ip   { font-size: 10px; color: var(--muted); opacity: .5; font-variant-numeric: tabular-nums; }
.al-empty {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    padding: 36px 0;
    opacity: .7;
}

/* Light theme overrides */
body.theme-light .sh-quick-btn-icon {
    background: rgba(0,0,0,.05);
    border-color: var(--b2);
}
body.theme-light .sh-quick-btn:hover .sh-quick-btn-icon {
    background: rgba(0,0,0,.10);
}
body.theme-light .info-modal-close { background: rgba(0,0,0,.05); border-color: var(--b2); }
body.theme-light .info-modal-close:hover { background: rgba(0,0,0,.10); }
body.theme-light .ph-chart-wrap { background: #eef2f7; }
body.theme-light .ph-row:hover { background: rgba(0,0,0,.02); }
body.theme-light .al-item:hover { background: rgba(0,0,0,.03); }
body.theme-light .al-icon.price { background: rgba(37,99,235,.10); color: #2563eb; }
body.theme-light .al-icon.visit { background: rgba(100,116,139,.08); }
body.theme-light .im-spinner { border-color: rgba(0,0,0,.1); border-top-color: var(--amber); }

/* Quick actions standalone block */
.dash-quick-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 14px 16px 16px;
}

/* Fix underline on <a> inside quick buttons */
a.sh-quick-btn,
a.sh-quick-btn:hover { text-decoration: none; }

/* Disabled state for quick buttons (e.g. Live View without device) */
.sh-quick-btn:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }

/* Theme toggle in sh-quick-btns row (index.php) — icon switching via ID */
#themeToggle .icon-moon { display: none; }
body.theme-light #themeToggle .icon-moon { display: block; }
body.theme-light #themeToggle .icon-sun  { display: none; }
