/* System Mode Switcher */
.system-mode-bar{display:flex;justify-content:flex-end;margin:0 0 14px}
.system-mode-manual{appearance:none;border:0;border-radius:999px;min-height:42px;padding:0 16px;background:#fff;color:#0f172a;box-shadow:0 10px 28px rgba(15,23,42,.10);border:1px solid #e2e8f0;font:900 13px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;cursor:pointer;display:inline-flex;align-items:center;gap:8px;transition:.18s ease}
.system-mode-manual:hover{transform:translateY(-1px);box-shadow:0 14px 34px rgba(15,23,42,.14)}
.system-mode-dot{width:9px;height:9px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.12)}
.system-mode-manual.offline-mode .system-mode-dot{background:#f59e0b;box-shadow:0 0 0 4px rgba(245,158,11,.13)}
.system-mode-overlay{position:fixed;inset:0;z-index:2147483000;display:none;align-items:center;justify-content:center;padding:18px;background:rgba(15,23,42,.46);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
.system-mode-overlay.open{display:flex}
.system-mode-card{position:relative;width:min(390px,100%);border-radius:28px;background:rgba(255,255,255,.98);box-shadow:0 34px 90px rgba(15,23,42,.30);border:1px solid rgba(226,232,240,.9);padding:34px 24px 24px;text-align:center;animation:systemModeIn .2s ease-out}
@keyframes systemModeIn{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:none}}
.system-mode-close{position:absolute;right:13px;top:13px;width:36px;height:36px;border:0;border-radius:50%;background:#f1f5f9;color:#334155;font-size:22px;line-height:1;cursor:pointer;display:grid;place-items:center}
.system-mode-icon{width:68px;height:68px;margin:0 auto 15px;border-radius:22px;display:grid;place-items:center;font-size:30px;background:linear-gradient(135deg,#fff7ed,#ffedd5);box-shadow:inset 0 0 0 1px #fed7aa}
.system-mode-overlay.recovered .system-mode-icon{background:linear-gradient(135deg,#ecfdf5,#dcfce7);box-shadow:inset 0 0 0 1px #bbf7d0}
.system-mode-title{margin:0 0 20px;color:#0f172a;font:1000 23px/1.15 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:-.025em}
.system-mode-actions{display:grid;gap:10px}
.system-mode-primary,.system-mode-secondary{min-height:48px;border:0;border-radius:16px;padding:0 16px;font:900 14px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;cursor:pointer}
.system-mode-primary{background:linear-gradient(135deg,#0f172a,#2563eb);color:#fff;box-shadow:0 12px 26px rgba(37,99,235,.22)}
.system-mode-secondary{background:#f1f5f9;color:#334155;border:1px solid #e2e8f0}
@media(max-width:640px){.system-mode-bar{margin-top:-2px}.system-mode-manual{width:100%;justify-content:center}.system-mode-overlay{padding:12px}.system-mode-card{border-radius:23px;padding:31px 17px 18px}.system-mode-title{font-size:21px}}

/* Dashboard always-available Online / Offline lever */
.system-mode-dashboard-toggle{display:inline-flex;align-items:center;gap:8px;min-height:34px;padding:0 10px;border:1px solid #e2e8f0;border-radius:999px;background:#fff;box-shadow:0 5px 16px rgba(15,23,42,.08);cursor:pointer;user-select:none;font:900 10px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:.04em;color:#64748b}
.system-mode-dashboard-toggle input{position:absolute;opacity:0;pointer-events:none}
.system-mode-dashboard-track{position:relative;width:42px;height:22px;border-radius:999px;background:#f59e0b;box-shadow:inset 0 0 0 1px rgba(15,23,42,.08);transition:.18s ease;flex:none}
.system-mode-dashboard-knob{position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 2px 6px rgba(15,23,42,.28);transition:.18s ease}
.system-mode-dashboard-toggle input:checked + .system-mode-dashboard-track{background:#22c55e}
.system-mode-dashboard-toggle input:checked + .system-mode-dashboard-track .system-mode-dashboard-knob{transform:translateX(20px)}
.system-mode-dashboard-toggle:focus-within{outline:3px solid rgba(37,99,235,.18);outline-offset:2px}
.system-mode-dashboard-toggle.is-online .system-mode-dashboard-label:last-child{color:#047857}
.system-mode-dashboard-toggle.is-offline .system-mode-dashboard-label:first-child{color:#c2410c}
@media(max-width:640px){.system-mode-dashboard-toggle{padding:0 8px;gap:6px}.system-mode-dashboard-label{font-size:9px}.system-mode-dashboard-track{width:38px;height:20px}.system-mode-dashboard-knob{width:14px;height:14px}.system-mode-dashboard-toggle input:checked + .system-mode-dashboard-track .system-mode-dashboard-knob{transform:translateX(18px)}}


/* Mobile: keep the original pre-switcher experience. */
@media(max-width:768px){
  .system-mode-overlay,
  .system-mode-bar,
  .system-mode-manual,
  .system-mode-dashboard-toggle,
  [data-internet-status]{display:none!important}
}
