@media (max-width: 768px) {
  html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    min-height: 100%;
    background: #f6f8fb;
    overscroll-behavior: none;
  }

  html.yaaleh-maui-app,
  html.yaaleh-maui-app body {
    width: 100%;
    min-height: 100dvh;
    overflow-x: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  html.yaaleh-maui-app body,
  html.yaaleh-maui-app .app-layout,
  html.yaaleh-maui-app .topbar,
  html.yaaleh-maui-app .mobile-bottom-nav,
  html.yaaleh-maui-app .nav-card,
  html.yaaleh-maui-app .shortcut-chip,
  html.yaaleh-maui-app button,
  html.yaaleh-maui-app a {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  html.yaaleh-maui-app input,
  html.yaaleh-maui-app textarea,
  html.yaaleh-maui-app select,
  html.yaaleh-maui-app [contenteditable="true"],
  html.yaaleh-maui-app .ql-editor {
    -webkit-touch-callout: default;
    -webkit-user-select: text;
    user-select: text;
  }

  html.yaaleh-maui-app input,
  html.yaaleh-maui-app textarea,
  html.yaaleh-maui-app select {
    font-size: 16px !important;
  }

  /* Login: the REAL desktop aurora (WebGL silk-waves) full-screen behind a frosted
     glass form card. login-left becomes the full-bleed background; the silk-waves
     ResizeObserver re-sizes the canvas the moment it is shown. */
  .login-page {
    position: relative !important;
    flex-direction: column !important;
    justify-content: center !important;
    width: 100%;
    min-height: 100dvh !important;
    background: #06001B !important;
  }

  .login-left {
    display: flex !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    flex: none !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: max(60px, calc(env(safe-area-inset-top) + 50px)) 2rem 2rem !important;
    z-index: 0 !important;
  }

  .login-left-content { gap: 0.9rem !important; }

  .login-left-logo { width: clamp(180px, 56%, 300px) !important; }
  .login-left-title { font-size: 1.5rem !important; }
  .login-copyright { display: none !important; }

  .login-right {
    position: relative !important;
    z-index: 2 !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
    margin: 0 14px !important;
    padding: 30px 22px 26px !important;
    background: rgba(255, 255, 255, 0.82) !important;
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    backdrop-filter: blur(22px) saturate(140%) !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    border-radius: 26px !important;
    box-shadow: 0 22px 60px rgba(3, 18, 48, 0.42) !important;
  }

  .login-right > .login-brand,
  .login-right > form,
  .login-right > .alert,
  .login-right > .login-footer {
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  .login-brand {
    margin-bottom: 24px !important;
    color: #06203f !important;
    font-size: 1.3rem !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
  }

  .login-field {
    margin-bottom: 20px !important;
  }

  .login-field label {
    margin-bottom: 8px !important;
    color: #1d2430 !important;
    font-size: 0.96rem !important;
  }

  /* Invisible input: no box/fill, just a bottom line colored by state
     (blue normal / green valid / red invalid). The .login-page prefix raises specificity
     above the base rules in Login.razor's inline <style> (which otherwise win on source order). */
  .login-page .login-field .form-control {
    min-height: 48px;
    border: 0 !important;
    border-bottom: 2px solid #0077d4 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #172033 !important;
    font-size: 16px !important;
    box-shadow: none !important;
    /* app.css draws a full green/red outline box on .valid.modified/.invalid —
       kill it so only the bottom line shows, colored per state below. */
    outline: none !important;
  }

  .login-page .login-field .form-control:focus {
    border-bottom-color: #0077d4 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
  }

  .login-page .login-field .form-control.modified.valid {
    border-bottom-color: #17ad00 !important; /* sucesso */
  }

  .login-page .login-field .form-control.invalid {
    border-bottom-color: #d60000 !important; /* inválido */
  }

  .login-page .login-field .form-control::placeholder {
    color: #8b94a3;
  }

  /* Kill the iOS/Safari autofill "white fill" (password manager) — keep the field
     transparent with dark text, no yellow/white box. */
  .login-page .login-field .form-control:-webkit-autofill,
  .login-page .login-field .form-control:-webkit-autofill:hover,
  .login-page .login-field .form-control:-webkit-autofill:focus,
  .login-page .login-field .form-control:-webkit-autofill:active {
    -webkit-text-fill-color: #172033 !important;
    caret-color: #172033;
    transition: background-color 600000s 0s, color 600000s 0s !important;
  }

  .btn-login {
    min-height: 54px;
    margin-top: 8px !important;
    border-radius: 14px !important;
    background: #0077d4 !important;
    font-size: 1rem !important;
    box-shadow: 0 12px 24px rgba(0, 119, 212, 0.28);
  }

  .btn-login:active {
    transform: scale(0.99);
  }

  .login-footer {
    margin-top: 24px !important;
    font-size: 0.92rem !important;
    color: #5a6475 !important;
  }

  /* Authenticated shell */
  html.yaaleh-maui-app .sidebar {
    /* The desktop sidebar is replaced by the bottom tab bar + "Mais" sheet in the native shell.
       Hardened here (class-gated, reliably loaded) because the scoped MainLayout @media rule
       was not taking effect in the WebView — the sidebar was rendering as a full-width block. */
    display: none !important;
  }

  html.yaaleh-maui-app .content-area {
    margin-left: 0 !important;
    min-height: 100dvh;
    background: #f6f8fb;
  }

  html.yaaleh-maui-app .topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    height: calc(56px + env(safe-area-inset-top)) !important;
    padding-top: env(safe-area-inset-top) !important;
    background: rgba(255, 255, 255, 0.96);
    border-bottom-color: #e7eaf0;
    box-shadow: 0 1px 0 rgba(19, 33, 68, 0.04);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  /* Topbar must fit the phone width — let the wallet name shrink/truncate so the brand logo isn't
     pushed off-screen left (the wallet's 160px min-width + ms-3 margin overflowed the row). */
  html.yaaleh-maui-app .topbar .wallet-dropdown {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    max-width: none !important;
    margin-left: 10px !important;
  }

  /* Native app-shell: fixed-viewport flex column. The content scrolls WITHIN main (between the
     topbar and the bottom nav) — so the nav sits in the flow at the bottom and never overlaps the
     content. Order on screen: topbar → scrollable content → navbar (stacked, no overlap). */
  html.yaaleh-maui-app,
  html.yaaleh-maui-app body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  html.yaaleh-maui-app .app-layout,
  html.yaaleh-maui-app .content-area {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  html.yaaleh-maui-app .topbar {
    flex-shrink: 0;
  }
  html.yaaleh-maui-app main {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0 !important;
  }

  html.yaaleh-maui-app .mobile-bottom-nav {
    /* In the flex flow (not a fixed overlay): the content region ends exactly at the nav's top. */
    position: relative;
    flex-shrink: 0;
    z-index: 1030;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    height: calc(62px + env(safe-area-inset-bottom)) !important;
    padding-bottom: env(safe-area-inset-bottom) !important;
    background: #ffffff;
    border-top: 1px solid #e7eaf0;
    box-shadow: 0 -10px 26px rgba(19, 33, 68, 0.08);
  }

  html.yaaleh-maui-app .mbn-tab {
    flex: 1 1 0;
    min-width: 0;
    min-height: 62px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 2px;
    border: 0;
    background: transparent;
    color: #7e7e7e;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.1;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  html.yaaleh-maui-app .mbn-tab i {
    font-size: 19px;
    line-height: 1;
  }

  html.yaaleh-maui-app .mbn-tab span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.yaaleh-maui-app .mbn-tab.active,
  html.yaaleh-maui-app .mbn-tab:active {
    color: #0077d4;
  }

  /* "Mais" full-screen menu sheet (ported — scoped rules not applied in the WebView). */
  html.yaaleh-maui-app .mobile-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0, 0, 0, 0.35);
  }

  html.yaaleh-maui-app .mobile-menu-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 1045;
    background: #ffffff;
  }

  html.yaaleh-maui-app .mobile-menu-sheet__header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
    border-bottom: 1px solid #e7eaf0;
  }

  html.yaaleh-maui-app .mobile-menu-sheet__title {
    font-family: var(--m-display, 'Satoshi', sans-serif);
    font-size: 18px;
    font-weight: 700;
    color: #172033;
  }

  html.yaaleh-maui-app .mobile-menu-sheet__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #565454;
    font-size: 18px;
  }

  html.yaaleh-maui-app .mobile-menu-sheet__body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 8px calc(16px + env(safe-area-inset-bottom));
  }

  html.yaaleh-maui-app .mobile-menu-sheet__body .sidebar-nav-inner {
    height: auto;
  }

  html.yaaleh-maui-app .mobile-menu-sheet__body .sidebar-toggle-row {
    display: none;
  }

  html.yaaleh-maui-app .mobile-menu-sheet__body .nav-group-label {
    margin-top: 18px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #5a6475;
    text-transform: uppercase;
  }

  html.yaaleh-maui-app .mobile-menu-sheet__body .nav-link,
  html.yaaleh-maui-app .mobile-menu-sheet__body .accordion-button {
    padding-top: 12px;
    padding-bottom: 12px;
    font-size: 15px;
    border-radius: 10px;
  }

  html.yaaleh-maui-app .mobile-menu-sheet__body .nav-link.active {
    position: relative;
    background: #e7f2fd;
    color: #0077d4;
  }

  html.yaaleh-maui-app .mobile-menu-sheet__body .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #0077d4;
  }

  /* Home */
  .home-hero {
    padding: 26px 22px 28px !important;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
    background:
      radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.18), transparent 30%),
      linear-gradient(145deg, #101936 0%, #214f9a 55%, #4778d7 100%) !important;
    box-shadow: 0 14px 28px rgba(20, 52, 114, 0.2);
  }

  .home-hero h1 {
    margin-top: 14px !important;
    font-size: clamp(1.72rem, 7vw, 2.05rem) !important;
    line-height: 1.08 !important;
  }

  .home-hero .hero-sub {
    max-width: 310px;
    margin-bottom: 8px;
    font-size: 0.98rem !important;
    line-height: 1.45;
  }

  .home-hero .hero-date {
    font-size: 0.83rem !important;
  }

  .home-role-badge {
    max-width: 100%;
    margin-bottom: 6px;
    padding: 5px 11px !important;
    font-size: 0.78rem !important;
  }

  .container-fluid.px-4.py-4 {
    padding: 22px 16px 10px !important;
  }

  /* Native: the content article is edge-to-edge on mobile (no gutter). Cards/tables/forms go
     full-bleed and inset their own text via their internal padding; only bare-text headers add a
     small side inset (see .page-header / .list-page__header in pages.css). */
  html.yaaleh-maui-app .main-container {
    padding: 0 !important;
  }
  html.yaaleh-maui-app .container-fluid.px-4.py-4 {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
  }

  /* The Home hero sits inset within the single gutter — rounded card, positive padding only. */
  html.yaaleh-maui-app .home-hero {
    border-radius: 20px !important;
    padding: 18px !important;
  }

  .section-label {
    margin: 6px 0 12px !important;
    padding-bottom: 8px !important;
    border-bottom-color: #e2e7f0 !important;
    color: #687386 !important;
    font-size: 0.72rem !important;
  }

  .container-fluid .row.g-3 {
    --bs-gutter-x: 12px;
    --bs-gutter-y: 12px;
  }

  .container-fluid .row.g-3 > .col-6 {
    flex: 0 0 100%;
    width: 100%;
  }

  .nav-card {
    /* Native list-row: icon | (title over description) | Acessar. Grid with EXPLICIT placement
       because h5/p/arrow are siblings (no wrapper) — flex-row was colliding title & description. */
    min-height: 84px;
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 14px;
    row-gap: 2px;
    padding: 14px 16px !important;
    border-color: #e5eaf2 !important;
    border-radius: 18px !important;
    box-shadow: 0 8px 22px rgba(19, 33, 68, 0.06) !important;
    transform: none !important;
  }

  .nav-card:active {
    transform: scale(0.99) !important;
  }

  .nav-card-icon {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 46px !important;
    height: 46px !important;
    margin: 0 !important;
    border-radius: 15px !important;
    font-size: 1.22rem !important;
  }

  .nav-card h5 {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    margin: 0 !important;
    font-size: 1rem !important;
    line-height: 1.2;
  }

  .nav-card p {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    display: -webkit-box;
    margin: 0 !important;
    overflow: hidden;
    color: #727b8b !important;
    font-size: 0.82rem !important;
    line-height: 1.35 !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .nav-card-arrow {
    grid-column: 3;
    grid-row: 1 / 3;
    margin: 0 !important;
    font-size: 0.8rem !important;
    white-space: nowrap;
  }

  .shortcut-chip {
    width: 100%;
    min-height: 48px;
    justify-content: flex-start;
    border-color: #e5eaf2 !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    background: #ffffff !important;
    box-shadow: 0 5px 16px rgba(19, 33, 68, 0.04);
  }

  .info-tile {
    border-color: #e5eaf2 !important;
    border-radius: 16px !important;
    padding: 18px !important;
    background: #ffffff !important;
    box-shadow: 0 5px 16px rgba(19, 33, 68, 0.04);
  }

  /* ===== Top navigation progress bar =====
     A thin indeterminate bar shown only while a navigation is in flight
     (toggled by `html.nav-loading` from js/nav-progress.js). Base `display:none`
     lives in app.css so desktop never shows it. */
  .nav-progress {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    right: 0;
    height: 3px;
    z-index: 2000;
    overflow: hidden;
    background: rgba(0, 119, 212, 0.12);
    pointer-events: none;
  }

  html.nav-loading .nav-progress {
    display: block;
  }

  .nav-progress__bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 45%;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(0, 119, 212, 0.15), #0077d4 60%, #38b6ff);
    box-shadow: 0 0 10px rgba(0, 119, 212, 0.45);
  }

  html.nav-loading .nav-progress__bar {
    animation: nav-progress-slide 1.15s infinite cubic-bezier(0.65, 0, 0.35, 1);
  }

  /* ===== Bottom-nav tap + pending feedback ===== */
  /* Instant press feedback (touch only; no desktop hover state involved). */
  .mbn-tab:active {
    transform: scale(0.94);
    opacity: 0.7;
  }

  /* While navigating, soften the active tab so it reads as "settling", clearly
     distinct from the solid settled-active color. */
  html.nav-loading .mbn-tab.active {
    opacity: 0.55;
    transition: opacity 0.15s ease;
  }

  /* ===== Dashboard: mobile skeleton instead of bare spinners ===== */
  /* The page renders both a `.dash-spinner` (existing) and a sibling `.dash-skeleton`.
     On mobile we hide the spinner and show the skeleton; desktop keeps the spinner
     (the skeleton stays `display:none` via the base rule in app.css). */
  .dash-spinner {
    display: none !important;
  }

  .dash-skeleton {
    display: block;
  }

  .dash-skeleton__line {
    position: relative;
    display: block;
    height: 14px;
    margin: 0 0 10px;
    border-radius: 7px;
    background: #e6eaf1;
    overflow: hidden;
  }

  .dash-skeleton__line:last-child {
    margin-bottom: 0;
  }

  .dash-skeleton__line--short {
    width: 60%;
  }

  .dash-skeleton__line::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
    animation: dash-skeleton-shimmer 1.3s infinite;
  }

  /* =====================================================================
     MOBILE UI/UX ELEVATION (refined native) — strictly mobile-only.
     Everything below stays inside @media (max-width:768px); desktop intact.
     ===================================================================== */

  /* ----- Mobile token aliases ----- single source of truth is design-system/00-tokens.css.
     These --m-* names are kept (so ~1.6k lines of mobile CSS don't churn) but now resolve to the
     design-system tokens. The two values without an exact DS equivalent stay literal. ----- */
  :root {
    --m-brand: var(--color-brand-70);
    --m-brand-strong: var(--color-brand-80);
    --m-brand-tint: var(--color-brand-tint);
    --m-ink: var(--color-ink-900);
    --m-ink-soft: var(--color-ink-600);
    --m-surface: var(--color-white);
    --m-bg: var(--bg-app);
    --m-border: #e5eaf2; /* cool border, no exact DS match (grey-20 is #e4e4e4) */
    --m-r-sm: var(--border-radius-lg);
    --m-r: var(--border-radius-xl);
    --m-r-lg: var(--border-radius-2xl);
    --m-shadow: 0 8px 22px rgba(19, 33, 68, 0.06); /* cooler tint than --card-shadow-soft */
    --m-shadow-soft: var(--shadow-soft-sm);
    --m-display: var(--font-family-heading);
  }

  /* ----- Display typography on title moments (body stays Helvetica Neue) ----- */
  .home-hero h1,
  .page-header h4,
  .nav-card h5,
  .section-label {
    font-family: var(--m-display);
  }
  .home-hero h1 { letter-spacing: -0.01em; }
  .section-label { color: var(--m-ink-soft) !important; letter-spacing: 0.09em; }

  /* ----- Home hero: align gradient to the single brand blue ----- */
  .home-hero {
    background:
      radial-gradient(circle at 15% 12%, rgba(255, 255, 255, 0.20), transparent 32%),
      linear-gradient(145deg, #06122e 0%, #0a4f9c 55%, var(--m-brand) 100%) !important;
  }

  /* ----- Hub page header: previously had desktop 2rem padding, no mobile rule ----- */
  .page-header {
    padding: 18px 16px 14px !important;
    border-bottom-color: var(--m-border) !important;
  }
  .page-header h4 {
    font-size: clamp(1.18rem, 5.4vw, 1.4rem) !important;
    letter-spacing: -0.01em;
  }
  .page-header p {
    font-size: 0.86rem !important;
    line-height: 1.45;
  }

  /* ----- Nav cards: crisper press feedback + cohesive brand accents ----- */
  .nav-card {
    border-color: var(--m-border) !important;
    box-shadow: var(--m-shadow) !important;
  }
  .nav-card:active {
    transform: scale(0.985) !important;
    box-shadow: var(--m-shadow-soft) !important;
  }
  .nav-card h5 { color: var(--m-ink) !important; }
  .nav-card-arrow { color: var(--m-brand) !important; }

  /* ----- Entrance: subtle staggered rise on hub grids ----- */
  .home-hero { animation: m-rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .row.g-3 > [class*="col-"] { animation: m-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .row.g-3 > [class*="col-"]:nth-child(1) { animation-delay: 0.04s; }
  .row.g-3 > [class*="col-"]:nth-child(2) { animation-delay: 0.08s; }
  .row.g-3 > [class*="col-"]:nth-child(3) { animation-delay: 0.12s; }
  .row.g-3 > [class*="col-"]:nth-child(4) { animation-delay: 0.16s; }
  .row.g-3 > [class*="col-"]:nth-child(5) { animation-delay: 0.20s; }
  .row.g-3 > [class*="col-"]:nth-child(6) { animation-delay: 0.24s; }
  .row.g-3 > [class*="col-"]:nth-child(7) { animation-delay: 0.28s; }
  .row.g-3 > [class*="col-"]:nth-child(n+8) { animation-delay: 0.32s; }

  /* ----- Bottom nav: native active indicator (brand lozenge behind icon) ----- */
  .mbn-tab i {
    font-size: 20px;
    padding: 3px 14px;
    border-radius: 999px;
    transition: background-color 0.18s ease, color 0.18s ease;
  }
  .mbn-tab span {
    font-size: 11px;
    letter-spacing: 0.1px;
  }
  .mbn-tab.active i {
    background: var(--m-brand-tint);
    color: var(--m-brand);
  }
  .mbn-tab.active span { color: var(--m-brand); }

  /* ----- Topbar dropdowns must never exceed the viewport on narrow phones ----- */
  .topbar .dropdown-menu,
  .wallet-dropdown .dropdown-menu {
    max-width: calc(100vw - 24px) !important;
  }
  .notification-dropdown {
    width: min(380px, calc(100vw - 16px)) !important;
  }

  /* ----- Dashboard / boards: pull off-brand inline blues onto the brand ----- */
  /* The header (#4472c4) and accordion/board headers (#0156a7) are set via inline
     styles; override them only on mobile via attribute selectors (no markup change). */
  h3[style*="background-color:#4472c4"] {
    background: var(--m-brand-strong) !important;
    height: auto !important;
    min-height: 56px;
    display: flex;
    align-items: center;
    border-radius: 0 0 var(--m-r) var(--m-r);
    font-family: var(--m-display);
  }
  [style*="background-color:#0156a7"],
  [style*="background-color: #0156a7"] {
    background: var(--m-brand) !important;
  }
}

/* Keyframes are global (defined once); they only animate elements that the
   max-width:768px rules above opt in, so desktop is unaffected. */
@keyframes nav-progress-slide {
  0%   { left: -45%; }
  100% { left: 100%; }
}

@keyframes dash-skeleton-shimmer {
  100% { transform: translateX(100%); }
}

@keyframes m-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  /* Replace the sliding bar with a static full-width bar; drop the shimmer. */
  .nav-progress__bar {
    animation: none;
    left: 0;
    width: 100%;
  }

  .dash-skeleton__line::after {
    animation: none;
  }

  /* Disable mobile entrance + tab indicator motion. */
  .home-hero,
  .row.g-3 > [class*="col-"] {
    animation: none !important;
  }

  .mbn-tab i {
    transition: none;
  }
}

/* =========================================================================
   BLAZOR RECONNECT OVERLAY  (native shell only)
   Gated by html.yaaleh-maui-app (NOT a width media query) so it covers phones
   and tablets in the app, and never appears on desktop web. The framework
   toggles components-reconnect-show / -failed / -rejected on the modal element.
   ========================================================================= */
html.yaaleh-maui-app #components-reconnect-modal.components-reconnect-show,
html.yaaleh-maui-app #components-reconnect-modal.components-reconnect-failed,
html.yaaleh-maui-app #components-reconnect-modal.components-reconnect-rejected {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 4000;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

html.yaaleh-maui-app #components-reconnect-modal .yaaleh-reconnect__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(320px, 86vw);
  padding: 28px 24px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28);
  text-align: center;
}

html.yaaleh-maui-app #components-reconnect-modal .yaaleh-reconnect__spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid #e3e8f0;
  border-top-color: #0077D4;
  animation: yaaleh-reconnect-spin 0.9s linear infinite;
}

html.yaaleh-maui-app #components-reconnect-modal .yaaleh-reconnect__retry,
html.yaaleh-maui-app #components-reconnect-modal .yaaleh-reconnect__failed {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: #1f2937;
}

/* Default (reconnecting): spinner + retry text; hide the failure copy and button. */
html.yaaleh-maui-app #components-reconnect-modal .yaaleh-reconnect__failed,
html.yaaleh-maui-app #components-reconnect-modal .yaaleh-reconnect__btn {
  display: none;
}

/* Terminal states: swap to the failure copy + reload button, drop the spinner. */
html.yaaleh-maui-app #components-reconnect-modal.components-reconnect-failed .yaaleh-reconnect__spinner,
html.yaaleh-maui-app #components-reconnect-modal.components-reconnect-rejected .yaaleh-reconnect__spinner,
html.yaaleh-maui-app #components-reconnect-modal.components-reconnect-failed .yaaleh-reconnect__retry,
html.yaaleh-maui-app #components-reconnect-modal.components-reconnect-rejected .yaaleh-reconnect__retry {
  display: none;
}

html.yaaleh-maui-app #components-reconnect-modal.components-reconnect-failed .yaaleh-reconnect__btn,
html.yaaleh-maui-app #components-reconnect-modal.components-reconnect-rejected .yaaleh-reconnect__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: #0077D4;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
}

@keyframes yaaleh-reconnect-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  html.yaaleh-maui-app #components-reconnect-modal .yaaleh-reconnect__spinner {
    animation: none;
  }
}

/* =========================================================================
   WIDE-TABLE SAFETY NET  (≤768px)
   The page suppresses horizontal scroll (overflow-x:hidden), so a wide table
   that hasn't opted into the card layout (table.cards-mobile) would be clipped.
   Make every remaining data table its own horizontal scroll container — exactly
   what Bootstrap's .table-responsive does — so no content is ever cut off.
   This is the readable baseline; per-screen .cards-mobile is the premium upgrade.
   ========================================================================= */
@media (max-width: 768px) {
  .content table.table:not(.cards-mobile),
  .modal-body table.table:not(.cards-mobile) {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

