/* dashboard-home.css — beedle caregiver dashboard redesign (home page only).
 *
 * Loaded by nwl/layout.ejs ONLY when page === 'home' and the body carries
 * `.dash-home`. Every component class is prefixed `bd-` and every rule is
 * scoped under `.bd-home` (page content) or `.bd-topbar` (the home header) so
 * nothing here can leak into the rest of the (Bootstrap-styled) app.
 *
 * ACCESSIBILITY: the app serves many seniors, so type must stay LARGE at every
 * breakpoint. All font sizes come from the --bd-fs-* scale below (nothing under
 * 15px desktop / 16px on small screens), and the scale steps UP on small
 * screens rather than down. Touch targets are ≥44px throughout.
 */

:root{
  /* neutrals — faintly cool to sit under the cyan brand */
  --bd-bg:        oklch(0.985 0.004 230);
  --bd-surface:   oklch(1 0 0);
  --bd-surface-2: oklch(0.982 0.004 230);
  --bd-ink:       oklch(0.27 0.02 250);
  --bd-muted:     oklch(0.52 0.015 250);
  --bd-faint:     oklch(0.65 0.012 250);
  --bd-line:      oklch(0.912 0.008 250);
  --bd-line-soft: oklch(0.945 0.006 250);

  /* brand — beedle cyan #1EC6F5 */
  --bd-cyan:        oklch(0.78 0.13 226);
  --bd-cyan-deep:   oklch(0.515 0.105 235);
  --bd-cyan-strong: oklch(0.45 0.10 238);
  --bd-cyan-soft:   oklch(0.965 0.028 225);
  --bd-cyan-tint:   oklch(0.90 0.055 224);

  /* brand — sunny yellow #FFD341 */
  --bd-yellow:      oklch(0.88 0.13 92);
  --bd-yellow-deep: oklch(0.60 0.11 78);
  --bd-yellow-soft: oklch(0.965 0.05 95);

  /* brand — heart red #F72025 */
  --bd-red:         oklch(0.60 0.22 25);
  --bd-red-deep:    oklch(0.52 0.20 27);
  --bd-red-soft:    oklch(0.955 0.035 25);

  /* connectivity green (matches the health widget "pass" state ~#22c55e) */
  --bd-green:       oklch(0.72 0.18 150);

  --bd-shadow-sm: 0 1px 2px oklch(0.4 0.03 250 / 0.05), 0 1px 3px oklch(0.4 0.03 250 / 0.06);
  --bd-shadow-md: 0 2px 4px oklch(0.4 0.03 250 / 0.04), 0 8px 24px oklch(0.4 0.03 250 / 0.08);
  /* tactile button lift (clickable affordance) — resting / hover / pressed */
  --bd-lift:       0 4px 12px oklch(0.45 0.04 250 / 0.13), 0 1px 2px oklch(0.45 0.04 250 / 0.10);
  --bd-lift-hover: 0 9px 22px oklch(0.45 0.04 250 / 0.18), 0 2px 5px oklch(0.45 0.04 250 / 0.12);
  --bd-press:      0 2px 5px oklch(0.45 0.04 250 / 0.12);
  --bd-r: 18px;
  --bd-r-sm: 12px;

  /* ---- type scale — single source of truth ----
     In rem, so it scales with the user's browser / OS text-size setting
     (WCAG 2.1 SC 1.4.4 "Resize text"): a senior who enlarges their default text
     enlarges the whole dashboard. Anchored to the 16px browser default.
     Norms applied:
       • body 1.125rem (18px) — above the 16px web-body minimum widely cited for
         older-adult legibility (Nielsen Norman Group); GOV.UK ships 19px body.
       • large numbers/stats 1.5rem (24px) = WCAG SC 1.4.3 "large text" (18pt).
       • floor 0.9375rem (15px) for small-caps labels — kept bold + letter-spaced. */
  --bd-fs-xs:   0.9375rem; /* 15px — small-caps labels, captions, fine print (floor) */
  --bd-fs-sm:   1rem;      /* 16px — secondary / muted text, subs, status pills */
  --bd-fs-base: 1.125rem;  /* 18px — body, buttons, chips, nav, menus, selects */
  --bd-fs-lg:   1.1875rem; /* 19px — input + section labels, volume titles, activity */
  --bd-fs-h2:   1.375rem;  /* 22px — card titles */
  --bd-fs-stat: 1.5rem;    /* 24px — big numbers / emphasis (= WCAG large text) */
  --bd-fs-h1:   1.875rem;  /* 30px — greeting */
}

/* page background + base type (overrides userconsole.css body bg on home only) */
body.dash-home{
  background: var(--bd-bg);
  font-family:'Figtree', system-ui, -apple-system, sans-serif;
  color: var(--bd-ink);
  font-size: var(--bd-fs-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* On small screens userconsole.css forces an arbitrary `* { font-size:1.3rem }`.
   Neutralise it for the dashboard subtree: our rem scale already keeps type large
   AND honours the user's text-size setting, so no magic per-breakpoint value is
   needed. The :where() universal is zero-specificity, so it wins the (0,0,0) tie
   with `*` (loads after userconsole.css) while every bd- component rule below stays
   more specific and keeps its own size. (Old WebViews without :where() drop this
   rule and fall back to prior behaviour.) */
@media (max-width:992px){
  :where(.bd-home, .bd-topbar, .bd-tabbar),
  :where(.bd-home, .bd-topbar, .bd-tabbar) *{ font-size: var(--bd-fs-base); }
}

/* The shared layout wraps the header partial in a global <header>, and
   styles.css gives every <header> `padding:2rem; display:flex; max-height:170px`
   — which boxes/indents our bar AND, being only as tall as the bar, would stop
   `position:sticky` from working. `display:contents` removes that wrapper's box
   entirely (killing the global header styling) and promotes .bd-topbar into the
   body flow, so it spans full width, lines up with the content gutter, and sticks
   correctly. The inner <header class="bd-topbar"> keeps the banner semantics. */
body.dash-home > header{ display:contents; }

/* userconsole.css adds a global `.btn { margin:5px }`; zero it for the JS-driven
   Bootstrap-classed buttons that live inside the dashboard (#tvPowerBtn, .vr-cmd,
   #vr-toggle-all, health widget) so our own spacing controls the layout. */
.bd-home .btn, .bd-topbar .btn{ margin:0; }

.bd-home, .bd-topbar{ -webkit-tap-highlight-color: transparent; }
.bd-home svg{ display:block; }
.bd-wrap{ max-width:1200px; margin:0 auto; padding:0 28px; }

/* ---------- HEADER ---------- */
/* styles.css `header { display:flex; justify-content:space-between; padding:2rem;
   font-size:1.5rem; min/max-height }` matches EVERY <header>, including this inner
   one — which made .bd-top-inner a shrink-to-fit, auto-margin-centred flex item
   (a floating cluster) instead of a full max-width block aligned with the content.
   Override all of it so .bd-topbar is a plain full-width block and its .bd-wrap
   centres exactly like the page content's .bd-wrap. */
header.bd-topbar{
  position:sticky; top:0; z-index:1030;
  display:block;
  background: oklch(1 0 0 / 0.85);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom:1px solid var(--bd-line);
  margin:0; padding:0; padding-top: env(safe-area-inset-top);
  min-height:0; max-height:none; font-size:inherit;
}
.bd-topbar *{ box-sizing:border-box; }
.bd-topbar a{ text-decoration:none; color:inherit; }
.bd-topbar button{ font-family:inherit; cursor:pointer; border:none; background:none; color:inherit; }
.bd-top-inner{ display:flex; align-items:center; gap:10px; height:74px; }
/* the wordmark is a button back to /nwl/home — give it the same rounded pill
   affordance as the .bd-person space chip, plus a clickable hover lift. */
.bd-brand{ display:inline-flex; align-items:center; margin-right:2px; background:var(--bd-surface);
  border:1px solid var(--bd-line); border-radius:999px; padding:8px 16px; box-shadow:var(--bd-shadow-sm);
  transition:border-color .14s, box-shadow .12s, transform .12s; }
.bd-brand:hover{ border-color:var(--bd-cyan-tint); box-shadow:var(--bd-lift); transform:translateY(-1px); }
.bd-brand:active{ transform:translateY(1px); box-shadow:var(--bd-press); }
.bd-brand img{ height:30px; width:auto; display:block; }

.bd-nav{ display:flex; align-items:center; gap:2px; margin-left:16px; }
.bd-navitem{ position:relative; }
.bd-navlink{ display:flex; align-items:center; gap:6px; padding:9px 14px; border-radius:10px;
  font-size:var(--bd-fs-base); font-weight:600; color:var(--bd-ink); white-space:nowrap; cursor:pointer; }
.bd-navlink:hover{ background:var(--bd-cyan-soft); color:var(--bd-cyan-strong); }
.bd-navlink svg{ width:15px; height:15px; opacity:.5; }

.bd-top-right{ margin-left:auto; display:flex; align-items:center; gap:8px; }
.bd-lang{ display:flex; align-items:center; gap:6px; font-size:var(--bd-fs-sm); font-weight:600; color:var(--bd-muted);
  padding:8px 12px; border-radius:10px; }
.bd-lang:hover{ background:var(--bd-surface-2); }

.bd-person{ display:flex; align-items:center; gap:10px; background:var(--bd-surface); border:1px solid var(--bd-line);
  padding:6px 12px 6px 6px; border-radius:999px; box-shadow:var(--bd-shadow-sm); margin-left:8px; }
.bd-person:hover{ border-color:var(--bd-cyan-tint); }
.bd-avatar{ width:38px; height:38px; border-radius:50%; background:var(--bd-cyan-soft); color:var(--bd-cyan-strong);
  display:grid; place-items:center; font-weight:800; font-size:var(--bd-fs-base); flex:none; text-transform:uppercase; }
.bd-who{ line-height:1.15; text-align:left; }
.bd-who b{ font-size:var(--bd-fs-base); font-weight:700; display:block; }
.bd-who span{ display:block; font-size:var(--bd-fs-xs); color:var(--bd-muted); font-weight:500; }

.bd-acct{ display:flex; align-items:center; gap:8px; padding:6px 12px 6px 8px; border-radius:999px;
  border:1px solid var(--bd-line); font-size:var(--bd-fs-base); font-weight:600; color:var(--bd-ink); }
.bd-acct:hover{ background:var(--bd-surface-2); }
.bd-acct .bd-ic{ width:32px; height:32px; border-radius:50%; background:var(--bd-surface-2); color:var(--bd-muted);
  display:grid; place-items:center; }
.bd-icon-btn{ display:none; place-items:center; width:44px; height:44px; border-radius:50%; color:var(--bd-muted); }
.bd-icon-btn:active{ background:var(--bd-surface-2); }
.bd-icon-btn svg{ width:24px; height:24px; }
.bd-disconnect{ display:grid; place-items:center; width:40px; height:40px; border-radius:50%; color:var(--bd-red-deep);
  background:var(--bd-red-soft); }
.bd-disconnect svg{ width:22px; height:22px; }

/* dropdown menus (vanilla, click-toggled) */
.bd-menu{ position:absolute; top:calc(100% + 6px); min-width:248px; background:var(--bd-surface);
  border:1px solid var(--bd-line); border-radius:14px; box-shadow:var(--bd-shadow-md); padding:8px;
  z-index:1040; display:none; max-height:min(70vh, 560px); overflow:auto; }
.bd-navitem .bd-menu{ left:0; }
.bd-top-right .bd-menu{ right:0; }
.bd-menu.open{ display:block; }
.bd-menu a, .bd-menu button.bd-menu-item{ display:flex; align-items:center; gap:8px; width:100%;
  text-align:left; padding:11px 12px; border-radius:9px; font-size:var(--bd-fs-base); font-weight:600; color:var(--bd-ink);
  white-space:nowrap; cursor:pointer; background:none; border:none; }
.bd-menu a:hover, .bd-menu button.bd-menu-item:hover{ background:var(--bd-cyan-soft); color:var(--bd-cyan-strong); }
.bd-menu .bd-menu-item.disabled{ color:var(--bd-faint); cursor:default; pointer-events:none; }
.bd-menu .bd-menu-sep{ font-size:var(--bd-fs-xs); font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  color:var(--bd-faint); padding:10px 12px 4px; }
.bd-menu hr{ border:none; border-top:1px solid var(--bd-line-soft); margin:6px 4px; }
.bd-menu .bd-current{ color:var(--bd-cyan-strong); }
.bd-menu .bd-qr{ text-align:center; padding:6px; }
.bd-menu .bd-qr img{ max-width:150px; }
.bd-menu .bd-attach{ display:flex; flex-direction:column; gap:4px; padding:8px 12px; }
.bd-menu .bd-attach input{ font-family:inherit; font-size:var(--bd-fs-sm); padding:9px 11px; border:1px solid var(--bd-line);
  border-radius:8px; }

/* console switcher items injected into #console-list */
.bd-topbar #console-list .select-console-button{ display:block; padding:11px 12px; border-radius:9px; font-size:var(--bd-fs-base);
  font-weight:600; color:var(--bd-ink); text-decoration:none; cursor:pointer; }
.bd-topbar #console-list .select-console-button:hover{ background:var(--bd-cyan-soft); color:var(--bd-cyan-strong); }
.bd-topbar #console-list .select-console-button.bd-current{ color:var(--bd-cyan-strong); cursor:default; font-weight:700; }

/* the account section is a mobile-drawer-only affordance; on desktop the
   top-right .bd-acct dropdown owns logout, so hide it there. */
.bd-nav-account{ display:none; }

/* hamburger appears whenever the inline nav is hidden (≤980px) */
@media (max-width:980px){
  #bd-hamburger{ display:grid; }
  .bd-nav{ display:none; }
  .bd-topbar.nav-open .bd-nav{ display:flex; flex-direction:column; align-items:stretch; gap:2px;
    position:absolute; top:100%; left:0; right:0; background:var(--bd-surface); border-bottom:1px solid var(--bd-line);
    box-shadow:var(--bd-shadow-md); padding:8px; max-height:80vh; overflow:auto; }
  .bd-topbar.nav-open .bd-navitem{ width:100%; }
  .bd-topbar.nav-open .bd-nav .bd-navlink{ width:100%; justify-content:space-between; }
  /* inside the mobile panel the dropdowns render inline (no absolute overlay) */
  .bd-topbar.nav-open .bd-nav .bd-menu{ position:static; display:block; box-shadow:none; border:none;
    border-radius:0; padding:2px 0 8px 12px; min-width:0; max-height:none; }
  /* reveal account actions (incl. logout) at the foot of the open drawer */
  .bd-topbar.nav-open .bd-nav-account{ display:block; border-top:1px solid var(--bd-line-soft);
    margin-top:6px; padding-top:6px; }
  .bd-topbar.nav-open .bd-nav-account a{ display:flex; align-items:center; padding:11px 12px; border-radius:9px;
    font-size:var(--bd-fs-base); font-weight:600; color:var(--bd-ink); text-decoration:none; }
  .bd-topbar.nav-open .bd-nav-account a:hover{ background:var(--bd-cyan-soft); color:var(--bd-cyan-strong); }
}

/* ---------- LAYOUT ---------- */
.bd-home{ padding:30px 0 56px; box-sizing:border-box; }
.bd-home *{ box-sizing:border-box; }
.bd-greet{ display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:22px; flex-wrap:wrap; }
.bd-greet h1{ font-size:var(--bd-fs-h1); font-weight:700; letter-spacing:-0.02em; margin:0; }
.bd-greet p{ color:var(--bd-muted); font-size:var(--bd-fs-sm); margin:3px 0 0; }
.bd-reassure{ display:flex; align-items:center; gap:10px; background:var(--bd-cyan-soft); border:1px solid var(--bd-cyan-tint);
  color:var(--bd-cyan-strong); padding:10px 16px; border-radius:999px; font-weight:600; font-size:var(--bd-fs-sm); }
.bd-reassure b{ font-weight:700; }
/* connectivity dot: YELLOW while awaiting the beedle, GREEN once it reports in.
   The .is-connected class + title are toggled by the script in home.ejs that hooks
   nwlCommon's handleBeedleConnected/Disconnected (the single source of truth). */
.bd-pulse{ width:10px; height:10px; border-radius:50%; background:var(--bd-yellow); position:relative; flex:none; cursor:help; transition:background .2s; }
.bd-pulse::after{ content:""; position:absolute; inset:-4px; border-radius:50%; border:2px solid var(--bd-yellow);
  opacity:.5; animation:bd-pp 2.4s ease-out infinite; }
.bd-pulse.is-connected{ background:var(--bd-green); }
.bd-pulse.is-connected::after{ border-color:var(--bd-green); }
@keyframes bd-pp{ 0%{ transform:scale(.6); opacity:.5 } 100%{ transform:scale(1.8); opacity:0 } }
@media (prefers-reduced-motion:reduce){ .bd-pulse::after{ animation:none } }

.bd-grid{ display:grid; grid-template-columns:1.45fr 1fr; gap:22px; align-items:start; }
.bd-col{ display:flex; flex-direction:column; gap:22px; }

.bd-card{ background:var(--bd-surface); border:1px solid var(--bd-line); border-radius:var(--bd-r); box-shadow:var(--bd-shadow-sm); }
.bd-card-pad{ padding:22px 24px; }
.bd-card-h{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px 24px;
  border-bottom:1px solid var(--bd-line-soft); }
.bd-card-h h2{ font-size:var(--bd-fs-h2); font-weight:700; letter-spacing:-0.01em; margin:0; }
.bd-card-h .bd-sub{ font-size:var(--bd-fs-xs); color:var(--bd-faint); font-weight:500; }

/* ---------- HERO (live console screenshot) ---------- */
.bd-hero{ overflow:hidden; }
.bd-eyebrow{ display:flex; align-items:center; gap:9px; font-size:var(--bd-fs-xs); font-weight:700; letter-spacing:.04em;
  text-transform:uppercase; color:var(--bd-cyan-strong); }
.bd-eyebrow svg{ width:18px; height:18px; }
.bd-screen{ position:relative; margin:0; border-radius:var(--bd-r-sm); overflow:hidden; aspect-ratio:16/10;
  background: oklch(0.18 0.02 250); border:1px solid var(--bd-line); display:flex; align-items:center; justify-content:center; }
/* fold the legacy console_view markup into the framed screen box */
.bd-home .bd-screen .console_view{ width:100%; height:100%; max-height:none; margin:0; }
.bd-home .bd-screen .console_view_image_container,
.bd-home .bd-screen .console-view-image-container{ width:100%; height:100%; border:0 !important; padding:0 !important;
  display:flex; align-items:center; justify-content:center; }
.bd-home .bd-screen #console-view-image{ max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain;
  cursor:pointer; }
.bd-home .bd-screen .console_text{ color:#fff; }
.bd-home .bd-screen .console-status-overlay{ position:absolute; inset:0; background: oklch(0.18 0.02 250 / 0.78);
  color:#fff; display:flex; align-items:center; justify-content:center; text-align:center; padding:0 24px;
  font-size:var(--bd-fs-lg); font-weight:600; }
.bd-home .bd-screen .old-screenshot-warning-overlay{ position:absolute; left:0; right:0; bottom:0; padding:10px 14px;
  background: oklch(0.55 0.18 28 / 0.85); color:#fff; font-size:var(--bd-fs-sm); font-weight:600; text-align:center; }
.bd-home .bd-screen .console-state-text{ position:absolute; top:12px; left:12px; background: oklch(0.2 0.02 250 / 0.55);
  color:#fff; font-size:var(--bd-fs-xs); font-weight:600; padding:6px 12px; border-radius:8px; backdrop-filter:blur(4px); }

.bd-hero-actions{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:18px; }

.bd-btn{ display:inline-flex; align-items:center; justify-content:center; gap:9px; border-radius:12px; font-weight:700;
  font-size:var(--bd-fs-base); padding:15px 18px; transition:transform .12s, box-shadow .12s, background .14s;
  border:1px solid transparent; min-height:54px; width:100%;
  cursor:pointer; font-family:inherit; line-height:1.2; text-decoration:none; box-shadow:var(--bd-lift); }
.bd-btn svg{ width:20px; height:20px; }
.bd-btn:hover{ transform:translateY(-1px); box-shadow:var(--bd-lift-hover); }
.bd-btn:active{ transform:translateY(1px); box-shadow:var(--bd-press); }
.bd-btn-primary{ background:var(--bd-cyan-deep); color:#fff; }
.bd-btn-primary:hover{ background:var(--bd-cyan-strong); color:#fff; }
.bd-btn-soft{ background:var(--bd-cyan-soft); color:var(--bd-cyan-strong); border-color:var(--bd-cyan-tint); }
.bd-btn-soft:hover{ background:var(--bd-cyan-tint); color:var(--bd-cyan-strong); }
.bd-btn-danger{ background:var(--bd-red-soft); color:var(--bd-red-deep); border-color: oklch(0.88 0.06 25); }
.bd-btn-danger:hover{ background: oklch(0.92 0.06 25); }

/* ---------- ACTIVITY ---------- */
.bd-act-row{ display:flex; align-items:center; gap:14px; padding:14px 0; border-bottom:1px solid var(--bd-line-soft); }
.bd-act-row:last-child{ border-bottom:none; }
.bd-act-ic{ width:42px; height:42px; border-radius:12px; display:grid; place-items:center; flex:none; font-size:var(--bd-fs-stat); }
.bd-ic-call{ background:var(--bd-cyan-soft); color:var(--bd-cyan-strong); }
.bd-ic-msg{ background:var(--bd-yellow-soft); color:var(--bd-yellow-deep); }
.bd-ic-photo{ background:var(--bd-red-soft); color:var(--bd-red-deep); }
.bd-act-main{ flex:1; min-width:0; }
.bd-act-main .bd-lbl{ font-size:var(--bd-fs-lg); font-weight:600; }
.bd-act-progress{ height:5px; border-radius:999px; background:var(--bd-line); overflow:hidden; margin-top:7px; }
.bd-act-progress > span{ display:block; height:100%; border-radius:999px; background:var(--bd-cyan); }
.bd-act-count{ font-size:var(--bd-fs-sm); color:var(--bd-muted); font-weight:600; flex:none; }
.bd-act-empty{ color:var(--bd-muted); font-size:var(--bd-fs-base); }
/* compact label/heading variants are phone-only (see the phone media query) */
.bd-act-h-short, .bd-lbl-short{ display:none; }

/* ---------- RECAP / reporting controls ---------- */
.bd-recap-top{ display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 16px;
  background:var(--bd-surface-2); border:1px solid var(--bd-line-soft); border-radius:var(--bd-r-sm); margin-bottom:16px; }
.bd-recap-top .bd-txt b{ font-size:var(--bd-fs-base); font-weight:700; display:block; }
.bd-recap-top .bd-txt span{ font-size:var(--bd-fs-sm); color:var(--bd-muted); }
/* custom switch built on the real checkbox the reporting script reads */
.bd-switch{ position:relative; width:54px; height:32px; flex:none; }
.bd-switch input{ position:absolute; opacity:0; width:100%; height:100%; margin:0; cursor:pointer; }
.bd-switch .bd-switch-track{ position:absolute; inset:0; border-radius:999px; background:var(--bd-line); transition:.15s; }
.bd-switch .bd-switch-track::after{ content:""; position:absolute; top:3px; left:3px; width:26px; height:26px;
  border-radius:50%; background:#fff; transition:.15s; box-shadow:var(--bd-shadow-sm); }
.bd-switch input:checked + .bd-switch-track{ background:var(--bd-cyan-deep); }
.bd-switch input:checked + .bd-switch-track::after{ left:25px; }

.bd-fields{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.bd-field label{ display:block; font-size:var(--bd-fs-sm); font-weight:600; color:var(--bd-muted); margin-bottom:6px; }
.bd-sel{ position:relative; }
.bd-sel select{ appearance:none; -webkit-appearance:none; width:100%; font-family:inherit; font-size:var(--bd-fs-base);
  font-weight:600; color:var(--bd-ink); background:var(--bd-surface); border:1px solid var(--bd-line);
  border-radius:10px; padding:13px 38px 13px 14px; cursor:pointer; min-height:50px; }
.bd-sel select:hover{ border-color:var(--bd-cyan-tint); }
.bd-sel::after{ content:""; position:absolute; right:15px; top:50%; width:9px; height:9px; pointer-events:none;
  border-right:2.4px solid var(--bd-faint); border-bottom:2.4px solid var(--bd-faint);
  transform:translateY(-65%) rotate(45deg); }
.bd-reporting-status{ display:block; font-size:var(--bd-fs-sm); color:var(--bd-muted); margin-top:8px; min-height:1em; }

/* ---------- CONTROL (virtual remote + volumes) ---------- */
.bd-control{ margin-top:22px; }
.bd-status-pill{ display:flex; align-items:center; gap:9px; background:var(--bd-cyan-soft); border:1px solid var(--bd-cyan-tint);
  color:var(--bd-cyan-strong); font-weight:600; font-size:var(--bd-fs-sm); padding:8px 14px 8px 12px; border-radius:999px; }
.bd-ctrl-grid{ display:grid; grid-template-columns:1.5fr 1fr; }
.bd-ctrl-grid > div{ padding:24px; min-width:0; }
.bd-ctrl-grid > div:first-child{ border-right:1px solid var(--bd-line-soft); }

.bd-remote-head{ display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:20px; }
.bd-remote-head .bd-lt{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.bd-remote-head h3{ font-size:var(--bd-fs-lg); font-weight:700; margin:0; }
.bd-display-toggle{ display:flex; align-items:center; gap:10px; font-size:var(--bd-fs-sm); color:var(--bd-muted); font-weight:500; }
.bd-seg{ display:flex; background:var(--bd-surface-2); border:1px solid var(--bd-line); border-radius:10px; padding:3px; }
.bd-seg button{ padding:8px 15px; border-radius:7px; font-size:var(--bd-fs-sm); font-weight:600; color:var(--bd-muted);
  border:none; background:none; cursor:pointer; font-family:inherit; }
/* active source = the device's reported input. WebCommon.ejs's tv:status handler
   toggles btn-primary / btn-outline-primary on #tvInputBeedle/#tvInputTV (state
   markers — no visual on their own without .btn), so we light the active one here. */
.bd-seg button.btn-primary{ background:var(--bd-surface); color:var(--bd-cyan-strong); box-shadow:var(--bd-shadow-sm); }

/* TV power button (#tvPowerBtn keeps its Bootstrap classes for handleCommonWidgets) */
.bd-home #tvPowerBtn{ display:inline-flex; align-items:center; gap:7px; background:var(--bd-surface-2);
  border:1px solid var(--bd-line); color:var(--bd-ink); font-weight:700; font-size:var(--bd-fs-sm); letter-spacing:.03em;
  padding:8px 14px; border-radius:999px; min-height:0; }
.bd-home #tvPowerBtn.btn-success{ background:var(--bd-cyan-soft); border-color:var(--bd-cyan-tint); color:var(--bd-cyan-strong); }

.bd-ch-group{ margin-bottom:18px; }
.bd-ch-group:last-child{ margin-bottom:0; }
.bd-glabel{ font-size:var(--bd-fs-xs); font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--bd-faint); margin-bottom:10px; }
.bd-chips{ display:flex; flex-wrap:wrap; gap:10px; }
.bd-chip{ display:inline-flex; align-items:center; gap:8px; background:var(--bd-surface); border:1px solid var(--bd-line);
  border-radius:10px; padding:12px 17px; font-size:var(--bd-fs-base); font-weight:600; color:var(--bd-ink);
  transition:transform .12s, box-shadow .12s, background .13s, border-color .13s;
  min-height:50px; cursor:pointer; font-family:inherit; text-decoration:none; box-shadow:var(--bd-shadow-sm); }
.bd-chip:hover{ border-color:var(--bd-cyan); background:var(--bd-cyan-soft); color:var(--bd-cyan-strong); box-shadow:var(--bd-lift); transform:translateY(-1px); }
.bd-chip:active{ transform:translateY(1px); box-shadow:var(--bd-press); }
.bd-chip svg{ width:18px; height:18px; opacity:.55; }
.bd-chip.danger:hover{ border-color:var(--bd-red); background:var(--bd-red-soft); color:var(--bd-red-deep); }

/* virtual-remote.js injects Bootstrap-classed buttons into the server-rendered
   columns; restyle them as chips while keeping their classes intact. */
.bd-home #virtual-remote .vr-col{ display:flex; flex-direction:column; gap:8px; }
.bd-home #virtual-remote .vr-cmd{ display:inline-flex; align-items:center; justify-content:flex-start; gap:8px;
  width:100%; background:var(--bd-surface); border:1px solid var(--bd-line); border-radius:10px; padding:12px 15px;
  font-size:var(--bd-fs-base); font-weight:600; color:var(--bd-ink); min-height:48px;
  transition:transform .12s, box-shadow .12s, background .13s, border-color .13s; box-shadow:var(--bd-shadow-sm); cursor:pointer; }
.bd-home #virtual-remote .vr-cmd:hover{ border-color:var(--bd-cyan); background:var(--bd-cyan-soft); color:var(--bd-cyan-strong); box-shadow:var(--bd-lift); transform:translateY(-1px); }
.bd-home #virtual-remote .vr-cmd:active{ transform:translateY(1px); box-shadow:var(--bd-press); }
.bd-home #virtual-remote .vr-cmd.btn-primary{ border-color:var(--bd-cyan-tint); background:var(--bd-cyan-soft); color:var(--bd-cyan-strong); }
.bd-home #virtual-remote .vr-toggle-all,
.bd-home #virtual-remote #vr-toggle-all{ background:var(--bd-surface-2); border:1px solid var(--bd-line);
  border-radius:8px; padding:7px 13px; font-size:var(--bd-fs-sm); font-weight:600; color:var(--bd-muted); }
.bd-home #virtual-remote h6{ font-size:var(--bd-fs-xs); font-weight:700; letter-spacing:.05em; text-transform:uppercase;
  color:var(--bd-faint); margin-bottom:10px; }
.bd-home #virtual-remote .card-header{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between;
  gap:10px; padding:0 0 14px; border:none; background:none; margin-bottom:14px; border-bottom:1px solid var(--bd-line-soft); }
.bd-home #virtual-remote{ border:none; background:none; }
.bd-home #virtual-remote .card-body{ padding:0; }
.bd-home #virtual-remote .card-header strong{ font-size:var(--bd-fs-lg); font-weight:700; }
.bd-home .bd-vr-columns{ display:grid; grid-template-columns:repeat(3, 1fr); gap:16px; }
.bd-home .vr-colwrap{ min-width:0; }

/* fallback display-mode buttons (non-TV units) — styled as chips */
.bd-home .beedle-control-buttons{ flex:1 1 calc(50% - 8px); }
.bd-home #virtual-remote + .bd-fallback-modes{ margin-top:18px; }

@media (max-width:640px){
  .bd-home .bd-vr-columns{ grid-template-columns:1fr; }
}

/* ---------- VOLUMES ---------- */
.bd-vol{ margin-bottom:20px; }
.bd-vol:last-child{ margin-bottom:0; }
.bd-vol-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:11px; }
.bd-vol-head .bd-vt{ display:flex; align-items:center; gap:9px; font-size:var(--bd-fs-lg); font-weight:600; }
.bd-vol-head .bd-vt svg{ width:19px; height:19px; color:var(--bd-muted); }
.bd-vol-ctrl{ display:flex; align-items:center; gap:12px; }
.bd-home .bd-vol-ctrl .bd-step{ width:48px; height:48px; border-radius:12px; background:var(--bd-surface-2);
  border:1px solid var(--bd-line); color:var(--bd-ink); display:grid; place-items:center; flex:none;
  transition:transform .12s, box-shadow .12s, background .12s, border-color .12s;
  font-size:var(--bd-fs-stat); font-weight:700; min-height:0; cursor:pointer; box-shadow:var(--bd-shadow-sm); }
.bd-home .bd-vol-ctrl .bd-step:hover{ background:var(--bd-cyan-soft); border-color:var(--bd-cyan-tint); color:var(--bd-cyan-strong); box-shadow:var(--bd-lift); transform:translateY(-1px); }
.bd-home .bd-vol-ctrl .bd-step:active{ transform:translateY(1px); box-shadow:var(--bd-press); }
.bd-home .bd-vol-ctrl input[type="range"]{ flex:1; accent-color: var(--bd-cyan); height:10px; }
.bd-home .bd-vol-ctrl .bd-test{ background:var(--bd-yellow-soft); color:var(--bd-yellow-deep);
  border:1px solid oklch(0.88 0.08 90); border-radius:12px; padding:0 17px; height:48px; min-height:0; font-weight:700;
  font-size:var(--bd-fs-base); display:inline-flex; align-items:center; gap:7px; cursor:pointer; box-shadow:var(--bd-shadow-sm);
  transition:transform .12s, box-shadow .12s, background .12s; }
.bd-home .bd-vol-ctrl .bd-test:hover{ background:var(--bd-yellow); color: oklch(0.4 0.08 75); box-shadow:var(--bd-lift); transform:translateY(-1px); }
.bd-home .bd-vol-ctrl .bd-test:active{ transform:translateY(1px); box-shadow:var(--bd-press); }
.bd-vbig{ font-size:var(--bd-fs-stat); font-weight:700; min-width:46px; text-align:center; }

/* ---- not-actionable controls: no lift, greyed out ----
   A raised/clickable look must not appear on controls that aren't usable:
   native :disabled, locked (.key-disabled), or awaiting the beedle. nwlCommon
   tags every display-on-beedle-connected control with .beedle-is-connected until
   the unit reports in (e.g. "Appeler" before connect), so we flatten + grey those
   (overriding the legacy blue !important) and the lift only returns once ready. */
.bd-home .bd-btn:disabled,
.bd-home .bd-btn.key-disabled,
.bd-home .beedle-is-connected{
  box-shadow:none !important;          /* flat = not raised = not pressable */
  transform:none !important;
  cursor:not-allowed;
  background: oklch(0.93 0.006 250) !important;  /* clean solid grey, not a faded ghost */
  color: var(--bd-muted) !important;             /* muted but readable */
  border-color: var(--bd-line) !important;
}
/* lockClassForKey adds .key-unlocked/.key-disabled = `display:block !important`,
   which would kill the button's flex layout (icon drifts away from the label).
   Keep them visible AND flex so the icon stays beside the text. */
.bd-home .bd-btn.key-unlocked,
.bd-home .bd-btn.key-disabled{ display:inline-flex !important; }

/* health widget sits in the control card header — soften its Bootstrap card look */
.bd-home #health-status-widget .card{ border:1px solid var(--bd-line); border-radius:12px; }

.bd-footer{ text-align:center; color:var(--bd-faint); font-size:var(--bd-fs-sm); padding:18px 0 8px; }
.bd-footer a{ color:var(--bd-muted); text-decoration:none; font-weight:600; }
.bd-footer a:hover{ color:var(--bd-cyan-strong); }

/* not-attached states */
.bd-empty-state{ text-align:center; padding:38px 24px; }
.bd-empty-state h2{ font-size:var(--bd-fs-h2); font-weight:700; margin:0 0 8px; }
.bd-empty-state p{ color:var(--bd-muted); font-size:var(--bd-fs-base); margin:0; }

/* ---------- MOBILE BOTTOM NAV ---------- */
/* Hidden everywhere by default; the phone media query reveals them. Without the
   global hide the .bd-sheet (its base rule lives inside @media) would render as a
   block of oversized tiles at the bottom of the desktop page. */
.bd-tabbar, .bd-sheet, .bd-sheet-backdrop{ display:none; }

/* ---- tablet ---- */
@media (max-width:980px){
  .bd-grid{ grid-template-columns:1fr; }
  .bd-ctrl-grid{ grid-template-columns:1fr; }
  .bd-ctrl-grid > div:first-child{ border-right:none; border-bottom:1px solid var(--bd-line-soft); }
  .bd-nav{ display:none; }
}

/* ---- phone ---- */
@media (max-width:640px){
  .bd-wrap{ padding:0 16px; }
  .bd-top-inner{ height:62px; gap:8px; }
  .bd-brand{ padding:6px 12px; }
  .bd-brand img{ height:26px; }
  .bd-lang, .bd-acct{ display:none; }
  .bd-person{ margin-left:auto; padding:5px 10px 5px 5px; }
  .bd-who span{ display:none; }

  .bd-home{ padding:20px 0 calc(82px + env(safe-area-inset-bottom)); }
  .bd-greet{ margin-bottom:18px; }
  .bd-reassure{ width:100%; justify-content:center; order:2; }

  .bd-grid{ gap:16px; }
  .bd-col{ gap:16px; }
  .bd-control{ margin-top:16px; }

  /* Activity widget shrinks to header + one row of three compact columns
     (Appels / Babillard / Photos), each its own little cell. */
  .bd-act-h-full, .bd-lbl-full{ display:none; }
  .bd-act-h-short, .bd-lbl-short{ display:inline; }
  .bd-act-body{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; padding-top:10px; padding-bottom:14px; }
  .bd-act-body .bd-act-row{ flex-direction:column; align-items:center; text-align:center; gap:5px; padding:10px 4px;
    border-bottom:none; background:var(--bd-surface-2); border:1px solid var(--bd-line-soft); border-radius:var(--bd-r-sm); }
  .bd-act-body .bd-act-main{ order:1; flex:none; width:100%; min-width:0; }
  .bd-act-body .bd-act-main .bd-lbl{ font-size:var(--bd-fs-sm); font-weight:700; }
  .bd-act-body .bd-act-progress{ display:none; }
  .bd-act-body .bd-act-ic{ order:2; width:34px; height:34px; border-radius:10px; font-size:20px; }
  .bd-act-body .bd-act-count{ order:3; font-size:var(--bd-fs-sm); }
  .bd-act-body .bd-act-empty{ grid-column:1 / -1; text-align:center; }
  .bd-card-pad{ padding:18px 16px; }
  .bd-card-h{ padding:16px; }
  .bd-ctrl-grid > div{ padding:18px 16px; }

  .bd-hero-actions{ grid-template-columns:1fr; gap:10px; }
  .bd-btn{ min-height:58px; }

  .bd-display-toggle{ width:100%; justify-content:space-between; }
  .bd-chips{ gap:8px; }
  .bd-chip{ flex:1; min-width:calc(50% - 4px); justify-content:center; }
  .bd-fields{ gap:12px; }

  .bd-vol-ctrl{ flex-wrap:wrap; }
  .bd-home .bd-vol-ctrl .bd-test{ margin-left:0; flex:1; justify-content:center; }

}

/* ---- bottom nav: phones AND tablets (shown whenever the inline top nav at
   ≤980px collapses into the hamburger; matches the .bd-nav breakpoint above so
   a collapsed top nav always pairs with the bottom bar). Base = phone styling;
   the tablet-only block further down caps/centres it and widens the grid. ---- */
@media (max-width:980px){
  /* bottom tab bar */
  .bd-tabbar{ display:flex; position:fixed; left:0; right:0; bottom:0; z-index:1035;
    background: oklch(1 0 0 / 0.92); backdrop-filter:saturate(1.5) blur(16px); border-top:1px solid var(--bd-line);
    padding:6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .bd-tab{ flex:1; display:flex; flex-direction:column; align-items:center; gap:3px; padding:7px 2px;
    font-size:var(--bd-fs-xs); font-weight:600; color:var(--bd-faint); border-radius:12px; background:none; border:none;
    cursor:pointer; font-family:inherit; text-decoration:none; -webkit-tap-highlight-color:transparent; }
  .bd-tab svg{ width:25px; height:25px; stroke-width:2; }
  /* a tab is a <button>; Bootstrap returns focus to it after a modal it opened
     (e.g. Appeler) closes, which on touch leaves it looking "selected". Drop the
     ring for pointer/programmatic focus; keep it for real keyboard navigation. */
  .bd-tab:focus{ outline:none; }
  /* neutral (grey) keyboard focus ring — NOT cyan — so a merely-focused tab
     (e.g. when Bootstrap returns focus to Appeler after its modal closes) never
     looks "selected". Only .bd-tab.active is cyan. */
  .bd-tab:focus-visible{ outline:2px solid var(--bd-faint); outline-offset:2px; border-radius:12px; }
  .bd-tab.active{ color:var(--bd-cyan-strong); }
  .bd-tab.active .bd-tab-ic{ background:var(--bd-cyan-soft); }
  .bd-tab-ic{ display:grid; place-items:center; width:54px; height:32px; border-radius:999px; transition:.15s; }

  /* ---- "More" sheet (apps grid + admin list), opened from the 4th tab ---- */
  .bd-sheet-backdrop{ display:none; position:fixed; inset:0; z-index:1036; background:oklch(0.2 0.02 250 / 0.34); }
  .bd-sheet-backdrop.open{ display:block; }
  .bd-sheet{ display:none; box-sizing:border-box; position:fixed; left:0; right:0; bottom:calc(64px + env(safe-area-inset-bottom));
    z-index:1037; max-height:82vh; overflow-y:auto; overflow-x:hidden; padding:14px 14px 18px;
    background: oklch(1 0 0 / 0.97); backdrop-filter:saturate(1.5) blur(16px);
    border-top:1px solid var(--bd-line); border-radius:18px 18px 0 0;
    box-shadow:0 -12px 30px oklch(0.2 0.02 250 / 0.16); }
  .bd-sheet.open{ display:block; }

  .bd-sheet-sec{ font-size:var(--bd-fs-xs); font-weight:700; color:var(--bd-faint);
    text-transform:uppercase; letter-spacing:.04em; margin:4px 2px 10px; }
  .bd-sheet-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
  .bd-sheet-tile{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px;
    min-width:0; text-align:center; min-height:76px; padding:12px 5px; border-radius:var(--bd-r-sm);
    background:var(--bd-surface-2); border:1px solid var(--bd-line-soft); color:var(--bd-ink);
    font-family:inherit; font-size:0.875rem; font-weight:600; line-height:1.18; text-decoration:none;
    cursor:pointer; -webkit-tap-highlight-color:transparent; }
  .bd-sheet-tile .bd-sheet-lbl{ max-width:100%; overflow-wrap:break-word; }
  .bd-sheet-tile .bd-sheet-ic{ display:grid; place-items:center; color:var(--bd-cyan-strong); }
  .bd-sheet-tile .bd-sheet-ic svg{ width:26px; height:26px; }
  .bd-sheet-tile.disabled{ opacity:.45; pointer-events:none; }
  .bd-sheet-tile:focus-visible{ outline:2px solid var(--bd-cyan-strong); outline-offset:2px; }

  .bd-sheet-rows{ display:flex; flex-direction:column; }
  .bd-sheet-row{ display:flex; align-items:center; gap:10px; width:100%; text-align:left; padding:15px 8px;
    background:none; border:none; border-bottom:1px solid var(--bd-line-soft); color:var(--bd-ink);
    font-family:inherit; font-size:var(--bd-fs-base); font-weight:600; text-decoration:none;
    cursor:pointer; -webkit-tap-highlight-color:transparent; }
  .bd-sheet-row:last-child{ border-bottom:none; }
  .bd-sheet-back{ display:inline-flex; align-items:center; gap:6px; padding:2px 2px 12px;
    background:none; border:none; color:var(--bd-cyan-strong); font-family:inherit;
    font-size:var(--bd-fs-sm); font-weight:700; cursor:pointer; }

  /* apps ↔ admin view switch within the sheet */
  .bd-sheet-view--admin{ display:none; }
  .bd-sheet.show-admin .bd-sheet-view--apps{ display:none; }
  .bd-sheet.show-admin .bd-sheet-view--admin{ display:block; }

  /* The fixed bottom tab bar (z 1035) otherwise paints over the cookie bar's
     "got it" button (Bootstrap .fixed-bottom is z 1030, bottom:0), swallowing the
     tap. Lift the cookie bar above the tab bar so its button stays clickable. */
  #cookie-notice.fixed-bottom{ bottom:calc(64px + env(safe-area-inset-bottom)); z-index:1036; }
}

/* ---- tablet-only polish (641–980px): the bar/sheet would stretch edge-to-edge
   and look sparse, so cap their width + centre them, and give the app grid a
   4th column. Phones (≤640px) never match this and keep the full-bleed base. ---- */
@media (min-width:641px) and (max-width:980px){
  .bd-tabbar{ max-width:560px; margin-inline:auto; border:1px solid var(--bd-line); border-radius:16px 16px 0 0; }
  .bd-sheet{ max-width:560px; margin-inline:auto; }
  .bd-sheet-grid{ grid-template-columns:repeat(4,1fr); }
  /* reserve bottom room so page content isn't hidden behind the fixed bar */
  .bd-home{ padding-bottom:calc(82px + env(safe-area-inset-bottom)); }
}
