/*
  Styles for prototype-only elements that don't exist in the Angular app,
  plus documented collision workarounds where stripping Angular's scoping
  attributes causes Bulma global rules to leak through.
*/

/* wx-icon custom element (Angular renders this as a component, we use it as a plain element) */
wx-icon { display: inline-flex; align-items: center; justify-content: center; }

/* ===== Collision workarounds ===== */
/* Bulma's .menu-list a sets background-color via HSL variables and shifts it on :hover.
   In the real app, Angular's [_ngcontent-*] scoping gives .logo higher specificity so
   the Bulma background never applies. Without scoping, we need to set it explicitly. */
wx-menu .menu-list a.logo { background-color: var(--bulma-scheme-main); }
wx-menu .menu-list a.logo:hover { background-color: var(--bulma-scheme-main); }

/* Bulma's .icon.is-small (0,2,0) overrides wx-base-widget .is-circle (0,1,1).
   In the real app, Angular scoping gives .is-circle higher specificity. */
wx-base-widget .icon.is-circle { height: 34px; width: 34px; }

/* Extraction converted :host(.is-hoverable) to "wx-icon .is-hoverable" (descendant)
   instead of "wx-icon.is-hoverable" (self). The color rule doesn't apply. */
wx-icon.is-hoverable { color: var(--bulma-text-weak); }
wx-icon.is-hoverable:hover { color: var(--bulma-text-strong); }

/* wx-switch component styles not captured. Bulma's label spacing adds margin-bottom
   to the toggle label. In the real app, Angular scoping prevents this. */
wx-switch label.toggle-switch { margin-bottom: 0; }

/* Bulma's .container sets max-width and margin:auto which leaks into wx-checkbox's
   label (class="is-flex container"). In the real app, Angular scoping prevents this. */
wx-checkbox label.container { max-width: none; margin: 0; }

/* Bulma's .navbar-link padding overrides the component-scoped .button-profile padding.
   In the real app, Angular scoping gives .button-profile higher specificity. */
wx-top-bar .navbar-link.button-profile { padding: 0; border: 2px solid var(--bulma-scheme-main); width: 34px; height: 34px; }

/* Collisions #6/#8/#9: wx-form-field's component rule ":not(:last-child) { margin-bottom: 1.25rem }"
   leaks into nested custom element components. In the real app, Angular's attribute scoping
   prevents the rule from crossing component boundaries. Fix: reset margin on :not(:last-child)
   inside specific sub-components where the leak causes visible spacing issues. */
wx-date-combobox :not(:last-child),
wx-city-search-field :not(:last-child),
wx-select :not(:last-child),
wx-input-select-user :not(:last-child),
wx-user-list-select-item :not(:last-child),
wx-switch :not(:last-child),
wx-checkbox :not(:last-child) { margin-bottom: 0; }

/* Collision #13: wx-form-field :not(:last-child) { margin-bottom: 1.25rem } (0,1,1) leaks into
   wx-checkbox's .checkbox-label div. Higher-specificity reset to ensure it always wins. */
wx-checkbox .checkbox-label { margin-bottom: 0; }

/* Collision #10: wx-form-field.field:not(:last-child) gets margin-bottom from Bulma's
   block-spacing rule (specificity 0,2,0) which overrides the component's 1.25rem (0,0,1).
   In real app, Angular [_nghost] has higher specificity. */
wx-form-field.field:not(:last-child) { margin-bottom: 1.25rem; }

/* Collision #12: Bulma's .label:not(:last-child) { margin-bottom: var(--bulma-label-spacing) }
   (0,2,0) overrides wx-form-field .label { margin-bottom: 0 } (0,1,1).
   In the real app, Angular scoping gives the component rule higher specificity. */
wx-form-field .label:not(:last-child) { margin-bottom: 0; }

/* Collision #11: Bulma's .icon { width: var(--bulma-icon-dimensions) } (0,1,0) overrides
   wx-kadence-space wx-icon { width: 2rem } (0,0,2). In the real app, Angular's attribute
   scoping boosts the component rule. */
wx-kadence-space wx-icon.icon { width: 2rem; height: 2rem; border-radius: 1rem; }

/* profile.component.scss: section + section rule (component-scoped, not in compiled CSS).
   Adds dividers and spacing between right-column sections (Default Kadence, Working hours, Bio, Teams). */
wx-profile section + section {
  border-top: 1px solid var(--bulma-border);
  margin-top: 1.5rem;
  padding-top: 1.5rem;
}

/* profile.component.scss: .media padding/margin for the avatar + name block in the left column. */
wx-profile .media {
  align-items: center;
  padding: 0 0 0.75rem 0;
  margin-bottom: calc(1.5rem - 0.75rem);
}
wx-profile .media .media-left { margin-right: 2rem; }
wx-profile .media .profile-picture { width: 100px; height: 100px; }

/* :host styles not captured by extraction for these components.
   They need flex layout to fill available space. */
wx-surveys-create { display: flex; flex-grow: 1; flex-direction: column; overflow: auto; }
wx-announcement-create-edit { display: flex; flex-grow: 1; flex-direction: column; overflow: auto; }

/* ===== Account Settings notification grid (component-scoped in Angular) ===== */
/* From settings.component.scss — grid layout for notification checkboxes */
.grid-container-2-col {
  display: grid;
  grid-template-columns: 1fr 55px;
  grid-template-rows: 0.5fr;
  grid-column-gap: 0;
  grid-row-gap: 8px;
  grid-auto-flow: dense;
}
.grid-container-3-col {
  display: grid;
  grid-template-columns: 1fr repeat(2, 55px);
  grid-template-rows: 0.5fr;
  grid-column-gap: 0;
  grid-row-gap: 8px;
  grid-auto-flow: dense;
}
.grid-item { display: grid; justify-content: center; }
.grid-title { grid-column: 1 / -1; }

/* ===== Widget Cards (home page) ===== */
.widget-card {
  background: white;
  border-radius: var(--bulma-radius-large);
  box-shadow: 0 1px 15px 0 rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.widget-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--kadence-grey-200);
}
.widget-card-title {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.875rem; font-weight: 600; color: var(--bulma-text-strong);
}
.widget-icon-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 0.875rem;
}

/* ===== Booking List Item (home widget) ===== */
.booking-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 0; border-bottom: 1px solid var(--kadence-grey-200);
}
.booking-item:last-child { border-bottom: none; }
.booking-item-info { display: flex; flex-direction: column; gap: 0.125rem; }
.booking-item-title { font-size: 0.875rem; font-weight: 600; color: var(--bulma-text-strong); }
.booking-item-meta { font-size: 0.75rem; color: var(--bulma-text-weak); }

/* ===== Status Tags ===== */
.status-tag {
  display: inline-flex; align-items: center; padding: 0.25em 0.75em;
  border-radius: 9999px; font-size: 0.75rem; font-weight: 600;
}
.status-tag.is-confirmed { background: var(--kadence-green-100); color: var(--kadence-green-500); }
.status-tag.is-pending { background: var(--kadence-yellow-100); color: var(--kadence-yellow-600); }
.status-tag.is-cancelled { background: var(--kadence-red-100); color: var(--kadence-red-600); }

/* ===== Announcement Item (home widget) ===== */
.announcement-item { padding: 0.75rem 0; border-bottom: 1px solid var(--kadence-grey-200); }
.announcement-item:last-child { border-bottom: none; }
.announcement-item-title { font-size: 0.875rem; font-weight: 600; color: var(--bulma-text-strong); margin-bottom: 0.25rem; }
.announcement-item-date { font-size: 0.75rem; color: var(--bulma-text-weak); margin-bottom: 0.25rem; }
.announcement-item-preview { font-size: 0.75rem; color: var(--kadence-grey-500); }

/* ===== Occupancy Bar (home widget) ===== */
.occupancy-bar { height: 8px; background: var(--kadence-grey-200); border-radius: 4px; overflow: hidden; margin-top: 0.5rem; }
.occupancy-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }

/* ===== Agents (prototype-only feature: agents hub + new joiner agent) ===== */
/* Host elements fill the content area, mirroring wx-surveys-create above. */
wx-agents, wx-new-joiner-agent { display: flex; flex-direction: column; flex-grow: 1; }

/* Agent icon chip — rounded square with a tinted background. Tints reuse the
   Kadence palette vars where available; a couple of decorative ones are literal. */
.agent-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: var(--kadence-blue-100); color: var(--kadence-blue-600);
}
.agent-chip.is-small { width: 36px; height: 36px; border-radius: 10px; }
.agent-chip.is-green  { background: var(--kadence-green-100); color: var(--kadence-green-500); }
.agent-chip.is-purple { background: #efe6fb; color: #7b3fe4; }
.agent-chip.is-orange { background: #fdeadd; color: #e8743b; }
.agent-chip.is-grey   { background: var(--kadence-grey-200); color: var(--kadence-grey-500); }

/* Hub cards — boxes with a hover lift; teasers are dashed + muted. */
.agent-card {
  display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--kadence-grey-300); box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
a.agent-card { color: inherit; }
a.agent-card:hover { border-color: var(--kadence-grey-400); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06); }
.agent-card.is-soon { background: var(--bulma-scheme-main-bis); border-style: dashed; }
.agent-card-spacer { flex-grow: 1; }

/* How-it-works step tile. */
.agent-step { display: flex; flex-direction: column; gap: 0.5rem; height: 100%; }

/* Placement rule rows + the muted fallback row. */
.agent-rule { border: 1px solid var(--kadence-grey-300); border-radius: var(--bulma-radius-large); padding: 0.75rem 1rem; }
.agent-rule + .agent-rule { margin-top: 0.75rem; }
.agent-rule.is-fallback { background: var(--bulma-scheme-main-bis); border-style: dashed; }

/* Activity feed rows; attention rows get a left accent. */
.agent-activity-row { border: 1px solid var(--kadence-grey-300); border-radius: var(--bulma-radius-large); padding: 1rem; }
.agent-activity-row + .agent-activity-row { margin-top: 0.75rem; }
.agent-activity-row.is-attention { border-left: 3px solid var(--kadence-yellow-600); }

/* Notification-preview block inside the run-detail modal. */
.agent-notif { border: 1px solid var(--kadence-grey-300); border-radius: var(--bulma-radius-large); background: var(--bulma-scheme-main-bis); padding: 1rem; }

/* ===== file:// compatibility: override root-relative font paths ===== */
/* production.css and component-styles use url(/assets/...) which fails on file://.
   These @font-face declarations use paths relative to this CSS file's location
   (_shared/css/) and always win because prototype-only.css loads last. */
@font-face {
  font-family: "Font Awesome 6 Pro";
  font-style: normal;
  font-weight: 900;
  font-display: block;
  src: url(../fonts/fontawesome/fa-solid-900.woff2) format("woff2");
}
@font-face {
  font-family: "Font Awesome 6 Pro";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(../fonts/fontawesome/fa-regular-400.woff2) format("woff2");
}
@font-face {
  font-family: "Font Awesome 6 Brands";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(../fonts/fontawesome/fa-brands-400.woff2) format("woff2");
}
@font-face {
  font-family: "Font Awesome Kit";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(../fonts/fontawesome/custom-icons.woff2) format("woff2");
}

/* ===== file:// compatibility: override root-relative background-image paths ===== */
/* component-styles-1.css uses url("/assets/images/logo-powered-by.png") which fails on file://. */
wx-menu .powered-by-kadence-logo { background-image: url(../../assets/images/logo-powered-by.png) !important; }
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
  wx-menu .powered-by-kadence-logo { background-image: url(../../assets/images/logo-powered-by@2x.png) !important; }
}

/* ===== Create-event wizard (wx-create-event) =====
   The create-event component's :host and wizard layout SCSS were not captured by
   the DOM extraction — the same gap documented above for wx-surveys-create. Supply
   the layout the component renders in the real app, using Kadence tokens only. */

/* Host fills the content area (matches the wx-surveys-create fix above). */
wx-create-event { display: flex; flex-direction: column; flex-grow: 1; overflow: auto; }
/* Centre the wizard as a column on wide screens (header, body, action bar aligned). */
wx-create-event > h1.title,
wx-create-event .box.main,
wx-create-event .box-action-bar { max-width: 1080px; margin-left: auto; margin-right: auto; width: 100%; }
/* Comfortable padding inside the wizard card (content was flush to the top). */
wx-create-event .box.main { padding: 2rem; }
wx-create-event section.about .inner { padding-top: 0.25rem; }

/* Form controls inherit the page font (Inter) — native select/input/date controls
   otherwise fall back to the OS font in some browsers, looking inconsistent. */
wx-create-event input, wx-create-event select, wx-create-event textarea,
wx-event-detail input, wx-event-detail select, wx-event-detail textarea,
wx-workplace-events-overview input, wx-workplace-events-overview select, wx-workplace-events-overview textarea,
wx-date-combobox input, wx-date-combobox .date-label { font-family: inherit; }

/* Date combobox: drop the native readonly-input box, and size the trigger like a
   select so date + time fields line up at the same height. */
wx-create-event wx-date-combobox input { border: none; background: transparent; box-shadow: none; }
wx-create-event wx-date-combobox .date-trigger { min-height: 40px; }

/* Softer, lighter field underlines across the event pages (was a dark slate). */
wx-create-event .select select, wx-create-event .input, wx-create-event .textarea, wx-create-event .date-trigger,
wx-event-detail .select select, wx-event-detail .input, wx-event-detail .textarea,
wx-workplace-events-overview .select select, wx-workplace-events-overview .input, wx-workplace-events-overview .textarea {
  border-bottom-color: var(--kadence-grey-300);
}

/* Step sections: only the active one shows (inactive ones get .is-hidden).
   The section must NOT also carry .is-flex — its display:flex !important would
   beat .is-hidden's display:none !important and every step would show at once. */
wx-create-event section.about { display: flex; flex-direction: column; min-width: 0; }
wx-create-event section.about .inner { width: 100%; max-width: 660px; }

/* Left wizard nav: a fixed-width column holding a vertical step list. */
wx-create-event aside.wizard { flex: 0 0 13.5rem; margin-right: 2rem; }
/* Override Bulma's horizontal .tabs styling for the vertical wizard list. */
wx-create-event aside.wizard ol.tabs {
  display: flex; flex-direction: column; align-items: stretch;
  border-bottom: 0; margin: 0; overflow: visible;
}
wx-create-event aside.wizard ol.tabs li { display: block; margin: 0; }
wx-create-event aside.wizard ol.tabs li a {
  display: flex; align-items: center; justify-content: flex-start;
  padding: 0.5rem 0; margin-bottom: 0.75rem;
  border-bottom: 0; color: var(--kadence-grey-500); font-weight: 500;
}
wx-create-event aside.wizard ol.tabs li a:hover { color: var(--bulma-text-strong); background: transparent; }
wx-create-event aside.wizard ol.tabs li.is-active a { color: var(--bulma-text-strong); font-weight: 700; }
wx-create-event aside.wizard ol.tabs li.is-disabled a { color: var(--kadence-grey-350); pointer-events: none; }

/* Mobile step dots (visible only on mobile via .is-hidden-tablet on the row). */
wx-create-event .steps { display: flex; gap: 0.5rem; padding-bottom: 1rem; }
wx-create-event .steps .step-circle {
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--kadence-grey-300); color: #fff; font-size: 0.875rem;
}
wx-create-event .steps .step.is-active .step-circle { background: var(--bulma-primary); }

/* ===== Assets (prototype-only feature: asset-management/) =====
   List + detail pages for the Assets module. Everything here is layout and
   tinting the component library has no pattern for (icon tiles, info tiles,
   the floor-plan drawing, chat bubbles, timeline). Colours are Kadence tokens. */
wx-assets-list, wx-asset-detail { display: flex; flex-direction: column; flex-grow: 1; min-height: 0; }
wx-assets-list .asset-scroll, wx-asset-detail .asset-scroll { flex-grow: 1; overflow-y: auto; min-height: 0; padding: 0 2rem 2rem; }
@media (max-width: 768px) { wx-assets-list .asset-scroll, wx-asset-detail .asset-scroll { padding: 0 1rem 1rem; } }
.asset-scroll .box { box-shadow: none; border: 1px solid var(--kadence-grey-200); margin-bottom: 1rem; }
/* production.css sets .box { margin-bottom: 3.75rem !important } at <=768px (room for the
   mobile action bar). Assets has no bottom bar, so keep section spacing and gridded cards tight. */
@media (max-width: 768px) {
  .asset-scroll .box { margin-bottom: 1rem !important; }
  .asset-scroll .asset-grid > .box { margin-bottom: 0 !important; }
}
.asset-section-title { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 700; color: var(--bulma-text-strong); }

/* Icon tile — rounded square with a tinted background. */
.asset-chip {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 2.25rem; height: 2.25rem; border-radius: var(--bulma-radius-medium);
  background: var(--kadence-grey-200); color: var(--kadence-grey-500);
}
.asset-chip.is-small { width: 1.75rem; height: 1.75rem; border-radius: var(--bulma-radius); font-size: 0.75rem; }
.asset-chip.is-large { width: 4rem; height: 4rem; border-radius: var(--bulma-radius-large); font-size: 1.75rem; }
.asset-chip.is-pink   { background: var(--kadence-pink-100); color: var(--kadence-pink-400); }
.asset-chip.is-green  { background: var(--kadence-green-100); color: var(--kadence-green-500); }
.asset-chip.is-yellow { background: var(--kadence-yellow-100); color: var(--kadence-orange-500); }
.asset-chip.is-red    { background: var(--kadence-red-100); color: var(--kadence-red-600); }
.asset-chip.is-blue   { background: var(--kadence-blue-100); color: var(--kadence-blue-400); }
.asset-chip.is-purple { background: #efe6fb; color: #7b3fe4; }
.asset-chip.is-orange { background: var(--kadence-orange-100); color: var(--kadence-orange-500); }
.asset-chip.is-large.is-blue { border: 1px solid var(--kadence-blue-200); }

/* Tone helpers for icons and values inside tiles and lists. */
.asset-tone-pink { color: var(--kadence-pink-400); }
.asset-tone-green { color: var(--kadence-green-500); }
.asset-tone-yellow { color: var(--kadence-orange-500); }
.asset-tone-red { color: var(--kadence-red-600); }
.asset-tone-blue { color: var(--kadence-blue-400); }
.asset-tone-purple { color: #7b3fe4; }
.asset-tone-orange { color: var(--kadence-orange-600); }
.asset-tone-grey { color: var(--kadence-grey-500); }

/* Info tile — grey label/value block. Tinted variants for maintenance dates. */
.asset-tile { background: var(--kadence-secondary-lighter); border-radius: var(--bulma-radius-medium); padding: 0.625rem 0.75rem; min-width: 0; }
.asset-tile-label { display: flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; color: var(--bulma-text-weak); margin-bottom: 0.25rem; }
.asset-tile-value { font-size: 0.875rem; font-weight: 600; color: var(--bulma-text-strong); overflow-wrap: anywhere; }
.asset-tile.is-centered { text-align: center; padding: 1rem 0.75rem; }
.asset-tile.is-centered .asset-tile-label { justify-content: center; }
.asset-tile.is-centered .asset-tile-value { font-size: 1rem; font-weight: 700; }
.asset-tile.is-warning { background: var(--kadence-yellow-100); }
.asset-tile.is-warning .asset-tile-value { color: var(--kadence-orange-500); }
.asset-tile.is-success { background: var(--kadence-green-100); }
.asset-tile.is-success .asset-tile-value { color: var(--kadence-green-500); }
.asset-tile.is-info { background: var(--kadence-blue-100); }
.asset-tile.is-info .asset-tile-value { color: var(--kadence-blue-400); }
.asset-tile.is-danger { background: var(--kadence-red-100); }
.asset-tile.is-danger .asset-tile-value { color: var(--kadence-red-600); }
.asset-tile.is-orange { background: var(--kadence-orange-100); }
.asset-tile.is-orange .asset-tile-value { color: var(--kadence-orange-600); }
.asset-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
@media (max-width: 768px) { .asset-grid { grid-template-columns: minmax(0, 1fr); } }
.asset-grid.is-kpis { --cols: 4; }
@media (max-width: 1100px) { .asset-grid.is-kpis { --cols: 2; } }
.asset-tile .asset-progress { margin: 0.5rem 0 0.25rem; height: 0.375rem; }

/* Ask Kadence AI panel on the list page. */
.asset-ai-panel {
  border: 1px solid var(--kadence-pink-200); border-radius: var(--bulma-radius-large);
  background: linear-gradient(100deg, var(--kadence-pink-100) 0%, var(--kadence-pink-50) 55%, #f3f0fd 100%);
  padding: 1rem; margin-bottom: 1rem;
}
.asset-ai-answer { background: var(--bulma-scheme-main); border-radius: var(--bulma-radius-medium); padding: 0.75rem 1rem; margin-top: 0.75rem; font-size: 0.8125rem; color: var(--bulma-text); min-height: 3.5rem; }
.asset-ai-answer p + p { margin-top: 0.5rem; }
.asset-pill {
  display: inline-flex; align-items: center; height: 1.75rem; padding: 0 0.75rem;
  border: 1px solid var(--kadence-grey-300); border-radius: var(--bulma-radius-rounded);
  background: var(--bulma-scheme-main); color: var(--kadence-grey-500); font: inherit; font-size: 0.6875rem; font-weight: 500; cursor: pointer;
}
.asset-pill:hover { border-color: var(--kadence-grey-400); color: var(--bulma-text-strong); }
.asset-pill.is-medium { height: 2rem; padding: 0 0.875rem; font-size: 0.75rem; border-radius: var(--bulma-radius); }
.asset-pill.is-active { background: var(--kadence-pink-100); border-color: var(--kadence-pink-200); color: var(--kadence-pink-500); }
.asset-pill:focus-visible, .asset-row-link:focus-visible, .asset-link:focus-visible {
  outline: var(--bulma-focus-width) solid hsl(var(--bulma-focus-h), var(--bulma-focus-s), var(--bulma-focus-l)); outline-offset: 2px;
}

/* Divider lists — alerts, documents, maintenance summary, quick actions. */
.asset-list > * + * { border-top: 1px solid var(--kadence-grey-200); }
.asset-row-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.5rem; margin: 0 -0.5rem; border-radius: var(--bulma-radius); color: inherit; }
a.asset-row-link:hover { background: var(--kadence-table-hover); color: inherit; }
.asset-row-link .asset-row-chevron { visibility: hidden; color: var(--kadence-grey-400); }
a.asset-row-link:hover .asset-row-chevron, a.asset-row-link:focus-visible .asset-row-chevron { visibility: visible; }
.asset-link { display: flex; align-items: center; gap: 0.625rem; width: 100%; padding: 0.5rem 0; background: none; border: 0; font: inherit; font-size: 0.8125rem; font-weight: 500; cursor: pointer; text-align: left; }
.asset-link:hover { text-decoration: underline; }
.asset-link:disabled { opacity: 0.45; cursor: not-allowed; text-decoration: none; }

/* Asset table + pagination footer. */
.asset-table td { vertical-align: middle; }
.asset-table tbody tr { cursor: pointer; }
.asset-pagination-bar { flex-shrink: 0; margin: 0 2rem 1rem; border: 1px solid var(--kadence-grey-200); border-radius: var(--bulma-radius-large); background: var(--bulma-scheme-main); }
@media (max-width: 768px) { .asset-pagination-bar { margin: 0 1rem 1rem; } }

/* Detail layout — main column + sticky right rail; rail stacks below 1100px. */
.asset-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 18.5rem; gap: 1.25rem; align-items: start; }
.asset-rail { position: sticky; top: 0; }
@media (max-width: 1100px) { .asset-detail-grid { grid-template-columns: minmax(0, 1fr); } .asset-rail { position: static; } }
.asset-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.75rem; color: var(--bulma-text-weak); }
.asset-meta span { display: inline-flex; align-items: center; gap: 0.25rem; }
.asset-tabs.tabs a { padding: 0.5rem 0.75rem; }

/* Floor plan — Head Office plan from ref/asset-floorplan.svg (baked into
   assets-floorplan.js). Spaces keep the plan's own grey; spaces holding
   assets get a blue marker, this asset's space turns pink with a pulse. */
.asset-plan { position: relative; border: 1px solid var(--kadence-grey-200); border-radius: var(--bulma-radius-medium); overflow: hidden; background: var(--bulma-scheme-main); height: 22rem; }
.asset-plan.is-large { height: min(64vh, 40rem); }
.asset-plan > svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; }
.asset-plan.is-panning > svg { cursor: grabbing; }
.asset-plan [id^="space::"] { transition: opacity 0.15s ease; }
.asset-plan [id^="space::"].is-occupied rect, .asset-plan [id^="space::"].is-occupied path, .asset-plan [id^="space::"].is-occupied ellipse { fill: var(--kadence-blue-100); }
.asset-plan [id^="space::"].is-hovered rect, .asset-plan [id^="space::"].is-hovered path, .asset-plan [id^="space::"].is-hovered ellipse { fill: var(--kadence-blue-200); }
.asset-plan [id^="space::"].is-current rect, .asset-plan [id^="space::"].is-current path, .asset-plan [id^="space::"].is-current ellipse { fill: var(--kadence-pink-200); }
.asset-plan [id^="space::"].is-picked rect, .asset-plan [id^="space::"].is-picked path, .asset-plan [id^="space::"].is-picked ellipse { fill: var(--kadence-green-300); }
.asset-plan.is-picking [id^="space::"] { cursor: pointer; }
.asset-plan [id^="space::"].is-selected rect, .asset-plan [id^="space::"].is-selected path, .asset-plan [id^="space::"].is-selected ellipse { fill: var(--kadence-blue-300); }
/* Count badges — one per space holding assets; they're the tap targets. */
.asset-plan .plan-badge { cursor: pointer; outline: none; }
.asset-plan .plan-badge circle { fill: var(--kadence-blue-400); stroke: var(--bulma-scheme-main); stroke-width: 4; }
.asset-plan .plan-badge text { fill: var(--bulma-scheme-main); font-size: 22px; font-weight: 700; font-family: inherit; pointer-events: none; }
.asset-plan .plan-badge.is-current circle { fill: var(--kadence-pink-400); }
.asset-plan .plan-badge.is-amenity circle { fill: var(--kadence-orange-500); }
.asset-plan .plan-badge:hover circle { stroke: var(--kadence-grey-600); }
.asset-plan .plan-badge:focus-visible circle { stroke: hsl(var(--bulma-focus-h), var(--bulma-focus-s), var(--bulma-focus-l)); stroke-width: 8; }
/* Space panel — opens over the plan's left edge when a space is clicked. */
.asset-plan-panel {
  position: absolute; z-index: 5; top: 0.75rem; left: 0.75rem; width: min(19rem, calc(100% - 4.5rem)); max-height: calc(100% - 1.5rem); overflow-y: auto;
  background: var(--bulma-scheme-main); border-radius: var(--bulma-radius-large); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); padding: 0.75rem;
}
.asset-plan-panel .asset-row-link { margin: 0; padding: 0.5rem 0.25rem; }
.asset-plan-panel .asset-row-link[aria-current="page"] { background: var(--kadence-pink-50); }
.asset-plan .plan-amenity-hit { fill: transparent; cursor: default; }
.asset-plan.is-picking .plan-amenity-hit { cursor: pointer; }
.asset-plan .plan-current-dot { fill: var(--kadence-pink-400); stroke: var(--bulma-scheme-main); stroke-width: 6; pointer-events: none; }
.asset-plan .plan-pulse { fill: none; stroke: var(--kadence-pink-400); stroke-width: 6; transform-box: fill-box; transform-origin: center; animation: asset-pulse 1.8s ease-out infinite; pointer-events: none; }
.asset-plan .plan-picked-dot { fill: var(--kadence-green-500); stroke: var(--bulma-scheme-main); stroke-width: 6; pointer-events: none; }
@keyframes asset-pulse { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .asset-plan .plan-pulse { animation: none; opacity: 0.4; } }
/* Zoom pill — same treatment as Move Manager's .floor-plan-zoom-controls. */
.asset-plan-zoom {
  position: absolute; bottom: 0.75rem; right: 0.75rem; z-index: 3; display: flex; flex-direction: column;
  background: var(--bulma-scheme-main); border-radius: 999px; border: 1px solid var(--bulma-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); overflow: hidden;
}
.asset-plan-zoom button { width: 2.25rem; height: 2.25rem; border: none; background: transparent; cursor: pointer; color: var(--bulma-text); display: flex; align-items: center; justify-content: center; }
.asset-plan-zoom button + button { border-top: 1px solid var(--bulma-border); }
.asset-plan-zoom button:hover { background: var(--bulma-scheme-main-bis); }
.asset-plan-zoom button:focus-visible { outline: var(--bulma-focus-width) solid hsl(var(--bulma-focus-h), var(--bulma-focus-s), var(--bulma-focus-l)); outline-offset: -3px; }
.asset-plan-card {
  position: absolute; z-index: 4; pointer-events: none; max-width: 16rem;
  background: var(--bulma-scheme-main); border-radius: var(--bulma-radius-large); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0.75rem; font-size: 0.75rem;
}
.asset-plan-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: center; font-size: 0.6875rem; color: var(--bulma-text-weak); margin-top: 0.5rem; }
.asset-plan-legend i { display: inline-block; width: 0.625rem; height: 0.625rem; border-radius: 50%; margin-right: 0.375rem; vertical-align: -1px; }

/* Asset photo (rail). wx-image-upload's file input overlays the drop zone —
   Bulma's .file-input rule that does this in the app isn't in the prototype CSS. */
.asset-photo { position: relative; border-radius: var(--bulma-radius-medium); overflow: hidden; background: var(--kadence-secondary-lighter); }
.asset-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.asset-rail wx-image-upload .drag-drop-image-container, .modal wx-image-upload .drag-drop-image-container { min-height: 9.5rem; text-align: center; }
wx-image-upload .file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
wx-image-upload .drag-drop-image-container:focus-within { outline: var(--bulma-focus-width) solid hsl(var(--bulma-focus-h), var(--bulma-focus-s), var(--bulma-focus-l)); outline-offset: 2px; }
.asset-photo-thumb { width: 5.5rem; flex-shrink: 0; border-radius: var(--bulma-radius); overflow: hidden; background: var(--kadence-secondary-lighter); }
.asset-photo-thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.asset-chip.has-photo { padding: 0; overflow: hidden; background: var(--kadence-secondary-lighter); }
.asset-chip.has-photo img { width: 100%; height: 100%; object-fit: cover; }

/* Relationship cards. */
.asset-rel { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 0.75rem; align-items: center; }
.asset-rel-card { border: 1px solid var(--kadence-grey-200); background: var(--kadence-secondary-lighter); border-radius: var(--bulma-radius-medium); padding: 0.75rem; }
@media (max-width: 768px) { .asset-rel { grid-template-columns: minmax(0, 1fr); } }

/* Timeline. */
.asset-timeline { position: relative; padding-left: 1.5rem; }
.asset-timeline::before { content: ''; position: absolute; left: 0.3125rem; top: 0.375rem; bottom: 0.25rem; width: 2px; background: var(--kadence-grey-200); }
.asset-timeline-item { position: relative; padding-bottom: 1.125rem; }
.asset-timeline-item:last-child { padding-bottom: 0; }
.asset-timeline-dot { position: absolute; left: -1.5rem; top: 0.3125rem; width: 0.75rem; height: 0.75rem; border-radius: 50%; border: 2px solid var(--bulma-scheme-main); background: var(--kadence-grey-400); }
.asset-timeline-dot.is-warning { background: var(--kadence-orange-500); }
.asset-timeline-dot.is-success { background: var(--kadence-green-400); }
.asset-timeline-dot.is-info { background: var(--kadence-blue-400); }
.asset-timeline-dot.is-primary { background: var(--kadence-pink-400); }
.asset-timeline-dot.is-grey { background: var(--kadence-grey-400); }

/* Work-order and scheduled-job cards. */
.asset-card { border: 1px solid var(--kadence-grey-200); border-radius: var(--bulma-radius-medium); background: var(--bulma-scheme-main); overflow: hidden; transition: opacity 0.3s ease, transform 0.3s ease; }
.asset-card + .asset-card { margin-top: 0.75rem; }
.asset-card.is-highlight { background: var(--kadence-yellow-100); border-color: var(--kadence-yellow-400); }
.asset-card.is-leaving { opacity: 0; transform: translateX(1.5rem); }
.asset-card-body { padding: 0.75rem 1rem; }
.asset-card-activity { background: var(--kadence-secondary-lighter); border-top: 1px solid var(--kadence-grey-200); padding: 0.75rem 1rem; }
.asset-card.is-highlight .asset-card-activity { background: var(--bulma-scheme-main-bis); }
.asset-card-foot { border-top: 1px solid var(--kadence-grey-200); padding: 0.625rem 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.asset-card.is-highlight .asset-card-foot { background: var(--bulma-scheme-main); }
.asset-eyebrow { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bulma-text-weak); }

/* Rail: Kadence AI chat. */
.asset-chat-thread { height: 16.25rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.625rem; padding-right: 0.25rem; }
.asset-bubble { max-width: 88%; padding: 0.5rem 0.75rem; border-radius: var(--bulma-radius-medium); font-size: 0.75rem; line-height: 1.45; color: var(--bulma-text); }
.asset-bubble.is-ai { align-self: flex-start; background: var(--kadence-secondary-lighter); border-bottom-left-radius: 2px; }
.asset-bubble.is-user { align-self: flex-end; background: var(--kadence-pink-100); border-bottom-right-radius: 2px; }
.asset-bubble-time { display: block; margin-top: 0.25rem; font-size: 0.625rem; color: var(--bulma-text-weak); }
.asset-typing { display: inline-flex; gap: 3px; padding: 0.25rem 0; }
.asset-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--kadence-grey-400); animation: asset-typing 1s infinite ease-in-out; }
.asset-typing span:nth-child(2) { animation-delay: 0.15s; }
.asset-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes asset-typing { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.asset-send { width: 2.25rem; height: 2.25rem; padding: 0; flex-shrink: 0; }

/* Asset tag + print. */
.asset-tag-card { background: var(--kadence-secondary-lighter); border-radius: var(--bulma-radius-medium); padding: 1rem; text-align: center; color: var(--bulma-text-strong); }
.asset-tag-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: 0.12em; font-size: 0.875rem; }
#asset-print-slot { display: none; }
@media print {
  @page { margin: 12mm; }
  html, body { height: auto !important; overflow: visible !important; background: white !important; }
  body.is-printing-tag > *:not(#asset-print-slot) { display: none !important; }
  body.is-printing-tag #asset-print-slot { display: block; }
  #asset-print-slot .asset-tag-card { width: 62mm; margin: 0; border: 1px solid #000; background: white; }
}

/* Toast, bottom centre. */
.asset-toast-host { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 0.5rem; align-items: center; pointer-events: none; }
.asset-toast { display: flex; align-items: center; gap: 0.625rem; max-width: 30rem; margin: 0 !important; box-shadow: 0 1px 15px 0 rgba(0, 0, 0, 0.15); pointer-events: auto; animation: asset-toast-in 0.2s ease-out; }
@keyframes asset-toast-in { from { opacity: 0; transform: translateY(0.5rem); } to { opacity: 1; transform: none; } }

/* Import CSV drop zone. */
.asset-dropzone { border: 2px dashed var(--kadence-grey-300); border-radius: var(--bulma-radius-large); padding: 2rem 1rem; text-align: center; background: var(--bulma-scheme-main-bis); cursor: pointer; }
.asset-dropzone.is-dragover { border-color: var(--kadence-pink-300); background: var(--kadence-pink-50); }

/* Assign popover anchored to its button. */
.asset-popover { position: absolute; z-index: 30; margin-top: 0.25rem; min-width: 12rem; background: var(--bulma-scheme-main); border-radius: var(--bulma-radius-large); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12); padding: 0.375rem 0; }
.asset-popover button { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.375rem 0.875rem; background: none; border: 0; font: inherit; font-size: 0.8125rem; text-align: left; cursor: pointer; }
.asset-popover button:hover, .asset-popover button:focus-visible { background: var(--kadence-dropdown-item-hover-bg); outline: none; }
.asset-modal-card { width: 520px; max-width: calc(100vw - 2rem); }

/* ===== Facilities Ops → Mail (prototype-only feature: facilities-ops/mail/) =====
   Reuses the Assets scaffolding (.asset-scroll, .asset-chip, .asset-pill, boxes,
   pagination bar). Adds only what has no pattern: the chain-of-custody timeline,
   the package-label photo and the signature / kiosk-photo tiles. */
wx-mail-list, wx-mail-detail, wx-mail-areas { display: flex; flex-direction: column; flex-grow: 1; min-height: 0; }
wx-mail-list .asset-scroll, wx-mail-detail .asset-scroll, wx-mail-areas .asset-scroll { flex-grow: 1; overflow-y: auto; min-height: 0; padding: 0 2rem 2rem; }
@media (max-width: 768px) { wx-mail-list .asset-scroll, wx-mail-detail .asset-scroll, wx-mail-areas .asset-scroll { padding: 0 1rem 1rem; } }
.mail-eyebrow { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--bulma-text-weak); }
.asset-pill .mail-count { margin-left: 0.375rem; font-weight: 500; opacity: 0.7; }
.mail-aging .message-body { display: flex; align-items: center; gap: 0.75rem; }

/* Chain of custody — icon chips joined by a rail. */
.mail-timeline { position: relative; }
.mail-timeline-item { position: relative; display: flex; gap: 0.875rem; padding-bottom: 1rem; }
.mail-timeline-item:last-child { padding-bottom: 0; }
.mail-timeline-item:not(:last-child)::before { content: ''; position: absolute; left: 0.875rem; top: 2rem; bottom: 0.25rem; width: 2px; background: var(--kadence-grey-200); }
.mail-event-note { background: var(--kadence-secondary-lighter); border-radius: var(--bulma-radius); padding: 0.5rem 0.75rem; margin-top: 0.5rem; font-size: 0.8125rem; color: var(--bulma-text); }

/* Package label — photo of the label as captured by the mailroom phone. */
.mail-label-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 22rem; padding: 2.5rem 1.5rem 3.5rem; background: #1f2633; border-radius: var(--bulma-radius-large); overflow: hidden; }
.mail-label { width: min(28rem, 100%); background: #fbf8ec; color: #1f2633; border-radius: 3px; padding: 0.75rem 1rem 1rem; transform: rotate(-1.5deg); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.75rem; line-height: 1.45; }
.mail-label svg { display: block; width: 100%; height: 2.5rem; margin-bottom: 0.5rem; }
.mail-label-foot { position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.75rem; border-radius: var(--bulma-radius); background: rgba(255, 255, 255, 0.08); color: #d6dbe4; font-size: 0.75rem; }
.mail-label-empty { color: #aab3c2; text-align: center; font-size: 0.8125rem; }

/* Chain-of-custody media tiles. */
.mail-media { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.mail-media-tile { border: 1px solid var(--kadence-grey-200); border-radius: var(--bulma-radius-medium); overflow: hidden; }
.mail-media-tile .mail-eyebrow { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--kadence-grey-200); }
.mail-media-body { height: 8.5rem; display: flex; align-items: center; justify-content: center; gap: 0.375rem; padding: 0.5rem; font-size: 0.75rem; color: var(--bulma-text-weak); text-align: center; }
.mail-media-body svg { width: 100%; height: 100%; }
.mail-media-body.is-photo { background: linear-gradient(135deg, var(--kadence-blue-100), #efe6fb 60%, var(--kadence-pink-100)); color: var(--bulma-text); }

/* Delivery areas — one card per area. */
.mail-area-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); }
.mail-area-card { border: 1px solid var(--kadence-grey-200); border-radius: var(--bulma-radius-large); padding: 1rem; min-width: 0; }
.mail-rule { display: flex; align-items: center; gap: 0.5rem; min-height: 1.75rem; font-size: 0.8125rem; }
.mail-rule > :nth-child(2) { flex-grow: 1; }
.mail-recipient-results { max-height: 15rem; overflow-y: auto; margin-top: 0.25rem; }
.mail-recipient-results button { display: flex; align-items: center; gap: 0.625rem; width: 100%; padding: 0.375rem 0.5rem; background: none; border: 0; border-radius: var(--bulma-radius); font: inherit; text-align: left; cursor: pointer; }
.mail-recipient-results button:hover, .mail-recipient-results button:focus-visible, .mail-recipient-results button.is-active { background: var(--kadence-dropdown-item-hover-bg); outline: none; }

/* Mail KPI cards double as filters. */
.mail-kpi { display: flex; align-items: center; gap: 0.875rem; width: 100%; text-align: left; font: inherit; color: inherit; background: var(--bulma-scheme-main); cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.asset-scroll .mail-kpi:hover { border-color: var(--kadence-grey-400); }
.asset-scroll .mail-kpi.is-active { border-color: var(--kadence-pink-400); box-shadow: 0 0 0 1px var(--kadence-pink-400); }
.mail-kpi:focus-visible { outline: 2px solid var(--kadence-pink-400); outline-offset: 2px; }
.mail-kpi-arrow { color: var(--kadence-grey-400); }
.mail-kpi:hover .mail-kpi-arrow, .mail-kpi.is-active .mail-kpi-arrow { color: var(--kadence-pink-400); }

/* Filter row sits on the KPI grid so its edges line up with the cards. The search
   input drops the wx-form-field margin leak and matches the selects' height and type size. */
.mail-filters { align-items: end; }
.mail-filters .search-bar .input { margin-bottom: 0; height: 2.5rem; font-size: 1rem; }
.mail-filters .search-bar .icon.is-left, .mail-filters .search-bar .icon.is-right { height: 2.5rem; }

/* Pickup panel on the package page — the main mailroom action. */
.mail-pickup-panel { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; border: 1px solid var(--kadence-green-200, var(--kadence-grey-200)) !important; background: var(--kadence-green-100) !important; }
.mail-pickup-panel .buttons { margin-left: auto; }
