/* ─── Inter — self-hosted (issue #601) ────────────────────────────────────
   Inter was previously loaded from fonts.googleapis.com, which made Google
   a sub-processor disclosed in our Privacy Policy and pulled two extra
   third-party origins onto first paint. We now ship the WOFF2 subsets
   ourselves from /fonts/inter/. Subsets: Latin + Latin-Extended (sufficient
   for EN + RO). `font-display: swap` so first paint never stalls waiting
   on the font file — the WASM boot screen + UI render in the system fallback
   and Inter swaps in once the woff2 lands.

   Source: Google Webfonts Helper (gwfh.mranftl.com) — v20 subset bundle.

   LICENCE: Inter is distributed under the SIL Open Font License 1.1. The
   full licence text + copyright notice ship alongside the font files at
   /fonts/inter/LICENSE.txt — required by OFL §3 (distribution clause).
   Do not delete LICENSE.txt without replacing the font with a non-OFL
   alternative. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter/inter-v20-latin_latin-ext-regular.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/inter/inter-v20-latin_latin-ext-500.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter/inter-v20-latin_latin-ext-600.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

/* ─── Brand override demo ──────────────────────────────────────────────────── */
/* To change the accent colour for a specific app, override these two variables.
   Remove or comment out to revert to KTS Foundation defaults. */
/* :root {
    --kts-sidebar-active: #e91e8c;
} */

#app {
    height: 100%;
    overflow: hidden;
}

h1:focus {
    outline: none;
}

/* #blazor-error-ui styling now lives in KTS.Foundation 0.41.0+ (issue #188) —
   see _content/KTS.Foundation/css/kts-crash-bar.css referenced from
   wwwroot/index.html. The mobile Reload/× overlap fix (#1059) + the compact
   single-line layout (#549) + the dark-amber palette are all preserved
   verbatim in the Foundation asset. Retheme via --kts-crash-* CSS custom
   properties in :root if a consumer palette is ever needed. */

/* Support reference stamped on the crash bar by js/crash-reference.js (render-crash
   observability). Sits in the .crash-row before the Reload link; muted + selectable
   so a user can read/copy it. currentColor inherits the bar's amber-on-dark text. */
.crash-reference {
    font-size: 0.75rem;
    opacity: 0.75;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    user-select: all;
    margin-inline: 0.25rem 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5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1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ─── WASM boot screen styles are defined in index.html <style> to guarantee
       they apply before Tailwind CDN can interfere. ─────────────────────────── */

code {
    color: #c02d76;
}

/* ─── Top-bar shadow regression fix (issue H, AC#10) ───────────────────────────
   The Foundation MainLayout's top bar lost its drop-shadow once components
   below it finished loading: a sibling element gained a stacking context on
   hydration that re-ordered z-index against the top bar's `box-shadow`,
   causing the shadow to render under content instead of over it.

   Two-part defence:
     1. Pin a positive z-index on the top bar so the shadow always sits on
        top of any sibling stacking context that appears during hydration.
     2. Re-assert the box-shadow with !important so a Tailwind utility added
        late in the page tree can't strip it. The shadow value matches
        Foundation's `shadow-md` token so the visual stays identical.

   NOTE ON THE FIX SHAPE:
   The PR description called out "position: sticky pinning" — that was the
   original direction; the actual landed fix is z-index + box-shadow
   reassertion (sticky wasn't needed once the stacking context was pinned).
   PR description has been updated to match. No `position: sticky` here.

   Foundation's MainLayout renders the AppBar with this signature inline
   style:
       <header … style="position:relative;z-index:var(--kts-z-appbar);">

   The `--kts-z-appbar` design-token reference is the most stable hook
   Foundation 0.6.x exposes — Foundation can re-theme `bg-zinc-900` to
   anything (light theme, brand re-skin, etc.) but the `--kts-z-appbar`
   token name is part of the published Foundation API. We bind on that
   instead of the brittle Tailwind utility pair so a colour-token bump
   doesn't break this override.

   Belt-and-braces selectors:
     1. `header[style*="--kts-z-appbar"]` — primary, design-token-keyed.
     2. `header.shadow-md.shrink-0` — fallback for any future Foundation
        rev that drops the inline custom-property reference but still
        emits the `shadow-md` + `shrink-0` utility pair on the AppBar.
   If Foundation ever ships a stable data-attribute (e.g.
   `data-kts-topbar`) we should retighten to that and drop the fallback. */
body header[style*="--kts-z-appbar"],
body header.shadow-md.shrink-0 {
    z-index: 50;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -2px rgba(0, 0, 0, 0.1) !important;
}

/* #765 — Consistent input help text.
   Foundation's `.kts-field-help` (the text rendered by KtsFormField's `Help`
   parameter) sets only line-height + margins; it OMITS font-size and color —
   unlike its sibling help classes `.kts-checkbox-help` / `.kts-toggle-help`,
   which both set `font-size:.75rem; color:#6b7280`. So KtsFormField help text
   inherited the body font size + default colour and rendered larger/darker
   than the hand-rolled `text-xs text-gray-500` hints used elsewhere (most
   visible on /tenant-info: the "Legal name" hint was small/muted while the
   "Display name" hint below it was large). Foundation leaves these two
   properties unset, so this unlayered override supplies them with no
   specificity fight, aligning every KtsFormField Help line with the app's
   small/muted hint style. Matches Foundation's own checkbox/toggle help. */
.kts-field-help {
    font-size: 0.75rem;
    color: #6b7280;
}

/* #760 — Consistent saved-card / billing-address action visibility.
   Billing addresses use Foundation's KtsAddressList, whose action strip is
   revealed on hover via Blazor SCOPED CSS (.kts-address-actions[b-...]). The
   saved-cards list is a bespoke composition (KtsPaymentMethodRow) here, so that
   scoped reveal could never apply and the card actions showed at all times —
   inconsistent. We give the card actions the same hover-reveal, and make BOTH
   lists behave the same on touch:
   - hover-capable devices: card actions hidden until row hover/focus-within
     (keyboard-reachable), matching the address list's hover reveal.
   - touch devices (no hover): actions stay visible on BOTH lists so they're
     tappable (Foundation's address reveal is forced visible too). */
@media (hover: hover) and (pointer: fine) {
    .card-row-hover .card-row-actions {
        opacity: 0;
        transition: opacity 120ms ease;
    }

    .card-row-hover:hover .card-row-actions,
    .card-row-hover:focus-within .card-row-actions {
        opacity: 1;
    }
}

@media (hover: none) {
    /* Touch: keep the Foundation address actions visible too (its scoped rule
       hides them until a hover that never comes). Mirrors the always-visible
       card actions on touch. */
    .kts-address-actions {
        opacity: 1 !important;
    }
}

/* Keep the two card action buttons laid out like Foundation's address actions
   (the wrapping .card-row-actions span would otherwise collapse their gap). */
.card-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
}
