/* Hotel CRM — screen-specific rules layered on the host app's colors_and_type.css + kit.css + app.css.
   Nothing here restyles a kit class; it only adds what the CRM needs (inline-edit affordances,
   tag input, repeating groups, density). Every color is a token.

   Ported from the approved `Hotel CRM.dc.html` prototype. Two blocks from the original are gone:

   1. The design-host escape hatch (`html,body{overflow:visible}` + a `#root` display override). Inside
      the design canvas the prototype owned the whole viewport; here it does not. app.css deliberately
      pins `html,body{overflow:hidden}` and kit.css makes `#root` a centering flexbox that the Clerk
      sign-in card depends on — and since this file loads last it would have won the cascade and broken
      both. The section scrolls inside its own container instead (see .hx-scroll below).
   2. The approval/pending rules (.hx-review*, .hx-was, .hx-pending-pill, .hx-pill-pending). Approvals
      were cut from the design; nothing references them, and they were the only hardcoded hexes here.

   The [data-*] selectors below are kept verbatim rather than being flattened into the base rules.
   hotels-section.jsx sets the shipped variant on the section root (data-aff="dashed" data-density="cozy"
   data-layout="two" data-rooms="split" data-create="modal"); the selectors for variants we don't ship
   are unreachable but harmless. Flattening them by hand is selector surgery on a file that is otherwise
   a verbatim port — the failure mode (silently losing a hover affordance or the rooms split grid) is
   much worse than a few dead rules. */

/* ---------- the section's own scroll container ---------- */
/* The host's <main> is `flex:1; min-height:0` with no overflow — every section supplies its own
   scroller (workforce-section.jsx and the boards both do this). */
.hx-scroll { height: 100%; overflow-y: auto; padding: 12px; }

/* ---------- key/value rows inside cards ---------- */
/* The whole row is the edit target — clicking a short right-aligned value was the fiddly part. */
.hx-kv { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 6px; margin: 0 -6px;
  min-height: 34px; border-radius: var(--radius-sm); cursor: text; transition: background .1s ease; }
.hx-kv::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 0; height: 1px; background: var(--kv-line); }
.hx-kv:last-child::after { display: none; }
.hx-kv:hover { background: var(--hover); }
.hx-kv > .hx-k { flex: 0 0 132px; width: 132px; font-size: 10.5px; font-weight: 500; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted-foreground); padding-top: 6px; }
.hx-kv > .hx-v { flex: 1; min-width: 0; display: flex; justify-content: flex-end; }
.hx-kv.static { cursor: default; }
.hx-kv.static::after { display: none; }
.hx-kv.static:hover { background: transparent; }
.hx-kv.stack { flex-direction: column; gap: 6px; }
.hx-kv.stack > .hx-k { flex: none; width: auto; padding-top: 0; }
.hx-kv.stack > .hx-v { justify-content: flex-start; width: 100%; }

/* ---------- inline edit ---------- */
.hx-ed { display: inline-block; max-width: 100%; padding: 3px 6px; margin: -3px -6px;
  border-radius: var(--radius-sm); cursor: text; text-align: right; overflow-wrap: anywhere;
  transition: background .1s ease, box-shadow .1s ease; }
h1.hx-ed, p.hx-ed { line-height: 1.22; overflow-wrap: normal; }
.hx-ed .hx-pencil { color: var(--muted-foreground); opacity: 0; margin-left: 5px; vertical-align: -1px;
  transition: opacity .1s ease; }
.hx-ed:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.hx-empty { font-style: italic; color: var(--muted-foreground); opacity: .8; }

/* The row's own hover fill is the affordance inside cards — an outline on the value as well
   double-draws the same message. Standalone values (the h1, the description) still get one. */
[data-aff="dashed"] h1.hx-ed:hover, [data-aff="dashed"] p.hx-ed:hover {
  background: var(--hover); outline: 1px dashed color-mix(in oklab, var(--muted-foreground) 50%, transparent); outline-offset: 2px; }
[data-aff="filled"] h1.hx-ed:hover, [data-aff="filled"] p.hx-ed:hover { background: var(--hover); }
[data-aff="pencil"] .hx-kv:hover .hx-pencil, [data-aff="pencil"] .hx-ed:hover .hx-pencil { opacity: 1; }
[data-aff="bordered"] .hx-ed { box-shadow: inset 0 0 0 1px var(--kv-line); background: color-mix(in oklab, var(--muted-foreground) 5%, transparent); }
[data-aff="bordered"] .hx-kv:hover .hx-ed { box-shadow: inset 0 0 0 1px var(--muted-foreground); }

/* inline inputs sit flush with the text they replace */
.hx-in { width: 100%; height: 28px; padding: 0 7px; font-size: 13px; font-family: inherit; color: var(--foreground);
  background: var(--card); border: 1px solid var(--ring); border-radius: var(--radius-sm);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--ring) 35%, transparent); outline: none; text-align: right; }
.hx-in.left { text-align: left; }
.hx-in.ta { height: auto; min-height: 0; padding: 3px 6px; margin: 0 -6px; width: calc(100% + 12px);
  font-size: 13.5px; line-height: 1.62; text-align: left; resize: none; overflow: hidden;
  background: transparent; border-color: color-mix(in oklab, var(--ring) 65%, transparent);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--ring) 22%, transparent); }
.hx-in.h1 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; height: 40px; text-align: left; }

/* ---------- tag input ---------- */
.hx-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; width: 100%; min-height: 34px;
  padding: 5px 6px; border: 1px solid var(--input); border-radius: var(--radius-sm); background: transparent;
  box-shadow: var(--shadow-xs); transition: box-shadow .12s, border-color .12s; cursor: text; }
.hx-tags:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 45%, transparent); }
.hx-tags input { flex: 1 1 90px; min-width: 90px; height: 22px; border: none; outline: none; background: transparent;
  color: var(--foreground); font-size: 13px; font-family: inherit; }
.hx-tags input::placeholder { color: color-mix(in oklab, var(--muted-foreground) 88%, transparent); }
.hx-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 4px 0 8px; font-size: 12px;
  border-radius: var(--radius-sm); background: var(--secondary); color: var(--secondary-foreground); white-space: nowrap; }
.hx-chip button { display: inline-flex; align-items: center; border: none; background: none; padding: 0 1px;
  color: var(--muted-foreground); border-radius: 3px; transition: color .1s, background .1s; }
.hx-chip button:hover { color: var(--destructive); background: color-mix(in oklab, var(--destructive) 16%, transparent); }

/* ---------- repeating group ---------- */
.hx-rep { position: relative; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 44px 12px 12px; }
.hx-rep-del { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; display: inline-flex;
  align-items: center; justify-content: center; border: 1px solid transparent; background: none; border-radius: var(--radius-sm);
  color: var(--muted-foreground); transition: color .1s, background .1s, border-color .1s; }
.hx-rep-del:hover { color: var(--destructive); background: color-mix(in oklab, var(--destructive) 12%, transparent);
  border-color: color-mix(in oklab, var(--destructive) 35%, transparent); }
.hx-flabel { display: block; font-size: 10.5px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted-foreground); margin-bottom: 5px; }
.hx-emptybox { border: 1px dashed color-mix(in oklab, var(--muted-foreground) 40%, transparent);
  border-radius: var(--radius-md); padding: 22px 18px; text-align: center; color: var(--muted-foreground); font-size: 13px; }

/* small controls used inside repeaters (kit .input is 36px / 14px — the CRM runs one notch tighter) */
.hx-ctl { width: 100%; height: 32px; padding: 0 9px; font-size: 13px; font-family: inherit; color: var(--foreground);
  background: transparent; border: 1px solid var(--input); border-radius: var(--radius-sm); box-shadow: var(--shadow-xs);
  transition: box-shadow .12s, border-color .12s; }
.hx-ctl:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 45%, transparent); }
.hx-ctl::placeholder { color: var(--muted-foreground); }
textarea.hx-ctl { height: auto; min-height: 62px; padding: 7px 9px; line-height: 1.55; resize: vertical; }
select.hx-ctl { appearance: none; background-image: none; padding-right: 26px; cursor: pointer; }
.hx-selwrap { position: relative; }
.hx-selwrap .hx-selchev { position: absolute; right: 8px; top: 8px; pointer-events: none; color: var(--muted-foreground); }

/* ---------- list table ---------- */
[data-density="compact"] .tbl th { height: 28px; padding: 0 12px; }
[data-density="compact"] .tbl td { padding: 7px 12px; }
.hx-count { font-size: 12px; color: var(--muted-foreground); }
.hx-cardhint { white-space: nowrap; flex: none; }
@media (max-width: 1240px) { .hx-cardhint { display: none; } }
.hx-recent { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; font-size: 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--foreground);
  cursor: pointer; transition: background .1s, border-color .1s; white-space: nowrap; }
.hx-recent:hover { background: var(--hover); border-color: var(--muted-foreground); }

/* ---------- skeleton ---------- */
.hx-skel { border-radius: 4px; background: linear-gradient(90deg,
  color-mix(in oklab, var(--muted-foreground) 14%, transparent) 25%,
  color-mix(in oklab, var(--muted-foreground) 26%, transparent) 37%,
  color-mix(in oklab, var(--muted-foreground) 14%, transparent) 63%);
  background-size: 400% 100%; animation: hx-shimmer 1.4s ease-in-out infinite; }
@keyframes hx-shimmer { from { background-position: 100% 0 } to { background-position: 0 0 } }

/* ---------- create surfaces ---------- */
.hx-rail { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: none; background: none;
  border-radius: var(--radius-sm); font-size: 13px; color: var(--muted-foreground); text-align: left;
  transition: background .1s, color .1s; }
.hx-rail:hover { background: var(--hover); color: var(--foreground); }
.hx-rail.on { background: var(--secondary); color: var(--foreground); font-weight: 500; }
.hx-drawer { animation: hx-slide .22s cubic-bezier(.23, 1, .32, 1); }
@keyframes hx-slide { from { transform: translateX(28px); opacity: .4 } }
.hx-quick { animation: hx-drop .16s ease; }
@keyframes hx-drop { from { opacity: 0; transform: translateY(-4px) } }

/* Chrome repaints autofilled / datalist-picked fields pale blue with black text, which is
   unreadable on the dark canvas and makes a filled field look like a different control than
   its neighbours. Pin fill, text and caret to tokens in both themes. */
.hx-in:-webkit-autofill, .hx-ctl:-webkit-autofill, .hx-tags input:-webkit-autofill, .input:-webkit-autofill,
.hx-in:-webkit-autofill:focus, .hx-ctl:-webkit-autofill:focus, .hx-tags input:-webkit-autofill:focus, .input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--foreground);
  -webkit-box-shadow: 0 0 0 40px var(--card) inset;
  caret-color: var(--foreground);
  transition: background-color 9999s ease-in-out 0s;
}
.hx-tags input:-webkit-autofill, .hx-tags input:-webkit-autofill:focus { -webkit-box-shadow: none; background-color: transparent; }

/* ---------- people list (contacts read row + popup editor) ---------- */
.hx-people { display: flex; flex-direction: column; }
.hx-person { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  padding: 9px 8px; margin: 0 -8px; border: none; border-bottom: 1px solid var(--kv-line); background: none;
  color: var(--foreground); border-radius: var(--radius-sm); transition: background .1s ease; }
.hx-person:last-child { border-bottom: none; }
.hx-person:hover { background: var(--hover); }
.hx-person .hx-person-edit { opacity: 0; color: var(--muted-foreground); flex: none; transition: opacity .1s ease; }
.hx-person:hover .hx-person-edit { opacity: 1; }
.hx-person-name { font-size: 13.5px; font-weight: 500; }
.hx-person-sub { font-size: 12px; color: var(--muted-foreground); }
.hx-dot-sep { color: var(--muted-foreground); opacity: .5; }

.hx-inline-act { font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; padding: 0;
  border: none; background: none; color: var(--foreground); transition: opacity .1s ease; }
.hx-inline-act:hover { opacity: .55; }
.hx-inline-act.muted { color: var(--muted-foreground); font-weight: 500; }

/* Dialog fields read as plain sentence-case labels — the uppercase micro-label is for dense
   card rows, not for a focused form. */
.hx-dlg-plain .hx-flabel { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--muted-foreground); }
.hx-tiptext { font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-align: left; }
/* Contact initials get a per-person tint from the utility palette — the neutral chip
   disappeared into the card in dark mode. */
.hx-av { border: 1px solid transparent; font-weight: 600; }
.hx-av-1 { background: color-mix(in oklab, #3b82f6 22%, transparent); color: #93c5fd; border-color: color-mix(in oklab, #3b82f6 38%, transparent); }
.hx-av-2 { background: color-mix(in oklab, #a855f7 22%, transparent); color: #d8b4fe; border-color: color-mix(in oklab, #a855f7 38%, transparent); }
.hx-av-3 { background: color-mix(in oklab, #0ea5e9 22%, transparent); color: #7dd3fc; border-color: color-mix(in oklab, #0ea5e9 38%, transparent); }
.hx-av-4 { background: color-mix(in oklab, #f59e0b 22%, transparent); color: #fcd34d; border-color: color-mix(in oklab, #f59e0b 38%, transparent); }
.hx-av-5 { background: color-mix(in oklab, #f43f5e 22%, transparent); color: #fda4af; border-color: color-mix(in oklab, #f43f5e 38%, transparent); }
.hx-av-6 { background: color-mix(in oklab, #22c55e 22%, transparent); color: #86efac; border-color: color-mix(in oklab, #22c55e 38%, transparent); }
:root .hx-av-1 { color: #1d4ed8; } :root .hx-av-2 { color: #7e22ce; } :root .hx-av-3 { color: #0369a1; }
:root .hx-av-4 { color: #b45309; } :root .hx-av-5 { color: #be123c; } :root .hx-av-6 { color: #15803d; }
.dark .hx-av-1 { color: #93c5fd; } .dark .hx-av-2 { color: #d8b4fe; } .dark .hx-av-3 { color: #7dd3fc; }
.dark .hx-av-4 { color: #fcd34d; } .dark .hx-av-5 { color: #fda4af; } .dark .hx-av-6 { color: #86efac; }

.hx-pill.hx-pill-static { cursor: default; }
.hx-pill.hx-pill-static:hover { background: var(--secondary); border-color: transparent; color: var(--secondary-foreground); }

/* ---------- pill list (tags / amenities / benefits on the hotel page) ---------- */
.hx-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hx-pill { display: inline-flex; align-items: center; justify-content: center; height: 25px; padding: 0 10px; font-size: 12px;
  border-radius: 999px; background: var(--secondary); color: var(--secondary-foreground);
  border: 1px solid transparent; cursor: pointer; transition: background .1s ease, border-color .1s ease, color .1s ease; }
.hx-pill:hover { background: color-mix(in oklab, var(--destructive) 12%, transparent);
  border-color: color-mix(in oklab, var(--destructive) 45%, transparent); color: var(--destructive); }
.hx-pill:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 45%, transparent); }
.hx-addpill { display: inline-flex; align-items: center; gap: 4px; height: 25px; padding: 0 10px 0 8px; font-size: 12px;
  border-radius: 999px; background: none; color: var(--muted-foreground);
  border: 1px dashed color-mix(in oklab, var(--muted-foreground) 45%, transparent);
  transition: color .1s ease, border-color .1s ease, background .1s ease; }
.hx-addpill:hover { color: var(--foreground); border-color: var(--muted-foreground); background: var(--hover); }
.hx-pillinput { height: 25px; min-width: 150px; padding: 0 11px; font-size: 12px; font-family: inherit;
  color: var(--foreground); background: transparent; border: 1px solid var(--ring); border-radius: 999px;
  outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 40%, transparent); }
.hx-pillinput::placeholder { color: var(--muted-foreground); }
.hx-emptypills { font-size: 12px; color: var(--muted-foreground); font-style: italic; opacity: .8; }

/* required-state markers: quiet before, a check after, loud only when wrong */
.hx-need { font-size: 10.5px; font-weight: 500; letter-spacing: .02em; text-transform: none; color: var(--muted-foreground); opacity: .75; }
.hx-ok { color: #22c55e; display: inline-flex; vertical-align: -2px; }
.hx-errbar { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 9px; font-size: 11.5px;
  border-radius: var(--radius-sm); color: var(--destructive);
  background: color-mix(in oklab, var(--destructive) 12%, transparent);
  border: 1px solid color-mix(in oklab, var(--destructive) 35%, transparent); }
.hx-okbar { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11.5px; color: var(--muted-foreground); }
.hx-okbar .icon { color: #22c55e; }
.hx-note-bad { color: var(--destructive); }
.hx-bad { border-color: var(--destructive) !important; box-shadow: 0 0 0 3px color-mix(in oklab, var(--destructive) 20%, transparent) !important; }
.hx-req { font-size: 10.5px; font-weight: 500; letter-spacing: .04em; color: var(--destructive); text-transform: none; }

/* ---------- detail page layouts (option axis) ---------- */
.hx-grid { display: grid; gap: 12px; align-items: start; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.hx-grid .hx-wide { grid-column: 1 / -1; }
@media (min-width: 1001px) {
  [data-layout="rail"] .hx-grid { grid-template-columns: 336px minmax(0,1fr); }
  [data-layout="rail"] .hx-c-general, [data-layout="rail"] .hx-c-location { grid-column: 1; }
  [data-layout="rail"] .hx-c-tags, [data-layout="rail"] .hx-c-contacts { grid-column: 2; }
  [data-layout="single"] .hx-grid { grid-template-columns: minmax(0, 1000px); }
}
@media (max-width: 1000px) {
  .hx-grid { grid-template-columns: minmax(0,1fr) !important; }
  .hx-grid > * { grid-column: auto !important; }
}

/* ---------- rooms views (option axis) ---------- */
.hx-room { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0,1fr)); }
.hx-room .hx-span { grid-column: 1 / -1; }
.hx-roomsview { display: grid; gap: 12px; grid-template-columns: minmax(0,1fr); align-items: start; }
[data-rooms="split"] .hx-roomsview { grid-template-columns: 276px minmax(0,1fr); }
[data-rooms="split"] .hx-editor .hx-room { grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (max-width: 1000px) {
  [data-rooms="split"] .hx-roomsview { grid-template-columns: minmax(0,1fr); }
  .hx-room { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
.hx-roomrail { display: flex; flex-direction: column; gap: 6px; }
.hx-railcard { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2);
  color: var(--foreground); cursor: pointer; transition: background .1s, border-color .1s; }
.hx-railcard:hover { background: var(--hover); }
.hx-railcard.on { background: var(--hover); border-color: color-mix(in oklab, var(--foreground) 45%, transparent); }
.tbl tbody tr.tbl-data.on td { background: color-mix(in oklab, var(--muted) 70%, transparent); }
.tbl tbody tr.tbl-data.on td:first-child { box-shadow: inset 3px 0 0 var(--primary); }

/* ---------- create surfaces (option axis) ---------- */
.hx-ovl { z-index: 80; background: rgba(0,0,0,.45); }
.hx-panel { width: 760px; max-width: 94vw; max-height: 82vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 24px 60px -20px rgba(0,0,0,.55); }
[data-create="drawer"] .hx-ovl { align-items: stretch; justify-content: flex-end; }
[data-create="drawer"] .hx-panel { width: 640px; max-width: 96vw; max-height: none; height: 100%;
  border-radius: 0; border-right: none; animation: hx-slide .22s cubic-bezier(.23,1,.32,1); }

/* Link colours, SCOPED to this section. The prototype styled every anchor on the page, which was
   harmless inside a design canvas that owned the whole document — here this file loads last, so a
   bare `a` selector would silently restyle links in Trip Views, the boards, Workforce and the Clerk
   sign-in card. That also contradicted this file's own opening promise not to restyle kit classes. */
.hx-scroll a { color: var(--link); text-decoration: none; }
.hx-scroll a:hover { color: var(--link-hover); }

/* ---- Atlas benefits: one sentence per row, not centred pills ---- */
.hx-benefits { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
.hx-benefit-caption { font-size: 11px; color: var(--muted-foreground); margin-bottom: 1px; }
.hx-benefit-caption.stale { color: #d97706; }
.hx-benefit { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px 6px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); text-align: left; font-size: 12.5px; line-height: 1.4; }
.hx-benefit:hover { background: var(--hover); }
.hx-benefit-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hx-benefit-note { font-size: 11.5px; color: var(--muted-foreground); }
.hx-benefit-year { flex: none; font-size: 10.5px; padding: 1px 6px; border-radius: 99px; background: var(--secondary);
  color: var(--muted-foreground); margin-top: 1px; font-variant-numeric: tabular-nums; }
.hx-benefit-year.stale { color: #d97706; }
.hx-benefit-x { flex: none; opacity: 0; border: none; background: none; cursor: pointer; color: var(--muted-foreground); padding: 2px; }
.hx-benefit:hover .hx-benefit-x, .hx-benefit-x:focus-visible { opacity: 1; }
.hx-benefit-add { align-self: flex-start; }
.hx-primary-badge { margin-left: 8px; font-size: 10.5px; padding: 0 6px; vertical-align: 1px; }

/* ---- Brands view (master-detail) ---- */
/* ---- shared Brands-tab pieces, all tokens ---- */
  .bx-num { font-variant-numeric: tabular-nums; }
  .bx-focus:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 45%, transparent); }
  .bx-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  .bx-search { position: relative; flex: 1; min-width: 180px; max-width: 340px; }
  .bx-search .icon { position: absolute; left: 10px; top: 9px; font-size: 14px; color: var(--muted-foreground); }
  .bx-search input { padding-left: 32px; height: 32px; font-size: 13px; }
  .bx-meter { display: inline-block; width: 72px; height: 5px; border-radius: 3px; vertical-align: middle;
    background: color-mix(in oklab, var(--muted-foreground) 22%, transparent); overflow: hidden; flex: none; }
  .bx-meter > span { display: block; height: 100%; background: var(--foreground); opacity: .75; border-radius: 3px; }
  .bx-meter.low > span { background: #f59e0b; opacity: .9; }
  .bx-pct { font-size: 12px; color: var(--muted-foreground); min-width: 32px; text-align: right; }
  .bx-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
  .bx-dots i { width: 8px; height: 8px; border-radius: 2px; background: color-mix(in oklab, var(--muted-foreground) 25%, transparent); }
  .bx-dots i.on { background: var(--foreground); opacity: .7; }
  .bx-cc { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
    border-radius: 4px; background: var(--secondary); color: var(--secondary-foreground); font-family: var(--font-mono); }
  .bx-cc.more { font-family: var(--font-sans); font-weight: 500; letter-spacing: 0; color: var(--muted-foreground); background: transparent;
    border: 1px dashed color-mix(in oklab, var(--muted-foreground) 40%, transparent); }
  .bx-av { width: 30px; height: 30px; border-radius: 8px; font-size: 11px; }
  .bx-tbl td { padding: 8px 12px; font-size: 13px; } .bx-tbl th { height: 30px; padding: 0 12px; }
  .bx-tbl td:first-child, .bx-tbl th:first-child { padding-left: 14px; }
  .bx-tbl td:last-child { white-space: nowrap; }
  .bx-tbl tr.tbl-data:focus-visible { outline: none; } .bx-tbl tr.tbl-data:focus-visible td { background: color-mix(in oklab, var(--muted) 70%, transparent); }
  .bx-tbl tr.tbl-data:focus-visible td:first-child { box-shadow: inset 3px 0 0 var(--ring); }
  .bx-empty { padding: 40px 20px; text-align: center; }
  .bx-empty b { display: block; font-size: 13.5px; font-weight: 500; }
  .bx-empty span { font-size: 12.5px; color: var(--muted-foreground); margin-top: 4px; display: block; }
  .bx-note { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted-foreground); padding: 8px 14px;
    border-top: 1px solid var(--border); background: var(--surface-2); }
  .bx-note .icon { font-size: 13px; }
  .bx-warn { color: #f59e0b; }
  .bx-link { color: var(--link); text-decoration: none; }
  .bx-link:hover { color: var(--link-hover); }
  .bx-sortsel { width: 168px; }

  /* ---- B: master-detail ---- */
  .bx-md { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 12px; align-items: start; }
  .bx-rail { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
  .bx-rail-list { display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 260px); overflow-y: auto; overflow-x: hidden; }
  .bx-rail-item > .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .bx-rail-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; padding: 6px 8px;
    border: 1px solid transparent; background: none; border-radius: var(--radius-sm); text-align: left; color: var(--foreground);
    cursor: pointer; transition: background .1s; }
  .bx-rail-item:hover { background: var(--hover); }
  .bx-rail-item.on { background: var(--secondary); border-color: color-mix(in oklab, var(--foreground) 18%, transparent); }
  .bx-rail-item .nm { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bx-rail-item .sub { font-size: 11.5px; color: var(--muted-foreground); display: flex; align-items: center; gap: 6px; }
  .bx-rail-item .sub .bx-meter { width: 44px; height: 4px; }
  .bx-rail-item .cnt { font-size: 12px; color: var(--muted-foreground); }
  .bx-rail-item.unassigned { margin-top: 6px; border: 1px dashed color-mix(in oklab, var(--muted-foreground) 40%, transparent); }
  .bx-rail-item.unassigned.on { border-style: solid; }
  .bx-rail-sec { font-size: 10.5px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-foreground); padding: 8px 8px 4px; }
  .bx-pane { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
  .bx-pane-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .bx-pane-head h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
  .bx-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .bx-stat { padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); min-width: 0; }
  .bx-stat .k { font-size: 10.5px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-foreground); }
  .bx-stat .v { font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-top: 3px; }
  .bx-stat .v small { font-size: 12px; font-weight: 400; color: var(--muted-foreground); letter-spacing: 0; margin-left: 4px; }
  .bx-assign-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; border: none; border-top: 1px dashed color-mix(in oklab, var(--muted-foreground) 45%, transparent);
    background: none; color: var(--muted-foreground); font-size: 13px; text-align: left; cursor: pointer; transition: background .1s, color .1s; }
  .bx-assign-row:hover { background: var(--hover); color: var(--foreground); }
  .bx-assign { border-top: 1px solid var(--border); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); animation: hx-drop .16s ease; }
  .bx-assign-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; max-height: 260px; overflow-y: auto; background: var(--card); }
  .bx-assign-list label { display: flex; align-items: center; gap: 10px; padding: 7px 10px; font-size: 13px; border-bottom: 1px solid var(--kv-line); cursor: pointer; }
  .bx-assign-list label:last-child { border-bottom: none; }
  .bx-assign-list label:hover { background: var(--hover); }
  .bx-assign-list label .m { font-size: 12px; color: var(--muted-foreground); margin-left: auto; white-space: nowrap; }
  .bx-railsel { display: none; }
  @media (max-width: 900px) {
    .bx-md { grid-template-columns: minmax(0, 1fr); }
    .bx-rail { display: none; }
    .bx-railsel { display: block; }
    .bx-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }

/* A text input backed by a <datalist> (the contact Title field) draws the browser's own ▼ next to our
   chevron icon. Keep the native control as an invisible click target over the chevron instead. */
.hx-selwrap input[list] { position: relative; }
.hx-selwrap input[list]::-webkit-calendar-picker-indicator { position: absolute; top: 0; right: 0; width: 32px; height: 100%;
  padding: 0; margin: 0; opacity: 0; cursor: pointer; }

  