/* eBurst comfort layer — keeps each system's own colors; adds dark mode, calmer focus/hover states and smoother reading.
   html.ebx = loaded; .ebx-own = systems built in-house; .ebx-vendor = Portal, HR, Advocate, Repair Your Devices. */

/* ---------- reading comfort (all systems) ---------- */
html.ebx { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; }
html.ebx { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html.ebx { scroll-behavior: auto; } html.ebx *, html.ebx *::before, html.ebx *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
html.ebx ::selection { background: rgba(59, 130, 246, .22); }
html.ebx :focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
html.ebx [id] { scroll-margin-top: 72px; }
/* slim, quiet scrollbars */
html.ebx * { scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, .45) transparent; }
html.ebx ::-webkit-scrollbar { width: 10px; height: 10px; }
html.ebx ::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .38); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
html.ebx ::-webkit-scrollbar-thumb:hover { background-color: rgba(100, 116, 139, .6); }
html.ebx ::-webkit-scrollbar-track { background: transparent; }

/* ---------- in-house systems: calmer, more consistent controls ---------- */
html.ebx-own body { line-height: 1.55; }
html.ebx-own p, html.ebx-own li { text-wrap: pretty; }
html.ebx-own h1, html.ebx-own h2, html.ebx-own h3 { text-wrap: balance; letter-spacing: -.01em; }
html.ebx-own td, html.ebx-own th { font-variant-numeric: tabular-nums; }
html.ebx-own tbody tr { transition: background-color .12s ease; }
html.ebx-own tbody tr:hover { background-color: rgba(59, 130, 246, .045); }
html.ebx-own input:not([type=checkbox]):not([type=radio]):not([type=range]), html.ebx-own select, html.ebx-own textarea {
  transition: border-color .15s ease, box-shadow .15s ease; }
html.ebx-own input:not([type=checkbox]):not([type=radio]):not([type=range]):focus, html.ebx-own select:focus, html.ebx-own textarea:focus {
  outline: none; box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); }
html.ebx-own input[type=checkbox], html.ebx-own input[type=radio] { accent-color: #3b82f6; }
html.ebx-own button, html.ebx-own .btn, html.ebx-own a.btn { transition: filter .12s ease, transform .06s ease, background-color .12s ease, box-shadow .12s ease; }
html.ebx-own button:active:not(:disabled), html.ebx-own .btn:active { transform: translateY(1px); }
html.ebx-own button:disabled, html.ebx-own .btn[disabled] { opacity: .55; cursor: not-allowed; }
html.ebx-own textarea { resize: vertical; }
html.ebx-own .table-wrap, html.ebx-own .tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 760px) { html.ebx-own table { font-size: 14px; } html.ebx-own td, html.ebx-own th { white-space: normal; } }
html.ebx-own img { max-width: 100%; height: auto; }

/* ---------- vendor apps: gentle polish only ---------- */
html.ebx-vendor body { color: #1f2937; }
html.ebx-vendor input.form-control:focus, html.ebx-vendor select.form-control:focus, html.ebx-vendor textarea.form-control:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .16); border-color: #93b4f5; }
html.ebx-vendor .table > tbody > tr:hover > td, html.ebx-vendor table.dataTable tbody tr:hover { background-color: rgba(59, 130, 246, .045); }

/* ---------- theme button ---------- */
#ebx-theme { position: fixed; right: 18px; bottom: 84px; z-index: 2147483000; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(100, 116, 139, .3); background: rgba(255, 255, 255, .92); color: #334155; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .12); cursor: pointer; opacity: .55; transition: opacity .15s ease, transform .15s ease; padding: 0; }
#ebx-theme:hover, #ebx-theme:focus-visible { opacity: 1; transform: scale(1.06); }
@media print { #ebx-theme { display: none !important; } }

/* ---------- dark mode ---------- */
/* Systems with their own dark palette (Connect): drive it from the toggle. */
html.ebx-native[data-theme=light] { --bg:#f4f6f9;--panel:#fff;--ink:#0f172a;--muted:#64748b;--line:#e2e8f0;--brand:#0f172a;--accent:#2563eb;--chip:#eef2f7;--ok-bg:#dcfce7;--ok:#15803d;--warn-bg:#fef3c7;--warn:#b45309;--bad-bg:#fee2e2;--bad:#b91c1c;--code:#0b1220; color-scheme: light; }
html.ebx-native[data-theme=dark] { --bg:#0b1020;--panel:#121a2e;--ink:#e5e9f2;--muted:#94a3b8;--line:#22304d;--brand:#060a16;--accent:#3b82f6;--chip:#1b2540;--ok-bg:#0f2e1c;--ok:#4ade80;--warn-bg:#33240b;--warn:#fbbf24;--bad-bg:#3a1212;--bad:#f87171;--code:#060a16; color-scheme: dark; }
/* Everything else: a soft inverted dark theme that keeps each system's own hues; photos, logos, video and maps stay true-color. */
html.ebx:not(.ebx-native)[data-theme=dark] { filter: invert(.9) hue-rotate(180deg); background: #fff; }
html.ebx:not(.ebx-native)[data-theme=dark] img, html.ebx:not(.ebx-native)[data-theme=dark] picture, html.ebx:not(.ebx-native)[data-theme=dark] video,
html.ebx:not(.ebx-native)[data-theme=dark] canvas, html.ebx:not(.ebx-native)[data-theme=dark] iframe, html.ebx:not(.ebx-native)[data-theme=dark] embed,
html.ebx:not(.ebx-native)[data-theme=dark] object, html.ebx:not(.ebx-native)[data-theme=dark] svg image,
html.ebx:not(.ebx-native)[data-theme=dark] [style*="background-image"], html.ebx:not(.ebx-native)[data-theme=dark] .ebx-keep-color { filter: invert(1) hue-rotate(180deg); }
html.ebx:not(.ebx-native)[data-theme=dark] img[src$=".svg"], html.ebx:not(.ebx-native)[data-theme=dark] .ebx-invert-ok { filter: none; }
html.ebx[data-theme=dark] #ebx-theme { background: rgba(255, 255, 255, .92); color: #334155; }
html.ebx-native[data-theme=dark] #ebx-theme { background: #1b2540; color: #e5e9f2; border-color: #22304d; }
@media print { html.ebx[data-theme=dark] { filter: none !important; } }
