/* ==========================================================================
   StayLedger Tenant Portal

   Phone first, because every tenant is on one and several are on a 360px
   Android. Laptop styles are added at breakpoints, not stripped back from a
   desktop layout.

   The palette, radii, shadows and breakpoints are the internal portal's, so the
   two read as one product rather than two that happen to share a name. The
   breakpoints in particular are deliberately identical - 560 / 820 / 1000 - so
   nobody has to hold two sets in their head.
   ========================================================================== */

/* Installed app only (js/shared.js adds .no-zoom on <html> when standalone):
   no pinch-zoom and no double-tap zoom, while single-finger panning / scrolling
   keeps working.

   This CSS rule is REQUIRED, the JS guards alone are not enough: Chrome will not
   let a script cancel a touchmove once a scroll has started, so a pinch that
   begins MID-SCROLL zoomed the page (reproduced: scale went 1 -> 5 on Android).
   `touch-action` is honoured by the compositor before any script runs, so it
   blocks that case. `pan-x pan-y` = both scroll axes allowed, pinch dropped.

   It was briefly removed on a wrong theory that it broke scrolling. It did NOT:
   the scroll bug was `overscroll-behavior` on <body> (see below). Verified with
   real touch input that scrolling still works with this rule. A normal browser
   tab never gets .no-zoom, so zoom stays available there. */
html.no-zoom, html.no-zoom body { touch-action: pan-x pan-y; }
/* ...and on EVERY element. By the CSS spec a touch is only governed by the
   touch-action of the element under the finger up to its NEAREST SCROLLING
   ANCESTOR. Both apps wrap all content in `.app` (a scroll container), so a rule
   on <html>/<body> alone never reaches the content on iOS/WebKit (Chrome ignores
   that boundary, which is why Chrome tests passed and an iPhone still zoomed
   when a second finger landed mid-scroll). Repeating the same value on every
   element closes the gap. `pan-x pan-y` still allows scrolling both ways. */
html.no-zoom *, html.no-zoom *::before, html.no-zoom *::after { touch-action: pan-x pan-y; }

:root {
  --brand-900: #14225c;
  --brand-800: #1b2e78;
  --brand-700: #1f3a8a;
  --brand-600: #2b4fc7;
  --brand-500: #3b63e8;
  --brand-100: #e5ecff;
  --brand-50:  #f2f6ff;

  --ink:      #0f172a;
  --ink-soft: #33415c;
  --muted:    #6b7690;
  --faint:    #94a1b8;

  --line:      #e4e8f2;
  --line-soft: #eef1f8;
  --bg:        #f5f7fc;
  --card:      #ffffff;

  --ok-700:#0f6b4a; --ok-100:#d9f5e7; --ok-line:#b6e7cf;
  --warn-700:#8a5300; --warn-100:#fdf0d5; --warn-line:#f4dcae;
  --bad-700:#a52034; --bad-100:#fde4e8; --bad-line:#f7c9d2;
  --info-700:#0b5f8a; --info-100:#ddf1fb; --info-line:#bfe4f6;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-2: 0 4px 12px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-3: 0 18px 44px rgba(15, 23, 42, .18);

  --header-h: 58px;
  --tabbar-h: 62px;
  /* Width of the permanent left rail on a laptop, matching the staff portal's
     sidebar proportions against this lighter theme. */
  --sidebar-w: 248px;
  /* Width of the rail when collapsed to icons only (matches the staff portal). */
  --sidebar-w-collapsed: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
/* Pull-to-refresh / overscroll-chaining guard on <html> ONLY. It must NOT be on
   <body>: body has overflow-x:hidden so Chrome (Android + desktop) treats it as
   its own scroll container, and `contain` there swallows every wheel / touch
   scroll aimed at the content (only the independently-scrolling sidebar moved).
   iOS/WebKit does not do this, which is why only iOS kept scrolling. */
html { overscroll-behavior-y: contain; }
/* When an overlay (modal, sheet, drawer, gate) is open the body is pinned by
   lockScroll() in shared.js so the page behind cannot scroll while a form or
   overlay is open. Just `overflow:hidden` on <body> - the known-good lock that
   worked on every platform. Do NOT add `touch-action:none` or lock <html>: a
   non-auto touch-action on the root scroller killed scrolling on Blink (Android
   + desktop Chrome). overflow:hidden can never leave the page stuck once the
   class is removed. */
body.scroll-locked { overflow: hidden; }
/* Mouse / trackpad screens: the page scrolls on <html>, so hold that too while a
   form is open (2026-11-02). Phones are not touched (touch guard in shared.js).
   scrollbar-gutter keeps the layout from jumping when the scrollbar hides. */
@media (hover: hover) and (pointer: fine) {
  html.scroll-locked { overflow: hidden; scrollbar-gutter: stable; }
}
/* The root canvas must carry the theme background too, not just <body>. With no
   background on <html>, the browser's default white shows through wherever body
   does not paint - on iOS rubber-band overscroll and any short-viewport gap -
   which read as white strips between the cards in dark mode. Painting the same
   token here removes that: light in light mode, deep navy in dark mode. */
html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink-soft);
  background: var(--bg);
  /* overscroll-behavior is set on <html> only (see above) - never on body. */
}

h1, h2, h3, h4 { margin: 0; color: var(--ink); line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
a { color: var(--brand-600); }

/*
 * Readable text selection in LIGHT theme on DESKTOP only. Global - applies to
 * every section and page, not just the hero. Without an explicit style the
 * browser default washed selected text out over the dark hero in light mode
 * (white text on a pale highlight). Pin a solid brand background + white text so
 * a selection is legible anywhere. Scoped to light theme (dark reads fine) and
 * >=821px so phone, tablet and iPad are untouched. Mirrors the staff portal.
 */
@media (min-width: 821px) {
  :root:not([data-theme="dark"]) ::selection {
    background: #2b4fc7;
    color: #ffffff;
  }
  :root:not([data-theme="dark"]) ::-moz-selection {
    background: #2b4fc7;
    color: #ffffff;
  }
}

/* 16px on form controls, always. Anything smaller makes iOS Safari zoom the
   whole page when the field is focused, which is disorienting mid-form. */
input, select, textarea, button { font-family: inherit; font-size: 16px; }

img { max-width: 100%; height: auto; }

/* Long values - an email address, a UPI reference - must wrap rather than push
   the layout wider than a 320px screen. */
.wrap-any { overflow-wrap: anywhere; word-break: break-word; }

.hidden { display: none !important; }

/*
 * The hidden attribute must beat any class that sets display.
 *
 * The browser's own rule is `[hidden] { display: none }`, which a class like
 * `.stage { display: grid }` outranks on specificity. The result is an element
 * whose `.hidden` property reads true while it is still painted - so the sign-in
 * card and the portal were both on screen at once, one above the other, and every
 * assertion on `el.hidden` passed while it happened. Only a screenshot showed it.
 */
[hidden] { display: none !important; }
.grow { flex: 1; min-width: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.strong { font-weight: 600; color: var(--ink); }
.num { font-variant-numeric: tabular-nums; }
.center { text-align: center; }

/* Visible only to screen readers. Used for form labels that would otherwise be
   implied by a placeholder, which assistive technology does not announce. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   Boot splash
   --------------------------------------------------------------------------
   Same refresh mechanism as the internal staff portal: on a reload the page
   cannot know who is signed in until /api/auth/tenant/me (or /api/owner/me)
   answers, and both the sign-in stage and the portal shell ship in the markup.
   Painting either one before the answer is the flicker that made a refresh look
   broken - the wrong view for a frame, or a blank screen while the request runs.

   So <html> carries class="booting" from the very first byte, which keeps every
   view out of sight and shows a neutral branded splash in its place. boot.js and
   owner.js remove the class only once the correct view has been chosen, so the
   first thing anyone sees on a refresh is this splash and then the right screen.

   Kept in the stylesheet rather than inline because the <link> in <head> blocks
   the first paint, so these rules are always in force before anything is drawn.
   ========================================================================== */
html.booting { overflow: hidden; }
/* Every top-level view stays hidden behind the splash until one is chosen. */
html.booting .signin-page,
html.booting .stage,
html.booting .app,
html.booting #console,
html.booting #needStaff { visibility: hidden; }

/* Each top-level view eases in once the splash lifts, so the reveal is a soft
   fade rather than a hard snap. The one-time entrance is driven by a marker on
   <html> that the reveal script removes right after it drops .booting. */
.signin-page, .stage, .app, #console, #needStaff {
  transition: opacity .5s ease, transform .5s ease;
}
html.page-enter .signin-page,
html.page-enter .stage,
html.page-enter .app,
html.page-enter #console,
html.page-enter #needStaff {
  opacity: 0;
  transform: translateY(6px);
}

/* NOTE: the public pages (landing, contact, terms) deliberately do NOT fade the
   whole <body>. The boot splash (#boot) is a child of <body>, so fading the body
   to opacity:0 during page-enter would also fade the splash itself to nothing -
   leaving only the bare html background visible, which on the landing page is
   near-white. That was the "white screen on reload" bug. The splash's own
   fade-out (.boot.boot-hiding) already provides the smooth reveal, so no
   body-level fade is needed or wanted here. */

/* ==========================================================================
   SKELETON LOADER (white, responsive) - tenant portal

   Shimmering ghost of the real page while html.booting is set, then the real
   view fades in. Three skeleton shapes: landing (home), login-card (sign-in,
   contact, terms), and dashboard (owner console). Always white.
   ========================================================================== */
.boot {
  position: fixed; inset: 0; z-index: 4000; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: linear-gradient(135deg, #eef2ff 0%, #dbeafe 35%, #d6f5ef 68%, #ffe9f1 100%);
  
  overflow: hidden; opacity: 1; transition: opacity .4s ease;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
html.booting .boot { display: flex; }
.boot.boot-hiding { opacity: 0; pointer-events: none; }
.boot *, .boot *::before, .boot *::after { box-sizing: border-box; }


.boot .boot-mark {
  position: relative; z-index: 3;
  width: clamp(68px, 18vw, 84px); height: clamp(68px, 18vw, 84px); border-radius: 22px;
  background: linear-gradient(150deg, #16225c, #0b1230);
  display: grid; place-items: center;
  box-shadow: 0 24px 54px -18px rgba(11,18,48,.55), inset 0 1px 0 rgba(255,255,255,.12);
}
.boot .boot-mark svg { width: 54%; height: 54%; }

.boot .boot-word { position: relative; z-index: 2; text-align: center; }
.boot .boot-word b { font-size: clamp(17px, 4.5vw, 19px); font-weight: 800; letter-spacing: .3px; color: #0b1230; }
.boot .boot-word b em { font-style: normal; color: var(--brand-500, #3b63e8); }
.boot .boot-word .tag { display: block; margin-top: 4px; font-size: 12.5px; color: #64748b; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; width: auto; max-width: none; }

.boot .boot-dots { position: relative; z-index: 2; display: flex; gap: 7px; }
.boot .boot-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-500, #3b63e8); animation: pgDot 1.1s ease-in-out infinite; }
.boot .boot-dots i:nth-child(2) { animation-delay: .16s; background: #2fd8a6; }
.boot .boot-dots i:nth-child(3) { animation-delay: .32s; background: #16225c; }
@keyframes pgDot { 0%,100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.2); } }

.boot-slow { position: absolute; left: 0; right: 0; bottom: 20px; margin: 0 auto; max-width: 280px; text-align: center; font-size: 13px; line-height: 1.5; color: var(--muted); z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  .boot, .signin-page, .stage, .app, #console, #needStaff { transition: none; }
  html.page-enter .signin-page, html.page-enter .stage, html.page-enter .app, html.page-enter #console, html.page-enter #needStaff { opacity: 1; transform: none; }
}

/* ==========================================================================
   Sign in
   ========================================================================== */

.stage {
  min-height: 100dvh;
  /* minmax(0, 1fr) rather than 1fr: an auto column can exceed a 360px viewport
     and then get clipped. This bit the internal portal and is fixed here from
     the start. */
  display: grid; grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: clamp(16px, 5vw, 40px) clamp(14px, 4vw, 32px);
  background:
    radial-gradient(760px 420px at 88% -10%, rgba(47, 216, 166, .16), transparent 68%),
    radial-gradient(680px 420px at 4% 108%, rgba(59, 99, 232, .22), transparent 70%),
    #0b1230;
}
.stage .shell { width: 100%; max-width: 420px; }

/*
 * The sign-in page frame.
 *
 * A flex column so the shared header sits at the top, the sign-in card floats in
 * the middle (the .stage grows to fill), and the shared footer is pinned to the
 * bottom on a short page yet pushed down by content on a tall one. The dark
 * gradient lives on this wrapper now, so header, card and footer share one
 * background rather than the card sitting on its own panel.
 */
.signin-page {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  /* The .nav header is position:fixed, so it sits out of flow over the top of
     this frame. Reserve its height (plus the phone safe-area inset) so the card
     below always starts clear of the header instead of tucking under it. This
     used to be provided by the .wordmark block above the card; with that gone
     the frame itself has to make the room. Applies on every screen size. */
  padding-top: calc(var(--header-h) + 6px + env(safe-area-inset-top));
  background:
    radial-gradient(760px 420px at 88% -6%, rgba(47, 216, 166, .16), transparent 68%),
    radial-gradient(680px 420px at 4% 108%, rgba(59, 99, 232, .22), transparent 70%),
    #0b1230;
}
/* Inside the frame the stage is just the centred middle band, not the whole
   viewport, and it carries no background of its own. */
.signin-page .stage {
  flex: 1 0 auto;
  min-height: 0;
  background: none;
}
/* On the sign-in/contact frame the header and footer are transparent so the
   wrapper's gradient shows through as one continuous surface. */
.signin-page .nav { background: rgba(11, 18, 48, .55); }
.signin-page .nav.scrolled { background: rgba(11, 18, 48, .82); }
.signin-page .ft { background: transparent; border-top-color: rgba(255,255,255,.08); }

/* ==========================================================================
   PRE-LOGIN LIGHT THEME  (sign-in + contact pages match the landing page)
   --------------------------------------------------------------------------
   The public pre-login pages (tenant sign-in index.html and contact.html) must
   wear the SAME light, colourful background and the SAME light header as the
   public landing page, so the product reads as one thing until the tenant logs
   in. These rules override the dark .signin-page theme above and are scoped to
   .signin-page ONLY, so the signed-in portal (#app) is never affected.
   ========================================================================== */
.signin-page {
  /*
   * The sign-in page is ALWAYS light, even when the signed-in app's dark theme
   * is remembered (data-theme="dark" on <html>, from pg.theme or the OS setting).
   * This one index.html carries both the sign-in view and the portal shell, so a
   * signed-out visitor with dark remembered used to get a dark card with dark,
   * near-invisible text here. Re-pin the theme tokens to their LIGHT values on
   * .signin-page so everything inside (the white card via var(--card), ink text,
   * inputs, borders) resolves light regardless of data-theme. boot.js also strips
   * data-theme on the sign-in view; this is the CSS belt-and-braces guard.
   */
  --ink:       #0f172a;
  --ink-soft:  #1f2937;
  --muted:     #475569;
  --faint:     #64748b;
  --line:      #e4e8f2;
  --line-soft: #eef1f8;
  --bg:        #f5f7fc;
  --card:      #ffffff;

  /* same light wash as the landing page body.landing::before */
  background-color: #e7ecfb;
  background-image:
    radial-gradient(80vmax 70vmax at 6% -4%,   rgba(129,140,248,.55), transparent 58%),
    radial-gradient(74vmax 70vmax at 104% 4%,  rgba(56,189,248,.50),  transparent 58%),
    radial-gradient(80vmax 76vmax at 96% 104%, rgba(45,212,191,.48),  transparent 60%),
    radial-gradient(72vmax 70vmax at -4% 98%,  rgba(251,146,180,.42), transparent 60%),
    linear-gradient(135deg, #e9e4ff 0%, #dbeafe 32%, #d6f5ef 64%, #ffe9f1 100%);
  background-attachment: fixed;
  color: #0f172a;
}
/* Dark-mode token re-definitions target :root[data-theme="dark"] and inputs
   globally; re-assert the light input/field surface inside .signin-page so a
   remembered dark theme cannot darken the email field or its border here. */
/* (2026-11-07) The sign-in frame no longer forces light inputs: it follows the theme (css/signin2.css). */
/* Light, visible header matching the landing page (solid-ish white glass with
   dark ink brand, not the dark navy translucent bar). */
.signin-page .nav {
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid rgba(79,70,229,.16);
  box-shadow: 0 6px 24px -18px rgba(30,41,59,.4);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
}
.signin-page .nav.scrolled { background: rgba(255,255,255,.95); }
/* Brand text: dark ink + indigo "Ledger", and a visible property sub-label. */
.signin-page .nav .nav-who b { color: #0f172a; }
.signin-page .nav .nav-who b em {
  background: linear-gradient(120deg, #4f46e5, #2563eb);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.signin-page .nav .nav-who span { color: #475569; font-weight: 600; }
/* Header buttons on the light bar: readable glass + indigo primary. */
.signin-page .nav .btn-glass {
  color: #4338ca; background: rgba(255,255,255,.75);
  border: 1px solid rgba(79,70,229,.28);
}
.signin-page .nav .btn-glass:hover { background: #fff; }
/* Footer sits as a slim light bar pinned to the bottom of the viewport. In the
   .signin-page flex column it is flex:none and the .stage takes the slack, so on
   a tall page it follows the content and on a short page it rests at the bottom -
   never growing on iOS overscroll (no safe-area padding here) and never leaving a
   gap. Minimal height: the two-line copyright plus a little breathing room. */
.signin-page .ft {
  flex: none;
  background: rgba(255,255,255,.72);
  border-top: 1px solid rgba(79,70,229,.14);
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
}
.signin-page .ft .ft-legal { color: #475569; }
.signin-page .ft .ft-legal span { color: #475569; }
.signin-page .ft .ft-contact { color: #4338ca; }
.signin-page .ft .ft-legal-line { color: #475569; }
/* Text that sits on the light wash (hints, lede, labels) must use dark,
   readable tones instead of the dark-theme's faint light greys. The card itself
   is white, so these dark values read well both on the card and on the wash. */
.signin-page .hint { color: #475569; }
.signin-page .lede { color: #475569; }
.signin-page .auth-card h1 { color: #0f172a; }
.signin-page label,
.signin-page .field label { color: #334155; }
.signin-page .legal-updated { color: #64748b; }
.signin-page .legal-body h2 { color: #1e293b; }
.signin-page .legal-body p,
.signin-page .legal-body li { color: #334155; }
/* Links on the light theme: readable indigo, not the dark-theme light blue. */
.signin-page a:not(.btn) { color: #4338ca; }
/* Safety net: the body/html behind the pre-login frame must also be light so no
   dark navy ever peeks through on overscroll or a very short viewport.

   MUST match ONLY while the sign-in view is actually on screen. index.html holds
   BOTH the sign-in frame (#signIn.signin-page) and the signed-in app (#app) in
   one body, and boot.js hides #signIn with the `hidden` attribute after login.
   The old selector matched on the mere PRESENCE of .signin-page, so it kept
   forcing the body light even after sign-in - which, in dark mode, left the
   signed-in app with dark cards on a light #e7ecfb body (the owner's bug). The
   `:not([hidden])` guard restricts this to the pre-login state; once #signIn is
   hidden the body falls back to var(--bg) and dark mode is honoured. */
body:has(> .signin-page:not([hidden])),
body.dark-page:has(.signin-page:not([hidden])) {
  background: #e7ecfb;
}

/*
 * Installed app (standalone PWA) only.
 *
 * In the installed Tenant app the sign-in screen must be a dead end: just the
 * code sign-in, with no header "Home" link back to the public landing page and
 * no footer Contact link. Those are the only ways off this page, so both are
 * hidden here. Scoped to .signin-page so it only affects the tenant sign-in
 * screen. This matches ONLY when launched from the home screen as an app; a
 * normal browser tab never matches it, so the website is unchanged. The card
 * gets a little top room back since the fixed header is gone.
 */
@media (display-mode: standalone) {
  .signin-page .nav { display: none; }
  .signin-page .ft { display: none; }
}
/* in-app mirror of the display-mode: standalone block above */
:where(html[data-in-app]) .signin-page .nav {
  display: none;
}
:where(html[data-in-app]) .signin-page .ft {
  display: none;
}

.wordmark { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.wordmark .mark {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px;
  background: linear-gradient(140deg, var(--brand-700), var(--brand-900));
  display: grid; place-items: center;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .6);
}
.wordmark svg { width: 27px; height: 27px; display: block; }
.wordmark .name { display: block; font-size: 19px; font-weight: 700; color: #fff; letter-spacing: -.2px; }
.wordmark .name em { font-style: normal; color: #2fd8a6; }
.wordmark .sub { display: block; font-size: 12.5px; color: #9aa7cc; }

/* ----------------------------------------------------------------------------
   Centred wordmark above the sign-in card, mirroring the staff login screen.
   Logo + "StayLedger" (dark ink / indigo "Ledger" to suit the light sign-in
   theme) + an uppercase "Tenant Login" sub-label. Dedicated class so it never
   touches the dark .wordmark used on owner/terms/maintenance pages.

   LAPTOP / DESKTOP BROWSER ONLY: hidden by default (phones), shown at >=768px,
   and force-hidden again inside the installed app (standalone). This keeps the
   mobile view and the PWA exactly as they are.
   -------------------------------------------------------------------------- */
.signin-wordmark { display: none; }
@media (min-width: 768px) {
  .signin-wordmark {
    display: flex; align-items: center; justify-content: center; gap: 11px;
    margin-bottom: 20px;
    animation: swDrop .6s cubic-bezier(.2, .9, .25, 1) both;
  }
}
@media (display-mode: standalone) {
  /* Installed app only: show the centred wordmark (logo mark + "StayLedger" +
     "Tenant Login" sub-label) above the sign-in card. In the installed app the
     fixed header is present but the brand above the card gives the sign-in
     screen the same branded lockup as the staff app. This block matches ONLY
     the installed app, so the browser/website view is unchanged (there the
     wordmark follows the min-width:768px desktop rule above). */
  .signin-wordmark {
    display: flex !important; align-items: center; justify-content: center; gap: 11px;
    margin-bottom: 20px;
    animation: swDrop .6s cubic-bezier(.2, .9, .25, 1) both;
  }
}
/* in-app mirror of the display-mode: standalone block above */
:where(html[data-in-app]) .signin-wordmark {
  display: flex !important; align-items: center; justify-content: center; gap: 11px;
    margin-bottom: 20px;
    animation: swDrop .6s cubic-bezier(.2, .9, .25, 1) both;
}
.signin-wordmark .mark {
  width: 42px; height: 42px; flex: none; border-radius: 13px;
  background: linear-gradient(160deg, #4b76ff, #16225c);
  display: grid; place-items: center;
  box-shadow: 0 10px 26px rgba(11, 18, 48, .5), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.signin-wordmark .mark svg { width: 22px; height: 22px; display: block; }
.signin-wordmark .sw-text { line-height: 1; }
.signin-wordmark .sw-name { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.03em; color: #0f172a; }
.signin-wordmark .sw-name em { font-style: normal; color: #2563eb; }
.signin-wordmark .sw-sub {
  display: block; margin-top: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: #475569;
}
@keyframes swDrop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.auth-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: clamp(20px, 5vw, 28px);
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, .7);
}
.auth-card h1 { font-size: clamp(20px, 5.5vw, 24px); margin-bottom: 6px; }
.auth-card .lede { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

.field { margin-bottom: 16px; }
.field > label {
  display: block; margin-bottom: 7px;
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.input, .select, .textarea {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: var(--r);
  background: var(--card); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: #cdd6ea; }
.input:focus, .select:focus, .textarea:focus {
  outline: 0; border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59, 99, 232, .16);
}
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--line-soft); color: var(--muted); cursor: not-allowed;
}
.hint { margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.hint.is-bad { color: var(--bad-700); font-weight: 600; }

/* Phone field with a fixed +91 country-code chip to the left of the input. */
.phone-field { display: flex; align-items: stretch; }
.phone-cc {
  display: inline-flex; align-items: center;
  padding: 0 12px; font-size: 16px; font-weight: 600; color: var(--ink-soft);
  background: var(--line-soft); border: 1.5px solid var(--line); border-right: 0;
  border-radius: var(--r) 0 0 var(--r);
}
.phone-field .input { border-radius: 0 var(--r) var(--r) 0; }
.phone-field .input:focus { position: relative; z-index: 1; }

/* The green success tick shown on the contact page after a message is sent. */
.done-mark {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 28px; font-weight: 800; color: #fff;
  background: linear-gradient(145deg, #2fd8a6, #0f6b4a);
  box-shadow: 0 12px 28px -12px rgba(15, 107, 74, .8);
}

/* ------------------------------ the code boxes ---------------------------- */

.otp { display: flex; gap: 8px; justify-content: space-between; margin: 4px 0 14px; }
.otp input {
  width: 100%; max-width: 54px; aspect-ratio: 1 / 1.15;
  text-align: center; font-size: 22px; font-weight: 700;
  color: var(--brand-700);
  border: 1.5px solid var(--line); border-radius: 11px; background: var(--card);
}
.otp input:focus {
  outline: 0; border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59, 99, 232, .16);
}
@media (max-width: 360px) {
  .otp { gap: 5px; }
  .otp input { font-size: 19px; }
}

/* -------------------- device limit list (sign-in step) -------------------- */
/* Uses theme tokens so it reads correctly in both light and dark mode. */
.device-list { display: grid; gap: 10px; margin: 4px 0 8px; }
.device-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card);
}
.device-info { flex: 1 1 auto; min-width: 0; }
.device-name { font-weight: 600; color: var(--ink); font-size: 14.5px; }
.device-seen { font-size: 12.5px; margin-top: 2px; }
.device-row .btn { flex: none; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 18px;
  font-size: 15px; font-weight: 600; line-height: 1.2;
  border-radius: var(--r); border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .08s, background .15s, border-color .15s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

.btn-primary { background: var(--brand-600); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-700); }
.btn-soft { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.btn-soft:hover:not(:disabled) { background: var(--brand-100); }
.btn-ghost { background: var(--card); color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); border-color: #cdd6ea; }
.btn-bad { background: var(--card); color: var(--bad-700); border-color: var(--bad-line); }
.btn-bad:hover:not(:disabled) { background: var(--bad-100); }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 8px 13px; font-size: 13.5px; border-radius: var(--r-sm); }

/* A full-width primary action, the shape used at the end of every form. */
.btn-go { width: 100%; min-height: 50px; font-size: 16px; }

.spinner {
  width: 15px; height: 15px; flex: none;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
.spinner-dark { border-color: rgba(31, 58, 138, .25); border-top-color: var(--brand-700); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Messages
   ========================================================================== */

.msg {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; margin-bottom: 16px;
  border: 1px solid transparent; border-radius: var(--r);
  font-size: 14px; line-height: 1.5;
}
.msg .ic { flex: none; font-size: 15px; line-height: 1.35; }
.msg-bad  { background: var(--bad-100);  border-color: var(--bad-line);  color: var(--bad-700); }
.msg-ok   { background: var(--ok-100);   border-color: var(--ok-line);   color: var(--ok-700); }
.msg-warn { background: var(--warn-100); border-color: var(--warn-line); color: var(--warn-700); }
.msg-info { background: var(--info-100); border-color: var(--info-line); color: var(--info-700); }

/* The card shakes once on a failure. Movement is noticed where a colour change
   alone can be missed, particularly on a small screen held at arm's length. */
.shake { animation: shake .3s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ==========================================================================
   App shell
   ========================================================================== */

/* Flex column so a short screen still pushes the copyright to the very bottom.
   .main grows to fill the gap; the footer then sits at the foot of the viewport
   rather than floating directly under a small amount of content. */
.app {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  /* The topbar is FIXED (see below), so the app content starts below it. Padding
     here reserves the header's height - exactly what the staff portal does. Kept
     with the safe-area insets so content clears the notch and the home indicator. */
  padding-top: calc(var(--header-h) + env(safe-area-inset-top));
  padding-bottom: env(safe-area-inset-bottom);
}

/*
 * The hamburger in the topbar.
 *
 * Below the 1000px rail breakpoint, navigation is the fixed bottom tab bar -
 * always fully visible, nothing to open or close - so the hamburger has no
 * job there and is hidden. At >=1000px the bar becomes the permanent left
 * rail and the hamburger reappears to do the one thing it still does:
 * collapse that rail to an icon-only strip (wireChrome's setCollapsed).
 */
.hamburger { display: none; }
@media (min-width: 1000px) {
  .hamburger {
    display: grid; place-items: center; width: 40px; height: 40px; flex: none;
    border: 1px solid var(--line); border-radius: 10px; background: #fff;
    cursor: pointer; color: var(--ink-soft);
    transition: background .15s, border-color .15s;
  }
}
.hamburger:hover { background: var(--brand-50); border-color: #c6d1ea; }
.hamburger:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

.topbar {
  /* Fixed, not sticky: it stays put across every scroll on every device. Sticky
     inside the flex-column .app made the header drift and, worse, left the page
     feeling frozen under a finger on iOS (a sticky header in a min-height:100dvh
     flex column turns touch scrolling unreliable). Fixed + .app padding-top is
     the same approach the staff portal uses, and it scrolls cleanly. */
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) clamp(12px, 4vw, 20px) 0;
  display: flex; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
/* The topbar brand lockup, mirroring the staff portal: a mark, "StayLedger" and
   a "Tenant portal" subtitle. This replaced the old .brand block that repeated
   the tenant's name/room (which the top-right profile button already shows). */
.brand-lockup { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; flex: none; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand-700), var(--brand-900));
  box-shadow: 0 6px 16px rgba(31, 58, 138, .28);
}
.brand-mark svg { width: 22px; height: 22px; display: block; }
.brand-text b { display: block; font-size: 15px; color: var(--ink); letter-spacing: -.2px; }
.brand-text span { display: block; font-size: 11.5px; color: var(--muted); }

.avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(145deg, var(--brand-500), var(--brand-800));
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 62px; height: 62px; font-size: 22px; }

/* Header profile button (top-right), mirroring the staff portal: avatar, name and
   a caret. Opens the account sheet. The room line hides on very small phones so the
   header never crowds. */
.profile-btn {
  display: inline-flex; align-items: center; gap: 9px; flex: none;
  padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; cursor: pointer; max-width: 62vw;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.profile-btn:hover { border-color: #cdd6ea; box-shadow: var(--shadow-1); }
.profile-btn:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.profile-btn.is-open { border-color: var(--brand-500); background: var(--brand-50); }
.pb-avatar {
  width: 30px; height: 30px; flex: none; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(145deg, var(--brand-500), var(--brand-800));
}
.pb-avatar img { width: 100%; height: 100%; object-fit: cover; transition: opacity .18s ease; }
/* Used while a new profile photo is swapped in (instant local preview, then the
   uploaded one once ready) so the change reads as a deliberate fade. */
.pb-avatar img.is-fading { opacity: 0; }
.pb-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; text-align: left; }
.pb-who b { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-who span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-caret { flex: none; font-size: 10px; color: var(--muted); }
.profile-btn .dot {
  position: absolute; top: 2px; right: 2px;
  width: 9px; height: 9px; border-radius: 50%; background: #e0334f; border: 1.5px solid #fff;
}
.profile-btn { position: relative; }
@media (max-width: 400px) {
  .pb-who span { display: none; }        /* keep just the name on tiny phones */
  .profile-btn { max-width: 56vw; }
}
/* On a phone the topbar carries the hamburger, the brand mark and the profile
   button; hide the brand wordmark so it never crowds, keeping just the mark. The
   laptop rail shows the full lockup. Mirrors the staff portal. */
@media (max-width: 640px) {
  .topbar .brand-text { display: none; }
}

/* flex: 1 so the content area takes up the slack on a short screen, pushing the
   persistent copyright footer down to the bottom of the viewport.
   width:100% because .app is a flex column: without it the flex item shrinks to
   its content's intrinsic width (and looks phone-narrow) once max-width + auto
   margins are applied on wider screens. */
/*
 * Bottom padding clears the fixed tab bar (var(--tabbar-h) + its own safe-area
 * padding) plus the normal 28px breathing room, so the last card is never
 * hidden behind the bar. Only matters below the 1000px rail breakpoint, where
 * .tabbar is fixed to the bottom instead of being a side rail - the
 * min-width:1000px block above resets this back to a plain 60px.
 */
.main {
  flex: 1 0 auto; min-width: 0; width: 100%;
  padding: 16px clamp(12px, 4vw, 20px) calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px);
}

/* ==========================================================================
   Primary navigation: a fixed bottom tab bar on phone/tablet, a permanent
   left rail on laptop/desktop.
   --------------------------------------------------------------------------
   Below 1000px every screen (Home, My rent, Receipts, Food, Problems) sits in
   one fixed bar at the bottom - always on screen, no drawer, no extra tap.
   The breakpoint further down (min-width:1000px) turns the exact same markup
   into the permanent left rail the portal used before switching to a bottom
   bar, so a laptop/desktop visitor sees no change at all.

   Scoped under body:not(.staff-console) so these rules only ever apply to
   the tenant portal's own #tabs - the owner console (owner.html, which carries
   body.staff-console) keeps its separate, already-shipped .tabbar rules
   further down this file untouched.
   ========================================================================== */

/* The grid that holds the rail and the main view on a laptop/desktop. Below
   that breakpoint it is a single column - the bar is fixed/out of flow, not a
   grid item - so flex:1 just fills the gap between header and footer and
   keeps the copyright at the foot of a short screen.

   Scoped to .app-shell (the signed-in app), NOT the sign-in page. The sign-in
   page uses .stage .shell as a plain centred container; if these grid rules were
   named .shell they would also catch it and float the "Accounts are set up..."
   hint beside the auth card on a laptop. */
.app-shell { display: grid; grid-template-columns: 1fr; flex: 1 0 auto; min-width: 0; }

/*
 * The bottom bar, phone first. Fixed (not sticky) so it never scrolls away -
 * it is the one piece of chrome that must always stay reachable.
 *
 * `minmax(0, 1fr)` rather than a bare `1fr`: on the narrowest real phones
 * (320-360px) five equal columns with the longest label ("My rent" / "Receipts")
 * can ask for more than its share; minmax's 0 floor lets a column shrink below
 * its content's natural width instead of overflowing the bar sideways.
 */
body:not(.staff-console) .tabbar {
  /*
   * top:auto is deliberate and load-bearing, not a default left to chance.
   * The owner console's OWN generic .tabbar rule (further down this file,
   * lower specificity) sets top:var(--header-h) at >=820px for ITS sticky-bar
   * mode. Specificity means position/bottom/height here still win over that
   * rule - but CSS still lets an unset property fall through from a weaker
   * rule. Without an explicit top here, top:var(--header-h) leaks in from
   * that rule, and a fixed box with top, bottom AND height all set at once is
   * over-constrained - the browser then drops `bottom`, and the bar renders
   * pinned under the header instead of at the foot of the screen. Pinning
   * top:auto here closes that gap for good.
   */
  position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 56;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: rgba(255, 255, 255, .97);
  backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 16px rgba(15, 23, 42, .06);
}
body:not(.staff-console) .tabbar button {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 0; height: 100%;
  padding: 6px 2px; border: 0; background: transparent; cursor: pointer;
  font-size: 11px; font-weight: 600; line-height: 1.15; color: var(--muted);
  transition: color .14s ease;
}
body:not(.staff-console) .tabbar button .ic {
  flex: none; font-size: 19px; line-height: 1; opacity: .85;
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), opacity .14s ease;
}
/* The label never wraps to a second line and never forces its column wider
   than the others - it shrinks with an ellipsis instead. This is the actual
   fix for "Food preference"/"My rent" colliding on a 320px-360px phone. */
body:not(.staff-console) .tabbar button .label {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body:not(.staff-console) .tabbar button.is-active { color: var(--brand-600); }
body:not(.staff-console) .tabbar button.is-active .ic { opacity: 1; transform: translateY(-1px) scale(1.08); }
body:not(.staff-console) .tabbar button:focus-visible { outline: 2px solid var(--brand-500); outline-offset: -2px; }
/* The Problems badge: a dot rather than a number, matching the old sidebar. */
body:not(.staff-console) .tabbar button .dot {
  position: absolute; top: 5px; right: calc(50% - 17px);
  width: 8px; height: 8px; border-radius: 50%;
  background: #e0334f; border: 1.5px solid #fff;
}

/*
 * Dark mode: the bottom bar hardcodes a light, near-white background and the
 * notification dot hardcodes a white ring - neither is a design-system token,
 * so neither one follows :root[data-theme="dark"] on its own (unlike the
 * labels and active-state colours above, which already use var(--muted) /
 * var(--brand-600) and so already looked right in dark mode). This is what
 * left a bright white strip glued to the bottom of an otherwise dark screen.
 * The desktop RAIL mode further down already uses var(--card)/var(--line)
 * throughout and needs no equivalent fix - only the phone/tablet bottom-bar
 * mode had the hardcoded colour.
 */
:root[data-theme="dark"] body:not(.staff-console) .tabbar {
  background: rgba(22, 29, 49, .94);
  border-top-color: var(--line);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, .45);
}
:root[data-theme="dark"] body:not(.staff-console) .tabbar button .dot { border-color: var(--card); }

/* Narrowest phones (iPhone SE and similar, ~320-375px): tighten the type and
   padding a little further so five labels keep their full words instead of
   leaning on the ellipsis for everyday use - the ellipsis above is a safety
   net, not the normal look. */
@media (max-width: 380px) {
  body:not(.staff-console) .tabbar button { padding: 5px 1px; font-size: 11px; gap: 1px; }
  body:not(.staff-console) .tabbar button .ic { font-size: 18px; }
}

/* A little more breathing room once a phone is wide enough to afford it
   (large phones in portrait, small tablets in portrait). Still the bottom bar -
   .tabbar only becomes the rail at the laptop breakpoint, much further down. */
@media (min-width: 480px) {
  body:not(.staff-console) .tabbar button { font-size: 11.5px; gap: 3px; }
  body:not(.staff-console) .tabbar button .ic { font-size: 20px; }
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  overflow: hidden;
}
.card + .card { margin-top: 14px; }
.card-head {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start;
  padding: 15px 16px; border-bottom: 1px solid var(--line-soft);
}
.card-head h3 { font-size: 15px; }
.card-head p { font-size: 12.5px; color: var(--muted); margin: 3px 0 0; }
/* flex-basis 0 so the title never claims space while the row is being measured -
   otherwise a pill beside it wraps to its own line and sits there stranded. */
.card-head .titles { flex: 1 1 0; min-width: 0; }
.card-head .pill { margin-left: auto; flex: none; }
.card-body { padding: 16px; }
.card-foot {
  padding: 13px 16px; border-top: 1px solid var(--line-soft);
  background: #fcfdff;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}

.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: clamp(19px, 5vw, 23px); margin-bottom: 4px; }
.page-head p { font-size: 13.5px; color: var(--muted); }

/* ==========================================================================
   The hero card - what I owe, and where it stands
   ========================================================================== */

.due {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: clamp(18px, 5vw, 24px);
  color: #fff; margin-bottom: 16px;
  box-shadow: 0 14px 34px -18px rgba(20, 34, 92, .8);
}
.due::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(420px 180px at 90% -30%, rgba(255, 255, 255, .20), transparent 70%),
    radial-gradient(300px 160px at 8% 130%, rgba(255, 255, 255, .12), transparent 70%);
}
.due > * { position: relative; z-index: 1; }
/* One colour per state, so the answer registers before a word is read. */
.due.is-due      { background: linear-gradient(120deg, #1b2e78, #2b4fc7); }
.due.is-overdue  { background: linear-gradient(120deg, #8a1c2c, #c0392b); }
.due.is-pending  { background: linear-gradient(120deg, #8a5300, #c07b18); }
.due.is-approved { background: linear-gradient(120deg, #0f6b4a, #16a34a); }
.due.is-rejected { background: linear-gradient(120deg, #7a1230, #b3253f); }

.due .when { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.due .amount {
  font-size: clamp(30px, 9vw, 40px); font-weight: 700; letter-spacing: -1px;
  margin: 6px 0 2px; font-variant-numeric: tabular-nums;
}
.due .state { font-size: 15px; font-weight: 600; }
.due .note {
  margin-top: 12px; padding: 10px 12px;
  background: rgba(255, 255, 255, .15); border-radius: var(--r-sm);
  font-size: 13.5px; line-height: 1.5;
}
.due .actions { margin-top: 16px; display: grid; gap: 9px; }
/*
 * Two on-hero buttons ("Pay this rent" + "Add payment details"): equal width,
 * same height, side by side once there is genuinely enough room for both
 * labels on one line without crowding - narrower than that, two full-width
 * stacked buttons reads cleaner than two cramped, wrapping half-width ones.
 * `.two` sizes DOWN (font, padding) rather than just splitting the row in
 * half, because "Add payment details" is noticeably longer than "Pay this
 * rent" and the default .btn size (15px, 12px/18px padding, no wrapping)
 * does not fit two of these side by side on an ordinary phone width.
 */
.due .actions.two {
  grid-template-columns: 1fr 1fr; gap: 10px;
}
.due .actions.two .btn {
  min-height: 44px; padding: 10px 10px; font-size: 13.5px;
  white-space: normal; text-align: center; line-height: 1.25;
}
@media (max-width: 399px) {
  /* Too narrow for two equal halves without crowding the text: stack instead. */
  .due .actions.two { grid-template-columns: 1fr; }
}
.due .btn-onhero { background: rgba(255, 255, 255, .95); color: var(--brand-800); border: 0; }
.due .btn-onhero:hover:not(:disabled) { background: #fff; }
.due .btn-onhero-ghost {
  background: rgba(255, 255, 255, .14); color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .55);
  font-weight: 700;
}
.due .btn-onhero-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .26); border-color: rgba(255, 255, 255, .75); }

/* Laptop/desktop: the hero (every state - due, overdue, pending, approved,
   rejected) stacked its note strip and button full-width across the ~900px
   column, so it looked stretched and tall. Lay it out side by side instead:
   month/amount/status on the left, note + button in a fixed-width column on the
   right. Same width as the other cards, about half the height. Phones and the
   installed app (<760px) keep the stacked layout unchanged. */
@media (min-width: 760px) {
  .due {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    align-items: center; gap: 14px 28px; padding: 22px 26px;
  }
  .due .amount { font-size: 34px; margin: 4px 0 2px; }
  .due-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
  .due .note { margin-top: 0; padding: 9px 12px; font-size: 13px; }
  .due .actions { margin-top: 0; }
  .due .actions .btn { width: 100%; }
  /* The fixed-width due-side column (240-320px) is too narrow to split two
     buttons side by side without crowding "Add payment details" - stack them
     instead, same as a narrow phone, rather than force equal cramped halves. */
  .due .actions.two { grid-template-columns: 1fr; }
  .due .actions.two .btn { min-height: 46px; padding: 11px 14px; font-size: 14px; }
}

/*
 * Swipeable month deck. Only appears when a tenant has more than one open
 * month (see App.openMonths/App.dueStack) - the common case of a single open
 * month renders the plain .due hero above with no wrapper at all, so nothing
 * about this changes how the vast majority of tenants see the app.
 *
 * Native scroll-snap, the same technique already used for the food page's
 * "today's meals" strip on a phone - no drag/touch JS needed, the browser's
 * own momentum scrolling does the swipe.
 */
.due-stack-wrap { margin-bottom: 16px; }
.due-stack {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  gap: 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 0 -2px; padding: 0 2px;
}
.due-stack::-webkit-scrollbar { display: none; }
.due-slide { flex: 0 0 100%; scroll-snap-align: center; min-width: 0; }
.due-slide .due { margin-bottom: 0; }
.due-dots { display: flex; justify-content: center; gap: 7px; margin-top: 10px; }
.due-dot {
  width: 7px; height: 7px; border-radius: 999px; background: var(--line);
  cursor: pointer; transition: background .15s ease, transform .15s ease;
}
.due-dot.is-on { background: var(--brand-600); transform: scale(1.25); }

/* ==========================================================================
   Pills
   ========================================================================== */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--line-soft); color: var(--ink-soft); border: 1px solid var(--line);
}
.pill.ok   { background: var(--ok-100);   color: var(--ok-700);   border-color: var(--ok-line); }
.pill.warn { background: var(--warn-100); color: var(--warn-700); border-color: var(--warn-line); }
.pill.bad  { background: var(--bad-100);  color: var(--bad-700);  border-color: var(--bad-line); }
.pill.info { background: var(--info-100); color: var(--info-700); border-color: var(--info-line); }
.pill.brand{ background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }

/* ==========================================================================
   Lists - used instead of tables, because a table on a phone is a scroll bar
   ========================================================================== */

.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line-soft);
  text-align: left; width: 100%;
  background: none; border-left: 0; border-right: 0; border-top: 0;
}
.rows > .row:last-child { border-bottom: 0; }
button.row { cursor: pointer; font: inherit; color: inherit; }
button.row:hover { background: #fafbff; }
button.row:focus-visible { outline: 2px solid var(--brand-500); outline-offset: -2px; }
.row .lead { flex: 1; min-width: 0; }
.row .lead b { display: block; font-size: 14.5px; color: var(--ink); font-weight: 600; }
.row .lead span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.row .trail { flex: none; text-align: right; display: grid; gap: 5px; justify-items: end; }
.row .trail .figure { font-size: 14.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty .ic { font-size: 30px; display: block; margin-bottom: 10px; opacity: .5; }
.empty b { display: block; color: var(--ink); margin-bottom: 5px; font-size: 15px; }

/* Two facts side by side - rent and advance, room and floor. */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); }
.facts > div { background: var(--card); padding: 14px 16px; }
.facts .k { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.facts .v { font-size: 16px; font-weight: 700; color: var(--ink); margin-top: 4px; }
.facts .v.small { font-size: 14px; font-weight: 600; }

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: end center; }
.modal-root[hidden] { display: none; }
.modal-veil { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); }
.modal {
  position: relative; width: calc(100% - 20px); max-width: 520px;
  margin: 0 10px 10px; display: flex; flex-direction: column;
  /* Height cap so the modal body (.modal-body, overflow-y:auto) becomes the
     scroll area on short screens. The `vh` line is a fallback for older Android
     WebView/Chrome that does NOT understand `dvh`: without it those browsers
     ignored the dvh cap entirely, the modal grew to its natural height, the
     body never scrolled, and content below the fold was unreachable (the food
     preference dialog could not be fully seen or marked on some phones). Modern
     browsers use the dvh line that follows. */
  max-height: 92vh;
  max-height: 92dvh;
  background: var(--card);
  /* A card rising from the bottom, which is where a thumb already is. All four
     corners are rounded (with a small bottom margin above so the lower corners
     show), rather than a flush bottom sheet. Becomes a centred dialog on a
     larger screen. */
  border-radius: var(--r-lg);
  /* Clip children to the rounded corners. Without this the .modal-foot's solid
     #fcfdff background squared off the two BOTTOM corners (the owner's report),
     because the footer is the last flex child and painted right up to the modal
     edge. overflow:hidden makes the footer follow the modal's bottom radius -
     the same technique .card already uses. */
  overflow: hidden;
  box-shadow: var(--shadow-3);
  animation: sheet .22s cubic-bezier(.2, .8, .2, 1);
}
@keyframes sheet { from { transform: translateY(100%); } }
/* Header is PINNED (flex:none) - never scrolls with the body. */
.modal-head {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 18px; border-bottom: 1px solid var(--line-soft);
  flex: none;
}
.modal-head h3 { font-size: 16.5px; }
.modal-head p { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
/* The body is the ONLY scroll region: flex:1 + min-height:0 so it scrolls
   inside the flex column instead of pushing the pinned header/footer out.
   Never scrolls sideways. */
.modal-body {
  flex: 1 1 auto; min-height: 0;
  padding: 18px; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
}
.modal, .modal-head, .modal-foot { overflow-x: hidden; }

/* An uploaded photo shown inside the modal viewer: fit it to the card at a
   readable size rather than overflowing. Used by the in-app file viewer. */
.proof-img {
  display: block; width: 100%; max-height: 420px; object-fit: contain;
  border-radius: var(--r); border: 1px solid var(--line);
  background: var(--line-soft); margin: 0 auto;
}
.modal-foot {
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft); background: #fcfdff;
  display: flex; flex-wrap: wrap; gap: 10px;
  flex: none;   /* footer PINNED - buttons never scroll with the body */
}
.modal-foot .btn { flex: 1 1 100%; }
.icon-btn {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--card);
  cursor: pointer; color: var(--ink-soft); font-size: 17px;
}
.icon-btn:hover { background: var(--brand-50); border-color: #c6d1ea; color: var(--brand-700); }

@media (min-width: 560px) {
  .modal-root { place-items: center; padding: 20px; }
  .modal { border-radius: var(--r-lg); animation: rise .2s cubic-bezier(.2, .8, .2, 1); }
  @keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
  .modal-foot { justify-content: flex-end; }
  .modal-foot .btn { flex: 0 1 auto; }

  /* The Problems page "Report a problem" button is btn-block (full width), which
     is the right tap target on a phone but looks oversized stretched across a
     wide laptop card. On tablet/laptop size it to its own content and align it
     left; phones (<560px) keep the full-width block. */
  .card-body > #raise.btn-block {
    display: inline-flex;
    width: auto;
    align-self: flex-start;
  }
}

/* ==========================================================================
   Toasts
   ========================================================================== */

.toast-stack {
  position: fixed; z-index: 200; left: 12px; right: 12px;
  /* Below the 1000px rail breakpoint the tab bar is fixed to the bottom of the
     screen, so a toast has to clear it too, not just the phone's own safe-area
     inset - otherwise the bar covers whatever a toast says. At >=1000px (see
     the min-width:1000px block further down) this resets back to a plain
     16px, since the bar is the side rail there, not fixed to the bottom. */
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r);
  background: var(--ink); color: #fff; font-size: 14px; line-height: 1.45;
  box-shadow: var(--shadow-2);
  animation: toast-in .2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.toast.is-out { opacity: 0; transition: opacity .2s; }
.toast.ok   { background: #0f6b4a; }
.toast.bad  { background: #a52034; }
.toast.warn { background: #8a5300; }
.toast b { display: block; }
.toast .x {
  flex: none; border: 0; background: none; color: inherit;
  font-size: 18px; line-height: 1; cursor: pointer; opacity: .8; padding: 0 2px;
}
@media (min-width: 560px) {
  .toast-stack { left: auto; right: 16px; max-width: 360px; }
  /* bottom stays the tab-bar-aware value set above until the 1000px rail
     breakpoint resets it - a 560-999px tablet still has the fixed bottom bar. */
}

/* ==========================================================================
   Skeletons - shown while the first request is in flight
   ========================================================================== */

.skeleton {
  height: 13px; border-radius: 6px;
  background: linear-gradient(90deg, #eef1f8 25%, #e2e7f3 37%, #eef1f8 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ==========================================================================
   Larger screens
   ========================================================================== */

@media (min-width: 820px) {
  /* Tablet / small laptop, but below the permanent-rail breakpoint (1000px):
     navigation is still the fixed bottom bar here, so the main column just
     gets more room and centres its content; bottom padding still has to clear
     the bar, same reasoning as the phone-width rule above. */
  .main { max-width: 760px; margin: 0 auto; padding: 24px 24px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px); }
  /* Toasts still need to clear the fixed bottom bar at this width (the rail
     breakpoint is 1000px, not 820px) - no override here; see the base rule. */
}

/* ==========================================================================
   Permanent left rail

   At >=1000px (the shared breakpoint) the sidebar stops being a drawer and
   becomes a fixed rail down the left, exactly like the staff portal: the .shell
   grid opens a first column the width of the rail and .main is pinned to the
   second column so nothing sits underneath it.
   ========================================================================== */
@media (min-width: 1000px) {
  .app-shell { grid-template-columns: var(--sidebar-w) 1fr; }
  /* The bottom bar becomes the permanent left rail - same markup, same
     classes, just laid out as a vertical column of icon+label rows instead of
     a fixed strip along the bottom. This is the exact layout the portal used
     before the bottom bar existed. */
  body:not(.staff-console) .tabbar {
    position: fixed; top: calc(var(--header-h) + env(safe-area-inset-top)); bottom: 0; left: 0; right: auto;
    z-index: 55;
    width: var(--sidebar-w); height: auto;
    display: flex; flex-direction: column; gap: 3px;
    /* Menu starts at the TOP of the rail. The owner-console .tabbar rule at
       >=820px sets justify-content:center, which pushed this list to the
       middle of the screen on the tenant website (2026-11-02). */
    justify-content: flex-start;
    padding: 18px 10px calc(20px + env(safe-area-inset-bottom));
    background: var(--card); border-top: 0; border-right: 1px solid var(--line);
    box-shadow: none; backdrop-filter: none;
    overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  }
  body:not(.staff-console) .tabbar button {
    flex-direction: row; justify-content: flex-start; align-items: center; gap: 12px;
    width: 100%; height: auto; min-height: 0;
    padding: 11px 12px; border-radius: 10px;
    font-size: 14.5px; font-weight: 600; color: var(--ink-soft);
    text-align: left; transition: background .14s, color .14s;
  }
  body:not(.staff-console) .tabbar button .ic { width: 21px; flex: none; font-size: 17px; text-align: center; }
  body:not(.staff-console) .tabbar button .label { flex: 1; text-align: left; }
  body:not(.staff-console) .tabbar button:hover { background: var(--brand-50); color: var(--brand-700); }
  body:not(.staff-console) .tabbar button.is-active {
    background: linear-gradient(135deg, var(--brand-700), var(--brand-600));
    color: #fff; box-shadow: 0 3px 12px rgba(31, 58, 138, .26);
  }
  body:not(.staff-console) .tabbar button.is-active .ic { opacity: 1; transform: none; }
  body:not(.staff-console) .tabbar button .dot { top: 8px; right: 10px; }
  body:not(.staff-console) .tabbar button.is-active .dot { border-color: transparent; }

  /* The persistent copyright footer spans the full viewport, but the fixed
     rail covers the left side, so its centred text looked shifted left of the
     content. Offset the footer's left by the rail width so the text sits in the
     middle of the content area beside the rail. Tracks the collapsed rail.
     `body` prefix raises specificity above the base .app-copyright padding
     shorthand defined later in this file. */
  body .app-copyright { padding-left: calc(4px + var(--sidebar-w)); transition: padding-left .22s cubic-bezier(.4, 0, .2, 1); }
  body.sidebar-collapsed .app-copyright { padding-left: calc(4px + var(--sidebar-w-collapsed)); }
  /* The rail is fixed (out of grid flow), so pin .main to the second column
     explicitly - otherwise it would auto-place into the empty first column and
     slide under the rail. Centre the content within that column with a max-width
     and auto side-margins so it sits in the middle of the space to the right of
     the rail rather than hugging it. No bottom-bar clearance needed up here -
     there is no bottom bar at this width. */
  .main { grid-column: 2; max-width: 900px; margin: 0 auto; padding: 26px 30px 60px; }
  /* No fixed bottom bar at this width - the rail is a side column, not fixed
     to the bottom - so toasts go back to sitting plainly in the corner. */
  .toast-stack { bottom: 16px; }

  /* -------- collapsed (icon-only) rail --------
     Ported from the staff portal. When the body carries .sidebar-collapsed the
     app-shell's first column narrows to the collapsed width, the rail shrinks to
     match, and the text labels are hidden, leaving centred icons. A hover
     tooltip (via data-label) names each icon. */
  body.sidebar-collapsed .app-shell { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }
  body.sidebar-collapsed .tabbar { width: var(--sidebar-w-collapsed); padding-left: 8px; padding-right: 8px; }
  body.sidebar-collapsed .tabbar .label { display: none; }
  body.sidebar-collapsed .tabbar button {
    position: relative;
    justify-content: center; padding: 11px 0; gap: 0;
  }
  body.sidebar-collapsed .tabbar button .ic { width: auto; font-size: 18px; }
  /* A tooltip on hover so an icon-only item still says what it is. */
  body.sidebar-collapsed .tabbar button:hover::after {
    content: attr(data-label);
    position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
    white-space: nowrap; z-index: 90;
    padding: 6px 10px; border-radius: 8px;
    background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600;
    box-shadow: var(--shadow-2);
  }
}

@media (min-width: 1100px) {
  /* Two columns once there is genuinely room for two readable ones. */
  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .cols > .card + .card { margin-top: 0; }
}

/* Touch devices: 44px is the accepted minimum target. */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 46px; }
  .btn-sm { min-height: 40px; }
  .row { padding-top: 15px; padding-bottom: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .topbar, .tabbar, .toast-stack, .modal-root, .btn { display: none !important; }
  .app-shell { grid-template-columns: 1fr; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* ==========================================================================
   Complaint tracking - the stages a reported problem moves through

   Used on both sides: the tenant sees where theirs is up to, the Owner tracks
   every one. Same words and same colours in both places, deliberately, so a
   conversation about "the late one" means the same thing to everybody.
   ========================================================================== */

.stage-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  border: 1px solid transparent;
}
.stage-pill::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; flex: none;
}
/* Nobody has looked at it yet. Grey, not red: it may be an hour old. */
.stage-waiting     { background: var(--line-soft); color: var(--ink-soft); border-color: var(--line); }
/* Seen, with a date still ahead. */
.stage-in_progress { background: var(--info-100); color: var(--info-700); border-color: var(--info-line); }
/* Seen, promised, and the date has gone. The only one that is red, because it is
   the only one where the property has broken its word. */
.stage-late        { background: var(--bad-100); color: var(--bad-700); border-color: var(--bad-line); }
.stage-resolved    { background: var(--ok-100); color: var(--ok-700); border-color: var(--ok-line); }
.stage-closed      { background: var(--line-soft); color: var(--muted); border-color: var(--line); }

/* The promised date, shown as a small block rather than a line of prose - it is
   the thing being looked for, so it should be findable without reading. */
.eta {
  /*
   * inline-flex with a cap, not a full-width block.
   *
   * As a block it stretched the whole row on a laptop - a 700px pale blue bar
   * announcing one date, which read as a banner rather than as a detail attached to
   * the row above it.
   */
  display: inline-flex; gap: 10px; align-items: center;
  max-width: 100%;
  margin-top: 10px; padding: 9px 13px 9px 11px;
  border-radius: var(--r); border: 1px solid var(--info-line);
  background: var(--info-100); color: var(--info-700);
}
.eta.is-late { background: var(--bad-100); border-color: var(--bad-line); color: var(--bad-700); }
.eta .ic { font-size: 16px; flex: none; }
.eta .k { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .85; }
.eta .v { font-size: 15px; font-weight: 700; }

/* Proof of the repair. Bounded height so a portrait photo from a phone does not
   push everything else off the screen. */
.fixed-shot {
  margin-top: 10px; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--ok-line); background: var(--ok-100);
}
.fixed-shot img { display: block; width: 100%; max-height: 260px; object-fit: cover; }

/* ==========================================================================
   Announcement posts - the tenant-facing cards on the Home screen

   Each announcement is its own little card with a soft gradient wash, an accent
   rail down the left, a megaphone mark and a small pinned chip in the corner. It
   is meant to feel like a post worth reading, not a table row.
   ========================================================================== */
.ann-post {
  position: relative; overflow: hidden;
  padding: 16px 16px 14px 18px;
  margin: 12px 12px 0;
  border-radius: 16px;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(59, 99, 232, .07), transparent 60%),
    linear-gradient(180deg, #ffffff, #fbfcff);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px -14px rgba(20, 34, 92, .5);
  transition: transform .14s ease, box-shadow .2s ease, border-color .2s ease;
}
.ann-post:first-child { margin-top: 14px; }
.ann-post:last-child { margin-bottom: 14px; }
.ann-post::before {
  /* the accent rail */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--brand-500), var(--a-mint, #2fd8a6));
}
.ann-post:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -16px rgba(20, 34, 92, .6);
  border-color: #d7def1;
}
.ann-post.is-pinned {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(214, 148, 40, .12), transparent 60%),
    linear-gradient(180deg, #fffdf7, #fffef9);
  border-color: #f0dcae;
}
.ann-post.is-pinned::before { background: linear-gradient(180deg, #f0b743, #d69428); }

/* Small pinned chip, top-right, not a full-width bar. */
.ann-pin {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
  color: #92610d; background: #fdeecb; border: 1px solid #f0d691;
}

.ann-post-head { display: flex; align-items: flex-start; gap: 10px; padding-right: 64px; }
.ann-ic {
  flex: none; width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center; font-size: 17px;
  background: var(--brand-50); color: var(--brand-700);
}
.ann-post.is-pinned .ann-ic { background: #fdeecb; }
.ann-title { font-size: 15.5px; font-weight: 750; color: var(--ink); line-height: 1.3; margin: 4px 0 0; }
.ann-text {
  margin: 9px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink-soft);
  white-space: pre-wrap;
}
/* ==========================================================================
   Maintenance countdown gate - a fixed, non-dismissable overlay shown to a
   signed-in tenant when the site is closed. It covers the whole viewport and
   swallows interaction (wired in JS) so wherever the tenant taps it stays put.
   ========================================================================== */
.mnt-gate {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center; padding: 18px;
  background: rgba(15, 23, 42, .62); backdrop-filter: blur(3px);
}
.mnt-gate-box {
  width: min(460px, 100%); background: var(--card, #fff);
  border-radius: 16px; padding: 20px; box-shadow: 0 24px 60px -20px rgba(15, 23, 42, .6);
}
.mnt-gate-box h3 { font-size: 18px; margin: 0 0 14px; color: var(--ink); }
.mnt-gate-box .msg + .msg { margin-top: 10px; }

/* ==========================================================================
   Maintenance marquee - a scrolling notice pinned to the very top of the public
   landing page while the site is closed for maintenance.
   ========================================================================== */
.mnt-marquee {
  position: fixed; top: 0; left: 0; right: 0; z-index: 210;
  height: var(--mnt-h, 38px);
  display: flex; align-items: center;
  overflow: hidden; white-space: nowrap;
  background: linear-gradient(100deg, #8a2b12, #c0392b);
  color: #fff;
  box-shadow: 0 3px 12px -4px rgba(0, 0, 0, .45);
}
/* When the marquee is present the landing header sits just below it and the page
   content is pushed down by both, so neither the marquee nor the header moves on
   scroll. The body carries the class only when the marquee was rendered. */
body.landing.has-mnt .nav { top: var(--mnt-h, 38px); }
body.landing.has-mnt { padding-top: calc(var(--mnt-h, 38px) + var(--nav-h, 62px)); }
.mnt-marquee-track {
  display: inline-flex; white-space: nowrap; will-change: transform;
  animation: mnt-scroll 30s linear infinite;
}
.mnt-marquee:hover .mnt-marquee-track { animation-play-state: paused; }
.mnt-item { padding-right: 64px; font-size: 13.5px; font-weight: 600; letter-spacing: .01em; }
@keyframes mnt-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .mnt-marquee-track { animation: none; white-space: normal; }
  .mnt-marquee { white-space: normal; }
}

/* ==========================================================================
   Announcement ticker - a one-line marquee at the top of Home that scrolls the
   latest announcement titles past, one after another.
   ========================================================================== */
.ann-ticker {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; padding: 10px 12px;
  border-radius: 12px; overflow: hidden;
  background: linear-gradient(100deg, var(--brand-700), var(--brand-500));
  color: #fff; box-shadow: 0 8px 20px -14px rgba(20, 34, 92, .8);
}
.ann-ticker-view { flex: 1; overflow: hidden; }
.ann-ticker-track {
  display: inline-flex; white-space: nowrap; will-change: transform;
  animation: ann-marquee 26s linear infinite;
}
.ann-ticker:hover .ann-ticker-track { animation-play-state: paused; }
.ann-ticker-item { padding-right: 42px; font-size: 13px; font-weight: 600; }
@keyframes ann-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }   /* the list is duplicated, so -50% loops seamlessly */
}
@media (prefers-reduced-motion: reduce) {
  .ann-ticker-track { animation: none; }
}

/* Event-date chip: "On 28 Sep 2026", so everyone knows which day it is about. */
.ann-event {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  color: var(--brand-700); background: var(--brand-50); border: 1px solid var(--brand-100);
}
.ann-post.is-pinned .ann-event { color: #92610d; background: #fdeecb; border-color: #f0d691; }

/* Media: a wide hero for the first photo, a small strip for the rest. */
.ann-media { margin-top: 12px; }
.ann-hero {
  display: block; border-radius: 13px; overflow: hidden;
  border: 1px solid var(--line); background: #eef1f8;
}
.ann-hero img { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.ann-hero:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.ann-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.ann-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line);
}
.ann-when { font-size: 12px; font-weight: 600; color: var(--muted); }
.ann-when::before { content: "\1F4C5\00a0"; opacity: .8; }

/* Announcement photo thumbnails: a small wrapping row, each opening full size. */
.ann-shots { display: flex; flex-wrap: wrap; gap: 8px; }
.ann-shot {
  display: block; width: 84px; height: 84px; flex: none;
  border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--line); background: #f2f4fa;
}
.ann-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ann-shot:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

/* Editable photo thumbnail in the announcement form, with a remove button. */
.ann-edit-shot {
  position: relative; display: inline-block; width: 84px; height: 84px;
  border-radius: var(--r); overflow: hidden; border: 1px solid var(--line);
}
.ann-edit-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ann-rm {
  position: absolute; top: 3px; right: 3px;
  width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(20, 24, 40, .72); color: #fff; font-size: 15px; line-height: 1;
  display: grid; place-items: center;
}
.ann-rm:hover { background: rgba(200, 40, 60, .9); }

/* A styled file picker - a dashed drop zone with an icon and helper text, so the
   raw browser "Choose file" button is never shown. The native input is hidden but
   still does the work (the whole label is its target). */
.file-drop {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 13px 14px; border: 1.5px dashed var(--line); border-radius: 12px;
  background: #fbfcff; transition: border-color .15s, background .15s;
}
.file-drop:hover { border-color: var(--brand-500); background: var(--brand-50); }
.file-drop-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-drop-ic {
  flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  font-size: 18px; background: var(--brand-50); color: var(--brand-700);
}
.file-drop-txt { display: flex; flex-direction: column; min-width: 0; }
.file-drop-txt b { font-size: 14px; color: var(--brand-700); }
.file-drop-txt span { font-size: 11.5px; color: var(--muted); }
.fixed-shot .cap {
  padding: 8px 11px; font-size: 12.5px; font-weight: 600; color: var(--ok-700);
  display: flex; align-items: center; gap: 7px;
}

/* ==========================================================================
   The problems table - the Owner's tracking view

   A table, because this one is genuinely tabular and is read on a laptop. It
   becomes a card list below 760px rather than growing a horizontal scroll bar,
   which is the usual way a table ruins a phone.
   ========================================================================== */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th, table.grid td {
  padding: 11px 13px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}
table.grid th {
  font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); background: #fbfcff; white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover { background: #fafbff; }
table.grid td b { color: var(--ink); font-weight: 600; }
table.grid .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/*
 * The figure does not wrap. The notes under it do.
 *
 * nowrap on the whole cell meant a sub-line like "fixed 22 Sept 2026 by Ramesh Babu"
 * held the column open at 248px on its own - a quarter of the table for one sentence -
 * and pushed the last column off the screen. The number itself is what needs to stay
 * on one line; the prose beneath it never did.
 */
table.grid .num > div { white-space: normal; }
/* A red left edge on a row whose promise has passed. Visible while scanning a
   column of dates, which a pill in the last cell is not. */
table.grid tr.is-late td:first-child { box-shadow: inset 3px 0 0 var(--bad-700); }

/*
 * Cards below 1000px, tables at or above it.
 *
 * The six columns need about 930px of content once their minimums and cell padding
 * are added up. The line was at 900px, which is less than that - so at exactly 900
 * the table rendered and then overflowed, putting Cost off the right-hand edge behind
 * a scroll bar nobody knew to look for. 1000px means an iPad in landscape gets the
 * table and everything narrower gets a card per row, which reads better anyway than
 * a table you cannot see the end of.
 */
@media (max-width: 999px) {
  /* Each row becomes its own card, with the column name as a label. */
  table.grid thead { display: none; }
  table.grid, table.grid tbody, table.grid tr, table.grid td { display: block; width: 100%; }
  table.grid tr {
    border: 1px solid var(--line); border-radius: var(--r);
    margin-bottom: 10px; padding: 4px 0; background: var(--card);
  }
  table.grid tr.is-late { border-left: 3px solid var(--bad-700); }
  table.grid tr.is-late td:first-child { box-shadow: none; }
  table.grid td { border: 0; padding: 7px 13px; display: flex; gap: 12px; }
  table.grid td::before {
    content: attr(data-label);
    flex: 0 0 38%; font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: var(--muted);
  }
  /*
   * A flex item will not shrink below its content by default, so a long problem
   * title or a nested .small div pushed past the right edge of a 320px screen -
   * the cell wrapped, the child inside it did not. min-width:0 is what lets it.
   */
  table.grid td > * { min-width: 0; overflow-wrap: anywhere; }
  table.grid td { min-width: 0; }
  table.grid td.num { text-align: left; }
  /*
   * A button in a cell takes the width it is given.
   *
   * .btn is nowrap with generous padding, so "Record what you did" sat wider than the
   * 62% of a 360px screen left over after the label - and pushed past the right edge.
   * Letting it wrap and fill the cell is the fix; shrinking the type is not.
   */
  table.grid td .btn { width: 100%; white-space: normal; }
}

@media (min-width: 1000px) {
  table.grid th:nth-child(1), table.grid td:nth-child(1) { min-width: 200px; }
  table.grid th:nth-child(2), table.grid td:nth-child(2) { min-width: 116px; white-space: nowrap; }
}

/* ==========================================================================
   THE PROFILE SHEET

   Rises from the bottom bar, where the button that opened it is.
   ========================================================================== */

.sheet-root { position: fixed; inset: 0; z-index: 110; display: grid; place-items: end center; }
.sheet-root[hidden] { display: none; }
.sheet-veil { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); }

.sheet {
  position: relative; width: 100%; max-width: 520px;
  /* vh fallback before dvh - see the .modal note above. Older Android browsers
     that ignore dvh would otherwise never scroll this sheet on a short screen. */
  max-height: 92vh;
  max-height: 92dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--card);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-3);
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  animation: sheet .22s cubic-bezier(.2, .8, .2, 1);
}
/* The grab handle. Does nothing, and it does not pretend to be draggable - it is
   the conventional signal that this panel came from the bottom edge. */
.sheet-grip {
  width: 38px; height: 4px; border-radius: 999px; background: var(--line);
  margin: 9px auto 4px;
}

.sheet-head {
  display: flex; gap: 13px; align-items: center;
  padding: 12px 16px 16px; border-bottom: 1px solid var(--line-soft);
}
.sheet-head b { display: block; font-size: 16.5px; color: var(--ink); }
.sheet-head span { display: block; font-size: 13px; color: var(--muted); }
.sheet-head .faint { font-size: 12.5px; overflow-wrap: anywhere; }

/* Rent and room at a glance, so the commonest reason for opening this needs no
   further tap. */
.sheet-facts {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.sheet-facts > div { background: var(--card); padding: 12px 10px; text-align: center; }
.sheet-facts .k {
  font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
}
.sheet-facts .v { font-size: 15px; font-weight: 700; color: var(--ink); margin-top: 3px; }

.sheet-items { padding: 8px 0; }
.sheet-item {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 12px 16px; border: 0; background: none; cursor: pointer;
  text-align: left; text-decoration: none; color: inherit; font: inherit;
}
.sheet-item:hover { background: #fafbff; }
.sheet-item:focus-visible { outline: 2px solid var(--brand-500); outline-offset: -2px; }
.sheet-item b { display: block; font-size: 14.5px; color: var(--ink); font-weight: 600; }
.sheet-item span span, .sheet-item .grow span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.sheet-item .chev { flex: none; font-size: 20px; color: var(--faint); line-height: 1; }
.sheet-item.is-bad b { color: var(--bad-700); }

/* A tinted tile per item. Colour here is doing real work: it makes a list of six
   similar rows scannable by shape rather than by reading each label. */
.sheet-item .si {
  flex: none; width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; font-size: 17px;
  background: var(--line-soft); color: var(--ink-soft);
}
.si.i-room    { background: var(--brand-50);  color: var(--brand-700); }
.si.i-contact { background: var(--info-100);  color: var(--info-700); }
.si.i-photo   { background: #ede9fe;          color: #6d28d9; }
.si.i-device  { background: var(--ok-100);    color: var(--ok-700); }
.si.i-move    { background: var(--warn-100);  color: var(--warn-700); }
.si.i-star    { background: #fff4d6;          color: #8a5300; }
.si.i-out     { background: var(--bad-100);   color: var(--bad-700); }

.sheet-foot {
  margin: 0; padding: 4px 18px 8px;
  font-size: 12px; color: var(--faint); line-height: 1.5;
}

@media (min-width: 560px) {
  .sheet-root { place-items: center; padding: 20px; }
  .sheet { border-radius: var(--r-lg); animation: rise .2s cubic-bezier(.2, .8, .2, 1); }
  .sheet-grip { display: none; }
}

/* ==========================================================================
   Screen furniture added by the redesign
   ========================================================================== */

/*
 * A coloured header strip on a card.
 *
 * The portal was six white cards on a grey background, which is legible and
 * completely flat - nothing tells you which card matters. A tinted head costs one
 * class and makes a screen scannable at arm's length.
 */
.card-head.tinted { border-bottom-color: transparent; }
.card-head.tinted h3 { color: var(--tint-ink, var(--ink)); }
.card-head.tinted p { color: var(--tint-ink, var(--muted)); opacity: .82; }
.card.t-brand .card-head.tinted { background: var(--brand-50); --tint-ink: var(--brand-700); }
.card.t-ok    .card-head.tinted { background: var(--ok-100);   --tint-ink: var(--ok-700); }
.card.t-warn  .card-head.tinted { background: var(--warn-100); --tint-ink: var(--warn-700); }
.card.t-bad   .card-head.tinted { background: var(--bad-100);  --tint-ink: var(--bad-700); }
.card.t-info  .card-head.tinted { background: var(--info-100); --tint-ink: var(--info-700); }

/* Quick actions under the hero - the two or three things somebody opens the app
   to do, rather than making them find the tab first. */
.quick { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
@media (min-width: 560px) { .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* On the laptop/desktop website (>=1000px) the sidebar is always visible and
   already lists Pay rent / Receipts / Report / News, so these quick buttons just
   duplicate it. Hide them there; keep them on phone, tablet and the installed app
   where the sidebar is a hidden drawer. */
@media (min-width: 1000px) { .quick { display: none; } }
.quick button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  padding: 15px 8px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft); line-height: 1.3;
  text-align: center;
  transition: transform .08s, border-color .15s;
}
.quick button:active { transform: translateY(1px); }
.quick button:hover { border-color: #cdd6ea; }
.quick button:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.quick .qi {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  font-size: 18px; background: var(--brand-50); color: var(--brand-700);
}
.quick .q-food .qi { background: var(--ok-100);   color: var(--ok-700); }
.quick .q-fix  .qi { background: var(--warn-100); color: var(--warn-700); }
.quick .q-rec  .qi { background: var(--info-100); color: var(--info-700); }
.quick .q-note .qi { background: #ede9fe;         color: #6d28d9; }

/* Progress through the year, on the home screen. A count of paid months is a
   fact; a bar is an impression, and the impression is what makes it stick. */
.meter { margin-top: 12px; }
.meter .bar {
  height: 9px; border-radius: 999px; background: var(--line-soft);
  overflow: hidden; display: flex;
}
.meter .bar i { display: block; height: 100%; }
.meter .bar .paid { background: linear-gradient(90deg, #16a34a, #0f6b4a); }
.meter .bar .wait { background: linear-gradient(90deg, #d69428, #8a5300); }
.meter .bar .owed { background: linear-gradient(90deg, #d14257, #a52034); }
.meter .key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 9px; font-size: 12px; color: var(--muted); }
.meter .key span { display: inline-flex; align-items: center; gap: 6px; }
.meter .key i { width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* Laptop/desktop: the 9px bar running the full ~900px card read as a heavy green
   stripe. Make it a short, thin bar with the "1 paid" key sitting beside it on
   one line. Must stay AFTER the base .meter rules above (same specificity, so
   the later rule wins). Phones (<760px) keep the full-width 9px bar. */
@media (min-width: 760px) {
  .meter { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
  .meter .bar { flex: 0 1 280px; height: 5px; }
  .meter .key { margin-top: 0; }
  .meter .key i { width: 7px; height: 7px; }
}

/* A filter row. Chips rather than a select, because there are only ever three or
   four and a chip shows the current state without being opened. */
.chips {
  display: flex; gap: 7px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 2px 0 4px; margin-bottom: 12px; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 13px; border-radius: 999px; cursor: pointer;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  background: var(--card); color: var(--ink-soft);
  border: 1.5px solid var(--line);
}
.chip:hover { border-color: #cdd6ea; }
.chip.is-on { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.chip:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.chip .n { opacity: .75; font-weight: 700; margin-left: 4px; }

/* A search field with a magnifier that is decoration, not a button. */
.search { position: relative; margin-bottom: 12px; }
.search input { padding-left: 38px; }
.search .mag {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-size: 15px; color: var(--faint); pointer-events: none;
}

/* The Google review card. Warm, and deliberately unlike everything else on the
   screen: it is the one thing here that asks the tenant for something. */
.review-card {
  border: 1px solid #f2dfae; border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(135deg, #fffaf0, #fff4d9);
  box-shadow: var(--shadow-1);
}
.review-card .inner { padding: 18px 16px; display: flex; gap: 14px; align-items: flex-start; }
.review-card .stars { flex: none; font-size: 21px; line-height: 1; letter-spacing: 1px; }
.review-card h3 { font-size: 15.5px; color: #6b4708; margin-bottom: 5px; }
.review-card p { font-size: 13.5px; color: #84601a; margin: 0 0 13px; line-height: 1.55; }
.review-card .btn {
  background: #8a5300; color: #fff; border: 0;
  min-height: 42px; font-size: 14px;
}
.review-card .btn:hover { background: #6b4708; }

/*
 * Column widths for the problems table.
 *
 * Without them the browser gives every column an equal share, which wraps
 * "Ravi Shankar" onto two lines while the Problem column has room to spare. These
 * are minimums rather than fixed widths, so the Problem column still takes up the
 * slack on a wide screen. Only applied at table widths - below 760px the same
 * markup is a card list and none of this is in play.
 */
@media (min-width: 1000px) {
  /* Stage, Acknowledged, Repair date, Cost. Minimums only - the Problem column
     takes the slack on a wide screen. */
  table.grid th:nth-child(3), table.grid td:nth-child(3) { min-width: 116px; }
  table.grid th:nth-child(4), table.grid td:nth-child(4) { min-width: 126px; }
  table.grid th:nth-child(5), table.grid td:nth-child(5) { min-width: 100px; }
  table.grid th:nth-child(6), table.grid td:nth-child(6) { min-width: 84px; }
}

/*
 * Escalated: the acknowledgement deadline went by with nobody replying.
 *
 * Deeper than the "past its date" red, and it needs to be. A slipped repair date is a
 * delay; this is a tenant who was not answered at all, and it is the one state on the
 * screen that implicates the property rather than the plumbing.
 */
.stage-escalated {
  background: #7a1226; color: #fff; border-color: #7a1226;
}
.stage-escalated::before { background: #ffd0d8; }

/* Six tiles rather than four, once the deadline and the spend are in there. */
@media (min-width: 700px) {
  .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .cols > .card + .card { margin-top: 0; }
}
@media (min-width: 1100px) {
  .cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ==========================================================================
   The staff console reads wider than the tenant portal

   The tenant portal is capped at 760px because it is read a card at a time on a
   phone. The console has a six column table in it whose own minimums come to about
   900px, so that cap made it overflow at every laptop width below 1280 - the Cost
   column sat off the right-hand edge behind a scroll bar nobody knew to look for.
   ========================================================================== */

@media (min-width: 820px) {
  body.staff-console .main { max-width: 1180px; }
}

/* ==========================================================================
   LANDING PAGE — v3 "modern showcase"
   Aurora hero, glass header, scroll-reveal, stats, visual feature rows,
   testimonial, FAQ, bold closing, compact footer. 320px → wide desktop.
   ========================================================================== */

/*
 * Colorful, not black.
 *
 * The page used to sit on near-black (#05010f). It now runs on a deep but
 * genuinely colourful gradient - indigo into violet into a teal-tinged base -
 * fixed behind the content so every section shares one continuous wash rather
 * than a set of flat dark panels. Individual sections are mostly transparent so
 * this shows through; a few use a translucent tint for separation. White text
 * still clears WCAG AA on every stop of this gradient.
 */
body.landing {
  color: #eaf0ff;
  /* The header is fixed, so the page starts below it. --nav-h is the header's
     height; the maintenance-marquee rule adds --mnt-h on top when present. */
  --nav-h: 62px;
  padding-top: var(--nav-h);
  /*
   * A deep, colourful base that covers the whole document, not just the first
   * screen. It is painted here AND repeated on the sections below (each section
   * carries its own translucent tint) so there is never a white band showing
   * through - the earlier version used background-attachment: fixed, which the
   * browser clips to the viewport, leaving the lower sections on the pale app
   * background. This scrolls with the page and reaches the full height.
   */
  background: #140f38;
  background-image:
    radial-gradient(90% 55% at 12% 0%, rgba(78, 56, 190, .85) 0%, transparent 60%),
    radial-gradient(80% 50% at 95% 8%, rgba(20, 130, 160, .7) 0%, transparent 55%),
    radial-gradient(90% 60% at 85% 100%, rgba(140, 45, 165, .7) 0%, transparent 55%),
    linear-gradient(180deg, #191046 0%, #140d38 45%, #0f1046 100%);
}
/* Sticky footer: body is a flex column so #main fills the viewport and the
   footer is pushed to the very bottom. On a tall page the footer sits right
   after the content (no gap); on a short page it rests at the viewport bottom.
   This is NOT position:fixed - while scrolling the content you do not see the
   footer; you reach it at the end of the page. */
body.landing { display: flex; flex-direction: column; }
body.landing #main { display: block; background: transparent; flex: 1 0 auto; }
/* Slim, minimal, never grows: a single thin bar at the end of the page. */
body.landing .ft {
  flex: none;
  background: rgba(6, 5, 24, .5);
  border-top: 1px solid rgba(255,255,255,.07);
}
body.landing .ft .ft-legal {
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
}
/* Decorative bleeding layers (auroras, floating phone) must never widen the
   document. Clip on the body only.

   Deliberately NOT on the root <html>: setting overflow-x on the document
   element forces the browser to compute overflow-y to a scroll container on
   <html> too, which - together with overscroll-behavior on the body and the
   sticky header - left the page feeling frozen on touch devices (it scrolled in
   a headless desktop but not under a finger). The body is a normal block box, so
   clipping its x-overflow trims the decorative bleed without touching the
   document's own vertical scroll. Each section also clips its own overflow, so
   this is the backstop, not the only guard. */
body.landing {
  overflow-x: hidden;
  /* The app shell sets overscroll-behavior-y:none to kill iOS rubber-banding,
     but on this tall marketing page that made momentum scrolling feel like it
     stopped dead. The landing page is a normal document scroll, so let it behave
     like one. */
  overscroll-behavior-y: auto;
  /* No height clamp: the document is as tall as its content and scrolls with the
     page. Guards against any inherited min-height/height turning body into a
     fixed-size box. */
  height: auto;
  min-height: 100%;
}

/* Scroll-reveal: rise + fade once, gently. Honoured only where motion is fine;
   the script adds .in immediately under prefers-reduced-motion. */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ------------------------------- glass header ---------------------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; gap: 14px;
  padding: 12px clamp(14px, 4vw, 40px);
  background: rgba(8, 6, 24, .55);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  transition: background .3s, border-color .3s, box-shadow .3s;
}
.nav.scrolled { background: rgba(8, 6, 24, .82); border-bottom-color: rgba(255,255,255,.10); box-shadow: 0 10px 40px -18px rgba(0,0,0,.8); }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.nav-mark {
  width: 34px; height: 34px; flex: none; border-radius: 10px;
  background: linear-gradient(140deg, #3b63e8, #14225c);
  display: grid; place-items: center; box-shadow: 0 6px 18px -6px rgba(59,99,232,.7);
}
.nav-mark svg { width: 21px; height: 21px; display: block; }
.nav-who { min-width: 0; line-height: 1.15; }
.nav-who b { display: block; font-size: 15px; color: #fff; font-weight: 700; letter-spacing: -.2px; }
.nav-who b em { font-style: normal; color: #2fd8a6; }
.nav-who span { display: block; font-size: 11px; color: #97a3cf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Two sub-labels under the wordmark. Default (phone / installed app): the PG
   name. On a laptop/desktop browser (>=768px) we swap to "Tenant Login". The
   installed app is forced back to the PG name below so it stays unchanged. */
.nav-who .who-login { display: none; text-transform: uppercase; letter-spacing: .08em; }
.nav-who .who-pg { display: block; }
@media (min-width: 768px) {
  .nav-who .who-login { display: block; }
  .nav-who .who-pg { display: none; }
}
@media (display-mode: standalone) {
  .nav-who .who-login { display: none; }
  .nav-who .who-pg { display: block; }
}
/* in-app mirror of the display-mode: standalone block above */
:where(html[data-in-app]) .nav-who .who-login {
  display: none;
}
:where(html[data-in-app]) .nav-who .who-pg {
  display: block;
}

.nav-links { margin-left: 20px; display: flex; gap: 2px; flex: 1 1 auto; }
.nav-links a {
  font-size: 13.5px; font-weight: 600; color: #b9c3e6; text-decoration: none;
  padding: 8px 12px; border-radius: 9px; white-space: nowrap; transition: background .2s, color .2s;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-cta { margin-left: auto; display: flex; gap: 8px; flex: none; }

/* Glass secondary button on the dark header. */
.btn-glass { background: rgba(255,255,255,.10); color: #eaf0ff; border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(6px); }
.btn-glass:hover:not(:disabled) { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.4); }

/*
 * Phone: the in-page links used to be display:none below 780px, which is the
 * bug that hid "Features / How it works / FAQ" entirely on a phone. Instead the
 * header wraps to two rows - brand + logins on the first, the section links on
 * a centred second row - so every link stays reachable on the smallest screen.
 */
@media (max-width: 780px) {
  .nav { flex-wrap: wrap; row-gap: 8px; align-items: center; }
  .nav-links {
    order: 3; width: 100%; margin-left: 0;
    justify-content: center; flex-wrap: wrap; gap: 4px;
    padding-top: 8px; border-top: 1px solid rgba(255,255,255,.10);
  }
  .nav-cta { margin-left: auto; }
  /* The header wraps to two rows on a phone (brand on top, the login buttons
     below), so the sign-in/contact frame needs more top clearance than the
     single-row laptop header to keep the card from tucking under it. */
  .signin-page { padding-top: calc(112px + env(safe-area-inset-top)); }
}
/*
 * Phones only: keep the two login buttons on the RIGHT of the header, beside the
 * brand, rather than dropping them onto their own row. They are made compact so
 * both fit on the top row on a narrow screen; the section links wrap to the row
 * below (handled by the 780px rule above).
 *
 * Capped at 640px so iPad portrait (768px), iPad landscape (1024px) and laptops
 * are untouched - only phones get this tightening.
 */
@media (max-width: 640px) {
  /* Keep everything on ONE top row: the brand on the left, the two login buttons
     on the right. The brand is allowed to shrink (and its subtitle truncates) so
     the buttons never get pushed onto a second line. Only the section links wrap
     to the row below. */
  .nav { flex-wrap: wrap; }
  .nav-brand { flex: 0 1 auto; min-width: 0; }
  .nav-who { min-width: 0; overflow: hidden; }
  .nav-who b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-cta {
    margin-left: auto; gap: 7px; flex: none;
    flex-wrap: nowrap;                 /* the two buttons stay side by side */
    order: 0;                          /* stay on the top row with the brand */
  }
  .nav-cta .btn {
    flex: none;
    padding: 8px 11px;
    font-size: 12.5px;
    min-height: 36px;
    white-space: nowrap;
  }
}
/* Narrowest phones: drop the "Sri Sai PG" subtitle so the brand is just the
   wordmark, leaving room for both buttons on the top row. */
@media (max-width: 400px) {
  .nav-who span { display: none; }
  .nav-cta .btn { padding: 7px 10px; font-size: 12px; }
}

/* --------------------------------- hero ---------------------------------- */
.hx {
  position: relative; overflow: hidden;
  display: grid; gap: clamp(28px, 6vw, 56px); align-items: center;
  padding: clamp(54px, 12vw, 128px) clamp(18px, 6vw, 72px) clamp(56px, 12vw, 128px);
  background: transparent;
}
@media (min-width: 960px) { .hx { grid-template-columns: 1.1fr .9fr; } }

/* Animated aurora: two big blurred blobs drifting behind the content. */
.hx-aurora {
  position: absolute; inset: -30% 0 auto 0; height: 150%; z-index: 0; filter: blur(70px); opacity: .8;
  background:
    radial-gradient(46% 46% at 78% 20%, rgba(47,216,166,.55), transparent 70%),
    radial-gradient(50% 50% at 12% 60%, rgba(59,99,232,.6), transparent 70%),
    radial-gradient(40% 40% at 60% 80%, rgba(147,51,234,.45), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translateY(0) scale(1); }
  100% { transform: translateY(3%) scale(1.06); }
}
/* Faint grid overlay for depth, fading toward the bottom. */
.hx-grid {
  position: absolute; inset: 0; z-index: 0; opacity: .35;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
          mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}
@media (prefers-reduced-motion: reduce) { .hx-aurora { animation: none; } }

.hx-inner { position: relative; z-index: 1; max-width: 620px; }
.hx-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: #cdd6f5;
  padding: 6px 13px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  margin-bottom: 20px;
}
.hx-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #2fd8a6; box-shadow: 0 0 0 4px rgba(47,216,166,.22); }
.hx-title {
  color: #fff; font-weight: 800; letter-spacing: -.03em;
  font-size: clamp(34px, 8.6vw, 66px); line-height: 1.04; margin-bottom: 20px;
}
.hx-title .grad {
  background: linear-gradient(96deg, #2fd8a6, #7cf3d0 40%, #63a4ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hx-sub { font-size: clamp(16px, 4.4vw, 20px); line-height: 1.55; color: #b7c1e6; max-width: 52ch; margin-bottom: 18px; }
.hx-note { font-size: 14px; color: #8f9cc6; max-width: 46ch; }
.hx-note b { color: #dfe6ff; }
.hx-trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 26px; font-size: 13px; color: #9fabd4; }
.hx-trust span { display: inline-flex; align-items: center; gap: 6px; }

/* Floating phone */
.hx-device { position: relative; z-index: 1; display: grid; place-items: center; }
/*
 * A modern iPhone (Pro-style): a titanium-like rounded frame with slim, even
 * bezels and a Dynamic Island pill floating at the top rather than the old wide
 * notch. Only the appearance changed - the cards inside are the same.
 */
.phone {
  position: relative; width: clamp(214px, 60vw, 304px); aspect-ratio: 9 / 19.5;
  border-radius: 52px; padding: 10px;
  background: linear-gradient(155deg, #2a3566 0%, #141c44 45%, #0a0f2e 100%);
  /* The thin bright rim reads as the polished metal edge. */
  border: 1px solid rgba(255,255,255,.22);
  box-shadow:
    0 60px 120px -40px rgba(0,0,0,.85),
    inset 0 0 0 2px rgba(255,255,255,.06),
    inset 0 0 0 7px #05060f,
    0 0 60px -10px rgba(59,99,232,.4);
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@media (prefers-reduced-motion: reduce) { .phone { animation: none; } }
/* Dynamic Island: a free-floating black pill near the top, not a cut-out. */
.phone-notch {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 34%; height: 22px; background: #000; border-radius: 999px;
  z-index: 2; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}
.phone-scr {
  height: 100%; border-radius: 44px; padding: 46px 13px 16px;
  background: linear-gradient(180deg, #15205a, #0c1440);
  display: flex; flex-direction: column; gap: 9px;
}
.g-card { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.10); border-radius: 13px; padding: 11px 12px; display: flex; flex-direction: column; gap: 5px; }
.g-due { background: rgba(47,216,166,.14); border-color: rgba(47,216,166,.34); }
.g-k { font-size: 11.5px; color: #a7b6e4; }
.g-v { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.g-chip { align-self: flex-start; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.14); color: #dbe4ff; }
.g-chip.warn { background: #fdf0d5; color: #8a5300; }
.g-chip.ok { background: #d9f5e7; color: #0f6b4a; }
.g-chip.info { background: #ddf1fb; color: #0b5f8a; }

/* -------------------------------- stats ---------------------------------- */
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: rgba(255,255,255,.08);
  border-top: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid rgba(255,255,255,.08);
}
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: rgba(10, 8, 34, .35); padding: clamp(24px, 5vw, 40px) 16px; text-align: center; }
.stat b { display: block; font-size: clamp(28px, 6vw, 44px); font-weight: 800; letter-spacing: -.03em;
  background: linear-gradient(96deg, #2fd8a6, #63a4ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { display: block; margin-top: 6px; font-size: 13px; color: #97a3cf; }

/* ------------------------------- features -------------------------------- */
.fx { background: rgba(10, 8, 34, .22); padding: clamp(50px, 10vw, 100px) clamp(18px, 6vw, 40px); }
.fx-head { max-width: 900px; margin: 0 auto clamp(30px, 6vw, 56px); text-align: center; }
.kicker { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #2fd8a6; margin-bottom: 12px; }
.fx-head h2 { color: #fff; font-size: clamp(26px, 6vw, 46px); letter-spacing: -.03em; line-height: 1.08; }

.fx-row {
  max-width: 1060px; margin: 0 auto; display: grid; gap: clamp(22px, 5vw, 52px); align-items: center;
  padding: clamp(30px, 6vw, 56px) 0;
}
.fx-row + .fx-row { border-top: 1px solid rgba(255,255,255,.07); }
@media (min-width: 860px) {
  .fx-row { grid-template-columns: 1fr 1fr; }
  .fx-row.flip .fx-text { order: 2; }
}
.fx-text .tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 5px 13px; border-radius: 999px; background: var(--cb); color: var(--c); margin-bottom: 16px; }
.fx-text h3 { color: #fff; font-size: clamp(22px, 5vw, 34px); letter-spacing: -.03em; line-height: 1.12; margin-bottom: 12px; }
.fx-text p { font-size: clamp(15px, 4vw, 17.5px); line-height: 1.62; color: #a7b2d8; margin: 0; max-width: 46ch; }

.fx-art {
  position: relative; min-height: clamp(200px, 42vw, 320px); border-radius: 24px; overflow: hidden;
  display: grid; place-items: center; gap: 12px;
  background: linear-gradient(150deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
/* Rent: layered mini cards */
.mini-card { width: min(78%, 300px); background: rgba(255,255,255,.9); color: #0f172a; border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 7px; box-shadow: 0 24px 50px -20px rgba(0,0,0,.6); }
.mini-card.faded { width: min(68%, 260px); opacity: .55; transform: translateY(-8px) scale(.96); }
.mc-k { font-size: 12.5px; color: #64748b; }
.mc-v { font-size: 30px; font-weight: 800; color: #1f3a8a; letter-spacing: -.03em; }
.mc-chip { align-self: flex-start; font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.mc-chip.ok { background: #d9f5e7; color: #0f6b4a; }
/* Pay: glowing phone glyph in a ring */
.a-pay .pay-glyph { font-size: clamp(60px, 15vw, 104px); z-index: 1; }
.a-pay .pay-ring { position: absolute; width: 56%; aspect-ratio: 1; border-radius: 50%; border: 2px dashed rgba(47,216,166,.5); animation: spin 22s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .a-pay .pay-ring { animation: none; } }
/* Receipt */
.receipt { position: relative; width: min(60%, 220px); background: #fff; color: #0f172a; border-radius: 8px; padding: 18px 16px; display: flex; flex-direction: column; gap: 9px; box-shadow: 0 24px 50px -20px rgba(0,0,0,.6); }
.receipt .r-top { font-size: 12px; font-weight: 800; letter-spacing: .2em; color: #334155; }
.receipt .r-line { height: 8px; border-radius: 4px; background: #e2e8f0; }
.receipt .r-line.short { width: 55%; }
.receipt .r-stamp { position: absolute; right: 12px; bottom: 12px; transform: rotate(-12deg); font-size: 13px; font-weight: 800; color: #0f6b4a; border: 2px solid #0f6b4a; border-radius: 6px; padding: 2px 8px; }
/* Fix: a little progress track */
.a-fix { flex-direction: column; }
.track { display: flex; gap: 8px; z-index: 1; flex-wrap: wrap; justify-content: center; }
.t-step { font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,.1); color: #b7c1e6; }
.t-step.done { background: rgba(47,216,166,.2); color: #7cf3d0; }
.t-step.now { background: #2fd8a6; color: #06281f; }
.fix-glyph { font-size: clamp(48px, 12vw, 84px); }
.notice-glyph { font-size: clamp(64px, 16vw, 116px); }

/* ------------------------------- how ------------------------------------- */
.how { background: rgba(10, 8, 34, .34); border-top: 1px solid rgba(255,255,255,.07); padding: clamp(50px, 10vw, 100px) clamp(18px, 6vw, 40px); }
.how-steps { max-width: 1000px; margin: 0 auto; padding: 0; list-style: none; display: grid; gap: 16px; }
@media (min-width: 800px) { .how-steps { grid-template-columns: repeat(3, 1fr); } }
.how-steps li { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.09); border-radius: 20px; padding: 28px 24px; transition: transform .3s, border-color .3s; }
.how-steps li:hover { transform: translateY(-4px); border-color: rgba(47,216,166,.35); }
.how-steps .n { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; font-size: 17px; font-weight: 800; color: #06281f; margin-bottom: 16px; background: linear-gradient(145deg, #2fd8a6, #63a4ff); }
.how-steps b { display: block; color: #fff; font-size: 17px; margin-bottom: 8px; }
.how-steps p { color: #a7b2d8; font-size: 14.5px; line-height: 1.6; margin: 0; }

/* ---------------------------- testimonial -------------------------------- */
.quote { max-width: 900px; margin: 0 auto; text-align: center; padding: clamp(56px, 12vw, 110px) clamp(20px, 6vw, 40px); }
.quote blockquote { margin: 0; font-size: clamp(22px, 5.4vw, 36px); line-height: 1.3; letter-spacing: -.02em; color: #fff; font-weight: 600; }
.quote cite { display: block; margin-top: 22px; font-style: normal; font-size: 14px; color: #8f9cc6; }

/* -------------------------------- faq ------------------------------------ */
.faq { background: rgba(10, 8, 34, .34); border-top: 1px solid rgba(255,255,255,.07); padding: clamp(50px, 10vw, 100px) clamp(18px, 6vw, 40px); }
.faq-list { max-width: 780px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.09); border-radius: 16px; padding: 4px 20px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-size: 16px; font-weight: 600; color: #eaf0ff; display: flex; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; color: #2fd8a6; line-height: 1; transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: #a7b2d8; font-size: 14.5px; line-height: 1.62; }
.faq details p b { color: #dfe6ff; }

/* ------------------------------ closing cta ------------------------------ */
.cta { position: relative; overflow: hidden; text-align: center; padding: clamp(64px, 14vw, 130px) clamp(20px, 6vw, 40px); }
.cta-aurora { position: absolute; inset: -40% 0 auto 0; height: 180%; z-index: 0; filter: blur(80px); opacity: .8;
  background: radial-gradient(40% 50% at 50% 20%, rgba(47,216,166,.5), transparent 70%), radial-gradient(46% 50% at 20% 80%, rgba(59,99,232,.55), transparent 70%); }
.cta-inner { position: relative; z-index: 1; max-width: 620px; margin: 0 auto; }
.cta h2 { color: #fff; font-size: clamp(30px, 8vw, 56px); letter-spacing: -.03em; margin-bottom: 16px; }
.cta p { color: #c3cdea; font-size: clamp(15px, 4vw, 18px); line-height: 1.6; margin: 0 auto; max-width: 46ch; }
.cta p b { color: #2fd8a6; }
.cta-actions { margin-top: 30px; display: flex; justify-content: center; }
/* A full line of space between the Contact button and this reassurance line. */
.cta-fine { margin-top: 40px; font-size: 13.5px; color: #9aa6ce; }
/* A larger primary button for the hero/closing calls to action. */
.btn-lg { min-height: 54px; padding: 15px 30px; font-size: 16.5px; border-radius: 14px; }

/* -------------------------------- footer --------------------------------- */
/* Compact: one row on desktop; wordmark left, links right; a thin legal line. */
.ft { background: rgba(6, 5, 24, .5); border-top: 1px solid rgba(255,255,255,.07); }
.ft-inner {
  max-width: 1100px; margin: 0 auto;
  padding: clamp(24px, 5vw, 34px) clamp(18px, 6vw, 40px);
  display: flex; flex-wrap: wrap; gap: 18px 24px; align-items: center; justify-content: space-between;
}
/* Centred footer variant: the brand block sits in the middle rather than pushed
   to the left with links on the right. Used where there is no footer button. */
.ft-inner-center { justify-content: center; text-align: left; }
.ft-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.ft-brand .nav-mark { width: 34px; height: 34px; }
.ft-brand span span { display: block; }
.ft-brand b { display: block; color: #fff; font-size: 14.5px; }
.ft-brand span span:last-child { font-size: 12px; color: #8f9cc6; }
.ft-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; }
/* Plain text links in the footer - but NOT a .btn, which must keep its own look.
   Without the :not(.btn) guard, this stripped the Contact button's padding and
   colour and it rendered as cramped bare text. */
.ft-links a:not(.btn) { font-size: 13.5px; color: #b9c3e6; text-decoration: none; padding: 4px 0; }
.ft-links a:not(.btn):hover { color: #2fd8a6; }
/* The Contact button in the footer: a clear glass pill, not a faint text link. */
.ft-links .btn { text-decoration: none; }
.ft-legal {
  border-top: 1px solid rgba(255,255,255,.06);
  /* Minimal height: just enough padding for the two text lines, no safe-area
     padding here (the fixed-footer rules below own the bottom inset). */
  padding: 8px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-size: 12px; line-height: 1.35; color: #5f6b93; text-align: center;
}

/*
 * Slim footer, staff-login style: a single centred row with the Contact link
 * and the legal line. Used on the tenant sign-in page - no brand block, no
 * button, everything centred.
 */
.ft.ft-slim {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px 16px;
  padding: 16px clamp(18px, 6vw, 40px) calc(16px + env(safe-area-inset-bottom));
  text-align: center;
}
.ft-slim .ft-contact { font-size: 13px; font-weight: 600; color: #b9c8f7; text-decoration: none; }
.ft-slim .ft-contact:hover { color: #2fd8a6; text-decoration: underline; }
.ft-slim .ft-legal-line { font-size: 12px; color: #7482ac; }

/* ==========================================================================
   Persistent copyright
   --------------------------------------------------------------------------
   Shown at the foot of every signed-in screen (the tenant app and the owner
   console), matching the sign-in page, the landing page and the staff portal so
   the copyright line is consistent everywhere. Sits inside .main, so the app's
   own padding keeps it clear of the surrounding chrome.
   ========================================================================== */
.app-copyright {
  margin-top: 26px;
  padding: 16px 4px 8px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ==========================================================================
   Section transitions
   A short, soft fade-and-rise played whenever a screen is (re)rendered into
   #view (retriggered from JS in app.route). Matches the staff portal so both
   feel like one product. Neutralised under prefers-reduced-motion above.
   ========================================================================== */
@keyframes viewEnter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
#view.view-enter { animation: viewEnter .34s cubic-bezier(.22, .61, .36, 1) both; }

/* ==========================================================================
   Bottom tab bar - used by the OWNER CONSOLE (owner.html) only.
   --------------------------------------------------------------------------
   The tenant portal moved to a left sidebar (see .sidebar / .shell above), but
   the owner console still uses this bottom/lifted tab bar and shares this
   stylesheet, so these rules are kept here scoped to .tabbar. The tenant portal
   markup no longer contains a .tabbar, so nothing here affects it.
   ========================================================================== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid var(--line);
}
.tabbar.tabbar-4 { grid-template-columns: repeat(4, 1fr); }
.tabbar button {
  position: relative;
  border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 6px 2px;
  font-size: 11px; font-weight: 600; color: var(--muted);
  transition: color .2s ease;
}
.tabbar button .ic { font-size: 19px; line-height: 1; transition: transform .2s cubic-bezier(.34, 1.56, .64, 1); }
.tabbar button.is-active { color: var(--brand-600); }
.tabbar button.is-active .ic { transform: translateY(-1px) scale(1.08); }
.tabbar button:focus-visible { outline: 2px solid var(--brand-500); outline-offset: -2px; }
.tabbar button .dot {
  position: absolute; top: 7px; right: calc(50% - 16px);
  width: 8px; height: 8px; border-radius: 50%;
  background: #e0334f; border: 1.5px solid #fff;
}
.tabbar .tab-profile .ic {
  width: 23px; height: 23px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  color: #fff; font-size: 12px; font-weight: 700;
  background: linear-gradient(145deg, var(--brand-500), var(--brand-800));
}
.tabbar .tab-profile .ic img { width: 100%; height: 100%; object-fit: cover; }
.tabbar .tab-profile.is-open { color: var(--brand-600); }

@media (min-width: 820px) {
  .tabbar {
    position: sticky; top: var(--header-h); bottom: auto;
    height: auto; padding: 0;
    grid-template-columns: repeat(4, max-content);
    gap: 4px;
    justify-content: center;
    border-top: 0; border-bottom: 1px solid var(--line);
  }
  .tabbar button {
    flex-direction: row; gap: 8px; padding: 13px 18px;
    font-size: 13.5px; border-bottom: 2px solid transparent;
  }
  .tabbar button .ic { font-size: 16px; }
  .tabbar button.is-active { border-bottom-color: var(--brand-600); }
  .tabbar button .dot { top: 10px; right: 8px; }
}

/* ==========================================================================
   Pay screen QR
   The scan-to-pay QR shown at the top of the Pay rent sheet, with a download
   link. Same QR for every tenant (the PG's bank/UPI QR at /pay-qr.svg).
   ========================================================================== */
.pay-qr {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 16px; margin-bottom: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.pay-qr-img {
  width: 220px; max-width: 70vw; height: auto; display: block;
  border-radius: 12px; border: 1px solid var(--line-soft); background: #fff;
}
.pay-qr-note {
  margin: 0; text-align: center; font-size: 13px; color: var(--muted); line-height: 1.5;
}

/* ==========================================================================
   Dark mode (tenant portal, signed-in app)
   Token re-definition applied via <html data-theme="dark">, toggled from the
   top bar and persisted to localStorage.
   ========================================================================== */
:root[data-theme="dark"] {
  --brand-900: #cdd8ff;
  --brand-800: #b9c8ff;
  --brand-700: #a9bcff;
  --brand-600: #7f9bff;
  --brand-500: #6f8dff;
  --brand-100: #26325c;
  --brand-50:  #1a2340;

  --ink:      #e9edf7;
  --ink-soft: #c2ccdf;
  --muted:    #8f9cb6;
  --faint:    #6b7690;

  --line:      #2a3350;
  --line-soft: #212a44;
  --bg:        #0e1424;
  --card:      #161d31;

  --ok-700:#5fe0a8;  --ok-100:#123a2c; --ok-line:#1f5c44;
  --warn-700:#f0c073; --warn-100:#3d2f12; --warn-line:#6b5220;
  --bad-700:#f58a9c;  --bad-100:#3d1620; --bad-line:#6b2a38;
  --info-700:#78c8ef; --info-100:#12303f; --info-line:#1f5674;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.3);
  --shadow-2: 0 4px 12px rgba(0,0,0,.5), 0 2px 4px rgba(0,0,0,.35);
  --shadow-3: 0 18px 44px rgba(0,0,0,.6);
  color-scheme: dark;
}
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder { color: var(--faint); }
:root[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator { filter: invert(1) opacity(.7); }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  transition: background .15s, color .15s, border-color .15s;
}
.theme-toggle:hover { border-color: var(--brand-500); color: var(--brand-600); }
/*
 * The sun (shown in dark mode, meaning "switch to light") is painted a warm
 * yellow so it reads as a sun rather than a pale outline glyph. Plain text glyph
 * so the colour applies, and it holds across phone, tablet, iPad and laptop.
 */
.theme-toggle .is-sun { color: #f5c518; }
.theme-toggle:hover .is-sun { color: #ffd633; }

/* Required-field marker (red asterisk) and optional hint on form labels. */
.req { color: var(--bad-700); font-weight: 700; margin-left: 2px; }
.opt { font-weight: 500; color: var(--faint); margin-left: 4px; }

/* ==========================================================================
   Dark mode - hardcoded-colour corrections (tenant portal)
   Fixes every spot that hardcoded a light hex so nothing is light-on-light or
   dark-on-dark: header pills, row hovers, card footers, month card, sheet
   items, announcement pinned styling, media placeholders, quick-action icons.
   ========================================================================== */

/* Header controls that hardcoded white (the visible white pills in the top bar). */
:root[data-theme="dark"] .hamburger,
:root[data-theme="dark"] .profile-btn { background: var(--card); border-color: var(--line); }
:root[data-theme="dark"] .hamburger:hover,
:root[data-theme="dark"] .profile-btn:hover,
:root[data-theme="dark"] .icon-btn:hover,
:root[data-theme="dark"] .input:hover,
:root[data-theme="dark"] .select:hover,
:root[data-theme="dark"] .textarea:hover,
:root[data-theme="dark"] .quick button:hover,
:root[data-theme="dark"] .chip:hover { border-color: var(--brand-500); }
:root[data-theme="dark"] .topbar { background: var(--card); border-bottom-color: var(--line); }
:root[data-theme="dark"] .brand-text b,
:root[data-theme="dark"] .brand-text span { color: var(--ink); }

/* Row hovers + card footers that hardcoded near-white. */
:root[data-theme="dark"] button.row:hover,
:root[data-theme="dark"] table.grid tbody tr:hover,
:root[data-theme="dark"] .sheet-item:hover { background: rgba(127,141,255,.10); }
:root[data-theme="dark"] .card-foot { background: rgba(255,255,255,.03); }
:root[data-theme="dark"] table.grid thead th { background: rgba(255,255,255,.03); }

/* File-drop resting + hover. */
:root[data-theme="dark"] .file-drop { background: rgba(255,255,255,.03); }

/*
 * Announcement ticker in dark mode.
 *
 * The light-mode gradient uses --brand-700/--brand-500, which dark mode
 * redefines to pale periwinkle - so white text on it washed out to the barely
 * readable strip in the report. Pin a deep, saturated blue gradient (fixed hex,
 * not the light tokens) with crisp light text and a soft border so the strip
 * reads clearly against the dark page. The event chip on it is given matching
 * dark treatment too.
 */
:root[data-theme="dark"] .ann-ticker {
  background: linear-gradient(100deg, #1b2e78, #2b4fc7);
  color: #eaf0ff;
  border: 1px solid rgba(127, 155, 255, .28);
  box-shadow: 0 10px 24px -16px rgba(0, 0, 0, .75);
}
:root[data-theme="dark"] .ann-ticker-item { color: #eaf0ff; }
:root[data-theme="dark"] .ann-event {
  color: #cdd8ff; background: rgba(127, 155, 255, .14); border-color: rgba(127, 155, 255, .30);
}

/* Announcements: pinned amber-on-cream -> dark amber; media placeholders. */
:root[data-theme="dark"] .ann-badge,
:root[data-theme="dark"] .ann-post.is-pinned .ann-event {
  color: var(--warn-700); background: var(--warn-100); border-color: var(--warn-line);
}
:root[data-theme="dark"] .ann-post.is-pinned .ann-ic { background: var(--warn-100); color: var(--warn-700); }
:root[data-theme="dark"] .ann-media,
:root[data-theme="dark"] .ann-thumb { background: var(--line-soft); }
:root[data-theme="dark"] .ann-post { background: var(--card); border-color: var(--line); }
:root[data-theme="dark"] .ann-title { color: var(--ink); }
:root[data-theme="dark"] .ann-text { color: var(--ink-soft); }

/* Account sheet quick-action tinted icons -> dark-tinted. */
:root[data-theme="dark"] .si.i-photo,
:root[data-theme="dark"] .quick .q-note .qi { background: rgba(139,92,246,.18); color: #c4b5fd; }
:root[data-theme="dark"] .si.i-star { background: rgba(245,158,11,.16); color: #fcd34d; }

/* Grid chip + escalated marker. */
:root[data-theme="dark"] .g-chip.warn { background: var(--warn-100); color: var(--warn-700); }
:root[data-theme="dark"] .stage-escalated::before { background: var(--bad-700); }

/* Generic residual white cards/panels fall back to the card token. */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .modal,
:root[data-theme="dark"] .sheet { background: var(--card); }

/* The "My rent" month rows and any button.row cards use var(--card); ensure their
   text tokens stay light (they already use --ink/--ink-soft, so they flip). */

/* Dark mode round 2 - modal footer + banner text legibility + remaining whites. */
:root[data-theme="dark"] .modal-foot { background: rgba(255,255,255,.03); border-top-color: var(--line); }
/* Info/status banners: keep child text in the banner's own light hue. */
:root[data-theme="dark"] .msg-bad *,
:root[data-theme="dark"] .msg-ok *,
:root[data-theme="dark"] .msg-warn *,
:root[data-theme="dark"] .msg-info * { color: inherit; }
/*
 * On-hero buttons ("Pay this rent", "Add payment details", "Get my receipt")
 * sit on a saturated coloured gradient card, so they stay a near-white pill in
 * BOTH themes. The base rule sets color:var(--brand-800), which dark mode
 * redefines to a light blue - that painted light-blue text on a near-white
 * button and made the label vanish. Pin an explicit dark ink and a solid white
 * hover here so the button reads clearly regardless of theme.
 */
:root[data-theme="dark"] .due .btn-onhero {
  background: rgba(255, 255, 255, .96);
  color: #10214a;
}
:root[data-theme="dark"] .due .btn-onhero:hover:not(:disabled) { background: #fff; color: #10214a; }
:root[data-theme="dark"] .si.i-star { background: rgba(245,158,11,.16); color: #fcd34d; }
/* Ensure every card and its sub-panels stay rounded and on the card surface. */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .card-foot,
:root[data-theme="dark"] .modal { border-radius: var(--r-lg); }
:root[data-theme="dark"] .card-foot { border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: var(--r-lg); }

/* ==========================================================================
   Installed app (standalone PWA): sign-in top spacing.

   Placed at the very end so it wins over the phone breakpoint above, which adds
   112px of top padding to clear the fixed header. In the installed app that
   header is hidden (see the earlier display-mode: standalone block), so that
   clearance would leave a large empty gap above the sign-in card. Reset it to a
   small, even top gap. Website (normal browser) never matches this query.
   ========================================================================== */
@media (display-mode: standalone) {
  .signin-page { padding-top: env(safe-area-inset-top, 0px); }
  .signin-page .stage { padding-top: 24px; }
}
/* in-app mirror of the display-mode: standalone block above */
:where(html[data-in-app]) .signin-page {
  padding-top: env(safe-area-inset-top, 0px);
}
:where(html[data-in-app]) .signin-page .stage {
  padding-top: 24px;
}


/* ==========================================================================
   INSTALLED APP (standalone PWA) — mobile fit
   --------------------------------------------------------------------------
   Applies ONLY when launched from the home screen (display-mode: standalone);
   a normal browser tab never matches, so the website is unaffected.

   Keep the header and any tall modal/sheet clear of the iOS status bar, keep
   the header clear of the notch in landscape, and make sure nothing can push
   off the right edge of a phone.
   ========================================================================== */
@media (display-mode: standalone) {
  /* Header clears the notch on the sides in landscape (0 on non-notched). */
  .topbar {
    padding-left: calc(clamp(12px, 4vw, 20px) + env(safe-area-inset-left));
    padding-right: calc(clamp(12px, 4vw, 20px) + env(safe-area-inset-right));
    /*
     * SOLID, opaque header in the installed app - fixes the "half-shaded"
     * header seen in the app. The website keeps its translucent blurred header;
     * in a standalone PWA the status-bar inset area rendered that translucency
     * differently from the rest, splitting the header into two shades. A solid
     * --card background (white in light mode, the dark card colour in dark mode)
     * makes the whole header one uniform colour in both themes, with no blur so
     * nothing shows through.
     */
    /* !important so this beats the higher-specificity dark-mode rule
       (:root[data-theme="dark"] .topbar) and the base translucent .topbar in
       BOTH themes. A media query adds no specificity, so without !important the
       dark-mode selector won and the half-shaded header remained in dark mode. */
    background: var(--card) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border-bottom: 1px solid var(--line) !important;
  }

  /* The pay / report modal rises from the bottom and can be up to 92dvh tall;
     cap it so its top always stays below the status bar, and add a top gap on
     the modal root so a full-height dialog never tucks under the clock. */
  .modal-root { padding-top: env(safe-area-inset-top); }
  .modal {
    max-height: calc(92vh - env(safe-area-inset-top));
    max-height: calc(92dvh - env(safe-area-inset-top));
  }

  /* The profile sheet likewise. */
  .sheet {
    max-height: calc(92vh - env(safe-area-inset-top));
    max-height: calc(92dvh - env(safe-area-inset-top));
  }

  /* The in-app PDF viewer: fill the card width with a tall-but-bounded frame. */
  .modal-body iframe { width: 100%; height: 70vh; height: min(70vh, 80dvh); border: 0; }
}
/* in-app mirror of the display-mode: standalone block above */
:where(html[data-in-app]) .topbar {
  padding-left: calc(clamp(12px, 4vw, 20px) + env(safe-area-inset-left));
    padding-right: calc(clamp(12px, 4vw, 20px) + env(safe-area-inset-right));
    
    
    background: var(--card) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border-bottom: 1px solid var(--line) !important;
}
:where(html[data-in-app]) .modal-root {
  padding-top: env(safe-area-inset-top);
}
:where(html[data-in-app]) .modal {
  max-height: calc(92vh - env(safe-area-inset-top));
    max-height: calc(92dvh - env(safe-area-inset-top));
}
:where(html[data-in-app]) .sheet {
  max-height: calc(92vh - env(safe-area-inset-top));
    max-height: calc(92dvh - env(safe-area-inset-top));
}
:where(html[data-in-app]) .modal-body iframe {
  width: 100%; height: 70vh; height: min(70vh, 80dvh); border: 0;
}

/* ==========================================================================
   HORIZONTAL-OVERFLOW BACKSTOP (app shell only)
   --------------------------------------------------------------------------
   Not on <html> (the author kept it off to protect the fixed topbar's touch
   scrolling) and not on body.landing. Scoped to the signed-in app so a single
   wide element cannot cause a sideways scroll on a phone.
   ========================================================================== */
.app { overflow-x: hidden; }
.main { min-width: 0; max-width: 100%; }
.main .card, .main .modal, .main table { max-width: 100%; }
/* Laptop website only (owner 2026-11-02): the line above cancelled the 900px
   reading width set for >=1000px, so every card stretched across the whole
   screen. Restore it here. Phones and the Android/iPhone apps (narrower than
   1000px) are not affected. The owner console keeps its own wider limit. */
@media (min-width: 1000px) {
  body:not(.staff-console) .main { max-width: 900px; }
  body.staff-console .main { max-width: 1180px; }
}
/* Fact tiles use bare 1fr tracks; make them min-width:0 so a long unbreakable
   value cannot force the track wider than the screen, and let the value wrap. */
.facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sheet-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.facts .v, .facts .k, .sheet-facts .v, .sheet-facts .k,
.row .lead b, .row .lead span, .card b { overflow-wrap: anywhere; }

/* =========================================================================
   App / phone responsive polish and in-app PDF viewer styling.
   Scoped to small screens so wider layouts are unchanged.
   ========================================================================= */
.proof-img { max-width: 100%; height: auto; display: block; margin: 0 auto; border-radius: 10px; }
.pdfview { width: 100%; }
.pdfview .pdfview-page { max-width: 100%; box-shadow: 0 1px 4px rgba(15, 23, 42, .12); }
.pdfview-status { padding: 24px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.pdfview-error { color: #a52034; }

@media (max-width: 640px) {
  .main, .card, .card-body, .modal-body { max-width: 100%; }
  .card-body, .modal-body { overflow-wrap: anywhere; word-break: break-word; }
  /* Lists already replace tables on the tenant phone view; make sure a long row
     value (reference number, email) wraps instead of widening the row. */
  .rows .row { flex-wrap: wrap; }
  .rows .row .lead, .rows .row .trail { min-width: 0; }
  .rows .row .lead .wrap-any { overflow-wrap: anywhere; word-break: break-word; }
}

/* =========================================================================
   Phone content fit (tenant app). Keeps list rows, fact grids and quick
   actions readable and tidy on the smallest phones without affecting wider
   layouts. Content inside rows wraps instead of overflowing.
   ========================================================================= */
@media (max-width: 640px) {
  /* A list row keeps lead (left) and trail (right) but lets the lead wrap and
     the trail hold the figure + action without pushing the row off-screen. */
  .row { gap: 10px; }
  .row .lead b { overflow-wrap: anywhere; }
  .row .lead span { overflow-wrap: anywhere; }
  .row .trail { min-width: 0; }
  .row .trail .figure { font-size: 14px; white-space: nowrap; }
  .row .trail .btn { min-height: 38px; }

  /* Fact grids. The profile's .sheet-facts always holds exactly three tiles
     (Rent, Advance, Room) and must stay on ONE even row at phone width - a two
     column track left Room alone on a second row beside an empty cell. The
     .facts grid (room/tenancy, payment detail pairs) stays two columns. */
  .facts { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sheet-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; }
  .facts .v, .sheet-facts .v { overflow-wrap: anywhere; font-size: 14px; }

  /* The coloured due hero: amount scales with viewport (already clamped); make
     sure the note and state text wrap cleanly. */
  .due .note, .due .state { overflow-wrap: anywhere; }
}

@media (max-width: 380px) {
  .quick { grid-template-columns: 1fr 1fr; }
  /* .facts pairs may stack to one column on the narrowest phones, but the three
     profile tiles stay on one row - they fit (~110px each) down to 320px. */
  .facts { grid-template-columns: 1fr; }
  .sheet-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ==========================================================================
   Phone only: card actions collapsed into a "..." kebab.

   App.enhanceCards() marks a card .has-kebab, its button group .is-kebabbed,
   and appends a .btn-kebab button. Here we pin that kebab to the card's
   top-right, hide the original buttons (they open in the bottom-sheet instead),
   and leave room so a long value never slides under it. Scoped to <=560px so
   tablet and laptop keep their inline buttons exactly as they are.
   ========================================================================== */
@media (max-width: 560px) {
  .row.has-kebab,
  .card.has-kebab,
  li.has-kebab { position: relative; }

  .has-kebab .js-row-acts.is-kebabbed { display: none !important; }

  .btn-kebab {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    width: 38px; height: 38px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--card, #fff); color: var(--muted);
    font-size: 20px; line-height: 1; cursor: pointer;
  }
  .btn-kebab:hover,
  .btn-kebab.is-open { color: var(--brand-700); border-color: var(--brand-200, #c6d1ea); background: var(--brand-50); }
  .btn-kebab:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

  /* Keep the card's own content clear of the kebab in the top-right corner. */
  .row.has-kebab > .trail,
  .row.has-kebab > .lead { padding-right: 46px; }

  /* The bottom-sheet list of actions. */
  .sheet-actions { display: flex; flex-direction: column; gap: 10px; }
  .sheet-actions .btn { width: 100%; justify-content: center; min-height: 46px; font-size: 15px; }
}

/* ======================================================================
 * PHONE CARD LAYOUT - FINAL OVERRIDE  (iPhone 15 = 393px, Plus/Max = 430px)
 *
 * Required layout for every stacked table-card cell: field LABEL hard LEFT
 * (left-aligned), ALL value(s) hard RIGHT (right-aligned), multiple values
 * STACKED vertically on the right - never spread across the middle.
 *
 * The tenant grid cells have several direct children with no wrapper, e.g.
 *   <td data-label="Tenant">Suresh<div>Room 203</div></td>
 * so the old flex row spread them. This pins the label left (margin-right:auto)
 * and forces each element value onto its own right-aligned line.
 *
 * Capped at max-width:430px so ONLY iPhone-class phones change; iPad portrait
 * (768px) and the tablet/laptop grid are left exactly as they were.
 * ====================================================================== */
@media (max-width: 430px) {
  /* Hard width containment so the card/table border never overflows the screen. */
  .table-wrap { overflow-x: hidden; max-width: 100%; }
  table.grid, table.grid tbody { display: block; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
  table.grid tr { display: block; width: auto; max-width: 100%; min-width: 0; overflow: hidden; box-sizing: border-box; }
  table.grid td {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 2px 12px;
    text-align: right;
    width: auto;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
  }
  /* Label hard left; the auto margin shoves every value to the right. */
  table.grid td::before {
    margin-right: auto;
    flex: 0 0 auto;
    max-width: 55%;
    text-align: left;
  }
  /* Each element value takes its own full-width line, right-aligned; a bare
     text value (name, figure) rides the label line at the right. */
  table.grid td > * {
    flex: 0 0 100%;
    max-width: 100%;
    min-width: 0;
    text-align: right;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  table.grid td * {
    min-width: 0;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  /* Pills/chips keep their own width and sit at the right. */
  table.grid td .stage-pill,
  table.grid td .chip,
  table.grid td .pill { align-self: flex-end; width: auto; display: inline-flex; }
  /* The .num column (Repair date, Cost) wraps instead of clipping. */
  table.grid .num,
  table.grid .num * { white-space: normal !important; }

  /* The Problem cell holds a title + sub-lines: keep it stacked, left-aligned. */
  table.grid td[data-label="Problem"] {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    text-align: left;
  }
  table.grid td[data-label="Problem"]::before { margin-right: 0; max-width: none; }
  table.grid td[data-label="Problem"] > * { flex-basis: auto; text-align: left; }

  /* Dashboard ".row" cards: label left, trailing figure/amount right, no clip. */
  .row .trail,
  .row .trail .figure,
  .row .trail * { white-space: normal !important; overflow-wrap: anywhere; min-width: 0; }
}

/* ======================================================================
 * PHONE FIXES (2026-10): profile facts alignment + compact inline chips.
 * Last block in the file so it wins by source order over the earlier phone
 * rules. Scoped to <=430px so iPad portrait (768px) and the laptop grid are
 * untouched, matching the existing phone-card breakpoint.
 * ====================================================================== */
@media (max-width: 430px) {
  /*
   * Profile "RENT / ADVANCE / ROOM" tiles: keep all three on ONE even row.
   * The earlier rules dropped them to a 2-column grid, so the third tile (Room)
   * sat alone on a second row beside a big empty cell. Three equal min-width:0
   * tracks line them up neatly across the screen; the figures still fit at
   * ~110px per tile down to 360px.
   */
  .sheet-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; }

  /*
   * Compact inline values on stacked grid cards: a status pill, a category chip
   * or a tappable link must keep its own width and sit at the RIGHT, not stretch
   * to the full card width (the "Paid" bar / phone pill the owner flagged). The
   * earlier `td > * { flex:0 0 100% }` rule stretched them; override just the
   * inline chips/links back to auto-width, right-aligned.
   */
  table.grid td .pill,
  table.grid td .chip,
  table.grid td .stage-pill,
  table.grid td a:not(.btn) {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    align-self: flex-end;
    display: inline-flex;
  }
}


/* ==========================================================================
   Food (tenant) - today's menu hero, "not coming" form, skipped-meal cards.

   Phone first, one column. Laptop / tablet landscape (>=760px): today's three
   meals sit side by side, and the form sits next to the skipped-meal cards.
   Surfaces use the theme tokens so dark mode follows; the hero band is a fixed
   warm gradient with white text in both themes. Every animation is switched
   off for prefers-reduced-motion.
   ========================================================================== */
.fd-c-breakfast { --fa: #f59e0b; --fa-soft: rgba(245, 158, 11, .15); --fa-ink: #b45309; }
.fd-c-lunch     { --fa: #f97316; --fa-soft: rgba(249, 115, 22, .14); --fa-ink: #c2410c; }
.fd-c-dinner    { --fa: #6366f1; --fa-soft: rgba(99, 102, 241, .15); --fa-ink: #4338ca; }
:root[data-theme="dark"] .fd-c-breakfast { --fa-ink: #fbbf24; --fa-soft: rgba(245, 158, 11, .2); }
:root[data-theme="dark"] .fd-c-lunch     { --fa-ink: #fdba74; --fa-soft: rgba(249, 115, 22, .2); }
:root[data-theme="dark"] .fd-c-dinner    { --fa-ink: #a5b4fc; --fa-soft: rgba(129, 140, 248, .2); }

/* ------------------------------- the hero -------------------------------- */
.fd-hero {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-2);
}
.fd-hero-band {
  position: relative; overflow: hidden; color: #fff;
  padding: 20px 18px 40px; min-height: 158px;
  background: linear-gradient(120deg, #ff8a3d 0%, #f43f5e 48%, #8b5cf6 100%);
  background-size: 220% 220%;
  animation: fdShift 16s ease-in-out infinite alternate;
}
.fd-hero-band::before, .fd-hero-band::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 70%);
}
.fd-hero-band::before { width: 240px; height: 240px; right: -70px; top: -90px; }
.fd-hero-band::after  { width: 180px; height: 180px; left: 30%; bottom: -120px; opacity: .6; }
:root[data-theme="dark"] .fd-hero-band { filter: brightness(.86) saturate(.95); }

.fd-hero-text { position: relative; z-index: 1; max-width: 62%; }
.fd-kicker {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, .2);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.fd-hero-text h2 { font-size: 22px; line-height: 1.2; margin: 10px 0 6px; color: #fff; letter-spacing: -.01em; }
.fd-hero-text p { font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, .92); margin: 0; }
.fd-hero-btn {
  position: relative; z-index: 1; margin-top: 14px; min-height: 40px; padding: 9px 18px;
  background: #fff; color: #9a3412; font-weight: 700; border: 0; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}
.fd-hero-btn:hover { background: #fff7ed; color: #7c2d12; }

/* Floating food graphics + a steaming pot. */
.fd-hero-art { position: absolute; inset: 0; pointer-events: none; }
.fd-float {
  position: absolute; font-size: 26px; line-height: 1;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .18));
  animation: fdBob 6s ease-in-out infinite;
}
.fd-float.f1 { right: 26%; top: 16px;  font-size: 30px; animation-delay: -1s; }
.fd-float.f2 { right: 6%;  top: 12px;  font-size: 24px; animation-delay: -3s; }
.fd-float.f3 { right: 30%; bottom: 46px; font-size: 22px; animation-delay: -2s; }
.fd-float.f4 { right: 4%;  bottom: 58px; font-size: 20px; animation-delay: -4s; }
.fd-float.f5 { right: 19%; top: 58px;  font-size: 18px; animation-delay: -5s; opacity: .9; }
.fd-pot {
  position: absolute; right: 12%; bottom: 30px; font-size: 52px; line-height: 1;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .22));
  animation: fdBob 7s ease-in-out infinite; animation-delay: -2.5s;
}
.fd-pot i {
  position: absolute; bottom: 88%; width: 6px; height: 20px; border-radius: 6px;
  background: rgba(255, 255, 255, .75); filter: blur(1.5px); opacity: 0;
  animation: fdSteam 2.8s ease-in infinite;
}
.fd-pot .s1 { left: 30%; }
.fd-pot .s2 { left: 48%; animation-delay: .9s; height: 26px; }
.fd-pot .s3 { left: 66%; animation-delay: 1.8s; }

/* ------------------------------- meal tiles ------------------------------ */
.fd-tiles {
  position: relative; z-index: 1; display: grid; gap: 12px;
  padding: 0 12px 14px; margin-top: -24px;
}
.fd-tile {
  position: relative; min-width: 0; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 14px 14px; box-shadow: var(--shadow-1);
  transition: transform .2s ease, box-shadow .2s ease;
}
.fd-tile::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--fa), rgba(255, 255, 255, 0));
}
.fd-tile::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, var(--fa-soft), transparent 70%); pointer-events: none;
}
@media (hover: hover) {
  .fd-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
  .fd-tile:hover .fd-bubble { animation: fdWiggle .6s ease; }
}
.fd-tile-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 11px; position: relative; z-index: 1; }
.fd-bubble {
  flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  font-size: 25px; background: var(--fa-soft); box-shadow: inset 0 0 0 1px var(--fa-soft);
}
.fd-tile.is-next .fd-bubble, .fd-tile.is-serving .fd-bubble { animation: fdBob 3.2s ease-in-out infinite; }
/* min-width keeps "8:00 PM" on one line; the phase badge wraps under instead. */
.fd-tile-name { display: flex; flex-direction: column; min-width: 6.5em; flex: 1; }
.fd-tile-name b { font-size: 16px; color: var(--ink); }
.fd-tile-name small { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; }

.fd-phase {
  flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.fd-phase i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fd-phase.is-next { background: var(--fa-soft); color: var(--fa-ink); }
.fd-phase.is-next i { animation: fdPulse 1.6s ease-out infinite; }
.fd-phase.is-live { background: var(--ok-100); color: var(--ok-700); }
.fd-phase.is-live i { animation: fdPulse 1.2s ease-out infinite; }
.fd-phase.is-done { background: var(--line-soft); color: var(--muted); }
.fd-tile.is-next { border-color: var(--fa); box-shadow: 0 0 0 3px var(--fa-soft), var(--shadow-1); }
.fd-tile.is-serving { border-color: var(--ok-line); box-shadow: 0 0 0 3px var(--ok-100), var(--shadow-1); }
.fd-tile.is-done .fd-bubble { filter: grayscale(.6); opacity: .75; }

.fd-tile-menu { position: relative; z-index: 1; margin-top: 12px; }
.fd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fd-chip {
  display: inline-flex; align-items: center; padding: 6px 11px; border-radius: 999px;
  font-size: 13px; font-weight: 600; line-height: 1.2; color: var(--ink);
  background: var(--fa-soft); overflow-wrap: anywhere;
}
.fd-chip.is-empty { background: var(--line-soft); color: var(--muted); font-weight: 500; }
.fd-opt-line { padding: 8px 10px; border-radius: 12px; border: 1px dashed transparent; }
.fd-opt-line + .fd-opt-line { margin-top: 6px; }
.fd-opt-line > b { font-size: 12.5px; color: var(--ink-soft); }
.fd-opt-line .fd-chips { margin-top: 6px; }
.fd-opt-line.is-mine { border-color: var(--fa); background: var(--fa-soft); }
.fd-opt-line.is-mine > b::after {
  content: "Your plate"; margin-left: 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--fa-ink);
}
.fd-opt-line.is-mine .fd-chip { background: var(--card); }

/* The usual Indian veg / non-veg marks: a square with a dot. */
.fd-mark {
  display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 6px;
  vertical-align: -1px; border: 1.5px solid; position: relative;
}
.fd-mark::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: currentColor; }
.fd-mark.v  { color: #16a34a; border-color: #16a34a; }
.fd-mark.nv { color: #c0392b; border-color: #c0392b; }

.fd-changed { position: relative; z-index: 1; font-size: 12px; color: var(--warn-700); margin-top: 8px; font-weight: 600; }

/* Today's veg / non-veg and egg switch. */
.fd-seg {
  position: relative; z-index: 1; display: inline-flex; margin-top: 10px; margin-right: 8px;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--card);
}
.fd-seg button {
  border: 0; background: transparent; color: var(--ink-soft); font: inherit; font-size: 13px;
  font-weight: 600; padding: 7px 14px; border-radius: 999px; cursor: pointer; min-height: 34px;
  transition: background .2s ease, color .2s ease;
}
.fd-seg button.is-on { background: var(--brand-600); color: #fff; }
.fd-seg button:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 1px; }

.fd-tile-foot {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 6px 10px; margin-top: 12px; padding-top: 11px;
  border-top: 1px dashed var(--line);
}
.fd-you {
  font-size: 12.5px; font-weight: 700; color: var(--ok-700); background: var(--ok-100);
  padding: 4px 10px; border-radius: 999px;
}
.fd-you.is-skip { color: var(--bad-700); background: var(--bad-100); }
.fd-clock { font-size: 12px; color: var(--muted); }
.fd-clock b { color: var(--ink-soft); }
.fd-clock.is-soon, .fd-clock.is-soon b { color: var(--warn-700); }
.fd-tile.is-skip { border-style: dashed; border-color: var(--bad-line); }
.fd-tile.is-skip .fd-bubble { filter: grayscale(1); opacity: .6; }
.fd-tile.is-skip .fd-chip { text-decoration: line-through; color: var(--muted); background: var(--line-soft); }

/* Home: a little breathing room around the card. */
.fd-home { margin: 16px 0; }
.fd-hero.is-compact .fd-hero-band { min-height: 0; padding-bottom: 38px; }

/* ----------------------- form + skipped-meal cards ----------------------- */
.fd-layout { display: grid; gap: 16px; margin-top: 16px; }
.fd-layout .card { margin: 0; }
/* The food cards are large and mostly white, so the default faint border/shadow
   let them melt into the pale page background. Give the food page's cards AND
   the header panel (title + subtitle + "My food preference" strip) a clearly
   visible border and a real drop shadow so each reads as a distinct white panel.
   Scoped to the food page only - every other section keeps its look. */
.fd-page .card,
.fd-page .fd-head {
  background: #ffffff;
  border: 1px solid #c3cde0;
  border-radius: var(--r-lg);
  box-shadow: 0 14px 32px -18px rgba(15, 23, 42, .35), 0 3px 8px rgba(15, 23, 42, .08);
}
/* The header panel needs its own padding (it is not a .card with a card-body). */
.fd-page .fd-head { padding: 18px 18px; margin-bottom: 16px; }
/* The "My food preference" strip now sits INSIDE the white header panel, so it
   drops its own border/shadow and reads as part of that panel. */
.fd-page .fd-head .fd-pref {
  background: #f3f6fd; border: 1px solid #dbe3f2; box-shadow: none;
}
.fd-page .fd-head .fd-pref.is-locked { background: #f3f6fd; }
:root[data-theme="dark"] .fd-page .card,
:root[data-theme="dark"] .fd-page .fd-head {
  background: var(--card);
  border-color: #3a466a;
  box-shadow: 0 16px 34px -16px rgba(0, 0, 0, .6);
}
:root[data-theme="dark"] .fd-page .fd-head .fd-pref,
:root[data-theme="dark"] .fd-page .fd-head .fd-pref.is-locked {
  background: rgba(255,255,255,.04); border-color: #333e5e;
}
.fd-form-head {
  display: flex; align-items: center; gap: 12px; padding: 15px 17px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(135deg, var(--brand-50), rgba(255, 255, 255, 0) 80%);
}
.fd-form-head h3 { font-size: 16px; }
.fd-form-head p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.fd-form-ic {
  flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  font-size: 21px; background: var(--brand-100);
}
.fd-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fd-dates .field { margin: 0; min-width: 0; }
.fd-dates .input { width: 100%; min-width: 0; }
.fd-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 16px 0 8px; }
.fd-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fd-pick {
  position: relative; display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink-soft);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.fd-pick:active { transform: scale(.97); }
.fd-pick:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.fd-pick-ic { font-size: 20px; line-height: 1; }
.fd-pick.is-on { border-color: var(--bad-700); background: var(--bad-100); color: var(--ink); }
.fd-pick.is-on::after {
  content: "\2715"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; color: #fff; background: var(--bad-700); animation: fdPop .25s ease both;
}
.fd-summary { font-size: 13px; color: var(--muted); margin: 12px 2px 0; min-height: 18px; }
.fd-summary.is-ready { color: var(--ink); font-weight: 600; }
.fd-go { margin-top: 12px; min-height: 48px; font-size: 15px; }
/* Locked until at least one open meal is picked. */
.fd-go:disabled, .fd-go[aria-disabled="true"] {
  opacity: 1; cursor: not-allowed; box-shadow: none; transform: none;
  background: var(--line); border-color: var(--line); color: var(--muted);
}
.fd-pick-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.fd-pick-note { font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--muted); margin-top: 2px; }
/* A meal already served / closed for the chosen date: greyed out, not tappable. */
.fd-pick.is-closed, .fd-pick:disabled {
  cursor: not-allowed; background: var(--bg); border-style: dashed; border-color: var(--line);
  color: var(--faint); transform: none;
}
.fd-pick.is-closed .fd-pick-ic { filter: grayscale(1); opacity: .45; }
.fd-pick.is-closed .fd-pick-name { text-decoration: line-through; text-decoration-color: var(--faint); }
.fd-pick.is-closed:active { transform: none; }
.fd-closed {
  display: flex; gap: 8px; align-items: flex-start; margin: 10px 2px 0; padding: 9px 11px;
  font-size: 12.5px; line-height: 1.45; color: var(--warn-700);
  background: var(--warn-100); border: 1px solid var(--warn-line); border-radius: 10px;
}
.fd-closed::before { content: "\23F0"; flex: none; }
.fd-closed[hidden] { display: none; }

/* Page head: title on the left, "My food preference" on the right (stacked on phones). */
.fd-head { display: flex; flex-direction: column; gap: 12px; }
.fd-head .fd-pref { margin-top: 0; }
@media (min-width: 760px) {
  .fd-head { flex-direction: row; align-items: center; justify-content: space-between; gap: 20px; }
  .fd-head-txt { min-width: 0; flex: 1 1 auto; }
  .fd-head .fd-pref { flex: 0 1 380px; }
}
.fd-hint { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 12px 2px 0; }

.fd-mine { min-width: 0; }
.fd-mine-head { display: flex; align-items: center; gap: 8px; margin: 2px 2px 10px; }
.fd-mine-head h3 { font-size: 16px; color: var(--ink); }
.fd-cards { display: grid; gap: 12px; }
.fd-card-head {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(90deg, var(--bad-100), rgba(255, 255, 255, 0) 75%);
}
.fd-card-head .titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fd-card-head .titles b { font-size: 15.5px; color: var(--ink); }
.fd-card-head .titles span { font-size: 12.5px; color: var(--muted); }
.fd-cal {
  flex: none; width: 46px; display: flex; flex-direction: column-reverse; align-items: center;
  border-radius: 10px; overflow: hidden; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.fd-cal b { font-size: 18px; line-height: 1; padding: 5px 0 6px; color: var(--ink); }
.fd-cal small {
  width: 100%; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #fff; background: var(--bad-700); padding: 2px 0;
}
.fd-card-body { padding: 13px 15px 14px; }
.fd-sks { display: flex; flex-wrap: wrap; gap: 8px; }
.fd-sk {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 8px 6px 6px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer;
  transition: border-color .15s ease, transform .1s ease;
}
.fd-sk:active { transform: scale(.97); }
.fd-sk:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.fd-sk-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; background: var(--fa-soft); }
.fd-sk-x {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; color: var(--bad-700); background: var(--bad-100); transition: background .15s ease, color .15s ease;
}
button.fd-sk:hover { border-color: var(--bad-line); }
button.fd-sk:hover .fd-sk-x { background: var(--bad-700); color: #fff; }
.fd-sk.is-locked { cursor: default; color: var(--muted); }
.fd-sk.is-locked .fd-sk-ic { filter: grayscale(.7); }
.fd-sk.is-locked .fd-sk-x { background: var(--line-soft); color: var(--muted); font-size: 11px; }
.fd-card-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line);
}
.fd-card-foot .btn-sm { min-height: 38px; padding-left: 14px; padding-right: 14px; }
.fd-seen { font-size: 12.5px; color: var(--muted); }
.fd-seen.ok { color: var(--ok-700); font-weight: 600; }

.fd-empty { padding: 26px 20px; text-align: center; }
.fd-empty-art {
  width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, var(--brand-100), var(--brand-50));
}
.fd-empty-art span { font-size: 34px; animation: fdBob 4s ease-in-out infinite; }
.fd-empty b { display: block; font-size: 15px; color: var(--ink); }
.fd-empty p { font-size: 13px; color: var(--muted); margin-top: 5px; line-height: 1.5; }

.fd-pref {
  display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
}
.fd-pref-ic { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; background: var(--ok-100); }
.fd-pref-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fd-pref-txt small { font-size: 11.5px; color: var(--muted); }
.fd-pref-txt b { font-size: 14px; color: var(--ink); }
.fd-pref-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fd-pref.is-locked { background: var(--brand-50); }
.fd-pref-lock {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
}

/* Preference questions (first visit card and the Change dialog). */
.fd-prefs { margin-bottom: 16px; }
.fd-q { margin-bottom: 14px; }
.fd-q-k { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.fd-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.fd-opt {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; min-height: 42px;
  border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 13.5px;
  color: var(--ink-soft); background: var(--card);
}
.fd-opt input { accent-color: var(--brand-600); margin: 0; }
.fd-opt.is-on { border-color: var(--brand-500); background: var(--brand-50); color: var(--ink); }

/* ------------------------------- entrances ------------------------------- */
.fd-anim .fd-hero-text > * { animation: fdUp .55s cubic-bezier(.2, .7, .2, 1) both; }
.fd-anim .fd-hero-text h2 { animation-delay: .06s; }
.fd-anim .fd-hero-text p  { animation-delay: .12s; }
.fd-anim .fd-tile, .fd-home .fd-tile { animation: fdUp .55s cubic-bezier(.2, .7, .2, 1) backwards; animation-delay: calc(.12s + var(--i, 0) * .09s); }
.fd-anim .fd-tile .fd-chip, .fd-home .fd-tile .fd-chip { animation: fdPop .35s ease both; animation-delay: calc(.35s + var(--i, 0) * .09s); }
.fd-anim .fd-layout > * { animation: fdUp .55s cubic-bezier(.2, .7, .2, 1) both; animation-delay: .3s; }
.fd-anim .fd-layout > * + * { animation-delay: .38s; }
.fd-anim .fd-card { animation: fdUp .5s ease backwards; animation-delay: calc(.42s + var(--i, 0) * .07s); }
.fd-card.is-new { animation: fdNew .7s cubic-bezier(.2, .8, .2, 1) both; }

@keyframes fdShift { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes fdBob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-7px) rotate(-4deg); } }
@keyframes fdSteam {
  0%   { opacity: 0; transform: translateY(6px) scaleX(1); }
  30%  { opacity: .85; }
  100% { opacity: 0; transform: translateY(-26px) scaleX(1.8); }
}
@keyframes fdWiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes fdPulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 7px rgba(0, 0, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); } }
@keyframes fdUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fdPop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@keyframes fdNew {
  0%   { opacity: 0; transform: translateY(-8px) scale(.96); box-shadow: 0 0 0 0 var(--bad-line); }
  60%  { opacity: 1; transform: none; box-shadow: 0 0 0 6px var(--bad-100); }
  100% { box-shadow: var(--shadow-1); }
}

@media (min-width: 560px) {
  .fd-hero-band { padding: 24px 24px 44px; }
  .fd-hero-text h2 { font-size: 26px; }
  .fd-float { font-size: 32px; }
  .fd-pot { font-size: 64px; }
  .fd-picks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fd-pick { flex-direction: column; justify-content: center; text-align: center; gap: 4px; padding: 12px 8px; min-height: 72px; }
  .fd-pick.is-on::after { top: 8px; right: 8px; transform: none; }
}
/* Home on a phone: today's three meals as a swipeable strip, so the card stays short. */
@media (max-width: 759px) {
  .fd-hero.is-compact .fd-tiles {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 12px 16px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .fd-hero.is-compact .fd-tiles::-webkit-scrollbar { display: none; }
  .fd-hero.is-compact .fd-tile { flex: 0 0 82%; scroll-snap-align: center; }
}
@media (min-width: 760px) {
  .fd-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 16px 16px; gap: 14px; }
  .fd-hero-band { min-height: 176px; padding: 28px 28px 48px; }
  .fd-hero-text h2 { font-size: 30px; }
  .fd-float { font-size: 38px; }
  .fd-float.f1 { font-size: 44px; }
  .fd-pot { font-size: 80px; right: 10%; }
  .fd-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  /* Two columns of picks inside the narrower half-width form. */
  .fd-picks { grid-template-columns: 1fr 1fr; }
  .fd-pick { flex-direction: row; justify-content: flex-start; text-align: left; min-height: 50px; }
  .fd-pick.is-on::after { top: 50%; right: 10px; transform: translateY(-50%); }
}
@media (min-width: 1100px) {
  .fd-picks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fd-pick { flex-direction: column; justify-content: center; text-align: center; min-height: 74px; }
  .fd-pick.is-on::after { top: 8px; right: 8px; transform: none; }
}
@media (max-width: 380px) {
  .fd-dates { grid-template-columns: 1fr; }
  .fd-hero-text { max-width: 66%; }
  .fd-hero-text h2 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .fd-hero-band, .fd-float, .fd-pot, .fd-pot i, .fd-bubble, .fd-phase i, .fd-empty-art span,
  .fd-anim *, .fd-home .fd-tile, .fd-home .fd-chip, .fd-card.is-new, .fd-pick.is-on::after { animation: none !important; }
  .fd-pot i { opacity: 0; }
  .fd-tile, .fd-pick { transition: none; }
}

/* Announcement photos: the WHOLE image at its own shape on every screen size
   (no crop, no fixed height), not clickable, with a round download arrow. */
.ann-media { display: grid; gap: 10px; }
.ann-photo {
  position: relative; margin: 0; border-radius: 13px; overflow: hidden;
  border: 1px solid var(--line); background: #eef1f8; line-height: 0;
}
:root[data-theme="dark"] .ann-photo { background: rgba(255, 255, 255, .04); }
.ann-photo img {
  display: block; width: 100%; height: auto; max-height: none; object-fit: contain;
  -webkit-user-drag: none; user-select: none; cursor: default;
}
.ann-dl {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  color: #fff; background: rgba(15, 23, 42, .62); border: 1px solid rgba(255, 255, 255, .35);
  box-shadow: 0 4px 14px rgba(15, 23, 42, .25); backdrop-filter: blur(4px);
  transition: background .15s ease, transform .15s ease;
}
.ann-dl:hover { background: rgba(15, 23, 42, .82); transform: translateY(-1px); }
.ann-dl:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 4px var(--brand-500); }
.ann-dl.is-busy { opacity: .55; pointer-events: none; }

/* Today's menu banner follows the kitchen (2026-10-05):
   serving = warm band + steaming pot (unchanged), preparing (1h 30m before a
   meal) = amber band + chef, sizzling pan and flame, closed = night band +
   swinging "Kitchen closed" sign, moon, stars and a sleeping plate. Same art on
   phones, tablets, laptops and the installed app; motion off for reduced-motion. */
.fd-hero-band.is-preparing { background: linear-gradient(120deg, #fbbf24 0%, #f97316 45%, #dc2626 100%); background-size: 220% 220%; }
.fd-hero-band.is-closed    { background: linear-gradient(120deg, #0f172a 0%, #1e3a8a 55%, #4338ca 100%); background-size: 220% 220%; }
.fd-hero-band.is-closed::before { background: radial-gradient(circle, rgba(165, 180, 252, .35), rgba(165, 180, 252, 0) 70%); }
.fd-status { max-width: 34em; }
.fd-status b { color: #fff; font-weight: 800; }

/* preparing */
.fd-hero-art.is-preparing .fd-float { animation: fdToss 2.6s ease-in-out infinite; }
.fd-float.k1 { right: 30%; top: 14px; font-size: 24px; animation-delay: -.4s; }
.fd-float.k2 { right: 17%; top: 8px; font-size: 22px; animation-delay: -1.3s; }
.fd-float.k3 { right: 4%; top: 14px; font-size: 20px; animation-delay: -2s; }
.fd-float.k4 { right: 25%; top: 58px; font-size: 18px; animation-delay: -.9s; opacity: .9; }
.fd-chef { position: absolute; right: 22%; bottom: 26px; font-size: 50px; line-height: 1; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .25)); animation: fdNod 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
.fd-pan { position: absolute; right: 5%; bottom: 30px; font-size: 42px; line-height: 1; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .25)); animation: fdSizzle .9s ease-in-out infinite; transform-origin: 20% 80%; }
.fd-pan i { position: absolute; bottom: 85%; width: 5px; height: 16px; border-radius: 6px; background: rgba(255, 255, 255, .8); filter: blur(1.5px); opacity: 0; animation: fdSteam 2s ease-in infinite; }
.fd-pan .s1 { left: 40%; }
.fd-pan .s2 { left: 62%; animation-delay: 1s; height: 20px; }
.fd-pan .fl { position: absolute; left: 50%; top: 88%; margin-left: -.32em; font-size: 22px; animation: fdFlame .5s ease-in-out infinite alternate; transform-origin: 50% 100%; }

/* closed */
.fd-moon { position: absolute; right: 31%; top: 12px; font-size: 26px; line-height: 1; filter: drop-shadow(0 0 12px rgba(253, 230, 138, .65)); animation: fdBob 7s ease-in-out infinite; }
.fd-star { position: absolute; color: #fde68a; font-size: 11px; line-height: 1; animation: fdTwinkle 2.4s ease-in-out infinite; }
.fd-star.t1 { right: 40%; top: 46px; }
.fd-star.t2 { right: 26%; top: 54px; animation-delay: .8s; font-size: 9px; }
.fd-star.t3 { right: 3%; bottom: 64px; animation-delay: 1.6s; }
.fd-sign { position: absolute; right: 6%; top: 0; display: flex; flex-direction: column; align-items: center; transform-origin: 50% 0; animation: fdSwing 3.6s ease-in-out infinite; }
.fd-sign-str { width: 46px; height: 18px; border: 2px solid rgba(255, 255, 255, .7); border-bottom: 0; border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: transparent; position: relative; }
.fd-sign-str::after { content: ""; position: absolute; left: 50%; top: -3px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #e2e8f0; }
.fd-sign-board {
  margin-top: -1px; padding: 6px 10px; border-radius: 9px; text-align: center;
  font-size: 11px; font-weight: 800; line-height: 1.15; letter-spacing: .05em; text-transform: uppercase;
  color: #b91c1c; background: #fff7ed; border: 2px solid #fecaca; box-shadow: 0 8px 18px rgba(0, 0, 0, .3);
}
.fd-plate { position: absolute; right: 22%; bottom: 30px; font-size: 34px; line-height: 1; opacity: .92; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); }
.fd-zz { position: absolute; right: 20%; bottom: 66px; color: #c7d2fe; font-weight: 800; font-size: 13px; line-height: 1; opacity: 0; animation: fdZz 3s ease-in infinite; }
.fd-zz.z2 { animation-delay: 1s; font-size: 15px; }
.fd-zz.z3 { animation-delay: 2s; font-size: 18px; }

/* meal badge while its food is being prepared */
.fd-phase.is-prep { background: rgba(245, 158, 11, .16); color: #b45309; }
.fd-phase.is-prep i { animation: fdPulse 1.2s ease-out infinite; }
:root[data-theme="dark"] .fd-phase.is-prep { color: #fbbf24; background: rgba(245, 158, 11, .2); }
.fd-tile.is-next .fd-tile-name small { white-space: normal; }
.fd-tile-name small { white-space: normal; }

@keyframes fdToss { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-12px) rotate(25deg); } }
@keyframes fdNod { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-5deg) translateY(-2px); } }
@keyframes fdSizzle { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-7deg) translateX(-2px); } 60% { transform: rotate(4deg); } }
@keyframes fdFlame { from { transform: scale(.85, .8); opacity: .8; } to { transform: scale(1.1, 1.15); opacity: 1; } }
@keyframes fdTwinkle { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes fdSwing { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes fdZz { 0% { opacity: 0; transform: translate(0, 6px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(14px, -26px); } }

@media (min-width: 760px) {
  .fd-chef { font-size: 74px; right: 21%; }
  .fd-pan { font-size: 58px; }
  .fd-pan .fl { font-size: 28px; }
  .fd-float.k1, .fd-float.k2 { font-size: 32px; }
  .fd-float.k3, .fd-float.k4 { font-size: 26px; }
  .fd-moon { font-size: 40px; right: 30%; }
  .fd-star { font-size: 14px; }
  .fd-sign-board { font-size: 14px; padding: 8px 14px; }
  .fd-sign-str { width: 60px; height: 24px; }
  .fd-plate { font-size: 48px; }
  .fd-zz { bottom: 86px; font-size: 16px; }
  .fd-zz.z3 { font-size: 22px; }
}
@media (max-width: 380px) {
  .fd-chef { font-size: 40px; right: 24%; }
  .fd-pan { font-size: 34px; }
  .fd-sign-board { font-size: 11px; padding: 5px 8px; }
  .fd-moon { right: 33%; }
}
@media (prefers-reduced-motion: reduce) {
  .fd-chef, .fd-pan, .fd-pan i, .fd-pan .fl, .fd-moon, .fd-star, .fd-sign, .fd-zz,
  .fd-hero-art.is-preparing .fd-float, .fd-phase.is-prep i { animation: none !important; }
  .fd-zz, .fd-pan i { opacity: 0; }
}

/* Kitchen closed, two scenes (owner 2026-10-06): NIGHT (after dinner until
   breakfast prep) keeps the moon and stars; DAY (after breakfast, after lunch)
   is a calm daytime band with a plate being scrubbed, soap bubbles and sparkles.
   Both share a shop-style sign that flips between "Kitchen closed" and
   "Back at <time>". */
.fd-hero-band.is-closed.is-day { background: linear-gradient(120deg, #0369a1 0%, #0e7490 50%, #0f766e 100%); background-size: 220% 220%; }
.fd-hero-band.is-closed.is-day::before { background: radial-gradient(circle, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0) 70%); }

/* flip sign: both faces share one grid cell so the card fits the wider face */
.fd-sign { perspective: 500px; }
.fd-sign-card { display: grid; margin-top: -1px; transform-style: preserve-3d; animation: fdFlip 7s ease-in-out infinite; }
.fd-sign-card > .fd-sign-board { grid-area: 1 / 1; margin-top: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fd-sign-board.is-back { transform: rotateY(180deg); color: #0f766e; border-color: #99f6e4; background: #f0fdfa; }
.fd-hero-band.is-night .fd-sign-board.is-back { color: #3730a3; border-color: #c7d2fe; background: #eef2ff; }

/* day scene: plate + sponge scrubbing, bubbles rising and popping, sparkles */
.fd-wash { position: absolute; right: 24%; bottom: 28px; line-height: 1; }
.fd-dish { display: block; font-size: 40px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .28)); }
.fd-sponge { position: absolute; right: -14px; top: -6px; font-size: 24px; animation: fdScrub 1.1s ease-in-out infinite; transform-origin: 50% 80%; }
.fd-bub {
  position: absolute; bottom: 52px; width: 12px; height: 12px; border-radius: 50%; opacity: 0;
  border: 1.5px solid rgba(255, 255, 255, .85);
  background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, .9) 0 18%, rgba(255, 255, 255, .12) 30%, rgba(186, 230, 253, .18) 100%);
  animation: fdRise 4.2s ease-in infinite;
}
.fd-bub.b1 { right: 30%; animation-delay: 0s; }
.fd-bub.b2 { right: 25%; width: 18px; height: 18px; animation-delay: .9s; }
.fd-bub.b3 { right: 34%; width: 9px; height: 9px; animation-delay: 1.7s; }
.fd-bub.b4 { right: 21%; width: 14px; height: 14px; animation-delay: 2.5s; }
.fd-bub.b5 { right: 28%; width: 22px; height: 22px; animation-delay: 3.3s; }
.fd-spark { position: absolute; font-size: 15px; line-height: 1; animation: fdTwinkle 1.8s ease-in-out infinite; }
.fd-spark.p1 { right: 34%; bottom: 66px; }
.fd-spark.p2 { right: 19%; bottom: 30px; font-size: 12px; animation-delay: .9s; }

@keyframes fdFlip { 0%, 40% { transform: rotateY(0); } 50%, 90% { transform: rotateY(180deg); } 100% { transform: rotateY(360deg); } }
@keyframes fdScrub { 0%, 100% { transform: translate(0, 0) rotate(-8deg); } 50% { transform: translate(-16px, 6px) rotate(10deg); } }
@keyframes fdRise {
  0%   { opacity: 0; transform: translate(0, 0) scale(.6); }
  15%  { opacity: 1; }
  80%  { opacity: .95; transform: translate(-8px, -70px) scale(1); }
  90%  { opacity: 0; transform: translate(-9px, -78px) scale(1.5); }
  100% { opacity: 0; transform: translate(-9px, -78px) scale(1.5); }
}

@media (min-width: 760px) {
  .fd-dish { font-size: 56px; }
  .fd-sponge { font-size: 32px; right: -18px; }
  .fd-bub { bottom: 74px; }
  .fd-spark { font-size: 20px; }
  .fd-spark.p1 { bottom: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  .fd-sign-card, .fd-sponge, .fd-bub, .fd-spark { animation: none !important; }
  .fd-bub { opacity: .7; }
}

/* Kitchen closed between meals (owner 2026-10-06): a bright daytime sky. A
   glowing sun with slowly turning rays, a beam of sunlight sweeping across,
   clouds drifting past and light motes floating up. After dinner keeps the
   moon scene. */
.fd-hero-band.is-closed.is-day { background: linear-gradient(120deg, #0369a1 0%, #0284c7 45%, #38bdf8 100%); background-size: 220% 220%; }
.fd-hero-band.is-closed.is-day::before { background: radial-gradient(circle, rgba(254, 240, 138, .45), rgba(254, 240, 138, 0) 70%); }
.fd-shine {
  position: absolute; top: -40%; bottom: -40%; left: 0; width: 38%;
  background: linear-gradient(90deg, rgba(255, 251, 214, 0), rgba(255, 251, 214, .28) 50%, rgba(255, 251, 214, 0));
  transform: rotate(18deg) translateX(-140%); animation: fdBeam 7s ease-in-out infinite;
}
.fd-sun {
  position: absolute; right: 24%; bottom: 34px; width: 50px; height: 50px; border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #fffbe0 0%, #fde047 42%, #f59e0b 100%);
  box-shadow: 0 0 24px rgba(253, 224, 71, .85), 0 0 60px rgba(253, 224, 71, .5);
  animation: fdSunGlow 3.6s ease-in-out infinite;
}
.fd-sun::before {
  content: ""; position: absolute; inset: -20px; border-radius: 50%;
  background: repeating-conic-gradient(rgba(254, 240, 138, .75) 0 7deg, rgba(254, 240, 138, 0) 7deg 22.5deg);
  -webkit-mask: radial-gradient(circle, transparent 0 48%, #000 52% 66%, transparent 76%);
          mask: radial-gradient(circle, transparent 0 48%, #000 52% 66%, transparent 76%);
  animation: fdSpin 26s linear infinite;
}
.fd-cloud { position: absolute; height: 16px; width: 48px; border-radius: 20px; background: rgba(255, 255, 255, .95); filter: drop-shadow(0 6px 10px rgba(3, 105, 161, .25)); }
.fd-cloud::before, .fd-cloud::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.fd-cloud::before { width: 22px; height: 22px; left: 8px; top: -11px; }
.fd-cloud::after { width: 16px; height: 16px; left: 24px; top: -7px; }
.fd-cloud.c1 { right: 15%; bottom: 36px; animation: fdDrift 9s ease-in-out infinite alternate; }
.fd-cloud.c2 { right: 33%; top: 22px; transform: scale(.72); opacity: .75; animation: fdDrift2 12s ease-in-out infinite alternate; }
.fd-mote { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #fffbe0; box-shadow: 0 0 8px #fde68a; opacity: 0; animation: fdMote 5s ease-in infinite; }
.fd-mote.m1 { right: 30%; bottom: 30px; }
.fd-mote.m2 { right: 20%; bottom: 46px; animation-delay: 1.3s; }
.fd-mote.m3 { right: 36%; bottom: 58px; animation-delay: 2.5s; width: 4px; height: 4px; }
.fd-mote.m4 { right: 12%; bottom: 70px; animation-delay: 3.7s; }

@keyframes fdBeam { 0%, 25% { transform: rotate(18deg) translateX(-140%); } 75%, 100% { transform: rotate(18deg) translateX(320%); } }
@keyframes fdSunGlow { 0%, 100% { box-shadow: 0 0 22px rgba(253, 224, 71, .8), 0 0 54px rgba(253, 224, 71, .45); } 50% { box-shadow: 0 0 34px rgba(253, 224, 71, 1), 0 0 84px rgba(253, 224, 71, .6); } }
@keyframes fdSpin { to { transform: rotate(360deg); } }
@keyframes fdDrift { from { transform: translateX(0); } to { transform: translateX(-34px); } }
@keyframes fdDrift2 { from { transform: translateX(0) scale(.72); } to { transform: translateX(26px) scale(.72); } }
@keyframes fdMote { 0% { opacity: 0; transform: translate(0, 0); } 25% { opacity: .95; } 100% { opacity: 0; transform: translate(-14px, -60px); } }

@media (min-width: 760px) {
  .fd-sun { width: 68px; height: 68px; right: 23%; bottom: 40px; }
  .fd-sun::before { inset: -28px; }
  .fd-cloud.c1 { transform: scale(1.3); bottom: 44px; animation-name: fdDriftL; }
  .fd-cloud.c2 { top: 26px; right: 34%; }
}
@keyframes fdDriftL { from { transform: translateX(0) scale(1.3); } to { transform: translateX(-44px) scale(1.3); } }
@media (max-width: 380px) {
  .fd-sun { width: 42px; height: 42px; right: 22%; }
  .fd-sun::before { inset: -16px; }
}
@media (prefers-reduced-motion: reduce) {
  .fd-shine, .fd-sun, .fd-sun::before, .fd-cloud, .fd-mote { animation: none !important; }
  .fd-shine, .fd-mote { opacity: 0; }
}

/* ==========================================================================
   Free UPI payment sheet (Pay.upi in js/pages.js): app buttons on a phone,
   an amount-filled QR on a laptop / iPad, then "Did it go through?", the UTR
   form and the done screen. Phone first; wider screens just get more room.
   ========================================================================== */
.upi { display: grid; gap: 14px; }
.upi-note { margin: 0; }
.upi-amount {
  display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; gap: 2px 12px;
  padding: 14px 16px; border-radius: var(--r);
  background: linear-gradient(135deg, var(--brand-50), #fff); border: 1px solid var(--brand-100);
}
.upi-amount-k { grid-column: 1; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.upi-amount-v { grid-column: 1; font-size: 30px; line-height: 1.1; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.upi-amount-for { grid-column: 1; font-size: 13px; color: var(--muted); }
.upi-month { grid-column: 1; display: flex; flex-direction: column; gap: 4px; margin: 10px 0 0; }
@media (min-width: 560px) {
  .upi-amount { grid-template-columns: minmax(0, 1fr) auto; }
  .upi-month { grid-column: 2; grid-row: 1 / span 3; margin: 0; align-self: center; }
}
.upi-month > span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.upi-month .select { min-height: 40px; min-width: 150px; }
.upi-to {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
}
.upi-to-k { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.upi-to-v { display: flex; flex-direction: column; min-width: 0; flex: 1 1 160px; }
.upi-to-v b { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.upi-vpa { font-size: 12.5px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.upi-to .btn { min-height: 38px; }
.upi-h { margin: 2px 0 -4px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
/*
 * Compact pay-with-app row. Previously a 2-column grid of square-ish cards
 * (min-height 84px on phone, stacked logo-over-label) that read as oversized
 * tiles next to the rest of this sheet's compact rows. Each app's wordmark
 * logo is already a wide horizontal lockup (PhonePe/Google Pay/Paytm/UPI are
 * all 3:1 to 5.6:1 aspect ratio), so a single-row pill - logo on the left,
 * a chevron on the right, fixed modest height - fits that artwork naturally
 * and keeps every row the same compact size instead of ballooning to fit a
 * stacked layout the logos never needed.
 */
.upi-apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.upi-app {
  display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14.5px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.upi-app:hover { border-color: var(--brand-100); box-shadow: 0 4px 14px rgba(15, 23, 42, .08); }
.upi-app:active { transform: scale(.98); }
.upi-app:focus-visible { outline: 3px solid var(--brand-600); outline-offset: 2px; }
/* Official logos: a white face in BOTH themes (the brand artwork is made for white). */
.upi-app { background: #fff; color: #334155; }
.upi-app-logo { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: flex-start; height: 18px; }
.upi-app-logo img { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
.upi-app.is-phonepe .upi-app-logo { height: 19px; }
.upi-app.is-gpay .upi-app-logo { height: 14px; }
.upi-app.is-paytm .upi-app-logo { height: 15px; }
.upi-app.is-other .upi-app-logo { flex: none; height: 15px; }
.upi-app-name { flex: 1; min-width: 0; line-height: 1.2; font-size: 12.5px; color: #475569; }
.upi-app-go { color: #94a3b8; font-size: 17px; }
.upi-hint { margin: -4px 0 0; font-size: 13px; color: #92400e; background: #fef3c7; border: 1px solid #fde68a; border-radius: 10px; padding: 8px 12px; }
.upi-qr { display: grid; justify-items: center; gap: 10px; text-align: center; }
/* The branded QR card: navy frame, PG name header, scannable matrix on white,
   amount chip and payee footer. The matrix itself (.upi-qrcard-matrix svg) is
   left pure black-on-white so every UPI app reads it. */
/*
 * Fixed deep-navy brand colours, NOT var(--brand-800)/var(--brand-900).
 * Those two tokens are redefined for dark mode (to light lavender shades
 * suited for TEXT on a dark background - see :root[data-theme="dark"]
 * further down) and this card picked them up by accident: in dark mode the
 * "branded navy card" look turned into a pale lavender card that read as
 * broken next to everything else, which stays a deep card in both themes
 * (the rent-due hero uses the same fixed-colour approach for the same
 * reason). Hardcoding the two colours here keeps this card's look identical
 * in light and dark, which is what it always visually was before dark mode
 * accidentally repainted it.
 */
.upi-qrcard {
  width: min(300px, 82vw);
  background: linear-gradient(165deg, #1b2e78, #14225c);
  border-radius: 20px; padding: 16px 16px 14px;
  box-shadow: 0 14px 36px -14px rgba(20, 34, 92, .7);
  display: grid; gap: 12px; color: #fff;
}
.upi-qrcard-top { display: flex; align-items: center; justify-content: center; gap: 9px; }
.upi-qrcard-badge {
  width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 17px; font-weight: 800;
}
.upi-qrcard-brand { font-size: 16.5px; font-weight: 800; letter-spacing: .01em; line-height: 1.2; }
.upi-qrcard-matrix {
  width: 100%; aspect-ratio: 1; padding: 12px; background: #fff;
  border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06);
}
.upi-qrcard-matrix svg { display: block; width: 100%; height: 100%; }
.upi-qrcard-amt {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
}
.upi-qrcard-amt span { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: #c9d6ff; }
.upi-qrcard-amt b { font-size: 24px; font-weight: 800; color: #fff; }
.upi-qrcard-foot { font-size: 12.5px; color: #c9d6ff; overflow-wrap: anywhere; }
.upi-qr-cap { margin: 0; font-size: 13.5px; color: var(--muted); max-width: 34ch; }
.upi-more { border: 1px dashed var(--line); border-radius: var(--r); padding: 4px 12px; }
.upi-more > summary { cursor: pointer; padding: 8px 0; font-size: 13.5px; font-weight: 700; color: var(--brand-700); list-style: none; }
.upi-more > summary::-webkit-details-marker { display: none; }
.upi-more > summary::after { content: " \25BE"; }
.upi-more[open] > summary::after { content: " \25B4"; }
.upi-more[open] { padding-bottom: 14px; }
.upi-more .upi-apps { margin-top: 4px; }
.upi-safe {
  display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted);
  padding: 10px 12px; border-radius: 10px; background: var(--brand-50);
}
.upi-paid { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.upi-paid .btn { min-height: 40px; }
.upi-back, .upi-done { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 6px 0 2px; }
.upi-back h3, .upi-done h3 { margin: 0; font-size: 20px; color: var(--ink); }
.upi-back p, .upi-done p { margin: 0; color: var(--muted); font-size: 14.5px; max-width: 40ch; }
.upi-back-ic { font-size: 40px; line-height: 1; }
.upi-back-acts { display: grid; gap: 10px; width: 100%; margin-top: 6px; }
.upi-back-acts .btn { min-height: 48px; font-size: 15.5px; }
.upi-small { font-size: 12.5px !important; }
.upi-done-ic {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok-100); color: var(--ok-700); font-size: 32px; font-weight: 800;
  animation: upiPop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes upiPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.upi-next { text-align: left; margin: 6px 0 8px; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; color: var(--muted); max-width: 44ch; }
.upi-next b { color: var(--ink); }
.upi-done .btn { min-height: 48px; }
.upi-form { display: grid; gap: 4px; }
.upi-form .field { margin: 0 0 10px; }
.upi-form .btn { min-height: 48px; }
.upi-form .btn + .btn { margin-top: 6px; }
.upi-sum {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px;
  padding: 10px 14px; border-radius: var(--r); background: var(--brand-50); color: var(--muted); font-size: 13.5px;
}
.upi-sum b { font-size: 18px; color: var(--ink); }
.upi-utr { font-size: 18px; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .upi-done-ic { animation: none; } .upi-app { transition: none; } }
/*
 * Phones: a tidy 2x2 grid of compact horizontal pills - same row layout as
 * the base rule above, just slightly smaller so four of them read as one
 * calm block rather than four separate big tiles. Every logo is a wide
 * horizontal wordmark by design (see UPI_APPS in pages.js), so a short fixed
 * row height holds all four consistently without squeezing any one of them.
 */
@media (max-width: 699px) {
  .upi-apps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .upi-app { height: 44px; padding: 0 10px; gap: 7px; }
  .upi-app-logo { height: 16px; }
  .upi-app.is-phonepe .upi-app-logo { height: 17px; }
  .upi-app.is-gpay .upi-app-logo { height: 13px; }
  .upi-app.is-paytm .upi-app-logo { height: 14px; }
  .upi-app.is-other .upi-app-logo { height: 14px; }
  .upi-app-name { font-size: 12px; }
  .upi-app-go { display: none; }
}
/* Very narrow phones (<=360px): a touch less padding so two pills still fit
   comfortably without the logos touching the card edges. */
@media (max-width: 360px) {
  .upi-apps { gap: 6px; }
  .upi-app { padding: 0 8px; height: 42px; }
}
@media (max-width: 559px) {
  .upi-month .select { width: 100%; }
  .upi-to .btn { margin-left: auto; }
}
/*
 * Desktop/tablet (>=700px): more width to spend, so all four pills fit in one
 * row instead of two - but still the same compact horizontal pill as every
 * other width, not the old vertical-stacked min-height:96px tile. That tile
 * size was the "became very very huge" complaint: four 96px-tall square
 * cards in a row looked oversized next to the rest of this sheet's compact
 * rows (the "Paying to" chip, the amount field) once there was room to make
 * them wide AND tall at the same time.
 */
@media (min-width: 700px) {
  .upi-apps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .upi-app { height: 48px; padding: 0 12px; }
  .upi-qrcard { width: 300px; }
}
:root[data-theme="dark"] .upi-amount { background: linear-gradient(135deg, rgba(99, 102, 241, .16), rgba(15, 23, 42, .2)); border-color: rgba(129, 140, 248, .3); }
:root[data-theme="dark"] .upi-safe, :root[data-theme="dark"] .upi-sum { background: rgba(99, 102, 241, .12); }
:root[data-theme="dark"] .upi-hint { color: #fde68a; background: rgba(245, 158, 11, .14); border-color: rgba(245, 158, 11, .35); }
:root[data-theme="dark"] .upi-app { box-shadow: none; background: #fff; border-color: rgba(255, 255, 255, .9); }
:root[data-theme="dark"] .upi-app:hover { border-color: #c7d2fe; }

/* UPI sheet: fixed "Date paid: today" line. */
.upi-date { margin: 2px 0 12px; font-size: 13px; color: var(--muted); }
.upi-date b { color: var(--ink); }

/*
 * iOS Safari gives <input type="date"> an intrinsic width wider than a phone
 * column, so it pokes out of the form card. Keep every date input inside its box.
 */
input[type="date"].input {
  display: block; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box;
  -webkit-appearance: none; appearance: none; text-align: left;
}
input[type="date"].input::-webkit-date-and-time-value { text-align: left; }

/* ID proof & agreement sheet (tenant) */
.card-lite { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--card); }
.card-lite + .card-lite { margin-top: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.agree-box { margin-top: 10px; max-height: min(60vh, 460px); overflow-y: auto; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; background: var(--line-soft); font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }
.agree-box ul,
.agree-box ol { margin: 8px 0 0; padding-left: 18px; }
.agree-box li { margin: 6px 0; }

/* ===========================================================================
   Payment progress: Submitted / Verifying / Confirmed.
   =========================================================================== */
.paytl { list-style: none; margin: 14px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.paytl li { position: relative; text-align: center; padding: 0 4px; min-width: 0; }
.paytl li::before { /* connector to the previous step */
  content: ''; position: absolute; top: 9px; left: -50%; right: 50%; height: 2px;
  background: currentColor; opacity: .22;
}
.paytl li:first-child::before { display: none; }
.paytl li.done::before, .paytl li.now::before, .paytl li.bad::before { opacity: .7; }
.paytl .dot {
  position: relative; z-index: 1; display: block; width: 20px; height: 20px; margin: 0 auto 6px;
  border-radius: 50%; border: 2px solid currentColor; background: transparent; opacity: .5;
}
.paytl li.done .dot { background: currentColor; opacity: 1; }
.paytl li.done .dot::after {
  content: ''; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
  border: solid var(--paytl-tick, #fff); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.paytl li.now .dot { opacity: 1; animation: paytl-pulse 1.6s ease-in-out infinite; }
.paytl li.bad .dot { opacity: 1; border-color: var(--bad-700); background: var(--bad-700); }
.paytl .lbl { display: block; font-size: 13px; font-weight: 700; line-height: 1.25; }
.paytl .sub { display: block; font-size: 11.5px; opacity: .75; margin-top: 2px; overflow-wrap: anywhere; }
.paytl li.todo .lbl, .paytl li.todo .sub { opacity: .55; }
@keyframes paytl-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(120,140,255,.55); } 50% { box-shadow: 0 0 0 6px rgba(120,140,255,0); } }
@media (prefers-reduced-motion: reduce) { .paytl li.now .dot { animation: none; } }
/* On the coloured hero the text is white; tick colour follows the hero. */
.due .paytl { --paytl-tick: #0b1230; margin-top: 4px; }
.due .paytl li.done .dot { background: #fff; }
.due .paytl li.bad .dot { background: #fff; border-color: #fff; }

/* Home: notifications card and monthly feedback card. */
.pushrow { display: flex; align-items: center; gap: 12px; }
.pushrow .grow { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pushrow .grow b { color: var(--ink); }
.pushic { font-size: 22px; flex: none; }
.fbrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.fbl { font-weight: 600; color: var(--ink); min-width: 0; }
.fbstars { display: inline-flex; gap: 2px; flex: none; }
.fbstar {
  border: 0; background: transparent; cursor: pointer; font-size: 30px; line-height: 1;
  color: var(--line); padding: 4px 3px; min-width: 40px; min-height: 40px;
}
.fbstar.is-on { color: #f5a524; }
.fbstar:focus-visible { outline: 3px solid var(--brand-500); outline-offset: 1px; border-radius: 8px; }

/* Food: "eat after all" form. */
.fbk-meals { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 4px; }
.fbk-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* Background scroll guard (CSS) - phones and installed apps only. A form and the
   filter/profile sheets must not hand their scroll to the page behind when
   they reach their end. Scoped so desktop and laptop windows behave exactly as before. */
@media (max-width: 820px), (display-mode: standalone) {
  .modal-body, .modal-root { overscroll-behavior: contain; }
}
/* in-app mirror of the display-mode: standalone block above */
:where(html[data-in-app]) .modal-body,
:where(html[data-in-app]) .modal-root {
  overscroll-behavior: contain;
}

/* Report a problem while reporting is locked: still tappable, so the reason can be shown. */
.btn.is-locked { opacity: .6; filter: grayscale(.4); }

/* Problems page: two equal tabs (Report a problem / Request a service). Reuses .chip. */
.help-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.help-tabs .chip { width: 100%; justify-content: center; text-align: center; white-space: normal; line-height: 1.2; min-height: 40px; }

/* Problems page tabs: keep the chip centred. */
.help-tabs .chip { display: flex; align-items: center; justify-content: center; gap: 6px; }

/* ===========================================================================
   PG Buddy: the floating button, the nudge, the chat window and the tour.
   Warm saffron / coral look; the logo is a blue chat bubble with an S.
   Phones get a bottom sheet; tablets and computers get a docked chat window.
   =========================================================================== */
/* The logo: a blue circle (this wrapper) with the white bubble drawn on it. Used at several sizes. */
.bot-ava {
  display: inline-grid; place-items: center; flex: none; border-radius: 50%; overflow: visible;
  background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
}
.bot-ava svg { width: 100%; height: 100%; display: block; }
.bot-ava-fab { width: 58px; height: 58px; position: relative; z-index: 1; animation: pgb-float 3.6s ease-in-out infinite; }
.bot-ava-head { width: 40px; height: 40px; }
.bot-ava-sm { width: 28px; height: 28px; box-shadow: none; }
@keyframes pgb-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ------------------------------ floating button ------------------------------ */
.chat-fab {
  position: fixed; z-index: 45; display: grid; place-items: center;
  right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  width: 58px; height: 58px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chat-fab:focus-visible { outline: 3px solid #ff8a4c; outline-offset: 4px; }
.chat-fab:active .bot-ava-fab { transform: scale(.94); animation: none; }
.chat-fab-ring {
  position: absolute; inset: 0; border-radius: 50%; z-index: 0;
  background: rgba(37, 99, 235, .4); animation: pgb-pulse 2.6s ease-out infinite;
}
.chat-fab-dot {
  position: absolute; right: 2px; top: 2px; z-index: 2; width: 14px; height: 14px; border-radius: 50%;
  background: #22c55e; border: 2.5px solid var(--card, #fff);
}
@keyframes pgb-pulse { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(1.7); opacity: 0; } }
/* Out of the way whenever a sheet, menu or the chat window itself is open. */
body.scroll-locked .chat-fab { display: none; }

/* ----------------------------------- nudge ----------------------------------- */
.chat-nudge {
  position: fixed; z-index: 46; width: min(300px, calc(100vw - 32px));
  right: max(16px, env(safe-area-inset-right)); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 70px);
  background: #fff8f0; color: #3b2a1d; border: 1px solid #ffd9bd; border-radius: 16px 16px 4px 16px;
  box-shadow: 0 14px 34px rgba(120, 60, 20, .22);
  opacity: 0; transform: translateY(12px) scale(.96); transform-origin: bottom right;
  transition: opacity .28s ease, transform .28s cubic-bezier(.34, 1.56, .64, 1);
}
.chat-nudge.is-in { opacity: 1; transform: none; }
.chat-nudge-body {
  display: grid; gap: 3px; width: 100%; text-align: left; padding: 13px 38px 13px 14px;
  background: transparent; border: 0; cursor: pointer; color: inherit; font: inherit;
}
.chat-nudge-body b { font-size: 14.5px; }
.chat-nudge-body span { font-size: 13px; color: #7a6350; line-height: 1.4; }
.chat-nudge-x {
  position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: transparent; color: #7a6350; font-size: 22px; line-height: 1; cursor: pointer; z-index: 1;
}
.chat-nudge-x:hover { background: #ffe9d6; }
body.scroll-locked .chat-nudge { display: none; }

/*
 * Below the 1000px rail breakpoint, the tab bar is fixed to the bottom of the
 * screen (see .tabbar earlier in this file) and would otherwise sit directly
 * under - and overlap the bottom edge of - the floating PG Buddy button and
 * its nudge bubble. Lift both by the bar's height so Buddy floats clear of it,
 * exactly as before the bottom bar existed. At >=1000px the tab bar is the
 * side rail again (not fixed to the bottom), so Buddy's original position
 * (plain 16px / 86px off the bottom corner) is restored there.
 */
@media (max-width: 999px) {
  .chat-fab { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); }
  .chat-nudge { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 84px); }
}

/* -------------------------------- the chat window ---------------------------- */
.chat-shade { position: fixed; inset: 0; z-index: 109; background: rgba(40, 20, 8, .45); opacity: 0; transition: opacity .2s ease; }
.chat-shade.is-in { opacity: 1; }
.chat-panel {
  position: fixed; z-index: 110; display: flex; flex-direction: column;
  background: #fff8f0; color: #3b2a1d; overflow: hidden;
  opacity: 0; transition: opacity .2s ease, transform .26s cubic-bezier(.2, .9, .3, 1);
}
.chat-panel.is-in { opacity: 1; transform: none; }
/* Phone: a sheet rising from the bottom, kept above the on-screen keyboard. */
@media (max-width: 699px) {
  .chat-panel {
    left: 0; right: 0; bottom: var(--chat-kb, 0px);
    height: min(88vh, var(--chat-vh, 100vh), 680px); height: min(88dvh, var(--chat-vh, 100dvh), 680px);
    border-radius: 20px 20px 0 0; box-shadow: 0 -12px 40px rgba(40, 20, 8, .3);
    padding-bottom: env(safe-area-inset-bottom); transform: translateY(40px);
  }
}
/* Tablet and computer: a window docked at the corner; the page behind stays still. */
@media (min-width: 700px) {
  .chat-panel {
    right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
    width: min(400px, calc(100vw - 40px)); height: min(640px, calc(100vh - 40px));
    border-radius: 22px; border: 1px solid #ffe0c7; box-shadow: 0 24px 60px rgba(40, 20, 8, .34);
    transform: translateY(16px) scale(.96); transform-origin: bottom right;
  }
  .chat-shade { background: rgba(40, 20, 8, .22); }
}
.chat-head {
  display: flex; align-items: center; gap: 11px; padding: 12px 12px 12px 14px; flex: none; color: #fff;
  background: linear-gradient(120deg, #ffb347 0%, #ff6a3d 100%);
}
.chat-head .bot-ava-head { box-shadow: 0 0 0 2.5px #fff; }
.chat-head-t { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.chat-head-t b { font-size: 16.5px; }
.chat-head-t small { font-size: 12px; opacity: .95; display: flex; align-items: center; gap: 6px; }
.bot-online { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, .7); animation: pgb-online 2s infinite; }
@keyframes pgb-online { 70% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
.chat-icon-btn {
  width: 38px; height: 38px; flex: none; border: 0; border-radius: 50%; cursor: pointer; color: #fff; font-size: 21px; line-height: 1;
  background: rgba(255, 255, 255, .22);
}
.chat-icon-btn:hover { background: rgba(255, 255, 255, .36); }
.chat-icon-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.chat-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 14px 12px 8px; background: #fff8f0; }
.bot-log { display: flex; flex-direction: column; gap: 10px; transition: opacity .2s ease, transform .2s ease; }
.bot-log.is-clearing { opacity: 0; transform: translateY(8px); }
.bot-row { display: flex; align-items: flex-end; gap: 8px; animation: pgb-pop .28s cubic-bezier(.34, 1.4, .64, 1) both; }
.bot-row.me { justify-content: flex-end; }
@keyframes pgb-pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.bot-msg { max-width: 84%; padding: 9px 12px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.bot-msg.bot { background: #fff; color: #3b2a1d; border: 1px solid #ffd9bd; border-bottom-left-radius: 5px; }
.bot-msg.me { background: linear-gradient(135deg, #ff9a3c, #ff5e62); color: #fff; border-bottom-right-radius: 5px; }
.bot-msg.is-typing { cursor: pointer; }
.bot-msg.is-typing::after { content: ''; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: currentColor; animation: pgb-caret .7s steps(1) infinite; }
@keyframes pgb-caret { 50% { opacity: 0; } }
.bot-typing { display: inline-flex; gap: 5px; align-items: center; padding: 13px 14px; }
.bot-typing i { width: 7px; height: 7px; border-radius: 50%; background: #ff8a4c; animation: pgb-dot 1s ease-in-out infinite; }
.bot-typing i:nth-child(2) { animation-delay: .15s; }
.bot-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes pgb-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }
.bot-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 4px 36px; }
.bot-chips .chip { white-space: normal; text-align: left; border: 1.5px solid #ff8a4c; color: #d9531e; background: #fff; border-radius: 999px; }
.bot-chips .chip:hover { background: #ffefe3; border-color: #ff6a3d; }
.chip-in { animation: pgb-chip .3s ease both; }
@keyframes pgb-chip { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bot-form { display: flex; gap: 8px; padding: 10px 12px 12px; flex: none; border-top: 1px solid #ffe0c7; background: #fff; }
.bot-form .input { flex: 1; min-width: 0; font-size: 16px; border-radius: 999px; padding-left: 16px; background: #fffaf5; border-color: #ffd9bd; }
.bot-form .input:focus { border-color: #ff8a4c; box-shadow: 0 0 0 3px rgba(255, 138, 76, .2); outline: none; }
.bot-form .btn { flex: none; border-radius: 999px; padding-left: 18px; padding-right: 18px; background: linear-gradient(135deg, #ff9a3c, #ff5e62); border-color: transparent; color: #fff; }

/* Dark theme: the same warm colours, deepened. */
:root[data-theme="dark"] .chat-panel, :root[data-theme="dark"] .chat-body { background: #1f1812; color: #f3e7da; }
:root[data-theme="dark"] .chat-panel { border-color: #4a3626; }
:root[data-theme="dark"] .bot-msg.bot { background: #2a2119; color: #f3e7da; border-color: #4a3626; }
:root[data-theme="dark"] .bot-chips .chip { background: #2a2119; color: #ffb27a; border-color: #b4642f; }
:root[data-theme="dark"] .bot-chips .chip:hover { background: #3a2a1d; }
:root[data-theme="dark"] .bot-form { background: #1a140f; border-top-color: #4a3626; }
:root[data-theme="dark"] .bot-form .input { background: #2a2119; color: #f3e7da; border-color: #4a3626; }
:root[data-theme="dark"] .chat-nudge { background: #2a2119; color: #f3e7da; border-color: #4a3626; }
:root[data-theme="dark"] .chat-nudge-body span, :root[data-theme="dark"] .chat-nudge-x { color: #c9b29b; }

/* ------------------------------------ tour ----------------------------------- */
.tour-shield { position: fixed; inset: 0; z-index: 150; touch-action: none; }
.tour-shield.is-dim { background: rgba(40, 20, 8, .62); }
.tour-spot {
  position: fixed; z-index: 151; pointer-events: none; border-radius: 14px; opacity: 0;
  box-shadow: 0 0 0 100vmax rgba(40, 20, 8, .62), 0 0 0 3px #fff, 0 0 0 7px rgba(255, 138, 76, .8);
  transition: left .35s ease, top .35s ease, width .35s ease, height .35s ease, opacity .25s ease;
  animation: pgb-glow 2s ease-in-out infinite;
}
@keyframes pgb-glow { 50% { box-shadow: 0 0 0 100vmax rgba(40, 20, 8, .62), 0 0 0 3px #fff, 0 0 0 11px rgba(255, 138, 76, .4); } }
.tour-card {
  position: fixed; z-index: 152; padding: 14px 16px 14px; border-radius: 18px;
  background: #fff8f0; color: #3b2a1d; border: 1px solid #ffd9bd;
  box-shadow: 0 20px 50px rgba(40, 20, 8, .42);
  opacity: 0; transform: translateY(10px); transition: opacity .25s ease, transform .25s ease, left .3s ease, top .3s ease;
}
.tour-card.is-in { opacity: 1; transform: none; }
.tour-card.is-swap { opacity: .0; transform: translateY(6px); }
.tour-top { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.tour-count { font-size: 12px; font-weight: 700; color: #7a6350; flex: 1; }
.tour-skip { border: 0; background: transparent; color: #7a6350; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 6px 4px; }
.tour-skip:hover { color: #3b2a1d; text-decoration: underline; }
.tour-card h4 { margin: 0 0 4px; font-size: 16.5px; }
.tour-card p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: #5b4636; }
.tour-bar { height: 4px; border-radius: 4px; background: #ffe3cf; overflow: hidden; margin-bottom: 12px; }
.tour-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #ffb347, #ff5e62); transition: width .35s ease; }
.tour-btns { display: flex; gap: 8px; justify-content: flex-end; }
.tour-btns .btn { min-width: 84px; }
.tour-btns .btn-primary { background: linear-gradient(135deg, #ff9a3c, #ff5e62); border-color: transparent; color: #fff; }
.tour-btns .btn-ghost { background: #fff; border-color: #ffd9bd; color: #3b2a1d; }
.tour-btns .btn[hidden] { display: none; }
:root[data-theme="dark"] .tour-card { background: #2a2119; color: #f3e7da; border-color: #4a3626; }
:root[data-theme="dark"] .tour-card p { color: #d8c6b3; }
:root[data-theme="dark"] .tour-btns .btn-ghost { background: #1f1812; color: #f3e7da; border-color: #4a3626; }

/* Calm motion for anyone who asked their device for it. */
@media (prefers-reduced-motion: reduce) {
  .bot-ava-fab, .chat-fab-ring, .bot-online, .tour-spot, .bot-typing i, .bot-row, .chip-in { animation: none !important; }
  .chat-panel, .chat-nudge, .tour-card, .tour-spot { transition: none; }
}



/*
 * Leave room under the footer so the floating PG Buddy button never covers
 * the last line - 72px was sized for the FAB alone, from when the tenant
 * portal had a left sidebar and no fixed bottom chrome. Below the 1000px
 * rail breakpoint there is now ALSO the fixed tab bar sitting under the FAB
 * (see .chat-fab below), so this has to clear both stacked, not just the one.
 * At >=1000px the tab bar is the side rail again (not fixed to the bottom),
 * so the plain 72px is restored there.
 */
.app-copyright { padding-bottom: calc(72px + var(--tabbar-h) + env(safe-area-inset-bottom)); }
@media (min-width: 1000px) {
  .app-copyright { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
}

@media (min-width: 700px) { .chat-shade { background: rgba(10, 16, 40, .22); } }

/* The page behind the PG Buddy chat stays still. */
html.chat-open { overflow: hidden !important; }

/* Owner: the signed-in footer shows on desktop only - never on phones/tablets
   or in the installed app. */
@media (max-width: 999px), (display-mode: standalone) {
  .app-copyright { display: none !important; }
}
/* in-app mirror of the display-mode: standalone block above */
:where(html[data-in-app]) .app-copyright {
  display: none !important;
}

/* ---- Buttons and other tap targets are never selectable (owner rule 2026-10) ----
   Only real content (text on the page, inputs) can be selected or copied. Covers
   buttons, sidebar/bottom-bar items, menus, chips, tabs and link-styled buttons,
   on every browser, plus iOS (-webkit-touch-callout stops the long-press
   "Copy / Look up" bubble). Plain links inside text keep normal behaviour. */
button, [role="button"], [role="tab"], [role="menuitem"], [role="link"], [role="option"], [role="switch"],
input[type="button"], input[type="submit"], input[type="reset"], input[type="checkbox"], input[type="radio"],
summary, .btn, a[class*="btn"], .nav-item, .nav a, nav a, .tabbar a, .menu-item, .chip, .seg-btn, .home-btn, .nav-cta,
.theme-toggle, .page-kebab, .upi-kebab, .btn-kebab, .upd-toggle, [data-go], [data-pay], [data-action], [onclick] {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* Form fields inside those areas stay usable. */
input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]), textarea, [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* Android app (native WebView, <html data-in-app> set by the server). Owner
   rule 2026-10: it is an app, not a website, so there is NO header bar at all.
   On the sign-in screen the brand sits centred above the form instead (logo +
   "StayLedger" + PG name), matching the staff app's sign-in. */
html[data-in-app] .nav-cta { display: none !important; }
html[data-in-app] .nav-brand { pointer-events: none; cursor: default; }
html[data-in-app] .signin-page .nav { display: none !important; }
html[data-in-app] .signin-page { padding-top: env(safe-area-inset-top, 0px) !important; }
html[data-in-app] .signin-page .stage { padding-top: 24px; }
html[data-in-app] .signin-wordmark {
  display: flex !important; align-items: center; justify-content: center; gap: 11px;
  margin-bottom: 20px;
  animation: swDrop .6s cubic-bezier(.2, .9, .25, 1) both;
}
.signin-wordmark .sw-pg { display: none; }
html[data-in-app] .signin-wordmark .sw-login { display: none; }
html[data-in-app] .signin-wordmark .sw-pg { display: block; }

/* Android app: no overscroll bounce / drag-to-refresh feel at the page edges.
   On <html> ONLY - never <body>. body has overflow-x:hidden, so current Chrome /
   Android WebView treats it as its own scroll container, and overscroll-behavior
   on it swallowed EVERY touch scroll in the Android app (bug 2026-10-29: no page
   could scroll on WebView 13x+; reproduced with real touch input, control 0px vs
   fixed 401px). Same rule the staff app follows. */
html[data-in-app] { overscroll-behavior-y: none; }

/* Android app version line at the bottom of the Profile sheet. */
.sheet-foot.sheet-ver { margin-top: 4px; font-size: 12px; opacity: .8; }

/* App version + "What's new" (js/whatsnew.js) - same on Android, iPhone, website. */
.wn-link{border:0;background:none;padding:0;font:inherit;font-weight:700;color:var(--brand-600,#2563eb);cursor:pointer;text-decoration:underline;
         -webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.wn-upd{font-weight:700;color:#b45309}
.wn-list{margin:0;padding-left:20px;display:grid;gap:10px;font-size:14.5px;line-height:1.55}
.wn-note{margin:14px 0 0;padding:10px 12px;border-radius:10px;background:#fff7ed;color:#9a3412;font-size:13.5px}

/* Keyboard over the form (owner rule 2026-10-28; js/shared.js adds html.kb-open
   while typing in a page the keyboard shrank). Dialogs keep their full size and
   the keyboard covers their lower part instead of squeezing them. */
html.kb-open .modal-root { bottom: auto; height: var(--app-h); }
html.kb-open .modal { max-height: calc(var(--app-h) * .92) !important; transition: transform .15s ease; }
:where(html.kb-open[data-in-app]) .modal {
  max-height: calc(var(--app-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 32px) !important;
}
html.kb-open .tabbar { display: none !important; }
/* Room to scroll the last field up above the keyboard. */
/* Extra room at the bottom is added by js/shared.js only when a field really needs it
   (it used to be the whole keyboard height: a big white gap under short dialogs). */

/* iPhone "App notifications" switch in the Profile (js/shared.js PushAlerts.mountToggle). */
.pushtg { display: flex; align-items: center; gap: 12px; }
.pushtg .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.sl-switch { flex: none; position: relative; width: 51px; height: 31px; border: 0; padding: 0; border-radius: 999px;
  background: #cbd5e1; cursor: pointer; transition: background .18s ease;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.sl-switch span { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(15, 23, 42, .25); transition: transform .18s ease; }
.sl-switch[aria-checked="true"] { background: #22c55e; }
.sl-switch[aria-checked="true"] span { transform: translateX(20px); }
.sl-switch:disabled { opacity: .5; cursor: default; }
.sl-switch:focus-visible { outline: 2px solid var(--brand-600, #2563eb); outline-offset: 2px; }
.sheet-push[hidden], #pfPushToggle[hidden] { display: none !important; }
.sheet-push { cursor: default; }
.sheet-push .pushtg { width: 100%; }

/* Android App settings card (js/shared.js AppSettings). */
.appset { display: grid; gap: 14px; }
.appset-h { font-size: 15px; margin: 0; }
.appset-row + .appset-row { padding-top: 12px; border-top: 1px solid var(--line-soft); }
#pfAppSettings[hidden], #sheetAppSet[hidden] { display: none !important; }

/* Tenant ID (SSPG-TNT-YYYYMM-0001): profile sheet line + full-width tile in My room (2026-10-29). */
.sheet-head .sheet-tid { font-size: 12.5px; color: var(--muted); }
.sheet-tid code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; font-weight: 600;
  color: var(--ink-soft, var(--ink)); white-space: nowrap; background: none; padding: 0; }
.facts > .fact-wide { grid-column: 1 / -1; }
.facts .v.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; letter-spacing: .01em; overflow-wrap: anywhere; }

/* "Update available" card - Android apps only (js/whatsnew.js showCard, owner design 2026-10-31).
   Centred, compact, small logo on the left; outside taps do nothing. Fits 300 px phones up. */
.slupd{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:20px;
  padding-left:max(20px,env(safe-area-inset-left));padding-right:max(20px,env(safe-area-inset-right));animation:slupdIn .2s ease both}
.slupd.is-out{animation:slupdOut .18s ease forwards}
.slupd-veil{position:absolute;inset:0;background:rgba(11,18,48,.55);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
.slupd-card{position:relative;width:100%;max-width:340px;border-radius:20px;padding:16px 16px 14px;background:#fff;color:#16225c;
  box-shadow:0 20px 50px rgba(0,0,0,.35);animation:slupdPop .38s cubic-bezier(.2,.9,.3,1.2) both;font-family:inherit}
.slupd-top{display:flex;align-items:center;gap:12px}
.slupd-logo{position:relative;flex:none;width:40px;height:40px;border-radius:11px;background:center/cover no-repeat url(/img/update-logo.png);
  box-shadow:0 4px 10px rgba(27,47,134,.25)}
.slupd-logo i{position:absolute;right:-5px;top:-5px;width:17px;height:17px;border-radius:50%;background:#2fd8a6;border:2px solid #fff;
  display:flex;align-items:center;justify-content:center;animation:slupdHop 1.6s ease-in-out infinite}
.slupd-logo svg{width:9px;height:9px}
.slupd-txt{min-width:0;display:flex;flex-direction:column;gap:2px}
.slupd-txt b{font-size:15px;line-height:1.25;font-weight:700}
.slupd-txt span{font-size:12px;line-height:1.4;color:#5a6687}
.slupd-txt strong{color:inherit;font-weight:700}
.slupd-btns{display:flex;gap:10px;margin-top:14px}
.slupd-btns button{flex:1;min-width:0;height:36px;border-radius:999px;font:600 12.5px/1 inherit;letter-spacing:.2px;cursor:pointer;
  -webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:transform .12s ease}
.slupd-btns button:active{transform:scale(.97)}
.slupd-later{background:transparent;color:#3b4a6b;border:1.5px solid #d3d9ea}
.slupd-go{border:1.5px solid transparent;color:#fff;
  background:linear-gradient(135deg,#4a74f0,#2b4fc7) padding-box,linear-gradient(135deg,#7fa0ff,#2fd8a6) border-box;box-shadow:0 6px 14px rgba(43,79,199,.30)}
:root[data-theme="dark"] .slupd-card{background:#161d36;color:#e8ecff}
:root[data-theme="dark"] .slupd-txt span{color:#a9b3d6}
:root[data-theme="dark"] .slupd-logo i{border-color:#161d36}
:root[data-theme="dark"] .slupd-later{color:#c9d2f0;border-color:#36406a}
html.slupd-open{overflow:hidden}
@media (max-width:330px){.slupd{padding:14px}.slupd-card{padding:14px 12px 12px}.slupd-btns{gap:8px}}
@keyframes slupdIn{from{opacity:0}}
@keyframes slupdOut{to{opacity:0}}
@keyframes slupdPop{from{transform:scale(.88);opacity:0}}
@keyframes slupdHop{50%{transform:translateY(-3px)}}
@media (prefers-reduced-motion:reduce){.slupd,.slupd-card,.slupd-logo i{animation:none}}
/* ==========================================================================
   Problems page, WEBSITE view only (>=1000px, owner-approved 2026-11-02).
   Both tabs share one layout: a compact tab switch, then one action card
   (icon, what it is for, today's counts, button on the right). Phones and the
   Android/iPhone apps keep their layout: .pa-intro is hidden below 1000px.
   ========================================================================== */
.pa-intro { display: none; }
@media (min-width: 1000px) {
  body:not(.staff-console) .help-tabs {
    display: inline-grid; grid-template-columns: auto auto; gap: 4px; padding: 4px;
    background: var(--card); border: 1px solid var(--line); border-radius: 999px; margin: 0 0 16px;
  }
  body:not(.staff-console) .help-tabs .chip {
    width: auto; min-height: 38px; padding: 0 20px; border: 0; border-radius: 999px;
    font-size: 14px; font-weight: 600; box-shadow: none;
  }
  body:not(.staff-console) .pa-card { display: flex; align-items: center; gap: 18px; padding: 20px 22px; }
  body:not(.staff-console) .pa-intro { display: flex; align-items: center; gap: 18px; flex: 1; min-width: 0; }
  body:not(.staff-console) .pa-ic {
    flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
    font-size: 24px; background: var(--brand-50, #eef2ff);
  }
  body:not(.staff-console) .pa-txt { flex: 1; min-width: 0; }
  body:not(.staff-console) .pa-txt b { display: block; font-size: 16.5px; color: var(--ink); }
  body:not(.staff-console) .pa-txt small { display: block; margin-top: 3px; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
  body:not(.staff-console) .pa-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  body:not(.staff-console) .pa-meta > span {
    display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
    font-size: 12.5px; font-weight: 600; color: var(--ink-soft); background: var(--bg); border: 1px solid var(--line);
  }
  body:not(.staff-console) .pa-meta i { font-style: normal; font-weight: 800; color: var(--brand-600); }
  body:not(.staff-console) .pa-card .pa-go { flex: none; width: auto; min-width: 210px; min-height: 46px; margin: 0; }
  body:not(.staff-console) .pa-card .pa-emoji,
  body:not(.staff-console) .pa-card .pa-usage { display: none; }
}

/* ==========================================================================
   Slow-network loading dots (owner 2026-11-02), staff + tenant, every device.
   The same three dots as the "Getting your stay ready..." screen. Shown ONLY
   when a photo, screenshot, profile picture or PDF is still loading after
   ~0.3 s (shared.js ImgWait / pdfview.js), so a fast connection never sees
   them. Drawn as the image's own background, so nothing on the page moves,
   reflows or reloads; the picture simply paints over the dots when it lands.
   ========================================================================== */
img.sl-imgwait {
  background-color: var(--line-soft, #eef1f8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 12'%3E%3Ccircle cx='6' cy='6' r='4' fill='%233b63e8'%3E%3Canimate attributeName='opacity' values='.3;1;.3' dur='1.1s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='22' cy='6' r='4' fill='%232fd8a6'%3E%3Canimate attributeName='opacity' values='.3;1;.3' dur='1.1s' begin='.16s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='38' cy='6' r='4' fill='%2316225c'%3E%3Canimate attributeName='opacity' values='.3;1;.3' dur='1.1s' begin='.32s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: clamp(16px, 46%, 44px) auto;
}
:root[data-theme="dark"] img.sl-imgwait { background-color: rgba(255, 255, 255, .06); }
/* Large pictures (screenshot / bill / ID / announcement photo viewers) keep a
   steady box while loading instead of a zero-height gap. */
img.sl-imgwait.proof-img, img.sl-imgwait.idv-img, .ann-photo img.sl-imgwait, .modal-body img.sl-imgwait {
  min-height: 200px; min-width: min(100%, 260px); border-radius: 10px;
}
/* The dots on their own (PDF viewer and any "loading" slot). */
.sl-dots { display: inline-flex; gap: 7px; align-items: center; justify-content: center; }
.sl-dots i { width: 8px; height: 8px; border-radius: 50%; background: #3b63e8; animation: slDot 1.1s ease-in-out infinite; }
.sl-dots i:nth-child(2) { animation-delay: .16s; background: #2fd8a6; }
.sl-dots i:nth-child(3) { animation-delay: .32s; background: #16225c; }
:root[data-theme="dark"] .sl-dots i:nth-child(3) { background: #94a3b8; }
@keyframes slDot { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.2); } }
.pdfview-status.is-loading { display: flex; align-items: center; justify-content: center; min-height: 220px; padding: 24px 12px; }
@media (prefers-reduced-motion: reduce) { .sl-dots i { animation-duration: 2.2s; } }
/* A photo inside an avatar circle (e.g. the tenant profile sheet) has no size of its own until it
   arrives; while loading it fills the circle so the dots show. Loaded look unchanged. */
.avatar img.sl-imgwait { display: block; width: 100% !important; height: 100% !important; border-radius: 50%; }
.avatar > span:has(> img.sl-imgwait) { display: block; width: 100%; height: 100%; }

/* sl-logo-unified:start */
/* Owner rule 2026-11-02: the StayLedger logo looks the SAME everywhere (header,
   loading screen, sign-in, landing, banners): the app-icon gradient, and the white
   document filling the tile like the app icon, not a small glyph on a big blue square. */
.boot-mark,
.brand-mark,
.wordmark .mark,
.signin-wordmark .mark,
.at-mark,
.nav-mark,
#slPushBanner .lg,
body.landing .nav-mark {
  background: linear-gradient(180deg, #3b63e8 0%, #131f4d 100%) !important;
  border-radius: 23% !important;
  overflow: hidden;
}
.boot-mark > svg,
.brand-mark > svg,
.wordmark .mark > svg,
.signin-wordmark .mark > svg,
.at-mark > svg,
.nav-mark > svg,
#slPushBanner .lg > svg,
body.landing .nav-mark > svg {
  width: 100% !important; height: 100% !important; max-width: none !important; display: block;
}
/* sl-logo-unified:end */

/* Smooth page changes (owner-approved 2026-11-05; same block in style.css and portal.css):
   the new screen's cards come in one after another, and the grey loading boxes only
   appear if loading takes longer than 160 ms. Transform/opacity only. */
#view.view-enter { animation: none; }
#view.view-enter > * { animation: slCardIn .3s cubic-bezier(.22,1,.36,1) backwards; }
/* Fix 2026-11-07: with fill "both" every section kept a transform after coming in, which
   made each one its own layer, so a later card (e.g. the Today figure) painted OVER the
   page-header kebab menu (PDF / Excel). "backwards" leaves nothing behind once it has
   come in, and the page header always sits above the cards below it. */
#view > .page-head, #view > .hero { position: relative; z-index: 30; }
#view > .page-head:has(.page-actions-wrap.is-open) { z-index: 60; }
#view.view-enter > *:nth-child(2) { animation-delay: .035s; }
#view.view-enter > *:nth-child(3) { animation-delay: .07s; }
#view.view-enter > *:nth-child(4) { animation-delay: .105s; }
#view.view-enter > *:nth-child(5) { animation-delay: .14s; }
#view.view-enter > *:nth-child(n+6) { animation-delay: .175s; }
@keyframes slCardIn { from { opacity: 0; transform: translate3d(0, 12px, 0); } }
#view > .sl-skel-card { animation: slSkelIn .2s ease .16s both; }
@keyframes slSkelIn { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  #view.view-enter > *, #view > .sl-skel-card { animation: none; }
}

/* Release 5: upload progress on the busy button (same block in style.css and portal.css) */
.sl-uploading { position: relative; overflow: hidden; }
.sl-uploading::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--slp, 0%); background: rgba(255,255,255,.85); transition: width .2s ease; }
.btn-ghost.sl-uploading::after, .btn-soft.sl-uploading::after { background: #2f56e6; }
.sl-dots { display: inline-flex; gap: 3px; margin-left: 5px; vertical-align: middle; }
.sl-dots i { width: 5px; height: 5px; border-radius: 99px; background: currentColor; opacity: .3; animation: slDot 1.2s ease-in-out infinite; }
.sl-dots i:nth-child(2) { animation-delay: .2s; } .sl-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes slDot { 30% { opacity: 1; transform: scale(1.25); } 60% { opacity: .3; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sl-dots i { animation: none; opacity: .7; } }

/* Release 5: once-only rating request, centred on every screen */
.sl-rate-root { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center; padding: 18px; animation: slRateIn .22s ease both; }
.sl-rate-root.out { animation: slRateOut .2s ease forwards; }
.sl-rate-dim { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(15, 23, 42, .5); }
.sl-rate-card { position: relative; width: 100%; max-width: 340px; max-height: calc(100% - 20px); overflow: auto; background: #fff; color: #0f172a; border-radius: 24px; padding: 22px 20px 16px; text-align: center; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); animation: slRateCard .32s cubic-bezier(.22,1,.36,1) both; }
.sl-rate-logo { display: block; width: 56px; height: 56px; margin: 0 auto 10px; }
.sl-rate-card h3 { font-size: 19px; letter-spacing: -.3px; margin: 0; }
.sl-rate-card p { font-size: 14px; color: #475569; margin: 6px 0 12px; line-height: 1.5; }
.sl-rate-stars { font-size: 26px; letter-spacing: 4px; color: #f5a524; white-space: nowrap; margin-bottom: 12px; }
.sl-rate-go { display: block; padding: 13px; border-radius: 14px; background: linear-gradient(135deg, #2f56e6, #0ea5c6); color: #fff !important; font-weight: 800; font-size: 15px; text-decoration: none; }
.sl-rate-later { display: block; width: 100%; margin-top: 8px; padding: 10px; border: 0; background: none; font: inherit; font-weight: 700; color: #475569; cursor: pointer; }
:root[data-theme="dark"] .sl-rate-card { background: #1b2238; color: #f1f5ff; }
:root[data-theme="dark"] .sl-rate-card p, :root[data-theme="dark"] .sl-rate-later { color: #c9d3ee; }
@keyframes slRateIn { from { opacity: 0; } }
@keyframes slRateOut { to { opacity: 0; } }
@keyframes slRateCard { from { opacity: 0; transform: translate3d(0, 12px, 0) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .sl-rate-root, .sl-rate-card { animation: none; } }

/* No button can be text-selected anywhere: a long press or a double tap on a button never
   highlights its words (owner rule 2026-11-12). Typing fields are not affected. */
button, .btn, [role="button"], a.btn, label.btn, .chip, .pill, .nav-item, .menu-item, .tab, .tabs button, .seg-btn,
.rd-seg button, .rd-kpi, .al-pick, .rd2-mpick, .pf-row, .rd2-all, .rd-expand, .b8-chip, .an-pre, .gh-chip, .gh-qb, .sheet-item, .mp-m, .cd-b {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}

/* "Rate us" card (owner 2026-11-16): Android apps only, once, after 20 days. Same look as the update card. */
.slrate{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:20px;
  padding-left:max(20px,env(safe-area-inset-left));padding-right:max(20px,env(safe-area-inset-right));animation:slupdIn .2s ease both}
.slrate.is-out{animation:slupdOut .18s ease forwards}
.slrate-veil{position:absolute;inset:0;background:rgba(11,18,48,.55);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
.slrate-card{position:relative;width:100%;max-width:360px;border-radius:22px;padding:22px 18px 16px;background:#fff;color:#16225c;text-align:center;
  box-shadow:0 20px 50px rgba(0,0,0,.35);animation:slupdPop .38s cubic-bezier(.2,.9,.3,1.2) both;font-family:inherit}
.slrate-logo{display:block;width:56px;height:56px;margin:0 auto 12px;border-radius:15px;background:center/cover no-repeat url(/img/update-logo.png);
  box-shadow:0 6px 16px rgba(27,47,134,.28)}
.slrate-t{display:block;font-size:18px;line-height:1.25;font-weight:800;letter-spacing:-.2px}
.slrate-p{margin:6px auto 0;max-width:290px;font-size:13.5px;line-height:1.5;color:#5a6687}
.slrate-stars{display:flex;justify-content:center;gap:6px;margin:16px 0 4px}
.slrate-star{width:44px;height:44px;padding:4px;border:0;border-radius:12px;background:transparent;cursor:pointer;
  -webkit-tap-highlight-color:transparent;transition:transform .15s ease}
.slrate-star svg{width:100%;height:100%;fill:#e3e7f2;stroke:#c9d0e4;stroke-width:1;stroke-linejoin:round;transition:fill .15s ease,stroke .15s ease}
.slrate-star.on svg{fill:#f6b400;stroke:#e39f00}
.slrate-star:active{transform:scale(.9)}
.slrate-star.on{animation:slrateHop .32s ease}
.slrate-hint{display:block;min-height:18px;font-size:12px;color:#7a86a6}
.slrate-btns{display:flex;gap:10px;margin-top:14px}
.slrate-btns button{flex:1;min-width:0;height:44px;padding:0 12px;border-radius:999px;font-family:inherit;font-size:14px;font-weight:700;line-height:1;white-space:nowrap;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:7px;
  -webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:transform .12s ease,box-shadow .2s ease}
.slrate-btns button:active{transform:scale(.97)}
.slrate-cancel{background:transparent;color:#3b4a6b;border:1.5px solid #d3d9ea}
.slrate-go{flex:1.5!important;border:1.5px solid transparent;color:#fff;
  background:linear-gradient(135deg,#4a74f0,#2b4fc7) padding-box,linear-gradient(135deg,#7fa0ff,#2fd8a6) border-box;box-shadow:0 6px 14px rgba(43,79,199,.30)}
.slrate-go svg{width:15px;height:15px;fill:currentColor;flex:none}
.slrate-go.is-ready{box-shadow:0 8px 20px rgba(43,79,199,.45)}
:root[data-theme="dark"] .slrate-card{background:#161d36;color:#e8ecff}
:root[data-theme="dark"] .slrate-p{color:#a9b3d6}
:root[data-theme="dark"] .slrate-hint{color:#8d97bd}
:root[data-theme="dark"] .slrate-star svg{fill:#2a3358;stroke:#3a4572}
:root[data-theme="dark"] .slrate-star.on svg{fill:#f6b400;stroke:#e39f00}
:root[data-theme="dark"] .slrate-cancel{color:#c9d2f0;border-color:#36406a}
@media (max-width:340px){.slrate{padding:12px}.slrate-card{padding:18px 12px 12px}.slrate-star{width:38px;height:38px}.slrate-btns{gap:8px}.slrate-btns button{font-size:12.5px;padding:0 8px}}
@media (max-height:520px){.slrate-logo{width:40px;height:40px;margin-bottom:8px}.slrate-stars{margin:10px 0 2px}}
@keyframes slrateHop{40%{transform:scale(1.18)}}

/* Fix 2026-11-16: a profile photo (img.avatar) inside a popup kept the 200px "big picture" box
   while loading, so it turned into a wide grey rectangle and squeezed the text beside it.
   A loading avatar keeps its own round size; only real screenshots/bills get the big box. */
img.avatar.sl-imgwait, .modal-body img.avatar.sl-imgwait { min-height: 0 !important; min-width: 0 !important; border-radius: 50% !important; flex: none; }
.rd-prof-h > img.avatar, .rd-prof-h > .avatar { flex: none; }

/* Touch targets (owner 2026-11-16): small links and checkboxes are at least 24 px to tap. */
input[type="checkbox"] { min-width: 20px; min-height: 20px; }
a[href^="tel:"], a[href^="mailto:"] { padding-block: 4px; }
.ft-legal a, .ft a, footer a { display: inline-block; padding-block: 4px; }

/* PG Buddy suggested questions under the chat box (owner 2026-11-16) */
.bot-suggest { display: flex; gap: 7px; overflow-x: auto; padding: 10px 12px 2px; background: #fff; flex: none; scrollbar-width: none; border-top: 1px solid #ffe0c7; }
.bot-suggest + .bot-form { border-top: 0; }
.bot-suggest::-webkit-scrollbar { display: none; }
.bot-sg { flex: none; min-height: 32px; padding: 6px 12px; border-radius: 999px; border: 1px solid #ffd2ad; background: #fff8f2; color: #9a4a12; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.bot-sg:hover { background: #ffefe1; }
:root[data-theme="dark"] .bot-suggest { background: #1a140f; }
:root[data-theme="dark"] .bot-sg { background: #2a1e14; border-color: #4a3626; color: #ffcf9e; }
:root[data-theme="dark"] .bot-suggest { border-top-color: #4a3626; }
