/* =============================================================================
   Member portal design system.

   Loaded ONLY by Pages/Portal/_PortalLayout.cshtml. That used to be a load-bearing separation: while
   pages were still being migrated, the legacy runtime-Razor pages shared /portal/css/portal.css with the
   compiled ones, so changing tokens or the root font size here could not be allowed to reach markup that
   predated both. That constraint is spent: every member-facing portal page is compiled now, and with
   Portal/root.cshtml and the floor plan viewer both retired nothing in the portal renders through the
   runtime Razor engine at all. The Form 1583 block further down is the clearest example of what that
   changed — its touch targets were written in px to compensate for portal.css's 14px root, and under the
   16px root below they no longer have to be.

   Loaded after site.css and portal.css so it wins, and before customportal.css so a tenant can still
   override any token here.

   Design source: Docs/design/member-portal. Tokens are Spoke's, lifted from Website.GlobalCss on
   prod Website.Id = 1, so a member arriving from the public site does not feel handed to a different
   product. They are declared here as defaults rather than hardcoded into components, which is what
   lets customportal.css reskin the portal per website.
   ============================================================================= */

:root {
   --hg-green: #3a7d44;
   --hg-green-dark: #2d5132;
   --hg-green-deep: #1a2e1c;
   --hg-green-light: #4e9e5a;
   --hg-green-pale: #eaf5ec;
   --hg-green-border: #c8e6cc;
   --hg-green-50: #eef7f0;
   --hg-lime: #b6e34a;
   --hg-lime-dark: #8ec433;
   --hg-cream: #fbfaf3;
   --hg-ink: #1a2a20;
   --hg-gray: #6b7280;
   --hg-line: #e5e7eb;
   --hg-bg: #f3f4f6;
   --hg-white: #ffffff;
   --hg-warn-bg: #fef3c7;
   --hg-warn-line: #fcd34d;
   --hg-warn-ink: #8a5a00;
   --hg-danger: #a63a2e;

   --hg-display: 'Expletus Sans', 'Nunito Sans', 'Segoe UI', sans-serif;
   --hg-body: 'Segoe UI', system-ui, -apple-system, sans-serif;

   --hg-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
   --hg-shadow-lift: 0 8px 32px rgba(0, 0, 0, 0.09);
   --hg-radius: 14px;

   /* Bottom tab bar height, so a page can reserve room under its own content for it. */
   --hg-tabbar-h: 76px;
}

/* Bootstrap's reboot supplied this until the sign-in screen was redrawn and the CDN links came out of
   _PortalLayout. Every page on this layout was authored under border-box and several depend on it —
   .hg-input alone is width:100% with 30px of horizontal padding and a 3px border, which content-box turns
   into an overflow rather than a fitted field. Restated here so the design system owns the reset outright
   instead of inheriting it from a stylesheet it no longer loads.

   Document-wide on purpose, exactly as the reboot was. Nothing else in the portal supplies one now —
   Portal/root.cshtml, which loaded Bootstrap and got the reset with it, has been deleted. */
*,
*::before,
*::after {
   box-sizing: border-box;
}

/* The UA stylesheet's [hidden] { display: none } is a UA rule, so ANY author rule setting display beats it
   — .hg-btn, .hg-pill and .hg-p-bar are all inline-flex or flex, and every one of them stayed on screen
   when a script set the attribute. Restating it here with !important is the standard reset for exactly this,
   and it means `el.hidden = true` can be relied on rather than checked class by class. Bootstrap supplied
   the equivalent until the sign-in redraw took its CDN links out of _PortalLayout. */
[hidden] {
   display: none !important;
}

/* site.css sets html{font-size:14px} below 768px and 16px above it — the shrunken root lands on
   phones and nowhere else, so every rem-sized control comes out 12.5% small exactly where it is
   operated by thumb. Pinned to 16px here for portal pages on the compiled layout. Touch targets
   below are still specified in px, because a finger is the same size whatever the type scale. */
html {
   font-size: 16px;
}

/* The page's own ground. Without this the document stays white, which shows wherever the shell does not
   paint — the scrollbar gutter, and any overscroll past the top or bottom — as a white edge against the
   cream content and the deep-green rail. Safe to set here: this stylesheet reaches only the compiled
   portal pages, never the legacy runtime-Razor ones, and the sign-in screen paints its own full-height
   background over it. */
body {
   background: var(--hg-cream);
}

.hg-p {
   font-family: var(--hg-body);
   color: var(--hg-ink);
   background: var(--hg-cream);
   line-height: 1.45;
   text-wrap: pretty;
}

.hg-p h1,
.hg-p h2,
.hg-p h3,
.hg-p h4 {
   font-family: var(--hg-display);
   font-weight: 600;
   letter-spacing: -0.01em;
   line-height: 1.2;
   margin: 0;
}

/* The default for a link that is nothing else, wrapped in :where() so it carries NO specificity at all.
   That matters more than it looks. Written plainly, `.hg-p a` is (0,1,1) and every component that styles
   an anchor — .hg-p-back, .hg-p-brand, .hg-btn-primary — is a bare class at (0,1,0), so this rule beat
   all of them and painted them --hg-green:

     · the hero's back link came out green on --hg-green-deep, about 1.9:1, on every page that has one
     · the phone top bar's wordmark, the same
     · <a class="hg-btn hg-btn-primary"> came out green on --hg-green-dark, about 1.5:1

   Only the third was noticed, and only because the floor plan viewer is the first page to need a primary
   button that navigates; the other two had been shipping. :where() drops this to (0,0,0), which still
   beats the browser's own link colour (any author rule does) while losing to every component that has an
   opinion — which is the relationship these two layers should have had from the start. */
:where(.hg-p a) {
   color: var(--hg-green);
   text-decoration: none;
}

:where(.hg-p a:hover) {
   color: var(--hg-green-dark);
}

.hg-p svg {
   display: block;
}

.hg-p :focus-visible {
   outline: 2px solid var(--hg-green);
   outline-offset: 2px;
}

/* ── Cross-document view transitions ─────────────────────────────────────────
   Every tab is a real navigation — the portal is Razor Pages, not a single-page app — so without this the
   screen goes white between Home and Mail even when the new page arrives quickly. This asks the browser to
   cross-fade the old rendering into the new one instead, which is what stops a fast navigation still
   reading as a full refresh.

   Costs one at-rule and no JavaScript. Browsers without cross-document transitions ignore it and navigate
   exactly as they do today, so there is nothing to feature-detect and no fallback to maintain.

   Scoped to same-origin navigations by the specification, so a link out to Stripe Checkout is unaffected. */

@view-transition {
   navigation: auto;
}

/* The chrome does not move between pages, so it should not be part of the fade. Naming an element opts it
   out of the root snapshot and gives it its own, which for an element that is identical on both sides means
   it simply stays put while the content changes underneath it — the difference between "the page changed"
   and "the whole window blinked".

   A name has to be unique in the document. Both of these render once, from _PortalNav and _PortalHeader. */
.hg-p-nav {
   view-transition-name: hg-portal-nav;
}

.hg-p-topbar {
   view-transition-name: hg-portal-topbar;
}

/* The hero is deliberately left unnamed. It is the same green band on every page but carries a different
   title, and a named element morphs its contents — which on text reads as a smear rather than a change.
   Letting it fall into the root cross-fade is both cheaper and calmer. */

/* Honour a stated preference for less motion: keep the navigation, drop the animation. Cutting the duration
   to zero rather than disabling the transition keeps the machinery identical in both cases, so a named
   element cannot end up half-applied. */
@media (prefers-reduced-motion: reduce) {

   ::view-transition-group(*),
   ::view-transition-old(*),
   ::view-transition-new(*) {
      animation-duration: 0s !important;
   }
}

/* ── App shell ───────────────────────────────────────────────────────────────
   One markup, two shapes: a bottom tab bar on a phone, a left rail from 768px up. The nav is a
   single element in both, so a destination cannot exist in one and be forgotten in the other. */

.hg-p-app {
   display: flex;
   flex-direction: column;
   min-height: 100vh;
   background: var(--hg-cream);
}

.hg-p-main {
   flex: 1 1 auto;
   min-height: 0;
   padding-bottom: var(--hg-tabbar-h);
}

.hg-p-wrap {
   padding: 16px;
   display: flex;
   flex-direction: column;
   gap: 14px;
}

/* An inner stack of cards. Deliberately NOT a nested .hg-p-wrap: that carries the page's max-width and
   `margin: 0 auto`, and an auto margin on a flex item in a column container beats the default
   align-items:stretch — so a nested wrap shrink-to-fits its content instead of filling its parent. On
   desktop that collapsed the whole page to a single ~354px column centred in 1100px of space, which in
   turn left .hg-p-grid with room for exactly one card. Pages put their conditional blocks in one of these. */
.hg-p-stack {
   display: flex;
   flex-direction: column;
   gap: 14px;
}

/* ── Sign-in ─────────────────────────────────────────────────────────────────
   The one screen every member sees before any of the others, and the last one the redesign reached: it
   sat inside the new shell still wearing Bootswatch Cosmo, so the first impression contradicted every
   page behind it.

   Drawn from Docs/design/member-portal (body-Login, body-LoginCode). Deep-green ground with the brand
   held in the flexible upper half and the form in a white sheet along the bottom edge — on a phone that
   puts the field and its button where the thumb already rests, rather than centred in a card with the
   keyboard covering half of it. From 768px the sheet becomes a centred card instead, because a
   bottom-anchored panel stretched across a desktop viewport reads as a broken layout, not a deliberate one.

   Deliberately not built on .hg-p: that class paints the cream app ground, which is the opposite of what
   this screen wants. Everything it needs from the base layer — display face, focus ring — is restated
   here, so the two cannot drift into fighting each other. */

.hg-p-auth {
   min-height: 100vh;
   /* dvh so the sheet stays on the bottom edge while a mobile browser's URL bar collapses; the vh above
      is the fallback for anything that does not know the unit. */
   min-height: 100dvh;
   display: flex;
   flex-direction: column;
   background: var(--hg-green-deep);
   font-family: var(--hg-body);
   color: var(--hg-ink);
}

.hg-p-auth :focus-visible {
   outline: 2px solid var(--hg-lime);
   outline-offset: 2px;
}

/* Top-left slot on the green, holding the back control on the code step. Always present so the two steps
   do not shift vertically as one replaces the other. */
.hg-p-auth-head {
   flex: 0 0 auto;
   padding: 22px 20px;
   min-height: 88px;
}

.hg-p-auth-back {
   width: 44px;
   height: 44px;
   padding: 0;
   border: 0;
   border-radius: 12px;
   background: rgba(255, 255, 255, 0.12);
   color: #fff;
   display: flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
}

.hg-p-auth-back:hover {
   background: rgba(255, 255, 255, 0.22);
}

/* The brand on step one, the mail glyph on step two. min-height:0 so this yields instead of pushing the
   sheet off-screen on a short viewport (a phone in landscape with the keyboard up). */
.hg-p-auth-top {
   flex: 1 1 auto;
   min-height: 0;
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   gap: 16px;
   padding: 0 32px 32px;
   text-align: center;
}

/* A tenant logo where PortalConfig carries one. Capped rather than sized, so a wordmark-shaped asset and
   a square one both land somewhere sensible without the tenant having to supply two files. */
.hg-p-auth-logo {
   max-width: 220px;
   max-height: 72px;
   width: auto;
   height: auto;
}

.hg-p-auth-form {
   display: flex;
   flex-direction: column;
   gap: 16px;
   margin-top: 22px;
}

/* The one primary action on the screen, and the mockup gives it more height than the app's standard 48px
   control. Scoped to the form so the dev shortcut's button keeps its own smaller size. */
.hg-p-auth-form > .hg-btn {
   min-height: 52px;
   font-size: 17px;
}

.hg-p-auth-wordmark {
   font-family: var(--hg-display);
   font-size: 30px;
   font-weight: 600;
   letter-spacing: 0.01em;
   color: #fff;
}

.hg-p-auth-tagline {
   font-size: 14px;
   color: rgba(255, 255, 255, 0.6);
   margin-top: 6px;
}

.hg-p-auth-sheet {
   flex: 0 0 auto;
   background: var(--hg-white);
   border-radius: 24px 24px 0 0;
   padding: 28px 24px 32px;
   /* Clears the home indicator on an iPhone and adds nothing anywhere else. */
   padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

.hg-p-auth-sheet h1 {
   font-family: var(--hg-display);
   font-size: 26px;
   font-weight: 600;
   letter-spacing: -0.01em;
   line-height: 1.2;
   margin: 0;
}

.hg-p-auth-lede {
   font-size: 15px;
   color: var(--hg-gray);
   line-height: 1.5;
   margin: 10px 0 0;
   text-wrap: pretty;
}

.hg-p-auth-lede strong {
   color: var(--hg-ink);
   font-weight: 600;
   overflow-wrap: anywhere;
}

/* Leading glyph inside the field. pointer-events:none so tapping the icon still focuses the input under it. */
.hg-p-auth-inputwrap {
   position: relative;
   display: flex;
   align-items: center;
}

.hg-p-auth-inputwrap > svg {
   position: absolute;
   left: 15px;
   color: var(--hg-gray);
   pointer-events: none;
}

.hg-p-auth-inputwrap > .hg-input {
   padding-left: 44px;
}

/* ── Verification code ───────────────────────────────────────────────────────
   Six cells painted over ONE real input, never six inputs. Splitting the field would cost exactly the
   things that make a code screen work: iOS and Android offer the arriving SMS to a single field marked
   autocomplete="one-time-code", a paste fills one field and not the first of six, and a screen reader
   announces one labelled control instead of six unlabelled boxes. So the input covers the grid while the
   cells below it are painted from its value. */

.hg-p-code {
   position: relative;
}

.hg-p-code-cells {
   display: grid;
   grid-template-columns: repeat(6, minmax(0, 1fr));
   gap: 8px;
}

.hg-p-code-cell {
   min-height: 60px;
   border: 1.5px solid var(--hg-line);
   border-radius: 12px;
   display: flex;
   align-items: center;
   justify-content: center;
   font-family: var(--hg-display);
   font-size: 24px;
   font-weight: 600;
   color: var(--hg-ink);
}

.hg-p-code-cell.hg-filled {
   border-color: var(--hg-green-border);
   background: var(--hg-green-50);
}

/* The cell the next digit will land in. Drawn rather than relying on a focus ring, because the element
   actually holding focus is the transparent input stretched across all six. */
.hg-p-code-cell.hg-on {
   border: 2px solid var(--hg-green-dark);
   box-shadow: 0 0 0 3px rgba(58, 125, 68, 0.14);
}

.hg-p-code-caret {
   width: 2px;
   height: 26px;
   background: var(--hg-green-dark);
   animation: hg-caret 1.06s steps(1) infinite;
}

@keyframes hg-caret {
   50% { opacity: 0; }
}

/* Transparent, not hidden: display:none and visibility:hidden cannot take focus at all, and an
   off-screen input makes some mobile keyboards scroll the page chasing it. 16px because iOS zooms the
   viewport when a focused field's text is smaller, which would jump the whole screen on focus even
   though the text itself never shows. */
.hg-p-code-input {
   position: absolute;
   inset: 0;
   width: 100%;
   height: 100%;
   margin: 0;
   padding: 0;
   border: 0;
   background: transparent;
   font-size: 16px;
   opacity: 0;
   cursor: pointer;
}

/* ── Sign-in footer ──────────────────────────────────────────────────────── */

.hg-p-auth-foot {
   display: flex;
   align-items: center;
   justify-content: center;
   flex-wrap: wrap;
   gap: 4px;
   margin-top: 16px;
   font-size: 14px;
   color: var(--hg-gray);
   text-align: center;
}

.hg-p-auth-link {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   min-height: 44px;
   padding: 0 8px;
   border: 0;
   background: none;
   font-family: var(--hg-body);
   font-size: 14px;
   font-weight: 600;
   color: var(--hg-green-dark);
   cursor: pointer;
}

/* Not :disabled — the resend control stays enabled through the cooldown so it keeps its place in the tab
   order and a screen reader still reads the remaining time. It reads as unavailable and does nothing. */
.hg-p-auth-link[aria-disabled="true"] {
   color: var(--hg-gray);
   font-weight: 400;
   cursor: default;
}

/* ── Sign-in loading ─────────────────────────────────────────────────────── */

.hg-p-auth-checking {
   flex: 1 1 auto;
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   gap: 16px;
   color: rgba(255, 255, 255, 0.7);
   font-size: 14px;
}

.hg-p-auth-spinner {
   width: 34px;
   height: 34px;
   border: 3px solid rgba(255, 255, 255, 0.22);
   border-top-color: var(--hg-lime);
   border-radius: 50%;
   animation: hg-spin 0.8s linear infinite;
}

@keyframes hg-spin {
   to { transform: rotate(360deg); }
}

/* Slowed rather than stopped: a spinner frozen mid-rotation reads as a hung page, which is the opposite
   of what it is there to say. Same reasoning as the view-transition block above. */
@media (prefers-reduced-motion: reduce) {
   .hg-p-auth-spinner { animation-duration: 2.4s; }
   .hg-p-code-caret { animation: none; }
}

/* ── Dev-only sign-in shortcut ───────────────────────────────────────────────
   Deliberately drawn as scaffolding — dashed rule, muted, set apart — so it cannot be mistaken for a
   member-facing control in a screenshot or a demo. Never rendered outside a DEBUG build talking to
   hubgnome-dev; the gate is DevAuthBypass.IsEnabled, checked in the markup and again server-side. */

.hg-p-auth-dev {
   margin-top: 24px;
   padding-top: 18px;
   border-top: 1px dashed var(--hg-line);
}

.hg-p-auth-dev-row {
   display: flex;
   gap: 8px;
   margin-top: 10px;
}

.hg-p-auth-dev-row > .hg-input {
   min-width: 0;
   min-height: 44px;
   font-size: 14px;
}

/* The button keeps its label on one line and the field gives up the width instead. Without both halves
   the flex row splits the space evenly and "Dev Login" wraps mid-label. */
.hg-p-auth-dev-row > .hg-btn {
   flex-shrink: 0;
   white-space: nowrap;
}

/* From 768px the sheet stops being a sheet and becomes a centred card. The brand block takes order:-1 so
   it sits above the back control rather than below it — on a phone the back button has the green margin
   to itself, and on desktop there is no margin for it to sit in. */
@media (min-width: 768px) {
   .hg-p-auth {
      justify-content: center;
      padding: 40px 20px;
   }

   .hg-p-auth-top {
      order: -1;
      flex: 0 0 auto;
      padding: 0 0 24px;
   }

   .hg-p-auth-head,
   .hg-p-auth-sheet {
      width: 100%;
      max-width: 460px;
      margin: 0 auto;
   }

   .hg-p-auth-head {
      min-height: 0;
      padding: 0 0 12px;
   }

   .hg-p-auth-sheet {
      border-radius: 24px;
      padding: 32px;
      padding-bottom: 32px;
      box-shadow: var(--hg-shadow-lift);
   }
}

/* ── Top bar ─────────────────────────────────────────────────────────────── */

/* Phone only — hidden from 768px up, where the rail carries the brand instead. 16px matches .hg-p-hero
   directly below it and .hg-p-wrap below that, so the wordmark, the page title and the first card all
   start on one line down the left edge. */
.hg-p-topbar {
   background: var(--hg-green-deep);
   color: #fff;
   padding: 18px 16px;
   display: flex;
   align-items: center;
   gap: 12px;
}

.hg-p-brand {
   display: flex;
   align-items: center;
   gap: 10px;
   flex: 1;
   min-width: 0;
   color: #fff;
   font-family: var(--hg-display);
   font-size: 19px;
   font-weight: 600;
}

.hg-p-brand:hover {
   color: #fff;
}

.hg-p-brand img {
   height: 30px;
   width: auto;
}

.hg-p-iconbtn {
   min-width: 44px;
   min-height: 44px;
   border-radius: 12px;
   border: 0;
   background: rgba(255, 255, 255, 0.12);
   color: rgba(255, 255, 255, 0.92);
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 7px;
   padding: 0 13px;
   font-family: var(--hg-body);
   font-size: 13px;
   cursor: pointer;
}

.hg-p-iconbtn:hover {
   background: rgba(255, 255, 255, 0.2);
   color: #fff;
}

/* ── Navigation ──────────────────────────────────────────────────────────── */

.hg-p-nav {
   position: fixed;
   left: 0;
   right: 0;
   bottom: 0;
   z-index: 20;
   background: var(--hg-white);
   border-top: 1px solid var(--hg-line);
   padding: 8px 8px 12px;
   display: grid;
   grid-auto-flow: column;
   grid-auto-columns: minmax(0, 1fr);
   gap: 2px;
}

/* Keeps the web chat launcher off the tab bar.

   The launcher is fixed to the bottom-right at 20px, which on a phone lands it squarely on top of the
   last tab — More, which opens the overflow menu, so the widget made a navigation destination
   unreachable rather than merely crowding it. The widget mounts into a shadow root but its HOST element
   is ordinary light DOM, and it reads --hg-wc-safe-bottom off that host for exactly this, so the
   reservation is declared here, beside the bar it is reserving for, instead of the widget carrying a
   copy of the portal's breakpoint.

   Scoped to the same width the bar is: above 768px .hg-p-nav is the sticky left rail and there is
   nothing at the bottom of the screen to avoid. The value is .hg-p-nav's rendered height (8 + label
   row + 12 of padding, 73px measured), which leaves the launcher its usual 20px gap above the bar. */
@media (max-width: 767.98px) {
   [data-hg-webchat-root] {
      --hg-wc-safe-bottom: 73px;
   }
}

/* .hg-p-nav-tab is the You and More buttons. They are shaped by the same rules as a destination because
   a member should not be able to tell which is which by looking — only by where it leads. */
.hg-p-nav a,
.hg-p-nav .hg-p-nav-tab {
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   gap: 4px;
   min-height: 52px;
   /* 3px a side rather than none, so two tabs at their measured minimum still have air between them —
      createPortalNav() reads this padding back when it decides how many columns fit. */
   padding: 6px 3px;
   color: var(--hg-gray);
   font-size: 11px;
   font-weight: 600;
   position: relative;
}

.hg-p-nav .hg-p-nav-tab {
   background: none;
   border: 0;
   font-family: inherit;
   cursor: pointer;
}

.hg-p-nav a:hover,
.hg-p-nav .hg-p-nav-tab:hover {
   color: var(--hg-green-dark);
}

.hg-p-nav a.hg-on,
.hg-p-nav .hg-p-nav-tab.hg-on {
   color: var(--hg-green-dark);
   font-weight: 700;
}

.hg-p-nav svg {
   width: 23px;
   height: 23px;
}

/* nowrap and a clip rather than a wrap: a label that wraps changes the height of the whole bar, and the
   clip is also what makes scrollWidth report the width the label actually wanted. */
.hg-p-nav-label {
   line-height: 1;
   max-width: 100%;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

/* ── Tab-bar overflow and sheets ──────────────────────────────────────────────
   The bottom bar holds what fits. Anything else moves into the More sheet behind the ⋮ button, which is
   hidden entirely until there is something in it — see createPortalNav() in portalclient.ts, which does
   the measuring and moves the real links rather than duplicating them.

   Both sheets are children of .hg-p-nav and positioned against it rather than the viewport, so neither
   has to keep a copy of the bar's height in sync with --hg-tabbar-h. */

.hg-p-nav-hidden {
   display: none !important;
}

/* Closed is the default state for the scrim and both sheets, and .hg-p-nav-open is the class the partial
   binds. Nothing here uses x-show — see the note in _PortalNav.cshtml for why — which is also what lets
   the rail claim the You sheet on desktop without an !important.

   The scrim stops at the top of the bar rather than covering the viewport. .hg-p-nav paints its own white
   background before any child does, so a full-screen scrim dims the bar it is anchored to: the tabs stay
   bright (they are position: relative and paint later) while the strip behind them goes grey, which reads
   as the bar having been disabled. Anchoring it to the nav and sending it upwards needs no z-index. */
.hg-p-nav-scrim {
   position: absolute;
   bottom: 100%;
   left: -8px;
   right: -8px;
   height: 100vh;
   display: none;
   background: rgba(26, 46, 28, 0.42);
}

.hg-p-nav-scrim.hg-p-nav-open {
   display: block;
}

.hg-p-nav-sheet {
   position: absolute;
   bottom: 100%;
   /* Out past .hg-p-nav's own 8px gutter, so the sheet spans the screen the way the bar below it does. */
   left: -8px;
   right: -8px;
   display: none;
   flex-direction: column;
   gap: 2px;
   max-height: min(60vh, 420px);
   overflow-y: auto;
   padding: 10px 8px 14px;
   background: var(--hg-white);
   border-top: 1px solid var(--hg-line);
   border-radius: 16px 16px 0 0;
   box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.14);
   /* A CSS animation rather than x-transition: the sheet has no exit state worth animating, and this one
      runs off the style engine instead of Alpine's requestAnimationFrame loop. */
   animation: hg-p-nav-sheet-in 150ms ease-out;
}

.hg-p-nav-sheet.hg-p-nav-open {
   display: flex;
}

@keyframes hg-p-nav-sheet-in {
   from {
      opacity: 0;
      transform: translateY(10px);
   }

   to {
      opacity: 1;
      transform: translateY(0);
   }
}

@media (prefers-reduced-motion: reduce) {
   .hg-p-nav-sheet {
      animation: none;
   }
}

.hg-p-nav-sheet-title {
   margin: 0;
   padding: 2px 12px 6px;
   font-size: 12px;
   font-weight: 600;
   letter-spacing: 0.06em;
   text-transform: uppercase;
   color: var(--hg-gray);
}

/* Both notes are hidden until the shell has an answer — the profile list is there when it does, and
   neither "loading" nor "we could not load it" is true before then. */
.hg-p-nav-sheet-note {
   display: none;
   margin: 0;
   padding: 10px 12px;
   font-size: 14px;
   color: var(--hg-gray);
}

.hg-p-nav-sheet-note.hg-p-nav-open {
   display: block;
}

.hg-p-nav-sheet-error.hg-p-nav-open {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 8px;
   padding: 4px 12px 4px 12px;
}

.hg-p-nav-sheet-list {
   display: flex;
   flex-direction: column;
   gap: 2px;
}

/* A destination reads as a row in here, not as a tab. Same specificity as the .hg-p-nav a base rule
   above, so this has to sit after it — which it does. */
.hg-p-nav-sheet a {
   flex-direction: row;
   justify-content: flex-start;
   gap: 12px;
   min-height: 52px;
   padding: 0 12px;
   border-radius: 11px;
   font-size: 15px;
   color: var(--hg-ink);
}

.hg-p-nav-sheet a.hg-on {
   background: var(--hg-green-pale);
   color: var(--hg-green-dark);
}

.hg-p-nav-sheet .hg-p-nav-label {
   line-height: 1.2;
}

/* ── Profile card and sign-out ───────────────────────────────────────────────
   Shape here, colour at the breakpoint: this block is the same whether it is the You sheet on a phone
   (white panel, ink text) or the foot of the rail on desktop (deep green, white text), so only the
   colours are restated down there. Both selectors carry .hg-p-nav a to outrank the tab rule above,
   which would otherwise stack these rows into a 11px column. */

.hg-p-nav-foot {
   display: flex;
   flex-direction: column;
   gap: 4px;
}

.hg-p-profile-list {
   display: flex;
   flex-direction: column;
   gap: 4px;
}

.hg-p-nav a.hg-p-profile-link {
   flex-direction: row;
   justify-content: flex-start;
   gap: 11px;
   min-height: 60px;
   padding: 8px 10px;
   border-radius: 11px;
   color: var(--hg-ink);
}

.hg-p-nav a.hg-p-profile-link.hg-on {
   background: var(--hg-green-pale);
}

.hg-p-profile-avatar {
   width: 36px;
   height: 36px;
   border-radius: 999px;
   background: var(--hg-green-light);
   color: #fff;
   display: flex;
   align-items: center;
   justify-content: center;
   flex-shrink: 0;
   overflow: hidden;
   font-size: 13px;
   font-weight: 700;
}

.hg-p-profile-avatar img {
   width: 100%;
   height: 100%;
   object-fit: cover;
}

.hg-p-profile-copy {
   flex: 1;
   min-width: 0;
   display: flex;
   flex-direction: column;
   gap: 2px;
   text-align: left;
}

.hg-p-profile-copy strong {
   color: inherit;
   font-size: 15px;
   line-height: 1.2;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

.hg-p-profile-copy small {
   color: var(--hg-gray);
   font-size: 12px;
   line-height: 1.2;
}

.hg-p-nav a.hg-p-signout-link {
   flex-direction: row;
   justify-content: flex-start;
   gap: 12px;
   min-height: 52px;
   padding: 0 12px;
   border-radius: 11px;
   font-size: 15px;
   color: var(--hg-danger);
}

/* ── Page hero ───────────────────────────────────────────────────────────────
   Continues the top bar's green band rather than sitting on the cream, so the greeting reads as part of
   the header on a phone. On desktop the top bar is hidden and this becomes the page's own masthead. */

/* 16px, not 20px, to sit on the same gutter as .hg-p-wrap below it — the phone equivalent of the desktop
   track further down. The mockups put the title and the content on one 16px gutter (body-Mail's .topbar is
   `14px 16px` over a 16px content pad); the 20px here was an implementation drift that left every phone
   hero 4px right of its own page. .hg-p-topbar carries the same 16px for the same reason. */
.hg-p-hero {
   background: var(--hg-green-deep);
   color: #fff;
   padding: 4px 16px 26px;
}

.hg-p-hero h1 {
   font-size: 27px;
   color: #fff;
}

.hg-p-hero-sub {
   margin: 8px 0 0;
   font-size: 13px;
   color: rgba(255, 255, 255, 0.72);
}

@media (min-width: 768px) {
   /* The green band is full-bleed, but the text on it has to land in the same column as the cards it
      introduces. .hg-p-wrap is a 1100px box with 32px of padding, so that column is 1036px wide — capping
      the hero's children at 1100px (the wrap's OUTER width) put every hero title 32px to the left of its
      own page.

      A grid track rather than max-width plus auto margins, because auto margins are only as good as the
      specificity race around them: `.hg-p h1 { margin: 0 }` is (0,1,1) and outranked `.hg-p-hero > *` at
      (0,1,0), so the h1 — alone among the children — kept margin:0 and sat flush against the padding edge
      while the subtitle centred beside it. A track cannot be opted out of by a margin declared elsewhere. */
   .hg-p-hero {
      padding: 32px 32px 30px;
      display: grid;
      grid-template-columns: minmax(0, 1036px);
      justify-content: center;
   }

   .hg-p-hero h1 {
      font-size: 32px;
   }

   /* Grid blockifies its items, so the back link's inline-flex would stretch the full track and turn a
      44px control into a full-width click target. Shrink it back onto its own content. */
   .hg-p-hero > .hg-p-back {
      justify-self: start;
   }
}

/* Back out of a detail page. Sits in the hero, above the title, so it reads as "where this came from"
   rather than competing with the page's own actions. */
.hg-p-back {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   min-height: 44px;
   margin-bottom: 2px;
   color: rgba(255, 255, 255, 0.72);
   font-size: 14px;
   font-weight: 600;
}

.hg-p-back:hover {
   color: #fff;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */

.hg-modal {
   position: fixed;
   inset: 0;
   z-index: 60;
   background: rgba(26, 46, 28, 0.5);
   display: flex;
   align-items: flex-end;
   justify-content: center;
   padding: 0;
}

.hg-modal-panel {
   background: var(--hg-white);
   border-radius: 22px 22px 0 0;
   padding: 20px 16px 24px;
   width: 100%;
   max-height: 90vh;
   overflow-y: auto;
   box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
   .hg-modal {
      align-items: center;
      padding: 24px;
   }

   .hg-modal-panel {
      border-radius: var(--hg-radius);
      max-width: 520px;
      padding: 24px;
   }
}

/* A section heading with a count beside it. Deliberately not justify-content: space-between — at the
   1100px desktop column that flung the count to the far right edge with a thousand pixels of nothing
   between it and the words it counts, so it read as unrelated to them. It belongs next to the title. */
.hg-p-sectionhead {
   display: flex;
   align-items: center;
   /* Wraps so .hg-listfilter below can claim a full-width line of its own under the title on a phone.
      Nothing else in a section head is wide enough to wrap on its own, so this costs the other screens
      nothing. */
   flex-wrap: wrap;
   gap: 10px;
   margin-bottom: 10px;
}

.hg-p-sectionhead h2 {
   font-size: 18px;
}

/* ── Directory cards (companies and people) ──────────────────────────────── */

.hg-p-grid {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
   gap: 14px;
}

.hg-directory-card {
   display: flex;
   flex-direction: column;
   overflow: hidden;
}

.hg-directory-media {
   height: 108px;
   background: var(--hg-green-pale);
   display: flex;
   align-items: center;
   justify-content: center;
   flex-shrink: 0;
}

.hg-directory-media img {
   width: 100%;
   height: 100%;
   object-fit: contain;
   padding: 10px;
}

.hg-directory-body {
   padding: 16px;
   display: flex;
   flex-direction: column;
   flex: 1;
}

/* Facts read as a run of short phrases rather than a stack of labelled rows: at this size the labels
   cost more room than they earn, and the values are self-describing. */
.hg-directory-facts {
   margin-top: 12px;
   display: flex;
   flex-wrap: wrap;
   gap: 4px 10px;
   font-size: 12px;
   color: var(--hg-gray);
}

.hg-directory-facts > span + span::before {
   content: "·";
   margin-right: 10px;
}

.hg-directory-body > a:last-child {
   margin-top: auto;
}

/* ── Cards and content ───────────────────────────────────────────────────── */

.hg-card {
   background: var(--hg-white);
   border-radius: var(--hg-radius);
   box-shadow: var(--hg-shadow);
}

.hg-card-pad {
   padding: 16px;
}

.hg-muted {
   color: var(--hg-gray);
}

.hg-sm {
   font-size: 13px;
}

.hg-xs {
   font-size: 12px;
}

.hg-label {
   font-size: 12px;
   font-weight: 600;
   letter-spacing: 0.06em;
   text-transform: uppercase;
   color: var(--hg-gray);
}

.hg-num {
   font-family: var(--hg-display);
   font-weight: 600;
   letter-spacing: -0.02em;
}

.hg-divider {
   height: 1px;
   background: var(--hg-line);
   border: 0;
   margin: 0;
}

.hg-listrow {
   display: flex;
   align-items: center;
   gap: 12px;
   min-height: 56px;
}

.hg-icobox {
   width: 44px;
   height: 44px;
   border-radius: 11px;
   background: var(--hg-green-pale);
   display: flex;
   align-items: center;
   justify-content: center;
   flex-shrink: 0;
}

.hg-icobox-warn {
   background: var(--hg-warn-bg);
}

.hg-icobox-mute {
   background: var(--hg-bg);
}

/* ── Pills ───────────────────────────────────────────────────────────────── */

.hg-pill {
   display: inline-flex;
   align-items: center;
   gap: 5px;
   border-radius: 999px;
   font-size: 12px;
   font-weight: 600;
   line-height: 1.3;
   padding: 4px 10px;
   white-space: nowrap;
}

.hg-pill-ok {
   background: var(--hg-green-pale);
   color: var(--hg-green-dark);
}

.hg-pill-warn {
   background: var(--hg-warn-bg);
   color: var(--hg-warn-ink);
}

.hg-pill-mute {
   background: var(--hg-bg);
   color: var(--hg-gray);
}

.hg-pill-lime {
   background: var(--hg-lime);
   color: var(--hg-green-deep);
}


/* ── Buttons ─────────────────────────────────────────────────────────────────
   48px, in px not rem, so the type scale can never shrink a thumb target below the 44px floor
   Apple's HIG and WCAG 2.2 AA both ask for. */

.hg-btn {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 8px;
   min-height: 48px;
   padding: 0 20px;
   border-radius: 12px;
   border: 0;
   font-family: var(--hg-body);
   font-size: 16px;
   font-weight: 600;
   text-align: center;
   cursor: pointer;
}

.hg-btn:disabled {
   opacity: 0.5;
   cursor: default;
}

/* "Not ready yet" without being unavailable — see the sign-in code button for why that distinction
   matters. Skipped while :disabled so the two never stack into a fainter button still. */
.hg-btn.hg-dim:not(:disabled) {
   opacity: 0.5;
}

.hg-btn-primary {
   background: var(--hg-green-dark);
   color: #fff;
}

.hg-btn-primary:hover:not(:disabled) {
   background: var(--hg-green-deep);
   color: #fff;
}

.hg-btn-outline {
   background: transparent;
   color: var(--hg-green-dark);
   border: 1.5px solid var(--hg-green-border);
}

.hg-btn-outline:hover:not(:disabled) {
   background: var(--hg-green-pale);
   color: var(--hg-green-dark);
}

.hg-btn-danger {
   background: transparent;
   color: var(--hg-danger);
   border: 1.5px solid #e8cdc9;
}

.hg-btn-sm {
   min-height: 44px;
   font-size: 14px;
   padding: 0 16px;
}

.hg-btn-block {
   width: 100%;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */

.hg-field {
   display: flex;
   flex-direction: column;
   gap: 8px;
}

.hg-input,
.hg-textarea {
   width: 100%;
   min-height: 52px;
   border: 1.5px solid var(--hg-line);
   border-radius: 12px;
   padding: 12px 15px;
   font-family: var(--hg-body);
   font-size: 16px;
   color: var(--hg-ink);
   background: var(--hg-white);
}

.hg-textarea {
   min-height: 120px;
   line-height: 1.5;
   resize: vertical;
}

/* A <select> needs its chevron drawn here rather than by the browser. Chrome pins the native arrow to the
   inline end of the BORDER box, not the padding box — verified side by side, a select with 12px of
   right padding and one with 38px put the arrow in exactly the same place, hard against the rounded
   border. So padding alone cannot buy it any breathing room; appearance:none and a background chevron can,
   and they also stop the control looking like three different widgets across macOS, Windows and Linux
   inside a design system that draws everything else itself.

   Geometry: the chevron is 12px wide, inset 14px, so the text stops 38px in and clears it by 12px — the
   same gap the text has from the left border.

   Typed as select.hg-input (0,1,1) so it also outranks .hg-input-sm's `padding` shorthand (0,1,0) further
   down the file — a small select is still a select and must not lose the clearance by being short. */
select.hg-input {
   appearance: none;
   -webkit-appearance: none;
   padding-right: 38px;
   background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 9 7 7 7-7'/%3E%3C/svg%3E");
   background-repeat: no-repeat;
   background-position: right 14px center;
   background-size: 12px 12px;
}

.hg-input:focus,
.hg-textarea:focus {
   outline: 0;
   border-color: var(--hg-green);
   box-shadow: 0 0 0 3px rgba(58, 125, 68, 0.14);
}

/* A switch drawn from a real checkbox rather than a div, so x-model binds to it directly and it keeps
   the native label association, focus ring and keyboard behaviour. appearance:none removes the browser
   control and leaves an element we can paint from the tokens. */
.hg-switch {
   appearance: none;
   -webkit-appearance: none;
   width: 50px;
   height: 30px;
   flex-shrink: 0;
   border: 0;
   border-radius: 999px;
   background: var(--hg-line);
   position: relative;
   cursor: pointer;
   margin: 0;
   transition: background-color 0.15s ease;
}

.hg-switch::after {
   content: "";
   position: absolute;
   top: 3px;
   left: 3px;
   width: 24px;
   height: 24px;
   border-radius: 999px;
   background: #fff;
   box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
   transition: transform 0.15s ease;
}

.hg-switch:checked {
   background: var(--hg-green-dark);
}

.hg-switch:checked::after {
   transform: translateX(20px);
   box-shadow: none;
}

.hg-switch:disabled {
   opacity: 0.5;
   cursor: default;
}

/* The whole row is the hit area, so a 30px control still gets a 56px target. */
.hg-switch-row {
   display: flex;
   align-items: center;
   gap: 14px;
   min-height: 56px;
   cursor: pointer;
}

.hg-switch-row > span {
   flex: 1;
   min-width: 0;
   font-size: 15px;
}

@media (prefers-reduced-motion: reduce) {
   .hg-switch,
   .hg-switch::after {
      transition: none;
   }
}

/* ── Rich text field ───────────────────────────────────────────────────────────
   Pages/Portal/_HtmlEditor.cshtml. Drawn to sit beside .hg-input / .hg-textarea — same border, radius
   and focus ring — so the bio does not read as a different kind of control from the fields above it.
   The toolbar wraps rather than scrolls: every button keeps its 44px target on a phone, and a control
   that has wrapped out of sight is still reachable. */

.hg-editor {
   border: 1.5px solid var(--hg-line);
   border-radius: 12px;
   background: var(--hg-white);
   position: relative;
}

/* :focus-within rather than :focus — the element that actually takes focus is the contenteditable
   inside, so the ring has to be painted by the wrapper. */
.hg-editor:focus-within {
   border-color: var(--hg-green);
   box-shadow: 0 0 0 3px rgba(58, 125, 68, 0.14);
}

.hg-editor-bar {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 2px;
   padding: 4px 6px;
   border-bottom: 1px solid var(--hg-line);
}

.hg-editor-grp {
   display: flex;
   align-items: center;
   gap: 2px;
}

.hg-editor-sep {
   width: 1px;
   align-self: stretch;
   margin: 4px 6px;
   background: var(--hg-line);
}

.hg-editor-btn {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   width: 44px;
   height: 44px;
   padding: 0;
   border: 0;
   border-radius: 10px;
   background: transparent;
   color: var(--hg-gray);
   cursor: pointer;
}

.hg-editor-btn:hover {
   background: var(--hg-bg);
   color: var(--hg-ink);
}

.hg-editor-btn-on {
   background: var(--hg-green-pale);
   color: var(--hg-green-dark);
}

.hg-editor-body {
   min-height: 120px;
   padding: 12px 15px;
   font-family: var(--hg-body);
   font-size: 16px;
   line-height: 1.5;
   color: var(--hg-ink);
   overflow-wrap: break-word;
}

.hg-editor-body:focus {
   outline: 0;
}

/* The empty state is a class, not :empty — Squire holds an empty editor as <p><br></p>, which has a
   child and so never matches :empty. portalHtmlEditor.refreshEmpty() sets it from textContent. */
.hg-editor-empty[data-placeholder]::before {
   content: attr(data-placeholder);
   color: var(--hg-gray);
   pointer-events: none;
   display: block;
   height: 0;
}

/* Squire emits <p> for every block; the browser default margin would open a gap the field is too
   short to spend. */
.hg-editor-body > p {
   margin: 0 0 8px;
}

.hg-editor-body > p:last-child {
   margin-bottom: 0;
}

.hg-editor-body ul,
.hg-editor-body ol {
   margin: 0 0 8px;
   padding-left: 22px;
}

.hg-editor-body a {
   color: var(--hg-green);
}

/* Read-only (a company the member may not administer): no toolbar, and the paper tone of a value
   being shown rather than a control that has been switched off. */
.hg-editor-readonly {
   background: var(--hg-bg);
}

.hg-editor-readonly:focus-within {
   border-color: var(--hg-line);
   box-shadow: none;
}

.hg-editor-link {
   display: flex;
   align-items: center;
   gap: 8px;
   padding: 8px;
   border-top: 1px solid var(--hg-line);
   background: var(--hg-cream);
   border-radius: 0 0 11px 11px;
}

/* ── Mail action tiles ───────────────────────────────────────────────────────
   Replaces a row of unlabelled buttons. Each tile states what the action does before it is chosen, which
   matters most on the two that are irreversible: shredding and returning to sender. */

.hg-action-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
   gap: 10px;
   margin-top: 14px;
}

.hg-action-tile {
   text-align: left;
   background: var(--hg-white);
   border: 1.5px solid var(--hg-line);
   border-radius: var(--hg-radius);
   padding: 14px;
   min-height: 76px;
   display: flex;
   flex-direction: column;
   gap: 4px;
   cursor: pointer;
   font-family: var(--hg-body);
}

.hg-action-tile:hover:not(:disabled) {
   border-color: var(--hg-green-border);
   background: var(--hg-green-50);
}

.hg-action-tile.hg-on {
   border-color: var(--hg-green-dark);
   background: var(--hg-green-50);
   box-shadow: 0 0 0 3px rgba(58, 125, 68, 0.14);
}

.hg-action-tile:disabled {
   opacity: 0.55;
   cursor: default;
}

.hg-action-name {
   font-size: 15px;
   font-weight: 700;
   color: var(--hg-ink);
}

.hg-action-note {
   font-size: 12px;
   color: var(--hg-gray);
}

/* ── Notices ─────────────────────────────────────────────────────────────── */

.hg-note {
   border-radius: var(--hg-radius);
   padding: 14px 16px;
   display: flex;
   gap: 11px;
   font-size: 14px;
}

.hg-note svg {
   flex-shrink: 0;
   margin-top: 1px;
}

.hg-note-ok {
   background: var(--hg-green-50);
   border: 1px solid var(--hg-green-border);
   color: var(--hg-green-dark);
}

.hg-note-warn {
   background: var(--hg-warn-bg);
   border: 1px solid var(--hg-warn-line);
   color: var(--hg-warn-ink);
}

.hg-note-error {
   background: #fdf1ef;
   border: 1px solid #f0d5d0;
   color: var(--hg-danger);
}

/* ── Empty and loading states ────────────────────────────────────────────── */

.hg-empty {
   background: var(--hg-white);
   border-radius: var(--hg-radius);
   box-shadow: var(--hg-shadow);
   padding: 40px 24px;
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   text-align: center;
   gap: 12px;
}

.hg-empty-icon {
   width: 64px;
   height: 64px;
   border-radius: 999px;
   background: var(--hg-green-50);
   display: flex;
   align-items: center;
   justify-content: center;
}

.hg-empty p {
   margin: 0;
   max-width: 34ch;
   color: var(--hg-gray);
   font-size: 14px;
}

/* An empty state that can offer a way forward rather than only explaining itself. The extra top margin sits
   on top of .hg-empty's 12px gap, so the action reads as a response to the message instead of another line
   of it. */
.hg-empty-action {
   margin-top: 4px;
}

.hg-skeleton {
   background: var(--hg-bg);
   border-radius: var(--hg-radius);
   position: relative;
   overflow: hidden;
}

.hg-skeleton::after {
   content: "";
   position: absolute;
   inset: 0;
   background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
   animation: hg-shimmer 1.4s infinite;
}

@keyframes hg-shimmer {
   100% {
      transform: translateX(100%);
   }
}

@media (prefers-reduced-motion: reduce) {
   .hg-skeleton::after {
      animation: none;
   }
}

/* ── Segmented control ───────────────────────────────────────────────────────
   Two mutually exclusive views of the same list (Upcoming / Past). A radio group would be the honest
   control, but the selection here triggers a fetch rather than carrying a form value, so these are
   buttons and the chosen one is announced with aria-pressed. */

.hg-seg {
   display: grid;
   grid-auto-flow: column;
   grid-auto-columns: minmax(0, 1fr);
   background: var(--hg-bg);
   border-radius: 12px;
   padding: 4px;
}

/* 44px, not the mockup's 40 — the design system commits to a 44px thumb target everywhere and a segmented
   control is tapped as often as anything on the page. */
.hg-seg button {
   min-height: 44px;
   border: 0;
   background: transparent;
   border-radius: 9px;
   font-family: var(--hg-body);
   font-size: 14px;
   font-weight: 600;
   color: var(--hg-gray);
   cursor: pointer;
}

.hg-seg button.hg-on {
   background: var(--hg-white);
   color: var(--hg-ink);
   font-weight: 700;
   box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

/* A segmented control that filters the list below its heading — All/Unpaid on Billing, Upcoming/Past on
   Book. It lives INSIDE .hg-p-sectionhead so that one element can be both shapes: a full-width two-up
   control on its own line under the title on a phone, which is what the phone mocks draw, and a
   content-width control at the right of the heading row from 768px up, which is what the desktop ones do.
   Deliberately not .hg-viewtoggle, which takes that right-hand slot at every width — a view control is
   small enough to sit beside a title on a phone and a filter with a count in it is not. */
.hg-listfilter {
   flex: 1 0 100%;
   margin-top: 2px;
}

/* ── Horizontal pickers ──────────────────────────────────────────────────────
   The day strip scrolls sideways rather than wrapping, so the row keeps a predictable height whatever it
   holds. The scrollbar is hidden because the content is obviously swipeable and a visible bar under a row
   of 56px tiles reads as a rendering fault. */

.hg-scrollrow {
   display: flex;
   gap: 8px;
   overflow-x: auto;
   scrollbar-width: none;
   -webkit-overflow-scrolling: touch;
}

.hg-scrollrow::-webkit-scrollbar {
   display: none;
}

.hg-day {
   flex: 0 0 auto;
   width: 56px;
   min-height: 62px;
   padding: 9px 0;
   border: 0;
   border-radius: 12px;
   background: var(--hg-bg);
   font-family: var(--hg-body);
   color: var(--hg-ink);
   text-align: center;
   cursor: pointer;
}

/* Both are block, so the two lines stack inside the button rather than sitting side by side and
   overflowing a 56px tile. */
.hg-day-dow {
   display: block;
   font-size: 11px;
   font-weight: 600;
   color: var(--hg-gray);
}

.hg-day-num {
   display: block;
   font-family: var(--hg-display);
   font-weight: 600;
   letter-spacing: -0.02em;
   font-size: 19px;
   margin-top: 2px;
}

.hg-day.hg-on {
   background: var(--hg-green-dark);
   color: #fff;
}

.hg-day.hg-on .hg-day-dow {
   color: rgba(255, 255, 255, 0.75);
}

/* Past the resource's AdvanceBookingDays. Still rendered rather than dropped, so the strip does not
   silently shorten and leave the member guessing which days exist. */
.hg-day:disabled {
   opacity: 0.45;
   cursor: default;
}

/* Stepping the day window. Deliberately not .hg-p-iconbtn, which is white-on-translucent for the dark top
   bar and would be invisible on a white card. */

.hg-stepbtn {
   flex: 0 0 auto;
   min-width: 44px;
   min-height: 44px;
   border: 1.5px solid var(--hg-line);
   border-radius: 11px;
   background: var(--hg-white);
   color: var(--hg-ink);
   display: inline-flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
}

.hg-stepbtn:hover:not(:disabled) {
   background: var(--hg-green-pale);
   border-color: var(--hg-green-border);
   color: var(--hg-green-dark);
}

.hg-stepbtn:disabled {
   opacity: 0.4;
   cursor: default;
}

/* The jump-to-a-date row under the strip. Wraps on a narrow phone rather than squeezing the input. */
.hg-daymeta {
   display: flex;
   align-items: center;
   flex-wrap: wrap;
   gap: 10px;
   margin-top: 12px;
}

.hg-daymeta label {
   white-space: nowrap;
}

/* A date input, or a select of short fixed options, has no free text to accommodate, so it does not need
   the full-width 52px treatment the rest of the form controls get. Still 44px tall, because it is still
   tapped. On a select, select.hg-input's inline-end padding still applies over this shorthand — see there. */
.hg-input-sm {
   width: auto;
   min-height: 44px;
   padding: 8px 12px;
   font-size: 15px;
}

/* ── Length-first picker ─────────────────────────────────────────────────────
   Lifted from site.css's .hg-len-chip / .hg-start-pill so the portal's booking flow feels like the one on
   the public site, with the rem values resolved at this layout's 16px root and the Cosmo blue selected
   state remapped to Spoke green. Length is asked before start time deliberately: how long a member needs
   the room is what decides which start times can be offered at all.

   Both controls hold two shapes and the markup is one tree either way, because the thing that decides
   between them is the data rather than the viewport: a handful of common lengths with Custom behind them,
   or the full ladder as a <select>; start times as pills, or — past eight of them — as a <select> too.
   A media query could not make either call, since how many starts a day offers is not a width. */

.hg-picklegend {
   font-size: 15px;
   font-weight: 600;
   margin: 0 0 9px;
}

.hg-lenchips,
.hg-startlist {
   display: flex;
   flex-wrap: wrap;
   gap: 8px;
}

.hg-lenchip {
   min-height: 44px;
   background: var(--hg-white);
   border: 1px solid #cfd4da;
   border-radius: 32px;
   display: inline-flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   padding: 6px 15px;
   line-height: 1.15;
   font-family: var(--hg-body);
   font-size: 15px;
   font-weight: 600;
   color: var(--hg-ink);
   cursor: pointer;
}

.hg-lenchip.hg-on {
   background: var(--hg-green-dark);
   border-color: var(--hg-green-dark);
   color: #fff;
}

.hg-lenchip.hg-on .hg-lennote {
   color: var(--hg-green-border);
}

/* A length this day has no room for. Hatched as well as faded, so it stays distinguishable without relying
   on the contrast difference alone — and left clickable, because a click is what produces the sentence
   naming the day's actual ceiling. aria-disabled carries that to a screen reader; :disabled would take the
   chip out of the tab order and silence the explanation with it.

   The key's swatch below is named in the same rule rather than given a copy of the gradient, so the two
   cannot drift apart. Doubled up as .hg-lenchip.hg-lenchip-off to match .hg-lenchip.hg-on's specificity:
   a chosen length can also be one this day cannot hold — pick 4 hours, then page to a busier day — and
   .hg-on's `background` shorthand resets background-image, so a single class lost the hatching on exactly
   the chip the legend was pointing at. Equal specificity and later in the file, so this one wins. */
.hg-lenchip.hg-lenchip-off,
.hg-lenkey-swatch-off {
   opacity: 0.5;
   background-image: repeating-linear-gradient(45deg,
         rgba(0, 0, 0, 0.05) 0, rgba(0, 0, 0, 0.05) 3px,
         transparent 3px, transparent 8px);
}

/* Custom is an escape hatch, not a sixth length, so it is drawn as one: dashed, and without the solid
   border the real choices share. It still sits in the same row because it answers the same question. */
.hg-lenchip-custom {
   border-style: dashed;
   color: var(--hg-green-dark);
}

.hg-lenchip-custom span:first-child {
   display: inline-flex;
   align-items: center;
   gap: 5px;
}

/* The Custom dropdown and its way back, on one line. The pair wraps rather than squeezing when the picker
   column is narrow, and the select takes the slack between them — up to a point: the longest option it can
   hold is "8 hours — Full Day, 25% off", about 262px with the chevron's clearance, and left uncapped it
   stretched to 566px in a full-width card to show text that needed less than half of it. */
.hg-lencustom {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 8px;
}

.hg-lencustom .hg-input {
   flex: 1 1 200px;
   min-width: 0;
   max-width: 300px;
}

/* What the hatching means. Docs/design/member-portal/parts/body-DesktopBooking.html adds a key rather than
   leaving the state to be guessed at, and the reason survives the move from start pills to length chips:
   the member is looking at a faded, striped control with no caption. Drawn at every width, not just the
   artboard's, because the question it answers is not a desktop question.

   The swatches are the chips themselves, shrunk: same border, same fill, same gradient, so the key
   restyles with what it describes. */
.hg-lenkey {
   display: flex;
   flex-wrap: wrap;
   gap: 8px 20px;
   margin-top: 16px;
   font-size: 12px;
   color: var(--hg-gray);
}

.hg-lenkey-item {
   display: flex;
   align-items: center;
   gap: 8px;
}

.hg-lenkey-swatch {
   width: 34px;
   height: 20px;
   flex-shrink: 0;
   border: 1px solid #cfd4da;
   border-radius: 999px;
   background: var(--hg-white);
}

.hg-lenkey-swatch-on {
   background: var(--hg-green-dark);
   border-color: var(--hg-green-dark);
}

.hg-lennote {
   font-size: 11px;
   font-weight: 600;
   color: var(--hg-green);
}

/* Green is the colour of a saving that is on offer, and on these two chips it is not one: on a hatched
   chip the tier belongs to a length this day has no room for, and on Custom "any length" is not a discount
   at all. Both read as grey in the mocks for the same reason (parts/_head.html's .lenchip-off .lennote,
   .lenchip-custom .lennote). */
.hg-lenchip.hg-lenchip-off .hg-lennote,
.hg-lenchip-custom .hg-lennote {
   color: var(--hg-gray);
}

.hg-startpill {
   min-height: 44px;
   min-width: 92px;
   background: var(--hg-white);
   border: 1px solid #cfd4da;
   border-radius: 8px;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   padding: 6px 13px;
   font-family: var(--hg-body);
   font-size: 15px;
   font-weight: 600;
   color: var(--hg-ink);
   cursor: pointer;
}

.hg-startpill.hg-on {
   background: var(--hg-green-dark);
   border-color: var(--hg-green-dark);
   color: #fff;
}

/* The overflow picker. .hg-input-sm sizes a select to its content, which on a list of times is about
   110px — narrow enough to read as a stray control rather than the answer to the legend above it. Given a
   floor instead, and the freedom to grow with the column up to a width a time never needs to exceed. */
.hg-startselect {
   width: 100%;
   max-width: 260px;
}

.hg-nudge {
   display: flex;
   align-items: center;
   gap: 6px;
   margin-top: 10px;
   font-size: 12px;
   font-weight: 600;
   color: var(--hg-green);
}

/* ── Space picker ────────────────────────────────────────────────────────────
   A radio group drawn as cards. The whole card is the label, so the hit area is the card rather than a
   dot beside it; the real input stays in the DOM (visually hidden, not display:none) so it keeps its
   role, its keyboard behaviour and its :checked state, which is what the selected styling hangs off. */

.hg-spacelist {
   display: grid;
   gap: 10px;
}

.hg-space {
   position: relative;
   display: flex;
   align-items: center;
   gap: 13px;
   padding: 14px 16px;
   min-height: 76px;
   background: var(--hg-white);
   border: 2px solid transparent;
   border-radius: var(--hg-radius);
   box-shadow: var(--hg-shadow);
   cursor: pointer;
}

.hg-space input {
   position: absolute;
   width: 1px;
   height: 1px;
   opacity: 0;
   pointer-events: none;
}

/* .hg-on is bound by Alpine and is what actually carries the selection; the :has() rule beside it keeps the
   border correct for the instant between a native click checking the radio and Alpine's async handler
   settling, and if scripting fails mid-page it still tracks the real control. Two selectors rather than one
   because neither covers both cases: :has() alone would drop the state on a browser without it, and the
   class alone would lag the click. */
.hg-space.hg-on,
.hg-space:has(input:checked) {
   border-color: var(--hg-green-dark);
}

.hg-space:has(input:focus-visible) {
   outline: 2px solid var(--hg-green-dark);
   outline-offset: 2px;
}

.hg-space-media {
   width: 48px;
   height: 48px;
   border-radius: 12px;
   background: var(--hg-green-pale);
   display: flex;
   align-items: center;
   justify-content: center;
   flex-shrink: 0;
   overflow: hidden;
}

.hg-space-media img {
   width: 100%;
   height: 100%;
   object-fit: cover;
}

.hg-space-body {
   flex: 1;
   min-width: 0;
}

/* Block, because the card's body is a <span> — the whole card is a <label> wrapping a radio, and a <div>
   is not permitted inside one. */
.hg-space-name {
   display: block;
   font-size: 16px;
   font-weight: 600;
}

/* ── Booking composer ────────────────────────────────────────────────────────
   The length/start picker and the price card, wrapped together so that on a wide screen they can become
   the artboard's picker-and-rail row (see the 1200px block near the end of this file).

   display:contents is what makes one markup tree enough for both shapes: below that width this wrapper
   generates no box at all, and its children stay direct children of the stack above — laid out by that
   stack's own gap, in the order they were already in, exactly as if it had never been added. */
.hg-bk-compose {
   display: contents;
}

/* ── Price breakdown ─────────────────────────────────────────────────────── */

.hg-priceline {
   display: flex;
   align-items: baseline;
   justify-content: space-between;
   gap: 10px;
   font-size: 15px;
}

.hg-priceline-off {
   color: var(--hg-green-dark);
}

.hg-priceline-off span:last-child {
   font-weight: 600;
}

.hg-priceline-total {
   font-size: 17px;
   font-weight: 600;
}

.hg-priceline-total .hg-num {
   font-size: 26px;
}

/* ── Sticky summary bar ──────────────────────────────────────────────────────
   Carries the running selection and the action that commits it. position: sticky rather than fixed, so it
   needs no knowledge of the rail: a fixed bar is positioned against the viewport and would have to be
   offset by the rail's 232px on desktop, re-deriving a number the shell already owns. It clears the tab
   bar on a phone, where the nav is fixed to the bottom, and sits flush on desktop where the nav is a
   rail. The negative margins pull it out to the full width of the page's padding. */

.hg-p-bar {
   position: sticky;
   bottom: var(--hg-tabbar-h);
   z-index: 15;
   display: flex;
   align-items: center;
   gap: 12px;
   margin: 4px -16px -16px;
   padding: 12px 16px;
   background: var(--hg-white);
   border-top: 1px solid var(--hg-line);
   box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.hg-p-bar-text {
   flex: 1;
   min-width: 0;
}

/* ── Booking cards ───────────────────────────────────────────────────────────
   A booking happening today is called out with a lime edge rather than another badge, so the eye finds it
   while scanning the left margin of the list. */

.hg-bookingcard-now {
   border-left: 3px solid var(--hg-lime);
}

@media (min-width: 768px) {
   .hg-spacelist {
      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
   }

   .hg-picklegend {
      font-size: 17px;
   }

   .hg-p-bar {
      bottom: 0;
      margin: 4px -32px -32px;
      padding: 16px 32px;
   }
}

/* ── Desktop ─────────────────────────────────────────────────────────────────
   768px is where site.css already switches the root font, so the portal changes shape on the same
   line rather than introducing a second breakpoint to reason about. */

@media (min-width: 768px) {
   .hg-p-app {
      flex-direction: row;
   }

   /* The document scrolls, not this element. It used to be its own scroll container
      (overflow-y: auto; max-height: 100vh), which put a scrollbar *inside* the layout: a ~15px gutter
      down the right of the content, and because .hg-p-main paints no background of its own that gutter
      showed the white body straight through — a white stripe beside the green header. Letting the page
      scroll normally moves the scrollbar to the window edge where it belongs. The rail stays put on its
      own, being position: sticky; top: 0. */
   .hg-p-main {
      flex: 1;
      min-width: 0;
      padding-bottom: 0;
   }

   .hg-p-wrap {
      max-width: 1100px;
      margin: 0 auto;
      padding: 32px;
      gap: 20px;
   }

   .hg-p-stack {
      gap: 20px;
   }

   /* The tab bar becomes the rail. Same element, same links, same active state. */
   .hg-p-nav {
      position: sticky;
      top: 0;
      left: auto;
      right: auto;
      bottom: auto;
      width: 232px;
      flex-shrink: 0;
      height: 100vh;
      /* No right border. --hg-line is #e5e7eb, meant for hairlines between white cards, and against the
         deep-green rail it read as a white stripe down the side of the nav. The rail already ends where
         its colour does; it needs no help. */
      border-top: 0;
      border-right: 0;
      background: var(--hg-green-deep);
      padding: 20px 14px;
      display: flex;
      flex-direction: column;
      gap: 4px;
   }

   .hg-p-nav a {
      flex-direction: row;
      justify-content: flex-start;
      gap: 12px;
      min-height: 46px;
      padding: 0 14px;
      border-radius: 11px;
      font-size: 15px;
      color: rgba(255, 255, 255, 0.66);
   }

   .hg-p-nav a:hover {
      background: rgba(255, 255, 255, 0.08);
      color: #fff;
   }

   .hg-p-nav a.hg-on {
      background: rgba(255, 255, 255, 0.11);
      color: #fff;
   }

   .hg-p-nav svg {
      width: 20px;
      height: 20px;
   }

   /* The brand sits in the rail on desktop, so the dark top bar is redundant there. */
   .hg-p-topbar {
      display: none;
   }

   .hg-p-nav-brand {
      display: flex;
      align-items: center;
      gap: 11px;
      padding: 4px 12px 24px;
      color: #fff;
      font-family: var(--hg-display);
      font-size: 20px;
      font-weight: 600;
   }

   /* A tenant logo is whatever shape it was uploaded in, so cap both axes and let the wordmark beside it
      keep the rest of the rail. Sized to sit with the 30px wheel it replaces. */
   .hg-p-nav-brand img {
      max-height: 34px;
      max-width: 46px;
      width: auto;
      height: auto;
      flex: none;
   }

   /* No tab bar means no sheets: the You and More buttons, the scrim behind an open one and the overflow
      panel itself are all phone furniture. .hg-p-nav-sheet is in the overflow panel's selector to match
      the specificity of .hg-p-nav-sheet.hg-p-nav-open above, which this has to outrank if a phone-sized
      window is stretched with the menu open. */
   .hg-p-nav .hg-p-nav-tab,
   .hg-p-nav-scrim,
   .hg-p-nav-scrim.hg-p-nav-open,
   .hg-p-nav-sheet.hg-p-nav-more-sheet,
   .hg-p-nav-sheet-title {
      display: none;
   }

   /* The You sheet IS the rail's foot up here — same element, panel chrome stripped and back in the
      flow. Same specificity trick, same reason. */
   .hg-p-nav-sheet.hg-p-nav-you-sheet {
      display: flex;
      position: static;
      margin-top: auto;
      max-height: none;
      overflow: visible;
      padding: 0;
      background: none;
      border: 0;
      border-radius: 0;
      box-shadow: none;
      animation: none;
   }

   .hg-p-nav-sheet-note {
      padding: 8px 12px;
      font-size: 12px;
      color: rgba(255, 255, 255, 0.55);
   }

   /* .hg-linkbtn is green-dark, which is all but invisible on the rail. */
   .hg-p-nav-retry {
      min-height: 32px;
      padding: 0 8px;
      font-size: 12px;
      color: #fff;
   }

   .hg-p-nav-retry:hover:not(:disabled) {
      color: var(--hg-lime);
   }

   .hg-p-profile-list {
      max-height: 35vh;
      overflow-y: auto;
   }

   /* Colours only — the shape of these rows is shared with the phone sheet further up the file. The
      .hg-p-nav a prefix is load-bearing: without it the shared rules, which are the same specificity as
      the ones being overridden here, would keep their ink-on-white palette against the deep-green rail. */
   .hg-p-nav a.hg-p-profile-link {
      color: rgba(255, 255, 255, 0.66);
   }

   .hg-p-nav a.hg-p-profile-link:hover,
   .hg-p-nav a.hg-p-profile-link.hg-on {
      background: rgba(255, 255, 255, 0.1);
      color: #fff;
   }

   .hg-p-profile-copy strong {
      color: #fff;
      font-size: 14px;
   }

   .hg-p-profile-copy small {
      color: rgba(255, 255, 255, 0.55);
   }

   .hg-p-nav a.hg-p-signout-link {
      min-height: 40px;
      padding: 0 14px;
      font-size: 13px;
      color: rgba(255, 255, 255, 0.66);
   }

   /* ── The pages' own desktop shape ──────────────────────────────────────────
      Everything above this point is the shell. These are the bands that were otherwise the phone layout
      made wider — Docs/design/member-portal/parts/body-DesktopBooking.html and body-DesktopBilling.html.
      The booking composer's split into a picker and a rail needs more room than 768px leaves once the
      rail and the gutters have taken theirs, so it has a block of its own further down. */

   /* The filter joins the heading's row and sizes to its own labels. Left full width, "All" was a 500px
      button with a 500px "Unpaid" beside it. */
   .hg-listfilter {
      flex: 0 0 auto;
      margin: 0 0 0 auto;
      grid-auto-columns: auto;
   }

   .hg-listfilter button {
      padding: 0 18px;
   }

   /* The description is the column worth the room, and this is the gentlest way to give it any. With
      table-layout left on auto a width is a hint the algorithm weighs rather than a rule it obeys, which
      is exactly what is wanted at both ends: at the 1036px column it gives the room names a line each and
      leaves the dates unwrapped, and in the 472px .hg-p-wrap has at exactly 768px it quietly gives way —
      the measured result there is 138px, not 45% — rather than push .hg-tablewrap into a scroll. */
   .hg-table th:nth-child(2),
   .hg-table td:nth-child(2) {
      width: 45%;
   }
}

/* ── Booking composer ────────────────────────────────────────────────────────
   Docs/design/member-portal/parts/body-DesktopBooking.html settles the price into a permanent right-hand
   summary rail instead of the phone's sticky bottom bar. That split gets its own line rather than the
   shell's 768px, because it is the one part of the portal that needs a width the shell does not: the nav
   rail takes 232px and .hg-p-wrap another 64px, so the picker column is the window less those 296px, less
   the 330px summary and the 20px gap beside it. A 768px window would leave it 122px.

   This line was 1200px while the start list was a row of 92px pills and needed ~554px to keep five of
   them together. There is no pill wall left to size for: past eight starts the list is a single 260px
   <select>, and at eight or fewer it is two rows at the narrowest width it is ever laid out at. So the
   binding constraint is that select plus the card's 32px of padding — 292px — and the line can come in
   to 1024px, where the picker gets 378px: the select clears by 86px and the length chips sit three to a
   row. 960px would leave 314px, clearing the select by 22px, which reads as cramped rather than compact.
   Above 1396px .hg-p-wrap's 1100px cap stops the column growing and the picker settles at 686px. */

@media (min-width: 1024px) {
   .hg-bk-compose {
      display: flex;
      align-items: flex-start;
      gap: 20px;
   }

   .hg-bk-compose > #bk-times {
      flex: 1 1 auto;
      min-width: 0;
   }

   /* Placed, not pinned. This was position:sticky back when the picker beside it was a full day's 46
      start pills and ran well past one screen, so a rail that scrolled away with it would have put the
      running total out of sight for most of the choosing. The compact picker measures 280px tall in a
      900px viewport, and a sticky box is clamped to its containing block — which is this composer — so
      there is no longer anything for it to travel over. A sticky box that never moves is only a static
      one that costs more to lay out. */
   .hg-bk-summary {
      flex: 0 0 330px;
   }

   /* The bar becomes the rail's foot without leaving its place in the markup. It cannot move into
      .hg-bk-compose: it is position:sticky, and a sticky box is clamped to its containing block, so a bar
      parked inside the composer would come unpinned the moment the bookings list below it scrolled into
      view — which is the whole reason it is the last child of the page's stack to begin with. So it stays
      last and narrows onto the rail's column instead, squared off as a card rather than run out to the
      full bleed, and the price above and the action below read as one right-hand rail.

      .hg-bk-bar, not a bare .hg-p-bar: the floor-plan viewer wears the same bar (.hg-p-bar.hg-fp-bar in
      FloorPlan.cshtml, deliberately, so the two agree about what a standing action looks like), and it has
      no rail for one to be the foot OF. Unscoped, these rules turned its full-width selection bar into a
      330px column up here and stretched its Book and close buttons across it — a close X 330px wide. */
   .hg-p-bar.hg-bk-bar {
      flex-direction: column;
      align-items: stretch;
      gap: 12px;
      width: 330px;
      margin: 4px 0 0 auto;
      padding: 16px;
      border: 1px solid var(--hg-line);
      border-radius: var(--hg-radius);
      box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
   }

   .hg-p-bar.hg-bk-bar .hg-btn {
      width: 100%;
   }
}

/* Both are desktop-rail furniture. display:none rather than visibility, because .hg-p-nav is a
   grid-auto-flow:column grid on a phone and either one left visible would claim a column of its own,
   squashing the tabs beside it.

   The brand needs `.hg-p-nav a` in its selector, not `.hg-p-nav-brand` alone: the base rule above is
   `.hg-p-nav a` at specificity (0,1,1), which beats a bare class at (0,1,0), so `display: flex` won and
   the wordmark rendered as a fifth tab.

   .hg-p-nav-foot used to be hidden here too, and is not any more: on a phone it is the body of the You
   sheet, which x-show already keeps closed until the tab is pressed. .hg-p-nav-desktop is no longer worn
   by anything — Companies gave it up for the overflow menu — but it is kept as the way to hold a future
   destination back from phones entirely, which the overflow deliberately does not do. */
@media (max-width: 767.98px) {
   .hg-p-nav a.hg-p-nav-brand,
   .hg-p-nav a.hg-p-nav-desktop {
      display: none;
   }
}
/* ── Visually hidden ─────────────────────────────────────────────────────────
   Text that exists for assistive technology and not for the eye. Kept in the flow with a 1px clip rather
   than display:none or visibility:hidden, both of which take an element out of the accessibility tree —
   which is the one place this content is meant to be. */

.hg-sr-only {
   position: absolute;
   width: 1px;
   height: 1px;
   margin: -1px;
   padding: 0;
   overflow: hidden;
   clip-path: inset(50%);
   white-space: nowrap;
   border: 0;
}

/* A text-only action: less weight than .hg-btn-outline, still a 44px target. For the third choice on a
   screen that already has a primary and a secondary — "skip this", "use it anyway", "start over" —
   where an outlined button would read as a peer of the two real ones. */
.hg-linkbtn {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 6px;
   min-height: 44px;
   padding: 0 12px;
   background: none;
   border: 0;
   font-family: var(--hg-body);
   font-size: 14px;
   font-weight: 600;
   color: var(--hg-green-dark);
   cursor: pointer;
}

.hg-linkbtn:hover:not(:disabled) {
   color: var(--hg-green-deep);
}

.hg-linkbtn:disabled {
   opacity: 0.5;
   cursor: default;
}

/* An inline progress indicator for a step genuinely waiting on the network. The pages behind the sign-in
   use .hg-skeleton for that and need nothing else, but a Form 1583 upload can run for tens of seconds on
   a phone with a 10MB photo, and a line of static text reads as a hung page. Shares hg-spin with
   .hg-p-auth-spinner; drawn for a white ground rather than the sign-in's deep green. */
.hg-spinner {
   width: 16px;
   height: 16px;
   flex-shrink: 0;
   border: 2px solid var(--hg-line);
   border-top-color: var(--hg-green);
   border-radius: 50%;
   animation: hg-spin 0.8s linear infinite;
}

/* Slowed rather than stopped, same reasoning as .hg-p-auth-spinner. */
@media (prefers-reduced-motion: reduce) {
   .hg-spinner {
      animation-duration: 2.4s;
   }
}

/* A <label> wrapping a file input, drawn as a button — the only shape that reliably opens the camera roll
   on iOS without scripting a click. Pair it with .hg-btn and put the input inside carrying .hg-sr-only, NOT
   display:none: a display:none input cannot be focused, which is what left "Upload File" unreachable by
   keyboard while the real button beside it was fine. The ring goes on the label, since that is what a
   sighted keyboard user can actually see. */
.hg-filebtn:focus-within {
   outline: 2px solid var(--hg-green);
   outline-offset: 2px;
}

/* .hg-p-back is written for an anchor, and the Form 1583 wizard's Back is a button — it walks the
   wizard's own history rather than navigating anywhere. Reset the control styling the class does not
   expect to have to override. */
button.hg-p-back {
   background: none;
   border: 0;
   padding: 0;
   font-family: var(--hg-body);
   font-size: 14px;
   font-weight: 600;
   cursor: pointer;
}

/* ── Self-authenticating shell ───────────────────────────────────────────────
   A portal page reached from an emailed link and authorised by a token in its own URL, not by a session:
   today only Form 1583. _PortalLayout renders these without the nav rail or the top bar, because the
   recipient may have no portal account at all — a named pickup agent often does not — so Home, Mail and
   Sign out would all be signposts to a login screen.

   That means three of the app shell's assumptions have to be unwound: .hg-p-main reserves height for a
   tab bar that is not there, .hg-p-hero leaves room above itself for a top bar that is not there, and
   the 1100px content column exists for pages with a rail beside them. A single-task wizard set in
   1100px of white reads as a form lost on a desktop. */

.hg-p-solo .hg-p-main {
   padding-bottom: 0;
}

/* Phone only. .hg-p-hero opens with 4px of top padding because the dark top bar sits directly above it
   and the two read as one band; with no top bar there is nothing for it to butt against, so the title
   would start hard against the edge of the screen. Desktop already pads the hero to 32px and must keep
   it — this rule is scoped away from there rather than overriding it downwards. */
@media (max-width: 767.98px) {
   .hg-p-solo .hg-p-hero {
      padding-top: 22px;
   }
}

@media (min-width: 768px) {
   /* Narrow the hero's own grid track rather than capping its children. They are grid items: a max-width
      on them leaves the text at the start of a track that is still 1036px wide, while .hg-p-wrap below
      centres its own width — so the title and the cards would sit on different left edges, which is the
      very bug the track was introduced to fix.

      The track is the wrap's CONTENT width, not its outer width: .hg-p-wrap is a border-box with 32px of
      padding, so a 680px box is a 616px column. Getting that wrong is the same 32px misalignment in a new
      disguise — it is exactly why the default pair is 1100px/1036px and not 1100px/1100px. Keep the two
      numbers 64 apart. */
   .hg-p-solo .hg-p-hero {
      grid-template-columns: minmax(0, 616px);
   }

   .hg-p-solo .hg-p-wrap {
      max-width: 680px;
   }
}

/* ── Form 1583 standing band (Pages/Portal/Profile.cshtml) ───────────────────
   The member's own compliance standing, one card per filing they personally answer for. Shape comes
   straight from Docs/design/member-portal/parts/body-Profile.html: icon tile, then title and pill on one
   line, then a small muted line of dates. Everything below only exists because the real data is less
   tidy than the mock's single "Form 1583 / Complete". */

.hg-1583-standing {
   display: flex;
   align-items: flex-start;
   gap: 12px;
}

.hg-1583-standing-body {
   flex: 1;
   min-width: 0;
}

/* Wraps, where the design's row does not need to: a business/DBA filing carries the company name in the
   same line, and "Form 1583 · Northwind Collective" plus its pill runs past the edge of a 390px phone. */
.hg-1583-standing-head {
   display: flex;
   align-items: center;
   flex-wrap: wrap;
   gap: 8px;
}

.hg-1583-standing-detail {
   margin-top: 5px;
}

/* The action line — the reason this band exists. A member can be compliant TODAY and still have a
   replacement filing waiting on them, and until now an email was their only notice of it. Reuses
   .hg-note/.hg-note-warn rather than inventing an amber box, so it is the same amber as every other
   thing the portal asks of somebody. */
.hg-1583-standing-note {
   margin-top: 12px;
}

.hg-1583-standing-note .hg-btn {
   margin-top: 10px;
}

/* ── Form 1583 ID upload wizard (Pages/Portal/Form1583.cshtml) ───────────────
   Nearly every one of these uploads happens on a phone, held one-handed, often in a shop. Everything
   below is sized for a thumb first and a mouse second.

   This block used to live in Portal/css/portal.css against Bootstrap markup and a 14px root, which is
   why its touch targets were written in px to compensate. Under this stylesheet the root is 16px and
   .hg-btn is 48px on its own, so that compensation is gone rather than carried across; the px that
   remain below are hit areas on the cropper, where the reason is the original one — a finger is the
   same size whatever the type scale. */

/* ── Progress ─────────────────────────────────────────────────────────────── */

/* Sits in the hero, on the deep green, so the wizard's position is part of the masthead rather than the
   first card of the page. Lime for the travelled segments: this is a meter on a dark panel, which is one
   of the three jobs the accent is rationed to. */
/* Keeps the hero the same height whether or not Back is showing, so the title does not hop as the member
   moves between steps. .hg-p-back is min-height:44px and collapses to nothing when x-show hides it. */
.hg-1583-heroback {
   min-height: 44px;
}

.hg-1583-progress {
   margin-top: 18px;
}

.hg-1583-progress-head {
   display: flex;
   justify-content: space-between;
   align-items: baseline;
   gap: 10px;
   margin-bottom: 8px;
   font-size: 13px;
}

.hg-1583-progress-step {
   font-weight: 600;
   color: #fff;
}

.hg-1583-progress-count {
   color: rgba(255, 255, 255, 0.72);
   white-space: nowrap;
}

.hg-1583-track {
   display: flex;
   gap: 4px;
}

.hg-1583-segment {
   flex: 1 1 0;
   height: 6px;
   border-radius: 999px;
   background: rgba(255, 255, 255, 0.22);
   transition: background-color 0.25s ease;
}

.hg-1583-segment.is-done {
   background: var(--hg-lime);
}

/* ── Capture and submit screens ───────────────────────────────────────────── */

/* The "Uploading…" / "Checking the photo is readable…" row.

   The display MUST live here rather than in a style attribute beside x-show. Alpine's _x_doShow calls
   el.style.removeProperty("display") whenever it reveals an element, so an inline `display: flex` is
   deleted the first time the row is shown — measured: the row fell back to display:block and .hg-spinner,
   a <span> with no display of its own, rendered 4x19px instead of 16x16. A class survives because Alpine
   only ever writes and clears the INLINE display. */
.hg-1583-busy {
   display: flex;
   align-items: center;
   gap: 10px;
}

/* Whose filing the current screen is asking about. A household invite can walk one person through two
   different people's filings back to back, so this is not decoration. */
.hg-1583-subject {
   margin: 0 0 4px;
}

/* Take Photo and Upload File are peers, and the second is a <label> wrapping a file input rather than a
   button — the only shape that opens a camera roll on iOS without scripting the click. Stacked on a
   phone so neither is a half-width target; side by side once there is room. */
.hg-1583-actions {
   display: flex;
   flex-direction: column;
   gap: 10px;
}

@media (min-width: 576px) {
   .hg-1583-actions {
      flex-direction: row;
   }

   .hg-1583-actions > * {
      flex: 1 1 0;
   }
}

/* ── Cropper ──────────────────────────────────────────────────────────────── */

/* touch-action:none is what stops a drag on the crop box from scrolling the page out from under the
   member's thumb — without it the cropper is unusable on a phone no matter how large the handles are. */
.hg-cropper {
   position: relative;
   display: block;
   width: fit-content;
   max-width: 100%;
   margin: 0 auto;
   touch-action: none;
   user-select: none;
   -webkit-user-select: none;
   background: var(--hg-ink);
   border-radius: 12px;
   overflow: hidden;
}

.hg-cropper img {
   display: block;
   max-width: 100%;
   /* svh, not vh: mobile browsers report vh against the viewport WITHOUT their collapsing address bar,
      so a vh-sized image pushes the confirm buttons off screen exactly when the member needs them. */
   max-height: 55svh;
   -webkit-user-drag: none;
}

.hg-crop-box {
   position: absolute;
   box-sizing: border-box;
   border: 1px solid rgba(255, 255, 255, 0.9);
   cursor: move;
   /* The dimming outside the selection. A single enormous spread beats four positioned shade panels and
      can't develop seams as the box moves. */
   box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5);
}

/* The box is keyboard-operable (arrows move, Shift+arrows resize), so it has to show where focus is —
   and against a photograph a plain outline can vanish, hence the paired dark/light rings. */
.hg-crop-box:focus-visible {
   outline: 3px solid #fff;
   outline-offset: 2px;
   box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5), 0 0 0 6px rgba(0, 0, 0, 0.9);
}

/* Rule-of-thirds guides, which are what actually help someone straighten a card. */
.hg-crop-box::before,
.hg-crop-box::after {
   content: "";
   position: absolute;
   inset: 0;
   pointer-events: none;
   opacity: 0.35;
}

.hg-crop-box::before {
   border-left: 1px solid #fff;
   border-right: 1px solid #fff;
   margin: 0 33.33%;
}

.hg-crop-box::after {
   border-top: 1px solid #fff;
   border-bottom: 1px solid #fff;
   margin: 33.33% 0;
}

.hg-crop-handle {
   position: absolute;
   width: 44px;
   height: 44px;
   /* The visible corner is drawn by ::after; the element itself stays a thumb-sized target that reaches
      outside the box, so the corner can be grabbed even when the selection is small. */
   background: transparent;
   z-index: 2;
}

.hg-crop-handle::after {
   content: "";
   position: absolute;
   width: 20px;
   height: 20px;
   border: 3px solid #fff;
}

.hg-crop-handle.nw { top: -22px; left: -22px; cursor: nwse-resize; }
.hg-crop-handle.ne { top: -22px; right: -22px; cursor: nesw-resize; }
.hg-crop-handle.sw { bottom: -22px; left: -22px; cursor: nesw-resize; }
.hg-crop-handle.se { bottom: -22px; right: -22px; cursor: nwse-resize; }

.hg-crop-handle.nw::after { top: 22px; left: 22px; border-right: 0; border-bottom: 0; border-top-left-radius: 4px; }
.hg-crop-handle.ne::after { top: 22px; right: 22px; border-left: 0; border-bottom: 0; border-top-right-radius: 4px; }
.hg-crop-handle.sw::after { bottom: 22px; left: 22px; border-right: 0; border-top: 0; border-bottom-left-radius: 4px; }
.hg-crop-handle.se::after { bottom: 22px; right: 22px; border-left: 0; border-top: 0; border-bottom-right-radius: 4px; }

.hg-crop-edge {
   position: absolute;
   z-index: 1;
}

.hg-crop-edge.n { top: -12px; left: 32px; right: 32px; height: 24px; cursor: ns-resize; }
.hg-crop-edge.s { bottom: -12px; left: 32px; right: 32px; height: 24px; cursor: ns-resize; }
.hg-crop-edge.w { left: -12px; top: 32px; bottom: 32px; width: 24px; cursor: ew-resize; }
.hg-crop-edge.e { right: -12px; top: 32px; bottom: 32px; width: 24px; cursor: ew-resize; }

/* ── Crop step actions ────────────────────────────────────────────────────── */

/* Pinned to the bottom of the viewport rather than left in normal flow after the cropper: the image
   above can run up to 55svh, and stacking Retake/Looks good after it pushed them off screen on most
   phones — reachable only by scrolling, which on this step means dragging across the photo itself and
   nudging the crop box instead of the page (touch-action:none on .hg-cropper above, needed so a crop
   drag works at all, swallows scroll gestures that start on the image). Fixing the actions to the
   screen means there's nothing to scroll past. */
.hg-1583-crop-actions {
   position: fixed;
   left: 0;
   right: 0;
   bottom: 0;
   z-index: 40;
   background: var(--hg-white);
   box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.09);
   /* left/right too, not just bottom: in landscape on a notched phone this bar spans the full width, so
      the sensor housing can sit over its horizontal edges the same way it would over .hg-camera's. */
   padding: 12px calc(16px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
}

/* 616px, matching .hg-p-solo .hg-p-wrap's content column exactly — the retired portal.css set this and
   the card to the same 640px for the same reason. Sizing it from the wrap's OUTER width instead left the
   two action buttons overhanging the card they belong to by 16px a side. Below 768px both this bar and
   the wrap pad 16px, so they already agree without a max-width. */
.hg-1583-crop-actions-inner {
   max-width: 616px;
   margin: 0 auto;
   display: flex;
   flex-direction: column;
   gap: 8px;
}

.hg-1583-crop-buttons {
   display: flex;
   flex-direction: column;
   gap: 8px;
}

@media (min-width: 576px) {
   .hg-1583-crop-buttons {
      flex-direction: row;
   }

   .hg-1583-crop-buttons > .hg-btn {
      flex: 1 1 0;
   }
}

/* Reserves room at the end of the crop card so its own content — the quality and mismatch notices in
   particular — never ends up hidden behind the fixed bar above. Sized for the tallest case: buttons
   stacked on a narrow phone plus the "Use this photo anyway" escape hatch. A little extra blank space
   when that case doesn't apply beats content disappearing behind an opaque bar.

   No !important here, unlike the Bootstrap-era rule this replaces: the padding it had to beat came from
   .p-3/.p-md-4, and those utilities compile with !important. Nothing on this layout does. */
.hg-1583-cropcard {
   padding-bottom: 208px;
}

@media (min-width: 576px) {
   .hg-1583-cropcard {
      padding-bottom: 128px;
   }
}

/* ── Camera ───────────────────────────────────────────────────────────────── */

.hg-camera {
   position: fixed;
   inset: 0;
   z-index: 80;
   display: flex;
   align-items: center;
   justify-content: center;
   background: rgba(0, 0, 0, 0.92);
   /* dvh so the sheet doesn't jump when a mobile browser's chrome collapses. */
   height: 100dvh;
   padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.hg-camera-shell {
   display: flex;
   flex-direction: column;
   width: 100%;
   max-width: 720px;
   max-height: 100%;
   color: #fff;
}

.hg-camera-bar {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 8px;
   padding: 12px 16px;
   font-weight: 600;
}

.hg-camera-bar > span {
   display: inline-flex;
   align-items: center;
   gap: 8px;
}

/* Outlined in white rather than the design system's green: this control sits on a black viewfinder,
   where --hg-green-border is invisible and --hg-green-dark text has no contrast to speak of. */
.hg-camera-cancel {
   background: none;
   border: 1.5px solid rgba(255, 255, 255, 0.55);
   border-radius: 12px;
   color: #fff;
   font-family: var(--hg-body);
   font-size: 14px;
   font-weight: 600;
   min-height: 44px;
   padding: 0 16px;
   cursor: pointer;
}

.hg-camera-stage {
   position: relative;
   width: 100%;
   overflow: hidden;
   background: #000;
   /* aspect-ratio is set inline from the live stream's own dimensions. Matching it exactly is what makes
      the guide rectangle map linearly onto the captured frame — with a letterboxed stage the guide would
      sit somewhere else in the photo than it does on screen, and the pre-positioned crop would be wrong. */
   flex: 0 1 auto;
   min-height: 0;
   /* Lets the guide below size itself against the stage's height as well as its width. See the note
      there for why that's necessary. */
   container-type: size;
}

.hg-camera-stage video {
   display: block;
   width: 100%;
   height: 100%;
   object-fit: contain;
}

.hg-camera-guide {
   position: absolute;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   border-radius: 12px;
   box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45);
   pointer-events: none;

   /* The frame has to stay a TRUE card/page rectangle, because the crop box on the next step opens
      exactly where this frame sat. Sizing it `width: 88%` with a `max-height: 82%` cap does not do that:
      max-height clamps the height and leaves the width alone, so on a 720x405 stage the card frame came
      out 634x332 — an aspect of 1.91 where 1.59 was wanted, visibly wrong and a misleading guide to line
      a licence up against.

      Container units fix it properly by letting the WIDTH account for the height budget, so whichever
      axis is tighter wins and the ratio always holds. The plain `width: 88%` above it is the fallback
      for anything without container query units. */
   width: 88%;
   width: min(88cqw, 82cqh * var(--hg-guide-w) / var(--hg-guide-h));
   aspect-ratio: var(--hg-guide-w) / var(--hg-guide-h);
}

/* ID-1 card: 85.60 x 53.98 mm — driver's licences, permanent resident cards. */
.hg-camera-guide.is-card {
   --hg-guide-w: 85.6;
   --hg-guide-h: 53.98;
}

/* US Letter portrait, for the paper documents that satisfy the address requirement. */
.hg-camera-guide.is-page {
   --hg-guide-w: 8.5;
   --hg-guide-h: 11;
}

.hg-camera-corner {
   position: absolute;
   width: 28px;
   height: 28px;
   border: 3px solid #fff;
}

.hg-camera-corner.tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: 12px; }
.hg-camera-corner.tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; border-top-right-radius: 12px; }
.hg-camera-corner.bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; border-bottom-left-radius: 12px; }
.hg-camera-corner.br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: 12px; }

.hg-camera-hint {
   margin: 0;
   padding: 12px 20px;
   text-align: center;
   font-size: 14px;
   color: rgba(255, 255, 255, 0.85);
}

.hg-camera-actions {
   display: flex;
   justify-content: center;
   padding: 8px 16px 20px;
}

.hg-camera-shutter {
   width: 72px;
   height: 72px;
   border-radius: 50%;
   border: 4px solid rgba(255, 255, 255, 0.85);
   background: #fff;
   color: var(--hg-ink);
   display: flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
}

.hg-camera-shutter:active {
   transform: scale(0.94);
}

@media (prefers-reduced-motion: reduce) {
   .hg-1583-segment,
   .hg-camera-shutter {
      transition: none;
   }
}

/* ── Floor plan viewer ───────────────────────────────────────────────────────
   Pages/Portal/FloorPlan.cshtml. The one portal page outside _PortalLayout: it is reached from a
   15-minute link the concierge hands out, not from the tab bar, so it renders its own document and
   borrows the tokens above rather than the shell.

   The screen answers one question — what is free, and where — so it says the answer twice, in the two
   forms that suit the two ways it gets read. The map is for orientation, which is what a member wants
   when the space is unfamiliar. The list beneath it is for scanning, which is what they want when it is
   not, and it is also the only one of the two that a screen reader can work with; the map is
   aria-hidden precisely so it does not present forty untraversable shapes as an alternative.
   ============================================================================= */

.hg-fp-body {
   min-height: 100vh;
   min-height: 100dvh;
}

/* The hero's live stamp. A pill rather than a line of muted text because it is the page's only claim to
   being current, and when the link lapses this is the element that has to say so. */
.hg-fp-live {
   display: inline-flex;
   /* .hg-p-hero is a grid, so inline-flex computes to flex here and a grid item stretches to its
      column by default — the pill ran the full width of the hero and read as a banner rather than a
      status. */
   justify-self: start;
   align-items: center;
   gap: 8px;
   margin-top: 14px;
   padding: 6px 13px 6px 11px;
   border-radius: 999px;
   background: rgba(255, 255, 255, 0.12);
   color: rgba(255, 255, 255, 0.88);
   font-size: 12.5px;
   font-weight: 600;
}

.hg-fp-live[data-state="stale"] {
   background: var(--hg-warn-bg);
   color: var(--hg-warn-ink);
}

.hg-fp-live-dot {
   width: 8px;
   height: 8px;
   border-radius: 50%;
   background: var(--hg-lime);
   flex-shrink: 0;
   animation: hg-fp-pulse 2.4s ease-in-out infinite;
}

.hg-fp-live[data-state="stale"] .hg-fp-live-dot {
   background: var(--hg-warn-ink);
   animation: none;
}

@keyframes hg-fp-pulse {
   0%, 100% { opacity: 1; }
   50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
   .hg-fp-live-dot {
      animation: none;
   }
}

/* ── Counts ──────────────────────────────────────────────────────────────── */

/* Two numbers, side by side, at the top of the page: the summary a member reads before deciding whether
   to look at the map at all. */
.hg-fp-counts {
   display: flex;
   align-items: center;
   gap: 18px;
}

/* Even widths on a phone, where two halves of a 343px card read as a pair. From 768px they shrink to
   their content instead: .hg-p-wrap is 1100px wide there, and two stretched columns put 500px of nothing
   between a number and the number it is being compared with. */
.hg-fp-count {
   flex: 1 1 0;
   min-width: 0;
}

@media (min-width: 768px) {
   .hg-fp-count {
      flex: 0 0 auto;
      min-width: 132px;
   }
}

.hg-fp-count .hg-num {
   display: block;
   font-size: 30px;
   line-height: 1.1;
}

.hg-fp-count-rule {
   align-self: stretch;
   width: 1px;
   background: var(--hg-line);
   flex: 0 0 1px;
}

/* ── Map ─────────────────────────────────────────────────────────────────── */

.hg-fp-mapcard {
   position: relative;
   padding: 0;
   overflow: hidden;
}

/* Takes the plan's own shape, which the page sets from its pixel size, so the map fills the frame instead
   of painting a band across the middle of it — a 900x620 plan in a fixed 343x471 frame on a phone left a
   third of the card empty above and below the drawing.

   Capped all the same, and never taller than most of the viewport. The canvas swallows touch gestures
   (touch-action below) so a drag on it pans the map instead of scrolling the page — which means there
   has to be page left above and below it to scroll from, on the narrowest phone this is opened on. A plan
   taller than the cap letterboxes horizontally instead, which is the correct trade: bars beside a tall
   drawing cost less than a map that runs off the bottom of the screen. */
.hg-fp-canvas {
   position: relative;
   /* width:100% is load-bearing next to aspect-ratio, not a tidy-up. With width:auto the box is
      stretch-fit, which Chrome still treats as auto for ratio purposes — so min-height became the definite
      axis and the ratio re-derived the WIDTH from it, blowing a 327px card out to 348px and giving the whole
      page a horizontal scrollbar. A definite width leaves min-height able only to stretch the height. */
   width: 100%;
   aspect-ratio: var(--hg-fp-aspect, 4 / 3);
   max-height: min(58vh, 520px);
   min-height: 240px;
   background: var(--hg-green-50);
   /* Without this a pan gesture scrolls the page and the map never moves. */
   touch-action: none;
   cursor: grab;
   overflow: hidden;
}

.hg-fp-canvas.hg-dragging {
   cursor: grabbing;
}

.hg-fp-canvas > svg {
   display: block;
   width: 100%;
   height: 100%;
}

/* The plan's own extent, so its edges stay visible once the view can be zoomed past them. */
.hg-fp-canvas svg [data-role="ground"] {
   fill: var(--hg-white);
}

/* Zones are drawn with the palette the standalone snapshot image needs (see GenerateFloorPlanSvg); those
   are `fill`/`stroke` presentation attributes, which lose to any CSS rule, so the viewer repaints them
   into the portal's own ramp here. Targeting the shapes rather than their group is deliberate — a colour
   set on the group would be inherited, and inheritance loses to the child's own attribute. */
.hg-fp-canvas g[data-status] > :is(rect, circle, ellipse, polygon, path) {
   stroke-width: 2;
   /* Keeps outlines a constant width on screen however far the view is zoomed in, so a small zone does
      not turn into a solid blob of stroke. */
   vector-effect: non-scaling-stroke;
   transition: fill-opacity 0.15s ease;
}

.hg-fp-canvas g[data-status="available"] > :is(rect, circle, ellipse, polygon, path) {
   fill: var(--hg-green-light);
   fill-opacity: 0.5;
   stroke: var(--hg-green-dark);
}

.hg-fp-canvas g[data-status="occupied"] > :is(rect, circle, ellipse, polygon, path) {
   fill: var(--hg-danger);
   fill-opacity: 0.32;
   stroke: var(--hg-danger);
}

/* A zone nothing has answered for yet — the booking map's first paint, or a refresh that failed. Its own
   state, and it has to have one: without a rule here the shape keeps the green `fill` GenerateFloorPlanSvg
   writes as a presentation attribute, so an unanswered room would read as a free one. Dashed rather than
   simply grey, so it is not mistaken for the solid grey of a zone that is not space at all. */
.hg-fp-canvas g[data-status="unknown"] > :is(rect, circle, ellipse, polygon, path) {
   fill: var(--hg-bg);
   fill-opacity: 0.8;
   stroke: #c2c8d0;
   stroke-dasharray: 6 5;
}

.hg-fp-canvas g[data-status="unknown"] > text {
   fill: var(--hg-gray);
}

/* Restrooms, entrances, the lounge — drawn so the plan reads as a place, not offered as space. Muted
   enough that the eye passes over them on the way to the two states that matter. */
.hg-fp-canvas g[data-status="unassigned"] > :is(rect, circle, ellipse, polygon, path) {
   fill: var(--hg-line);
   fill-opacity: 0.75;
   stroke: #d3d7dd;
}

.hg-fp-canvas g[data-status] > text {
   font-family: var(--hg-body);
   font-weight: 600;
   fill: var(--hg-ink);
   pointer-events: none;
}

.hg-fp-canvas g[data-status="unassigned"] > text {
   fill: var(--hg-gray);
}

.hg-fp-canvas g[data-zone-id] {
   cursor: pointer;
}

/* The selected zone, which is how tapping a row in the list answers "where is that". */
.hg-fp-canvas g[data-zone-id].hg-on > :is(rect, circle, ellipse, polygon, path) {
   stroke: var(--hg-ink);
   stroke-width: 3.5;
   fill-opacity: 0.72;
}

/* ── Map controls ────────────────────────────────────────────────────────── */

.hg-fp-tools {
   position: absolute;
   top: 12px;
   right: 12px;
   display: flex;
   flex-direction: column;
   gap: 6px;
   z-index: 2;
}

/* A column of three 44px buttons is 150px tall, which on a phone is most of a 240px map — it sat over the
   whole of a space rather than the corner of one. Laid out as a row instead it covers a band 44px deep.
   Something is always under a control on a map this size; a band across the top costs least, and the map
   can be panned out from under it. */
@media (max-width: 767.98px) {
   .hg-fp-tools {
      flex-direction: row;
   }
}

.hg-fp-tool {
   width: 44px;
   height: 44px;
   display: flex;
   align-items: center;
   justify-content: center;
   border: 1px solid var(--hg-line);
   border-radius: 12px;
   background: rgba(255, 255, 255, 0.94);
   color: var(--hg-ink);
   cursor: pointer;
   padding: 0;
}

.hg-fp-tool:hover:not(:disabled) {
   background: var(--hg-white);
   border-color: var(--hg-green-border);
}

.hg-fp-tool:disabled {
   opacity: 0.4;
   cursor: default;
}

/* ── Legend ──────────────────────────────────────────────────────────────── */

.hg-fp-legend {
   display: flex;
   flex-wrap: wrap;
   gap: 8px 18px;
   padding: 13px 16px;
   border-top: 1px solid var(--hg-line);
   font-size: 12.5px;
   color: var(--hg-gray);
}

.hg-fp-legend-item {
   display: flex;
   align-items: center;
   gap: 8px;
}

.hg-fp-swatch {
   width: 13px;
   height: 13px;
   border-radius: 4px;
   border: 1.5px solid;
   flex-shrink: 0;
}

.hg-fp-swatch[data-status="available"] {
   background: color-mix(in srgb, var(--hg-green-light) 50%, transparent);
   border-color: var(--hg-green-dark);
}

.hg-fp-swatch[data-status="occupied"] {
   background: color-mix(in srgb, var(--hg-danger) 32%, transparent);
   border-color: var(--hg-danger);
}

.hg-fp-swatch[data-status="unassigned"] {
   background: var(--hg-line);
   border-color: #d3d7dd;
}

/* ── Space list ──────────────────────────────────────────────────────────── */

.hg-fp-list {
   display: flex;
   flex-direction: column;
   /* The rows are full-bleed and separated by borders, so the first and last need clipping to the
      card's radius. */
   overflow: hidden;
}

/* A real button, because this is the surface a keyboard and a screen reader use to work the page: the map
   above it is aria-hidden. Full-bleed inside its card so the row's whole width is the target. */
.hg-fp-row {
   display: flex;
   align-items: center;
   gap: 13px;
   width: 100%;
   min-height: 60px;
   padding: 12px 16px;
   border: 0;
   border-top: 1px solid var(--hg-line);
   background: transparent;
   font-family: var(--hg-body);
   color: var(--hg-ink);
   text-align: left;
   cursor: pointer;
}

.hg-fp-row:first-child {
   border-top: 0;
}


.hg-fp-row:hover {
   background: var(--hg-green-50);
}

.hg-fp-row[aria-pressed="true"] {
   background: var(--hg-green-pale);
}

.hg-fp-dot {
   width: 11px;
   height: 11px;
   border-radius: 50%;
   flex-shrink: 0;
}

.hg-fp-dot[data-status="available"] { background: var(--hg-green-light); }
.hg-fp-dot[data-status="occupied"] { background: var(--hg-danger); }
.hg-fp-dot[data-status="unassigned"] { background: #d3d7dd; }

/* Hollow, because the answer is outstanding rather than known to be anything. */
.hg-fp-dot[data-status="unknown"] {
   background: transparent;
   box-shadow: inset 0 0 0 2px #c2c8d0;
}

.hg-fp-row-main {
   flex: 1;
   min-width: 0;
}

.hg-fp-row-name {
   display: block;
   font-size: 15px;
   font-weight: 600;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

.hg-fp-row-note {
   display: block;
   margin-top: 2px;
   font-size: 12.5px;
   color: var(--hg-gray);
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

/* ── Selection bar ───────────────────────────────────────────────────────── */

/* .hg-p-bar sits above the tab bar on every other page. This one has no tab bar — it is not on
   _PortalLayout — so --hg-tabbar-h of clearance would leave it floating 76px off the bottom edge. */
.hg-fp-body .hg-p-bar {
   bottom: 0;
}

.hg-fp-bar-name,
.hg-fp-bar-note {
   overflow: hidden;
   text-overflow: ellipsis;
   /* Both stay on one line so the bar keeps a fixed height. "Drew Ingram · until Fri 12:56 AM" wrapped on
      a phone and made the bar 83px tall, which on a 240px map is a third of it again. */
   white-space: nowrap;
}

.hg-fp-bar-name {
   font-family: var(--hg-display);
   font-size: 16px;
   font-weight: 600;
}

/* Square, so the X reads as an icon rather than a word that lost its label. */
.hg-fp-bar-close {
   flex: 0 0 auto;
   width: 48px;
   padding: 0;
}

.hg-fp-foot {
   padding: 0 4px 8px;
   text-align: center;
   font-size: 12px;
   color: var(--hg-gray);
}

@media (min-width: 768px) {
   .hg-fp-canvas {
      max-height: min(64vh, 640px);
   }
}

/* ── Booking map ─────────────────────────────────────────────────────────────
   Pages/Portal/Bookings.cshtml, "Choose a space" in its Map shape. The drawing, its zoom controls, its
   legend and its zone list are all the floor plan viewer's own components above — .hg-fp-canvas,
   .hg-fp-tools, .hg-fp-legend, .hg-fp-list — reused rather than restyled, so the two surfaces cannot
   drift into looking like different products. Everything below is only what the booking page adds around
   them: the view toggle, the plan tabs, the header that says what the colours currently mean, and the
   action bar for a picked zone.

   The three zone states are the viewer's too, and reusing them is the point: a member who has seen the
   map on a link from the front desk reads this one without relearning it. What they MEAN differs, and
   the header says which — there, "occupied" is "someone is in it now"; here it is "your booking does not
   fit", which is the only question this page asks.
   ============================================================================= */

/* Pushed to the right of the heading it belongs to. .hg-p-sectionhead is deliberately not
   space-between — a count belongs beside its title — but a view control is an action on the section
   rather than a fact about it, and right is where one is looked for. */
.hg-viewtoggle {
   margin-left: auto;
   /* .hg-seg is a full-width grid by default, which here would stretch two words across the column. */
   grid-auto-columns: auto;
   flex: 0 0 auto;
}

.hg-viewtoggle button {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 7px;
   padding: 0 14px;
}

/* ── Plan tabs ───────────────────────────────────────────────────────────── */

/* Only rendered when an organization has more than one plan. Two lines rather than one because a floor
   plan's name ("Level 2") and its place ("Main Street · Floor 2") answer different halves of "which one
   is this", and a member switching between buildings needs the second. */
.hg-planchip {
   flex: 0 0 auto;
   min-height: 48px;
   padding: 7px 16px;
   border: 1.5px solid var(--hg-line);
   border-radius: 999px;
   background: var(--hg-white);
   font-family: var(--hg-body);
   color: var(--hg-ink);
   text-align: left;
   cursor: pointer;
}

.hg-planchip:hover:not(.hg-on) {
   border-color: var(--hg-green-border);
}

.hg-planchip.hg-on {
   background: var(--hg-green-dark);
   border-color: var(--hg-green-dark);
   color: #fff;
}

.hg-planchip-name {
   display: block;
   font-size: 14px;
   font-weight: 600;
   line-height: 1.25;
}

.hg-planchip-sub {
   display: block;
   font-size: 11.5px;
   color: var(--hg-gray);
   line-height: 1.25;
}

.hg-planchip.hg-on .hg-planchip-sub {
   color: rgba(255, 255, 255, 0.72);
}

/* ── Map header ──────────────────────────────────────────────────────────── */

/* What the colours under it currently mean, and how many of each. .hg-fp-mapcard is padding:0 because
   the drawing is full-bleed inside it, so this row carries its own. */
.hg-bkmap-head {
   display: flex;
   align-items: center;
   gap: 12px;
   padding: 13px 16px;
   border-bottom: 1px solid var(--hg-line);
}

.hg-bkmap-window {
   display: flex;
   align-items: center;
   gap: 9px;
   min-width: 0;
   flex: 1;
   font-size: 13.5px;
   font-weight: 600;
   /* One line, so the card keeps a fixed header height whatever the window is called. */
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

/* The one live-ish marker on this card, which is the third of lime's three rationed jobs. It pulses only
   while an answer is in flight; at rest it is a quiet dot saying the colours below are current. */
.hg-bkmap-dot {
   width: 8px;
   height: 8px;
   border-radius: 50%;
   background: var(--hg-lime-dark);
   flex-shrink: 0;
}

.hg-bkmap-dot.hg-busy {
   animation: hg-fp-pulse 1.1s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
   .hg-bkmap-dot.hg-busy {
      animation: none;
   }
}

.hg-bkmap-counts {
   display: flex;
   align-items: baseline;
   gap: 12px;
   flex: 0 0 auto;
   font-size: 12.5px;
   color: var(--hg-ink);
}

.hg-bkmap-counts .hg-num {
   font-size: 17px;
   margin-right: 3px;
}

/* ── Stage ───────────────────────────────────────────────────────────────── */

/* The zoom controls are positioned against this, not against the card. Anchored to the card they would
   sit over the header row above the drawing instead of over the drawing. */
.hg-bkmap-stage {
   position: relative;
   transition: opacity 0.15s ease;
}

/* A refresh is in flight, so the colours on screen still describe the window the member has just moved
   off. Dimmed rather than cleared: blanking the whole drawing on every tap of a length chip would flash
   the map grey several times a second, and the header withdraws its counts and says "Checking…" for the
   part that would actually mislead. */
.hg-bkmap-stage.hg-busy {
   opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
   .hg-bkmap-stage {
      transition: none;
   }
}

/* ── Picked zone ─────────────────────────────────────────────────────────── */

/* Deliberately NOT .hg-p-bar. The page already has one sticky bar pinned to the bottom for the booking
   itself, and a second would fight it for the same strip of screen on a phone. This one sits where it was
   caused — directly under the drawing that was tapped. */
.hg-bkmap-bar {
   display: flex;
   align-items: center;
   gap: 10px;
}

.hg-bkmap-bar-name {
   font-family: var(--hg-display);
   font-size: 16px;
   font-weight: 600;
}

/* Both stay on one line so the bar keeps a fixed height — "Booked — free from 4:30 PM" wrapped on a
   phone and moved the buttons under the map by a row each time a zone was tapped. */
.hg-bkmap-bar-name,
.hg-bkmap-bar-note {
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

/* The row in the list that is the space currently chosen in the picker — the map's half of keeping the
   two surfaces agreed about the selection, not only about what is free. Green rather than lime: lime has
   three jobs in this design system and "this row is selected" is not one of them. */
.hg-fp-row.hg-bkmap-chosen {
   box-shadow: inset 3px 0 0 var(--hg-green-dark);
}

/* ── Crossing over from the list ─────────────────────────────────────────── */

/* "Show The Boardroom on the floor plan", under the space cards. A full-width row rather than a link,
   because it is a 48px target on a phone and because it reads as the next thing to do rather than as an
   aside about the thing above it.

   Used on both a <button> (the floor-plan jump, which stays on the page) and an <a> (Billing's door to
   the saved-cards screen, which is a real navigation), hence the text-decoration reset — the element
   that matches the sentence is the one to reach for, not the one the first caller happened to be. */
.hg-maplink {
   display: flex;
   align-items: center;
   gap: 10px;
   width: 100%;
   min-height: 48px;
   margin-top: 12px;
   padding: 10px 16px;
   border: 1.5px dashed var(--hg-green-border);
   border-radius: 12px;
   background: transparent;
   font-family: var(--hg-body);
   font-size: 14px;
   font-weight: 600;
   color: var(--hg-green-dark);
   text-align: left;
   text-decoration: none;
   cursor: pointer;
}

.hg-maplink:hover {
   background: var(--hg-green-50);
   border-style: solid;
}

.hg-maplink span {
   flex: 1;
   min-width: 0;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

.hg-maplink-go {
   flex: 0 0 auto;
   opacity: 0.65;
}

@media (max-width: 420px) {
   /* At 390px the header's two halves cannot both stay on one line: "Free for 4 hours on Mon 14 Sep"
      needs the width more than the counts do, and the counts repeat what the legend and the list already
      say. Stacked rather than truncated. */
   .hg-bkmap-head {
      flex-wrap: wrap;
      gap: 6px 12px;
   }

   .hg-bkmap-window {
      flex: 1 0 100%;
   }
}

/* ── Billing ─────────────────────────────────────────────────────────────────

   Docs/design/member-portal, body-Billing and body-DesktopBilling. The design's own note on this screen:
   "The balance panel is the one place on a phone that goes dark green with a lime action — an amount owed
   should not look like every other row." That is the whole reason .hg-panel and .hg-btn-lime exist here and
   nowhere else, and it is also the reason they are not offered as general-purpose utilities: lime has three
   sanctioned jobs in Foundations (the primary action on a dark surface, the credit meter, the live-time
   marker) and a fourth would dilute all three. .hg-fp-live-dot already holds the third. */

.hg-panel {
   background: var(--hg-green-deep);
   /* 16px, not --hg-radius's 14px. Foundations draws the emphasis panel one step rounder than a card so the
      two do not read as the same surface painted differently. */
   border-radius: 16px;
   padding: 20px;
   color: #fff;
}

.hg-panel .hg-label {
   color: rgba(255, 255, 255, 0.6);
}

/* Wraps, so the action drops under the figure rather than squeezing it. The balance is set in the display
   face at 38px — "$279.36" is 133px of it, and it cannot break — so in a tile narrow enough to want both
   on one line something has to give, and it must not be the number. */
.hg-panel-figure {
   display: flex;
   flex-wrap: wrap;
   align-items: flex-end;
   justify-content: space-between;
   gap: 12px;
   margin-top: 8px;
}

.hg-panel-num {
   font-size: 38px;
   line-height: 1.1;
   color: #fff;
}

.hg-panel-note {
   font-size: 13px;
   color: rgba(255, 255, 255, 0.72);
   margin-top: 12px;
}

/* The one lime action, and only on a dark surface — lime on cream fails contrast for text at this weight
   (#b6e34a on #fbfaf3 is about 1.5:1), which is why this pairs it with --hg-green-deep ink rather than
   offering a lime button that could be dropped onto a white card. */
.hg-btn-lime {
   background: var(--hg-lime);
   color: var(--hg-green-deep);
   font-weight: 700;
}

.hg-btn-lime:hover:not(:disabled) {
   background: var(--hg-lime-dark);
   color: var(--hg-green-deep);
}

/* Credit meter — lime's second sanctioned job. */
.hg-meter {
   height: 8px;
   border-radius: 999px;
   background: var(--hg-bg);
   margin-top: 9px;
   overflow: hidden;
}

.hg-meter-fill {
   height: 100%;
   border-radius: 999px;
   background: var(--hg-lime);
}

/* Guest-pass and plus-one punch cards (Pages/Portal/_PassPunchCards.cshtml, issue #2951). A slot per pass this
   cycle: used ones filled, open ones dashed with their number, extras the front desk granted in amber. Slots are
   32px, px rather than rem (the portal's root is 14px), and wrap so a large allowance stays inside a phone. */
.hg-pass-card-head {
   display: flex;
   align-items: baseline;
   justify-content: space-between;
   gap: 10px;
}

.hg-pass-card-count {
   display: inline-flex;
   align-items: baseline;
   gap: 6px;
   white-space: nowrap;
}

.hg-pass-card-count .hg-num {
   font-size: 26px;
}

.hg-pass-slots {
   display: flex;
   flex-wrap: wrap;
   gap: 8px;
   margin-top: 14px;
}

.hg-pass-slot {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   width: 32px;
   height: 32px;
   border-radius: 999px;
   font-size: 13px;
   font-weight: 600;
   flex: none;
}

.hg-pass-slot-open {
   border: 2px dashed var(--hg-green-border);
   color: var(--hg-gray);
   background: var(--hg-white);
}

.hg-pass-slot-punched {
   border: 2px solid var(--hg-green);
   background: var(--hg-green);
   color: var(--hg-white);
}

.hg-pass-card-plusone .hg-pass-slot-punched {
   border-color: var(--hg-green-dark);
   background: var(--hg-green-dark);
}

.hg-pass-slot.hg-pass-slot-extra {
   border-color: var(--hg-warn-line);
   background: var(--hg-warn-bg);
   color: var(--hg-warn-ink);
   font-size: 16px;
}

.hg-pass-slot-more {
   align-self: center;
   font-size: 13px;
   color: var(--hg-gray);
}

.hg-pass-used {
   list-style: none;
   margin: 12px 0 0;
   padding: 10px 0 0;
   border-top: 1px solid var(--hg-line);
   font-size: 13px;
}

.hg-pass-used li {
   display: flex;
   justify-content: space-between;
   gap: 10px;
   padding: 3px 0;
}

.hg-pass-used li > span:first-child {
   min-width: 0;
   overflow-wrap: anywhere;
}

.hg-pass-used li > span:last-child {
   white-space: nowrap;
}

/* "What is included" — Docs/design/member-portal, body-Membership. A real <ul> with its marker removed
   rather than a stack of divs: it is the one band on that screen that genuinely is a list, and "list, 4
   items" is the whole value of the band said in one phrase.

   The tick is a flex item sized here rather than by width/height attributes on each <svg>, so the whole
   list is one rule to change. flex-shrink is what keeps it round when the line beside it wraps to three
   lines on a phone — without it the glyph squashes to an oval — and align-items:flex-start plus the 2px
   nudge is what puts it on the first line's baseline instead of centred against the whole wrapped block. */
.hg-checklist {
   list-style: none;
   margin: 14px 0 0;
   padding: 0;
   display: flex;
   flex-direction: column;
   gap: 12px;
}

.hg-checklist li {
   display: flex;
   align-items: flex-start;
   gap: 10px;
   font-size: 15px;
}

.hg-checklist li > svg {
   width: 18px;
   height: 18px;
   flex-shrink: 0;
   margin-top: 2px;
}

/* Summary tiles. One column on a phone, where the design stacks them; the desktop mock's three across from
   768px up. Balance first in both, so the figure that decides whether the member does anything is the one
   they reach first however the page is folded. */
.hg-summary {
   display: grid;
   grid-template-columns: 1fr;
   gap: 14px;
}

@media (min-width: 768px) {
   /* auto-fit rather than a flat repeat(3): the row of three the artboard draws is drawn at 1440px, and at
      768px the same three tracks are 144px each — narrower than the balance figure standing in one of
      them, which clipped mid-digit at "$279.3". Three tiles when three fit at a legible width, fewer when
      they do not, which is the same answer the phone reaches for the same reason. 240px is that width:
      enough for the figure and the Pay now beside it once .hg-panel-figure is allowed to wrap. */
   .hg-summary {
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 20px;
      align-items: stretch;
   }

   /* :not(template) is load-bearing, not defensive. Alpine renders an x-if's content as a SIBLING and
      leaves the <template> element itself in the DOM; a bare `> *` overrides the UA's
      `template { display: none }` and hands that empty element a grid cell, which pushed the third tile
      onto a second row. */
   .hg-summary > :not(template) {
      /* Without this a short tile floats against a taller neighbour and the three stop reading as a row. */
      display: flex;
      flex-direction: column;
      justify-content: center;
   }
}

/* Desktop statement table. Deliberately a real <table> rather than the design's CSS grid: the grid version
   gives a screen reader six unrelated cells per row with no header association, and this data is exactly
   what a table element is for. The wrapper scrolls rather than the page. */
.hg-tablewrap {
   overflow-x: auto;
}

.hg-table {
   width: 100%;
   border-collapse: collapse;
}

.hg-table th {
   text-align: left;
   font-size: 12px;
   font-weight: 600;
   letter-spacing: 0.06em;
   text-transform: uppercase;
   color: var(--hg-gray);
   padding: 0 16px 12px;
   white-space: nowrap;
}

.hg-table td {
   padding: 16px;
   font-size: 15px;
   border-top: 1px solid var(--hg-line);
   vertical-align: middle;
}

.hg-table .hg-table-right {
   text-align: right;
}

.hg-table .hg-table-center {
   text-align: center;
}

/* A cell's own caption, for the stacked rows below, where the <th> has gone off screen and a running
   balance would otherwise arrive as a bare second figure under the amount it follows. display:none rather
   than .hg-sr-only, because the header row is still in the accessibility tree and still associated with
   the cell: up here it is the eye that has lost the column, not the screen reader. Declared before the
   block that turns it on, because both selectors are one class and the later one would otherwise win. */
.hg-td-label {
   display: none;
   margin-right: 4px;
   font-weight: 400;
   color: var(--hg-gray);
}

/* Phone: the same rows as stacked blocks. A five-column statement cannot be read at 390px, and
   horizontally scrolling a list the member is scanning for one status is worse than restacking it.

   table/thead/tbody/tr all go display:block or grid, which takes the table layout algorithm out of play
   entirely. Without that the <table> keeps sizing itself to its content's natural width and spills out of
   .hg-tablewrap however the rows are laid out — measured at 390px, the description and amount ran past the
   card's right edge. */
@media (max-width: 767px) {
   .hg-table,
   .hg-table tbody {
      display: block;
      width: 100%;
   }

   .hg-table thead {
      /* Not display:none — that would drop the headers from the accessibility tree as well as the layout,
         and the stacked cells below still rely on them for their meaning. */
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
   }

   /* Explicit areas rather than auto-placement: the cells are emitted in table order (date, description,
      amount, status, action) but read best with the room first and the date beneath it. */
   .hg-table tr {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      grid-template-areas:
         "desc   amount"
         "date   status"
         "action action";
      gap: 2px 12px;
      padding: 14px 16px;
      border-top: 1px solid var(--hg-line);
   }

   .hg-table tr:first-child {
      border-top: 0;
   }

   .hg-table td {
      padding: 0;
      border-top: 0;
      min-width: 0;
   }

   .hg-table td:nth-child(1) { grid-area: date; }
   .hg-table td:nth-child(2) { grid-area: desc; }
   .hg-table td:nth-child(3) { grid-area: amount; text-align: right; }
   .hg-table td:nth-child(4) { grid-area: status; text-align: right; }

   .hg-table td:nth-child(5) {
      grid-area: action;
      text-align: left;
   }

   /* Spacing hangs off the button, not the cell. A settled row's action cell still contains Alpine's
      <template> element — so it is never :empty — but with no rendered button it has no height, and the
      third track collapses instead of leaving a gap under every paid line. */
   .hg-table td:nth-child(5) .hg-btn {
      margin-top: 8px;
   }

   /* The ledger is four columns where the statement is five, and its fourth is a running balance rather
      than a status. Only the placement differs; every rule above still applies, including the right
      alignment nth-child(4) already carries. */
   .hg-table-ledger tr {
      grid-template-areas:
         "desc   amount"
         "date   balance";
   }

   .hg-table-ledger td:nth-child(4) {
      grid-area: balance;
   }

   .hg-td-label {
      display: inline;
   }
}

/* ── Payment methods ─────────────────────────────────────────────────────────

   Docs/design/member-portal, body-PaymentMethods. The screen's whole idea is a hierarchy of two: the
   default card is drawn as an OBJECT — a dark-green slab with the number across it, the thing a member
   recognises as "the card you will charge" — and every other card is a row. That is why there is no
   .hg-cardface-secondary: a second object would flatten the distinction the page exists to make.

   .hg-cardface builds on .hg-panel (the billing balance panel) rather than restating dark green and the
   16px radius. One emphasis surface, two uses — and if Foundations ever retunes it, both move together. */

.hg-cardface {
   display: flex;
   flex-direction: column;
   justify-content: space-between;
   gap: 18px;
   min-height: 170px;
}

.hg-cardface-top {
   display: flex;
   align-items: flex-start;
   justify-content: space-between;
   gap: 10px;
}

/* The mock's letter-spacing is doing real work: it is what makes four groups of bullets read as a card
   number rather than as a run of dots. Kept on .hg-num's display face for the same reason the balance
   figure uses it. */
.hg-cardface-num {
   font-size: 22px;
   letter-spacing: 0.08em;
   color: #fff;
   word-break: break-all;
}

.hg-cardface-meta {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 10px;
   margin-top: 12px;
   font-size: 13px;
   color: rgba(255, 255, 255, 0.72);
}

/* An expired card is still the default until the member changes it, so it keeps the slab — saying so in
   the meta line is honest, and hiding it would leave them wondering where their card went. */
.hg-cardface-meta .hg-pill {
   flex-shrink: 0;
}

.hg-cardface-actions {
   display: flex;
   flex-wrap: wrap;
   gap: 8px;
   margin-top: 14px;
}

.hg-cardface-actions > .hg-btn {
   flex: 1 1 140px;
}

/* The one place a lime-adjacent outline appears on the dark slab. --hg-green-border is a pale green meant
   for cream backgrounds and disappears entirely at 20% against --hg-green-deep, so the outline on this
   surface is white at low alpha instead. */
.hg-cardface-actions > .hg-btn-outline {
   color: #fff;
   border-color: rgba(255, 255, 255, 0.4);
}

.hg-cardface-actions > .hg-btn-outline:hover:not(:disabled) {
   background: rgba(255, 255, 255, 0.12);
   color: #fff;
}

/* ── Secondary cards ──────────────────────────────────────────────────────────
   A row, not a slab. The design draws its two actions as full-width outline buttons beneath the identity
   rather than as a kebab menu, and that is what is built: a menu here would put Remove — the one
   irreversible action on this screen — behind a control whose target is smaller than the thing it
   removes. */

.hg-cardrow {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 13px;
   padding: 14px 16px;
   min-height: 76px;
}

/* 44 by 30 with a 6px radius: a card's proportions, not an icon tile's. Deliberately not .hg-icobox,
   which is a 44px square — at this size the difference is the whole reason the row reads as a card. */
.hg-cardbrand {
   width: 44px;
   height: 30px;
   border-radius: 6px;
   background: var(--hg-bg);
   display: flex;
   align-items: center;
   justify-content: center;
   flex-shrink: 0;
}

.hg-cardrow-main {
   flex: 1 1 auto;
   min-width: 0;
}

.hg-cardrow-name {
   font-size: 15px;
   font-weight: 600;
}

/* flex-basis 100% so the actions always take their own line under the identity, exactly as the mock draws
   them, instead of squeezing the brand and expiry at narrow widths. */
.hg-cardrow-actions {
   display: flex;
   flex-wrap: wrap;
   gap: 8px;
   flex: 1 0 100%;
}

.hg-cardrow-actions > .hg-btn {
   flex: 1 1 140px;
}

/* ── Stripe Payment Element ───────────────────────────────────────────────────
   Stripe renders the fields inside its own cross-origin iframe, so nothing in this stylesheet reaches
   them — appearance is passed to elements() in JS instead. All this does is reserve the space and keep
   the sheet from jumping as the iframe finishes measuring itself. */

.hg-pm-element {
   min-height: 220px;
   margin: 4px 0 16px;
}

/* ── Dashboard ───────────────────────────────────────────────────────────────

   Docs/design/member-portal, body-Main and body-DesktopHome, plus the proposal that reordered them.

   The page is bands ordered by SHELF LIFE — how fast each claim stops being true. Something waiting on the
   member decays in hours and goes nearest the top; what they have booked decays by this evening; the plan
   and credit figures over a billing cycle; how they appear in the lobby directory over months. Anything
   whose answer would be "forever" is a setting and belongs on another page.

   Two rules that the CSS below exists to enforce rather than merely allow:

   • A band with nothing to say is ABSENT, not empty. There is deliberately no empty-state styling here for
     Needs you, Today or Your space — the page omits the element. An empty state is a promise that something
     will arrive, and "no bookings" on a tenant whose EnablePortalBooking is off is a promise that will never
     be kept.

   • The card that overlaps the green band is whatever ranks first, which is why the overlap is .hg-p-lift on
     its own rather than a margin baked into the Needs you card. On a quiet day the next booking sits in that
     slot instead. */

/* The hero needs somewhere for the first band to pull up into, so the dashboard deepens it rather than
   every other page paying for the space. 74px = the lift below plus the 16px gutter. */
.hg-p-hero-deep {
   padding-bottom: 74px;
}

/* "Nothing needs you today" — the one place the absence of a band is stated rather than just rendered, and
   lime's sanctioned job on a dark surface. It replaces a card that would otherwise say the same thing in
   twelve times the space. */
.hg-p-hero-clear {
   display: flex;
   align-items: center;
   gap: 7px;
   margin-top: 12px;
   font-size: 13.5px;
   font-weight: 600;
   color: var(--hg-lime);
}

.hg-p-hero-clear svg {
   flex-shrink: 0;
}

/* The overlap slot. Applied to the first band whatever it turns out to be. */
.hg-p-lift {
   margin-top: -58px;
}

/* A band that is lifted has its heading sitting ON the green, not on the cream — and .hg-p-sectionhead is
   built for the cream. Without this, the one day the member has nothing waiting is the day the Today
   heading renders near-black on deep green and cannot be read. It only bites when a band that HAS a heading
   reaches the slot, which the Needs you card never does (its title is inside the card), so it is invisible
   until the page is quiet. :not(.hg-card) is that exception made explicit: the Needs you card is itself
   the lifted element, so its heading is a direct child of .hg-p-lift too, and without the exclusion it
   rendered white on the white card. */
.hg-p-lift:not(.hg-card) > .hg-p-sectionhead h2 {
   color: #fff;
}

.hg-p-lift:not(.hg-card) > .hg-p-sectionhead .hg-linkbtn {
   color: rgba(255, 255, 255, 0.78);
}

.hg-p-lift:not(.hg-card) > .hg-p-sectionhead .hg-pill-mute {
   background: rgba(255, 255, 255, 0.14);
   color: rgba(255, 255, 255, 0.86);
}

@media (min-width: 768px) {
   /* The lift is off on desktop, so the heading is back on the cream and must take its ink back with it.
      Declared here rather than relying on the rule above not matching: .hg-p-lift is still on the element. */
   .hg-p-lift > .hg-p-sectionhead h2 {
      color: var(--hg-ink);
   }

   .hg-p-lift > .hg-p-sectionhead .hg-linkbtn {
      color: var(--hg-green-dark);
   }

   .hg-p-lift > .hg-p-sectionhead .hg-pill-mute {
      background: var(--hg-bg);
      color: var(--hg-gray);
   }
}

/* ── Needs you ───────────────────────────────────────────────────────────────
   A warm left edge rather than another pill, reusing the 3px idiom .hg-bookingcard-now already established
   for "this one is today" — the eye finds it scanning the left margin. Warm, not lime: lime has three
   sanctioned jobs and none of them is alarm. */
.hg-attention {
   border-left: 3px solid var(--hg-warn-line);
}

.hg-attention-row {
   display: flex;
   align-items: flex-start;
   gap: 11px;
   padding-top: 14px;
}

.hg-attention-row + .hg-attention-row {
   border-top: 1px solid var(--hg-line);
}

.hg-attention-body {
   flex: 1;
   min-width: 0;
}

.hg-attention-title {
   font-size: 15px;
   font-weight: 600;
}

.hg-attention-row .hg-btn {
   margin-top: 9px;
}

/* ── Today ───────────────────────────────────────────────────────────────────
   The live strip. Its dot is lime's third sanctioned job (the live marker), and --hg-lime-dark rather than
   --hg-lime because this one sits on pale green instead of the floor plan's dark hero pill — the same
   marker, a ground apart. It shares hg-fp-pulse rather than declaring a second identical keyframe. */
.hg-p-live {
   display: flex;
   align-items: center;
   gap: 9px;
   padding: 11px 14px;
   background: var(--hg-green-50);
   border: 1px solid var(--hg-green-border);
   border-radius: 12px;
   font-size: 13.5px;
   font-weight: 600;
   color: var(--hg-green-dark);
}

.hg-p-livedot {
   width: 8px;
   height: 8px;
   border-radius: 50%;
   background: var(--hg-lime-dark);
   flex-shrink: 0;
   animation: hg-fp-pulse 2.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
   .hg-p-livedot {
      animation: none;
   }
}

/* ── Your space ──────────────────────────────────────────────────────────── */

.hg-p-two {
   display: grid;
   grid-template-columns: repeat(2, minmax(0, 1fr));
   gap: 12px;
}

/* A fact tile that opens something — Wi-Fi credentials, door hours. Deliberately not .hg-action-tile: that
   one is a choice in a set (the mail action panel), bordered and selectable, and these are destinations. */
.hg-p-facttile {
   display: flex;
   flex-direction: column;
   justify-content: center;
   gap: 7px;
   min-height: 96px;
   padding: 14px;
   text-align: left;
   font-family: var(--hg-body);
   color: var(--hg-ink);
   border: 0;
   cursor: pointer;
}

.hg-p-facttile:hover {
   box-shadow: var(--hg-shadow-lift);
}

.hg-p-facttile-name {
   font-size: 14px;
   font-weight: 600;
}

/* ── Get somewhere ───────────────────────────────────────────────────────────
   Built from the section's own nav-item list, so a tile cannot point at a destination this org does not
   have. auto-fit rather than a fixed four: a mail-only tenant gets three tiles that fill the row, not four
   with two that apologise. */
.hg-p-qa {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
   gap: 8px;
}

.hg-p-qa > a {
   position: relative;
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   gap: 7px;
   min-height: 80px;
   padding: 12px 4px;
   background: var(--hg-white);
   border-radius: var(--hg-radius);
   box-shadow: var(--hg-shadow);
   font-size: 12px;
   font-weight: 600;
   color: var(--hg-ink);
   text-align: center;
}

.hg-p-qa > a:hover {
   box-shadow: var(--hg-shadow-lift);
   color: var(--hg-green-dark);
}

.hg-p-qa svg {
   width: 23px;
   height: 23px;
   stroke: var(--hg-green-dark);
}

/* How much is in the mailbox. Pale rather than warm: this is a quantity, not a summons — what actually
   wants the member is in the Needs you band, and two warm badges on one screen would make neither mean
   anything. */
.hg-p-qa-count {
   position: absolute;
   top: 8px;
   right: 10px;
   min-width: 20px;
   padding: 0 5px;
   border-radius: 999px;
   background: var(--hg-green-pale);
   color: var(--hg-green-dark);
   font-size: 11px;
   font-weight: 700;
   line-height: 20px;
   text-align: center;
}

/* ── You and yours ───────────────────────────────────────────────────────────
   One row per company or person, against the media cards this band replaced: image panel, bio teaser,
   contact count, notification summary and a full-width button each. A directory listing is edited about
   twice a year, and /portal/companies and /portal/profile are one tap away and built for editing it. */
.hg-p-dirlist {
   background: var(--hg-white);
   border-radius: var(--hg-radius);
   box-shadow: var(--hg-shadow);
   overflow: hidden;
}

.hg-p-dirrow {
   display: flex;
   align-items: center;
   gap: 11px;
   min-height: 60px;
   padding: 8px 14px;
   color: var(--hg-ink);
}

.hg-p-dirrow + .hg-p-dirrow {
   border-top: 1px solid var(--hg-line);
}

.hg-p-dirrow:hover {
   background: var(--hg-green-50);
}

/* A column, not just a flex child: the name and its note are <span>s inside an <a> — the row has to stay
   one link — and inline spans would otherwise run together on a single line. */
.hg-p-dirrow-body {
   flex: 1;
   min-width: 0;
   display: flex;
   flex-direction: column;
}

.hg-p-dirrow-name {
   font-size: 15px;
   font-weight: 600;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

.hg-p-diravatar {
   width: 34px;
   height: 34px;
   border-radius: 999px;
   background: var(--hg-green-pale);
   color: var(--hg-green-dark);
   display: flex;
   align-items: center;
   justify-content: center;
   flex-shrink: 0;
   overflow: hidden;
   font-size: 12px;
   font-weight: 700;
}

.hg-p-diravatar img {
   width: 100%;
   height: 100%;
   object-fit: cover;
}

/* ── Folding ─────────────────────────────────────────────────────────────────
   On a phone the bands are one column in shelf-life order, which is DOM order. .hg-p-home-main and
   .hg-p-home-side are display:contents there, so their children are direct flex items of the stack and the
   grouping costs nothing.

   From 768px the same DOM becomes the desktop composition: the time-sensitive bands take eight columns and
   the money figures pin to the right four, where the balance stays put whatever else is on the page. No
   band is moved or duplicated to get there — grouping the markup by column is what lets one order serve
   both folds. */
.hg-p-home {
   display: flex;
   flex-direction: column;
   gap: 14px;
}

.hg-p-home-main,
.hg-p-home-side {
   display: contents;
}

@media (min-width: 768px) {
   /* Back to the hero's own desktop padding. The extra depth exists only to receive .hg-p-lift, which is
      a phone device — leaving it here would open a band of empty green under every desktop greeting. */
   .hg-p-hero-deep {
      padding-bottom: 30px;
   }

   /* .hg-p-hero is a grid from 768px up, and a grid item stretches its column by default — without this
      the clear line runs the full width of the hero and reads as a banner. Same fix, same reason, as
      .hg-fp-live's justify-self. */
   .hg-p-hero > .hg-p-hero-clear {
      justify-self: start;
   }

   .hg-p-home {
      display: grid;
      grid-template-columns: repeat(12, minmax(0, 1fr));
      gap: 20px;
      align-items: start;
   }

   /* Everything that is not in a column group spans the page: the quick actions and the directory read
      across the full width rather than being squeezed into eight columns. */
   .hg-p-home > * {
      grid-column: span 12;
   }

   .hg-p-home-main,
   .hg-p-home-side {
      display: flex;
      flex-direction: column;
      gap: 20px;
   }

   .hg-p-home-main {
      grid-column: span 8;
      min-width: 0;
   }

   .hg-p-home-side {
      grid-column: span 4;
      min-width: 0;
   }

   /* The lift is a phone device. On desktop the hero is a full-bleed band above a 1100px track, and a card
      pulled up into it would sit against the viewport edge rather than the content column. */
   .hg-p-lift {
      margin-top: 0;
   }

   /* Wider tiles than on a phone, but still wrapping: a single column-flow row of fixed tiles ran past the
      content column (and scrolled the page sideways) once a member had seven or eight actions. */
   .hg-p-qa {
      grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
   }
}

/* ── Term pricing ("More space" on Membership) ─────────────────────────────────
   One kind of space, its cheapest rate on the head, and the full ladder underneath. The head is a
   real <button> so it is reachable by keyboard and announces aria-expanded; these rules only give
   it the geometry, since a button carries its own defaults that would otherwise show through. */
.hg-term-option {
   border-top: 1px solid var(--hg-line);
}

.hg-term-option:first-of-type {
   border-top: none;
}

.hg-term-option-head {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 12px;
   width: 100%;
   padding: 11px 0;
   background: none;
   border: 0;
   font: inherit;
   color: inherit;
   text-align: left;
   cursor: pointer;
}

.hg-term-option-head:hover {
   color: var(--hg-green);
}

.hg-term-option-rungs {
   padding: 2px 0 12px;
}

.hg-term-rung {
   display: flex;
   align-items: baseline;
   justify-content: space-between;
   gap: 12px;
   padding: 5px 0;
   font-size: 14px;
}

/* The rate is the number being compared down the column, so it is the one that gets the weight. */
.hg-term-rung span:last-child {
   font-variant-numeric: tabular-nums;
   font-weight: 600;
}

/* ── Join (plan sales) ───────────────────────────────────────────────────── */

/* Pages/Join. Each plan is a radio drawn as a card: the whole card is the hit area, and the chosen one takes the
   portal's dark green border like a chosen .hg-planchip. */
.hg-join-offers {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
   gap: 12px;
   margin-top: 14px;
}

.hg-join-offer {
   display: flex;
   flex-direction: column;
   gap: 4px;
   padding: 14px 16px;
   border: 1.5px solid var(--hg-line);
   border-radius: 14px;
   background: var(--hg-white);
   font-family: var(--hg-body);
   color: var(--hg-ink);
   text-align: left;
   cursor: pointer;
}

.hg-join-offer:hover:not(.hg-on) {
   border-color: var(--hg-green-border);
}

.hg-join-offer.hg-on {
   border-color: var(--hg-green-dark);
   box-shadow: 0 0 0 1px var(--hg-green-dark);
}

.hg-join-offer-name {
   font-size: 16px;
   font-weight: 600;
}

.hg-join-offer-price {
   font-size: 15px;
}

.hg-join-summary {
   padding: 12px 14px;
   border: 1px solid var(--hg-line);
   border-radius: 12px;
}

.hg-join-summary-row {
   display: flex;
   justify-content: space-between;
   gap: 12px;
   font-size: 14px;
   padding: 2px 0;
}

.hg-join-summary-total {
   font-weight: 600;
   border-top: 1px solid var(--hg-line);
   margin-top: 4px;
   padding-top: 6px;
}

.hg-join-terms {
   display: flex;
   align-items: flex-start;
   gap: 10px;
   font-size: 14px;
   cursor: pointer;
}

.hg-join-terms input {
   margin-top: 3px;
   width: 18px;
   height: 18px;
   flex-shrink: 0;
}

/* ── Customer quote page (/quote, Pages/Quote.cshtml) ─────────────────────────────────────────────── */

.hg-quote-org {
   display: flex;
   align-items: center;
   gap: 10px;
   margin: 12px 0 14px;
   font-size: 14px;
   font-weight: 600;
   color: rgba(255, 255, 255, 0.86);
}

/* On a white chip: an email logo is drawn for a white page, and the hero is deep green. */
.hg-quote-logo {
   display: block;
   max-height: 44px;
   max-width: 160px;
   padding: 6px 10px;
   border-radius: 10px;
   background: var(--hg-white);
   object-fit: contain;
}

.hg-quote-head {
   display: flex;
   align-items: flex-start;
   justify-content: space-between;
   gap: 12px;
}

.hg-quote-number {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 8px;
   margin-top: 2px;
   font-size: 18px;
   font-weight: 600;
}

.hg-quote-totals {
   display: flex;
   flex-direction: column;
   gap: 4px;
   margin-top: 14px;
}

/* Cover letters, terms, descriptions and messages are plain text, as the PDF draws them. */
.hg-quote-text {
   margin: 0;
   white-space: pre-line;
   overflow-wrap: anywhere;
}

.hg-quote-lines {
   list-style: none;
   margin: 0 0 12px;
   padding: 0;
}

.hg-quote-line {
   display: flex;
   align-items: flex-start;
   justify-content: space-between;
   gap: 12px;
   padding: 10px 0;
   border-bottom: 1px solid var(--hg-line);
}

.hg-quote-line:last-child {
   border-bottom: 0;
}

.hg-quote-line-main {
   display: flex;
   flex-direction: column;
   gap: 2px;
   min-width: 0;
}

.hg-quote-line-name {
   font-weight: 600;
}

.hg-quote-decline {
   align-self: center;
   font-size: 14px;
   color: var(--hg-gray);
   text-decoration: underline;
}

.hg-quote-log {
   list-style: none;
   margin: 0;
   padding: 0;
   display: flex;
   flex-direction: column;
   gap: 14px;
}

.hg-quote-log li {
   display: flex;
   flex-direction: column;
   gap: 4px;
}

.hg-quote-log-head {
   display: flex;
   flex-wrap: wrap;
   align-items: baseline;
   justify-content: space-between;
   gap: 4px 12px;
}

.hg-quote-log-reply {
   margin-left: 12px;
   padding-left: 10px;
   border-left: 2px solid var(--hg-line);
}

/* The included agreement (contracting plan, Step 4c): server-rendered HTML from DocxHtmlRenderer, collapsed to its first
   page (quote.js measures the first page break) until "Read the full agreement". A reading copy; the signed PDF is the
   record. */
.hg-quote-agreement {
   position: relative;
   overflow: hidden;
   padding: 4px 2px;
   font-size: 14px;
   line-height: 1.55;
   overflow-wrap: anywhere;
}

.hg-quote-agreement.is-collapsed {
   max-height: 28rem;
}

/* A fade over the cut-off text, so the collapsed copy reads as continuing. */
.hg-quote-agreement.is-collapsed.is-overflowing::after {
   content: "";
   position: absolute;
   left: 0;
   right: 0;
   bottom: 0;
   height: 64px;
   background: linear-gradient(rgba(255, 255, 255, 0), var(--hg-white));
   pointer-events: none;
}

.hg-quote-agreement h2,
.hg-quote-agreement h3 {
   margin: 18px 0 8px;
   font-size: 16px;
}

.hg-quote-agreement h3 {
   font-size: 15px;
}

.hg-quote-agreement p {
   margin: 0 0 10px;
}

.hg-quote-agreement ul,
.hg-quote-agreement ol {
   margin: 0 0 10px;
   padding-left: 22px;
}

.hg-quote-agreement hr {
   margin: 18px 0;
   border: 0;
   border-top: 1px dashed var(--hg-line);
}

/* A SignWell field: where the member signs or fills something in while signing. */
.hg-docx-signing {
   color: var(--hg-gray);
   font-style: italic;
}

.hg-docx-image {
   display: inline-block;
   padding: 2px 8px;
   border: 1px dashed var(--hg-line);
   border-radius: 6px;
   color: var(--hg-gray);
   font-size: 12px;
}

.hg-docx-table {
   width: 100%;
   margin: 0 0 12px;
   border-collapse: collapse;
   font-size: 13px;
}

.hg-docx-table td {
   padding: 6px 8px;
   border: 1px solid var(--hg-line);
   vertical-align: top;
}

.hg-docx-table td > :last-child {
   margin-bottom: 0;
}

/* A wide table scrolls inside the card instead of widening the page on a phone. */
.hg-quote-agreement .hg-docx-table {
   display: block;
   overflow-x: auto;
}

.hg-quote-agreement-actions {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   justify-content: space-between;
   gap: 10px;
}

/* Signing the agreement on the page (contracting plan, Step 5d). */
.hg-quote-signing-status {
   display: flex;
   align-items: center;
   gap: 10px;
}

/* SignWell's embedded signing frame. SignWell sizes its own iframe to fill this box (100% by 100%, with its own border)
   and scrolls the document inside it, so the box sets the height. Hidden until quote.js opens SignWell in it (is-open). */
.hg-quote-signing-frame {
   display: none;
}

.hg-quote-signing-frame.is-open {
   display: block;
   width: 100%;
   height: 78vh;
   min-height: 560px;
}

/* The mail forwarding agreement's SignWell frame (Pages/Portal/ForwardAgreement.cshtml). Same reasoning as the quote's:
   SignWell's iframe is 100% of this box, so the box needs a definite height, and a min-height alone would leave the
   iframe at the browser's 150px default. Alpine's x-show hides it until forward-agreement.js opens SignWell. It breaks
   out of the narrow column the same way .hg-quote-signing-card.is-signing does. */
.hg-forward-agreement-frame {
   align-self: center;
   width: min(1100px, calc(100vw - 32px));
   max-width: none;
   height: 78vh;
   min-height: 560px;
}

/* While SignWell is open, the signing card breaks out of the page's narrow reading column so the agreement is
   legible: up to the 1100px page width, never closer than 16px to the viewport edge. align-self: center on a flex
   item wider than its column overflows evenly on both sides, and nothing above it clips overflow. 100% of the
   viewport less 32px keeps it inside the window on a phone, where the column is already full width. */
.hg-quote-signing-card.is-signing {
   align-self: center;
   width: min(1100px, calc(100vw - 32px));
   max-width: none;
}
