/* ==========================================================================
   EPMRS — iOS 26 Liquid Glass layer
   Loaded last (after glass.css → bootstrap → ui-suite.css → glass-bridge.css).
   Visual only: no markup contract, field names or behaviour depend on it.
   Uses the --g-* tokens so light and dark themes follow automatically.
   ========================================================================== */

/* ---------- 1. Liquid material tokens ---------- */
:root {
  --lg-clear: rgba(255, 255, 255, .42);
  --lg-clear-strong: rgba(255, 255, 255, .62);
  --lg-rim: linear-gradient(135deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .25) 38%, rgba(255, 255, 255, .08) 62%, rgba(255, 255, 255, .7));
  --lg-specular: radial-gradient(120% 70% at 50% -10%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 55%);
  --lg-inner: inset 0 1px 1px rgba(255, 255, 255, .85), inset 0 -1px 1px rgba(255, 255, 255, .25);
  --lg-float: 0 18px 50px -14px rgba(20, 30, 60, .28), 0 4px 14px -6px rgba(20, 30, 60, .14);
  --lg-press: cubic-bezier(.2, .9, .3, 1.25);
  --lg-radius-xl: 30px;
  --lg-control: rgba(255, 255, 255, .55);
  --lg-control-hover: rgba(255, 255, 255, .78);
  --lg-chip-shadow: 0 1px 2px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .45);
}
:root[data-theme="dark"] {
  --lg-clear: rgba(40, 44, 58, .40);
  --lg-clear-strong: rgba(36, 40, 54, .62);
  --lg-rim: linear-gradient(135deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, .06) 40%, rgba(255, 255, 255, .02) 62%, rgba(255, 255, 255, .22));
  --lg-specular: radial-gradient(120% 70% at 50% -10%, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 55%);
  --lg-inner: inset 0 1px 1px rgba(255, 255, 255, .14), inset 0 -1px 1px rgba(255, 255, 255, .04);
  --lg-float: 0 22px 56px -14px rgba(0, 0, 0, .7), 0 4px 14px -6px rgba(0, 0, 0, .5);
  --lg-control: rgba(255, 255, 255, .10);
  --lg-control-hover: rgba(255, 255, 255, .17);
  --lg-chip-shadow: 0 1px 2px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .22);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --lg-clear: rgba(40, 44, 58, .40);
    --lg-clear-strong: rgba(36, 40, 54, .62);
    --lg-rim: linear-gradient(135deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, .06) 40%, rgba(255, 255, 255, .02) 62%, rgba(255, 255, 255, .22));
    --lg-specular: radial-gradient(120% 70% at 50% -10%, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 55%);
    --lg-inner: inset 0 1px 1px rgba(255, 255, 255, .14), inset 0 -1px 1px rgba(255, 255, 255, .04);
    --lg-float: 0 22px 56px -14px rgba(0, 0, 0, .7), 0 4px 14px -6px rgba(0, 0, 0, .5);
    --lg-control: rgba(255, 255, 255, .10);
    --lg-control-hover: rgba(255, 255, 255, .17);
    --lg-chip-shadow: 0 1px 2px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .22);
  }
}

/* Richer, slowly-lit wallpaper so the glass has colour to bend */
body::before {
  background:
    radial-gradient(38rem 30rem at 85% -5%, rgba(255, 196, 120, .30), transparent 70%),
    var(--g-wall), var(--g-bg) !important;
}

/* ---------- 2. Glass panels: specular rim + top light ---------- */
.card, .epmrs-card, .epmrs-sidebar, .epmrs-topbar, .modal-content, .offcanvas, .epmrs-tabbar,
body.dashboard-page .dash-card {
  background-image: var(--lg-specular), var(--g-sheen);
  box-shadow: var(--lg-inner), 0 0 0 .5px var(--g-edge), var(--lg-float);
}
.card::after, .epmrs-card::after, .epmrs-sidebar::after, .epmrs-topbar::after, .modal-content::after, .offcanvas::after, .epmrs-tabbar::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--lg-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
.card, .epmrs-card { border-radius: 26px; border-color: transparent; }
/* the rim is drawn relative to the panel itself (no z-index, so no new stacking context) */
.epmrs-card { position: relative; }
.card > .card-header:first-child { border-radius: 26px 26px 0 0; }
/* Nested glass stays a plain fill (one blur layer only) and loses the rim */
:is(.card, .glass, .modal-content, .offcanvas, .epmrs-topbar, .epmrs-sidebar) :is(.card, .epmrs-card) {
  background-image: none; box-shadow: none;
}
:is(.card, .glass, .modal-content, .offcanvas, .epmrs-topbar, .epmrs-sidebar) :is(.card, .epmrs-card)::after { display: none; }
.alert.epmrs-card::after { display: none; }
.alert.epmrs-card { background-image: none; box-shadow: none; }

/* Gentle lift on interactive cards */
a.card, .card.card-hover, .epmrs-card[data-href] { transition: transform 300ms var(--g-ease), box-shadow 300ms var(--g-ease); }
a.card:hover, .card.card-hover:hover { transform: translateY(-2px); }

/* ---------- 3. Shell: floating sidebar, capsule toolbar ---------- */
.epmrs-sidebar {
  background-color: var(--lg-clear);
  border-radius: var(--lg-radius-xl);
  border-color: transparent;
}
.epmrs-brand-lockup { border-bottom: 0; padding-bottom: 6px; }
.epmrs-brand { letter-spacing: .04em; font-weight: 800; }
.epmrs-brand-logo { box-shadow: 0 0 0 1px rgba(255, 255, 255, .7), 0 6px 18px -6px rgba(0, 0, 0, .35); }

.epmrs-nav-link {
  min-height: 42px; padding: 6px 10px;
  border-radius: 14px;
  color: var(--g-text);
  font-weight: 500;
  transition: background-color 220ms var(--g-ease), box-shadow 220ms var(--g-ease), transform 160ms var(--lg-press);
}
.epmrs-nav-link > span:first-child { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.epmrs-nav-link:hover { background: var(--lg-control); }
.epmrs-nav-link:active { transform: scale(.97); }
.epmrs-nav-link.active {
  background: var(--lg-clear-strong);
  color: var(--g-text);
  font-weight: 600;
  box-shadow: var(--lg-inner), 0 0 0 .5px var(--g-edge), 0 6px 16px -8px rgba(20, 30, 60, .35);
}

/* iOS Settings-style coloured icon chips */
.epmrs-nav-icon {
  --tone: #8e8e93;
  flex: 0 0 auto;
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 78%, #fff), var(--tone));
  box-shadow: var(--lg-chip-shadow);
  font-size: 14px;
}
.epmrs-nav-icon i { margin: 0 !important; width: auto !important; color: #fff !important; }
.epmrs-nav-icon[data-tone="overview"] { --tone: #0a84ff; }
.epmrs-nav-icon[data-tone="planning"] { --tone: #34c759; }
.epmrs-nav-icon[data-tone="reporting"] { --tone: #ff9500; }
.epmrs-nav-icon[data-tone="organization"] { --tone: #5e5ce6; }
.epmrs-nav-icon[data-tone="oversight"] { --tone: #ff375f; }
.epmrs-nav-icon[data-tone="ai"] { --tone: #bf5af2; }
.epmrs-nav-icon[data-tone="system"] { --tone: #8e8e93; }
.epmrs-nav-icon[data-tone="staff"] { --tone: #30b0c7; }
@supports not (background: color-mix(in srgb, red, blue)) {
  .epmrs-nav-icon { background: var(--tone); }
}

.epmrs-nav-group__title { color: var(--g-text-2); font-size: 12px; letter-spacing: .03em; padding: 10px 12px 6px; }
.epmrs-nav-group__title:hover { background: transparent; color: var(--g-text); }

.epmrs-topbar {
  background-color: var(--lg-clear);
  border-color: transparent;
  padding: 7px 8px 7px 12px;
  min-height: 58px;
}

/* ---------- 4. Buttons: liquid capsules ---------- */
.btn {
  --lg-mx: 50%; --lg-my: 0%;
  position: relative;
  min-height: 40px;
  border-radius: var(--g-pill);
  font-weight: 600;
  letter-spacing: -.005em;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  background-image: radial-gradient(90% 120% at var(--lg-mx) var(--lg-my), rgba(255, 255, 255, .38), rgba(255, 255, 255, 0) 60%);
  box-shadow: var(--lg-inner);
  transition: transform 220ms var(--lg-press), box-shadow 220ms var(--g-ease), background-color 220ms var(--g-ease), color 220ms var(--g-ease), filter 220ms;
}
.btn.d-block, .btn.w-100, .d-grid > .btn { display: flex; }
.btn-sm { min-height: 32px; font-size: 13px; }
.btn-lg { min-height: 50px; }
.btn:active, .btn.active { transform: scale(.95); }
.btn:focus-visible { box-shadow: var(--lg-inner), var(--g-focus); }
.btn i { line-height: 1; }

/* Prominent (tinted) glass: primary actions */
.btn-primary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-dark {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 8px 20px -8px var(--lg-glow, rgba(0, 122, 255, .7));
}
.btn-primary { --lg-glow: rgba(0, 122, 255, .75); }
.btn-success { --lg-glow: rgba(52, 199, 89, .7); }
.btn-danger { --lg-glow: rgba(255, 59, 48, .7); }
.btn-warning { --lg-glow: rgba(255, 149, 0, .7); --bs-btn-bg: #ff9f0a; --bs-btn-border-color: #ff9f0a; --bs-btn-color: #fff; --bs-btn-hover-bg: #ff9f0a; --bs-btn-hover-color: #fff; }
.btn-primary:hover, .btn-success:hover, .btn-danger:hover, .btn-warning:hover { filter: brightness(1.07) saturate(1.05); transform: translateY(-1px); }

/* Regular glass: secondary / neutral actions */
.btn-light, .btn-secondary, .btn-outline-secondary, .btn-outline-dark, .btn-outline-light {
  --bs-btn-bg: var(--lg-control);
  --bs-btn-hover-bg: var(--lg-control-hover);
  --bs-btn-active-bg: var(--lg-control-hover);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-border-color: transparent;
  --bs-btn-color: var(--g-text);
  --bs-btn-hover-color: var(--g-text);
  -webkit-backdrop-filter: blur(12px) saturate(170%);
  backdrop-filter: blur(12px) saturate(170%);
  box-shadow: var(--lg-inner), 0 0 0 .5px var(--g-edge), 0 4px 12px -6px rgba(20, 30, 60, .25);
}
/* Inside a glass panel a control is a fill, never a second blur */
:is(.card, .epmrs-card, .modal-content, .offcanvas, .epmrs-sidebar, .dropdown-menu) :is(.btn-light, .btn-secondary, .btn-outline-secondary, .btn-outline-dark, .btn-outline-light) {
  -webkit-backdrop-filter: none; backdrop-filter: none;
  --bs-btn-bg: var(--g-fill);
  --bs-btn-hover-bg: var(--g-fill-hover);
  box-shadow: var(--lg-inner);
}
/* Tinted outline buttons keep their colour, gain the liquid highlight */
.btn-outline-primary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info { box-shadow: var(--lg-inner); }
.btn-outline-info { --bs-btn-color: var(--g-accent); --bs-btn-border-color: transparent; --bs-btn-bg: var(--g-accent-tint); --bs-btn-hover-bg: var(--g-accent); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: var(--g-accent); }
.btn-link { box-shadow: none; background-image: none; min-height: 0; }

/* Round icon buttons (toolbar) */
.btn.rounded-circle { width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 50% !important; }
.epmrs-topbar .btn { min-height: 42px; }
.epmrs-topbar .btn-primary.d-lg-none { width: 42px; padding: 0; }

.btn-close { width: 30px; height: 30px; padding: 0; background-color: var(--g-fill); background-size: 10px; opacity: .8; border-radius: 50%; }
.btn-close:hover { opacity: 1; background-color: var(--g-fill-hover); }

/* ---------- 5. Typography: large titles ---------- */
.epmrs-main :is(h1, h2, h3) { letter-spacing: -.02em; font-weight: 800; }
.epmrs-main > .container > .d-flex:first-child h4,
.epmrs-main > .container-fluid > .d-flex:first-child h4,
.epmrs-main > div > .d-flex:first-child > div > h4.mb-1,
.epmrs-main h4.mb-1:only-of-type {
  font-size: clamp(1.45rem, 1.1rem + 1vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -.02em;
}
.card-title, .card h5 { font-weight: 700; letter-spacing: -.01em; }

/* ---------- 6. Forms: soft wells ---------- */
.form-control, .form-select, .input-group-text {
  min-height: 44px;
  border-radius: 14px;
  background-color: var(--g-fill);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06);
}
textarea.form-control { min-height: 88px; }
.form-control-sm, .form-select-sm { min-height: 34px; border-radius: 11px; }
.form-control:focus, .form-select:focus {
  background-color: var(--lg-control-hover);
  box-shadow: 0 0 0 4px var(--g-accent-tint), inset 0 0 0 1px var(--g-accent);
}
.input-group > .input-group-text { border-radius: 14px; }
.form-check-input { width: 1.2em; height: 1.2em; border-radius: .4em; }
.form-check-input[type="radio"] { border-radius: 50%; }
.form-switch .form-check-input { width: 2.6em; height: 1.55em; border-radius: 2em; border: 0; background-color: var(--g-fill-hover); box-shadow: inset 0 0 0 1px var(--g-separator); }
.form-switch .form-check-input:checked { background-color: #34c759; box-shadow: none; }
.form-range::-webkit-slider-thumb { background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }

/* ---------- 7. Menus, modals, toasts ---------- */
.dropdown-menu {
  --bs-dropdown-bg: var(--lg-clear-strong);
  background-image: var(--lg-specular);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  backdrop-filter: blur(28px) saturate(190%);
  border-radius: 20px;
  border-color: transparent;
  box-shadow: var(--lg-inner), 0 0 0 .5px var(--g-edge), var(--lg-float);
  padding: 6px;
  transform-origin: top;
}
.dropdown-menu.show { animation: lg-pop 260ms var(--lg-press); }
.dropdown-item { border-radius: 12px; padding: .5rem .75rem; }
/* A menu inside the blurred topbar cannot blur what is behind the topbar: keep it legible */
.epmrs-topbar .dropdown-menu { --bs-dropdown-bg: var(--g-surface-thick); }

.modal-content { border-radius: 32px; border-color: transparent; }
.modal.fade .modal-dialog { transform: translateY(24px) scale(.96); transition: transform 380ms var(--lg-press), opacity 200ms; }
.modal.show .modal-dialog { transform: none; }
.modal-header, .modal-footer { border: 0; }
.modal-footer { gap: .5rem; }
.toast { border-radius: 20px; }
.offcanvas { border-radius: 0 28px 28px 0; }
.offcanvas-end { border-radius: 28px 0 0 28px; }

@keyframes lg-pop {
  from { opacity: 0; transform: translateY(-4px) scale(.96); }
  to { opacity: 1; transform: none; }
}

/* ---------- 8. Status: capsules, segmented controls ---------- */
.badge { border-radius: var(--g-pill); padding: .42em .8em; font-weight: 600; letter-spacing: 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
#notif-badge.bg-danger, [data-chat-badge].bg-danger { box-shadow: 0 0 0 2px var(--g-surface-thick); }
.progress, .progress-stacked { height: .6rem; background-color: var(--g-fill); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08); }
.progress-bar { border-radius: var(--g-pill); background-image: linear-gradient(180deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0)); }
.alert { border-radius: 20px; box-shadow: var(--lg-inner); }

.nav-pills, .nav-tabs, .epmrs-segmented {
  display: inline-flex; flex-wrap: wrap; gap: 4px;
  padding: 4px;
  border: 0;
  border-radius: var(--g-pill);
  background: var(--g-fill);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06);
  max-width: 100%;
}
.nav-pills .nav-link, .nav-tabs .nav-link {
  border: 0 !important;
  border-radius: var(--g-pill) !important;
  background: transparent !important;
  color: var(--g-text-2);
  font-weight: 500;
  min-height: 36px; padding: .4rem 1rem;
  display: inline-flex; align-items: center; gap: .4rem;
  transition: background-color 220ms var(--g-ease), color 220ms, box-shadow 220ms;
}
.nav-pills .nav-link:hover, .nav-tabs .nav-link:hover { color: var(--g-text); }
.nav-pills .nav-link.active, .nav-tabs .nav-link.active, .epmrs-segmented__item[aria-current="page"] {
  background: var(--lg-clear-strong) !important;
  color: var(--g-text) !important;
  font-weight: 600;
  box-shadow: var(--lg-inner), 0 0 0 .5px var(--g-edge), 0 3px 10px -4px rgba(20, 30, 60, .3);
}
.pagination .page-link { min-width: 36px; text-align: center; box-shadow: var(--lg-inner); }

/* ---------- 9. Tables: one panel, airy rows ---------- */
.table > thead > tr > th {
  background: var(--g-fill) !important;
  border-bottom: 0;
  padding-block: .7rem;
}
.table > thead > tr > th:first-child { border-start-start-radius: 14px; border-end-start-radius: 14px; }
.table > thead > tr > th:last-child { border-start-end-radius: 14px; border-end-end-radius: 14px; }
.table > tbody > tr > td { padding-block: .75rem; }
.table-hover > tbody > tr { transition: background-color 160ms; }
.table > tbody > tr:last-child > td { border-bottom: 0; }
.epmrs-official-table > thead > tr > th { border-radius: 0 !important; background: var(--g-green-tint) !important; }

/* ---------- 10. Dashboard widgets ---------- */
body.dashboard-page .dash-card { border-radius: 26px; border-color: transparent; }
.metric-value { font-weight: 800; }

/* ---------- 11. Phones: floating glass tab bar ---------- */
.epmrs-tabbar { display: none; }
@media (max-width: 767.98px) {
  .epmrs-tabbar {
    position: fixed; z-index: 1035;
    inset-inline: 12px;
    inset-block-end: max(12px, env(safe-area-inset-bottom));
    display: flex; justify-content: space-around; align-items: stretch;
    gap: 2px; padding: 6px;
    border-radius: var(--g-pill);
    background-color: var(--lg-clear-strong);
    -webkit-backdrop-filter: blur(26px) saturate(190%);
    backdrop-filter: blur(26px) saturate(190%);
  }
  .epmrs-tabbar__item {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 52px; padding: 4px 2px;
    border: 0; background: transparent;
    border-radius: var(--g-pill);
    color: var(--g-text-2);
    font-size: 10.5px; font-weight: 600; line-height: 1.15;
    text-decoration: none;
    transition: background-color 220ms var(--g-ease), color 220ms, transform 180ms var(--lg-press);
    position: relative; z-index: 2;
  }
  .epmrs-tabbar__item i { font-size: 18px; }
  .epmrs-tabbar__item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .epmrs-tabbar__item:active { transform: scale(.92); }
  .epmrs-tabbar__item[aria-current="page"] { color: var(--g-accent); background: var(--g-fill); }
  .epmrs-tabbar__item .badge { position: absolute; top: 4px; inset-inline-end: 22%; font-size: 9px; padding: .3em .5em; }
  body.has-tabbar .epmrs-main { padding-bottom: 96px !important; }
  body.has-tabbar .epmrs-ai-chat { inset-block-end: calc(92px + env(safe-area-inset-bottom)) !important; }
  body.has-tabbar .toast-container { padding-bottom: 96px !important; }
  /* The tab bar's "menu" item opens navigation on phones */
  body.has-tabbar .epmrs-topbar .btn-primary.d-lg-none { display: none !important; }
  .card, .epmrs-card { border-radius: 22px; }
  .epmrs-topbar { border-radius: 26px; }
}

/* ---------- 12. Accessibility & fallbacks ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn, .epmrs-nav-link, .modal.fade .modal-dialog, .dropdown-menu.show { transition: none !important; animation: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .btn-light, .btn-secondary, .btn-outline-secondary, .dropdown-menu, .epmrs-tabbar { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background-color: var(--g-surface-solid) !important; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .epmrs-sidebar, .epmrs-topbar, .epmrs-tabbar, .dropdown-menu { background-color: var(--g-surface-solid); }
}
:root[data-contrast="high"] .card::after, :root[data-contrast="high"] .epmrs-card::after { display: none; }

@media print {
  .epmrs-tabbar { display: none !important; }
  .card::after, .epmrs-card::after { display: none !important; }
  .card, .epmrs-card { box-shadow: none !important; background-image: none !important; }
}

/* Dashboard page ships its own sidebar colours; keep the glass selection there too */
html:root body.dashboard-page .epmrs-sidebar .epmrs-nav-link.active.active {
  background: var(--lg-clear-strong);
  color: var(--g-text);
  font-weight: 600;
  box-shadow: var(--lg-inner), 0 0 0 .5px var(--g-edge), 0 6px 16px -8px rgba(20, 30, 60, .35);
}
html:root body.dashboard-page .epmrs-sidebar .epmrs-nav-link { color: var(--g-text); }
html:root body.dashboard-page :is(.dash-metric, .dash-card, .dash-completion, .dash-steps) {
  border-radius: 24px;
  border-color: transparent;
  background-image: var(--lg-specular), var(--g-sheen);
  box-shadow: var(--lg-inner), 0 0 0 .5px var(--g-edge), var(--lg-float);
}
html:root body.dashboard-page :is(.dash-metric, .dash-card, .dash-steps) {
  background-color: var(--g-surface);
  -webkit-backdrop-filter: blur(var(--g-blur)) saturate(var(--g-sat));
  backdrop-filter: blur(var(--g-blur)) saturate(var(--g-sat));
}
html:root body.dashboard-page .dash-symbol { border-radius: 10px; box-shadow: var(--lg-chip-shadow); }
html:root body.dashboard-page .dashboard-shell .epmrs-card { border-radius: 24px; }

/* Chat voice notes */
.epmrs-chat-voice { display: block; flex: 1 1 auto; width: 260px; min-width: 200px; max-width: 100%; height: 40px; margin-block: 4px; border-radius: var(--g-pill); }
.epmrs-voice-recorder { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: var(--g-pill); background: var(--g-red-tint); color: var(--g-text); }
.epmrs-voice-recorder[hidden] { display: none; }
.epmrs-voice-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 0 0 rgba(255, 59, 48, .6); animation: lg-rec 1.4s ease-out infinite; }
.epmrs-voice-timer { font-variant-numeric: tabular-nums; color: var(--g-text-2); }
@keyframes lg-rec { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, .55); } 100% { box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); } }
@media (prefers-reduced-motion: reduce) { .epmrs-voice-dot { animation: none; } }
.epmrs-chat-voice-row { display: flex; align-items: center; gap: 8px; }
.epmrs-chat-voice-row > i { opacity: .8; }
.epmrs-chat-voice-len { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .8; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
@media (max-width: 575.98px) { .epmrs-chat-voice { width: 200px; min-width: 160px; } }

/* ==========================================================================
   Sign-in pages (login, forgot / reset password, two-step code)
   ========================================================================== */
body.auth-page .epmrs-topbar,
body.auth-page .epmrs-main > .alert,
body.auth-page .epmrs-breadcrumb { display: none !important; }
body.auth-page .epmrs-shell { padding: 0; }
body.auth-page .epmrs-main { padding: 0 !important; }
/* Signed-in full-screen pages (such as the policy consent) still show the phone tab bar:
   keep room for it so the last controls on the page are not hidden underneath. */
@media (max-width: 767.98px) {
  body.auth-page.has-tabbar .epmrs-main { padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
}
body.auth-page::before {
  background:
    radial-gradient(48rem 36rem at 10% 0%, rgba(10, 132, 255, .42), transparent 70%),
    radial-gradient(40rem 32rem at 100% 20%, rgba(255, 159, 10, .30), transparent 70%),
    radial-gradient(44rem 36rem at 70% 105%, rgba(52, 199, 89, .32), transparent 70%),
    var(--g-wall), var(--g-bg) !important;
}

.auth-wrap {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
.auth-card {
  position: relative;
  width: min(460px, 100%);
  padding: clamp(22px, 5vw, 36px);
  border-radius: 34px;
  background: var(--lg-specular), var(--g-sheen), var(--lg-clear-strong);
  -webkit-backdrop-filter: blur(34px) saturate(190%);
  backdrop-filter: blur(34px) saturate(190%);
  box-shadow: var(--lg-inner), 0 0 0 .5px var(--g-edge), 0 30px 80px -24px rgba(20, 30, 60, .45);
  color: var(--g-text);
  animation: auth-in 520ms var(--lg-press) both;
}
.auth-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--lg-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
@keyframes auth-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

.auth-brand { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 12px; text-align: center; direction: ltr; }
.auth-brand img { width: 56px; height: 56px; object-fit: contain; border-radius: 50%; background: #fff; padding: 3px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .8), 0 6px 16px -6px rgba(0, 0, 0, .35); }
.auth-brand__text { direction: inherit; line-height: 1.5; }
[dir="rtl"] .auth-brand__text { direction: rtl; }
.auth-brand__text strong { display: block; font-size: 14px; }
.auth-brand__text span { display: block; font-size: 12px; color: var(--g-text-2); }

.auth-heading { text-align: center; margin: 26px 0 20px; }
.auth-heading__icon {
  display: inline-grid; place-items: center; width: 58px; height: 58px; margin-bottom: 12px;
  border-radius: 18px; color: #fff; font-size: 24px;
  background: linear-gradient(160deg, #4aa3ff, #0a6cff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 12px 26px -10px rgba(10, 108, 255, .8);
}
.auth-heading h1 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.8rem); font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-heading p { margin: 0 auto; max-width: 34ch; color: var(--g-text-2); font-size: 14px; line-height: 1.8; }

.auth-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; margin-bottom: 14px; font-size: 14px; line-height: 1.7; animation: auth-shake 380ms var(--g-ease) 1; }
.auth-alert i { margin-top: 4px; }
.auth-alert--error { background: var(--g-red-tint); color: var(--g-red); }
.auth-alert--warn { background: var(--g-orange-tint); color: var(--g-orange); animation: none; }
.auth-alert--ok { background: var(--g-green-tint); color: var(--g-green); animation: none; }
@keyframes auth-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

.auth-form { display: grid; gap: 16px; }
.auth-field { display: grid; gap: 7px; }
.auth-field label, .auth-field__row label { font-size: 13px; font-weight: 600; color: var(--g-text-2); }
.auth-field__row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.auth-link { font-size: 13px; font-weight: 600; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

.auth-input {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 14px;
  border-radius: 16px;
  background: var(--g-fill);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06), inset 0 0 0 1px transparent;
  transition: box-shadow 200ms var(--g-ease), background-color 200ms;
}
.auth-input > i { color: var(--g-text-3); width: 18px; text-align: center; }
.auth-input input {
  flex: 1 1 auto; min-width: 0; height: 50px;
  border: 0; outline: 0; background: transparent; color: var(--g-text);
  font: inherit; font-size: 16px;
}
[dir="rtl"] .auth-input input[dir="ltr"] { text-align: right; }
[dir="rtl"] .auth-input input[dir="ltr"]:not(:placeholder-shown) { text-align: left; }
.auth-input:focus-within { background: var(--lg-control-hover); box-shadow: 0 0 0 4px var(--g-accent-tint), inset 0 0 0 1px var(--g-accent); }
.auth-input:focus-within > i { color: var(--g-accent); }
.auth-input.is-invalid { box-shadow: 0 0 0 4px var(--g-red-tint), inset 0 0 0 1px var(--g-red); }
.auth-input__toggle {
  display: grid; place-items: center; width: 38px; height: 38px; margin-inline-end: -6px;
  border: 0; border-radius: 50%; background: transparent; color: var(--g-text-2); cursor: pointer;
  transition: background-color 160ms;
}
.auth-input__toggle:hover { background: var(--g-fill-hover); }
.auth-input__toggle:focus-visible { outline: none; box-shadow: var(--g-focus); }

.auth-code {
  width: 100%; height: 64px; border: 0; border-radius: 18px; background: var(--g-fill);
  text-align: center; font-size: 30px; font-weight: 700; letter-spacing: .45em; font-variant-numeric: tabular-nums; color: var(--g-text);
}
.auth-code:focus { outline: none; box-shadow: 0 0 0 4px var(--g-accent-tint), inset 0 0 0 1px var(--g-accent); }

.auth-hint { font-size: 12.5px; color: var(--g-text-2); margin: 0; line-height: 1.7; }
.auth-hint--warn { color: var(--g-orange); font-weight: 600; }
.auth-hint[hidden] { display: none; }

.auth-strength { height: 6px; border-radius: 999px; background: var(--g-fill); overflow: hidden; }
.auth-strength span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 260ms var(--g-ease), background-color 260ms; }
.auth-strength[data-level="1"] span { width: 20%; background: var(--g-red); }
.auth-strength[data-level="2"] span { width: 40%; background: var(--g-orange); }
.auth-strength[data-level="3"] span { width: 65%; background: #ffcc00; }
.auth-strength[data-level="4"] span { width: 85%; background: var(--g-green); }
.auth-strength[data-level="5"] span { width: 100%; background: var(--g-green); }

.auth-remember { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--g-text-2); cursor: pointer; width: fit-content; }
.auth-remember .form-check-input { margin: 0; width: 1.25em; height: 1.25em; }

.auth-submit { width: 100%; min-height: 54px; font-size: 17px; border-radius: 18px !important; gap: 10px; }
.auth-submit.is-busy { pointer-events: none; opacity: .85; }
.auth-submit.is-busy i { animation: auth-spin 900ms linear infinite; }
.auth-submit.is-busy i::before { content: "\f110"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-back { display: inline-flex; align-items: center; gap: 8px; justify-self: center; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--g-text-2); }
.auth-back:hover { color: var(--g-accent); }

.auth-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--g-separator); display: grid; gap: 10px; justify-items: center; text-align: center; }
.auth-langs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--g-fill); }
.auth-langs a { padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--g-text-2); text-decoration: none; }
.auth-langs a[aria-current="true"] { background: var(--lg-clear-strong); color: var(--g-text); box-shadow: var(--lg-inner), 0 2px 8px -4px rgba(0, 0, 0, .3); }
.auth-footer__name { font-size: 12px; color: var(--g-text-3); }

@media (max-width: 420px) {
  .auth-wrap { place-items: start center; padding-top: max(18px, env(safe-area-inset-top)); }
  .auth-card { border-radius: 28px; }
  .auth-brand { grid-template-columns: 44px 1fr 44px; gap: 8px; }
  .auth-brand img { width: 44px; height: 44px; }
  .auth-brand__text strong { font-size: 13px; }
  .auth-brand__text span { font-size: 11px; }
  .auth-heading { margin: 20px 0 16px; }
  .auth-heading__icon { width: 50px; height: 50px; font-size: 21px; border-radius: 15px; }
}
@media (min-height: 900px) and (min-width: 768px) { .auth-card { width: min(480px, 100%); } }
@media (prefers-reduced-motion: reduce) { .auth-card, .auth-alert { animation: none; } }
/* the field frame is drawn by .auth-input; the bare input inside must stay invisible */
.auth-input input, .auth-input input:focus, .auth-input input:hover {
  border: 0 !important; outline: none !important; box-shadow: none !important;
  background: transparent !important; border-radius: 0 !important; padding: 0 !important; min-height: 0 !important;
}
.auth-input input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px transparent inset !important; -webkit-text-fill-color: var(--g-text); transition: background-color 9999s; }
.auth-install { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--g-accent-tint); color: var(--g-accent); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.auth-install[hidden] { display: none; }
.auth-install:hover { background: var(--g-accent); color: #fff; }

/* ---------- Notification popups (small, never covers the page) ---------- */
.epmrs-popup-stack {
  position: fixed; z-index: 1085;
  inset-block-end: calc(20px + env(safe-area-inset-bottom));
  inset-inline-start: 20px;
  width: min(360px, calc(100vw - 24px));
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.epmrs-popup {
  pointer-events: auto; cursor: pointer;
  position: relative; overflow: hidden;
  padding: 12px 14px 10px;
  border-radius: 22px;
  background: var(--lg-clear-strong);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow: var(--lg-float), var(--lg-inner);
  border: 1px solid rgba(255, 255, 255, .45);
  color: var(--g-text, inherit);
  animation: epmrs-popup-in 320ms var(--lg-press) both;
  transition: transform 180ms var(--lg-press), opacity 200ms;
}
.epmrs-popup:hover { transform: translateY(-2px); }
.epmrs-popup:focus-visible { outline: 3px solid var(--g-accent, #0a84ff); outline-offset: 2px; }
.epmrs-popup.is-leaving { opacity: 0; transform: translateY(10px) scale(.97); }
/* a finger can swipe popups sideways to remove them; the page still scrolls up and down */
.epmrs-popup, [data-toast-container] .toast, [data-push-banner] { touch-action: pan-y; }
.epmrs-popup__head { display: flex; align-items: center; gap: 8px; }
.epmrs-popup__icon {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px;
  color: #fff; background: linear-gradient(135deg, #ff9f0a, #ff375f);
}
.epmrs-popup__title { flex: 1; font-size: 13.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.epmrs-popup__close {
  flex: none; width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: var(--lg-control); color: inherit; font-size: 13px;
  display: grid; place-items: center;
}
.epmrs-popup__close:hover { background: var(--lg-control-hover); }
.epmrs-popup__body {
  margin: 8px 0 6px; font-size: 13px; line-height: 1.7;
  white-space: pre-line; max-height: 9.5em; overflow-y: auto;
}
.epmrs-popup__foot { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; opacity: .75; }
.epmrs-popup__open { font-weight: 600; color: var(--g-accent, #0a84ff); opacity: 1; }
:root[data-theme="dark"] .epmrs-popup { border-color: rgba(255, 255, 255, .14); background: rgba(30, 34, 46, .9); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .epmrs-popup { border-color: rgba(255, 255, 255, .14); background: rgba(30, 34, 46, .9); }
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .epmrs-popup { background: rgba(255, 255, 255, .86); }
}
@keyframes epmrs-popup-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@media (prefers-reduced-motion: reduce) { .epmrs-popup { animation: none; transition: none; } }
@media (max-width: 991.98px) {
  body.has-tabbar .epmrs-popup-stack { inset-block-end: calc(96px + env(safe-area-inset-bottom)); }
  .epmrs-popup-stack { inset-inline-start: 12px; }
}
/* Phones: one popup at a time (the rest wait in the queue), short, so the page stays usable */
@media (max-width: 575.98px) {
  .epmrs-popup__body { max-height: 6.8em; }
}
/* Priority colours and the 10-second countdown line */
.epmrs-popup--critical { border-inline-start: 5px solid #ff3b30; }
.epmrs-popup--high { border-inline-start: 5px solid #ff9f0a; }
.epmrs-popup--low .epmrs-popup__icon, .epmrs-popup--normal .epmrs-popup__icon { background: linear-gradient(135deg, #0a84ff, #5e5ce6); }
.epmrs-popup--critical .epmrs-popup__icon { background: linear-gradient(135deg, #ff3b30, #ff2d55); }
.epmrs-popup__progress {
  position: absolute; inset-inline: 0; inset-block-end: 0; height: 3px;
  background: currentColor; opacity: .25; transform-origin: inline-start;
  animation: epmrs-popup-countdown linear forwards;
}
[dir="rtl"] .epmrs-popup__progress { transform-origin: right; }
[dir="ltr"] .epmrs-popup__progress { transform-origin: left; }
.epmrs-popup.is-paused .epmrs-popup__progress { animation-play-state: paused; }
@keyframes epmrs-popup-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .epmrs-popup__progress { animation: none; display: none; } }

/* ---------- Collapsible sidebar (☰ on every screen size) ---------- */
@media (min-width: 992px) {
  html.sidebar-animate .epmrs-sidebar {
    transition: width 280ms var(--g-ease, ease), flex-basis 280ms var(--g-ease, ease), padding 280ms, margin 280ms, opacity 200ms;
  }
  html.sidebar-collapsed .epmrs-sidebar {
    width: 0 !important; flex-basis: 0 !important;
    padding-inline: 0 !important; margin-inline-end: -16px;
    border-width: 0 !important; opacity: 0; overflow: hidden !important;
    pointer-events: none;
  }
}
.epmrs-menu-toggle { width: 42px; height: 42px; display: inline-grid; place-items: center; flex: none; }
@media (prefers-reduced-motion: reduce) { html.sidebar-animate .epmrs-sidebar { transition: none; } }

/* ---------- Avatars & presence ---------- */
.epmrs-avatar {
  --av-size: 40px;
  position: relative; flex: none;
  width: var(--av-size); height: var(--av-size);
  border-radius: 50%;
  display: inline-grid; place-items: center;
  background: hsl(var(--av-hue, 210) 55% 52%);
  color: #fff; font-weight: 700;
  font-size: calc(var(--av-size) * .38); line-height: 1;
  box-shadow: 0 0 0 2px var(--g-surface-thick, #fff);
}
.epmrs-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.epmrs-avatar--group { background: linear-gradient(135deg, #5e5ce6, #0a84ff); }
.epmrs-avatar__initials { letter-spacing: .02em; }
.epmrs-avatar__dot {
  position: absolute; inset-block-end: 1px; inset-inline-end: 1px;
  width: max(10px, calc(var(--av-size) * .26)); height: max(10px, calc(var(--av-size) * .26));
  border-radius: 50%;
  background: #8e8e93;
  box-shadow: 0 0 0 2px var(--g-surface-thick, #fff);
  display: none;
}
.epmrs-avatar__dot.is-online { display: block; background: #31c75a; }

/* ---------- Compact chat list (WhatsApp-like) ---------- */
.epmrs-chat-list { display: flex; flex-direction: column; }
.epmrs-chat-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px; border-radius: 16px;
  color: inherit; text-decoration: none;
  transition: background-color 160ms;
}
.epmrs-chat-row + .epmrs-chat-row { border-top: 1px solid var(--g-separator, rgba(0, 0, 0, .06)); }
.epmrs-chat-row:hover, .epmrs-chat-row:focus-visible { background: var(--g-fill, rgba(0, 0, 0, .04)); color: inherit; }
.epmrs-chat-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.epmrs-chat-row__top, .epmrs-chat-row__bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.epmrs-chat-row__name { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.epmrs-chat-row__seen { font-weight: 400; font-size: 11px; color: var(--bs-secondary-color); margin-inline-start: 6px; direction: ltr; unicode-bidi: isolate; }
.epmrs-chat-row__seen.is-online { color: #16a34a; }
.epmrs-chat-row__time { font-size: 11.5px; color: var(--g-text-2, #6b7280); white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.epmrs-chat-row__preview { font-size: 13px; color: var(--g-text-2, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.epmrs-chat-row.has-unread .epmrs-chat-row__preview { color: var(--g-text, inherit); font-weight: 600; }
.epmrs-chat-row.has-unread .epmrs-chat-row__time { color: #25a244; font-weight: 600; }
.epmrs-chat-row__badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: #25a244; color: #fff; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center; flex: none;
}

/* ---------- Message ticks: 1 grey = sent, 2 grey = delivered, 2 blue = read ---------- */
.epmrs-ticks, .epmrs-chat-message-status { color: #8696a0; }
.epmrs-ticks[data-status="seen"], .epmrs-chat-message-status[data-status="seen"] { color: #34b7f1; }
.epmrs-chat-message-status { display: flex; justify-content: flex-end; align-items: center; font-size: .8rem; line-height: 1; }

/* ---------- Chat bubbles ---------- */
.epmrs-chat-message { padding: 8px 12px 6px; border-radius: 18px; box-shadow: 0 1px 1.5px rgba(0, 0, 0, .12); }
.epmrs-bubble--own { background: #d9fdd3; color: #111b21; border-end-end-radius: 6px; }
.epmrs-bubble--other { background: var(--g-surface-thick, #fff); color: var(--g-text, #111b21); border-end-start-radius: 6px; }
.epmrs-bubble--own .text-muted { color: #667781 !important; }
:root[data-theme="dark"] .epmrs-bubble--own { background: #005c4b; color: #e9edef; }
:root[data-theme="dark"] .epmrs-bubble--own .text-muted { color: rgba(233, 237, 239, .7) !important; }
:root[data-theme="dark"] .epmrs-bubble--other { background: #202c33; color: #e9edef; }
:root[data-theme="dark"] .epmrs-ticks, :root[data-theme="dark"] .epmrs-chat-message-status { color: rgba(233, 237, 239, .6); }
:root[data-theme="dark"] .epmrs-ticks[data-status="seen"], :root[data-theme="dark"] .epmrs-chat-message-status[data-status="seen"] { color: #53bdeb; }

/* Report entry control */
.epmrs-entry-state { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 18px; color: #fff; }
.epmrs-entry-state.is-open { background: linear-gradient(135deg, #34c759, #248a3d); }
.epmrs-entry-state.is-closed { background: linear-gradient(135deg, #ff453a, #c9342b); }

/* Detail-page actions that need a written reason */
.epmrs-action-form { position: relative; }
.epmrs-action-form > summary { list-style: none; }
.epmrs-action-form > summary::-webkit-details-marker { display: none; }
.epmrs-action-form__panel {
  position: absolute; z-index: 30; inset-inline-end: 0; top: calc(100% + 6px);
  width: min(340px, calc(100vw - 32px)); padding: 12px; border-radius: 16px;
  background: var(--g-surface-solid, #fff); box-shadow: var(--lg-float);
}

/* Report entered by a substitute */
.epmrs-delegation-card { background: linear-gradient(135deg, #0a84ff, #0060df); border-radius: 20px; box-shadow: var(--lg-float); }

/* ---------- Weak / lost internet bar ---------- */
.epmrs-offline-bar {
  position: fixed; z-index: 1090; inset-inline: 50% auto; inset-block-start: 10px; transform: translateX(50%);
  max-width: min(680px, calc(100vw - 24px)); padding: 8px 16px; border-radius: 999px;
  background: #0a84ff; color: #fff; font-size: 13px; box-shadow: var(--lg-float, 0 8px 24px rgba(0,0,0,.2));
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
}
[dir="ltr"] .epmrs-offline-bar { transform: translateX(-50%); inset-inline: 50% auto; }
.epmrs-offline-bar.is-offline { background: #ff9f0a; color: #1c1c1e; }
.epmrs-offline-bar a { color: inherit; text-decoration: underline; }

/* Sign-in: passkey button, "or" divider, lock screen identity */
.auth-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; color: var(--g-text-2); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--g-separator, rgba(0, 0, 0, .1)); }
.auth-passkey .auth-submit, .auth-lock-user + [data-passkey-area] .auth-submit { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.auth-lock-user { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin-bottom: 14px; border-radius: 18px; background: var(--g-fill, rgba(0, 0, 0, .04)); }
.auth-lock-user > div { display: flex; flex-direction: column; min-width: 0; }
.auth-lock-user span { font-size: 13px; color: var(--g-text-2); overflow: hidden; text-overflow: ellipsis; }

/* Profile: sign-in security card */
.profile-sec { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--g-separator, rgba(0, 0, 0, .08)); }
.profile-sec__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; }
.profile-qr { width: 180px; height: 180px; padding: 6px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.profile-qr svg { width: 100%; height: 100%; display: block; }
.profile-secret { font-size: 1rem; letter-spacing: .08em; word-break: break-all; }
.profile-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 6px; }
.profile-codes code { padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, .7); color: #111; font-size: .95rem; text-align: center; }

/* ---------- Phones: the bottom tab bar is the same liquid glass as the top bar ---------- */
@media (max-width: 767.98px) {
  .epmrs-tabbar.glass-thick {
    background-color: var(--lg-clear);
    background-image: var(--lg-specular), var(--g-sheen);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    backdrop-filter: blur(24px) saturate(200%);
    border: 0;
    box-shadow: var(--lg-inner), 0 0 0 .5px var(--g-edge), var(--lg-float);
    padding: 5px;
    gap: 4px;
  }
  .epmrs-tabbar__item { color: var(--g-text); }
  .epmrs-tabbar__item i { font-size: 19px; transition: transform 260ms var(--lg-press); }
  /* The current tab: a lifted glass lens, like the round buttons of the top bar */
  .epmrs-tabbar__item[aria-current="page"] {
    color: var(--g-accent);
    background: var(--lg-control);
    background-image: radial-gradient(90% 120% at 50% 0%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 62%);
    box-shadow: var(--lg-chip-shadow);
  }
  .epmrs-tabbar__item[aria-current="page"] i { transform: translateY(-1px) scale(1.08); }
  .epmrs-tabbar__item:active { background: var(--lg-control-hover); }
}
@media (max-width: 767.98px) and (prefers-reduced-transparency: reduce) {
  .epmrs-tabbar.glass-thick { background-color: var(--g-surface-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Bell list: readable width on computers, and on phones it stays inside the screen. */
.epmrs-notif-menu { min-width: 320px; max-width: 380px; max-height: min(70vh, 32rem); overflow-y: auto; }
.epmrs-notif-menu .dropdown-item { white-space: normal; border-radius: 12px; }
@media (max-width: 575.98px) {
  .epmrs-notif-menu.show {
    position: fixed !important;
    inset-inline: 10px !important;
    left: 10px !important; right: 10px !important;
    top: calc(max(10px, env(safe-area-inset-top)) + 66px) !important;
    transform: none !important;
    min-width: 0; max-width: none; width: auto;
    max-height: calc(100dvh - 190px);
  }
}
/* The bell list carries text over busy pages: an almost solid sheet keeps it readable. */
.epmrs-notif-menu {
  background-color: var(--g-surface-solid) !important;
  background-image: var(--lg-specular) !important;
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
}
.epmrs-notif-menu .badge { align-self: flex-start; font-size: 11px; padding: .3em .6em; }

/* Phones: the top bar holds up to eight controls. On narrow screens the account button
   becomes a plain avatar circle and the gaps tighten, so the bar fits the screen instead
   of pushing the account menu off the edge and scrolling the page sideways. */
@media (max-width: 575.98px) {
  .epmrs-topbar { gap: .25rem !important; padding-inline: 8px !important; }
  .epmrs-top-actions { gap: .25rem !important; }
  .epmrs-topbar .epmrs-user-menu { width: 38px; padding: 0 !important; justify-content: center; gap: 0 !important; }
  .epmrs-topbar .epmrs-user-caret { display: none; }
}
@media (max-width: 379.98px) {
  .epmrs-topbar .btn.rounded-circle,
  .epmrs-topbar .epmrs-search-trigger,
  .epmrs-topbar .epmrs-user-menu,
  .epmrs-topbar .epmrs-locale > .dropdown-toggle { width: 34px; height: 34px; min-height: 34px; }
}
@media (max-width: 339.98px) {
  .epmrs-topbar, .epmrs-top-actions, .epmrs-language-voice-controls { gap: .125rem !important; }
  .epmrs-topbar { padding-inline: 6px !important; }
}

/* Profile menu: app version status — green when up to date, orange while an update waits */
.epmrs-app-status { --app-status: #15803d; color: var(--app-status) !important; font-weight: 600; }
.epmrs-app-status[data-app-status="stale"] { --app-status: #c2410c; }
.epmrs-app-status:disabled { opacity: 1; cursor: default; background: transparent; }
.epmrs-app-status__version { margin-inline-start: 1.6rem; font-weight: 400; color: var(--g-text-3, #6b7280); }
:root[data-theme="dark"] .epmrs-app-status { --app-status: #4ade80; }
:root[data-theme="dark"] .epmrs-app-status[data-app-status="stale"] { --app-status: #fb923c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .epmrs-app-status { --app-status: #4ade80; }
  :root:not([data-theme="light"]) .epmrs-app-status[data-app-status="stale"] { --app-status: #fb923c; }
}

/* «پنهان کردن همه»: one glass pill above the popups (computer and phone) */
.epmrs-popup-hideall {
  order: -1; align-self: flex-start; pointer-events: auto;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .5);
  background: var(--lg-clear-strong);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  box-shadow: var(--lg-chip-shadow);
  color: var(--g-text, inherit); font-size: 13px; font-weight: 600;
  transition: transform 150ms var(--lg-press), background-color 150ms;
}
.epmrs-popup-hideall:hover { background: var(--lg-control-hover); }
.epmrs-popup-hideall:active { transform: scale(.96); }
.epmrs-popup-hideall:focus-visible { outline: 3px solid var(--g-accent, #0a84ff); outline-offset: 2px; }
.epmrs-popup-hideall[hidden] { display: none; }
:root[data-theme="dark"] .epmrs-popup-hideall { border-color: rgba(255, 255, 255, .14); }
@media (prefers-reduced-motion: reduce) { .epmrs-popup-hideall { transition: none; } }
