/* ============================================================================
   PORTAL NAV + PAGE OVERRIDES  ·  v3.3  (2025‑07‑30)
   Duplicate blocks consolidated – no functional changes.
   ========================================================================== */

body.portal-body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body.portal-body,
body.portal-body *,
body.portal-body *::before,
body.portal-body *::after { box-sizing: border-box; }

/* --------------------------- 0 · NAV BAR ---------------------------------- */
body.portal-body .nav.w-nav.portal-compact,
body.portal-body .nav.w-nav.capacitor-compact {
  background: #ffffff;
  min-height: 72px;
  padding: 20px 24px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
}
body.portal-body .nav.w-nav.portal-compact .logo img   { height: 32px; width: auto; }
body.portal-body .nav.w-nav.portal-compact .actions-wrapper { display: flex; gap: 18px; }
body.portal-body .nav.w-nav.portal-compact .nav-link.dropdown { display: none !important; }

/* Avatar */
body.portal-body .avatar.avatar-small {
  width: 34px; height: 34px; border-radius: 50%;
  background: #004f9e; color: #fff; display: flex;
  align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
}
body.portal-body .avatar-dropdown {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
}
body.portal-body .avatar-dropdown__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  cursor: pointer;
  padding: .35rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  list-style: none;
}
body.portal-body .avatar-dropdown__trigger:focus-visible {
  outline: 2px solid rgba(241, 136, 30, 0.35);
  outline-offset: 2px;
}
body.portal-body .avatar-dropdown__trigger:hover {
  background: rgba(241, 136, 30, 0.08);
}
body.portal-body .avatar-menu {
  display: none;
  position: absolute;
  left: .5rem;
  top: calc(100% - 175px);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  min-width: 170px;
  list-style: none;
  margin: 0;
  padding: 6px 0;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
body.portal-body .avatar-dropdown.is-open .avatar-menu { display: block; }
body.portal-body .avatar-dropdown.is-open > .avatar-dropdown__trigger { background: rgba(241, 136, 30, 0.08); }
body.portal-body .avatar-menu li { margin: 0; padding: 0; }
body.portal-body .avatar-link {
  display: block; padding: 8px 14px; font-size: .875rem;
  color: #333; text-decoration: none;
}
body.portal-body .avatar-link:hover { background: #f3f3f3; }
body.portal-body .avatar-link:focus-visible { background: #f3f3f3; outline: 2px solid rgba(21,21,21,.18); outline-offset: -2px; }
body.portal-body .avatar-menu hr { margin: 4px 0; border: none; border-top: 1px solid #eee; }

body.portal-body a.sidebar__logo.w--current,
body.portal-body .sidebar__logo {margin-bottom: 20px;}

/* --------------------------- 1 · COLOR TOKENS ----------------------------- */
body.portal-body {
  --color-primary: #151515;
  --color-primary-hover: #2b2b2b;
  --color-bg:      #efefef;
  --color-surface: rgba(255, 255, 255, 0.92);
  --color-text:    #151515;
  --color-muted:   #675f56;
  --color-border:  rgba(21, 21, 21, 0.08);
  --color-accent:  #f1881e;
  --color-success: #1a7f37;
  --color-danger:  #c23934;

  --shadow-xs: 0 1px 2px  rgba(16,24,40,.05);
  --shadow-sm: 0 1px 3px  rgba(16,24,40,.10),
               0 1px 2px  rgba(16,24,40,.06);

  --font-sans: "Satoshi Variable", "Satoshi", system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, sans-serif;
  --fs-300: .875rem; --fs-400: 1rem;  --fs-500: 1.125rem;
  --fs-600: 1.35rem; --fs-800: 2rem;

  --myca-safe-area-top: max(env(safe-area-inset-top, 0px), var(--native-safe-area-top, 0px));
  --myca-safe-area-bottom: max(env(safe-area-inset-bottom, 0px), var(--native-safe-area-bottom, 0px));
  --myca-safe-area-left: max(env(safe-area-inset-left, 0px), var(--native-safe-area-left, 0px));
  --myca-safe-area-right: max(env(safe-area-inset-right, 0px), var(--native-safe-area-right, 0px));
  --safe-area-top: var(--myca-safe-area-top);
  --safe-area-bottom: var(--myca-safe-area-bottom);
  --safe-area-left: var(--myca-safe-area-left);
  --safe-area-right: var(--myca-safe-area-right);
}

@supports (padding: env(safe-area-inset-top)) {
  body.portal-body {
    --myca-safe-area-top: max(env(safe-area-inset-top, 0px), var(--native-safe-area-top, 0px));
    --myca-safe-area-bottom: max(env(safe-area-inset-bottom, 0px), var(--native-safe-area-bottom, 0px));
    --myca-safe-area-left: max(env(safe-area-inset-left, 0px), var(--native-safe-area-left, 0px));
    --myca-safe-area-right: max(env(safe-area-inset-right, 0px), var(--native-safe-area-right, 0px));
    --safe-area-top: var(--myca-safe-area-top);
    --safe-area-bottom: var(--myca-safe-area-bottom);
    --safe-area-left: var(--myca-safe-area-left);
    --safe-area-right: var(--myca-safe-area-right);
  }
}
@media (prefers-color-scheme: dark) {
  body.portal-body {
    --color-primary: #6ab0ff;
    --color-bg:      #0d1117;
    --color-surface: #161b22;
    --color-text:    #e6edf3;
    --color-muted:   #8b949e;
  }
}

/* Explicit portal theme override (portal-only, driven by JS)
   Matches chat design where we toggle html[data-portal-theme]. */
html[data-portal-theme='dark'] body.portal-body {
  --color-primary: #6ab0ff;
  --color-bg:      #0d1117;
  --color-surface: #161b22;
  --color-text:    #e6edf3;
  --color-muted:   #8b949e;
}
html[data-portal-theme='light'] body.portal-body {
  --color-primary: #151515;
  --color-primary-hover: #2b2b2b;
  --color-bg:      #efefef;
  --color-surface: rgba(255, 255, 255, 0.92);
  --color-text:    #151515;
  --color-muted:   #675f56;
  --color-border:  rgba(21, 21, 21, 0.08);
  --color-accent:  #f1881e;
}

/* --------------------------- 2 · LAYOUT ---------------------------------- */
body.portal-body {
  font-family: var(--font-sans) !important;
  font-size:   var(--fs-400)   !important;
  color: var(--color-text);
  background:
    radial-gradient(circle at top left, rgba(241, 136, 30, 0.1), transparent 22rem),
    radial-gradient(circle at top right, rgba(21, 21, 21, 0.04), transparent 26rem),
    var(--color-bg);
  line-height: 1.55 !important;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
}
body.portal-body .skip-link {
  position: absolute; top: -4rem; left: 1rem;
  padding: .75rem 1rem; background: var(--color-primary); color: #fff;
  border-radius: .25rem; transition: top .2s; z-index: 999;
}
body.portal-body .skip-link:focus { top: .5rem; }

body.portal-body .portal-layout {
  display: grid; grid-template-columns: 1fr;
  max-width: 1280px; margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
  padding-left: max(var(--safe-area-left), clamp(1rem, 4vw, 2rem));
  padding-right: max(var(--safe-area-right), clamp(1rem, 4vw, 2rem));
}
body.portal-body .portal-layout .container,
body.portal-body .portal-layout .code-embed {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}
body.portal-body ul {
  color: var(--color-text);
}
@media (min-width: 64rem) {
  body.portal-body .portal-layout { grid-template-columns: 240px 1fr; }
}

body.portal-body .sidebar { display: none; }
@media (min-width: 64rem) {
  body.portal-body .sidebar {
    display: block; position: sticky; top: 0; height: 100vh; padding-block: 2rem;
  }
  body.portal-body .sidebar__nav ul {
    display: flex; flex-direction: column; gap: .25rem;
    list-style: none; margin: 0; padding: 0;
  }
body.portal-body .sidebar__link {
    display: flex; align-items: center; gap: .75rem; padding: .65rem 1rem;
    border-radius: 1rem; font-weight: 500; color: var(--color-text);
    border: 1px solid transparent;
    text-decoration: none;
  }
  body.portal-body .sidebar__link:hover,
  body.portal-body .sidebar__link:focus-visible {
    background: rgba(241, 136, 30, 0.08);
    border-color: rgba(241, 136, 30, 0.18);
  }
  body.portal-body .sidebar__link.is-active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 12px 24px rgba(21, 21, 21, 0.14);
  }
}

body.portal-body .main {
  padding-block: calc(1.5rem + var(--safe-area-top)) calc(1.2rem + var(--safe-area-bottom));
  display: flex; flex-direction: column;
  padding-left: 20px; gap: 1.5rem;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

/* Hero -------------------------------------------------------------------- */
body.portal-body .hero-card {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(250, 245, 238, 0.92)),
    var(--color-surface);
  border-radius: 2rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  justify-content: space-between; align-items: center;
  padding: 2rem;
  width: 100%;
  max-width: 100%;
}
body.portal-body .hero-card__text {
  flex: 1 1 60px;
  max-width: 480px;
  min-width: 0;
}
body.portal-body .hero-card__illus {
  flex: 1 1 220px;
  max-width: min(320px, 100%);
  min-width: 0;
}
body.portal-body .hero-card__illus img {
  width: 100%;
  height: auto;
  display: block;
}
body.portal-body .heading-xl {
  font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 500;
  color: var(--color-text); line-height: 1.15;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
  word-break: break-word;
}
body.portal-body .text-md { font-size: var(--fs-400); }

/* KPI --------------------------------------------------------------------- */
body.portal-body .kpi-grid { display: grid; gap: 1rem; }
@media (min-width: 599px) {
  body.portal-body .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}
body.portal-body .kpi-grid > * { min-width: 0; }
body.portal-body .kpi-card {
  background: rgba(255, 255, 255, 0.92); border-radius: 1.4rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card); padding: 1.5rem 1.25rem;
  display: flex; flex-direction: column; gap: .75rem; justify-content: space-evenly;
  width: 100%;
  max-width: 100%;
}
body.portal-body .kpi-card__title { font-size: var(--fs-300); color: var(--color-muted); }
body.portal-body .kpi-card__value {
  font-size: var(--fs-600);
  font-weight: 600;
  overflow-wrap: anywhere;
}
body.portal-body .btn-primary {
  background: var(--color-accent); color: #151515;
  padding: .72rem 1.25rem; border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(241, 136, 30, 0.2);
}
body.portal-body .btn-primary:hover,
body.portal-body .btn-primary:focus-visible { background: var(--brand-600, #de7f1d); }

/* Panels & grids ---------------------------------------------------------- */
body.portal-body .flex-grid-2col { display: grid; gap: 1.5rem; }
@media (min-width: 599px) {
  body.portal-body .flex-grid-2col { grid-template-columns: 1fr 1fr; }
}
body.portal-body .flex-grid-2col > * { min-width: 0; }

body.portal-body .panel {
  background: rgba(255, 255, 255, 0.92); border-radius: 1.6rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card); overflow: hidden; transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
  width: 100%;
  max-width: 100%;
}
body.portal-body .panel:hover,
body.portal-body .panel:focus-within {
  box-shadow: 0 18px 32px rgba(21, 21, 21, 0.1);
  transform: translateY(-2px);
  border-color: rgba(241, 136, 30, 0.16);
}
body.portal-body .panel__header {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 1.2rem 1.35rem; border-bottom: 1px solid rgba(21, 21, 21, .06);
}
body.portal-body .heading-md { font-size: var(--fs-500); font-weight: 600; }
body.portal-body .btn-link   {
  font-size: var(--fs-300); color: var(--color-primary);
  text-decoration: none;
}
body.portal-body .btn-link:hover { text-decoration: underline; }

/* Reveal animations (paired with animations.js) ---------------------------- */
body.portal-body .reveal { opacity: 0; transform: translateY(8px); transition: opacity .28s ease, transform .28s ease; }
body.portal-body .reveal.in { opacity: 1; transform: none; }

/* Tables & badges --------------------------------------------------------- */
body.portal-body .table { width: 100%; border-collapse: collapse; font-size: var(--fs-300); }
body.portal-body .table--tight th,
body.portal-body .table--tight td {
  padding: .8rem 1.25rem; border-bottom: 1px solid rgba(21,21,21,.06);
}
@media (max-width: 480px) {
  body.portal-body .table--tight th,
  body.portal-body .table--tight td { padding: .6rem .6rem; }
}
body.portal-body .badge {
  display: inline-block; width: 100%; text-align: center;
  font-size: .75rem; padding: .25rem .55rem; border-radius: 999px;
  background: var(--color-muted); color: #fff;
}
body.portal-body .badge--paid    { background: var(--color-success); }
body.portal-body .badge--overdue { background: var(--color-danger); }
body.portal-body .badge--closed  { background: var(--color-muted); }

/* Ticket list ------------------------------------------------------------- */
body.portal-body .ticket-list         { display: flex; flex-direction: column; }
body.portal-body .ticket-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .5rem;
  margin-left: 0;
  padding-right: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}
body.portal-body .ticket-list__title  {
  font-weight: 500;
  color: var(--color-text);
  flex: 1 1 220px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
body.portal-body .ticket-list__meta {
  font-size: .8125rem;
  color: var(--color-muted);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  flex: 1 1 140px;
  min-width: 0;
}
@media (max-width: 480px) {
  body.portal-body .ticket-list__meta { flex-basis: 100%; }
}

/* Tab‑bar ----------------------------------------------------------------- */
body.portal-body .tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255, 255, 255, 0.92); border-top: 1px solid rgba(21,21,21,.06);
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px max(12px, var(--safe-area-right)) calc(8px + var(--safe-area-bottom)) max(12px, var(--safe-area-left));
  min-height: 64px;
  box-shadow: 0 18px 36px rgba(21, 21, 21, 0.12); z-index: 100;
}
@media (min-width: 64rem) { body.portal-body .tabbar { display: none; } }
body.portal-body .tabbar__link {
  flex: 1; text-align: center; font-size: var(--fs-400) !important; color: var(--color-muted);
  display: flex; flex-direction: column; align-items: center; gap: .2rem;
  border-radius: 1rem;
  padding: 0.4rem 0.3rem;
  text-decoration: none;
}
body.portal-body .tabbar__link span { font-size: var(--fs-400) }
body.portal-body .tabbar__link.is-active,
body.portal-body .tabbar__link:hover {
  color: var(--color-primary);
  background: rgba(241, 136, 30, 0.08);
}

/* Emoji placeholder icons ------------------------------------------------- */
body.portal-body .icon-home::before       { content: "🏠"; }
body.portal-body .icon-wrench::before     { content: "🔧"; }
body.portal-body .icon-credit-card::before{ content: "💳"; }
body.portal-body .icon-invoice::before    { content: "🧾"; }
body.portal-body .icon-file::before       { content: "📄"; }
body.portal-body .icon-chat::before       { content: "💬"; }
body.portal-body .icon-user::before       { content: "👤"; }


/* ==== NAV additions for bell & overlay =================================== */
body.portal-body .nav-container { display: flex; justify-content: space-between; align-items: center; width: 100%; }
body.portal-body .logo-wrapper  { display: flex; align-items: center; gap: 8px; }

body.portal-body .nav-icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
}
body.portal-body .nav-icon svg { width: 24px; height: 24px; stroke: #4b5563; fill: none; }
body.portal-body .nav-icon:hover svg { stroke: var(--color-primary); }
body.portal-body .dot {
  position: absolute; top: 0; right: 0; width: 10px; height: 10px;
  border-radius: 50%; background: #e11d48;
}

/* Avatar & bell visibility tweaks ---------------------------------------- */
body.portal-body .avatar-frame        { background: transparent; color: #fff; }
body.portal-body .avatar.avatar-small,
body.portal-body .nav-icon svg        { transition: opacity .2s; }
body.portal-body .avatar.avatar-small:hover,
body.portal-body .nav-icon:hover svg  { opacity: .75; }

/* hide marketing nav items inside portal --------------------------------- */
body.portal-body .nav.w-nav.portal-compact .nav-menu,
body.portal-body .nav.w-nav.portal-compact .button.small.hide-mobile-portrait,
body.portal-body .nav-menu-button .w-nav-button { display: none !important; }

/* centre the initials inside the circle ---------------------------------- */
body.portal-body .avatar-frame {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  width: 100%; height: 100% !important;
}

body.portal-body .unit-details {
  padding: 1.25rem 0 1.75rem;
  display: flex;
  gap: 1rem;
  flex-wrap: nowrap;
  justify-content: space-around;
}

/* Mobile tweaks (≤ 768 px) ------------------------------------------------ */
@media (max-width: 768px) {
  body.portal-body .nav-container {
    display: flex; justify-content: space-between; align-items: center;
    padding-inline: 10px; width: 100%;
  }
  body.portal-body .main {
    padding-left: unset;
    padding-top: max(0.85rem, var(--safe-area-top));
    margin-bottom: 0;
  }
}
body.portal-body .nav.w-nav.capacitor-compact { padding: calc(var(--safe-area-top) + 20px) 0 5px 0; }

/* ─── 1 · KPI GRID on phones → two‑up layout ───────────────────────────── */

/* ─── 1 · KPI GRID on phones → two‑up layout ───────────────────────────── */
@media (max-width: 599px) {
  body.portal-body .kpi-grid { grid-template-columns: 1fr 1fr; }
  body.portal-body .kpi-grid .kpi-card:nth-child(3) { grid-column: 1 / -1; }
  body.portal-body .kpi-grid #kpi-upcoming { grid-column: 1 / -1; }

  body.portal-body #cmd-modal,
  body.portal-body #compose-modal,
  body.portal-body #qp-sheet {
    left: 0.75rem !important;
    right: 0.75rem !important;
    top: max(0.75rem, calc(var(--safe-area-top) + 0.2rem)) !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(var(--portal-vh, 100dvh) - var(--portal-kb, 0px) - max(0.75rem, var(--safe-area-top)) - max(0.9rem, var(--safe-area-bottom))) !important;
    overflow: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.portal-body #cmd-modal,
  body.portal-body #compose-modal {
    transform: translateX(-50%) !important;
  }

  body.portal-body #qp-sheet,
  body.portal-body #qp-sheet.is-open {
    transform: translateX(-50%) !important;
  }

  body.portal-body #cmd-list {
    max-height: calc(var(--portal-vh, 100dvh) - var(--portal-kb, 0px) - max(0.75rem, var(--safe-area-top)) - max(8.75rem, var(--safe-area-bottom))) !important;
    overscroll-behavior: contain;
  }

  body.portal-body #compose-text {
    min-height: 9rem;
    max-height: calc(var(--portal-vh, 100dvh) - var(--portal-kb, 0px) - max(0.75rem, var(--safe-area-top)) - max(11.5rem, var(--safe-area-bottom)));
  }

  body.portal-body #qp-amount {
    min-height: 2.9rem;
    font-size: 16px;
  }

  body.portal-body .kpi-grid #kpi-upcoming {
    grid-column: 1 / -1 !important;
  }
  .button-flex {
    display: flex;
    flex-direction: row !important;
    justify-content: space-around;
    flex-wrap: nowrap !important;
    align-items: center;
  }
}

@media (max-width: 30rem) {
  body.portal-body .kpi-grid { grid-template-columns: 1fr; }
  body.portal-body .kpi-grid .kpi-card:nth-child(3) { grid-column: auto; }
  body.portal-body .kpi-grid #kpi-upcoming { grid-column: auto; }

  body.portal-body #cmd-modal,
  body.portal-body #compose-modal,
  body.portal-body #qp-sheet {
    left: 0.55rem !important;
    right: 0.55rem !important;
    top: max(0.6rem, calc(var(--safe-area-top) + 0.08rem)) !important;
    padding: 0.9rem !important;
    border-radius: 18px !important;
  }

  body.portal-body #qp-sheet {
    left: 49% !important;
    right: -44% !important;
    top: 20% !important;
    transform: translate(-50%, -50%) !important;
    max-width: 720px !important;
    width: 92vw !important;
  }
  body.portal-body .kpi-grid #kpi-upcoming {
    grid-column: 1 / -1 !important;
  }
  #push-nudge-pill {
    bottom: calc(80px + var(--myca-safe-area-bottom, env(safe-area-inset-bottom))) !important;
  }

  body.portal-body #cmd-list {
    margin-top: 0.75rem !important;
  }
}


/* ─── 2 · Mobile flex‑order helpers ─────────────────────────────────────── */
@media (max-width: 599px) {
  body.portal-body .order-mobile-1 { order: 1; }
  body.portal-body .order-mobile-2 { order: 2; }
  body.portal-body .order-mobile-3 { order: 3; }
  body.portal-body .order-mobile-4 { order: 4; }
  body.portal-body .ticket-list__meta {min-width: 130px;}
}

/* ─── 3 · Building card layout & responsiveness ────────────────────────── */
body.portal-body .building-card .panel__header { border-bottom: 1px solid rgba(0,0,0,.05); }
body.portal-body .building-flex {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  flex-wrap: nowrap;
  margin-left: 10px;
}
body.portal-body figure.building-thumb { width: 48%; }
body.portal-body .building-thumb img {
  object-fit: cover;
  border-radius: .5rem;
  box-shadow: var(--shadow-xs);
}
body.portal-body .building-details {
  flex: 1 1 260px;
  font-size: var(--fs-300);
  padding-left: 10px;
}
body.portal-body .building-details.info-grid {
  display: flex;
  flex-wrap: nowrap;
  flex-direction: row;
  align-content: flex-start;
  gap: 1rem;
}
body.portal-body .building-details.info-grid > .amenity-block {
  flex: 1 1 0;
  min-width: 0;
  width: calc(50% - 0.5rem);
  max-width: calc(50% - 0.5rem);
}
body.portal-body .building-details .subhead { font-weight: 600; margin-bottom: .25rem; }
body.portal-body .lock-info-block {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-around;
  align-content: flex-start;
  flex-wrap: nowrap;
  gap: 1rem;
  width: 100%;
  margin-left: 0;
}
body.portal-body .lock-buttons {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.75rem;
  align-items: flex-start;
}
@media (min-width: 599px) {
  body.portal-body .building-thumb { flex: 0 0 260px; }
  body.portal-body .building-thumb img { width: 100%; height: 180px; object-fit: cover; }

  body.portal-body .building-flex { gap: 1rem; }
  body.portal-body figure.building-thumb { width: 48%; margin-left: 1rem; }
}
@media (max-width: 599px) {
  body.portal-body .building-card { padding-inline: 1rem; }
  body.portal-body .building-flex { flex-direction: column; gap: .5rem; margin-left: 0; }
  body.portal-body figure.building-thumb,
  body.portal-body .building-thumb { width: 100% !important; margin: 0; }
  body.portal-body .building-thumb img { width: 100%; height: auto; }
  body.portal-body .building-details { padding-left: 0; }
  body.portal-body .building-details.info-grid {
    gap: 1rem;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 100%;
    height: fit-content !important;
    max-height: min-content;
    margin-left: 0;
    align-items: center;
  }
  body.portal-body .building-details.info-grid > .amenity-block {
    min-width: 0;
    width: auto;
    height: fit-content;
    display: flex;
    column-gap: 1rem;
    flex-direction: row;
    align-content: flex-start;
    align-items: flex-start;
    max-width: 95%;
    justify-content: center;
  }
  body.portal-body .btn-primary,
  body.portal-body .btn-link { font-size: small; }
  body.portal-body h2#bldg-heading { margin: 0 !important; margin-left: 0 !important; }
  body.portal-body .unit-details {
    padding: 1.25rem 0 1.75rem;
    display: flex;
    gap: 1rem;
    flex-wrap: nowrap;
    justify-content: space-around;
  }
  body.portal-body .lock-info-block {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
    align-content: flex-start;
    align-items: flex-start;
    flex-wrap: nowrap;
    margin-left: 0;
  }
  body.portal-body .lock-buttons {
    justify-content: flex-start;
  }
}
body.portal-body h2#bldg-heading { margin: 0 !important; margin-left: .5rem !important; }

body.portal-body .amenity-block {
  width: 50%;
}
body.portal-body .building-amenity-block {
  width: fit-content;
}

/* Reset list bullets in sidebar nav -------------------------------------- */
body.portal-body .sidebar__nav ul,
body.portal-body .sidebar__nav li { list-style: none; margin: 0; padding: 0; }

/* ------------------------------------------------------------------------
   ACCOUNT  /me   (light re‑skin of the old dark card)
   --------------------------------------------------------------------- */
body.portal-body .account-wrap  {
  display: flex; flex-direction: column; gap: 2rem;
  padding-block: 2.5rem 4rem;
  padding-inline: clamp(1rem,4vw,2rem);
}
body.portal-body .account-card  {
  background: var(--color-surface); border-radius: .75rem;
  box-shadow: var(--shadow-xs); overflow: hidden;
}

/* Header row (avatar + name) */
body.portal-body .account-card .top-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 1.5rem;
}
body.portal-body .top-row .user-meta      { display: flex; align-items: center; gap: .75rem; }
body.portal-body .top-row .user-meta img  { border-radius: 50%; }
body.portal-body .top-row .user-meta .name{ font-weight: 600; font-size: var(--fs-500); }
body.portal-body .top-row .edit-link      {
  color: var(--color-primary); font-size: var(--fs-300);
  text-decoration: none; display: inline-flex; align-items: center; gap: .3rem;
}
body.portal-body .top-row .edit-link svg  { width: 1em; height: 1em; stroke: currentColor; fill: none; }

/* Rows */
body.portal-body .account-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.5rem; border-top: 1px solid rgba(0,0,0,.05);
}
body.portal-body .account-row:first-of-type { border-top: none; }
body.portal-body .account-row .info       { max-width: 440px; }
body.portal-body .account-row .info .lbl  { font-weight: 600; display: block; color: var(--color-text); }
body.portal-body .account-row .info .sub  { font-size: var(--fs-300); color: var(--color-muted); }
body.portal-body .account-row .row-link   {
  font-size: var(--fs-300); color: var(--color-primary);
  display: inline-flex; align-items: center; gap: .3rem; text-decoration: none;
}
body.portal-body .account-row .row-link svg{ width: 1em; height: 1em; stroke: currentColor; fill: none; }

@media (max-width: 599px) {
  body.portal-body .account-wrap          { padding-inline: 1rem; }
  body.portal-body .account-row           { flex-direction: column; align-items: flex-start; gap: .5rem; }
  body.portal-body .account-row .row-link { margin-top: .25rem; }
}

/* ------------------------------------------------------------------------
   “My Lease Agreement” & My Documents tweaks
   --------------------------------------------------------------------- */
body.portal-body .lease-wrapper {
  background: var(--color-surface); border-radius: .75rem;
  box-shadow: var(--shadow-xs); padding: 1.5rem;
  margin: 1.5rem 0 4rem;
  overflow-x: auto;
}
@media (max-width: 600px) {
  body.portal-body .lease-wrapper .print-format {
    transform-origin: top left; width: calc(70% / .75);
  }
  body.portal-body .lease-wrapper { padding: 1rem; margin-top: 0; }
}
body.portal-body .print-format {
  font-size: 9pt;
  font-family: Helvetica Neue, sans-serif;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
@media (max-width: 767px) {
  body.portal-body .print-format { padding: 0.1in; }
}
body.portal-body .print-format {
  background-color: #fff;
  border-radius: 8px;
  max-width: 8.3in;
  min-height: 11.69in;
  padding: 0.75in;
  margin: 0;
  margin-left: 2.5% !important;
  color: var(--gray-900, var(--color-text));
}
@media (max-width: 600px) {
  body.portal-body .lease-wrapper { padding: 0; margin-top: 0; max-width: 95%; }
}
body.portal-body .btn-download {
  display: inline-block; background: var(--color-primary); color: #fff;
  padding: .6rem 1.4rem; border-radius: .5rem; font-weight: 600;
  margin: 0 0 1.25rem 15px; text-decoration: none;
}
body.portal-body .btn-download:hover,
body.portal-body .btn-download:focus-visible {
  background: var(--color-primary-hover); text-decoration: none;
}

/* Macro‑generated avatar size fix */
body.portal-body .avatar-dropdown .avatar { width: 34px; height: 34px; border-radius: 50%; }

/* ------------------------------------------------------------------------
   MOBILE avatar‑menu position in tab‑bar
   --------------------------------------------------------------------- */
body.portal-body .tabbar__link,
body.portal-body .tabbar__link > .avatar-dropdown__trigger { position: relative; }
body.portal-body .tabbar__link          {
  display: flex; flex-direction: column; align-items: center;
  gap: .2rem; text-align: center; line-height: 1;
}
body.portal-body .tabbar__text          { font-size: .75rem; }
html[data-native-platform="ios"] body.portal-body .tabbar,
html[data-myca-native-platform="ios"] body.portal-body .tabbar {
  padding-top: 0.16rem;
  padding-bottom: 0;
  min-height: 0;
}
html[data-native-platform="ios"] body.portal-body .tabbar__link,
html[data-myca-native-platform="ios"] body.portal-body .tabbar__link {
  padding-top: 0.12rem;
  padding-bottom: 0.12rem;
}
body.portal-body .sidebar__link .dot,
body.portal-body .tabbar__link .dot {
  position: absolute; top: 4px; right: 12px;
  width: 10px; height: 10px; border-radius: 50%; background: #e11d48; display: none;
}
@media (max-width: 599px) {
  body.portal-body .tabbar details[open] .avatar-menu {
    position: absolute; top: -90px; right: 0; left: unset;
    background: #fff; border: 1px solid #ddd; border-radius: 6px;
    min-width: 170px; list-style: none; padding: 6px 0;
    box-shadow: 0 4px 16px rgba(0,0,0,.1); z-index: 9999;
  }
}
body.portal-body .badge--pending { background:#f59e0b; }   /* amber / orange */

/* ------------------------------------------------------------------------
   PORTAL · MESSAGES  (/messages)
   --------------------------------------------------------------------- */
body.portal-body { background: var(--color-bg) !important; }

body.portal-body .main > h1.heading-md { margin-bottom: 2rem; }

body.portal-body #msg-list {
  list-style: none; margin: 0 0 4rem; padding: 0;
  display: flex; flex-direction: column; gap: 1.25rem;
}
body.portal-body #msg-list > li {
  background: rgba(255, 255, 255, 0.92); border-radius: 1.4rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card); padding: 1.25rem;
  display: flex; gap: 1rem; cursor: pointer;
  transition: box-shadow .15s, transform .12s;
}
body.portal-body #msg-list > li:hover,
body.portal-body #msg-list > li:focus-within {
  box-shadow: 0 18px 32px rgba(21, 21, 21, 0.1);
  transform: translateY(-2px);
}
@media (max-width: 599px) { body.portal-body #msg-list > li { flex-direction: column; } }

body.portal-body .msg-head {
  flex: 0 0 220px; max-width: 220px;
  display: flex; flex-direction: column; gap: .4rem;
}
@media (max-width: 599px) { body.portal-body .msg-head { flex: none; max-width: 100%; } }

body.portal-body .msg-body {
  flex: 1 1 auto; display: flex; flex-direction: column;
  gap: .6rem; justify-content: space-between;
}

body.portal-body .msg-id  { font-weight: 600; color: var(--color-primary); }
body.portal-body .snippet {
  font-size: var(--fs-300); color: var(--color-text); opacity: .9;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.portal-body .date    { font-size: .75rem; color: var(--color-muted); }

body.portal-body .status-pill {
  display: inline-block; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; padding: .2rem .6rem; border-radius: 999px;
  background: var(--color-muted); color: #fff; text-align: center;
}
body.portal-body .status-pill[data-status="closed"],
body.portal-body .status-pill.green   { background: var(--color-success); }
body.portal-body .status-pill[data-status="overdue"],
body.portal-body .status-pill.red     { background: var(--color-danger); }

body.portal-body #tab-bar {
  display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 2rem;
}
body.portal-body #tab-bar button {
  border: 1px solid var(--color-border); border-radius: 999px;
  padding: .62rem 1.15rem; font-size: var(--fs-300); font-weight: 600;
  background: rgba(255, 255, 255, 0.82); color: var(--color-text);
  box-shadow: none; cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
body.portal-body #tab-bar button:hover,
body.portal-body #tab-bar button:focus-visible {
  background: rgba(241, 136, 30, 0.08);
  border-color: rgba(241, 136, 30, 0.18);
}
body.portal-body #tab-bar button.is-active {
  background: var(--color-primary);
  color: #fff;
  border-color: rgba(21, 21, 21, 0.18);
}

body.portal-body #load-more.btn-secondary {
  background: rgba(255, 255, 255, 0.82); color: var(--color-primary);
  border: 1px solid var(--color-border);
  padding: .7rem 1.4rem; border-radius: 999px; font-weight: 600;
}
body.portal-body #load-more.btn-secondary:hover,
body.portal-body #load-more.btn-secondary:focus-visible {
  background: rgba(241, 136, 30, 0.08);
  color: var(--color-primary);
  border-color: rgba(241, 136, 30, 0.18);
}

/* ------------------------------------------------------------------------
   PORTAL · THREAD  (/thread)
   --------------------------------------------------------------------- */
body.portal-body .link-back {
  display: inline-block; font-size: var(--fs-300);
  color: var(--color-primary); margin-bottom: 1rem; text-decoration: none;
}
body.portal-body .link-back:hover,
body.portal-body .link-back:focus-visible { text-decoration: underline; }

body.portal-body .thread-wrapper {
  display: flex; flex-direction: column; height: 100%; gap: 1.5rem;
}
body.portal-body #thread-body {
  flex: 1 1 auto; overflow-y: auto; padding: 1rem 0 3rem;
  scroll-behavior: smooth; color: var(--color-text);
}
body.portal-body #thread-body article,
body.portal-body #thread-body .msg-card {
  background: var(--color-surface); border-radius: .75rem;
  box-shadow: var(--shadow-xs); padding: 1rem 1.25rem; margin: 0 0 1rem;
}

/* author / meta row */
body.portal-body #thread-body .msg-header {
  display: flex; align-items: baseline; flex-wrap: wrap;
  gap: .5rem; margin-bottom: .5rem;
}
body.portal-body #thread-body .author { font-weight: 600; color: var(--color-primary); }
body.portal-body #thread-body .meta   { font-size: .75rem; color: var(--color-muted); }

/* body copy */
body.portal-body #thread-body p {
  margin: 0 0 .8rem; font-size: var(--fs-400); line-height: 1.55;
}
body.portal-body #thread-body p:last-child { margin-bottom: 0; }

/* composer ---------------------------------------------------------------- */
body.portal-body #composer {
  position: sticky; bottom: 0; left: 0;
  padding: 1rem; background: var(--color-surface);
  border: 1px solid rgba(0,0,0,.05); border-radius: .75rem;
  box-shadow: var(--shadow-sm); display: flex; flex-wrap: wrap; gap: .75rem;
}
body.portal-body #reply-box {
  flex: 1 1 100%; min-height: 120px; padding: 1rem;
  border: 1px solid #d1d5db; border-radius: .5rem;
  font-size: var(--fs-400); resize: vertical;
}
body.portal-body #reply-box:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 30%, transparent);
}
body.portal-body #send-reply {
  flex: 0 0 auto; background: var(--color-primary); color: #fff;
  border: none; border-radius: .5rem; padding: .65rem 1.6rem;
  font-size: var(--fs-400); font-weight: 600; cursor: pointer;
  transition: background .15s;
}
body.portal-body #send-reply:hover,
body.portal-body #send-reply:focus-visible { background: var(--color-primary-hover); }

/* ------------------------------------------------------------------------
   HOT‑FIX · Messages list width (≤ 40 rem)
   --------------------------------------------------------------------- */
@media (max-width: 40rem) {
  body.portal-body .portal-layout { padding-inline: 1rem !important; }
  body.portal-body .main          { padding-left: 0 !important; }
  body.portal-body #msg-list > li {
    flex-direction: column !important;
    padding: 1rem !important;
  }
  body.portal-body .msg-head,
  body.portal-body .msg-body {
    flex: none !important; max-width: 100% !important;
  }
  body.portal-body .snippet { white-space: normal; }
  body.portal-body .msg-id  { text-align: center; }
}

/* ------------------------------------------------------------------------
   Utility tweak
   --------------------------------------------------------------------- */
body.portal-body li.border.rounded.p-3.flex.flex-col.md\:flex-row.md\:justify-between.md\:items-center {
  margin-left: 0;
}

/* ========================================================================
   HOT‑FIXES · consolidated (2025‑07‑30)
   – Critical layout corrections for Messages, avatar dropdown, unread
     badges, and misc UI tweaks.
   – Mobile‑first order: base rules → media queries.
   ===================================================================== */

/* —— General tweaks —————————————————————————————————————— */
body.portal-body h1               { color: var(--color-text); }
body.portal-body .heading-md      { margin: 20px 0 0 !important; }
body.portal-body nav#tab-bar      { margin: 0 !important; }

/* —— Messages list —————————————————————————————————————— */
body.portal-body #msg-list > li{
  /* keep each card inside the grid column */
  width: 100%;
  max-width: 100%;
  margin-left: 0 !important;
  padding-left: 0 !important;
  box-sizing: border-box;
  flex: 1 1 auto;
}
body.portal-body #msg-list > li > * {               /* restore inner padding */
  padding-left: 1.25rem;
}
body.portal-body .msg-head { flex: 0 0 200px; max-width: 200px; }  /* fixed column   */
body.portal-body .msg-body { flex: 1 1 0;   min-width: 0; }        /* elastic column */
body.portal-body .snippet  {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal !important;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;           /* clamp to two lines    */
  line-clamp: 2;
}

/* —— Avatar dropdown in tab‑bar —————————————————————————— */
body.portal-body .tabbar__link,
body.portal-body .tabbar__link > .avatar-dropdown__trigger { position: relative; }
body.portal-body .tabbar__link.avatar-dropdown      { flex: 1; }

/* ─── Separate desktop‑sidebar behaviour from mobile‑tabbar ───────────── */

/* 1 · Sidebar avatar should stay inside the sidebar flow */
body.portal-body .sidebar .avatar-dropdown {
  position: relative;
  left: 0;
  bottom: auto;
  transform: none;
  margin-top: auto;
  align-self: flex-start;
}
/* 2 · Mobile tab‑bar avatar should behave like every other tile */
body.portal-body .tabbar .avatar-dropdown   { position:relative; bottom:auto; }

/* 3 · Tiles stay relative so the red dot can anchor correctly */
body.portal-body .sidebar__link,
body.portal-body .tabbar__link              { position:relative !important; }

/* 4 · …but let the inner <summary> fall back to normal flow               */
body.portal-body .tabbar__link > .avatar-dropdown__trigger { position: static !important; }


/* —— Unread badge (red dot) ———————————————————————————— */
body.portal-body .sidebar__link,
body.portal-body .tabbar__link { position: relative !important; }

body.portal-body .sidebar__link .dot,
body.portal-body .tabbar__link .dot{
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #e11d48;
  pointer-events: none;
}
body.portal-body .sidebar__link .dot { top: 10px; left: 125px; }
body.portal-body .tabbar__link .dot  { top: -5px; right: 4px; }

/* —— Media queries ————————————————————————————————————— */
@media (max-width: 64rem){          /* ≤ 1024 px */
  body.portal-body .msg-head { flex: 0 0 180px; max-width: 180px; }
}

@media (max-width: 40rem){          /* ≤ 640 px */
  body.portal-body .portal-layout { padding-inline: 1rem !important; }
  body.portal-body .main          { padding-left: 0 !important; }

  body.portal-body #msg-list > li{
    flex-direction: column !important;
    padding: 1rem !important;
  }
  body.portal-body .snippet { -webkit-line-clamp: 3; line-clamp: 3; }   /* allow one extra line */
  body.portal-body .tabbar__link .dot { top: -5px; right: 4px; }
}


/* —— Avatar‑tile <summary> layout (icon over text) —————————————— */
/*  ⤷ makes the <summary> behave like the other .tabbar__link anchors   */
body.portal-body .tabbar__link > summary{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  padding: 0;                 /* remove default summary padding         */
  color: var(--color-muted);  /* base (idle) colour                     */
  line-height: 1;
  text-decoration: none;
}
body.portal-body .tabbar__link.is-active > summary,
body.portal-body .tabbar__link:hover       > summary { color: var(--color-primary); }

/* —— Mobile drop‑down positioning for avatar menu —————————————— */
/*  keeps the pop‑over anchored above the tab‑bar on small screens      */
@media (max-width: 599px){
  body.portal-body .tabbar details[open] .avatar-menu{
    position: absolute; top: -90px; right: 0; left: unset;
    background: #fff; border: 1px solid #ddd; border-radius: 6px;
    min-width: 170px; list-style: none; padding: 6px 0;
    box-shadow: 0 4px 16px rgba(0,0,0,.1); z-index: 9999;
  }
}

/* ============================================================
   Payments + Invoices page tweaks (v4.0 – 2025‑07‑31)
   =========================================================== */
body.portal-body .iframe-wrapper { margin: 0; }
body.portal-body #payment-iframe { border: none; }

body.portal-body button#pay-now-button {
    margin-top: 20px;
}
body.portal-body section.panel.invoices {
  margin-right: 5px;
  overflow: scroll;
}
body.portal-body #payment-section {
    padding: 5px;
}


/* ────────────────────────────────────────────────────────────────
   My Account page – ensure inline SVG icons inherit link colour
   (all other layout & typography is already in the shared sheet)
   ─────────────────────────────────────────────────────────────── */
body.portal-body .account-card .icon,
body.portal-body .account-row   .icon {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  fill: none;
  transition: opacity .15s;
}
body.portal-body .edit-link:hover .icon,
body.portal-body .row-link:hover  .icon { opacity: .75; }

body.portal-body .modal-content:has(.file-uploader) .modal-footer > button.btn.btn-secondary {
  display: none !important;
}

body.portal-body .modal.show,
body.portal-body .modal.fade.show {
  padding-top: max(0.85rem, calc(var(--safe-area-top) + 0.6rem));
  padding-right: max(0.75rem, var(--safe-area-right));
  padding-bottom: max(0.9rem, calc(var(--safe-area-bottom) + 0.75rem));
  padding-left: max(0.75rem, var(--safe-area-left));
}

body.portal-body .modal.show .modal-dialog,
body.portal-body .modal.fade.show .modal-dialog,
body.portal-body .modal.show .modal-dialog.msgprint-dialog,
body.portal-body .modal.fade.show .modal-dialog.msgprint-dialog {
  margin: 0 auto !important;
  width: min(100%, 34rem);
  max-width: 100%;
}

body.portal-body .modal.show .modal-content,
body.portal-body .modal.fade.show .modal-content {
  max-height: calc(
    var(--portal-vh, 100dvh) - var(--portal-kb, 0px) -
    max(1.7rem, calc(var(--safe-area-top) + var(--safe-area-bottom)))
  );
  overflow: hidden;
  border-radius: 18px;
}

body.portal-body .modal.show .modal-header,
body.portal-body .modal.fade.show .modal-header {
  padding-top: max(0.95rem, calc(var(--safe-area-top) * 0.35 + 0.7rem));
}

body.portal-body .modal.show .modal-body,
body.portal-body .modal.fade.show .modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.portal-body .modal.show .modal-header .close,
body.portal-body .modal.fade.show .modal-header .close {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: -0.35rem -0.35rem -0.35rem auto;
  border-radius: 999px;
}

/* ─────────────────────────────────────────────────────────────
   3rd‑party Apps page
   ────────────────────────────────────────────────────────────*/
body.portal-body .thirdparty-card .subhead       { font-weight:600;margin:0 0 .5rem 0; }
body.portal-body .tp-app-list                    { list-style:none;margin:0;padding:0; }
body.portal-body .tp-app-row {
  display:flex;gap:.75rem;align-items:center;
  padding:.75rem 0;border-top:1px solid rgba(0,0,0,.05);
}
body.portal-body .tp-app-row:first-child         { border-top:none; }
body.portal-body .tp-app-row .app-name           { flex:1 1 auto; }
body.portal-body .tp-app-row .since              { font-size:.8125rem; min-width:120px; }
body.portal-body .tp-app-row .row-link           { color:var(--color-primary); font-size:.875rem; }
body.portal-body .empty-state                    { text-align:center;padding:2rem 1rem; }
body.portal-body .empty-state .strong            { font-weight:600;margin-top:1rem; }

/* revoke‑confirmation block */
body.portal-body .confirm-row .warning           { margin:.75rem 0 1.25rem;
                                  font-size:.875rem;color:var(--color-muted); }
body.portal-body .confirm-row .actions           { display:flex;gap:.75rem; }
body.portal-body .btn-secondary                  { background:var(--color-surface);
                                  color:var(--color-primary);
                                  border:1px solid var(--color-primary);
                                  padding:.5rem 1.25rem;border-radius:.5rem; }
body.portal-body .btn-secondary:hover,
body.portal-body .btn-secondary:focus-visible    { background:var(--color-primary); color:#fff; }
body.portal-body .btn-danger                     { background:var(--color-danger); color:#fff;
                                  padding:.5rem 1.25rem;border:none;
                                  border-radius:.5rem; }
body.portal-body .btn-danger:hover,
body.portal-body .btn-danger:focus-visible       { opacity:.85; }

/* ─────────────────────────────────────────────────────────────
   Password page
   ────────────────────────────────────────────────────────────*/
body.portal-body .pw-card .form-group            { margin-bottom:1rem; }
body.portal-body .pw-card .form-control          { width:100%;padding:.65rem .75rem;
                                  border:1px solid #d1d5db;border-radius:.5rem; }
body.portal-body .pw-card .form-control:focus    { outline:none;border-color:var(--color-primary);
                                  box-shadow:0 0 0 3px color-mix(in srgb,
                                  var(--color-primary) 30%, transparent); }
body.portal-body .password-strength-indicator    { float:right;margin-top:-34px;
                                  width:60px;height:6px;border-radius:3px;
                                  background:#ddd; }
body.portal-body .password-strength-message,
body.portal-body .password-mismatch-message      { margin-top:.25rem; }


/* ===============================================================
   MOBILE / CAPACITOR OVERFLOW – v2 · 22 Aug 2025
   Kills every last horizontal scroll on ≤ 480 px screens.
   ============================================================== */

/* A belt‑and‑braces reset – makes sure nothing can extend the canvas */
body.portal-body { max-width: 100%; overflow-x: hidden !important; }

/* Global defensive rule – every visual asset can shrink with the page */
body.portal-body img, body.portal-body svg, body.portal-body picture, body.portal-body video, body.portal-body canvas {
  max-width: 100% !important;
  height: auto !important;
}

/* All tweaks limited to real phones */
@media (max-width: 480px) {
  /* MAIN COLUMN --------------------------------------------------- */
  body.portal-body .main { padding-left: 0 !important; }

  /* HERO CARD ------------------------------------------------------ */
  body.portal-body .hero-card {
    flex-direction: column;          /* text over image            */
    align-items: flex-start;
    padding: 1rem !important;        /* was 1.75 rem               */
    gap: 1rem !important;            /* a bit tighter              */
  }
  body.portal-body .hero-card__illus,
  body.portal-body .hero-card__illus img { width: 100% !important; }

  /* KPI GRID ------------------------------------------------------- */
  body.portal-body .kpi-grid { grid-template-columns: 1fr 1fr !important; }

  /* PANELS --------------------------------------------------------- */
  body.portal-body section.panel.invoices { margin-right: 0 !important; }
  body.portal-body .building-flex         { margin-left: 0 !important; }

  /* Make sure flex gaps don’t cause cumulative overflow            */
  body.portal-body .building-flex,
  body.portal-body .kpi-grid,
  body.portal-body .flex-grid-2col { box-sizing: border-box !important; }
  body.portal-body .portal-layout {
    padding-inline: 10px;
    padding-left: max(10px, var(--safe-area-left));
    padding-right: max(10px, var(--safe-area-right));
    margin-inline: 0;
  }

  body.portal-body .tabbar {
    max-height: none !important;
  }
}

body.portal-body select#portal-theme-select {
    color: #fff;
    font-weight: 700;
    background-color: var(--color-primary);
    font-size: small;
    min-height: 40px;
}
/*# sourceMappingURL=portal_mobile_nav.css.map*/
