/* EVbro — No visible scrollbars on touch devices.
   Standalone sheet: the load ORDER (templates/index.html) follows the original cascade; do not change it. */

/* ========================================================
   GLOBAL MOBILE TOUCH NO-SCROLLBAR SYSTEM
   Completely removes all visible scrollbars on touch / mobile webapps
   ======================================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  overflow-x: hidden !important;
  max-width: 100vw;
  width: 100%;
}

html::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden !important;
  max-width: 100vw;
  width: 100%;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  -webkit-overflow-scrolling: touch;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* HABRO Typography Utilities */
.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

/* Glass & Card Styling */
.glass {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

/* Areas this installation does not offer to the account (app/entitlements.py): core/auth.js writes them in `data-off` on <html>
   and whatever is marked `data-feature` with one of them is not shown. Without a rule on the server nothing is ever hidden. */
html[data-off~="history_full"] [data-feature="history_full"],
html[data-off~="stats"] [data-feature="stats"],
html[data-off~="costs"] [data-feature="costs"],
html[data-off~="maintenance"] [data-feature="maintenance"],
html[data-off~="automation"] [data-feature="automation"],
html[data-off~="integrations"] [data-feature="integrations"],
html[data-off~="members"] [data-feature="members"],
html[data-off~="book"] [data-feature="book"] { display: none !important; }
/* The other way round: a line that only an account with the recent part of its history sees */
.history-note { display: none; margin: 6px 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--bg-glass-inset); color: var(--text-secondary); font-size: 0.84rem; line-height: 1.35; }
html[data-off~="history_full"] .history-note { display: block; }
/* The battery bar is also the charge target's slider: without that area it is only a bar */
html[data-off~="automation"] #energyTargetSlider { pointer-events: none; }

/* Keyboard focus, visible in both themes on every control (accessibility audit, 27-11-2026: the ring was about 1:1 on the primary
   buttons and missing on the sliders). Only for keyboard focus: a tap does not draw it. */
:root { --focus-ring: #0064c8; }
[data-theme="dark"] { --focus-ring: #8cc8ff; }
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.btn-primary:focus-visible, .btn-danger:focus-visible { outline-offset: 3px; box-shadow: 0 0 0 5px var(--bg, #fff); }

/* Pinch zoom is allowed (WCAG 1.4.4); this keeps the app feel the zoom ban was for: no double-tap zoom and no 300 ms delay */
html { touch-action: manipulation; }
