/* ============================================================
   Housing Direct — Rails shell additions

   The files alongside this one (portal.css, portal-components.css,
   hdp-v2.css …) are the design bundle, copied verbatim so the app
   stays pixel-identical to the mockups and can be re-synced by
   overwriting them. Anything the running app needs that the static
   mockups didn't lives HERE instead, so a re-sync never loses it.

   Loaded last on every layout, after the design sheets.
   ============================================================ */

/* ── Dropdown menus ─────────────────────────────────────────────
   The design opens .um-drop with :focus-within, which works in
   Chromium and Firefox but not in Safari, where a click does not
   focus a <button>. menu_controller.js toggles .open on the
   .user-menu wrapper as a fallback; this rule makes it visible.
   Both mechanisms coexist — keyboard users still get :focus-within. */
.user-menu.open .um-drop{display:block}

/* ── Turbo progress bar ────────────────────────────────────────── */
.turbo-progress-bar{background:var(--teal,#009fad);height:2px}

/* ── Flash messages ─────────────────────────────────────────────
   Rails `notice` / `alert` render as the design's .notice component
   (portal.css) at the top of <main>. Portal pages get the standard
   .notice; -mint for success, -blush for errors. The .notice-blush
   variant isn't in the bundle so it's defined here in the same idiom. */
.flash-stack{display:flex;flex-direction:column;gap:10px;margin-bottom:22px}
.flash-stack .notice{margin-bottom:0}
.flash-stack .notice i{font-size:14px;margin-top:2px}
.notice-blush{background:var(--tint-blush,#fbeae8);color:#a1443a}
.notice-blush .notice-title{color:#7f2f26}

/* ── Impersonation banner ──────────────────────────────────────
   Platform staff "acting as" a user. Sits above the header, full
   width, unmistakable. Uses the sand tint so it reads as a warning
   without clashing with the teal chrome. */
.impersonation-bar{background:#fbf0d3;border-bottom:1px solid #e7cf8a;color:#6b4d05;font-size:13.5px}
.impersonation-bar-in{max-width:1200px;margin:0 auto;padding:9px 32px;display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.impersonation-bar-in.wide{max-width:1600px;padding:9px 24px}
.impersonation-bar strong{font-weight:700}
.impersonation-bar .grow{flex:1;min-width:200px}
.impersonation-bar form{margin:0}
.impersonation-bar .btn{padding:6px 12px;font-size:12.5px;background:#fff;border:1px solid #e7cf8a;color:#6b4d05;border-radius:9px;font-weight:600;cursor:pointer;font-family:inherit}
.impersonation-bar .btn:hover{background:#fff7e0}
@media(max-width:640px){.impersonation-bar-in{padding:9px 18px}}

/* ── Platform user menu ────────────────────────────────────────
   The platform mockups draw the bell and user chip as plain buttons
   with no dropdown. The running console needs "Sign out" etc., so the
   portal's .um-drop / .nm-drop menus are reused here. Rules mirror
   portal.css but read the hdp-v2 token names. */
.topnav .user-menu{position:relative}
.topnav .um-drop{display:none;position:absolute;right:0;top:calc(100% + 10px);width:280px;background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 24px 54px -22px rgba(20,27,36,.35);padding:8px;z-index:60;text-align:left}
.topnav .user-menu:focus-within .um-drop,.topnav .user-menu.open .um-drop{display:block}
.topnav .um-id{display:flex;align-items:center;gap:12px;padding:12px 12px 14px;border-bottom:1px solid var(--line-2,var(--line));margin-bottom:6px}
.topnav .um-id .avatar{width:40px;height:40px;font-size:14px;border-radius:50%;display:grid;place-items:center;background:var(--teal-50,#e6f6f8);color:var(--teal-700,#00727d);font-weight:700}
.topnav .um-name{font-size:15px;font-weight:700;color:var(--ink)}
.topnav .um-email{font-size:12.5px;color:var(--ink-3);margin-top:1px}
.topnav .um-item{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:10px;font-size:14px;font-weight:500;color:var(--ink);text-decoration:none}
.topnav .um-item:hover{background:var(--tint-stone,var(--surface-alt))}
.topnav .um-item i{width:16px;text-align:center;color:var(--ink-3);font-size:13px}
.topnav .um-item.out{border-top:1px solid var(--line-2,var(--line));border-radius:0 0 10px 10px;margin-top:6px;padding-top:12px}
.topnav .um-item.out,.topnav .um-item.out i{color:#a1443a}
.topnav .nm-drop{width:372px;padding:0;overflow:hidden}
.topnav .nm-hd{display:flex;align-items:center;justify-content:space-between;padding:13px 18px;border-bottom:1px solid var(--line-2,var(--line));font-size:14px;font-weight:700;color:var(--ink)}
.topnav .nm-hd a{font-size:12.5px;font-weight:600;color:var(--teal-700,#00727d);text-decoration:none}
.topnav .nm-item{display:flex;gap:12px;padding:12px 18px;border-top:1px solid var(--line-2,var(--line));align-items:flex-start;text-decoration:none;color:inherit}
.topnav .nm-hd+.nm-item{border-top:none}
.topnav .nm-item:hover{background:var(--tint-stone,var(--surface-alt))}
.topnav .nm-item .ic{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;font-size:13px;flex-shrink:0}
.topnav .nm-item .ic.booking{background:var(--teal-50,#e6f6f8);color:var(--teal-700,#00727d)}
.topnav .nm-item .ic.msg{background:#e7edf3;color:#31506b}
.topnav .nm-item .ic.comp{background:var(--tint-sand,#fbf5e9);color:#966f11}
.topnav .nm-item .ic.team{background:var(--tint-mint,#eef8f2);color:#2b7d55}
.topnav .nm-item .grow{flex:1;min-width:0}
.topnav .nm-t{display:block;font-size:13.5px;font-weight:600;line-height:1.35;color:var(--ink)}
.topnav .nm-item.unread .nm-t::after{content:'';display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--teal);margin-left:7px;vertical-align:1px}
.topnav .nm-s{display:block;font-size:12.5px;color:var(--ink-3);margin-top:1px;line-height:1.4;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.topnav .nm-w{font-size:11px;color:var(--ink-4);white-space:nowrap;padding-top:2px}
.topnav .nm-ft{border-top:1px solid var(--line-2,var(--line))}
.topnav .nm-ft a{display:block;text-align:center;padding:11px;font-size:13px;font-weight:600;color:var(--teal-700,#00727d);text-decoration:none}
.topnav .nm-ft a:hover{background:var(--tint-stone,var(--surface-alt))}
.topnav .icon-btn .dot{position:absolute;top:-6px;right:-6px;min-width:18px;height:18px;padding:0 4px;border-radius:999px;background:#c4574c;color:#fff;font-size:10px;font-weight:700;display:grid;place-items:center;box-shadow:0 0 0 2px #fff;font-variant-numeric:tabular-nums}
.topnav .icon-btn{position:relative}

/* ── Shared ─────────────────────────────────────────────────────
   Empty state inside either notifications menu. */
.nm-empty{padding:26px 18px;text-align:center;font-size:13px;color:var(--ink-3)}

/* Hide the count badge when there's nothing to count (the bell's
   .dot and the platform nav's .nav-badge are both rendered server-side
   and updated live by notifications_controller.js). */
.dot[hidden],.nav-badge[hidden]{display:none!important}

/* A form that must render inline as a menu item (Sign out is a DELETE). */
.um-drop form{margin:0}
.um-drop button.um-item{width:100%;background:none;border:0;font-family:inherit;text-align:left;cursor:pointer}
.um-item.out{width:100%}

/* Mobile drawer also lists the user-menu links, so a phone user can
   reach settings and sign out without a hover menu. */
.mobile-nav .mn-sep{height:1px;background:var(--line-2,var(--line));margin:6px 0}

/* ── Transition only ────────────────────────────────────────────
   Views not yet ported (no `hd_page` call) render inside this wrapper
   so they keep the 1600px column and side padding their Tailwind
   markup was written for. Delete with the legacy Tailwind bundle. */
.legacy-wrap{max-width:1600px;margin:0 auto;padding:0 16px}
@media(min-width:768px){.legacy-wrap{padding:0 24px}}
@media(min-width:1024px){.legacy-wrap{padding:0 32px}}
.legacy-wrap .flash-stack{margin-top:-10px}

/* "Mark all as read" in the bell header — a <button>, styled as the
   design's .nm-hd link. */
.nm-mark-all{background:none;border:0;padding:0;font-family:inherit;font-size:12.5px;font-weight:600;color:var(--teal-700,#00727d);cursor:pointer}
.nm-mark-all:hover{text-decoration:underline}

/* ── Auth pages ─────────────────────────────────────────────────
   The design scopes .form-alert to body.p-signup; the sign-in, 2FA and
   reset cards need the same inline error, so it's unscoped here with
   the same declarations. */
.form-alert{display:flex;gap:11px;align-items:flex-start;padding:13px 15px;border-radius:12px;background:var(--tint-blush);border:1px solid #f2d3ce;color:#8f3a31;font-size:13px;line-height:1.45;margin-bottom:20px}
.form-alert i{margin-top:1px;font-size:14px}
.form-alert a{color:inherit;text-decoration:underline}
.login-card .notice{margin-bottom:20px}
/* Backup-code field: monospace, per the mockup's inline style. */
.inp input.code{font-family:ui-monospace,Menlo,monospace;letter-spacing:.08em}
/* Rails renders f.submit as <input>; the design's .btn is written for
   <button>, and inputs don't inherit font-family or line-height. */
input.btn{font-family:inherit;line-height:1}
/* Show/hide-password button inside .inp — scoped to signup in the design,
   reused on the sign-in card. */
.inp .affix-btn{background:none;border:none;color:var(--ink-4);cursor:pointer;font-size:15px;padding:4px}
.inp .affix-btn:hover{color:var(--ink-2)}
/* Inline button_to (e.g. "Sign out" inside a sentence). */
.inline-form{display:inline}
.inline-form button.btn-link{background:none;border:0;padding:0;font:inherit;color:var(--teal-700);cursor:pointer;font-weight:600}
.inline-form button.btn-link:hover{text-decoration:underline}
/* button_to wrappers on the account switcher: the form must not break
   the .acct button's block layout. */
.acct-form{display:block}
.acct-form .acct{width:100%;text-align:left;font-family:inherit}

/* ── Modal (design .omask/.omodal) ──────────────────────────────
   The design scopes .omodal and .om-bd to the pages that draw them;
   the app uses the same modal everywhere, so the declarations are
   repeated unscoped here. Opened/closed by modal_controller.js. */
.omodal{background:#fff;border-radius:18px;width:100%;max-width:520px;box-shadow:0 30px 70px -30px rgba(15,22,28,.55);display:flex;flex-direction:column;max-height:88vh}
.om-bd{padding:18px 24px 22px;overflow-y:auto}
.om-bd .sfld:last-child{margin-bottom:0}
.om-ft form{margin:0}
body.modal-open{overflow:hidden}
/* Real QR code inside the design's .qr frame (the mockup paints a
   placeholder pattern as the background). */
.qr.has-svg{background:#fff;padding:10px}
.qr.has-svg svg{width:100%;height:100%;display:block}
/* Copy-to-clipboard feedback */
[data-copied="true"]{color:#2b7d55}

/* Listing-row flag tone for "in discussion with council" (design only ships warn/err). */
.lr-flag.info{color:var(--teal-700)}

/* shared/_logo inside the design's .logo-cur box */
.logo-cur img,.logo-cur .la-crest-img{width:64px;height:64px;border-radius:14px;object-fit:cover;display:block}

/* Inbox compose: a textarea in the design's .msg-input (which styles <input>). */
.msg-input textarea{flex:1;border:none;outline:none;font-family:inherit;font-size:13.5px;background:transparent;line-height:1.45;padding:7px 0;resize:none;min-height:34px;max-height:220px;overflow-y:hidden;field-sizing:content}
.msg-input{align-items:flex-end}
.msg-input .btn.is-disabled,.msg-input .btn:disabled{opacity:.45;cursor:not-allowed}
.msg-input .btn{flex:none}
.conv-foot .msg-input{margin-bottom:0}
.inbox .thread{display:flex}

/* Two-pane lists: rows fill the card edge-to-edge so a selected row's
   tint reaches the rounded corners (no white strip above/below). */
.grid-detail > .card > .brow:first-child{border-top:none;border-radius:16px 16px 0 0}
.grid-detail > .card > .brow:last-child{border-radius:0 0 16px 16px}
.grid-detail > .card > .brow:only-child{border-radius:16px}

/* ── Platform nav groups ────────────────────────────────────────
   Twelve flat items didn't fit the bar, so related pages are grouped
   behind four dropdowns (see NavigationHelper#build_nav_links). Opens
   on click via menu_controller, with :focus-within for keyboards. */
.topnav-group{position:relative;flex:none}
.topnav-group>button{font-family:inherit;cursor:pointer;display:inline-flex;align-items:center}
.topnav .nav-drop{display:none;position:absolute;left:0;top:calc(100% + 8px);width:290px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 24px 54px -22px rgba(20,27,36,.35);padding:7px;z-index:60;text-align:left}
.topnav-group:focus-within .nav-drop,.topnav-group.open .nav-drop{display:block}
.nav-drop-item{display:flex;gap:10px;padding:9px 11px;border-radius:9px;text-decoration:none;color:var(--ink)}
.nav-drop-item:hover{background:var(--tint-stone,#f4f5f6)}
.nav-drop-item.on{background:var(--teal-50);color:var(--teal-700)}
.nav-drop-item .grow{flex:1;min-width:0}
.nd-label{display:block;font-size:13.5px;font-weight:600;line-height:1.3}
.nd-hint{display:block;font-size:12px;color:var(--ink-3);margin-top:2px;line-height:1.35}
.nav-drop-item.on .nd-hint{color:var(--teal-700);opacity:.75}
.nd-label .nav-badge{margin-left:7px}
.mobile-nav .mn-group-label{font-size:11px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-4);padding:12px 12px 4px}

/* The design set `overflow-x:auto` on .topnav-items so twelve nav items
   could scroll. That clips absolutely-positioned children, so the group
   dropdowns opened invisibly. With five items there's nothing to scroll,
   so the clipping is removed; items wrap-free and shrink instead. */
.topnav--platform .topnav-items{overflow:visible;gap:2px;flex:0 1 auto;justify-content:center}
.topnav--platform .topnav-item{padding:8px 11px;font-size:13px}
/* Centre the nav in the bar: brand and the right-hand cluster take equal
   flexible space either side, so the five items sit on the bar's midpoint
   regardless of how wide either end is. Mirrors the portal header, where
   the design centres .nav absolutely. */
.topnav--platform .topnav-bar{gap:16px}
.topnav--platform .topnav-bar>.brand{flex:1 1 0;min-width:0}
.topnav--platform .topnav-right{flex:1 1 0;justify-content:flex-end}
@media(max-width:1023px){.topnav--platform .topnav-bar>.brand,.topnav--platform .topnav-right{flex:0 0 auto}}

/* Compliance document dots: the design ships .ok and .warn only, but a
   council can also be looking at an expired or never-supplied
   certificate, so those two states are defined here in the same idiom. */
:where(body.p-la-compliance) .doc-dot.bad{background:var(--tint-blush);color:#a1443a}
:where(body.p-la-compliance) .doc-dot.none{background:var(--tint-stone);color:var(--ink-4)}

/* ── Platform detail headers (transition) ───────────────────────
   Platform show pages still use the previous header markup
   (.page-back / .page-eyebrow / .page-title / .entity-tags), whose
   rules lived in a stylesheet the platform shell doesn't load. These
   map that markup onto the design's header: ONE eyebrow line reading
   "← USERS · PLATFORM USER", then the title, then the meta as plain
   text — same as every portal detail page. Rebuilt properly in the
   platform phase. */
.hdp-app .page-back,
.hdp-app .page-eyebrow{display:inline;font-size:12px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;line-height:1.6;margin:0}
.hdp-app .page-back{color:var(--teal-700);text-decoration:none}
.hdp-app .page-back:hover{text-decoration:underline}
.hdp-app .page-eyebrow{color:var(--ink-3)}
.hdp-app .page-back + .page-eyebrow::before{content:"·";margin:0 8px;color:var(--ink-4)}
.hdp-app .page-title{font-size:32px;font-weight:700;letter-spacing:-.02em;line-height:1.15;margin:6px 0 6px}
.hdp-app .page-sub,.hdp-app .page-subtitle{font-size:14px;color:var(--ink-3);line-height:1.5;margin:0}

/* Meta row: plain dot-separated text, not chips. */
.hdp-app .entity-tags{display:flex;align-items:center;gap:0;flex-wrap:wrap;margin-top:4px;font-size:13.5px;color:var(--ink-3)}
.hdp-app .entity-tags > *{margin:0}
.hdp-app .entity-tags > * + *::before{content:"·";margin:0 9px;color:var(--ink-4)}
.hdp-app .entity-tags .crest-sm{display:inline-flex;align-items:center;gap:7px;background:none;border:none;padding:0;font-family:ui-monospace,Menlo,monospace;font-size:12.5px;color:var(--ink-3)}
.hdp-app .entity-tags .crest-sm .mk{width:22px;height:22px;border-radius:6px;background:var(--teal-50);color:var(--teal-700);display:grid;place-items:center;font-size:10px;font-weight:700;font-family:var(--font-sans)}
.hdp-app .entity-tags .pill{font-size:12px}

/* ── Row action menus (team lists) ──────────────────────────────
   .um-drop is sized for the header account menu (280px, roomy rows).
   Inside a .t-row it reads as an oversized panel that escapes the
   card, so row menus get a compact variant anchored to the trigger. */
.t-row .user-menu{position:relative}
.t-row .um-drop{width:auto;min-width:196px;max-width:240px;right:0;left:auto;top:calc(100% + 6px);padding:6px;border-radius:12px;z-index:40}
.t-row .um-item{font-size:13.5px;padding:8px 10px;border-radius:8px;white-space:nowrap}
.t-row .um-item i{font-size:12px;width:14px}
.t-row .um-item.out{margin-top:4px;padding-top:9px;border-radius:0 0 8px 8px}
.t-row .um-form{display:block}
.t-row .um-form button.um-item{width:100%;font-family:inherit;font-size:13.5px}
/* Last rows in a card would otherwise clip the menu against the card edge. */
.t-row:nth-last-child(-n+2) .um-drop{top:auto;bottom:calc(100% + 6px)}
.t-menu{width:32px;height:32px;border-radius:9px;border:1px solid var(--line);background:#fff;color:var(--ink-3);cursor:pointer;display:grid;place-items:center;font-size:13px}
.t-menu:hover{background:var(--tint-stone);color:var(--ink)}
.user-menu.open .t-menu{border-color:var(--teal);color:var(--teal-700)}

/* Card footers sit inside the <form>, so the flex row needs declaring on
   the element itself rather than relying on a page-scoped rule. */
.scard-ft{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;padding:14px 24px;border-top:1px solid var(--line-2);background:var(--tint-stone)}
.scard-ft .ft-hint{font-size:12.5px;color:var(--ink-3);flex:1;min-width:160px}
.formfoot{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;padding:16px 24px;border-top:1px solid var(--line-2)}
/* Native file inputs inside a drop-style label shouldn't look like a button bar. */
.sfld input[type=file]{font-size:12.5px;color:var(--ink-3)}

/* Booking request form: Rails form wrappers mapped to the design's layout. */
.bk-grid{display:grid;grid-template-columns:1fr 340px;gap:20px;align-items:start}
@media(max-width:1080px){.bk-grid{grid-template-columns:1fr}}
.bk-main{min-width:0}
.stepno{font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--teal-700)}
.sfld-label{display:block;font-size:13px;font-weight:600;margin-bottom:6px;color:var(--ink-2)}
.sfld-label .req{color:#c4574c}
.sfld-label .opt{font-weight:400;color:var(--ink-4)}
.rail-ll{display:flex;align-items:center;gap:12px;padding:0 24px 20px}
.kv.tot{border-top:1px solid var(--line-2);margin-top:6px;padding-top:10px;font-weight:700}

/* Platform dashboard: the mockup sets these two grids inline. */
.hdp-app .dash-2col{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:20px}
.hdp-app .dash-2col.wide-left{grid-template-columns:1.35fr 1fr}
@media(max-width:1100px){.hdp-app .dash-2col,.hdp-app .dash-2col.wide-left{grid-template-columns:1fr}}
.hdp-app .q-empty{padding:30px 22px;text-align:center;font-size:13.5px;color:var(--ink-3)}
.hdp-app img.q-thumb{width:46px;height:46px;border-radius:9px;object-fit:cover;flex:none}

/* ── Platform column width ──────────────────────────────────────
   The design gave the staff console a 1600px column and the portals
   1200px. Two widths in one product reads as a bug, so the console
   now matches the portal. Wide tables scroll inside their card
   (.table-scroll / overflow-x on the card) rather than widening the
   page. */
.hdp-app .page{max-width:1200px;padding-left:32px;padding-right:32px}
/* The header bar has to be constrained separately: the bar itself is
   full-bleed (so its bottom border spans the window, like the portal
   header) while its contents sit in the same 1200px column as the page.
   Without this the nav floats out past the content on wide screens. */
.topnav--platform .topnav-bar{max-width:1200px;margin:0 auto;padding-left:32px;padding-right:32px}
.topnav--platform .mobile-nav{max-width:1200px;margin:0 auto;padding-left:24px;padding-right:24px}
@media(max-width:768px){.topnav--platform .topnav-bar{padding-left:16px;padding-right:16px}}
.impersonation-bar-in.wide{max-width:1200px;padding-left:32px;padding-right:32px}
.site-foot-wide .site-foot-in{max-width:1200px}
@media(max-width:768px){.hdp-app .page{padding-left:16px;padding-right:16px}}
/* Wide data tables (directory listings) keep a minimum width and scroll
   rather than squashing. Tables inside a half-width dashboard card must
   NOT do that — they fit the column and truncate instead, or the card
   grows a scrollbar and clips its last column. */
.hdp-app .main-scroll > .card > .table{min-width:720px}
.hdp-app .main-scroll > .card:has(> .table){overflow-x:auto}
.hdp-app .dash-2col .table{min-width:0;table-layout:fixed;width:100%}
.hdp-app .dash-2col .table td,.hdp-app .dash-2col .table th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Verification history timeline: the platform mockup uses .timeline /
   .tl-item but the bundled platform sheets don't define them. */
.hdp-app .timeline{position:relative;padding-left:20px}
.hdp-app .timeline::before{content:"";position:absolute;left:5px;top:6px;bottom:6px;width:2px;background:var(--line)}
.hdp-app .tl-item{position:relative;padding:0 0 16px}
.hdp-app .tl-item:last-child{padding-bottom:0}
.hdp-app .tl-item::before{content:"";position:absolute;left:-19px;top:5px;width:12px;height:12px;border-radius:50%;background:#fff;border:2px solid var(--line)}
.hdp-app .tl-item.done::before{border-color:var(--ink-4)}
.hdp-app .tl-item.active::before{border-color:var(--teal);background:var(--teal)}
.hdp-app .tl-title{font-size:13.5px;font-weight:600;color:var(--ink)}
.hdp-app .tl-sub{font-size:12.5px;color:var(--ink-3);margin-top:2px}
/* Activity rows: icon + plain-English event, actor underneath, so the
   table reads at a glance instead of as a column of raw action strings. */
.hdp-app .act-table td{vertical-align:top;padding-top:11px;padding-bottom:11px}
.hdp-app .act-line{display:flex;align-items:center;gap:9px;min-width:0}
.hdp-app .act-line .act-ic{width:26px;height:26px;border-radius:8px;display:grid;place-items:center;font-size:11px;flex:none}
.hdp-app .act-what{font-size:13.5px;font-weight:600;color:var(--ink);overflow:hidden;text-overflow:ellipsis}
.hdp-app .act-by{font-size:12px;color:var(--ink-3);margin:2px 0 0 35px}
.hdp-app .act-ic.booking{background:var(--teal-50);color:var(--teal-700)}
.hdp-app .act-ic.compliance{background:var(--tint-sand,#fbf5e9);color:#966f11}
.hdp-app .act-ic.listing{background:#e7edf3;color:#31506b}
.hdp-app .act-ic.system{background:var(--tint-stone,#f4f5f6);color:var(--ink-3)}

/* Notification delivery rail: label + detail on the left, state pill on
   the right. These rows have no equivalent in the mockups. */
.pref-row{display:flex;align-items:center;gap:14px;padding:12px 0;border-top:1px solid var(--line-2)}
.pref-row:first-child{border-top:none}
.pref-row > div:first-child{flex:1;min-width:0}
.pref-row .pk{font-size:13.5px;font-weight:600;color:var(--ink)}
.pref-row .ps{font-size:12.5px;color:var(--ink-3);margin-top:2px;overflow:hidden;text-overflow:ellipsis}
/* Compliance page: flags list beside the lapsed-certificate list. */
.hdp-app .comp-grid{display:grid;grid-template-columns:1.5fr 1fr;gap:18px;margin-top:18px}
@media(max-width:1100px){.hdp-app .comp-grid{grid-template-columns:1fr}}

/* ── Flat placeholders ──────────────────────────────────────────
   The design draws missing images, document previews and queue thumbs
   with diagonal stripes. Replaced with a single flat tint everywhere so
   empty states read as "nothing here", not as a pattern. The tinted
   variants keep their colour, just without the stripes. */
.img-ph,.q-thumb--doc,.doc-tile .dt-preview{background:var(--tint-stone,#f4f5f6)!important;background-image:none!important}
.img-ph--mint{background:var(--tint-mint,#eef8f2)!important;background-image:none!important}
.img-ph--sand{background:var(--tint-sand,#fbf5e9)!important;background-image:none!important}

/* ── Organisation-type colours ──────────────────────────────────
   One flat colour per kind of account (PortalV2Helper#org_tone):
   staff navy · landlord teal · council violet · council housing gold.
   Applied to avatars, marks and the small owner dot. */
.avatar.av-hd,.vmark.av-hd,.t-av.av-hd{background:#2d4059;color:#fff}
.avatar.av-ll,.vmark.av-ll,.t-av.av-ll{background:var(--teal-50,#e6f6f8);color:var(--teal-700,#00727d)}
.avatar.av-la,.vmark.av-la,.t-av.av-la{background:#efeaf7;color:#5b3f8c}
.avatar.av-lah,.vmark.av-lah,.t-av.av-lah{background:#fbf2dc;color:#8a6410}
.avatar.av-muted{background:var(--tint-stone,#f4f5f6);color:var(--ink-4)}
.org-dot{display:inline-block;width:9px;height:9px;border-radius:50%;flex:none;background:var(--line)}
.org-dot.av-hd{background:#2d4059}.org-dot.av-ll{background:var(--teal,#009fad)}
.org-dot.av-la{background:#7a5bb0}.org-dot.av-lah{background:#c8921f}
.owner-cell{display:inline-flex;align-items:center;gap:8px}
/* Key shown under a mixed list. */
.org-key{display:flex;gap:16px;flex-wrap:wrap;font-size:12px;color:var(--ink-3);padding:12px 22px;border-top:1px solid var(--line-2)}
.org-key span{display:inline-flex;align-items:center;gap:6px}

/* Audit log */
.hdp-app .audit-filters{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.hdp-app .audit-filters .select,.hdp-app .audit-filters .input[type=date]{flex:1 1 150px;min-width:0}
.hdp-app .audit-table{table-layout:fixed;width:100%}
.hdp-app .audit-day td{background:var(--tint-stone,#f4f5f6);font-size:11px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-3);padding:8px 20px}
.hdp-app .audit-meta{margin:8px 0 0 35px}
.hdp-app .audit-meta summary{font-size:12px;color:var(--teal-700);cursor:pointer;list-style:none}
.hdp-app .audit-meta summary::-webkit-details-marker{display:none}
.hdp-app .audit-meta summary::before{content:"▸ "}
.hdp-app .audit-meta[open] summary::before{content:"▾ "}
.hdp-app .audit-meta pre{margin:8px 0 0;padding:10px 12px;background:var(--tint-stone,#f4f5f6);border-radius:8px;font-size:11.5px;line-height:1.5;overflow-x:auto;white-space:pre-wrap;word-break:break-word}

/* Stats: placements-per-month bars. */
.hdp-app .stats-bars{display:grid;grid-template-columns:repeat(12,1fr);gap:10px;align-items:end;height:220px;padding:10px 22px 18px}
.hdp-app .sb-col{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;gap:6px;min-width:0}
.hdp-app .sb-bar{width:100%;max-width:44px;background:var(--teal-50,#e6f6f8);border-radius:6px 6px 2px 2px}
.hdp-app .sb-bar.now{background:var(--teal,#009fad)}
.hdp-app .sb-n{font-size:11.5px;font-weight:600;color:var(--ink-3);min-height:14px}
.hdp-app .sb-l{font-size:11px;color:var(--ink-4);white-space:nowrap}

/* Shortlist: "previously placed here" history line on a saved row. */
.sl-history{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--teal-700);background:var(--teal-50);padding:3px 9px;border-radius:999px}
.sl-history i{font-size:10.5px}
.sl-history .btn-link{font-size:12px}

/* Route badges (Nightly / Leasing) — the design's search-card badge
   (.rcard-route in portal-lease.css), used everywhere a property's
   route is shown: dark ink for nightly, teal for leasing, uppercase. */
.route-badges{display:inline-flex;gap:5px;flex-wrap:wrap}
.route-badges.overlay{position:absolute;left:10px;bottom:10px;z-index:2}
.route-badges.overlay.top{top:10px;bottom:auto}
/* Landlord and council-housing listings show the route where the
   property reference used to sit. */
.lr-title .route-badges{margin-left:6px;vertical-align:2px}
.lr-title .route-pill{padding:2px 7px;font-size:10px}
.route-pill{display:inline-flex;align-items:center;gap:5px;padding:4px 9px;border-radius:999px;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#fff;line-height:1.2}
.route-pill i{font-size:10px}
.route-pill.nightly{background:rgba(20,27,36,.78)}
.route-badges.overlay .route-pill.nightly{backdrop-filter:blur(4px)}
.route-pill.lease{background:var(--teal-700,#00727d)}

/* Shortlist third line: route pills + history, one wrapping row. */
.sl-tags{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:6px}

/* Backfills */
.hdp-app .bf-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;padding:4px 22px 22px}
@media(max-width:1000px){.hdp-app .bf-grid{grid-template-columns:repeat(2,1fr)}}
.hdp-app .bf-card{border:1px solid var(--line);border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:6px}
.hdp-app .bf-title{font-size:14px;font-weight:600}
.hdp-app .bf-sub{font-size:12.5px;color:var(--ink-3);line-height:1.45;flex:1;margin-bottom:6px}
.hdp-app .bf-progress{height:10px;border-radius:999px;background:var(--tint-stone,#f4f5f6);overflow:hidden}
.hdp-app .bf-progress span{display:block;height:100%;background:var(--teal,#009fad);border-radius:999px;transition:width .3s}
/* Backfills: job list rows + run progress. */
.hdp-app .bf-ic{width:38px;height:38px;border-radius:10px;display:grid;place-items:center;flex:none;background:var(--teal-50,#e6f6f8);color:var(--teal-700,#00727d);font-size:15px}
.hdp-app .bf-last{font-size:12.5px;color:var(--ink-3);white-space:nowrap}
.hdp-app .bf-progress{height:10px;border-radius:999px;background:var(--tint-stone,#f4f5f6);overflow:hidden}
.hdp-app .bf-progress span{display:block;height:100%;background:var(--teal,#009fad);border-radius:999px;transition:width .3s}

/* Numeric table columns right-align (platform.css only sets tabular
   figures), so headers and values line up. */
.hdp-app .table th.num,.hdp-app .table td.num{text-align:right}

/* Search field: platform.css positions an inline <svg>; the app uses
   Font Awesome <i> icons, so position those the same way. */
.hdp-app .search-field > i{position:absolute;left:12px;color:var(--ink-4);pointer-events:none;font-size:14px}
.hdp-app .search-field .input{width:100%}

/* Card wrapping a search/filter form (form_with ignores a style: option,
   so the card is a real wrapper). */
.hdp-app .search-card{padding:18px 22px;margin-bottom:20px}
.hdp-app .search-row{display:flex;gap:10px;align-items:center}
.hdp-app .search-card .search-field{max-width:none}
.hdp-app .search-hint{font-size:12.5px;color:var(--ink-3);margin-top:10px}

/* LA dashboard: spend chart with pipeline (forecast months split into
   committed + pipeline columns; toggle pills pick the statuses). */
.chart .cc-slot-split .cc-bars{display:flex;align-items:flex-end;gap:3px;height:100%;width:100%}
.chart .cc-slot-split .cc-bars > div{flex:1;height:100%;display:flex;align-items:flex-end}
.chart .cc-slot-split .cc-bars .b{width:100%}
.chart .cc-bar-pipeline{background:var(--teal-50,#e6f6f8)!important;border:1.5px dashed var(--teal,#009fad);border-bottom:none}
.cc-pipeline-strip{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px 24px;border-top:1px solid var(--line-2)}
.cc-pipeline-label{font-size:12px;font-weight:600;color:var(--ink-3);margin-right:4px}
.cc-pipeline-pill{font-size:12px;font-weight:600;padding:4px 11px;border-radius:999px;border:1px solid var(--line);color:var(--ink-3);text-decoration:none}
.cc-pipeline-pill-on{background:var(--teal-50,#e6f6f8);border-color:var(--teal,#009fad);color:var(--teal-700,#00727d)}
.cc-pipeline-reset{font-size:12px;color:var(--teal-700,#00727d);margin-left:4px}
.cc-pipeline-empty-note{font-size:12px;color:var(--ink-4);margin-left:auto}
.ftotals:has(> div:nth-child(4)){grid-template-columns:repeat(4,1fr)}

/* Clickable table rows (whole row opens the record; row_link_controller
   ignores clicks on links, buttons and form controls inside it). */
.hdp-app tr.row-click{cursor:pointer}
.hdp-app tr.row-click:hover td{background:var(--tint-stone,#f7f8f8)}

/* Lease signing process preview (Platform::LeaseSigningPreviewController)
   — a fresh, small component, not built on booking-legacy.css. */
.signing-stepper{display:flex;gap:8px}
.signing-step{flex:1;padding:12px 14px;border:1px solid var(--line,#e5e5e5);border-radius:10px;background:var(--tint-stone,#f7f8f8)}
.signing-step .ix{font-size:11px;font-weight:600;color:var(--ink-4);margin-bottom:4px}
.signing-step .nm{font-size:13px;font-weight:600;color:var(--ink-2)}
.signing-step.now{border-color:var(--teal);background:var(--tint-teal,#eafaf5)}
.signing-step.now .ix{color:var(--teal)}
.signing-step.done{border-color:var(--teal-700,var(--teal));background:var(--tint-teal,#eafaf5)}
.signing-step.done .nm{color:var(--ink-3)}

/* .notice-inline is otherwise only defined in booking-legacy.css; this
   page deliberately doesn't load that stylesheet, so it's redefined
   here rather than pulling in the whole legacy file for one rule. */
.notice-inline{display:flex;gap:10px;padding:12px 14px;background:var(--teal-50,#eafaf5);border:1px solid #b6e8ed;border-radius:var(--r-md,10px);font-size:12.5px;color:var(--teal-700,var(--teal));align-items:flex-start}
.notice-inline strong{display:block;font-weight:500;margin-bottom:2px}
.notice-inline .body{color:var(--ink-2)}
.notice-inline i{flex-shrink:0;margin-top:1px}

/* Spend & forecast chart tooltip (cost-chart-tooltip controller). The
   chart is position:relative, so the tooltip is placed in chart
   coordinates; pointer-events off so it never steals the hover. */
.chart .m[data-action]{cursor:default}
.chart .m[data-action]:hover .b{filter:brightness(.92)}
.cc-tip{position:absolute;z-index:5;min-width:190px;max-width:260px;background:var(--ink);color:#fff;border-radius:12px;padding:10px 12px;font-size:12.5px;line-height:1.45;box-shadow:0 12px 28px -12px rgba(15,22,28,.6);pointer-events:none}
.cc-tip[hidden],.cc-tip [hidden]{display:none}
.cc-tip-month{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-weight:600}
.cc-tip-tag{font-size:10.5px;font-weight:600;letter-spacing:.04em;color:#c9ecf0;background:rgba(255,255,255,.12);padding:2px 7px;border-radius:999px}
.cc-tip-total{font-size:18px;font-weight:700;margin:4px 0 6px;font-variant-numeric:tabular-nums}
.cc-tip-row{display:flex;justify-content:space-between;gap:12px;color:rgba(255,255,255,.75);padding:2px 0}
.cc-tip-row b{color:#fff;font-weight:600;font-variant-numeric:tabular-nums}
.cc-tip-top{border-top:1px solid rgba(255,255,255,.15);margin-top:4px;padding-top:6px}
.cc-tip-top > span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* EPC band tiles on the compliance document card: the rating scale's
   standard colours, matching PortalV2Helper#epc_band_colours. */
.epc-band-a{background:#008054;color:#fff}
.epc-band-b{background:#19b459;color:#fff}
.epc-band-c{background:#8dce46;color:#17202b}
.epc-band-d{background:#ffd500;color:#17202b}
.epc-band-e{background:#fcaa65;color:#17202b}
.epc-band-f{background:#ef8023;color:#fff}
.epc-band-g{background:#e9153b;color:#fff}

/* Uploaded organisation logos (shared/_logo) fill whatever frames them:
   a 30px list avatar, the 64px settings tile or the show-page preview.
   Contain, not cover, so a wordmark isn't cropped. */
.la-crest-img{width:100%;height:100%;object-fit:contain;display:block;background:#fff}
.avatar .la-crest-img{border-radius:50%}
.vmark.has-logo{overflow:hidden;background:#fff;border:1px solid var(--line-2);padding:3px;box-sizing:border-box}
.vmark .la-crest-img{border-radius:6px}

/* Locations list: fixed counts and actions columns so rows align
   whether a row has one button or two. */
.t-row.t-row-loc{grid-template-columns:auto minmax(0,1.4fr) minmax(220px,1fr) 176px}
.t-row.t-row-loc .t-acts{display:flex;gap:6px;justify-content:flex-end}
@media (max-width:820px){.t-row.t-row-loc{grid-template-columns:auto 1fr auto}.t-row.t-row-loc .t-role{grid-column:2}.t-row.t-row-loc .t-acts{grid-column:1/-1;justify-content:flex-start}}

/* Pager rows-per-page control: label and select on one line whatever
   the page's field rules say about labels and selects. */
.pager .pager-per{display:inline-flex!important;align-items:center;gap:6px}
.pager .pager-per label{display:inline!important;margin:0!important;font-size:12px}
.pager .pager-per select{display:inline-block!important;width:auto!important;margin:0!important}

/* ── Shared form fields ─────────────────────────────────────────
   The booking page's modals (cancel, change dates, assign), the offer
   forms and the lease confirmation use .field / .field-label / .input /
   .textarea. The design bundle styles inputs only inside its own
   wrappers (.sfld, .bf-field, the listing-step pages); the base rules
   for these classes live in the Tailwind sheet, which hd_page views
   don't load. These carry zero specificity so every design rule,
   scoped or not, still wins where one exists. */
:where(.field){margin-bottom:14px}
:where(.field-label){display:block;font-size:13px;font-weight:600;color:var(--ink-2);margin-bottom:6px}
:where(.field-label .opt){font-size:11px;font-weight:400;color:var(--ink-4);margin-left:4px}
:where(.field-label .req){color:#c4574c}
:where(.field-hint){font-size:12px;color:var(--ink-4);margin-top:6px}
:where(.input,.textarea){width:100%;font-family:inherit;font-size:14.5px;color:var(--ink);background-color:#fff;border:1px solid var(--line);border-radius:11px;padding:11px 13px;outline:none;transition:border-color .15s,box-shadow .15s}
:where(.input,.textarea)::placeholder{color:var(--ink-4)}
:where(.input,.textarea):focus{border-color:var(--teal);box-shadow:0 0 0 3px var(--teal-50)}
:where(.textarea){resize:vertical;min-height:80px;line-height:1.5}
/* A select beside an input in the same .field row matches its height. */
:where(.field:not(.hdp-app *)) .select{width:100%;font-size:14.5px;color:var(--ink);padding:11px 34px 11px 13px;border-radius:11px}
